Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Pass task reference ParamScheculer.__call__ #397

@miguelvr

Description

@miguelvr

🚀 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions