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
fa382ce1
Commit
fa382ce1
authored
Oct 03, 2021
by
Vishnu Banna
Browse files
task update
parent
3ebf3a66
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
official/vision/beta/projects/yolo/optimization/sgd_torch.py
official/vision/beta/projects/yolo/optimization/sgd_torch.py
+3
-3
No files found.
official/vision/beta/projects/yolo/optimization/sgd_torch.py
View file @
fa382ce1
...
@@ -41,7 +41,8 @@ class SGDTorch(tf.keras.optimizers.Optimizer):
...
@@ -41,7 +41,8 @@ class SGDTorch(tf.keras.optimizers.Optimizer):
Example of usage for training:
Example of usage for training:
```python
```python
opt = SGDTorch(learning_rate)
opt = SGDTorch(learning_rate, weight_decay = 0.0001)
l2_regularization = None
# Models must implement a method to iterate all model.trainable_variables
# Models must implement a method to iterate all model.trainable_variables
# and split the variables by key into the weights, biases, and others.
# and split the variables by key into the weights, biases, and others.
...
@@ -49,7 +50,6 @@ class SGDTorch(tf.keras.optimizers.Optimizer):
...
@@ -49,7 +50,6 @@ class SGDTorch(tf.keras.optimizers.Optimizer):
# and others are included as a way to proved alternate LR scedules to various
# and others are included as a way to proved alternate LR scedules to various
# paramter groups. An example of this variable search can be found in
# paramter groups. An example of this variable search can be found in
# official/vision/beta/projects/yolo/modeling/yolo_model.py.
# official/vision/beta/projects/yolo/modeling/yolo_model.py.
optimizer.search_and_set_variable_groups(model.trainable_variables)
optimizer.search_and_set_variable_groups(model.trainable_variables)
# if the learning rate schedule on the biases are different. if lr is not set
# if the learning rate schedule on the biases are different. if lr is not set
...
@@ -160,7 +160,7 @@ class SGDTorch(tf.keras.optimizers.Optimizer):
...
@@ -160,7 +160,7 @@ class SGDTorch(tf.keras.optimizers.Optimizer):
def
_set_variable_groups
(
self
,
weights
,
biases
,
others
):
def
_set_variable_groups
(
self
,
weights
,
biases
,
others
):
"""Sets the variables to be used in each group."""
"""Sets the variables to be used in each group."""
if
self
.
_variables_set
:
if
self
.
_variables_set
:
logging
.
warning
(
"_set_variable_groups has been called again indicating"
logging
.
warning
(
"_set_variable_groups has been called again indicating"
"that the variable groups have already been set, they"
"that the variable groups have already been set, they"
...
...
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