January 2019
Intermediate to advanced
342 pages
9h 17m
English
We first execute the model_enc_dec function to define the model for training as well as encoder_model and decoder_model for inference and then compile it with categorical_crossentropy loss and rmsprop optimizer. We can experiment with other optimizers, such as Adam, SDG with momentum, and so on, but, for now, we will stick to rmsprop. The train function can be defined as follows:
# Run training def train(self,encoder_input_data,decoder_input_data, decoder_target_data): print("Training...") model,encoder_model,decoder_model = self.model_enc_dec() model.compile(optimizer='rmsprop', loss='categorical_crossentropy') model.fit([encoder_input_data, decoder_input_data], decoder_target_data, batch_size=self.batch_size, epochs=self.epochs, ...Read now
Unlock full access