We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@lsdefine please can you tell me how can I use the transformer instead of an LSTM layer in a simple encoder ? as in this small example.
model = Sequential() model.add(Embedding(top_words, 100, input_length=max_words, trainable=True)) model.add(LSTM(32)) model.add(Dense(1, activation='sigmoid'))
The text was updated successfully, but these errors were encountered:
@basma-b Did you figure it out?
Sorry, something went wrong.
from transformer import QANet_Encoder inp = Input(shape=(max_len,), dtype='int32') x = Embedding(words.num(), 64)(inp) x = Dropout(0.5)(x) mask = Lambda(lambda x:K.cast(K.greater(x, 0), 'float32'))(inp) x = QANet_Encoder(64, n_head=4, n_conv=2, n_block=3, kernel_size=5, dropout=0.5, add_pos=False)(x, mask)
Or using Encoder instead of the QANet_Encoder.
No branches or pull requests
@lsdefine please can you tell me how can I use the transformer instead of an LSTM layer in a simple encoder ? as in this small example.
The text was updated successfully, but these errors were encountered: