Skip to content

Commit

Permalink
int -> float type annotation for LRFinder (#6364)
Browse files Browse the repository at this point in the history
Fixes #6363.

### Description

Correct type annotation for `end_lr`.

### Types of changes

- [x] Non-breaking change (fix or new feature that would not break
existing functionality).

Signed-off-by: Josh <josh.e.stein@gmail.com>
  • Loading branch information
joshestein authored Apr 14, 2023
1 parent 825b8db commit 7bb74c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion monai/optimizers/lr_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def range_test(
image_extractor: Callable = default_image_extractor,
label_extractor: Callable = default_label_extractor,
start_lr: float | None = None,
end_lr: int = 10,
end_lr: float = 10.0,
num_iter: int = 100,
step_mode: str = "exp",
smooth_f: float = 0.05,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_lr_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def test_lr_finder(self):
pickle_module=pickle,
pickle_protocol=4,
)
lr_finder.range_test(train_loader, val_loader=train_loader, end_lr=10, num_iter=5)
lr_finder.range_test(train_loader, val_loader=train_loader, end_lr=10.0, num_iter=5)
print(lr_finder.get_steepest_gradient(0, 0)[0])

if has_matplotlib:
Expand Down

0 comments on commit 7bb74c6

Please sign in to comment.