Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ColossalAI
Commits
52d145a3
Commit
52d145a3
authored
Jul 12, 2022
by
Super Daniel
Committed by
Frank Lee
Jul 13, 2022
Browse files
[NFC] polish colossalai/nn/lr_scheduler/onecycle.py code style (#1269)
parent
0e06f621
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
colossalai/nn/lr_scheduler/onecycle.py
colossalai/nn/lr_scheduler/onecycle.py
+8
-3
No files found.
colossalai/nn/lr_scheduler/onecycle.py
View file @
52d145a3
...
...
@@ -68,7 +68,9 @@ class OneCycleLR(_OneCycleLR):
https://arxiv.org/abs/1708.07120
"""
def
__init__
(
self
,
optimizer
,
total_steps
:
int
,
def
__init__
(
self
,
optimizer
,
total_steps
:
int
,
pct_start
=
0.3
,
anneal_strategy
=
'cos'
,
cycle_momentum
=
True
,
...
...
@@ -76,9 +78,12 @@ class OneCycleLR(_OneCycleLR):
max_momentum
=
0.95
,
div_factor
=
25.0
,
final_div_factor
=
10000.0
,
last_epoch
=-
1
,
**
kwargs
):
last_epoch
=-
1
,
**
kwargs
):
max_lrs
=
list
(
map
(
lambda
group
:
group
[
'lr'
],
optimizer
.
param_groups
))
super
().
__init__
(
optimizer
,
max_lrs
,
total_steps
=
total_steps
,
super
().
__init__
(
optimizer
,
max_lrs
,
total_steps
=
total_steps
,
pct_start
=
pct_start
,
anneal_strategy
=
anneal_strategy
,
cycle_momentum
=
cycle_momentum
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment