Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/sg 000 fix lr function scheduling and add deprecation #675

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/super_gradients/training/utils/callbacks/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import onnx
import onnxruntime
import torch
from deprecate import deprecated

from super_gradients.common.abstractions.abstract_logger import get_logger
from super_gradients.training.utils.callbacks.base_callbacks import PhaseCallback, PhaseContext, Phase, Callback
Expand Down Expand Up @@ -470,9 +471,10 @@ class FunctionLRCallback(LRCallbackBase):
Hard coded rate scheduling for user defined lr scheduling function.
"""

@deprecated(target=None, deprecated_in="3.6.0", remove_in="4.0.0")
def __init__(self, max_epochs, lr_schedule_function, **kwargs):
super(FunctionLRCallback, self).__init__(Phase.TRAIN_BATCH_STEP, **kwargs)
assert callable(self.lr_schedule_function), "self.lr_function must be callable"
assert callable(lr_schedule_function), "self.lr_function must be callable"
self.lr_schedule_function = lr_schedule_function
self.max_epochs = max_epochs

Expand Down