-
Notifications
You must be signed in to change notification settings - Fork 1.8k
docstr/pylint of GP Tuner & CurveFitting Assessor #1692
Conversation
@@ -100,6 +102,7 @@ def logx_linear(x, a, b): | |||
float | |||
a * np.log(x) + b | |||
""" | |||
# pylint: disable=assignment-from-no-return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed.
@@ -308,6 +308,7 @@ def mcmc_sampling(self): | |||
new_values = np.random.randn(NUM_OF_INSTANCE, self.effective_model_num) * STEP_SIZE + self.weight_samples | |||
new_values = self.normalize_weight(new_values) | |||
# compute alpha(i, j) = min{1, P(j)Q(j, i)/P(i)Q(i, j)} | |||
# pylint: disable=assignment-from-no-return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed. Use latest pylintrc.
""" | ||
GPTuner is a Bayesian Optimization method where Gaussian Process is used for modeling loss functions. | ||
|
||
See : class:`GPTuner` for details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space after colon. :class:`ClassName`
is the syntax of sphinx cross-reference.
|
||
import warnings | ||
import logging | ||
import numpy as np | ||
|
||
# pylint: disable=no-name-in-module, import-error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why ? This is not included in pylintrc
|
||
Parameters | ||
---------- | ||
optimize_mode: str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be a space before colon here. My example was incorrect.
---------- | ||
optimize_mode: str | ||
optimize mode, 'maximize' or 'minimize', by default 'maximize' | ||
utility: str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documented attributes are public APIs. Use underscore name for internal states.
Parameters | ||
---------- | ||
search_space : dict | ||
Override of the abstract method in class:`Tuner`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please build and check html locally.
If this link does not work, it should be :class:`~nni.tuner.Tuner`
.
|
||
Returns | ||
------- | ||
result: tuple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Numpy format "returns" does not include a name.
Updates:
|
src/sdk/pynni/nni/gp_tuner/util.py
Outdated
|
||
Parameters | ||
---------- | ||
vals :numpy array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space after colon
src/sdk/pynni/nni/gp_tuner/util.py
Outdated
|
||
Parameters | ||
---------- | ||
:param f_acq: | ||
param f_acq : UtilityFunction.utility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No param
, it was another docstring format
src/sdk/pynni/nni/gp_tuner/util.py
Outdated
|
||
Parameters | ||
---------- | ||
x: numpy array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space
src/sdk/pynni/nni/gp_tuner/util.py
Outdated
@@ -52,32 +64,33 @@ def acq_max(f_acq, gp, y_max, bounds, space, num_warmup, num_starting_points): | |||
A function to find the maximum of the acquisition function | |||
|
|||
It uses a combination of random sampling (cheap) and the 'L-BFGS-B' | |||
optimization method. First by sampling `n_warmup` (1e5) points at random, | |||
and then running L-BFGS-B from `n_iter` (250) random starting points. | |||
optimization method. First by sampling `num_warmup` points at random, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check if single quote works here
src/sdk/pynni/nni/gp_tuner/util.py
Outdated
return None | ||
|
||
@staticmethod | ||
def _ucb(x, gp, kappa): | ||
""" | ||
Upper Confidence Bound(UCB) utility function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have a space before (
No description provided.