Skip to content

Instantly share code, notes, and snippets.

@isauravmanitripathi
Created October 10, 2022 15:57
Show Gist options
  • Save isauravmanitripathi/e761b54a7b1f92670b4ec1ea2d429ea2 to your computer and use it in GitHub Desktop.
Save isauravmanitripathi/e761b54a7b1f92670b4ec1ea2d429ea2 to your computer and use it in GitHub Desktop.
from positional_encoding import PositionEmbeddingFixedWeights
class Decoder(Layer):
def __init__(self, vocab_size, sequence_length, h, d_k, d_v, d_model, d_ff, n, rate, **kwargs):
super(Decoder, self).__init__(**kwargs)
self.pos_encoding = PositionEmbeddingFixedWeights(sequence_length, vocab_size, d_model)
self.dropout = Dropout(rate)
self.decoder_layer = [DecoderLayer(h, d_k, d_v, d_model, d_ff, rate) for _ in range(n)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment