Minor changes
This commit is contained in:
@@ -23,7 +23,7 @@ public class Main {
|
||||
DataSet dataset = new DatasetExtractor()
|
||||
.extract("C:/Users/Laurent/Desktop/ANN-framework/src/main/resources/assets/table_4_14.csv", nbrClass);
|
||||
|
||||
int[] neuronPerLayer = new int[]{3, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 37, dataset.getNbrLabels()};
|
||||
int[] neuronPerLayer = new int[]{27, dataset.getNbrLabels()};
|
||||
int nbrInput = dataset.getNbrInputs();
|
||||
|
||||
List<Layer> layers = new ArrayList<>();
|
||||
@@ -51,7 +51,7 @@ public class Main {
|
||||
FullyConnectedNetwork network = new FullyConnectedNetwork(layers.toArray(new Layer[0]));
|
||||
|
||||
Trainer trainer = new GradientBackpropagationTraining();
|
||||
trainer.train(0.01F, 5000, network, dataset);
|
||||
trainer.train(0.0001F, 15000, network, dataset);
|
||||
|
||||
GraphVisualizer visualizer = new GraphVisualizer();
|
||||
|
||||
@@ -60,9 +60,9 @@ public class Main {
|
||||
visualizer.addPoint("Label " + label.getFirst(), entry.getData().get(0).getValue(), entry.getData().get(1).getValue());
|
||||
}
|
||||
|
||||
float min = -3F;
|
||||
float max = 2F;
|
||||
float step = 0.01F;
|
||||
float min = -5F;
|
||||
float max = 5F;
|
||||
float step = 0.025F;
|
||||
for (float x = min; x < max; x+=step){
|
||||
for (float y = min; y < max; y+=step){
|
||||
float prediction = network.predict(List.of(new Input(x), new Input(y))).getFirst();
|
||||
@@ -71,8 +71,7 @@ public class Main {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
visualizer.buildScatterGraph();
|
||||
visualizer.buildScatterGraph((int)min-1, (int)max+1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user