Minor perfomance improvements
This commit is contained in:
@@ -11,6 +11,7 @@ import com.naaturel.ANN.infrastructure.dataset.DatasetExtractor;
|
||||
import com.naaturel.ANN.domain.model.neuron.*;
|
||||
import com.naaturel.ANN.infrastructure.graph.GraphVisualizer;
|
||||
|
||||
import java.io.Console;
|
||||
import java.util.*;
|
||||
|
||||
public class Main {
|
||||
@@ -40,19 +41,19 @@ public class Main {
|
||||
|
||||
Bias bias = new Bias(new Weight());
|
||||
|
||||
Neuron n = new Neuron(syns, bias, new TanH());
|
||||
Neuron n = new Neuron(syns.toArray(new Synapse[0]), bias, new TanH());
|
||||
neurons.add(n);
|
||||
}
|
||||
Layer layer = new Layer(neurons);
|
||||
Layer layer = new Layer(neurons.toArray(new Neuron[0]));
|
||||
layers.add(layer);
|
||||
}
|
||||
|
||||
FullyConnectedNetwork network = new FullyConnectedNetwork(layers);
|
||||
FullyConnectedNetwork network = new FullyConnectedNetwork(layers.toArray(new Layer[0]));
|
||||
|
||||
Trainer trainer = new GradientBackpropagationTraining();
|
||||
trainer.train(0.001F, 1000, network, dataset);
|
||||
trainer.train(0.01F, 5000, network, dataset);
|
||||
|
||||
/*GraphVisualizer visualizer = new GraphVisualizer();
|
||||
GraphVisualizer visualizer = new GraphVisualizer();
|
||||
|
||||
for (DataSetEntry entry : dataset) {
|
||||
List<Float> label = dataset.getLabelsAsFloat(entry);
|
||||
@@ -71,7 +72,7 @@ public class Main {
|
||||
}
|
||||
|
||||
|
||||
visualizer.buildScatterGraph();*/
|
||||
visualizer.buildScatterGraph();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user