-
-
Save isauravmanitripathi/e761b54a7b1f92670b4ec1ea2d429ea2 to your computer and use it in GitHub Desktop.
This file contains 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
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