From a8cf03ac645931baec1355e58227ac470ee96bc0 Mon Sep 17 00:00:00 2001 From: ekn1503 <39153577+ekn1503@users.noreply.github.com> Date: Fri, 25 Apr 2025 18:15:59 +0200 Subject: [PATCH] Update cnn.py NEP 34: https://numpy.org/neps/nep-0034-infer-dtype-is-object.html --- pygad/cnn/cnn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygad/cnn/cnn.py b/pygad/cnn/cnn.py index 1bd9033..82dc8de 100644 --- a/pygad/cnn/cnn.py +++ b/pygad/cnn/cnn.py @@ -143,7 +143,7 @@ def layers_weights_as_matrix(model, vector_weights): # 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. # 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). network_weights.reverse() - return numpy.array(network_weights) + return numpy.array(network_weights, dtype=object) # NEP 34: https://numpy.org/neps/nep-0034-infer-dtype-is-object.html def layers_weights_as_vector(model, initial=True):