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
ModelZoo
ResNet50_tensorflow
Commits
812ab923
Commit
812ab923
authored
Feb 14, 2022
by
Jinoo Baek
Committed by
A. Unique TensorFlower
Feb 14, 2022
Browse files
Fix typo from StepConsineDecayWithOffset -> StepCosineDecayWithOffset
PiperOrigin-RevId: 428599243
parent
5c33ce76
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
11 deletions
+11
-11
official/legacy/detection/modeling/learning_rates.py
official/legacy/detection/modeling/learning_rates.py
+1
-1
official/legacy/image_classification/learning_rate.py
official/legacy/image_classification/learning_rate.py
+1
-1
official/modeling/optimization/configs/learning_rate_config.py
...ial/modeling/optimization/configs/learning_rate_config.py
+3
-3
official/modeling/optimization/lr_schedule.py
official/modeling/optimization/lr_schedule.py
+5
-5
official/modeling/optimization/optimizer_factory.py
official/modeling/optimization/optimizer_factory.py
+1
-1
No files found.
official/legacy/detection/modeling/learning_rates.py
View file @
812ab923
...
...
@@ -61,7 +61,7 @@ class CosineLearningRateWithLinearWarmup(
"""Class to generate learning rate tensor."""
def
__init__
(
self
,
total_steps
,
params
):
"""Creates the co
n
sine learning rate tensor with linear warmup."""
"""Creates the cosine learning rate tensor with linear warmup."""
super
(
CosineLearningRateWithLinearWarmup
,
self
).
__init__
()
self
.
_total_steps
=
total_steps
assert
isinstance
(
params
,
(
dict
,
params_dict
.
ParamsDict
))
...
...
official/legacy/image_classification/learning_rate.py
View file @
812ab923
...
...
@@ -78,7 +78,7 @@ class CosineDecayWithWarmup(tf.keras.optimizers.schedules.LearningRateSchedule):
"""Class to generate learning rate tensor."""
def
__init__
(
self
,
batch_size
:
int
,
total_steps
:
int
,
warmup_steps
:
int
):
"""Creates the co
n
sine learning rate tensor with linear warmup.
"""Creates the cosine learning rate tensor with linear warmup.
Args:
batch_size: The training batch size used in the experiment.
...
...
official/modeling/optimization/configs/learning_rate_config.py
View file @
812ab923
...
...
@@ -216,14 +216,14 @@ class StepCosineLrConfig(base_config.Config):
"""Configuration for stepwise learning rate decay.
This class is a container for the piecewise cosine learning rate scheduling
configs. It will configure an instance of StepCo
n
sineDecayWithOffset keras
configs. It will configure an instance of StepCosineDecayWithOffset keras
learning rate schedule.
```python
boundaries: [100000, 110000]
values: [1.0, 0.5]
lr_decayed_fn = (
lr_schedule.StepCo
n
sineDecayWithOffset(
lr_schedule.StepCosineDecayWithOffset(
boundaries,
values))
```
...
...
@@ -243,7 +243,7 @@ class StepCosineLrConfig(base_config.Config):
[boundaries[n], end] -> values[n+1] to 0.
offset: An int. The offset applied to steps. Defaults to 0.
"""
name
:
str
=
'StepCo
n
sineDecayWithOffset'
name
:
str
=
'StepCosineDecayWithOffset'
boundaries
:
Optional
[
List
[
int
]]
=
None
values
:
Optional
[
List
[
float
]]
=
None
offset
:
int
=
0
...
...
official/modeling/optimization/lr_schedule.py
View file @
812ab923
...
...
@@ -386,11 +386,11 @@ class PowerDecayWithOffset(tf.keras.optimizers.schedules.LearningRateSchedule):
}
class
StepCo
n
sineDecayWithOffset
(
class
StepCosineDecayWithOffset
(
tf
.
keras
.
optimizers
.
schedules
.
LearningRateSchedule
):
"""Stepwise cosine learning rate decay with offset.
Learning rate is equivalent to one or more co
n
sine decay(s) starting and
Learning rate is equivalent to one or more cosine decay(s) starting and
ending at each interval.
ExampleL
...
...
@@ -399,7 +399,7 @@ class StepConsineDecayWithOffset(
boundaries: [100000, 110000]
values: [1.0, 0.5]
lr_decayed_fn = (
lr_schedule.StepCo
n
sineDecayWithOffset(
lr_schedule.StepCosineDecayWithOffset(
boundaries,
values))
```
...
...
@@ -412,7 +412,7 @@ class StepConsineDecayWithOffset(
boundaries
,
values
,
offset
:
int
=
0
,
name
:
str
=
"StepCo
n
sineDecayWithOffset"
):
name
:
str
=
"StepCosineDecayWithOffset"
):
"""Initialize configuration of the learning rate schedule.
Args:
...
...
@@ -444,7 +444,7 @@ class StepConsineDecayWithOffset(
]
+
[
0
])
def
__call__
(
self
,
global_step
):
with
tf
.
name_scope
(
self
.
name
or
"StepCo
n
sineDecayWithOffset"
):
with
tf
.
name_scope
(
self
.
name
or
"StepCosineDecayWithOffset"
):
global_step
=
tf
.
cast
(
global_step
-
self
.
offset
,
tf
.
float32
)
lr_levels
=
self
.
values
lr_steps
=
self
.
boundaries
...
...
official/modeling/optimization/optimizer_factory.py
View file @
812ab923
...
...
@@ -47,7 +47,7 @@ LR_CLS = {
'power'
:
lr_schedule
.
DirectPowerDecay
,
'power_linear'
:
lr_schedule
.
PowerAndLinearDecay
,
'power_with_offset'
:
lr_schedule
.
PowerDecayWithOffset
,
'step_cosine_with_offset'
:
lr_schedule
.
StepCo
n
sineDecayWithOffset
,
'step_cosine_with_offset'
:
lr_schedule
.
StepCosineDecayWithOffset
,
}
WARMUP_CLS
=
{
...
...
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