Tracking a Run

Set and Get Run Parameters

There are a few ways you are able to set parameter values for a SigOpt Run. The sigopt.params object is used to track chosen parameter values and to get suggested parameter values for optimization. The sigopt.params object can be used like the Python dict class, allowing you to use methods like .keys(), .items(), .values() and access values using string indexing.

Set Parameter Values

sigopt.params.learning_rate = 0.1
sigopt.params["num_hidden_layers"] = 200
sigopt.params.update({"activation": "sigmoid", "num_epochs": 12})

# set default values for your SigOpt AI Experiment
sigopt.params.setdefault("batch_size", 32)
sigopt.params.setdefaults({"momentum": 0.9, "decay": 0.99})
>>>print(sigopt.params)
{‘learning_rate’:0.1, ‘num_hidden_layers’:200,‘activation’:’sigmoid’, ‘batch_size’:32, ‘momentum’:0.9, ‘decay’:0.99, ‘batch_size’:32, ‘num_epochs’:12}

Get Parameter Values

>>>sigopt.params.learning_rate
0.1

>>>sigopt.params["batch_size"]
32

SigOpt Run Attribute Tracking Methods

sigopt.log_dataset(name)

Logs the dataset name for your Run


sigopt.log_model(model_type)

Logs the model type for your Run


sigopt.log_checkpoint(checkpoint_values)

Logs metric values for a single checkpoint. To see a chart of checkpoints on the Runs Page, log checkpoints across each epoch of your model's training.


sigopt.log_metric(name, value, stddev=None)

Logs a metric value for your Run. A metric should be a scalar artifact of your model's training and evaluation. You may repeat this call with unique metric names to log values for many metrics. If you log the same metric multiple times then we will only keep the most recent value.


sigopt.log_failure()

Indicates that the Run has failed for any reason. When performing optimization, you will see that a Run for your AI Experiment has also been marked as failed


sigopt.log_image(image, name=None)

Uploads an image artifact for your run. See the image argument description for a list of compatible inputs.

Additional notes for image argument:

  • If a string is provided then this argument will be treated like a filesystem path and the image will be opened and uploaded. The image type will be inferred from the file extension.

  • If a PIL Image is provided then it will be converted to PNG and uploaded.

  • If a matplotlib Figure is provided then it will be converted to SVG and uploaded.

  • If a numpy array is provided then the values will be clamped to the range [0, 255] and then cast to unsigned 8-bit integers. The resulting array will be converted to PNG and then uploaded.

    • 2D arrays will be interpreted as grayscale images.

    • 3D arrays with a single channel in the last dimension will also be interpreted as grayscale images.

    • 3D arrays with 3 channels in the last dimension will be interpreted as RGB images with the 3 channels representing the red, green and blue intensities respectively.

    • 3D arrays with 4 channels in the last dimension will be interpreted as RGBA images with the 4 channels representing the red, green, blue and alpha intensities respectively.


sigopt.log_metadata(key, value)

This stores any extra information about your Run.

Last updated