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
0dabefa2
Commit
0dabefa2
authored
Oct 02, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve docs in StatMonitorParamSetter
parent
72d54fdc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
tensorpack/callbacks/param.py
tensorpack/callbacks/param.py
+9
-5
No files found.
tensorpack/callbacks/param.py
View file @
0dabefa2
...
...
@@ -297,12 +297,15 @@ class StatMonitorParamSetter(HyperParamSetter):
last_k (int): last k epochs.
reverse (bool): monitor increasing instead of decreasing.
This callback will change
param
by ``new_value = value_func(old_value)``, when:
This callback will change
``param``
by ``new_value = value_func(old_value)``, when:
``min(stats) >= stats[0] - threshold``, where
``stats = [stat_name in last k epochs]``
``stats = [the values of stat_name in last k epochs]``
If ``reverse`` is True, it will change the ``param`` when:
``max(stats) <= stats[0] + threshold``.
Example:
If validation error wasn't decreasing for 5 epochs, anneal the learning rate:
If validation error wasn't decreasing for 5 epochs, anneal the learning rate
by 0.2
:
.. code-block:: python
...
...
@@ -334,6 +337,7 @@ class StatMonitorParamSetter(HyperParamSetter):
if
hist_max
>
hist_first
+
self
.
threshold
:
# large enough
return
None
self
.
last_changed_epoch
=
self
.
epoch_num
logger
.
info
(
"[StatMonitorParamSetter] Triggered, history: "
+
','
.
join
(
map
(
str
,
hist
)))
logger
.
info
(
"[StatMonitorParamSetter] Triggered, history of {}: "
.
format
(
self
.
stat_name
)
+
','
.
join
(
map
(
str
,
hist
)))
return
self
.
value_func
(
self
.
get_current_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