repo
stringlengths
7
54
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
20
28.4k
docstring
stringlengths
1
46.3k
docstring_tokens
listlengths
1
1.66k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
summary
stringlengths
4
350
obf_code
stringlengths
7.85k
764k
Microsoft/nni
src/sdk/pynni/nni/gridsearch_tuner/gridsearch_tuner.py
GridSearchTuner.json2paramater
def json2paramater(self, ss_spec): ''' generate all possible configs for hyperparameters from hyperparameter space. ss_spec: hyperparameter space ''' if isinstance(ss_spec, dict): if '_type' in ss_spec.keys(): _type = ss_spec['_type'] _...
python
def json2paramater(self, ss_spec): ''' generate all possible configs for hyperparameters from hyperparameter space. ss_spec: hyperparameter space ''' if isinstance(ss_spec, dict): if '_type' in ss_spec.keys(): _type = ss_spec['_type'] _...
[ "def", "json2paramater", "(", "self", ",", "ss_spec", ")", ":", "if", "isinstance", "(", "ss_spec", ",", "dict", ")", ":", "if", "'_type'", "in", "ss_spec", ".", "keys", "(", ")", ":", "_type", "=", "ss_spec", "[", "'_type'", "]", "_value", "=", "ss_...
generate all possible configs for hyperparameters from hyperparameter space. ss_spec: hyperparameter space
[ "generate", "all", "possible", "configs", "for", "hyperparameters", "from", "hyperparameter", "space", ".", "ss_spec", ":", "hyperparameter", "space" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/gridsearch_tuner/gridsearch_tuner.py#L59-L94
train
generate all possible parameters from hyperparameter space.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/gridsearch_tuner/gridsearch_tuner.py
GridSearchTuner._parse_quniform
def _parse_quniform(self, param_value): '''parse type of quniform parameter and return a list''' if param_value[2] < 2: raise RuntimeError("The number of values sampled (q) should be at least 2") low, high, count = param_value[0], param_value[1], param_value[2] interval = (hi...
python
def _parse_quniform(self, param_value): '''parse type of quniform parameter and return a list''' if param_value[2] < 2: raise RuntimeError("The number of values sampled (q) should be at least 2") low, high, count = param_value[0], param_value[1], param_value[2] interval = (hi...
[ "def", "_parse_quniform", "(", "self", ",", "param_value", ")", ":", "if", "param_value", "[", "2", "]", "<", "2", ":", "raise", "RuntimeError", "(", "\"The number of values sampled (q) should be at least 2\"", ")", "low", ",", "high", ",", "count", "=", "param_...
parse type of quniform parameter and return a list
[ "parse", "type", "of", "quniform", "parameter", "and", "return", "a", "list" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/gridsearch_tuner/gridsearch_tuner.py#L96-L102
train
parse type of quniform parameter and return a list
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/gridsearch_tuner/gridsearch_tuner.py
GridSearchTuner.parse_qtype
def parse_qtype(self, param_type, param_value): '''parse type of quniform or qloguniform''' if param_type == 'quniform': return self._parse_quniform(param_value) if param_type == 'qloguniform': param_value[:2] = np.log(param_value[:2]) return list(np.exp(self....
python
def parse_qtype(self, param_type, param_value): '''parse type of quniform or qloguniform''' if param_type == 'quniform': return self._parse_quniform(param_value) if param_type == 'qloguniform': param_value[:2] = np.log(param_value[:2]) return list(np.exp(self....
[ "def", "parse_qtype", "(", "self", ",", "param_type", ",", "param_value", ")", ":", "if", "param_type", "==", "'quniform'", ":", "return", "self", ".", "_parse_quniform", "(", "param_value", ")", "if", "param_type", "==", "'qloguniform'", ":", "param_value", "...
parse type of quniform or qloguniform
[ "parse", "type", "of", "quniform", "or", "qloguniform" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/gridsearch_tuner/gridsearch_tuner.py#L104-L112
train
parse type of quniform or qloguniform
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/gridsearch_tuner/gridsearch_tuner.py
GridSearchTuner.expand_parameters
def expand_parameters(self, para): ''' Enumerate all possible combinations of all parameters para: {key1: [v11, v12, ...], key2: [v21, v22, ...], ...} return: {{key1: v11, key2: v21, ...}, {key1: v11, key2: v22, ...}, ...} ''' if len(para) == 1: for key, value...
python
def expand_parameters(self, para): ''' Enumerate all possible combinations of all parameters para: {key1: [v11, v12, ...], key2: [v21, v22, ...], ...} return: {{key1: v11, key2: v21, ...}, {key1: v11, key2: v22, ...}, ...} ''' if len(para) == 1: for key, value...
[ "def", "expand_parameters", "(", "self", ",", "para", ")", ":", "if", "len", "(", "para", ")", "==", "1", ":", "for", "key", ",", "values", "in", "para", ".", "items", "(", ")", ":", "return", "list", "(", "map", "(", "lambda", "v", ":", "{", "...
Enumerate all possible combinations of all parameters para: {key1: [v11, v12, ...], key2: [v21, v22, ...], ...} return: {{key1: v11, key2: v21, ...}, {key1: v11, key2: v22, ...}, ...}
[ "Enumerate", "all", "possible", "combinations", "of", "all", "parameters", "para", ":", "{", "key1", ":", "[", "v11", "v12", "...", "]", "key2", ":", "[", "v21", "v22", "...", "]", "...", "}", "return", ":", "{{", "key1", ":", "v11", "key2", ":", "...
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/gridsearch_tuner/gridsearch_tuner.py#L114-L132
train
Expand all possible combinations of all parameters in para and return a list of dicts.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/gridsearch_tuner/gridsearch_tuner.py
GridSearchTuner.import_data
def import_data(self, data): """Import additional data for tuning Parameters ---------- data: a list of dictionarys, each of which has at least two keys, 'parameter' and 'value' """ _completed_num = 0 for trial_info in data: logger.info("I...
python
def import_data(self, data): """Import additional data for tuning Parameters ---------- data: a list of dictionarys, each of which has at least two keys, 'parameter' and 'value' """ _completed_num = 0 for trial_info in data: logger.info("I...
[ "def", "import_data", "(", "self", ",", "data", ")", ":", "_completed_num", "=", "0", "for", "trial_info", "in", "data", ":", "logger", ".", "info", "(", "\"Importing data, current processing progress %s / %s\"", "%", "(", "_completed_num", ",", "len", "(", "dat...
Import additional data for tuning Parameters ---------- data: a list of dictionarys, each of which has at least two keys, 'parameter' and 'value'
[ "Import", "additional", "data", "for", "tuning" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/gridsearch_tuner/gridsearch_tuner.py#L153-L174
train
Import additional data for tuning
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_trial_tool/log_utils.py
nni_log
def nni_log(log_type, log_message): '''Log message into stdout''' dt = datetime.now() print('[{0}] {1} {2}'.format(dt, log_type.value, log_message))
python
def nni_log(log_type, log_message): '''Log message into stdout''' dt = datetime.now() print('[{0}] {1} {2}'.format(dt, log_type.value, log_message))
[ "def", "nni_log", "(", "log_type", ",", "log_message", ")", ":", "dt", "=", "datetime", ".", "now", "(", ")", "print", "(", "'[{0}] {1} {2}'", ".", "format", "(", "dt", ",", "log_type", ".", "value", ",", "log_message", ")", ")" ]
Log message into stdout
[ "Log", "message", "into", "stdout" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_trial_tool/log_utils.py#L54-L57
train
Log message into stdout
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_trial_tool/log_utils.py
RemoteLogger.write
def write(self, buf): ''' Write buffer data into logger/stdout ''' for line in buf.rstrip().splitlines(): self.orig_stdout.write(line.rstrip() + '\n') self.orig_stdout.flush() try: self.logger.log(self.log_level, line.rstrip()) ...
python
def write(self, buf): ''' Write buffer data into logger/stdout ''' for line in buf.rstrip().splitlines(): self.orig_stdout.write(line.rstrip() + '\n') self.orig_stdout.flush() try: self.logger.log(self.log_level, line.rstrip()) ...
[ "def", "write", "(", "self", ",", "buf", ")", ":", "for", "line", "in", "buf", ".", "rstrip", "(", ")", ".", "splitlines", "(", ")", ":", "self", ".", "orig_stdout", ".", "write", "(", "line", ".", "rstrip", "(", ")", "+", "'\\n'", ")", "self", ...
Write buffer data into logger/stdout
[ "Write", "buffer", "data", "into", "logger", "/", "stdout" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_trial_tool/log_utils.py#L106-L116
train
Write buffer data into logger
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_trial_tool/log_utils.py
PipeLogReader.run
def run(self): """Run the thread, logging everything. If the log_collection is 'none', the log content will not be enqueued """ for line in iter(self.pipeReader.readline, ''): self.orig_stdout.write(line.rstrip() + '\n') self.orig_stdout.flush() if ...
python
def run(self): """Run the thread, logging everything. If the log_collection is 'none', the log content will not be enqueued """ for line in iter(self.pipeReader.readline, ''): self.orig_stdout.write(line.rstrip() + '\n') self.orig_stdout.flush() if ...
[ "def", "run", "(", "self", ")", ":", "for", "line", "in", "iter", "(", "self", ".", "pipeReader", ".", "readline", ",", "''", ")", ":", "self", ".", "orig_stdout", ".", "write", "(", "line", ".", "rstrip", "(", ")", "+", "'\\n'", ")", "self", "."...
Run the thread, logging everything. If the log_collection is 'none', the log content will not be enqueued
[ "Run", "the", "thread", "logging", "everything", ".", "If", "the", "log_collection", "is", "none", "the", "log", "content", "will", "not", "be", "enqueued" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_trial_tool/log_utils.py#L168-L181
train
Run the thread logging everything.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/utils.py
extract_scalar_reward
def extract_scalar_reward(value, scalar_key='default'): """ Extract scalar reward from trial result. Raises ------ RuntimeError Incorrect final result: the final result should be float/int, or a dict which has a key named "default" whose value is float/int. """ if isinstance...
python
def extract_scalar_reward(value, scalar_key='default'): """ Extract scalar reward from trial result. Raises ------ RuntimeError Incorrect final result: the final result should be float/int, or a dict which has a key named "default" whose value is float/int. """ if isinstance...
[ "def", "extract_scalar_reward", "(", "value", ",", "scalar_key", "=", "'default'", ")", ":", "if", "isinstance", "(", "value", ",", "float", ")", "or", "isinstance", "(", "value", ",", "int", ")", ":", "reward", "=", "value", "elif", "isinstance", "(", "...
Extract scalar reward from trial result. Raises ------ RuntimeError Incorrect final result: the final result should be float/int, or a dict which has a key named "default" whose value is float/int.
[ "Extract", "scalar", "reward", "from", "trial", "result", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/utils.py#L25-L41
train
Extract scalar reward from trial result.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/utils.py
convert_dict2tuple
def convert_dict2tuple(value): """ convert dict type to tuple to solve unhashable problem. """ if isinstance(value, dict): for _keys in value: value[_keys] = convert_dict2tuple(value[_keys]) return tuple(sorted(value.items())) else: return value
python
def convert_dict2tuple(value): """ convert dict type to tuple to solve unhashable problem. """ if isinstance(value, dict): for _keys in value: value[_keys] = convert_dict2tuple(value[_keys]) return tuple(sorted(value.items())) else: return value
[ "def", "convert_dict2tuple", "(", "value", ")", ":", "if", "isinstance", "(", "value", ",", "dict", ")", ":", "for", "_keys", "in", "value", ":", "value", "[", "_keys", "]", "=", "convert_dict2tuple", "(", "value", "[", "_keys", "]", ")", "return", "tu...
convert dict type to tuple to solve unhashable problem.
[ "convert", "dict", "type", "to", "tuple", "to", "solve", "unhashable", "problem", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/utils.py#L43-L52
train
convert dict type to tuple
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/utils.py
init_dispatcher_logger
def init_dispatcher_logger(): """ Initialize dispatcher logging configuration""" logger_file_path = 'dispatcher.log' if dispatcher_env_vars.NNI_LOG_DIRECTORY is not None: logger_file_path = os.path.join(dispatcher_env_vars.NNI_LOG_DIRECTORY, logger_file_path) init_logger(logger_file_path, dispat...
python
def init_dispatcher_logger(): """ Initialize dispatcher logging configuration""" logger_file_path = 'dispatcher.log' if dispatcher_env_vars.NNI_LOG_DIRECTORY is not None: logger_file_path = os.path.join(dispatcher_env_vars.NNI_LOG_DIRECTORY, logger_file_path) init_logger(logger_file_path, dispat...
[ "def", "init_dispatcher_logger", "(", ")", ":", "logger_file_path", "=", "'dispatcher.log'", "if", "dispatcher_env_vars", ".", "NNI_LOG_DIRECTORY", "is", "not", "None", ":", "logger_file_path", "=", "os", ".", "path", ".", "join", "(", "dispatcher_env_vars", ".", ...
Initialize dispatcher logging configuration
[ "Initialize", "dispatcher", "logging", "configuration" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/utils.py#L54-L59
train
Initialize dispatcher logging configuration
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/bohb_advisor/config_generator.py
CG_BOHB.sample_from_largest_budget
def sample_from_largest_budget(self, info_dict): """We opted for a single multidimensional KDE compared to the hierarchy of one-dimensional KDEs used in TPE. The dimensional is seperated by budget. This function sample a configuration from largest budget. Firstly we sample "num_samples" ...
python
def sample_from_largest_budget(self, info_dict): """We opted for a single multidimensional KDE compared to the hierarchy of one-dimensional KDEs used in TPE. The dimensional is seperated by budget. This function sample a configuration from largest budget. Firstly we sample "num_samples" ...
[ "def", "sample_from_largest_budget", "(", "self", ",", "info_dict", ")", ":", "best", "=", "np", ".", "inf", "best_vector", "=", "None", "budget", "=", "max", "(", "self", ".", "kde_models", ".", "keys", "(", ")", ")", "l", "=", "self", ".", "kde_model...
We opted for a single multidimensional KDE compared to the hierarchy of one-dimensional KDEs used in TPE. The dimensional is seperated by budget. This function sample a configuration from largest budget. Firstly we sample "num_samples" configurations, then prefer one with the largest l(x...
[ "We", "opted", "for", "a", "single", "multidimensional", "KDE", "compared", "to", "the", "hierarchy", "of", "one", "-", "dimensional", "KDEs", "used", "in", "TPE", ".", "The", "dimensional", "is", "seperated", "by", "budget", ".", "This", "function", "sample...
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/bohb_advisor/config_generator.py#L114-L205
train
This function sample a configuration from the largest budget.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/bohb_advisor/config_generator.py
CG_BOHB.get_config
def get_config(self, budget): """Function to sample a new configuration This function is called inside BOHB to query a new configuration Parameters: ----------- budget: float the budget for which this configuration is scheduled Returns ------- ...
python
def get_config(self, budget): """Function to sample a new configuration This function is called inside BOHB to query a new configuration Parameters: ----------- budget: float the budget for which this configuration is scheduled Returns ------- ...
[ "def", "get_config", "(", "self", ",", "budget", ")", ":", "logger", ".", "debug", "(", "'start sampling a new configuration.'", ")", "sample", "=", "None", "info_dict", "=", "{", "}", "# If no model is available, sample from prior", "# also mix in a fraction of random co...
Function to sample a new configuration This function is called inside BOHB to query a new configuration Parameters: ----------- budget: float the budget for which this configuration is scheduled Returns ------- config return a valid confi...
[ "Function", "to", "sample", "a", "new", "configuration", "This", "function", "is", "called", "inside", "BOHB", "to", "query", "a", "new", "configuration" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/bohb_advisor/config_generator.py#L207-L241
train
Function to sample a new configuration from the configspace
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/bohb_advisor/config_generator.py
CG_BOHB.new_result
def new_result(self, loss, budget, parameters, update_model=True): """ Function to register finished runs. Every time a run has finished, this function should be called to register it with the loss. Parameters: ----------- loss: float the loss of the paramete...
python
def new_result(self, loss, budget, parameters, update_model=True): """ Function to register finished runs. Every time a run has finished, this function should be called to register it with the loss. Parameters: ----------- loss: float the loss of the paramete...
[ "def", "new_result", "(", "self", ",", "loss", ",", "budget", ",", "parameters", ",", "update_model", "=", "True", ")", ":", "if", "loss", "is", "None", ":", "# One could skip crashed results, but we decided", "# assign a +inf loss and count them as bad configurations", ...
Function to register finished runs. Every time a run has finished, this function should be called to register it with the loss. Parameters: ----------- loss: float the loss of the parameters budget: float the budget of the parameters parameters: d...
[ "Function", "to", "register", "finished", "runs", ".", "Every", "time", "a", "run", "has", "finished", "this", "function", "should", "be", "called", "to", "register", "it", "with", "the", "loss", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/bohb_advisor/config_generator.py#L266-L349
train
Function to register finished runs and update the model with the new result.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/batch_tuner/batch_tuner.py
BatchTuner.is_valid
def is_valid(self, search_space): """ Check the search space is valid: only contains 'choice' type Parameters ---------- search_space : dict """ if not len(search_space) == 1: raise RuntimeError('BatchTuner only supprt one combined-paramreters...
python
def is_valid(self, search_space): """ Check the search space is valid: only contains 'choice' type Parameters ---------- search_space : dict """ if not len(search_space) == 1: raise RuntimeError('BatchTuner only supprt one combined-paramreters...
[ "def", "is_valid", "(", "self", ",", "search_space", ")", ":", "if", "not", "len", "(", "search_space", ")", "==", "1", ":", "raise", "RuntimeError", "(", "'BatchTuner only supprt one combined-paramreters key.'", ")", "for", "param", "in", "search_space", ":", "...
Check the search space is valid: only contains 'choice' type Parameters ---------- search_space : dict
[ "Check", "the", "search", "space", "is", "valid", ":", "only", "contains", "choice", "type", "Parameters", "----------", "search_space", ":", "dict" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/batch_tuner/batch_tuner.py#L54-L73
train
Check the search space is valid.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/batch_tuner/batch_tuner.py
BatchTuner.generate_parameters
def generate_parameters(self, parameter_id): """Returns a dict of trial (hyper-)parameters, as a serializable object. Parameters ---------- parameter_id : int """ self.count +=1 if self.count>len(self.values)-1: raise nni.NoMoreTrialError('no more par...
python
def generate_parameters(self, parameter_id): """Returns a dict of trial (hyper-)parameters, as a serializable object. Parameters ---------- parameter_id : int """ self.count +=1 if self.count>len(self.values)-1: raise nni.NoMoreTrialError('no more par...
[ "def", "generate_parameters", "(", "self", ",", "parameter_id", ")", ":", "self", ".", "count", "+=", "1", "if", "self", ".", "count", ">", "len", "(", "self", ".", "values", ")", "-", "1", ":", "raise", "nni", ".", "NoMoreTrialError", "(", "'no more p...
Returns a dict of trial (hyper-)parameters, as a serializable object. Parameters ---------- parameter_id : int
[ "Returns", "a", "dict", "of", "trial", "(", "hyper", "-", ")", "parameters", "as", "a", "serializable", "object", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/batch_tuner/batch_tuner.py#L84-L94
train
Returns a dict of trial ( hyper - ) parameters as a serializable object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
examples/trials/weight_sharing/ga_squad/graph_to_tf.py
normalize
def normalize(inputs, epsilon=1e-8, scope="ln"): '''Applies layer normalization. Args: inputs: A tensor with 2 or more dimensions, where the first dimension has `batch_size`. epsilon: A floating number. A very small number for preventing ZeroDivision Error. ...
python
def normalize(inputs, epsilon=1e-8, scope="ln"): '''Applies layer normalization. Args: inputs: A tensor with 2 or more dimensions, where the first dimension has `batch_size`. epsilon: A floating number. A very small number for preventing ZeroDivision Error. ...
[ "def", "normalize", "(", "inputs", ",", "epsilon", "=", "1e-8", ",", "scope", "=", "\"ln\"", ")", ":", "with", "tf", ".", "variable_scope", "(", "scope", ")", ":", "inputs_shape", "=", "inputs", ".", "get_shape", "(", ")", "params_shape", "=", "inputs_sh...
Applies layer normalization. Args: inputs: A tensor with 2 or more dimensions, where the first dimension has `batch_size`. epsilon: A floating number. A very small number for preventing ZeroDivision Error. scope: Optional scope for `variable_scope`. reuse: Boolean, whether to reuse ...
[ "Applies", "layer", "normalization", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/examples/trials/weight_sharing/ga_squad/graph_to_tf.py#L28-L54
train
Applies layer normalization.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
examples/trials/weight_sharing/ga_squad/graph_to_tf.py
multihead_attention
def multihead_attention(queries, keys, scope="multihead_attention", num_units=None, num_heads=4, dropout_rate=0, is_training=True, causality=False): ...
python
def multihead_attention(queries, keys, scope="multihead_attention", num_units=None, num_heads=4, dropout_rate=0, is_training=True, causality=False): ...
[ "def", "multihead_attention", "(", "queries", ",", "keys", ",", "scope", "=", "\"multihead_attention\"", ",", "num_units", "=", "None", ",", "num_heads", "=", "4", ",", "dropout_rate", "=", "0", ",", "is_training", "=", "True", ",", "causality", "=", "False"...
Applies multihead attention. Args: queries: A 3d tensor with shape of [N, T_q, C_q]. keys: A 3d tensor with shape of [N, T_k, C_k]. num_units: A cdscalar. Attention size. dropout_rate: A floating point number. is_training: Boolean. Controller of mechanism for dropout. causality:...
[ "Applies", "multihead", "attention", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/examples/trials/weight_sharing/ga_squad/graph_to_tf.py#L57-L164
train
Applies multihead attention.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
examples/trials/weight_sharing/ga_squad/graph_to_tf.py
positional_encoding
def positional_encoding(inputs, num_units=None, zero_pad=True, scale=True, scope="positional_encoding", reuse=None): ''' Return positinal embedding. ''' Shape = tf.shape(inputs) N ...
python
def positional_encoding(inputs, num_units=None, zero_pad=True, scale=True, scope="positional_encoding", reuse=None): ''' Return positinal embedding. ''' Shape = tf.shape(inputs) N ...
[ "def", "positional_encoding", "(", "inputs", ",", "num_units", "=", "None", ",", "zero_pad", "=", "True", ",", "scale", "=", "True", ",", "scope", "=", "\"positional_encoding\"", ",", "reuse", "=", "None", ")", ":", "Shape", "=", "tf", ".", "shape", "(",...
Return positinal embedding.
[ "Return", "positinal", "embedding", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/examples/trials/weight_sharing/ga_squad/graph_to_tf.py#L167-L205
train
Returns a tensor of the positinal embedding of the object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
examples/trials/weight_sharing/ga_squad/graph_to_tf.py
feedforward
def feedforward(inputs, num_units, scope="multihead_attention"): '''Point-wise feed forward net. Args: inputs: A 3d tensor with shape of [N, T, C]. num_units: A list of two integers. scope: Optional scope for `variable_scope`. reuse: Boolean, whether to r...
python
def feedforward(inputs, num_units, scope="multihead_attention"): '''Point-wise feed forward net. Args: inputs: A 3d tensor with shape of [N, T, C]. num_units: A list of two integers. scope: Optional scope for `variable_scope`. reuse: Boolean, whether to r...
[ "def", "feedforward", "(", "inputs", ",", "num_units", ",", "scope", "=", "\"multihead_attention\"", ")", ":", "with", "tf", ".", "variable_scope", "(", "scope", ")", ":", "# Inner layer", "params", "=", "{", "\"inputs\"", ":", "inputs", ",", "\"filters\"", ...
Point-wise feed forward net. Args: inputs: A 3d tensor with shape of [N, T, C]. num_units: A list of two integers. scope: Optional scope for `variable_scope`. reuse: Boolean, whether to reuse the weights of a previous layer by the same name. Returns: A 3d tensor with the ...
[ "Point", "-", "wise", "feed", "forward", "net", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/examples/trials/weight_sharing/ga_squad/graph_to_tf.py#L208-L240
train
Point - wise feed forward net.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_annotation/search_space_generator.py
generate
def generate(module_name, code): """Generate search space. Return a serializable search space object. module_name: name of the module (str) code: user code (str) """ try: ast_tree = ast.parse(code) except Exception: raise RuntimeError('Bad Python code') visitor = SearchS...
python
def generate(module_name, code): """Generate search space. Return a serializable search space object. module_name: name of the module (str) code: user code (str) """ try: ast_tree = ast.parse(code) except Exception: raise RuntimeError('Bad Python code') visitor = SearchS...
[ "def", "generate", "(", "module_name", ",", "code", ")", ":", "try", ":", "ast_tree", "=", "ast", ".", "parse", "(", "code", ")", "except", "Exception", ":", "raise", "RuntimeError", "(", "'Bad Python code'", ")", "visitor", "=", "SearchSpaceGenerator", "(",...
Generate search space. Return a serializable search space object. module_name: name of the module (str) code: user code (str)
[ "Generate", "search", "space", ".", "Return", "a", "serializable", "search", "space", "object", ".", "module_name", ":", "name", "of", "the", "module", "(", "str", ")", "code", ":", "user", "code", "(", "str", ")" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_annotation/search_space_generator.py#L114-L130
train
Generate search space object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/rest_utils.py
rest_put
def rest_put(url, data, timeout, show_error=False): '''Call rest put method''' try: response = requests.put(url, headers={'Accept': 'application/json', 'Content-Type': 'application/json'},\ data=data, timeout=timeout) return response except Exception as except...
python
def rest_put(url, data, timeout, show_error=False): '''Call rest put method''' try: response = requests.put(url, headers={'Accept': 'application/json', 'Content-Type': 'application/json'},\ data=data, timeout=timeout) return response except Exception as except...
[ "def", "rest_put", "(", "url", ",", "data", ",", "timeout", ",", "show_error", "=", "False", ")", ":", "try", ":", "response", "=", "requests", ".", "put", "(", "url", ",", "headers", "=", "{", "'Accept'", ":", "'application/json'", ",", "'Content-Type'"...
Call rest put method
[ "Call", "rest", "put", "method" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/rest_utils.py#L28-L37
train
Call rest put method
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/rest_utils.py
rest_post
def rest_post(url, data, timeout, show_error=False): '''Call rest post method''' try: response = requests.post(url, headers={'Accept': 'application/json', 'Content-Type': 'application/json'},\ data=data, timeout=timeout) return response except Exception as ex...
python
def rest_post(url, data, timeout, show_error=False): '''Call rest post method''' try: response = requests.post(url, headers={'Accept': 'application/json', 'Content-Type': 'application/json'},\ data=data, timeout=timeout) return response except Exception as ex...
[ "def", "rest_post", "(", "url", ",", "data", ",", "timeout", ",", "show_error", "=", "False", ")", ":", "try", ":", "response", "=", "requests", ".", "post", "(", "url", ",", "headers", "=", "{", "'Accept'", ":", "'application/json'", ",", "'Content-Type...
Call rest post method
[ "Call", "rest", "post", "method" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/rest_utils.py#L39-L48
train
Call rest post method
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/rest_utils.py
rest_get
def rest_get(url, timeout, show_error=False): '''Call rest get method''' try: response = requests.get(url, timeout=timeout) return response except Exception as exception: if show_error: print_error(exception) return None
python
def rest_get(url, timeout, show_error=False): '''Call rest get method''' try: response = requests.get(url, timeout=timeout) return response except Exception as exception: if show_error: print_error(exception) return None
[ "def", "rest_get", "(", "url", ",", "timeout", ",", "show_error", "=", "False", ")", ":", "try", ":", "response", "=", "requests", ".", "get", "(", "url", ",", "timeout", "=", "timeout", ")", "return", "response", "except", "Exception", "as", "exception"...
Call rest get method
[ "Call", "rest", "get", "method" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/rest_utils.py#L50-L58
train
Call rest get method
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/rest_utils.py
rest_delete
def rest_delete(url, timeout, show_error=False): '''Call rest delete method''' try: response = requests.delete(url, timeout=timeout) return response except Exception as exception: if show_error: print_error(exception) return None
python
def rest_delete(url, timeout, show_error=False): '''Call rest delete method''' try: response = requests.delete(url, timeout=timeout) return response except Exception as exception: if show_error: print_error(exception) return None
[ "def", "rest_delete", "(", "url", ",", "timeout", ",", "show_error", "=", "False", ")", ":", "try", ":", "response", "=", "requests", ".", "delete", "(", "url", ",", "timeout", "=", "timeout", ")", "return", "response", "except", "Exception", "as", "exce...
Call rest delete method
[ "Call", "rest", "delete", "method" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/rest_utils.py#L60-L68
train
Call rest delete method
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/rest_utils.py
check_rest_server
def check_rest_server(rest_port): '''Check if restful server is ready''' retry_count = 5 for _ in range(retry_count): response = rest_get(check_status_url(rest_port), REST_TIME_OUT) if response: if response.status_code == 200: return True, response els...
python
def check_rest_server(rest_port): '''Check if restful server is ready''' retry_count = 5 for _ in range(retry_count): response = rest_get(check_status_url(rest_port), REST_TIME_OUT) if response: if response.status_code == 200: return True, response els...
[ "def", "check_rest_server", "(", "rest_port", ")", ":", "retry_count", "=", "5", "for", "_", "in", "range", "(", "retry_count", ")", ":", "response", "=", "rest_get", "(", "check_status_url", "(", "rest_port", ")", ",", "REST_TIME_OUT", ")", "if", "response"...
Check if restful server is ready
[ "Check", "if", "restful", "server", "is", "ready" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/rest_utils.py#L70-L82
train
Check if restful server is ready
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/rest_utils.py
check_rest_server_quick
def check_rest_server_quick(rest_port): '''Check if restful server is ready, only check once''' response = rest_get(check_status_url(rest_port), 5) if response and response.status_code == 200: return True, response return False, None
python
def check_rest_server_quick(rest_port): '''Check if restful server is ready, only check once''' response = rest_get(check_status_url(rest_port), 5) if response and response.status_code == 200: return True, response return False, None
[ "def", "check_rest_server_quick", "(", "rest_port", ")", ":", "response", "=", "rest_get", "(", "check_status_url", "(", "rest_port", ")", ",", "5", ")", "if", "response", "and", "response", ".", "status_code", "==", "200", ":", "return", "True", ",", "respo...
Check if restful server is ready, only check once
[ "Check", "if", "restful", "server", "is", "ready", "only", "check", "once" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/rest_utils.py#L84-L89
train
Check if restful server is ready only check once
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/curvefitting_assessor/curvefunctions.py
vap
def vap(x, a, b, c): """Vapor pressure model Parameters ---------- x: int a: float b: float c: float Returns ------- float np.exp(a+b/x+c*np.log(x)) """ return np.exp(a+b/x+c*np.log(x))
python
def vap(x, a, b, c): """Vapor pressure model Parameters ---------- x: int a: float b: float c: float Returns ------- float np.exp(a+b/x+c*np.log(x)) """ return np.exp(a+b/x+c*np.log(x))
[ "def", "vap", "(", "x", ",", "a", ",", "b", ",", "c", ")", ":", "return", "np", ".", "exp", "(", "a", "+", "b", "/", "x", "+", "c", "*", "np", ".", "log", "(", "x", ")", ")" ]
Vapor pressure model Parameters ---------- x: int a: float b: float c: float Returns ------- float np.exp(a+b/x+c*np.log(x))
[ "Vapor", "pressure", "model", "Parameters", "----------", "x", ":", "int", "a", ":", "float", "b", ":", "float", "c", ":", "float" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/curvefitting_assessor/curvefunctions.py#L27-L42
train
Vapor pressure model.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/curvefitting_assessor/curvefunctions.py
logx_linear
def logx_linear(x, a, b): """logx linear Parameters ---------- x: int a: float b: float Returns ------- float a * np.log(x) + b """ x = np.log(x) return a*x + b
python
def logx_linear(x, a, b): """logx linear Parameters ---------- x: int a: float b: float Returns ------- float a * np.log(x) + b """ x = np.log(x) return a*x + b
[ "def", "logx_linear", "(", "x", ",", "a", ",", "b", ")", ":", "x", "=", "np", ".", "log", "(", "x", ")", "return", "a", "*", "x", "+", "b" ]
logx linear Parameters ---------- x: int a: float b: float Returns ------- float a * np.log(x) + b
[ "logx", "linear" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/curvefitting_assessor/curvefunctions.py#L89-L104
train
logx linear implementation of log
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/curvefitting_assessor/curvefunctions.py
dr_hill_zero_background
def dr_hill_zero_background(x, theta, eta, kappa): """dr hill zero background Parameters ---------- x: int theta: float eta: float kappa: float Returns ------- float (theta* x**eta) / (kappa**eta + x**eta) """ return (theta* x**eta) / (kappa**eta + x**eta)
python
def dr_hill_zero_background(x, theta, eta, kappa): """dr hill zero background Parameters ---------- x: int theta: float eta: float kappa: float Returns ------- float (theta* x**eta) / (kappa**eta + x**eta) """ return (theta* x**eta) / (kappa**eta + x**eta)
[ "def", "dr_hill_zero_background", "(", "x", ",", "theta", ",", "eta", ",", "kappa", ")", ":", "return", "(", "theta", "*", "x", "**", "eta", ")", "/", "(", "kappa", "**", "eta", "+", "x", "**", "eta", ")" ]
dr hill zero background Parameters ---------- x: int theta: float eta: float kappa: float Returns ------- float (theta* x**eta) / (kappa**eta + x**eta)
[ "dr", "hill", "zero", "background", "Parameters", "----------", "x", ":", "int", "theta", ":", "float", "eta", ":", "float", "kappa", ":", "float" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/curvefitting_assessor/curvefunctions.py#L110-L125
train
dr hill zero background
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/curvefitting_assessor/curvefunctions.py
log_power
def log_power(x, a, b, c): """"logistic power Parameters ---------- x: int a: float b: float c: float Returns ------- float a/(1.+(x/np.exp(b))**c) """ return a/(1.+(x/np.exp(b))**c)
python
def log_power(x, a, b, c): """"logistic power Parameters ---------- x: int a: float b: float c: float Returns ------- float a/(1.+(x/np.exp(b))**c) """ return a/(1.+(x/np.exp(b))**c)
[ "def", "log_power", "(", "x", ",", "a", ",", "b", ",", "c", ")", ":", "return", "a", "/", "(", "1.", "+", "(", "x", "/", "np", ".", "exp", "(", "b", ")", ")", "**", "c", ")" ]
logistic power Parameters ---------- x: int a: float b: float c: float Returns ------- float a/(1.+(x/np.exp(b))**c)
[ "logistic", "power" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/curvefitting_assessor/curvefunctions.py#L131-L146
train
logistic power of a random variates.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/curvefitting_assessor/curvefunctions.py
pow4
def pow4(x, alpha, a, b, c): """pow4 Parameters ---------- x: int alpha: float a: float b: float c: float Returns ------- float c - (a*x+b)**-alpha """ return c - (a*x+b)**-alpha
python
def pow4(x, alpha, a, b, c): """pow4 Parameters ---------- x: int alpha: float a: float b: float c: float Returns ------- float c - (a*x+b)**-alpha """ return c - (a*x+b)**-alpha
[ "def", "pow4", "(", "x", ",", "alpha", ",", "a", ",", "b", ",", "c", ")", ":", "return", "c", "-", "(", "a", "*", "x", "+", "b", ")", "**", "-", "alpha" ]
pow4 Parameters ---------- x: int alpha: float a: float b: float c: float Returns ------- float c - (a*x+b)**-alpha
[ "pow4" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/curvefitting_assessor/curvefunctions.py#L152-L168
train
pow4 - 4 function.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/curvefitting_assessor/curvefunctions.py
mmf
def mmf(x, alpha, beta, kappa, delta): """Morgan-Mercer-Flodin http://www.pisces-conservation.com/growthhelp/index.html?morgan_mercer_floden.htm Parameters ---------- x: int alpha: float beta: float kappa: float delta: float Returns ------- float alpha - (alpha ...
python
def mmf(x, alpha, beta, kappa, delta): """Morgan-Mercer-Flodin http://www.pisces-conservation.com/growthhelp/index.html?morgan_mercer_floden.htm Parameters ---------- x: int alpha: float beta: float kappa: float delta: float Returns ------- float alpha - (alpha ...
[ "def", "mmf", "(", "x", ",", "alpha", ",", "beta", ",", "kappa", ",", "delta", ")", ":", "return", "alpha", "-", "(", "alpha", "-", "beta", ")", "/", "(", "1.", "+", "(", "kappa", "*", "x", ")", "**", "delta", ")" ]
Morgan-Mercer-Flodin http://www.pisces-conservation.com/growthhelp/index.html?morgan_mercer_floden.htm Parameters ---------- x: int alpha: float beta: float kappa: float delta: float Returns ------- float alpha - (alpha - beta) / (1. + (kappa * x)**delta)
[ "Morgan", "-", "Mercer", "-", "Flodin", "http", ":", "//", "www", ".", "pisces", "-", "conservation", ".", "com", "/", "growthhelp", "/", "index", ".", "html?morgan_mercer_floden", ".", "htm" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/curvefitting_assessor/curvefunctions.py#L174-L191
train
Returns the mmf of a single node.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/curvefitting_assessor/curvefunctions.py
weibull
def weibull(x, alpha, beta, kappa, delta): """Weibull model http://www.pisces-conservation.com/growthhelp/index.html?morgan_mercer_floden.htm Parameters ---------- x: int alpha: float beta: float kappa: float delta: float Returns ------- float alpha - (alpha - b...
python
def weibull(x, alpha, beta, kappa, delta): """Weibull model http://www.pisces-conservation.com/growthhelp/index.html?morgan_mercer_floden.htm Parameters ---------- x: int alpha: float beta: float kappa: float delta: float Returns ------- float alpha - (alpha - b...
[ "def", "weibull", "(", "x", ",", "alpha", ",", "beta", ",", "kappa", ",", "delta", ")", ":", "return", "alpha", "-", "(", "alpha", "-", "beta", ")", "*", "np", ".", "exp", "(", "-", "(", "kappa", "*", "x", ")", "**", "delta", ")" ]
Weibull model http://www.pisces-conservation.com/growthhelp/index.html?morgan_mercer_floden.htm Parameters ---------- x: int alpha: float beta: float kappa: float delta: float Returns ------- float alpha - (alpha - beta) * np.exp(-(kappa * x)**delta)
[ "Weibull", "model", "http", ":", "//", "www", ".", "pisces", "-", "conservation", ".", "com", "/", "growthhelp", "/", "index", ".", "html?morgan_mercer_floden", ".", "htm" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/curvefitting_assessor/curvefunctions.py#L239-L256
train
Weibull model for the given parameter x.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/curvefitting_assessor/curvefunctions.py
janoschek
def janoschek(x, a, beta, k, delta): """http://www.pisces-conservation.com/growthhelp/janoschek.htm Parameters ---------- x: int a: float beta: float k: float delta: float Returns ------- float a - (a - beta) * np.exp(-k*x**delta) """ return a - (a - bet...
python
def janoschek(x, a, beta, k, delta): """http://www.pisces-conservation.com/growthhelp/janoschek.htm Parameters ---------- x: int a: float beta: float k: float delta: float Returns ------- float a - (a - beta) * np.exp(-k*x**delta) """ return a - (a - bet...
[ "def", "janoschek", "(", "x", ",", "a", ",", "beta", ",", "k", ",", "delta", ")", ":", "return", "a", "-", "(", "a", "-", "beta", ")", "*", "np", ".", "exp", "(", "-", "k", "*", "x", "**", "delta", ")" ]
http://www.pisces-conservation.com/growthhelp/janoschek.htm Parameters ---------- x: int a: float beta: float k: float delta: float Returns ------- float a - (a - beta) * np.exp(-k*x**delta)
[ "http", ":", "//", "www", ".", "pisces", "-", "conservation", ".", "com", "/", "growthhelp", "/", "janoschek", ".", "htm", "Parameters", "----------", "x", ":", "int", "a", ":", "float", "beta", ":", "float", "k", ":", "float", "delta", ":", "float" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/curvefitting_assessor/curvefunctions.py#L262-L278
train
A function that computes the Janoschek distribution.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/nnictl.py
parse_args
def parse_args(): '''Definite the arguments users need to follow and input''' parser = argparse.ArgumentParser(prog='nnictl', description='use nnictl command to control nni experiments') parser.add_argument('--version', '-v', action='store_true') parser.set_defaults(func=nni_info) # create subparse...
python
def parse_args(): '''Definite the arguments users need to follow and input''' parser = argparse.ArgumentParser(prog='nnictl', description='use nnictl command to control nni experiments') parser.add_argument('--version', '-v', action='store_true') parser.set_defaults(func=nni_info) # create subparse...
[ "def", "parse_args", "(", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "prog", "=", "'nnictl'", ",", "description", "=", "'use nnictl command to control nni experiments'", ")", "parser", ".", "add_argument", "(", "'--version'", ",", "'-v'", ","...
Definite the arguments users need to follow and input
[ "Definite", "the", "arguments", "users", "need", "to", "follow", "and", "input" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/nnictl.py#L46-L198
train
Define the arguments users need to follow and input
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/launcher.py
get_log_path
def get_log_path(config_file_name): '''generate stdout and stderr log path''' stdout_full_path = os.path.join(NNICTL_HOME_DIR, config_file_name, 'stdout') stderr_full_path = os.path.join(NNICTL_HOME_DIR, config_file_name, 'stderr') return stdout_full_path, stderr_full_path
python
def get_log_path(config_file_name): '''generate stdout and stderr log path''' stdout_full_path = os.path.join(NNICTL_HOME_DIR, config_file_name, 'stdout') stderr_full_path = os.path.join(NNICTL_HOME_DIR, config_file_name, 'stderr') return stdout_full_path, stderr_full_path
[ "def", "get_log_path", "(", "config_file_name", ")", ":", "stdout_full_path", "=", "os", ".", "path", ".", "join", "(", "NNICTL_HOME_DIR", ",", "config_file_name", ",", "'stdout'", ")", "stderr_full_path", "=", "os", ".", "path", ".", "join", "(", "NNICTL_HOME...
generate stdout and stderr log path
[ "generate", "stdout", "and", "stderr", "log", "path" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/launcher.py#L43-L47
train
generate stdout and stderr log path
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/launcher.py
print_log_content
def print_log_content(config_file_name): '''print log information''' stdout_full_path, stderr_full_path = get_log_path(config_file_name) print_normal(' Stdout:') print(check_output_command(stdout_full_path)) print('\n\n') print_normal(' Stderr:') print(check_output_command(stderr_full_path))
python
def print_log_content(config_file_name): '''print log information''' stdout_full_path, stderr_full_path = get_log_path(config_file_name) print_normal(' Stdout:') print(check_output_command(stdout_full_path)) print('\n\n') print_normal(' Stderr:') print(check_output_command(stderr_full_path))
[ "def", "print_log_content", "(", "config_file_name", ")", ":", "stdout_full_path", ",", "stderr_full_path", "=", "get_log_path", "(", "config_file_name", ")", "print_normal", "(", "' Stdout:'", ")", "print", "(", "check_output_command", "(", "stdout_full_path", ")", "...
print log information
[ "print", "log", "information" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/launcher.py#L49-L56
train
print log content
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/launcher.py
start_rest_server
def start_rest_server(port, platform, mode, config_file_name, experiment_id=None, log_dir=None, log_level=None): '''Run nni manager process''' nni_config = Config(config_file_name) if detect_port(port): print_error('Port %s is used by another process, please reset the port!\n' \ 'You could u...
python
def start_rest_server(port, platform, mode, config_file_name, experiment_id=None, log_dir=None, log_level=None): '''Run nni manager process''' nni_config = Config(config_file_name) if detect_port(port): print_error('Port %s is used by another process, please reset the port!\n' \ 'You could u...
[ "def", "start_rest_server", "(", "port", ",", "platform", ",", "mode", ",", "config_file_name", ",", "experiment_id", "=", "None", ",", "log_dir", "=", "None", ",", "log_level", "=", "None", ")", ":", "nni_config", "=", "Config", "(", "config_file_name", ")"...
Run nni manager process
[ "Run", "nni", "manager", "process" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/launcher.py#L98-L140
train
Start restful server.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/launcher.py
set_trial_config
def set_trial_config(experiment_config, port, config_file_name): '''set trial configuration''' request_data = dict() request_data['trial_config'] = experiment_config['trial'] response = rest_put(cluster_metadata_url(port), json.dumps(request_data), REST_TIME_OUT) if check_response(response): ...
python
def set_trial_config(experiment_config, port, config_file_name): '''set trial configuration''' request_data = dict() request_data['trial_config'] = experiment_config['trial'] response = rest_put(cluster_metadata_url(port), json.dumps(request_data), REST_TIME_OUT) if check_response(response): ...
[ "def", "set_trial_config", "(", "experiment_config", ",", "port", ",", "config_file_name", ")", ":", "request_data", "=", "dict", "(", ")", "request_data", "[", "'trial_config'", "]", "=", "experiment_config", "[", "'trial'", "]", "response", "=", "rest_put", "(...
set trial configuration
[ "set", "trial", "configuration" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/launcher.py#L142-L155
train
set trial configuration
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/launcher.py
set_local_config
def set_local_config(experiment_config, port, config_file_name): '''set local configuration''' #set machine_list request_data = dict() if experiment_config.get('localConfig'): request_data['local_config'] = experiment_config['localConfig'] if request_data['local_config'] and request_data...
python
def set_local_config(experiment_config, port, config_file_name): '''set local configuration''' #set machine_list request_data = dict() if experiment_config.get('localConfig'): request_data['local_config'] = experiment_config['localConfig'] if request_data['local_config'] and request_data...
[ "def", "set_local_config", "(", "experiment_config", ",", "port", ",", "config_file_name", ")", ":", "#set machine_list", "request_data", "=", "dict", "(", ")", "if", "experiment_config", ".", "get", "(", "'localConfig'", ")", ":", "request_data", "[", "'local_con...
set local configuration
[ "set", "local", "configuration" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/launcher.py#L157-L176
train
set local configuration
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/launcher.py
set_remote_config
def set_remote_config(experiment_config, port, config_file_name): '''Call setClusterMetadata to pass trial''' #set machine_list request_data = dict() request_data['machine_list'] = experiment_config['machineList'] if request_data['machine_list']: for i in range(len(request_data['machine_list...
python
def set_remote_config(experiment_config, port, config_file_name): '''Call setClusterMetadata to pass trial''' #set machine_list request_data = dict() request_data['machine_list'] = experiment_config['machineList'] if request_data['machine_list']: for i in range(len(request_data['machine_list...
[ "def", "set_remote_config", "(", "experiment_config", ",", "port", ",", "config_file_name", ")", ":", "#set machine_list", "request_data", "=", "dict", "(", ")", "request_data", "[", "'machine_list'", "]", "=", "experiment_config", "[", "'machineList'", "]", "if", ...
Call setClusterMetadata to pass trial
[ "Call", "setClusterMetadata", "to", "pass", "trial" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/launcher.py#L178-L200
train
Call setClusterMetadata to pass trial
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/launcher.py
setNNIManagerIp
def setNNIManagerIp(experiment_config, port, config_file_name): '''set nniManagerIp''' if experiment_config.get('nniManagerIp') is None: return True, None ip_config_dict = dict() ip_config_dict['nni_manager_ip'] = { 'nniManagerIp' : experiment_config['nniManagerIp'] } response = rest_put(clu...
python
def setNNIManagerIp(experiment_config, port, config_file_name): '''set nniManagerIp''' if experiment_config.get('nniManagerIp') is None: return True, None ip_config_dict = dict() ip_config_dict['nni_manager_ip'] = { 'nniManagerIp' : experiment_config['nniManagerIp'] } response = rest_put(clu...
[ "def", "setNNIManagerIp", "(", "experiment_config", ",", "port", ",", "config_file_name", ")", ":", "if", "experiment_config", ".", "get", "(", "'nniManagerIp'", ")", "is", "None", ":", "return", "True", ",", "None", "ip_config_dict", "=", "dict", "(", ")", ...
set nniManagerIp
[ "set", "nniManagerIp" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/launcher.py#L202-L217
train
set nniManagerIp
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/launcher.py
set_frameworkcontroller_config
def set_frameworkcontroller_config(experiment_config, port, config_file_name): '''set kubeflow configuration''' frameworkcontroller_config_data = dict() frameworkcontroller_config_data['frameworkcontroller_config'] = experiment_config['frameworkcontrollerConfig'] response = rest_put(cluster_metadata_ur...
python
def set_frameworkcontroller_config(experiment_config, port, config_file_name): '''set kubeflow configuration''' frameworkcontroller_config_data = dict() frameworkcontroller_config_data['frameworkcontroller_config'] = experiment_config['frameworkcontrollerConfig'] response = rest_put(cluster_metadata_ur...
[ "def", "set_frameworkcontroller_config", "(", "experiment_config", ",", "port", ",", "config_file_name", ")", ":", "frameworkcontroller_config_data", "=", "dict", "(", ")", "frameworkcontroller_config_data", "[", "'frameworkcontroller_config'", "]", "=", "experiment_config", ...
set kubeflow configuration
[ "set", "kubeflow", "configuration" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/launcher.py#L257-L274
train
set kubeflow configuration
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/launcher.py
set_experiment
def set_experiment(experiment_config, mode, port, config_file_name): '''Call startExperiment (rest POST /experiment) with yaml file content''' request_data = dict() request_data['authorName'] = experiment_config['authorName'] request_data['experimentName'] = experiment_config['experimentName'] reque...
python
def set_experiment(experiment_config, mode, port, config_file_name): '''Call startExperiment (rest POST /experiment) with yaml file content''' request_data = dict() request_data['authorName'] = experiment_config['authorName'] request_data['experimentName'] = experiment_config['experimentName'] reque...
[ "def", "set_experiment", "(", "experiment_config", ",", "mode", ",", "port", ",", "config_file_name", ")", ":", "request_data", "=", "dict", "(", ")", "request_data", "[", "'authorName'", "]", "=", "experiment_config", "[", "'authorName'", "]", "request_data", "...
Call startExperiment (rest POST /experiment) with yaml file content
[ "Call", "startExperiment", "(", "rest", "POST", "/", "experiment", ")", "with", "yaml", "file", "content" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/launcher.py#L276-L341
train
Set the experiment to the given configuration.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/launcher.py
launch_experiment
def launch_experiment(args, experiment_config, mode, config_file_name, experiment_id=None): '''follow steps to start rest server and start experiment''' nni_config = Config(config_file_name) # check packages for tuner if experiment_config.get('tuner') and experiment_config['tuner'].get('builtinTunerName...
python
def launch_experiment(args, experiment_config, mode, config_file_name, experiment_id=None): '''follow steps to start rest server and start experiment''' nni_config = Config(config_file_name) # check packages for tuner if experiment_config.get('tuner') and experiment_config['tuner'].get('builtinTunerName...
[ "def", "launch_experiment", "(", "args", ",", "experiment_config", ",", "mode", ",", "config_file_name", ",", "experiment_id", "=", "None", ")", ":", "nni_config", "=", "Config", "(", "config_file_name", ")", "# check packages for tuner", "if", "experiment_config", ...
follow steps to start rest server and start experiment
[ "follow", "steps", "to", "start", "rest", "server", "and", "start", "experiment" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/launcher.py#L343-L492
train
start experiment and start rest server
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/launcher.py
resume_experiment
def resume_experiment(args): '''resume an experiment''' experiment_config = Experiments() experiment_dict = experiment_config.get_all_experiments() experiment_id = None experiment_endTime = None #find the latest stopped experiment if not args.id: print_error('Please set experiment id...
python
def resume_experiment(args): '''resume an experiment''' experiment_config = Experiments() experiment_dict = experiment_config.get_all_experiments() experiment_id = None experiment_endTime = None #find the latest stopped experiment if not args.id: print_error('Please set experiment id...
[ "def", "resume_experiment", "(", "args", ")", ":", "experiment_config", "=", "Experiments", "(", ")", "experiment_dict", "=", "experiment_config", ".", "get_all_experiments", "(", ")", "experiment_id", "=", "None", "experiment_endTime", "=", "None", "#find the latest ...
resume an experiment
[ "resume", "an", "experiment" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/launcher.py#L494-L521
train
resume an experiment
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/launcher.py
create_experiment
def create_experiment(args): '''start a new experiment''' config_file_name = ''.join(random.sample(string.ascii_letters + string.digits, 8)) nni_config = Config(config_file_name) config_path = os.path.abspath(args.config) if not os.path.exists(config_path): print_error('Please set correct co...
python
def create_experiment(args): '''start a new experiment''' config_file_name = ''.join(random.sample(string.ascii_letters + string.digits, 8)) nni_config = Config(config_file_name) config_path = os.path.abspath(args.config) if not os.path.exists(config_path): print_error('Please set correct co...
[ "def", "create_experiment", "(", "args", ")", ":", "config_file_name", "=", "''", ".", "join", "(", "random", ".", "sample", "(", "string", ".", "ascii_letters", "+", "string", ".", "digits", ",", "8", ")", ")", "nni_config", "=", "Config", "(", "config_...
start a new experiment
[ "start", "a", "new", "experiment" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/launcher.py#L523-L536
train
start a new experiment
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/curvefitting_assessor/model_factory.py
CurveModel.fit_theta
def fit_theta(self): """use least squares to fit all default curves parameter seperately Returns ------- None """ x = range(1, self.point_num + 1) y = self.trial_history for i in range(NUM_OF_FUNCTIONS): model = curve_combination_model...
python
def fit_theta(self): """use least squares to fit all default curves parameter seperately Returns ------- None """ x = range(1, self.point_num + 1) y = self.trial_history for i in range(NUM_OF_FUNCTIONS): model = curve_combination_model...
[ "def", "fit_theta", "(", "self", ")", ":", "x", "=", "range", "(", "1", ",", "self", ".", "point_num", "+", "1", ")", "y", "=", "self", ".", "trial_history", "for", "i", "in", "range", "(", "NUM_OF_FUNCTIONS", ")", ":", "model", "=", "curve_combinati...
use least squares to fit all default curves parameter seperately Returns ------- None
[ "use", "least", "squares", "to", "fit", "all", "default", "curves", "parameter", "seperately", "Returns", "-------", "None" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/curvefitting_assessor/model_factory.py#L54-L86
train
use least squares to fit all default curves parameter seperately Returns None
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/curvefitting_assessor/model_factory.py
CurveModel.filter_curve
def filter_curve(self): """filter the poor performing curve Returns ------- None """ avg = np.sum(self.trial_history) / self.point_num standard = avg * avg * self.point_num predict_data = [] tmp_model = [] for i in range(NUM_OF_FUN...
python
def filter_curve(self): """filter the poor performing curve Returns ------- None """ avg = np.sum(self.trial_history) / self.point_num standard = avg * avg * self.point_num predict_data = [] tmp_model = [] for i in range(NUM_OF_FUN...
[ "def", "filter_curve", "(", "self", ")", ":", "avg", "=", "np", ".", "sum", "(", "self", ".", "trial_history", ")", "/", "self", ".", "point_num", "standard", "=", "avg", "*", "avg", "*", "self", ".", "point_num", "predict_data", "=", "[", "]", "tmp_...
filter the poor performing curve Returns ------- None
[ "filter", "the", "poor", "performing", "curve", "Returns", "-------", "None" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/curvefitting_assessor/model_factory.py#L88-L116
train
filter the poor performing curve Returns ------- None
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/curvefitting_assessor/model_factory.py
CurveModel.predict_y
def predict_y(self, model, pos): """return the predict y of 'model' when epoch = pos Parameters ---------- model: string name of the curve function model pos: int the epoch number of the position you want to predict Returns ------...
python
def predict_y(self, model, pos): """return the predict y of 'model' when epoch = pos Parameters ---------- model: string name of the curve function model pos: int the epoch number of the position you want to predict Returns ------...
[ "def", "predict_y", "(", "self", ",", "model", ",", "pos", ")", ":", "if", "model_para_num", "[", "model", "]", "==", "2", ":", "y", "=", "all_models", "[", "model", "]", "(", "pos", ",", "model_para", "[", "model", "]", "[", "0", "]", ",", "mode...
return the predict y of 'model' when epoch = pos Parameters ---------- model: string name of the curve function model pos: int the epoch number of the position you want to predict Returns ------- int: The expected matr...
[ "return", "the", "predict", "y", "of", "model", "when", "epoch", "=", "pos", "Parameters", "----------", "model", ":", "string", "name", "of", "the", "curve", "function", "model", "pos", ":", "int", "the", "epoch", "number", "of", "the", "position", "you",...
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/curvefitting_assessor/model_factory.py#L118-L139
train
return the predict y of model when epoch = pos
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/curvefitting_assessor/model_factory.py
CurveModel.f_comb
def f_comb(self, pos, sample): """return the value of the f_comb when epoch = pos Parameters ---------- pos: int the epoch number of the position you want to predict sample: list sample is a (1 * NUM_OF_FUNCTIONS) matrix, representing{w1, w2, ... wk} ...
python
def f_comb(self, pos, sample): """return the value of the f_comb when epoch = pos Parameters ---------- pos: int the epoch number of the position you want to predict sample: list sample is a (1 * NUM_OF_FUNCTIONS) matrix, representing{w1, w2, ... wk} ...
[ "def", "f_comb", "(", "self", ",", "pos", ",", "sample", ")", ":", "ret", "=", "0", "for", "i", "in", "range", "(", "self", ".", "effective_model_num", ")", ":", "model", "=", "self", ".", "effective_model", "[", "i", "]", "y", "=", "self", ".", ...
return the value of the f_comb when epoch = pos Parameters ---------- pos: int the epoch number of the position you want to predict sample: list sample is a (1 * NUM_OF_FUNCTIONS) matrix, representing{w1, w2, ... wk} Returns ------- int ...
[ "return", "the", "value", "of", "the", "f_comb", "when", "epoch", "=", "pos" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/curvefitting_assessor/model_factory.py#L141-L161
train
return the value of the f_comb when epoch = pos
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/curvefitting_assessor/model_factory.py
CurveModel.normalize_weight
def normalize_weight(self, samples): """normalize weight Parameters ---------- samples: list a collection of sample, it's a (NUM_OF_INSTANCE * NUM_OF_FUNCTIONS) matrix, representing{{w11, w12, ..., w1k}, {w21, w22, ... w2k}, ...{wk1, wk2,..., wkk}} ...
python
def normalize_weight(self, samples): """normalize weight Parameters ---------- samples: list a collection of sample, it's a (NUM_OF_INSTANCE * NUM_OF_FUNCTIONS) matrix, representing{{w11, w12, ..., w1k}, {w21, w22, ... w2k}, ...{wk1, wk2,..., wkk}} ...
[ "def", "normalize_weight", "(", "self", ",", "samples", ")", ":", "for", "i", "in", "range", "(", "NUM_OF_INSTANCE", ")", ":", "total", "=", "0", "for", "j", "in", "range", "(", "self", ".", "effective_model_num", ")", ":", "total", "+=", "samples", "[...
normalize weight Parameters ---------- samples: list a collection of sample, it's a (NUM_OF_INSTANCE * NUM_OF_FUNCTIONS) matrix, representing{{w11, w12, ..., w1k}, {w21, w22, ... w2k}, ...{wk1, wk2,..., wkk}} Returns ------- list ...
[ "normalize", "weight", "Parameters", "----------", "samples", ":", "list", "a", "collection", "of", "sample", "it", "s", "a", "(", "NUM_OF_INSTANCE", "*", "NUM_OF_FUNCTIONS", ")", "matrix", "representing", "{{", "w11", "w12", "...", "w1k", "}", "{", "w21", "...
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/curvefitting_assessor/model_factory.py#L163-L183
train
normalize weight of a collection of samples
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/curvefitting_assessor/model_factory.py
CurveModel.sigma_sq
def sigma_sq(self, sample): """returns the value of sigma square, given the weight's sample Parameters ---------- sample: list sample is a (1 * NUM_OF_FUNCTIONS) matrix, representing{w1, w2, ... wk} Returns ------- float the value...
python
def sigma_sq(self, sample): """returns the value of sigma square, given the weight's sample Parameters ---------- sample: list sample is a (1 * NUM_OF_FUNCTIONS) matrix, representing{w1, w2, ... wk} Returns ------- float the value...
[ "def", "sigma_sq", "(", "self", ",", "sample", ")", ":", "ret", "=", "0", "for", "i", "in", "range", "(", "1", ",", "self", ".", "point_num", "+", "1", ")", ":", "temp", "=", "self", ".", "trial_history", "[", "i", "-", "1", "]", "-", "self", ...
returns the value of sigma square, given the weight's sample Parameters ---------- sample: list sample is a (1 * NUM_OF_FUNCTIONS) matrix, representing{w1, w2, ... wk} Returns ------- float the value of sigma square, given the weight's sa...
[ "returns", "the", "value", "of", "sigma", "square", "given", "the", "weight", "s", "sample", "Parameters", "----------", "sample", ":", "list", "sample", "is", "a", "(", "1", "*", "NUM_OF_FUNCTIONS", ")", "matrix", "representing", "{", "w1", "w2", "...", "...
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/curvefitting_assessor/model_factory.py#L185-L202
train
returns the value of sigma square given the sample
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/curvefitting_assessor/model_factory.py
CurveModel.normal_distribution
def normal_distribution(self, pos, sample): """returns the value of normal distribution, given the weight's sample and target position Parameters ---------- pos: int the epoch number of the position you want to predict sample: list sample is a (1 ...
python
def normal_distribution(self, pos, sample): """returns the value of normal distribution, given the weight's sample and target position Parameters ---------- pos: int the epoch number of the position you want to predict sample: list sample is a (1 ...
[ "def", "normal_distribution", "(", "self", ",", "pos", ",", "sample", ")", ":", "curr_sigma_sq", "=", "self", ".", "sigma_sq", "(", "sample", ")", "delta", "=", "self", ".", "trial_history", "[", "pos", "-", "1", "]", "-", "self", ".", "f_comb", "(", ...
returns the value of normal distribution, given the weight's sample and target position Parameters ---------- pos: int the epoch number of the position you want to predict sample: list sample is a (1 * NUM_OF_FUNCTIONS) matrix, representing{w1, w2, ... wk...
[ "returns", "the", "value", "of", "normal", "distribution", "given", "the", "weight", "s", "sample", "and", "target", "position", "Parameters", "----------", "pos", ":", "int", "the", "epoch", "number", "of", "the", "position", "you", "want", "to", "predict", ...
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/curvefitting_assessor/model_factory.py#L204-L221
train
returns the value of normal distribution given the weight s sample and target position
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/curvefitting_assessor/model_factory.py
CurveModel.likelihood
def likelihood(self, samples): """likelihood Parameters ---------- sample: list sample is a (1 * NUM_OF_FUNCTIONS) matrix, representing{w1, w2, ... wk} Returns ------- float likelihood """ ret = np.ones(NUM_OF_INST...
python
def likelihood(self, samples): """likelihood Parameters ---------- sample: list sample is a (1 * NUM_OF_FUNCTIONS) matrix, representing{w1, w2, ... wk} Returns ------- float likelihood """ ret = np.ones(NUM_OF_INST...
[ "def", "likelihood", "(", "self", ",", "samples", ")", ":", "ret", "=", "np", ".", "ones", "(", "NUM_OF_INSTANCE", ")", "for", "i", "in", "range", "(", "NUM_OF_INSTANCE", ")", ":", "for", "j", "in", "range", "(", "1", ",", "self", ".", "point_num", ...
likelihood Parameters ---------- sample: list sample is a (1 * NUM_OF_FUNCTIONS) matrix, representing{w1, w2, ... wk} Returns ------- float likelihood
[ "likelihood" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/curvefitting_assessor/model_factory.py#L223-L240
train
Returns the likelihood of a list of items in the log - likelihood matrix.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/curvefitting_assessor/model_factory.py
CurveModel.prior
def prior(self, samples): """priori distribution Parameters ---------- samples: list a collection of sample, it's a (NUM_OF_INSTANCE * NUM_OF_FUNCTIONS) matrix, representing{{w11, w12, ..., w1k}, {w21, w22, ... w2k}, ...{wk1, wk2,..., wkk}} Retu...
python
def prior(self, samples): """priori distribution Parameters ---------- samples: list a collection of sample, it's a (NUM_OF_INSTANCE * NUM_OF_FUNCTIONS) matrix, representing{{w11, w12, ..., w1k}, {w21, w22, ... w2k}, ...{wk1, wk2,..., wkk}} Retu...
[ "def", "prior", "(", "self", ",", "samples", ")", ":", "ret", "=", "np", ".", "ones", "(", "NUM_OF_INSTANCE", ")", "for", "i", "in", "range", "(", "NUM_OF_INSTANCE", ")", ":", "for", "j", "in", "range", "(", "self", ".", "effective_model_num", ")", "...
priori distribution Parameters ---------- samples: list a collection of sample, it's a (NUM_OF_INSTANCE * NUM_OF_FUNCTIONS) matrix, representing{{w11, w12, ..., w1k}, {w21, w22, ... w2k}, ...{wk1, wk2,..., wkk}} Returns ------- float ...
[ "priori", "distribution", "Parameters", "----------", "samples", ":", "list", "a", "collection", "of", "sample", "it", "s", "a", "(", "NUM_OF_INSTANCE", "*", "NUM_OF_FUNCTIONS", ")", "matrix", "representing", "{{", "w11", "w12", "...", "w1k", "}", "{", "w21", ...
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/curvefitting_assessor/model_factory.py#L242-L263
train
Returns a priori distribution
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/curvefitting_assessor/model_factory.py
CurveModel.target_distribution
def target_distribution(self, samples): """posterior probability Parameters ---------- samples: list a collection of sample, it's a (NUM_OF_INSTANCE * NUM_OF_FUNCTIONS) matrix, representing{{w11, w12, ..., w1k}, {w21, w22, ... w2k}, ...{wk1, wk2,..., wkk}...
python
def target_distribution(self, samples): """posterior probability Parameters ---------- samples: list a collection of sample, it's a (NUM_OF_INSTANCE * NUM_OF_FUNCTIONS) matrix, representing{{w11, w12, ..., w1k}, {w21, w22, ... w2k}, ...{wk1, wk2,..., wkk}...
[ "def", "target_distribution", "(", "self", ",", "samples", ")", ":", "curr_likelihood", "=", "self", ".", "likelihood", "(", "samples", ")", "curr_prior", "=", "self", ".", "prior", "(", "samples", ")", "ret", "=", "np", ".", "ones", "(", "NUM_OF_INSTANCE"...
posterior probability Parameters ---------- samples: list a collection of sample, it's a (NUM_OF_INSTANCE * NUM_OF_FUNCTIONS) matrix, representing{{w11, w12, ..., w1k}, {w21, w22, ... w2k}, ...{wk1, wk2,..., wkk}} Returns ------- ...
[ "posterior", "probability", "Parameters", "----------", "samples", ":", "list", "a", "collection", "of", "sample", "it", "s", "a", "(", "NUM_OF_INSTANCE", "*", "NUM_OF_FUNCTIONS", ")", "matrix", "representing", "{{", "w11", "w12", "...", "w1k", "}", "{", "w21"...
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/curvefitting_assessor/model_factory.py#L265-L284
train
Returns the target distribution of the posterior probability of the log - likelihood of the set of samples.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/curvefitting_assessor/model_factory.py
CurveModel.mcmc_sampling
def mcmc_sampling(self): """Adjust the weight of each function using mcmc sampling. The initial value of each weight is evenly distribute. Brief introduction: (1)Definition of sample: Sample is a (1 * NUM_OF_FUNCTIONS) matrix, representing{w1, w2, ... wk} (2)Definitio...
python
def mcmc_sampling(self): """Adjust the weight of each function using mcmc sampling. The initial value of each weight is evenly distribute. Brief introduction: (1)Definition of sample: Sample is a (1 * NUM_OF_FUNCTIONS) matrix, representing{w1, w2, ... wk} (2)Definitio...
[ "def", "mcmc_sampling", "(", "self", ")", ":", "init_weight", "=", "np", ".", "ones", "(", "(", "self", ".", "effective_model_num", ")", ",", "dtype", "=", "np", ".", "float", ")", "/", "self", ".", "effective_model_num", "self", ".", "weight_samples", "...
Adjust the weight of each function using mcmc sampling. The initial value of each weight is evenly distribute. Brief introduction: (1)Definition of sample: Sample is a (1 * NUM_OF_FUNCTIONS) matrix, representing{w1, w2, ... wk} (2)Definition of samples: Samples is...
[ "Adjust", "the", "weight", "of", "each", "function", "using", "mcmc", "sampling", ".", "The", "initial", "value", "of", "each", "weight", "is", "evenly", "distribute", ".", "Brief", "introduction", ":", "(", "1", ")", "Definition", "of", "sample", ":", "Sa...
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/curvefitting_assessor/model_factory.py#L286-L318
train
Adjust the weight of each function using mcmc sampling.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/curvefitting_assessor/model_factory.py
CurveModel.predict
def predict(self, trial_history): """predict the value of target position Parameters ---------- trial_history: list The history performance matrix of each trial. Returns ------- float expected final result performance of this hype...
python
def predict(self, trial_history): """predict the value of target position Parameters ---------- trial_history: list The history performance matrix of each trial. Returns ------- float expected final result performance of this hype...
[ "def", "predict", "(", "self", ",", "trial_history", ")", ":", "self", ".", "trial_history", "=", "trial_history", "self", ".", "point_num", "=", "len", "(", "trial_history", ")", "self", ".", "fit_theta", "(", ")", "self", ".", "filter_curve", "(", ")", ...
predict the value of target position Parameters ---------- trial_history: list The history performance matrix of each trial. Returns ------- float expected final result performance of this hyperparameter config
[ "predict", "the", "value", "of", "target", "position", "Parameters", "----------", "trial_history", ":", "list", "The", "history", "performance", "matrix", "of", "each", "trial", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/curvefitting_assessor/model_factory.py#L320-L344
train
predict the value of target position
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/metis_tuner/Regression_GP/OutlierDetection.py
_outlierDetection_threaded
def _outlierDetection_threaded(inputs): ''' Detect the outlier ''' [samples_idx, samples_x, samples_y_aggregation] = inputs sys.stderr.write("[%s] DEBUG: Evaluating %dth of %d samples\n"\ % (os.path.basename(__file__), samples_idx + 1, len(samples_x))) outlier = None ...
python
def _outlierDetection_threaded(inputs): ''' Detect the outlier ''' [samples_idx, samples_x, samples_y_aggregation] = inputs sys.stderr.write("[%s] DEBUG: Evaluating %dth of %d samples\n"\ % (os.path.basename(__file__), samples_idx + 1, len(samples_x))) outlier = None ...
[ "def", "_outlierDetection_threaded", "(", "inputs", ")", ":", "[", "samples_idx", ",", "samples_x", ",", "samples_y_aggregation", "]", "=", "inputs", "sys", ".", "stderr", ".", "write", "(", "\"[%s] DEBUG: Evaluating %dth of %d samples\\n\"", "%", "(", "os", ".", ...
Detect the outlier
[ "Detect", "the", "outlier" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/metis_tuner/Regression_GP/OutlierDetection.py#L32-L53
train
This function is used in the main thread of the detection of the outlier.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/metis_tuner/Regression_GP/OutlierDetection.py
outlierDetection_threaded
def outlierDetection_threaded(samples_x, samples_y_aggregation): ''' Use Multi-thread to detect the outlier ''' outliers = [] threads_inputs = [[samples_idx, samples_x, samples_y_aggregation]\ for samples_idx in range(0, len(samples_x))] threads_pool = ThreadPool(min...
python
def outlierDetection_threaded(samples_x, samples_y_aggregation): ''' Use Multi-thread to detect the outlier ''' outliers = [] threads_inputs = [[samples_idx, samples_x, samples_y_aggregation]\ for samples_idx in range(0, len(samples_x))] threads_pool = ThreadPool(min...
[ "def", "outlierDetection_threaded", "(", "samples_x", ",", "samples_y_aggregation", ")", ":", "outliers", "=", "[", "]", "threads_inputs", "=", "[", "[", "samples_idx", ",", "samples_x", ",", "samples_y_aggregation", "]", "for", "samples_idx", "in", "range", "(", ...
Use Multi-thread to detect the outlier
[ "Use", "Multi", "-", "thread", "to", "detect", "the", "outlier" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/metis_tuner/Regression_GP/OutlierDetection.py#L55-L75
train
Use Multi - thread to detect the outlier of a single node.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/networkmorphism_tuner/layer_transformer.py
deeper_conv_block
def deeper_conv_block(conv_layer, kernel_size, weighted=True): '''deeper conv layer. ''' n_dim = get_n_dim(conv_layer) filter_shape = (kernel_size,) * 2 n_filters = conv_layer.filters weight = np.zeros((n_filters, n_filters) + filter_shape) center = tuple(map(lambda x: int((x - 1) / 2), filt...
python
def deeper_conv_block(conv_layer, kernel_size, weighted=True): '''deeper conv layer. ''' n_dim = get_n_dim(conv_layer) filter_shape = (kernel_size,) * 2 n_filters = conv_layer.filters weight = np.zeros((n_filters, n_filters) + filter_shape) center = tuple(map(lambda x: int((x - 1) / 2), filt...
[ "def", "deeper_conv_block", "(", "conv_layer", ",", "kernel_size", ",", "weighted", "=", "True", ")", ":", "n_dim", "=", "get_n_dim", "(", "conv_layer", ")", "filter_shape", "=", "(", "kernel_size", ",", ")", "*", "2", "n_filters", "=", "conv_layer", ".", ...
deeper conv layer.
[ "deeper", "conv", "layer", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/networkmorphism_tuner/layer_transformer.py#L34-L65
train
deeper conv layer.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/networkmorphism_tuner/layer_transformer.py
dense_to_deeper_block
def dense_to_deeper_block(dense_layer, weighted=True): '''deeper dense layer. ''' units = dense_layer.units weight = np.eye(units) bias = np.zeros(units) new_dense_layer = StubDense(units, units) if weighted: new_dense_layer.set_weights( (add_noise(weight, np.array([0, 1]...
python
def dense_to_deeper_block(dense_layer, weighted=True): '''deeper dense layer. ''' units = dense_layer.units weight = np.eye(units) bias = np.zeros(units) new_dense_layer = StubDense(units, units) if weighted: new_dense_layer.set_weights( (add_noise(weight, np.array([0, 1]...
[ "def", "dense_to_deeper_block", "(", "dense_layer", ",", "weighted", "=", "True", ")", ":", "units", "=", "dense_layer", ".", "units", "weight", "=", "np", ".", "eye", "(", "units", ")", "bias", "=", "np", ".", "zeros", "(", "units", ")", "new_dense_laye...
deeper dense layer.
[ "deeper", "dense", "layer", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/networkmorphism_tuner/layer_transformer.py#L68-L79
train
deeper dense layer.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/networkmorphism_tuner/layer_transformer.py
wider_pre_dense
def wider_pre_dense(layer, n_add, weighted=True): '''wider previous dense layer. ''' if not weighted: return StubDense(layer.input_units, layer.units + n_add) n_units2 = layer.units teacher_w, teacher_b = layer.get_weights() rand = np.random.randint(n_units2, size=n_add) student_w ...
python
def wider_pre_dense(layer, n_add, weighted=True): '''wider previous dense layer. ''' if not weighted: return StubDense(layer.input_units, layer.units + n_add) n_units2 = layer.units teacher_w, teacher_b = layer.get_weights() rand = np.random.randint(n_units2, size=n_add) student_w ...
[ "def", "wider_pre_dense", "(", "layer", ",", "n_add", ",", "weighted", "=", "True", ")", ":", "if", "not", "weighted", ":", "return", "StubDense", "(", "layer", ".", "input_units", ",", "layer", ".", "units", "+", "n_add", ")", "n_units2", "=", "layer", ...
wider previous dense layer.
[ "wider", "previous", "dense", "layer", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/networkmorphism_tuner/layer_transformer.py#L82-L106
train
wider previous dense layer.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/networkmorphism_tuner/layer_transformer.py
wider_pre_conv
def wider_pre_conv(layer, n_add_filters, weighted=True): '''wider previous conv layer. ''' n_dim = get_n_dim(layer) if not weighted: return get_conv_class(n_dim)( layer.input_channel, layer.filters + n_add_filters, kernel_size=layer.kernel_size, ) ...
python
def wider_pre_conv(layer, n_add_filters, weighted=True): '''wider previous conv layer. ''' n_dim = get_n_dim(layer) if not weighted: return get_conv_class(n_dim)( layer.input_channel, layer.filters + n_add_filters, kernel_size=layer.kernel_size, ) ...
[ "def", "wider_pre_conv", "(", "layer", ",", "n_add_filters", ",", "weighted", "=", "True", ")", ":", "n_dim", "=", "get_n_dim", "(", "layer", ")", "if", "not", "weighted", ":", "return", "get_conv_class", "(", "n_dim", ")", "(", "layer", ".", "input_channe...
wider previous conv layer.
[ "wider", "previous", "conv", "layer", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/networkmorphism_tuner/layer_transformer.py#L109-L139
train
wider previous conv layer.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/networkmorphism_tuner/layer_transformer.py
wider_next_conv
def wider_next_conv(layer, start_dim, total_dim, n_add, weighted=True): '''wider next conv layer. ''' n_dim = get_n_dim(layer) if not weighted: return get_conv_class(n_dim)(layer.input_channel + n_add, layer.filters, kerne...
python
def wider_next_conv(layer, start_dim, total_dim, n_add, weighted=True): '''wider next conv layer. ''' n_dim = get_n_dim(layer) if not weighted: return get_conv_class(n_dim)(layer.input_channel + n_add, layer.filters, kerne...
[ "def", "wider_next_conv", "(", "layer", ",", "start_dim", ",", "total_dim", ",", "n_add", ",", "weighted", "=", "True", ")", ":", "n_dim", "=", "get_n_dim", "(", "layer", ")", "if", "not", "weighted", ":", "return", "get_conv_class", "(", "n_dim", ")", "...
wider next conv layer.
[ "wider", "next", "conv", "layer", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/networkmorphism_tuner/layer_transformer.py#L142-L166
train
wider next conv layer.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/networkmorphism_tuner/layer_transformer.py
wider_bn
def wider_bn(layer, start_dim, total_dim, n_add, weighted=True): '''wider batch norm layer. ''' n_dim = get_n_dim(layer) if not weighted: return get_batch_norm_class(n_dim)(layer.num_features + n_add) weights = layer.get_weights() new_weights = [ add_noise(np.ones(n_add, dtype=...
python
def wider_bn(layer, start_dim, total_dim, n_add, weighted=True): '''wider batch norm layer. ''' n_dim = get_n_dim(layer) if not weighted: return get_batch_norm_class(n_dim)(layer.num_features + n_add) weights = layer.get_weights() new_weights = [ add_noise(np.ones(n_add, dtype=...
[ "def", "wider_bn", "(", "layer", ",", "start_dim", ",", "total_dim", ",", "n_add", ",", "weighted", "=", "True", ")", ":", "n_dim", "=", "get_n_dim", "(", "layer", ")", "if", "not", "weighted", ":", "return", "get_batch_norm_class", "(", "n_dim", ")", "(...
wider batch norm layer.
[ "wider", "batch", "norm", "layer", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/networkmorphism_tuner/layer_transformer.py#L169-L194
train
wider batch norm layer.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/networkmorphism_tuner/layer_transformer.py
wider_next_dense
def wider_next_dense(layer, start_dim, total_dim, n_add, weighted=True): '''wider next dense layer. ''' if not weighted: return StubDense(layer.input_units + n_add, layer.units) teacher_w, teacher_b = layer.get_weights() student_w = teacher_w.copy() n_units_each_channel = int(teacher_w.s...
python
def wider_next_dense(layer, start_dim, total_dim, n_add, weighted=True): '''wider next dense layer. ''' if not weighted: return StubDense(layer.input_units + n_add, layer.units) teacher_w, teacher_b = layer.get_weights() student_w = teacher_w.copy() n_units_each_channel = int(teacher_w.s...
[ "def", "wider_next_dense", "(", "layer", ",", "start_dim", ",", "total_dim", ",", "n_add", ",", "weighted", "=", "True", ")", ":", "if", "not", "weighted", ":", "return", "StubDense", "(", "layer", ".", "input_units", "+", "n_add", ",", "layer", ".", "un...
wider next dense layer.
[ "wider", "next", "dense", "layer", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/networkmorphism_tuner/layer_transformer.py#L197-L220
train
wider next dense layer.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/networkmorphism_tuner/layer_transformer.py
add_noise
def add_noise(weights, other_weights): '''add noise to the layer. ''' w_range = np.ptp(other_weights.flatten()) noise_range = NOISE_RATIO * w_range noise = np.random.uniform(-noise_range / 2.0, noise_range / 2.0, weights.shape) return np.add(noise, weights)
python
def add_noise(weights, other_weights): '''add noise to the layer. ''' w_range = np.ptp(other_weights.flatten()) noise_range = NOISE_RATIO * w_range noise = np.random.uniform(-noise_range / 2.0, noise_range / 2.0, weights.shape) return np.add(noise, weights)
[ "def", "add_noise", "(", "weights", ",", "other_weights", ")", ":", "w_range", "=", "np", ".", "ptp", "(", "other_weights", ".", "flatten", "(", ")", ")", "noise_range", "=", "NOISE_RATIO", "*", "w_range", "noise", "=", "np", ".", "random", ".", "uniform...
add noise to the layer.
[ "add", "noise", "to", "the", "layer", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/networkmorphism_tuner/layer_transformer.py#L223-L229
train
add noise to the layer.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/networkmorphism_tuner/layer_transformer.py
init_dense_weight
def init_dense_weight(layer): '''initilize dense layer weight. ''' units = layer.units weight = np.eye(units) bias = np.zeros(units) layer.set_weights( (add_noise(weight, np.array([0, 1])), add_noise(bias, np.array([0, 1]))) )
python
def init_dense_weight(layer): '''initilize dense layer weight. ''' units = layer.units weight = np.eye(units) bias = np.zeros(units) layer.set_weights( (add_noise(weight, np.array([0, 1])), add_noise(bias, np.array([0, 1]))) )
[ "def", "init_dense_weight", "(", "layer", ")", ":", "units", "=", "layer", ".", "units", "weight", "=", "np", ".", "eye", "(", "units", ")", "bias", "=", "np", ".", "zeros", "(", "units", ")", "layer", ".", "set_weights", "(", "(", "add_noise", "(", ...
initilize dense layer weight.
[ "initilize", "dense", "layer", "weight", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/networkmorphism_tuner/layer_transformer.py#L232-L240
train
initilize dense layer weight.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/networkmorphism_tuner/layer_transformer.py
init_conv_weight
def init_conv_weight(layer): '''initilize conv layer weight. ''' n_filters = layer.filters filter_shape = (layer.kernel_size,) * get_n_dim(layer) weight = np.zeros((n_filters, n_filters) + filter_shape) center = tuple(map(lambda x: int((x - 1) / 2), filter_shape)) for i in range(n_filters):...
python
def init_conv_weight(layer): '''initilize conv layer weight. ''' n_filters = layer.filters filter_shape = (layer.kernel_size,) * get_n_dim(layer) weight = np.zeros((n_filters, n_filters) + filter_shape) center = tuple(map(lambda x: int((x - 1) / 2), filter_shape)) for i in range(n_filters):...
[ "def", "init_conv_weight", "(", "layer", ")", ":", "n_filters", "=", "layer", ".", "filters", "filter_shape", "=", "(", "layer", ".", "kernel_size", ",", ")", "*", "get_n_dim", "(", "layer", ")", "weight", "=", "np", ".", "zeros", "(", "(", "n_filters", ...
initilize conv layer weight.
[ "initilize", "conv", "layer", "weight", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/networkmorphism_tuner/layer_transformer.py#L243-L260
train
initilize conv layer weight.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/networkmorphism_tuner/layer_transformer.py
init_bn_weight
def init_bn_weight(layer): '''initilize batch norm layer weight. ''' n_filters = layer.num_features new_weights = [ add_noise(np.ones(n_filters, dtype=np.float32), np.array([0, 1])), add_noise(np.zeros(n_filters, dtype=np.float32), np.array([0, 1])), add_noise(np.zeros(n_filters,...
python
def init_bn_weight(layer): '''initilize batch norm layer weight. ''' n_filters = layer.num_features new_weights = [ add_noise(np.ones(n_filters, dtype=np.float32), np.array([0, 1])), add_noise(np.zeros(n_filters, dtype=np.float32), np.array([0, 1])), add_noise(np.zeros(n_filters,...
[ "def", "init_bn_weight", "(", "layer", ")", ":", "n_filters", "=", "layer", ".", "num_features", "new_weights", "=", "[", "add_noise", "(", "np", ".", "ones", "(", "n_filters", ",", "dtype", "=", "np", ".", "float32", ")", ",", "np", ".", "array", "(",...
initilize batch norm layer weight.
[ "initilize", "batch", "norm", "layer", "weight", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/networkmorphism_tuner/layer_transformer.py#L263-L273
train
initilize batch norm layer weight.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/tensorboard_utils.py
parse_log_path
def parse_log_path(args, trial_content): '''parse log path''' path_list = [] host_list = [] for trial in trial_content: if args.trial_id and args.trial_id != 'all' and trial.get('id') != args.trial_id: continue pattern = r'(?P<head>.+)://(?P<host>.+):(?P<path>.*)' mat...
python
def parse_log_path(args, trial_content): '''parse log path''' path_list = [] host_list = [] for trial in trial_content: if args.trial_id and args.trial_id != 'all' and trial.get('id') != args.trial_id: continue pattern = r'(?P<head>.+)://(?P<host>.+):(?P<path>.*)' mat...
[ "def", "parse_log_path", "(", "args", ",", "trial_content", ")", ":", "path_list", "=", "[", "]", "host_list", "=", "[", "]", "for", "trial", "in", "trial_content", ":", "if", "args", ".", "trial_id", "and", "args", ".", "trial_id", "!=", "'all'", "and",...
parse log path
[ "parse", "log", "path" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/tensorboard_utils.py#L38-L53
train
parse log path
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/tensorboard_utils.py
copy_data_from_remote
def copy_data_from_remote(args, nni_config, trial_content, path_list, host_list, temp_nni_path): '''use ssh client to copy data from remote machine to local machien''' machine_list = nni_config.get_config('experimentConfig').get('machineList') machine_dict = {} local_path_list = [] for machine in ma...
python
def copy_data_from_remote(args, nni_config, trial_content, path_list, host_list, temp_nni_path): '''use ssh client to copy data from remote machine to local machien''' machine_list = nni_config.get_config('experimentConfig').get('machineList') machine_dict = {} local_path_list = [] for machine in ma...
[ "def", "copy_data_from_remote", "(", "args", ",", "nni_config", ",", "trial_content", ",", "path_list", ",", "host_list", ",", "temp_nni_path", ")", ":", "machine_list", "=", "nni_config", ".", "get_config", "(", "'experimentConfig'", ")", ".", "get", "(", "'mac...
use ssh client to copy data from remote machine to local machien
[ "use", "ssh", "client", "to", "copy", "data", "from", "remote", "machine", "to", "local", "machien" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/tensorboard_utils.py#L55-L69
train
use ssh client to copy data from remote machine to local machien
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/tensorboard_utils.py
get_path_list
def get_path_list(args, nni_config, trial_content, temp_nni_path): '''get path list according to different platform''' path_list, host_list = parse_log_path(args, trial_content) platform = nni_config.get_config('experimentConfig').get('trainingServicePlatform') if platform == 'local': print_norm...
python
def get_path_list(args, nni_config, trial_content, temp_nni_path): '''get path list according to different platform''' path_list, host_list = parse_log_path(args, trial_content) platform = nni_config.get_config('experimentConfig').get('trainingServicePlatform') if platform == 'local': print_norm...
[ "def", "get_path_list", "(", "args", ",", "nni_config", ",", "trial_content", ",", "temp_nni_path", ")", ":", "path_list", ",", "host_list", "=", "parse_log_path", "(", "args", ",", "trial_content", ")", "platform", "=", "nni_config", ".", "get_config", "(", "...
get path list according to different platform
[ "get", "path", "list", "according", "to", "different", "platform" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/tensorboard_utils.py#L71-L84
train
get path list according to different platform
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/tensorboard_utils.py
start_tensorboard_process
def start_tensorboard_process(args, nni_config, path_list, temp_nni_path): '''call cmds to start tensorboard process in local machine''' if detect_port(args.port): print_error('Port %s is used by another process, please reset port!' % str(args.port)) exit(1) stdout_file = open(os.path.j...
python
def start_tensorboard_process(args, nni_config, path_list, temp_nni_path): '''call cmds to start tensorboard process in local machine''' if detect_port(args.port): print_error('Port %s is used by another process, please reset port!' % str(args.port)) exit(1) stdout_file = open(os.path.j...
[ "def", "start_tensorboard_process", "(", "args", ",", "nni_config", ",", "path_list", ",", "temp_nni_path", ")", ":", "if", "detect_port", "(", "args", ".", "port", ")", ":", "print_error", "(", "'Port %s is used by another process, please reset port!'", "%", "str", ...
call cmds to start tensorboard process in local machine
[ "call", "cmds", "to", "start", "tensorboard", "process", "in", "local", "machine" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/tensorboard_utils.py#L92-L109
train
start a tensorboard process in the local machine
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/tensorboard_utils.py
stop_tensorboard
def stop_tensorboard(args): '''stop tensorboard''' experiment_id = check_experiment_id(args) experiment_config = Experiments() experiment_dict = experiment_config.get_all_experiments() config_file_name = experiment_dict[experiment_id]['fileName'] nni_config = Config(config_file_name) tensorb...
python
def stop_tensorboard(args): '''stop tensorboard''' experiment_id = check_experiment_id(args) experiment_config = Experiments() experiment_dict = experiment_config.get_all_experiments() config_file_name = experiment_dict[experiment_id]['fileName'] nni_config = Config(config_file_name) tensorb...
[ "def", "stop_tensorboard", "(", "args", ")", ":", "experiment_id", "=", "check_experiment_id", "(", "args", ")", "experiment_config", "=", "Experiments", "(", ")", "experiment_dict", "=", "experiment_config", ".", "get_all_experiments", "(", ")", "config_file_name", ...
stop tensorboard
[ "stop", "tensorboard" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/tensorboard_utils.py#L111-L129
train
stop tensorboard
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
tools/nni_cmd/tensorboard_utils.py
start_tensorboard
def start_tensorboard(args): '''start tensorboard''' experiment_id = check_experiment_id(args) experiment_config = Experiments() experiment_dict = experiment_config.get_all_experiments() config_file_name = experiment_dict[experiment_id]['fileName'] nni_config = Config(config_file_name) rest_...
python
def start_tensorboard(args): '''start tensorboard''' experiment_id = check_experiment_id(args) experiment_config = Experiments() experiment_dict = experiment_config.get_all_experiments() config_file_name = experiment_dict[experiment_id]['fileName'] nni_config = Config(config_file_name) rest_...
[ "def", "start_tensorboard", "(", "args", ")", ":", "experiment_id", "=", "check_experiment_id", "(", "args", ")", "experiment_config", "=", "Experiments", "(", ")", "experiment_dict", "=", "experiment_config", ".", "get_all_experiments", "(", ")", "config_file_name", ...
start tensorboard
[ "start", "tensorboard" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/tools/nni_cmd/tensorboard_utils.py#L132-L165
train
start tensorboard process
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/metis_tuner/Regression_GMM/Selection.py
_ratio_scores
def _ratio_scores(parameters_value, clusteringmodel_gmm_good, clusteringmodel_gmm_bad): ''' The ratio is smaller the better ''' ratio = clusteringmodel_gmm_good.score([parameters_value]) / clusteringmodel_gmm_bad.score([parameters_value]) sigma = 0 return ratio, sigma
python
def _ratio_scores(parameters_value, clusteringmodel_gmm_good, clusteringmodel_gmm_bad): ''' The ratio is smaller the better ''' ratio = clusteringmodel_gmm_good.score([parameters_value]) / clusteringmodel_gmm_bad.score([parameters_value]) sigma = 0 return ratio, sigma
[ "def", "_ratio_scores", "(", "parameters_value", ",", "clusteringmodel_gmm_good", ",", "clusteringmodel_gmm_bad", ")", ":", "ratio", "=", "clusteringmodel_gmm_good", ".", "score", "(", "[", "parameters_value", "]", ")", "/", "clusteringmodel_gmm_bad", ".", "score", "(...
The ratio is smaller the better
[ "The", "ratio", "is", "smaller", "the", "better" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/metis_tuner/Regression_GMM/Selection.py#L37-L43
train
Returns the ratio and sigma of the clustering model.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/metis_tuner/Regression_GMM/Selection.py
selection_r
def selection_r(x_bounds, x_types, clusteringmodel_gmm_good, clusteringmodel_gmm_bad, num_starting_points=100, minimize_constraints_fun=None): ''' Call selection ''' minimize_starting_points = [lib_data.rand(x_bounds, x_type...
python
def selection_r(x_bounds, x_types, clusteringmodel_gmm_good, clusteringmodel_gmm_bad, num_starting_points=100, minimize_constraints_fun=None): ''' Call selection ''' minimize_starting_points = [lib_data.rand(x_bounds, x_type...
[ "def", "selection_r", "(", "x_bounds", ",", "x_types", ",", "clusteringmodel_gmm_good", ",", "clusteringmodel_gmm_bad", ",", "num_starting_points", "=", "100", ",", "minimize_constraints_fun", "=", "None", ")", ":", "minimize_starting_points", "=", "[", "lib_data", "....
Call selection
[ "Call", "selection" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/metis_tuner/Regression_GMM/Selection.py#L45-L61
train
Call selection with random starting points.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/metis_tuner/Regression_GMM/Selection.py
selection
def selection(x_bounds, x_types, clusteringmodel_gmm_good, clusteringmodel_gmm_bad, minimize_starting_points, minimize_constraints_fun=None): ''' Select the lowest mu value ''' results = lib_acquisition_function.next_hyperparameter_lo...
python
def selection(x_bounds, x_types, clusteringmodel_gmm_good, clusteringmodel_gmm_bad, minimize_starting_points, minimize_constraints_fun=None): ''' Select the lowest mu value ''' results = lib_acquisition_function.next_hyperparameter_lo...
[ "def", "selection", "(", "x_bounds", ",", "x_types", ",", "clusteringmodel_gmm_good", ",", "clusteringmodel_gmm_bad", ",", "minimize_starting_points", ",", "minimize_constraints_fun", "=", "None", ")", ":", "results", "=", "lib_acquisition_function", ".", "next_hyperparam...
Select the lowest mu value
[ "Select", "the", "lowest", "mu", "value" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/metis_tuner/Regression_GMM/Selection.py#L63-L77
train
Select the lowest mu value from the given bounds.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/metis_tuner/Regression_GMM/Selection.py
_minimize_constraints_fun_summation
def _minimize_constraints_fun_summation(x): ''' Minimize constraints fun summation ''' summation = sum([x[i] for i in CONSTRAINT_PARAMS_IDX]) return CONSTRAINT_UPPERBOUND >= summation >= CONSTRAINT_LOWERBOUND
python
def _minimize_constraints_fun_summation(x): ''' Minimize constraints fun summation ''' summation = sum([x[i] for i in CONSTRAINT_PARAMS_IDX]) return CONSTRAINT_UPPERBOUND >= summation >= CONSTRAINT_LOWERBOUND
[ "def", "_minimize_constraints_fun_summation", "(", "x", ")", ":", "summation", "=", "sum", "(", "[", "x", "[", "i", "]", "for", "i", "in", "CONSTRAINT_PARAMS_IDX", "]", ")", "return", "CONSTRAINT_UPPERBOUND", ">=", "summation", ">=", "CONSTRAINT_LOWERBOUND" ]
Minimize constraints fun summation
[ "Minimize", "constraints", "fun", "summation" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/metis_tuner/Regression_GMM/Selection.py#L99-L104
train
Minimize constraints fun summation.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
examples/trials/sklearn/classification/main.py
load_data
def load_data(): '''Load dataset, use 20newsgroups dataset''' digits = load_digits() X_train, X_test, y_train, y_test = train_test_split(digits.data, digits.target, random_state=99, test_size=0.25) ss = StandardScaler() X_train = ss.fit_transform(X_train) X_test = ss.transform(X_test) retu...
python
def load_data(): '''Load dataset, use 20newsgroups dataset''' digits = load_digits() X_train, X_test, y_train, y_test = train_test_split(digits.data, digits.target, random_state=99, test_size=0.25) ss = StandardScaler() X_train = ss.fit_transform(X_train) X_test = ss.transform(X_test) retu...
[ "def", "load_data", "(", ")", ":", "digits", "=", "load_digits", "(", ")", "X_train", ",", "X_test", ",", "y_train", ",", "y_test", "=", "train_test_split", "(", "digits", ".", "data", ",", "digits", ".", "target", ",", "random_state", "=", "99", ",", ...
Load dataset, use 20newsgroups dataset
[ "Load", "dataset", "use", "20newsgroups", "dataset" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/examples/trials/sklearn/classification/main.py#L29-L38
train
Load dataset use 20newsgroups dataset
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
examples/trials/sklearn/classification/main.py
get_model
def get_model(PARAMS): '''Get model according to parameters''' model = SVC() model.C = PARAMS.get('C') model.keral = PARAMS.get('keral') model.degree = PARAMS.get('degree') model.gamma = PARAMS.get('gamma') model.coef0 = PARAMS.get('coef0') return model
python
def get_model(PARAMS): '''Get model according to parameters''' model = SVC() model.C = PARAMS.get('C') model.keral = PARAMS.get('keral') model.degree = PARAMS.get('degree') model.gamma = PARAMS.get('gamma') model.coef0 = PARAMS.get('coef0') return model
[ "def", "get_model", "(", "PARAMS", ")", ":", "model", "=", "SVC", "(", ")", "model", ".", "C", "=", "PARAMS", ".", "get", "(", "'C'", ")", "model", ".", "keral", "=", "PARAMS", ".", "get", "(", "'keral'", ")", "model", ".", "degree", "=", "PARAMS...
Get model according to parameters
[ "Get", "model", "according", "to", "parameters" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/examples/trials/sklearn/classification/main.py#L51-L60
train
Get model according to parameters
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/bohb_advisor/bohb_advisor.py
Bracket.get_hyperparameter_configurations
def get_hyperparameter_configurations(self, num, r, config_generator): """generate num hyperparameter configurations from search space using Bayesian optimization Parameters ---------- num: int the number of hyperparameter configurations Returns ------- ...
python
def get_hyperparameter_configurations(self, num, r, config_generator): """generate num hyperparameter configurations from search space using Bayesian optimization Parameters ---------- num: int the number of hyperparameter configurations Returns ------- ...
[ "def", "get_hyperparameter_configurations", "(", "self", ",", "num", ",", "r", ",", "config_generator", ")", ":", "global", "_KEY", "assert", "self", ".", "i", "==", "0", "hyperparameter_configs", "=", "dict", "(", ")", "for", "_", "in", "range", "(", "num...
generate num hyperparameter configurations from search space using Bayesian optimization Parameters ---------- num: int the number of hyperparameter configurations Returns ------- list a list of hyperparameter configurations. Format: [[key1, valu...
[ "generate", "num", "hyperparameter", "configurations", "from", "search", "space", "using", "Bayesian", "optimization" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/bohb_advisor/bohb_advisor.py#L215-L237
train
generate num hyperparameter configurations from search space using Bayesian optimization
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/bohb_advisor/bohb_advisor.py
BOHB.handle_initialize
def handle_initialize(self, data): """Initialize Tuner, including creating Bayesian optimization-based parametric models and search space formations Parameters ---------- data: search space search space of this experiment Raises ------ Value...
python
def handle_initialize(self, data): """Initialize Tuner, including creating Bayesian optimization-based parametric models and search space formations Parameters ---------- data: search space search space of this experiment Raises ------ Value...
[ "def", "handle_initialize", "(", "self", ",", "data", ")", ":", "logger", ".", "info", "(", "'start to handle_initialize'", ")", "# convert search space jason to ConfigSpace", "self", ".", "handle_update_search_space", "(", "data", ")", "# generate BOHB config_generator usi...
Initialize Tuner, including creating Bayesian optimization-based parametric models and search space formations Parameters ---------- data: search space search space of this experiment Raises ------ ValueError Error: Search space is None
[ "Initialize", "Tuner", "including", "creating", "Bayesian", "optimization", "-", "based", "parametric", "models", "and", "search", "space", "formations" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/bohb_advisor/bohb_advisor.py#L344-L375
train
Handles the initialization of a Tuner with a search space.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/bohb_advisor/bohb_advisor.py
BOHB.generate_new_bracket
def generate_new_bracket(self): """generate a new bracket""" logger.debug( 'start to create a new SuccessiveHalving iteration, self.curr_s=%d', self.curr_s) if self.curr_s < 0: logger.info("s < 0, Finish this round of Hyperband in BOHB. Generate new round") se...
python
def generate_new_bracket(self): """generate a new bracket""" logger.debug( 'start to create a new SuccessiveHalving iteration, self.curr_s=%d', self.curr_s) if self.curr_s < 0: logger.info("s < 0, Finish this round of Hyperband in BOHB. Generate new round") se...
[ "def", "generate_new_bracket", "(", "self", ")", ":", "logger", ".", "debug", "(", "'start to create a new SuccessiveHalving iteration, self.curr_s=%d'", ",", "self", ".", "curr_s", ")", "if", "self", ".", "curr_s", "<", "0", ":", "logger", ".", "info", "(", "\"...
generate a new bracket
[ "generate", "a", "new", "bracket" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/bohb_advisor/bohb_advisor.py#L377-L392
train
generate a new bracket
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/bohb_advisor/bohb_advisor.py
BOHB.handle_request_trial_jobs
def handle_request_trial_jobs(self, data): """recerive the number of request and generate trials Parameters ---------- data: int number of trial jobs that nni manager ask to generate """ # Receive new request self.credit += data for _ in rang...
python
def handle_request_trial_jobs(self, data): """recerive the number of request and generate trials Parameters ---------- data: int number of trial jobs that nni manager ask to generate """ # Receive new request self.credit += data for _ in rang...
[ "def", "handle_request_trial_jobs", "(", "self", ",", "data", ")", ":", "# Receive new request", "self", ".", "credit", "+=", "data", "for", "_", "in", "range", "(", "self", ".", "credit", ")", ":", "self", ".", "_request_one_trial_job", "(", ")" ]
recerive the number of request and generate trials Parameters ---------- data: int number of trial jobs that nni manager ask to generate
[ "recerive", "the", "number", "of", "request", "and", "generate", "trials" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/bohb_advisor/bohb_advisor.py#L394-L406
train
recerive the number of request and generate trials
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/bohb_advisor/bohb_advisor.py
BOHB._request_one_trial_job
def _request_one_trial_job(self): """get one trial job, i.e., one hyperparameter configuration. If this function is called, Command will be sent by BOHB: a. If there is a parameter need to run, will return "NewTrialJob" with a dict: { 'parameter_id': id of new hyperparamete...
python
def _request_one_trial_job(self): """get one trial job, i.e., one hyperparameter configuration. If this function is called, Command will be sent by BOHB: a. If there is a parameter need to run, will return "NewTrialJob" with a dict: { 'parameter_id': id of new hyperparamete...
[ "def", "_request_one_trial_job", "(", "self", ")", ":", "if", "not", "self", ".", "generated_hyper_configs", ":", "ret", "=", "{", "'parameter_id'", ":", "'-1_0_0'", ",", "'parameter_source'", ":", "'algorithm'", ",", "'parameters'", ":", "''", "}", "send", "(...
get one trial job, i.e., one hyperparameter configuration. If this function is called, Command will be sent by BOHB: a. If there is a parameter need to run, will return "NewTrialJob" with a dict: { 'parameter_id': id of new hyperparameter 'parameter_source': 'algorithm'...
[ "get", "one", "trial", "job", "i", ".", "e", ".", "one", "hyperparameter", "configuration", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/bohb_advisor/bohb_advisor.py#L408-L442
train
request one trial job i. e. one hyperparameter configuration
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/bohb_advisor/bohb_advisor.py
BOHB.handle_update_search_space
def handle_update_search_space(self, data): """change json format to ConfigSpace format dict<dict> -> configspace Parameters ---------- data: JSON object search space of this experiment """ search_space = data cs = CS.ConfigurationSpace() for ...
python
def handle_update_search_space(self, data): """change json format to ConfigSpace format dict<dict> -> configspace Parameters ---------- data: JSON object search space of this experiment """ search_space = data cs = CS.ConfigurationSpace() for ...
[ "def", "handle_update_search_space", "(", "self", ",", "data", ")", ":", "search_space", "=", "data", "cs", "=", "CS", ".", "ConfigurationSpace", "(", ")", "for", "var", "in", "search_space", ":", "_type", "=", "str", "(", "search_space", "[", "var", "]", ...
change json format to ConfigSpace format dict<dict> -> configspace Parameters ---------- data: JSON object search space of this experiment
[ "change", "json", "format", "to", "ConfigSpace", "format", "dict<dict", ">", "-", ">", "configspace" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/bohb_advisor/bohb_advisor.py#L444-L496
train
handle update of the search space of a specific experiment
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/bohb_advisor/bohb_advisor.py
BOHB.handle_trial_end
def handle_trial_end(self, data): """receive the information of trial end and generate next configuaration. Parameters ---------- data: dict() it has three keys: trial_job_id, event, hyper_params trial_job_id: the id generated by training service even...
python
def handle_trial_end(self, data): """receive the information of trial end and generate next configuaration. Parameters ---------- data: dict() it has three keys: trial_job_id, event, hyper_params trial_job_id: the id generated by training service even...
[ "def", "handle_trial_end", "(", "self", ",", "data", ")", ":", "logger", ".", "debug", "(", "'Tuner handle trial end, result is %s'", ",", "data", ")", "hyper_params", "=", "json_tricks", ".", "loads", "(", "data", "[", "'hyper_params'", "]", ")", "s", ",", ...
receive the information of trial end and generate next configuaration. Parameters ---------- data: dict() it has three keys: trial_job_id, event, hyper_params trial_job_id: the id generated by training service event: the job's state hyper_params: ...
[ "receive", "the", "information", "of", "trial", "end", "and", "generate", "next", "configuaration", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/bohb_advisor/bohb_advisor.py#L498-L526
train
handle trial end and generate next configuaration
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/bohb_advisor/bohb_advisor.py
BOHB.handle_report_metric_data
def handle_report_metric_data(self, data): """reveice the metric data and update Bayesian optimization with final result Parameters ---------- data: it is an object which has keys 'parameter_id', 'value', 'trial_job_id', 'type', 'sequence'. Raises ------ ...
python
def handle_report_metric_data(self, data): """reveice the metric data and update Bayesian optimization with final result Parameters ---------- data: it is an object which has keys 'parameter_id', 'value', 'trial_job_id', 'type', 'sequence'. Raises ------ ...
[ "def", "handle_report_metric_data", "(", "self", ",", "data", ")", ":", "logger", ".", "debug", "(", "'handle report metric data = %s'", ",", "data", ")", "assert", "'value'", "in", "data", "value", "=", "extract_scalar_reward", "(", "data", "[", "'value'", "]",...
reveice the metric data and update Bayesian optimization with final result Parameters ---------- data: it is an object which has keys 'parameter_id', 'value', 'trial_job_id', 'type', 'sequence'. Raises ------ ValueError Data type not supported
[ "reveice", "the", "metric", "data", "and", "update", "Bayesian", "optimization", "with", "final", "result" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/bohb_advisor/bohb_advisor.py#L528-L572
train
reveice the metric data and update the optimization with final result
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/bohb_advisor/bohb_advisor.py
BOHB.handle_import_data
def handle_import_data(self, data): """Import additional data for tuning Parameters ---------- data: a list of dictionarys, each of which has at least two keys, 'parameter' and 'value' Raises ------ AssertionError data doesn't have requir...
python
def handle_import_data(self, data): """Import additional data for tuning Parameters ---------- data: a list of dictionarys, each of which has at least two keys, 'parameter' and 'value' Raises ------ AssertionError data doesn't have requir...
[ "def", "handle_import_data", "(", "self", ",", "data", ")", ":", "_completed_num", "=", "0", "for", "trial_info", "in", "data", ":", "logger", ".", "info", "(", "\"Importing data, current processing progress %s / %s\"", "%", "(", "_completed_num", ",", "len", "(",...
Import additional data for tuning Parameters ---------- data: a list of dictionarys, each of which has at least two keys, 'parameter' and 'value' Raises ------ AssertionError data doesn't have required key 'parameter' and 'value'
[ "Import", "additional", "data", "for", "tuning" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/bohb_advisor/bohb_advisor.py#L577-L617
train
Handle the import data for the tuning system.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
examples/trials/network_morphism/FashionMNIST/utils.py
data_transforms_cifar10
def data_transforms_cifar10(args): """ data_transforms for cifar10 dataset """ cifar_mean = [0.49139968, 0.48215827, 0.44653124] cifar_std = [0.24703233, 0.24348505, 0.26158768] train_transform = transforms.Compose( [ transforms.RandomCrop(32, padding=4), transforms...
python
def data_transforms_cifar10(args): """ data_transforms for cifar10 dataset """ cifar_mean = [0.49139968, 0.48215827, 0.44653124] cifar_std = [0.24703233, 0.24348505, 0.26158768] train_transform = transforms.Compose( [ transforms.RandomCrop(32, padding=4), transforms...
[ "def", "data_transforms_cifar10", "(", "args", ")", ":", "cifar_mean", "=", "[", "0.49139968", ",", "0.48215827", ",", "0.44653124", "]", "cifar_std", "=", "[", "0.24703233", ",", "0.24348505", ",", "0.26158768", "]", "train_transform", "=", "transforms", ".", ...
data_transforms for cifar10 dataset
[ "data_transforms", "for", "cifar10", "dataset" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/examples/trials/network_morphism/FashionMNIST/utils.py#L116-L137
train
data_transforms for cifar10 dataset
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
examples/trials/network_morphism/FashionMNIST/utils.py
data_transforms_mnist
def data_transforms_mnist(args, mnist_mean=None, mnist_std=None): """ data_transforms for mnist dataset """ if mnist_mean is None: mnist_mean = [0.5] if mnist_std is None: mnist_std = [0.5] train_transform = transforms.Compose( [ transforms.RandomCrop(28, paddin...
python
def data_transforms_mnist(args, mnist_mean=None, mnist_std=None): """ data_transforms for mnist dataset """ if mnist_mean is None: mnist_mean = [0.5] if mnist_std is None: mnist_std = [0.5] train_transform = transforms.Compose( [ transforms.RandomCrop(28, paddin...
[ "def", "data_transforms_mnist", "(", "args", ",", "mnist_mean", "=", "None", ",", "mnist_std", "=", "None", ")", ":", "if", "mnist_mean", "is", "None", ":", "mnist_mean", "=", "[", "0.5", "]", "if", "mnist_std", "is", "None", ":", "mnist_std", "=", "[", ...
data_transforms for mnist dataset
[ "data_transforms", "for", "mnist", "dataset" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/examples/trials/network_morphism/FashionMNIST/utils.py#L140-L163
train
data_transforms for mnist dataset
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
examples/trials/network_morphism/FashionMNIST/utils.py
get_mean_and_std
def get_mean_and_std(dataset): """Compute the mean and std value of dataset.""" dataloader = torch.utils.data.DataLoader( dataset, batch_size=1, shuffle=True, num_workers=2 ) mean = torch.zeros(3) std = torch.zeros(3) print("==> Computing mean and std..") for inputs, _ in dataloader:...
python
def get_mean_and_std(dataset): """Compute the mean and std value of dataset.""" dataloader = torch.utils.data.DataLoader( dataset, batch_size=1, shuffle=True, num_workers=2 ) mean = torch.zeros(3) std = torch.zeros(3) print("==> Computing mean and std..") for inputs, _ in dataloader:...
[ "def", "get_mean_and_std", "(", "dataset", ")", ":", "dataloader", "=", "torch", ".", "utils", ".", "data", ".", "DataLoader", "(", "dataset", ",", "batch_size", "=", "1", ",", "shuffle", "=", "True", ",", "num_workers", "=", "2", ")", "mean", "=", "to...
Compute the mean and std value of dataset.
[ "Compute", "the", "mean", "and", "std", "value", "of", "dataset", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/examples/trials/network_morphism/FashionMNIST/utils.py#L166-L180
train
Compute the mean and std value of dataset.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
examples/trials/network_morphism/FashionMNIST/utils.py
init_params
def init_params(net): """Init layer parameters.""" for module in net.modules(): if isinstance(module, nn.Conv2d): init.kaiming_normal(module.weight, mode="fan_out") if module.bias: init.constant(module.bias, 0) elif isinstance(module, nn.BatchNorm2d): ...
python
def init_params(net): """Init layer parameters.""" for module in net.modules(): if isinstance(module, nn.Conv2d): init.kaiming_normal(module.weight, mode="fan_out") if module.bias: init.constant(module.bias, 0) elif isinstance(module, nn.BatchNorm2d): ...
[ "def", "init_params", "(", "net", ")", ":", "for", "module", "in", "net", ".", "modules", "(", ")", ":", "if", "isinstance", "(", "module", ",", "nn", ".", "Conv2d", ")", ":", "init", ".", "kaiming_normal", "(", "module", ".", "weight", ",", "mode", ...
Init layer parameters.
[ "Init", "layer", "parameters", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/examples/trials/network_morphism/FashionMNIST/utils.py#L183-L196
train
Init layer parameters.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
examples/trials/network_morphism/FashionMNIST/utils.py
EarlyStopping.step
def step(self, metrics): """ EarlyStopping step on each epoch Arguments: metrics {float} -- metric value """ if self.best is None: self.best = metrics return False if np.isnan(metrics): return True if self.is_better(metri...
python
def step(self, metrics): """ EarlyStopping step on each epoch Arguments: metrics {float} -- metric value """ if self.best is None: self.best = metrics return False if np.isnan(metrics): return True if self.is_better(metri...
[ "def", "step", "(", "self", ",", "metrics", ")", ":", "if", "self", ".", "best", "is", "None", ":", "self", ".", "best", "=", "metrics", "return", "False", "if", "np", ".", "isnan", "(", "metrics", ")", ":", "return", "True", "if", "self", ".", "...
EarlyStopping step on each epoch Arguments: metrics {float} -- metric value
[ "EarlyStopping", "step", "on", "each", "epoch", "Arguments", ":", "metrics", "{", "float", "}", "--", "metric", "value" ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/examples/trials/network_morphism/FashionMNIST/utils.py#L43-L65
train
EarlyStopping step on each epoch.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
Microsoft/nni
src/sdk/pynni/nni/metis_tuner/lib_constraint_summation.py
check_feasibility
def check_feasibility(x_bounds, lowerbound, upperbound): ''' This can have false positives. For examples, parameters can only be 0 or 5, and the summation constraint is between 6 and 7. ''' # x_bounds should be sorted, so even for "discrete_int" type, # the smallest and the largest number should...
python
def check_feasibility(x_bounds, lowerbound, upperbound): ''' This can have false positives. For examples, parameters can only be 0 or 5, and the summation constraint is between 6 and 7. ''' # x_bounds should be sorted, so even for "discrete_int" type, # the smallest and the largest number should...
[ "def", "check_feasibility", "(", "x_bounds", ",", "lowerbound", ",", "upperbound", ")", ":", "# x_bounds should be sorted, so even for \"discrete_int\" type,", "# the smallest and the largest number should the first and the last element", "x_bounds_lowerbound", "=", "sum", "(", "[", ...
This can have false positives. For examples, parameters can only be 0 or 5, and the summation constraint is between 6 and 7.
[ "This", "can", "have", "false", "positives", ".", "For", "examples", "parameters", "can", "only", "be", "0", "or", "5", "and", "the", "summation", "constraint", "is", "between", "6", "and", "7", "." ]
c7cc8db32da8d2ec77a382a55089f4e17247ce41
https://github.com/Microsoft/nni/blob/c7cc8db32da8d2ec77a382a55089f4e17247ce41/src/sdk/pynni/nni/metis_tuner/lib_constraint_summation.py#L27-L40
train
Check feasibility of a given parameter range.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...