"examples/git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "d7a283004e1db3c25cb9eed0d640d427ff771dc6"
Commit 591fa1d7 authored by suiguoxin's avatar suiguoxin
Browse files

update annotation doc; update smartparam sync

parent 9a00a14c
......@@ -41,11 +41,11 @@ There are 10 types to express your search space as follows:
* `@nni.variable(nni.uniform(low, high),name=variable)`
Which means the variable value is a value uniformly between low and high.
* `@nni.variable(nni.quniform(low, high, q),name=variable)`
Which means the variable value is a value like round(uniform(low, high) / q) * q
Which means the variable value is a value like randint(floor((high-low)/q)+1)*q + low
* `@nni.variable(nni.loguniform(low, high),name=variable)`
Which means the variable value is a value drawn according to exp(uniform(low, high)) so that the logarithm of the return value is uniformly distributed.
* `@nni.variable(nni.qloguniform(low, high, q),name=variable)`
Which means the variable value is a value like round(exp(uniform(low, high)) / q) * q
Which means the variable value is a value like floor((loguniform(low, high) - low) / q) * q + low
* `@nni.variable(nni.normal(mu, sigma),name=variable)`
Which means the variable value is a real value that's normally-distributed with mean mu and standard deviation sigma.
* `@nni.variable(nni.qnormal(mu, sigma, q),name=variable)`
......
......@@ -57,6 +57,7 @@ def quniform(low, high, q, random_state):
q: sample step
random_state: an object of numpy.random.RandomState
'''
assert high > low, 'Upper bound must be larger than lower bound'
return randint(np.floor((high-low)/q)+1, random_state) * q + low
......
......@@ -57,14 +57,14 @@ if trial_env_vars.NNI_PLATFORM is None:
def quniform(low, high, q, name=None):
assert high > low, 'Upper bound must be larger than lower bound'
return round(random.uniform(low, high) / q) * q
return randint(np.floor((high-low)/q)+1) * q + low
def loguniform(low, high, name=None):
assert low > 0, 'Lower bound must be positive'
return np.exp(random.uniform(np.log(low), np.log(high)))
def qloguniform(low, high, q, name=None):
return round(loguniform(low, high) / q) * q
return np.floor((loguniform(low, high) - low) / q) * q + low
def normal(mu, sigma, name=None):
return random.gauss(mu, sigma)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment