Skip to content

Instantly share code, notes, and snippets.

@pythonlessons
Created September 4, 2023 15:04
Show Gist options
  • Save pythonlessons/b1964dafd98d399b7b56b09fc5464e17 to your computer and use it in GitHub Desktop.
Save pythonlessons/b1964dafd98d399b7b56b09fc5464e17 to your computer and use it in GitHub Desktop.
transformers_training
# Create TensorFlow Transformer Model
transformer = Transformer(
num_layers=configs.num_layers,
d_model=configs.d_model,
num_heads=configs.num_heads,
dff=configs.dff,
input_vocab_size=len(tokenizer)+1,
target_vocab_size=len(detokenizer)+1,
dropout_rate=configs.dropout_rate,
encoder_input_size=tokenizer.max_length,
decoder_input_size=detokenizer.max_length
)
transformer.summary()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment