Skip to content

Commit

Permalink
Backported to Java 17
Browse files Browse the repository at this point in the history
  • Loading branch information
xEcho1337 committed Oct 15, 2024
1 parent 934c027 commit 80ac547
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public double fit(DataSet set) {

@Override
public double[] predict(double ... input) {
Layer inputLayer = layers.getFirst();
Layer inputLayer = layers.get(0);

if (input.length != inputLayer.getNeurons().size()) {
throw new IllegalArgumentException("Input size does not match model's input dimension!");
Expand Down Expand Up @@ -129,7 +129,7 @@ public double[] predict(double ... input) {
nextLayer.applyFunction();
}

Layer outputLayer = layers.getLast();
Layer outputLayer = layers.get(layers.size() - 1);
double[] output = new double[outputLayer.getNeurons().size()];

for (int i = 0; i < output.length; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private void backpropagate(double[] targets, double[] outputs, double learningRa
}

private void initialDelta(List<Layer> layers, double[] targets, double[] outputs) {
Layer outputLayer = layers.getLast();
Layer outputLayer = layers.get(layers.size() - 1);

for (int i = 0; i < outputLayer.getNeurons().size(); i++) {
Neuron neuron = outputLayer.getNeuronAt(i);
Expand Down

0 comments on commit 80ac547

Please sign in to comment.