Skip to content

Commit

Permalink
formatting changes from black 22.3.0
Browse files Browse the repository at this point in the history
Summary:
Applies the black-fbsource codemod with the new build of pyfmt.

paintitblack

Reviewed By: lisroach

Differential Revision: D36324783

fbshipit-source-id: 280c09e88257e5e569ab729691165d8dedd767bc
  • Loading branch information
amyreese authored and facebook-github-bot committed May 12, 2022
1 parent 6c83054 commit d20d204
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pycls/core/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def construct_optimizer(model):
def lr_fun_steps(cur_epoch):
"""Steps schedule (cfg.OPTIM.LR_POLICY = 'steps')."""
ind = [i for i, s in enumerate(cfg.OPTIM.STEPS) if cur_epoch >= s][-1]
return cfg.OPTIM.LR_MULT ** ind
return cfg.OPTIM.LR_MULT**ind


def lr_fun_exp(cur_epoch):
Expand Down
2 changes: 1 addition & 1 deletion pycls/sweep/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def power2_uniform(low, high, q):
"""Samples uniform powers of 2 from [low, high] quantized to q."""
# Samples f2 in [l2, h2+1) then quantizes f2 to [l2, h2] via floor()
f2 = np.floor(np.random.uniform(np.log2(low), np.log2(high) + 1))
return quantize(2 ** f2, q)
return quantize(2**f2, q)


def power2_or_log_uniform(low, high, q):
Expand Down

0 comments on commit d20d204

Please sign in to comment.