-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOutputLayer.java
More file actions
30 lines (24 loc) · 805 Bytes
/
OutputLayer.java
File metadata and controls
30 lines (24 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import java.util.function.DoubleFunction;
import java.lang.Math;
public class OutputLayer extends Layer {
public OutputLayer(int nbNeurons, int inputLength) {
super(nbNeurons, inputLength);
}
@Override
public double [] computeError(double [] realisation) {
if (this.guess.length != realisation.length) {
System.out.println("Wrong length in OutputLayer computeError.");
return null;
} else {
double [] error = new double [this.guess.length];
for (int i = 0; i < error.length; i++) {
error[i] = realisation[i] - this.guess[i];
}
return error;
}
}
@Override
public Layer getNext() {
return null;
}
}