PacktPublishing / Deep-Learning-with-TensorFlow-2-and-Keras

Deep Learning with TensorFlow 2 and Keras, published by Packt
MIT License
313 stars 212 forks source link

Wrong function parameter order in seq2seq #2

Closed huikang closed 3 years ago

huikang commented 4 years ago

https://github.com/PacktPublishing/Deep-Learning-with-TensorFlow-2-and-Keras/blob/b2639479d3e487005ba9098ed8eb37a1242226e8/Chapter%208/seq2seq_wo_attn.py#L47

The definition is

class Encoder(tf.keras.Model):
    def __init__(self, vocab_size, num_timesteps, 
            embedding_dim, encoder_dim, **kwargs):

However, the encoder is create by

https://github.com/PacktPublishing/Deep-Learning-with-TensorFlow-2-and-Keras/blob/b2639479d3e487005ba9098ed8eb37a1242226e8/Chapter%208/seq2seq_wo_attn.py#L217

I think the correct order should be

class Encoder(tf.keras.Model):
    def __init__(self, vocab_size, embedding_dim, num_timesteps,
            encoder_dim, **kwargs):
sujitpal commented 3 years ago

Thank you, I have fixed the ordering in the class definition, to keep it in line with the ordering in the Decoder class definition.

sujitpal commented 3 years ago

Change applied via PR (https://github.com/PacktPublishing/Deep-Learning-with-TensorFlow-2-and-Keras/pull/6), awaiting merge.