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
OpenDAS
nni
Commits
901012eb
"vscode:/vscode.git/clone" did not exist on "331405bead4ea8aaaa1dab7f580cec418c85b6bd"
Commit
901012eb
authored
Nov 09, 2019
by
liuzhe-lz
Committed by
QuanluZhang
Nov 09, 2019
Browse files
docstring fix (#1691)
parent
2d375f43
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
17 deletions
+17
-17
src/sdk/pynni/nni/assessor.py
src/sdk/pynni/nni/assessor.py
+7
-7
src/sdk/pynni/nni/tuner.py
src/sdk/pynni/nni/tuner.py
+10
-10
No files found.
src/sdk/pynni/nni/assessor.py
View file @
901012eb
...
...
@@ -53,14 +53,14 @@ class Assessor(Recoverable):
to tell whether this trial can be early stopped or not.
This is the abstract base class for all assessors.
Early stopping algorithms should
d
eri
ve
this class and override :meth:`assess_trial` method,
Early stopping algorithms should
inh
eri
t
this class and override :meth:`assess_trial` method,
which receives intermediate results from trials and give an assessing result.
If :meth:`assess_trial` returns :obj:`AssessResult.Bad` for a trial,
it hints NNI framework that the trial is likely to result in a poor final accuracy,
and therefore should be killed to save resource.
If an accessor want's to
get
notified when a trial ends, it can also override :meth:`trial_end`.
If an accessor want's to
be
notified when a trial ends, it can also override :meth:`trial_end`.
To write a new assessor, you can reference :class:`~nni.medianstop_assessor.MedianstopAssessor`'s code as an example.
...
...
@@ -77,7 +77,7 @@ class Assessor(Recoverable):
The NNI framework has little guarantee on ``trial_history``.
This method is not guaranteed to be invoked for each time ``trial_history`` get updated.
It is also possible that a trial's history keeps updat
e
ing after receiving a bad result.
It is also possible that a trial's history keeps updating after receiving a bad result.
And if the trial failed and retried, ``trial_history`` may be inconsistent with its previous value.
The only guarantee is that ``trial_history`` is always growing.
...
...
@@ -96,9 +96,9 @@ class Assessor(Recoverable):
Parameters
----------
trial_job_id: str
trial_job_id
: str
Unique identifier of the trial.
trial_history: list
trial_history
: list
Intermediate results of this trial. The element type is decided by trial code.
Returns
...
...
@@ -114,9 +114,9 @@ class Assessor(Recoverable):
Parameters
----------
trial_job_id: str
trial_job_id
: str
Unique identifier of the trial.
success: bool
success
: bool
True if the trial successfully completed; False if failed or terminated.
"""
...
...
src/sdk/pynni/nni/tuner.py
View file @
901012eb
...
...
@@ -42,7 +42,7 @@ class Tuner(Recoverable):
A new trial will run with this configuration.
This is the abstract base class for all tuners.
Tuning algorithms should
d
eri
ve
this class and override :meth:`update_search_space`, :meth:`receive_trial_result`,
Tuning algorithms should
inh
eri
t
this class and override :meth:`update_search_space`, :meth:`receive_trial_result`,
as well as :meth:`generate_parameters` or :meth:`generate_multiple_parameters`.
After initializing, NNI will first call :meth:`update_search_space` to tell tuner the feasible region,
...
...
@@ -96,9 +96,9 @@ class Tuner(Recoverable):
Parameters
----------
parameter_id: int
parameter_id
: int
Unique identifier for requested hyper-parameters. This will later be used in :meth:`receive_trial_result`.
**kwargs
:
**kwargs
Unstable parameters which should be ignored by normal users.
Returns
...
...
@@ -129,10 +129,10 @@ class Tuner(Recoverable):
Parameters
----------
parameter_id_list: list of int
parameter_id_list
: list of int
Unique identifiers for each set of requested hyper-parameters.
These will later be used in :meth:`receive_trial_result`.
**kwargs
:
**kwargs
Unstable parameters which should be ignored by normal users.
Returns
...
...
@@ -159,13 +159,13 @@ class Tuner(Recoverable):
Parameters
----------
parameter_id: int
parameter_id
: int
Unique identifier of used hyper-parameters, same with :meth:`generate_parameters`.
parameters
Hyper-parameters generated by :meth:`generate_parameters`.
value
Result from trial (the return value of :func:`nni.report_final_result`).
**kwargs
:
**kwargs
Unstable parameters which should be ignored by normal users.
"""
raise
NotImplementedError
(
'Tuner: receive_trial_result not implemented'
)
...
...
@@ -186,11 +186,11 @@ class Tuner(Recoverable):
Parameters
----------
parameter_id: int
parameter_id
: int
Unique identifier for hyper-parameters used by this trial.
success: bool
success
: bool
True if the trial successfully completed; False if failed or terminated.
**kwargs
:
**kwargs
Unstable parameters which should be ignored by normal users.
"""
...
...
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