Created
August 22, 2023 14:47
-
-
Save pythonlessons/271ef12378f045e9c011204b7f45694a to your computer and use it in GitHub Desktop.
build_transformer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Test DecoderLayer layer | |
decoder_vocab_size = 1000 | |
d_model = 512 | |
dff = 2048 | |
num_heads = 8 | |
decoder_layer = DecoderLayer(d_model, num_heads, dff) | |
random_decoderLayer_input = np.random.randint(0, decoder_vocab_size, size=(1, 110)) | |
decoder_embeddings = encoder_embedding_layer(random_decoderLayer_input) | |
decoderLayer_output = decoder_layer(decoder_embeddings, encoder_output) | |
print("random_decoder_input shape", random_decoderLayer_input.shape) | |
print("decoder_embeddings shape", decoder_embeddings.shape) | |
print("decoder_output shape", decoderLayer_output.shape) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment