Ich versuche in Keras ein Sprachmodell auf Wortebene zu trainieren.Eingabeform für Keras LSTM/GRU Sprachmodell
Ich habe meine X und Y, die beide mit der Form (90582L, 517L)
Als ich dieses Modell versuchen passen:
print('Build model...')
model = Sequential()
model.add(GRU(512, return_sequences=True, input_shape=(90582, 517)))
model.add(Dropout(0.2))
model.add(GRU(512, return_sequences=True))
model.add(Dropout(0.2))
model.add(TimeDistributedDense(1))
model.add(Activation('softmax'))
model.compile(loss='categorical_crossentropy', optimizer='rmsprop')
model.fit(x_pad, y_pad, batch_size=128, nb_epoch=2)
ich den Fehler:
Exception: Error when checking model input:
expected gru_input_7 to have 3 dimensions, but got array with shape (90582L, 517L)
Ich brauche eine Anleitung, wie die Eingabeform sein sollte? Ich habe Versuche und Fehler in allen möglichen Kombinationen gemacht, aber es scheint, dass ich etwas Grundlegendes falsch verstehe.
Im Keras-Texterstellungsbeispiel hatte die X-Matrix drei Dimensionen. Ich habe keine Ahnung, was die dritte Dimension sein soll.