Skip to content

Commit d923ba6

Browse files
crapxxialxkm
andauthored
Update src/main/java/com/thealgorithms/maths/SigmoidActivation.java
Co-authored-by: Oleksandr Klymenko <alexanderklmn@gmail.com>
1 parent 543032a commit d923ba6

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎src/main/java/com/thealgorithms/maths/SigmoidActivation.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ public static double activate(double x) {
3939

4040
public static double[][] activate(double[][] x) {
4141
// apply calculation to every value in batch.
42-
double[][] activatedNumbers = new double[x.length][x[0].length];
42+
double[][] activatedNumbers = new double[x.length][];
4343
for (int i = 0; i < x.length; i++) {
44-
for (int j = 0; j < x[0].length; j++) {
44+
activatedNumbers[i] = new double[x[i].length];
45+
for (int j = 0; j < x[i].length; j++) {
4546
activatedNumbers[i][j] = activate(x[i][j]);
4647
}
4748
}

0 commit comments

Comments
 (0)