Skip to content

Commit

Permalink
Add decay to loss scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
ancestor-mithril committed Nov 29, 2024
1 parent 1de605c commit afc18b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ def __init__(self, loss, reducer):
f"Using Loss scaling with scaling range: {self.loss_scaling_range}"
)

@lru_cache(maxsize=32)
def get_weights(
self, shape: torch.Size, dtype: torch.dtype, device: torch.device
) -> Tensor:
Expand Down Expand Up @@ -130,6 +129,7 @@ def init_criterion(args):
else:
loss = loss(reduction=args.reduction if args.loss_scaling is None else "none")

# TODO: Add decay to loss scaling
if args.loss_scaling is None:
return loss
elif args.loss_scaling == "normal-scaling":
Expand Down

0 comments on commit afc18b7

Please sign in to comment.