Is there a reason to use two optimizer instead of one for both encoder and decoder in the following tutorial?
In this case, it is equivalent to use one. But multiple optimizers are useful when you either want different optimization algorithm for different parts or optimize different set of parameters at each time.
Separate optimizers will also allow you to have separate schedulers, in case e.g. you are fine-tuning a pretrained model, and you want to slowly ramp-up the learning rate for the low-level (first) part of the model, while the final part will have a higher learning rate from the beginning.