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
3ebf3a66
"vscode:/vscode.git/clone" did not exist on "4b6506718f0b5d6bd7fef7d94e15877a2b0f7d96"
Commit
3ebf3a66
authored
Oct 03, 2021
by
Vishnu Banna
Browse files
task update
parent
b6c5f6e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
15 deletions
+5
-15
official/vision/beta/projects/yolo/optimization/sgd_torch.py
official/vision/beta/projects/yolo/optimization/sgd_torch.py
+5
-15
No files found.
official/vision/beta/projects/yolo/optimization/sgd_torch.py
View file @
3ebf3a66
...
...
@@ -155,24 +155,14 @@ class SGDTorch(tf.keras.optimizers.Optimizer):
# if all searches fail, add to other group
others
.
append
(
var
)
self
.
set_variable_groups
(
weights
,
biases
,
others
)
self
.
_
set_variable_groups
(
weights
,
biases
,
others
)
return
weights
,
biases
,
others
def
set_variable_groups
(
self
,
weights
,
biases
,
others
):
"""Alterantive to search and set allowing user to manually set each group.
This method is allows the user to bypass the weights, biases and others
search by key, and manually set the values for each group. This is the
safest alternative in cases where the variables cannot be grouped by
searching their names.
Args:
weights: List[tf.Variable] from model.trainable_variables
biases: List[tf.Variable] from model.trainable_variables
others: List[tf.Variable] from model.trainable_variables
"""
def
_set_variable_groups
(
self
,
weights
,
biases
,
others
):
"""Sets the variables to be used in each group."""
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"
"will be updated."
)
self
.
_wset
.
update
(
set
([
_var_key
(
w
)
for
w
in
weights
]))
...
...
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