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
00707082
Commit
00707082
authored
Aug 10, 2021
by
Le Hou
Committed by
A. Unique TensorFlower
Aug 10, 2021
Browse files
Internal change
PiperOrigin-RevId: 390025168
parent
7bd3c937
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
official/modeling/fast_training/progressive/policies.py
official/modeling/fast_training/progressive/policies.py
+9
-0
No files found.
official/modeling/fast_training/progressive/policies.py
View file @
00707082
...
@@ -24,10 +24,17 @@ from typing import Any, Mapping
...
@@ -24,10 +24,17 @@ from typing import Any, Mapping
from
absl
import
logging
from
absl
import
logging
import
six
import
six
import
tensorflow
as
tf
import
tensorflow
as
tf
from
tensorflow.python.eager
import
monitoring
from
official.modeling.fast_training.progressive
import
utils
from
official.modeling.fast_training.progressive
import
utils
from
official.modeling.hyperparams
import
base_config
from
official.modeling.hyperparams
import
base_config
_progressive_policy_creation_counter
=
monitoring
.
Counter
(
'/tensorflow/training/fast_training/progressive_policy_creation'
,
'Counter for the number of ProgressivePolicy creations.'
)
@
dataclasses
.
dataclass
@
dataclasses
.
dataclass
class
ProgressiveConfig
(
base_config
.
Config
):
class
ProgressiveConfig
(
base_config
.
Config
):
pass
pass
...
@@ -69,6 +76,8 @@ class ProgressivePolicy:
...
@@ -69,6 +76,8 @@ class ProgressivePolicy:
optimizer
=
self
.
get_optimizer
(
stage_id
),
optimizer
=
self
.
get_optimizer
(
stage_id
),
model
=
self
.
get_model
(
stage_id
,
old_model
=
None
))
model
=
self
.
get_model
(
stage_id
,
old_model
=
None
))
_progressive_policy_creation_counter
.
get_cell
().
increase_by
(
1
)
def
compute_stage_id
(
self
,
global_step
:
int
)
->
int
:
def
compute_stage_id
(
self
,
global_step
:
int
)
->
int
:
for
stage_id
in
range
(
self
.
num_stages
()):
for
stage_id
in
range
(
self
.
num_stages
()):
global_step
-=
self
.
num_steps
(
stage_id
)
global_step
-=
self
.
num_steps
(
stage_id
)
...
...
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