def hp_pchoice(label, p_options): """ label: string p_options: list of (probability, option) pairs """ p, options = zip(*p_options) n_options = len(options) ch = scope.hyperopt_param(label, scope.categorical(p, upper=n_options)) return scope.switch(ch, *options)
def hp_pchoice(label, p_options): """ label: string p_options: list of (probability, option) pairs """ if not isinstance(label, basestring): raise TypeError("require string label") p, options = zip(*p_options) n_options = len(options) ch = scope.hyperopt_param(label, scope.categorical(p, upper=n_options)) return scope.switch(ch, *options)
def hp_pchoice(label, p_options): """ label: string p_options: list of (probability, option) pairs """ if not isinstance(label, basestring): raise TypeError('require string label') p, options = zip(*p_options) n_options = len(options) ch = scope.hyperopt_param(label, scope.categorical(p, upper=n_options)) return scope.switch(ch, *options)
def hp_choice(label, options): if not isinstance(label, basestring): raise TypeError("require string label") ch = scope.hyperopt_param(label, scope.randint(len(options))) return scope.switch(ch, *options)
def hp_choice(label, options): ch = scope.hyperopt_param(label, scope.randint(len(options))) return scope.switch(ch, *options)
def hp_choice(label, options): if not isinstance(label, basestring): raise TypeError('require string label') ch = scope.hyperopt_param(label, scope.randint(len(options))) return scope.switch(ch, *options)