0
$\begingroup$

Trying to learn the encoder-decoder model for some NLP problems.

I am referring to this Keras tutorial.

During the model training phase, this tutorial just uses the following:

model.fit([encoder_input_data, decoder_input_data], decoder_target_data,
          batch_size=batch_size,
          epochs=epochs)

I understand this logic. But the confusion is in some other tutorials for EXACTLY THE SAME PROBLEM. For example, in Tensorflow's documentation for NMT with Attention the training_phase is very different where they use custom training loops with a custom train step and calling the step for every batch manually.

The question is are these 2 different training methods which should be used in particular cases OR its the same training method with 2 different forms of implementation?

$\endgroup$
1
$\begingroup$

One is a straight forward use of API while the other one gives you much better control on training. If you are experimenting, it is good to go with a custom training loop so you can control the various things that happen to your model's training.

But, if you want to just train a model and not experiment with it much, save time and go for the straight forward method of training.

Both are same but one gives you much more control.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.