Created
December 2, 2020 07:36
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
class Decoder(tf.keras.Model): | |
def __init__(self, vocab_size, embedding_dim, output_length, dec_units,att_units): | |
super().__init__() | |
self.onestep=One_Step_Decoder(vocab_size, embedding_dim, output_length, dec_units,att_units) | |
def call(self, input_to_decoder,encoder_output,state_1) | |
all_outputs=tf.TensorArray(tf.float32,input_to_decoder.shape[1],name="output_array") | |
for step in range(input_to_decoder.shape[1]): | |
output,state_1,alpha=self.onestep(input_to_decoder[:,step:step+1],encoder_output,state_1) | |
all_outputs=all_outputs.write(step,output) | |
all_outputs=tf.transpose(all_outputs.stack(),[1,0,2]) | |
return all_outputs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment