Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/network/main/NeuralNetwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import java.util.Random;

public class NeuralNetwork {
private bool isCountingpUp = false;
private int learningTracker;
private int[] layers;
private BigDecimal learningRate;
private NeuronLayer[] neuronLayer;
Expand All @@ -12,12 +14,18 @@ public class NeuralNetwork {
public NeuralNetwork(int[] layers, BigDecimal learningRate){
this.layers = new int[layers.length];
this.learningRate = learningRate;
if(learningRate > 30) isCountingUp = true;
for(int i = 0; i < layers.length; i++){
this.layers[i] = layers[i];
}

r = new Random();
initLayer();
if(isCountingUp){
isCountingUp = false;
r = new Random();
this.learningTracker++;
}
}

private void initLayer(){
Expand Down Expand Up @@ -62,4 +70,4 @@ public void backProp(BigDecimal[] expected){
neuronLayer[i].backPropHidden(neuronLayer[i + 1]);
}
}
}
}