Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
cc2f9c12
You need to sign in or sign up before continuing.
Commit
cc2f9c12
authored
Jul 12, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix typo in freeze_variables
parent
a77cc508
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
tensorpack/tfutils/varreplace.py
tensorpack/tfutils/varreplace.py
+2
-2
No files found.
tensorpack/tfutils/varreplace.py
View file @
cc2f9c12
...
...
@@ -52,14 +52,14 @@ def remap_variables(fn):
def
freeze_variables
():
"""
Return a context, where all variables (reused or not) returned by
``get_variable`` will have no gradients (they
will be follow
ed by ``tf.stop_gradient``).
``get_variable`` will have no gradients (they
will be wrapp
ed by ``tf.stop_gradient``).
But they will still be in ``TRAINABLE_VARIABLES`` collections so they will get
saved correctly. This is useful to fix certain variables for fine-tuning.
Example:
.. code-block:: python
with varreplace.freeze_
get_
variable():
with varreplace.freeze_variable():
x = FullyConnected('fc', x, 1000) # fc/* will not be trained
"""
return
remap_variables
(
lambda
v
:
tf
.
stop_gradient
(
v
))
...
...
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