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
53c4db69
Commit
53c4db69
authored
Jan 30, 2018
by
yselivonchyk
Committed by
Yuxin Wu
Jan 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update utils.py (#616)
* Update utils.py Example of deterministic weight initialization * Update utils.py
parent
6ca57de4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
tensorpack/utils/utils.py
tensorpack/utils/utils.py
+13
-0
No files found.
tensorpack/utils/utils.py
View file @
53c4db69
...
@@ -50,6 +50,19 @@ def fix_rng_seed(seed):
...
@@ -50,6 +50,19 @@ def fix_rng_seed(seed):
Note:
Note:
See https://github.com/ppwwyyxx/tensorpack/issues/196.
See https://github.com/ppwwyyxx/tensorpack/issues/196.
Examples:
Fix random seed in both tensorpack and tensorflow.
.. code-block:: python
import tensorpack.utils.utils as utils
seed = 42
utils.fix_rng_seed(seed)
tesnorflow.set_random_seed(seed)
# run trainer
"""
"""
global
_RNG_SEED
global
_RNG_SEED
_RNG_SEED
=
int
(
seed
)
_RNG_SEED
=
int
(
seed
)
...
...
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