Skip to content

Commit

Permalink
warmup 3
Browse files Browse the repository at this point in the history
  • Loading branch information
jefequien committed Oct 29, 2024
1 parent 10bac1d commit 68289ae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/blur_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,12 @@ def mask_loss(self, blur_mask: Tensor, step: int, eps: float = 1e-2):
sparsity. During warmup, the bias is even higher to start with a sparse mask."""
x = blur_mask.mean()
if step <= self.num_warmup_steps:
a = 2
a = 3
b = 0.1
else:
a = 1
maskloss = a * (1 / (1 - x + eps) - 1) + 0.1 * (1 / (x + eps) - 1)
b = 0.1
maskloss = a * (1 / (1 - x + eps) - 1) + b * (1 / (x + eps) - 1)
return maskloss


Expand Down

0 comments on commit 68289ae

Please sign in to comment.