This commit is contained in:
Gianpaolo Coro 2012-09-28 09:08:38 +00:00
parent c75e118b6c
commit 38ef8f8b51
9 changed files with 50 additions and 22 deletions

Binary file not shown.

View File

@ -2,6 +2,7 @@ package org.gcube.dataanalysis.ecoengine.configuration;
public enum ALG_PROPS {
PARALLEL_SPECIES_VS_CSQUARE_FROM_DATABASE,
SPECIES_VS_CSQUARE_FROM_DATABASE,
SPECIES_VS_CSQUARE_REMOTE_FROM_DATABASE,
SPECIES_VS_CSQUARE,

View File

@ -6,6 +6,7 @@ import java.io.ObjectInputStream;
import java.util.List;
import org.gcube.contentmanagement.lexicalmatcher.utils.AnalysisLogger;
import org.gcube.dataanalysis.ecoengine.configuration.ALG_PROPS;
import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration;
import org.gcube.dataanalysis.ecoengine.datatypes.PrimitiveType;
import org.gcube.dataanalysis.ecoengine.datatypes.ServiceType;
@ -18,6 +19,7 @@ import org.hibernate.SessionFactory;
public class AquamapsNN extends AquamapsNative{
private Neural_Network neuralnet;
@Override
public String getName() {

View File

@ -6,6 +6,7 @@ import java.io.ObjectInputStream;
import java.util.List;
import org.gcube.contentmanagement.lexicalmatcher.utils.AnalysisLogger;
import org.gcube.dataanalysis.ecoengine.configuration.ALG_PROPS;
import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration;
import org.gcube.dataanalysis.ecoengine.datatypes.PrimitiveType;
import org.gcube.dataanalysis.ecoengine.datatypes.ServiceType;
@ -19,6 +20,12 @@ public class AquamapsNNSuitable extends AquamapsSuitable{
private Neural_Network neuralnet;
@Override
public ALG_PROPS[] getProperties() {
ALG_PROPS [] p = {ALG_PROPS.SPECIES_VS_CSQUARE_FROM_DATABASE};
return p;
}
@Override
public String getName() {
return "AQUAMAPS_SUITABLE_NEURAL_NETWORK";

View File

@ -3,8 +3,17 @@ package org.gcube.dataanalysis.ecoengine.spatialdistributions;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import org.gcube.dataanalysis.ecoengine.configuration.ALG_PROPS;
public class AquamapsNative extends AquamapsSuitable {
@Override
public ALG_PROPS[] getProperties() {
ALG_PROPS [] p = {ALG_PROPS.SPECIES_VS_CSQUARE_FROM_DATABASE};
return p;
}
@Override
// to overwrite in case of native generation in order to filer on the probabilities types
public Queue<String> filterProbabilitySet(Queue<String> probabiltyRows) {

View File

@ -233,7 +233,7 @@ public class AquamapsSuitable implements SpatialProbabilityDistributionTable{
@Override
public ALG_PROPS[] getProperties() {
// ALG_PROPS [] p = {ALG_PROPS.SPECIES_VS_CSQUARE_FROM_DATABASE, ALG_PROPS.SPECIES_VS_CSQUARE_REMOTE_FROM_DATABASE};
ALG_PROPS [] p = {ALG_PROPS.SPECIES_VS_CSQUARE_FROM_DATABASE};
ALG_PROPS [] p = {ALG_PROPS.PARALLEL_SPECIES_VS_CSQUARE_FROM_DATABASE};
return p;
}

View File

@ -1,5 +1,6 @@
package org.gcube.dataanalysis.ecoengine.spatialdistributions;
import org.gcube.dataanalysis.ecoengine.configuration.ALG_PROPS;
import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration;
import org.hibernate.SessionFactory;
@ -11,6 +12,12 @@ public class AquamapsSuitable2050 extends AquamapsSuitable {
type = "2050";
}
@Override
public ALG_PROPS[] getProperties() {
ALG_PROPS [] p = {ALG_PROPS.SPECIES_VS_CSQUARE_FROM_DATABASE};
return p;
}
@Override
public String getName() {
return "AQUAMAPS_SUITABLE_2050";

View File

@ -42,6 +42,7 @@ public class ExperimentsForLatimeria {
static String randomnative = "randomnative";
static int numberOfPoints = 34;
static String nnname = "neuralname";
static float x1 = 95.346678f;
static float y1 = -9.18887f;
static float x2 = 125.668944f;
@ -104,7 +105,7 @@ public class ExperimentsForLatimeria {
List<Modeler> modelers = null;
System.out.println("*****************************TRAINING NN SUITABLE WITH STATIC ABSENCES**********************************");
modelers = ModelersFactory.getModelers(PresetConfigGenerator.configSuitableNeuralNetworkTraining(presenceTable,absenceStaticTable,staticsuitable,speciesID,"100"+AlgorithmConfiguration.getListSeparator()+"2"));
modelers = ModelersFactory.getModelers(PresetConfigGenerator.configSuitableNeuralNetworkTraining(presenceTable,absenceStaticTable,staticsuitable,speciesID,"100"+AlgorithmConfiguration.getListSeparator()+"2",nnname));
modelers.get(0).init();
Regressor.process(modelers.get(0));
modelers = null;
@ -117,7 +118,7 @@ public class ExperimentsForLatimeria {
*/
System.out.println("*****************************TRAINING NN NATIVE WITH STATIC ABSENCES**********************************");
modelers = ModelersFactory.getModelers(PresetConfigGenerator.configNativeNeuralNetworkTraining(presenceTable,absenceStaticTable,staticnative,speciesID,"100"));
modelers = ModelersFactory.getModelers(PresetConfigGenerator.configNativeNeuralNetworkTraining(presenceTable,absenceStaticTable,staticnative,speciesID,"100",nnname));
modelers.get(0).init();
Regressor.process(modelers.get(0));
modelers = null;
@ -134,7 +135,7 @@ public class ExperimentsForLatimeria {
List<Modeler> modelers = null;
System.out.println("*****************************TRAINING NN SUITABLE WITH STATIC ABSENCES**********************************");
modelers = ModelersFactory.getModelers(PresetConfigGenerator.configSuitableNeuralNetworkTraining(presenceTable,absenceStaticTable,staticsuitable,speciesID,"100"+AlgorithmConfiguration.getListSeparator()+"2"));
modelers = ModelersFactory.getModelers(PresetConfigGenerator.configSuitableNeuralNetworkTraining(presenceTable,absenceStaticTable,staticsuitable,speciesID,"100"+AlgorithmConfiguration.getListSeparator()+"2",nnname));
modelers.get(0).init();
Regressor.process(modelers.get(0));
modelers = null;
@ -144,7 +145,7 @@ public class ExperimentsForLatimeria {
System.out.println("*****************************TRAINING NN NATIVE WITH STATIC ABSENCES**********************************");
List<Modeler> modelers = null;
modelers = ModelersFactory.getModelers(PresetConfigGenerator.configNativeNeuralNetworkTraining(presenceTable,absenceStaticTable,staticnative,speciesID,"100"+AlgorithmConfiguration.getListSeparator()+"2"));
modelers = ModelersFactory.getModelers(PresetConfigGenerator.configNativeNeuralNetworkTraining(presenceTable,absenceStaticTable,staticnative,speciesID,"100"+AlgorithmConfiguration.getListSeparator()+"2",nnname));
modelers.get(0).init();
Regressor.process(modelers.get(0));
modelers = null;
@ -155,7 +156,7 @@ public class ExperimentsForLatimeria {
public static void generateAquamapsNativeSuitableNeuralNetwokrs() throws Exception{
List<Generator> generators = null;
System.out.println("*****************************GENERATING NN SUITABLE WITH STATIC ABSENCES**********************************");
generators = GeneratorsFactory.getGenerators(PresetConfigGenerator.configAquamapsNNSuitable(nnsuitableTable,staticsuitable,envelopeTable,speciesID));
generators = GeneratorsFactory.getGenerators(PresetConfigGenerator.configAquamapsNNSuitable(nnsuitableTable,staticsuitable,envelopeTable,speciesID,nnname));
generators.get(0).init();
Regressor.process(generators.get(0));
generators = null;
@ -169,7 +170,7 @@ public class ExperimentsForLatimeria {
*/
System.out.println("*****************************GENERATING NN NATIVE WITH STATIC ABSENCES**********************************");
generators = GeneratorsFactory.getGenerators(PresetConfigGenerator.configAquamapsNNNative(nnnativeTable,staticnative,envelopeTable,speciesID));
generators = GeneratorsFactory.getGenerators(PresetConfigGenerator.configAquamapsNNNative(nnnativeTable,staticnative,envelopeTable,speciesID,nnname));
generators.get(0).init();
Regressor.process(generators.get(0));
generators = null;
@ -280,17 +281,16 @@ public class ExperimentsForLatimeria {
// generateAbsenceTable();
// generateHCAFFilter();
//train the neural networks on these tables
// trainSuitableNeuralNetworks();
// trainNativeNeuralNetworks();
trainSuitableNeuralNetworks();
trainNativeNeuralNetworks();
//project the neural networks
// generateAquamapsNativeSuitableNeuralNetwokrs();
generateAquamapsNativeSuitableNeuralNetwokrs();
//Analysis
/*
calcdiscrepancy(aquamapsSuitableTable, nnsuitableTable);
calcdiscrepancy(aquamapsNativeTable, nnnativeTable);
/*
calcdiscrepancy(aquamapsSuitableTable, nnsuitableTable);
calcdiscrepancy(aquamapsNativeTable, nnnativeTable);

View File

@ -34,7 +34,7 @@ public class PresetConfigGenerator {
return config;
}
public static AlgorithmConfiguration configAquamapsNNSuitable(String tableName,String username, String envelopeTable, String speciesID) {
public static AlgorithmConfiguration configAquamapsNNSuitable(String tableName,String username, String envelopeTable, String speciesID,String nnname) {
AlgorithmConfiguration config = Regressor.getConfig();
config.setNumberOfResources(5);
@ -46,11 +46,12 @@ public class PresetConfigGenerator {
config.setParam("CreateTable", "true");
config.setParam("SpeciesName", speciesID);
config.setParam("UserName", username);
config.setParam("NeuralNetworkName", nnname);
return config;
}
public static AlgorithmConfiguration configAquamapsNNNative(String tableName,String username, String envelopeTable, String speciesID) {
public static AlgorithmConfiguration configAquamapsNNNative(String tableName,String username, String envelopeTable, String speciesID,String nnname) {
AlgorithmConfiguration config = Regressor.getConfig();
config.setNumberOfResources(5);
@ -62,11 +63,11 @@ public class PresetConfigGenerator {
config.setParam("CreateTable", "true");
config.setParam("SpeciesName", speciesID);
config.setParam("UserName", username);
config.setParam("NeuralNetworkName", nnname);
return config;
}
public static AlgorithmConfiguration configSuitableNeuralNetworkTraining(String presenceTable, String absenceTable,String username, String speciesID, String neuronsAndLayers) {
public static AlgorithmConfiguration configSuitableNeuralNetworkTraining(String presenceTable, String absenceTable,String username, String speciesID, String neuronsAndLayers,String nnname) {
AlgorithmConfiguration config = Regressor.getConfig();
config.setNumberOfResources(5);
@ -77,11 +78,11 @@ public class PresetConfigGenerator {
config.setParam("SpeciesName", speciesID);
config.setParam("UserName",username);
config.setParam("LayersNeurons", neuronsAndLayers);
config.setParam("NeuralNetworkName", nnname);
return config;
}
public static AlgorithmConfiguration configNativeNeuralNetworkTraining(String presenceTable, String absenceTable,String username, String speciesID, String neuronsAndLayers) {
public static AlgorithmConfiguration configNativeNeuralNetworkTraining(String presenceTable, String absenceTable,String username, String speciesID, String neuronsAndLayers,String nnname) {
AlgorithmConfiguration config = Regressor.getConfig();
config.setNumberOfResources(5);
@ -92,7 +93,8 @@ public class PresetConfigGenerator {
config.setParam("SpeciesName", speciesID);
config.setParam("UserName", username);
config.setParam("LayersNeurons", neuronsAndLayers);
config.setParam("NeuralNetworkName", nnname);
return config;
}