fixed bugs on hspen filtering and AquaMaps ANNs
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-analysis/EcologicalEngine@86746 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
aeb215469a
commit
866d992515
|
@ -1,5 +1,6 @@
|
||||||
package org.gcube.dataanalysis.ecoengine.spatialdistributions;
|
package org.gcube.dataanalysis.ecoengine.spatialdistributions;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.ObjectInputStream;
|
import java.io.ObjectInputStream;
|
||||||
|
@ -20,6 +21,11 @@ public class AquamapsNN extends AquamapsNative{
|
||||||
|
|
||||||
private Neural_Network neuralnet;
|
private Neural_Network neuralnet;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ALG_PROPS[] getProperties() {
|
||||||
|
ALG_PROPS [] p = {ALG_PROPS.SPECIES_VS_CSQUARE_FROM_DATABASE};
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
@ -36,7 +42,8 @@ public class AquamapsNN extends AquamapsNative{
|
||||||
List<StatisticalType> parameters = super.getInputParameters();
|
List<StatisticalType> parameters = super.getInputParameters();
|
||||||
|
|
||||||
PrimitiveType p1 = new PrimitiveType(String.class.getName(), null, PrimitiveTypes.STRING, "SpeciesName","Name of the Species for which the distribution has to be produced","Fis-30189");
|
PrimitiveType p1 = new PrimitiveType(String.class.getName(), null, PrimitiveTypes.STRING, "SpeciesName","Name of the Species for which the distribution has to be produced","Fis-30189");
|
||||||
PrimitiveType p2 = new PrimitiveType(String.class.getName(), null, PrimitiveTypes.STRING, "NeuralNetworkName","The name of the Neural Network","neuralnet_");
|
// PrimitiveType p2 = new PrimitiveType(String.class.getName(), null, PrimitiveTypes.STRING, "NeuralNetworkName","The name of the Neural Network","neuralnet_");
|
||||||
|
PrimitiveType p2 = new PrimitiveType(File.class.getName(), null, PrimitiveTypes.FILE, "NeuralNetworkName","The file containing the Neural Network", "neuralnet_");
|
||||||
ServiceType p3 = new ServiceType(ServiceParameters.USERNAME, "UserName","LDAP username");
|
ServiceType p3 = new ServiceType(ServiceParameters.USERNAME, "UserName","LDAP username");
|
||||||
|
|
||||||
parameters.add(p1);
|
parameters.add(p1);
|
||||||
|
@ -49,8 +56,15 @@ public class AquamapsNN extends AquamapsNative{
|
||||||
@Override
|
@Override
|
||||||
public void init(AlgorithmConfiguration config, SessionFactory dbHibConnection) {
|
public void init(AlgorithmConfiguration config, SessionFactory dbHibConnection) {
|
||||||
super.init(config,dbHibConnection);
|
super.init(config,dbHibConnection);
|
||||||
|
AnalysisLogger.getLogger().debug("Initializing ANNs");
|
||||||
String persistencePath = config.getPersistencePath();
|
String persistencePath = config.getPersistencePath();
|
||||||
String filename = persistencePath + "neuralnetwork_" + config.getParam("SpeciesName") + "_" + config.getParam("UserName")+"_"+config.getParam("NeuralNetworkName").replace(" ", "");
|
// String filename = persistencePath + "neuralnetwork_" + config.getParam("SpeciesName") + "_" + config.getParam("UserName")+"_"+config.getParam("NeuralNetworkName").replace(" ", "");
|
||||||
|
|
||||||
|
String nnname = config.getParam("NeuralNetworkName");
|
||||||
|
AnalysisLogger.getLogger().debug("Init ANN in projection mode with filename: "+nnname);
|
||||||
|
String filename = new File(nnname).getAbsolutePath();
|
||||||
|
AnalysisLogger.getLogger().debug("ANN: using file name: "+filename);
|
||||||
|
if (filename!=null)
|
||||||
neuralnet = loadNN(filename);
|
neuralnet = loadNN(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.gcube.dataanalysis.ecoengine.spatialdistributions;
|
package org.gcube.dataanalysis.ecoengine.spatialdistributions;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.ObjectInputStream;
|
import java.io.ObjectInputStream;
|
||||||
|
@ -41,7 +42,8 @@ public class AquamapsNNSuitable extends AquamapsSuitable{
|
||||||
List<StatisticalType> parameters = super.getInputParameters();
|
List<StatisticalType> parameters = super.getInputParameters();
|
||||||
|
|
||||||
PrimitiveType p1 = new PrimitiveType(String.class.getName(), null, PrimitiveTypes.STRING, "SpeciesName","Name of the Species for which the distribution has to be produced","Fis-30189");
|
PrimitiveType p1 = new PrimitiveType(String.class.getName(), null, PrimitiveTypes.STRING, "SpeciesName","Name of the Species for which the distribution has to be produced","Fis-30189");
|
||||||
PrimitiveType p2 = new PrimitiveType(String.class.getName(), null, PrimitiveTypes.STRING, "NeuralNetworkName","The name of the Neural Network","neuralnet_");
|
// PrimitiveType p2 = new PrimitiveType(String.class.getName(), null, PrimitiveTypes.STRING, "NeuralNetworkName","The name of the Neural Network","neuralnet_");
|
||||||
|
PrimitiveType p2 = new PrimitiveType(File.class.getName(), null, PrimitiveTypes.FILE, "NeuralNetworkName","The file containing the Neural Network", "neuralnet_");
|
||||||
ServiceType p3 = new ServiceType(ServiceParameters.USERNAME, "UserName","LDAP username");
|
ServiceType p3 = new ServiceType(ServiceParameters.USERNAME, "UserName","LDAP username");
|
||||||
|
|
||||||
parameters.add(p1);
|
parameters.add(p1);
|
||||||
|
@ -53,9 +55,16 @@ public class AquamapsNNSuitable extends AquamapsSuitable{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(AlgorithmConfiguration config, SessionFactory dbHibConnection) {
|
public void init(AlgorithmConfiguration config, SessionFactory dbHibConnection) {
|
||||||
|
AnalysisLogger.getLogger().debug("Initializing ANNs");
|
||||||
super.init(config,dbHibConnection);
|
super.init(config,dbHibConnection);
|
||||||
String persistencePath = config.getPersistencePath();
|
String persistencePath = config.getPersistencePath();
|
||||||
String filename = persistencePath + "neuralnetwork_" + config.getParam("SpeciesName") + "_" + config.getParam("UserName")+"_"+config.getParam("NeuralNetworkName").replace(" ", "");
|
|
||||||
|
// String filename = persistencePath + "neuralnetwork_" + config.getParam("SpeciesName") + "_" + config.getParam("UserName")+"_"+config.getParam("NeuralNetworkName").replace(" ", "");
|
||||||
|
String nnname = config.getParam("NeuralNetworkName");
|
||||||
|
AnalysisLogger.getLogger().debug("Init ANN in projection mode with filename: "+nnname);
|
||||||
|
String filename = new File(nnname).getAbsolutePath();
|
||||||
|
AnalysisLogger.getLogger().debug("ANN: using file name: "+filename);
|
||||||
|
if (filename!=null)
|
||||||
neuralnet = loadNN(filename);
|
neuralnet = loadNN(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ public class HspenFilter extends QueryExecutor {
|
||||||
|
|
||||||
finalTableName = config.getParam(finalTable);
|
finalTableName = config.getParam(finalTable);
|
||||||
finalTableLabel = config.getParam(finalTableLabel$);
|
finalTableLabel = config.getParam(finalTableLabel$);
|
||||||
species = config.getParam(speciesCodes).replace(AlgorithmConfiguration.getListSeparator(), ",");
|
species = config.getParam(speciesCodes).replace(AlgorithmConfiguration.getListSeparator(), "','");
|
||||||
|
|
||||||
query = "select * into "+finalTableName+" from hspen where speciesid in ('"+species+"')";
|
query = "select * into "+finalTableName+" from hspen where speciesid in ('"+species+"')";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue