farizrahman4u / seq2seq

Sequence to Sequence Learning with Keras
GNU General Public License v2.0
3.17k stars 845 forks source link

persist Seq2Seq through keras load - save api #224

Open stefanoterna opened 6 years ago

stefanoterna commented 6 years ago

Added a get_config override method to handle hidden_dim in LSTMDecoderCell and AttentionDecoderCell.

Moreover, the constructors of both classes relied on self.output_dim to set the value of hidden_dim if not supplied. But self.output_dim is not available until super constructor has been called. Fixed by accessing directly to kwargs, so that hidden_dim is be available when the super constructor calls the build_model method.