Pass parameters on train_step/validation_step/test_step
🚀 Feature
As title
Motivation
I'm currently working with Seq-to-seq architecture, which requires a variable called max_length when decoding outputs. I mean, while training, it could be fixed as a model hyperparameter. However, during testing, we could vary its value to make predict longer or shorter in need. Therefore, I think there should be a way to pass other arguments in the validating/testing phase to make it more flexible, especially with argparse. This also helps in case we have different strategies during evaluating, such as I could select either greedy or beam search algorithms.
For example:
I could run
# training model with max_length = 15 and using Greedy (as default) to save training time
python train.py --max_length 15

# eval model with a longer length and use Beamsearch to increase performance
python eval.py epoch=0.ckpt --max_length 20 --using_beamsearch