J'essaie de former nn avec keras train_on_batch
fonction. J'ai 39 fonctions et je veux qu'un lot contienne 32 échantillons. J'ai donc une liste de 32 tableaux numpy pour chaque itération d'entraînement.Keras forme de fonctionnalités pour la formation
Alors, voici mon code (ici chaque batch_x est une liste de 32 tableau numpy contenant chacun 39 caractéristiques):
input_shape = (39,)
model = Sequential()
model.add(Dense(39, input_shape=input_shape)) # show you is only first layer
...
for batch_x, batch_y in train_gen:
model.train_on_batch(batch_x, batch_y)
Mais tout à coup je me suis une erreur:
Exception: Error when checking model input: the list of Numpy arrays
that you are passing to your model is not the size the model expected.
Expected to see 1 arrays but instead got the following list of 32 arrays:
Je suis pas vraiment sûr de ce qui ne va pas.
P.S. J'ai également essayé différents input_shape
tels que (32, 39), (39, 32) etc.