We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b193942 commit ba8bec0Copy full SHA for ba8bec0
1 file changed
src/neural-network.js
@@ -982,9 +982,11 @@ export default class NeuralNetwork {
982
const nodes = Object.keys(layer);
983
this.sizes[i] = nodes.length;
984
for (let j in nodes) {
985
- const node = nodes[j];
986
- this.biases[i][j] = layer[node].bias;
987
- this.weights[i][j] = toArray(layer[node].weights);
+ if (nodes.hasOwnProperty(j)) {
+ const node = nodes[j];
+ this.biases[i][j] = layer[node].bias;
988
+ this.weights[i][j] = toArray(layer[node].weights);
989
+ }
990
}
991
992
0 commit comments