Skip to content

Requesting Hyperparameter Configurations and Reporting Loss

Jonny M edited this page May 18, 2018 · 1 revision

Using the next_configuration option will request the next configuration from the server. You will then need to apply these hyperparameters to your model.

A single configuration can be requested, or a batch of configurations can be requested.

This will return a hyperparameter configuration stored as a (JSON) Dictionary for all variables in the experiment.

In a typical experiment setting, you will want to run a loop where you will continuously request configurations, apply the configuration to your model which should report some loss or error factor to be minimized, and then report_loss to the wwu_tinker server.

The report_loss function is critical to the process, as it will allow you to fetch the best configuration later on.

Below is a simple loop demonstrating this process

for i in range(1, 10):
    config = test_experiment.next_configuration()
    result = ml_model(config['x'], config['y'])
    print (result)
    config.report_loss(result)