Skip to content

Commit

Permalink
Add 'step' ramp for ExponentialDecayScheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
oseiskar committed Feb 9, 2024
1 parent 5fe47c9 commit 04149f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nerfstudio/engine/schedulers.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class ExponentialDecaySchedulerConfig(SchedulerConfig):
"""Number of warmup steps."""
max_steps: int = 100000
"""The maximum number of steps."""
ramp: Literal["linear", "cosine"] = "cosine"
ramp: Literal["linear", "cosine", "step"] = "cosine"
"""The ramp function to use during the warmup."""


Expand All @@ -125,6 +125,8 @@ def func(step):
lr = self.config.lr_pre_warmup + (lr_init - self.config.lr_pre_warmup) * np.sin(
0.5 * np.pi * np.clip(step / self.config.warmup_steps, 0, 1)
)
elif self.config.ramp == "step":
lr = self.config.lr_pre_warmup
else:
lr = (
self.config.lr_pre_warmup
Expand Down

0 comments on commit 04149f7

Please sign in to comment.