Move dataset components
This commit is contained in:
@@ -2,11 +2,10 @@ package com.naaturel.ANN;
|
||||
|
||||
import com.naaturel.ANN.domain.model.neuron.Neuron;
|
||||
import com.naaturel.ANN.domain.abstraction.Trainer;
|
||||
import com.naaturel.ANN.domain.model.dataset.DataSet;
|
||||
import com.naaturel.ANN.domain.model.dataset.DatasetExtractor;
|
||||
import com.naaturel.ANN.infrastructure.dataset.DataSet;
|
||||
import com.naaturel.ANN.infrastructure.dataset.DatasetExtractor;
|
||||
import com.naaturel.ANN.domain.model.neuron.*;
|
||||
import com.naaturel.ANN.implementation.gradientDescent.Linear;
|
||||
import com.naaturel.ANN.implementation.training.AdalineTraining;
|
||||
import com.naaturel.ANN.implementation.training.GradientDescentTraining;
|
||||
|
||||
import java.util.*;
|
||||
@@ -18,25 +17,31 @@ public class Main {
|
||||
int nbrInput = 2;
|
||||
int nbrClass = 3;
|
||||
|
||||
int nbrLayers = 1;
|
||||
|
||||
DataSet dataset = new DatasetExtractor()
|
||||
.extract("C:/Users/Laurent/Desktop/ANN-framework/src/main/resources/assets/table_3_1.csv", nbrClass);
|
||||
|
||||
List<Neuron> neurons = new ArrayList<>();
|
||||
List<Layer> layers = new ArrayList<>();
|
||||
for(int i = 0; i < nbrLayers; i++){
|
||||
|
||||
for (int i=0; i < nbrClass; i++){
|
||||
List<Synapse> syns = new ArrayList<>();
|
||||
for (int j=0; j < nbrInput; j++){
|
||||
syns.add(new Synapse(new Input(0), new Weight(0)));
|
||||
List<Neuron> neurons = new ArrayList<>();
|
||||
for (int j=0; j < nbrClass; j++){
|
||||
|
||||
List<Synapse> syns = new ArrayList<>();
|
||||
for (int k=0; k < nbrInput; k++){
|
||||
syns.add(new Synapse(new Input(0), new Weight(0)));
|
||||
}
|
||||
|
||||
Bias bias = new Bias(new Weight(0));
|
||||
|
||||
Neuron n = new Neuron(syns, bias, new Linear());
|
||||
neurons.add(n);
|
||||
}
|
||||
|
||||
Bias bias = new Bias(new Weight(0));
|
||||
|
||||
Neuron n = new Neuron(syns, bias, new Linear());
|
||||
neurons.add(n);
|
||||
Layer layer = new Layer(neurons);
|
||||
layers.add(layer);
|
||||
}
|
||||
|
||||
Layer layer = new Layer(neurons);
|
||||
Network network = new Network(List.of(layer));
|
||||
Network network = new Network(layers);
|
||||
|
||||
Trainer trainer = new GradientDescentTraining();
|
||||
trainer.train(network, dataset);
|
||||
|
||||
Reference in New Issue
Block a user