Unofficial implementation of ON-LSTM
Project description
Keras Ordered Neurons LSTM
Unofficial implementation of ON-LSTM.
Install
pip install keras-ordered-neurons
Usage
Same as LSTM
except that an extra argument chunk_size
should be given:
from keras.models import Sequential
from keras.layers import Embedding, Bidirectional, Dense
from keras_ordered_neurons import ONLSTM
model = Sequential()
model.add(Embedding(input_shape=(None,), input_dim=10, output_dim=100))
model.add(Bidirectional(ONLSTM(units=50, chunk_size=5)))
model.add(Dense(units=2, activation='softmax'))
model.compile(optimizer='adam', loss='sparse_categorical_crossentropy')
model.summary()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for keras-ordered-neurons-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f44d6222a20a2788d7e61147377336bb0d37c4f35dfc3b2831736bede55560a1 |
|
MD5 | 03e473797c6f72cb2ed919b5512c92a2 |
|
BLAKE2b-256 | c1a6ba0d85026a0c1bb846a1c0ba8d273d39a321e6ce8b9b2add16d93aad396e |