aup.Proposer package

The proposer is the core component to optimize hyperparameters for model training.

Use aup.Proposer.AbstractProposer.get_proposer() to initialize proposer.

All of them adopt the same interface as described below.

Proposers

aup.Proposer.AbstractProposer

aup.Proposer.AbstractProposer provide interface for Hyperparameter Optimization Modules.

APIs

class AbstractProposer(config)[source]

Bases: abc.ABC

Proposer to generate new values for hyperparameters

Parameters

config (BasicConfig) – experiment configuration

check_termination()[source]
failed(job)[source]

Mark job as failed in proposer history.

Parameters

job (Job) – Failed job

get(**kwargs)[source]

Wrapper for specific get_param() to update current_proposal and counter.

Parameters

kwargs (dict) – any arguments to be passed to get_param()

Returns

parameter values

Return type

dict

abstract get_param(**kwargs)[source]

Get new proposed parameter values

get_remaining_jobs()[source]
get_status()[source]
increment_job_counter()[source]
static parse_param_config(config)[source]

Parse the given experiment configuration of parameter_config If values are missing, fill in defaults.

Parameters

config (dict) – config[“param_config”]

Returns

updated config

Return type

dict

reload(path)[source]

Reload Proposer state from path

Parameters

path (str) – path to reload

reset()[source]

Reset proposer

save(path)[source]

Save Proposer state to path.

Some proposer can not generate new parameters after saving.

Parameters

path (str) – path to save

set_status(status)[source]
static setup_config()[source]
update(score, job)[source]

Update scores in proposer history

Parameters
  • score (float) – score returned by Job

  • job (Job) – Finished job

verify_config(config)[source]

Verify the input configuration is enough for the proposer

Parameters

config (dict) – Experiment configuration of parameter_config

Returns

config

Return type

dict

create_param_config(name, vrange, vtype)[source]

Reads the configuration file and checks for errors.