Skip to content

Commit 402b9bd

Browse files
authored
Update simple_neural_network.py
1 parent 37cae3f commit 402b9bd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

neural_network/simple_neural_network.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ def forward_propagation(expected: int, number_propagations: int) -> float:
4747
layer_1_error = (expected / 100) - layer_1
4848
# Error delta
4949
layer_1_delta = layer_1_error * sigmoid_function(layer_1, True)
50-
# Update weight
51-
weight += INITIAL_VALUE * layer_1_delta
50+
# Update weight using a list comprehension
51+
weight = weight + [INITIAL_VALUE * w_d for w_d in layer_1_delta]
5252

5353
return layer_1 * 100
5454

0 commit comments

Comments
 (0)