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
24c1ec26
Commit
24c1ec26
authored
Feb 16, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve warning messages when checking the initial parameters
parent
e79d74f8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
tensorpack/callbacks/param.py
tensorpack/callbacks/param.py
+7
-3
No files found.
tensorpack/callbacks/param.py
View file @
24c1ec26
...
@@ -273,10 +273,11 @@ class ScheduledHyperParamSetter(HyperParamSetter):
...
@@ -273,10 +273,11 @@ class ScheduledHyperParamSetter(HyperParamSetter):
v
=
self
.
_get_value_to_set_at_point
(
p
)
or
v
v
=
self
.
_get_value_to_set_at_point
(
p
)
or
v
actual_value
=
self
.
param
.
get_value
()
actual_value
=
self
.
param
.
get_value
()
if
v
is
not
None
and
v
!=
actual_value
:
if
v
is
not
None
and
v
!=
actual_value
:
logger
.
warn
(
"According to
the schedule
, parameter '{}' should become {} at the current point. "
logger
.
warn
(
"According to
scheduler {}
, parameter '{}' should become {} at the current point. "
"However its current value is {}. "
"However its current value is {}. "
"You may want to check whether your initialization of the parameter is as expected"
.
format
(
"If this is the only scheduler being used, you may want to check whether your "
self
.
param
.
readable_name
,
v
,
actual_value
))
"initialization of the parameter is as expected"
.
format
(
self
,
self
.
param
.
readable_name
,
v
,
actual_value
))
def
_get_value_to_set_at_point
(
self
,
point
):
def
_get_value_to_set_at_point
(
self
,
point
):
"""
"""
...
@@ -310,6 +311,9 @@ class ScheduledHyperParamSetter(HyperParamSetter):
...
@@ -310,6 +311,9 @@ class ScheduledHyperParamSetter(HyperParamSetter):
if
self
.
_step
:
if
self
.
_step
:
self
.
trigger
()
self
.
trigger
()
def
__str__
(
self
):
return
"ScheduledHyperParamSetter(schedule={})"
.
format
(
self
.
schedule
)
class
HyperParamSetterWithFunc
(
HyperParamSetter
):
class
HyperParamSetterWithFunc
(
HyperParamSetter
):
""" Set the parameter by a function of epoch num and old value. """
""" Set the parameter by a function of epoch num and old value. """
...
...
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