Skip to content

Commit 8e72d74

Browse files
committed
change a lazy map into a list comprehension
1 parent 98d5780 commit 8e72d74

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎code-python3/neural_networks.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def patch(x, y, hatch, color):
6868

6969
def show_weights(neuron_idx):
7070
weights = network[0][neuron_idx]
71-
abs_weights = map(abs, weights)
71+
abs_weights = [abs(weight) for weight in weights]
7272

7373
grid = [abs_weights[row:(row+5)] # turn the weights into a 5x5 grid
7474
for row in range(0,25,5)] # [weights[0:5], ..., weights[20:25]]

0 commit comments

Comments
 (0)