🚀 Feature
We should pass a reference to the task object to the optimizer + param scheduler to be able to use more complex parameter schedulers
Motivation / Pitch
Basic PyTorch learning rate schedulers such as the ReduceLROnPlateau require task information such as access to the validation loss. Currently, it is not possible to implement this in Classy Vision because there is no access to the task by the scheduler.
By adding a task reference, the user could access the local variables, or the task meters to make informed decisions on their parameter scheduling.
This would imply also giving the optimizer access to the task during the update scheduler method.
Alternatives
As far as I know, the only (hacky) way of achieving this is by using a custom hook, but hooks are not configurable via configuration file, and it doesn't make much sense to have a Parameter Scheduler as a Hook.
Let me know what you think!