keras-team / keras

Deep Learning for humans
http://keras.io/
Apache License 2.0
61.97k stars 19.46k forks source link

Getting state of predictions in LSTMs #7572

Closed sachinruk closed 6 years ago

sachinruk commented 7 years ago

This is a cross post from: https://stackoverflow.com/questions/45582185/getting-state-of-predictions-in-lstms

I have since tried to redo the model as:

batch_size = 64

model = Sequential()
model.add(Embedding(len_vocab, 64, batch_size=batch_size))
model.add(LSTM(256, return_sequences=True, stateful=True))
model.add(TimeDistributed(Dense(len_vocab, activation='softmax')))

model.compile(loss='sparse_categorical_crossentropy', optimizer='adam')
model.summary()

However, now I cannot predict one letter at a time as it is expecting a batch_size of inputs.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 30 days if no further activity occurs, but feel free to re-open a closed issue if needed.