Skip to content

Commit 8e3c461

Browse files
committed
Return weights as list
1 parent d79b396 commit 8e3c461

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pygad/cnn/cnn.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def layers_weights(model,
5454
# Currently, the weights of the layers are in the reverse order. In other words, the weights of the first layer are at the last index of the 'network_weights' list while the weights of the last layer are at the first index.
5555
# Reversing the 'network_weights' list to order the layers' weights according to their location in the network architecture (i.e. the weights of the first layer appears at index 0 of the list).
5656
network_weights.reverse()
57-
return numpy.array(network_weights)
57+
return network_weights
5858

5959
def layers_weights_as_matrix(model, vector_weights):
6060

@@ -140,7 +140,7 @@ def layers_weights_as_vector(model, initial=True):
140140
# Currently, the weights of the layers are in the reverse order. In other words, the weights of the first layer are at the last index of the 'network_weights' list while the weights of the last layer are at the first index.
141141
# Reversing the 'network_weights' list to order the layers' weights according to their location in the network architecture (i.e. the weights of the first layer appears at index 0 of the list).
142142
network_weights.reverse()
143-
return numpy.array(network_weights)
143+
return network_weights
144144

145145
def update_layers_trained_weights(model, final_weights):
146146

0 commit comments

Comments
 (0)