Skip to content

Add Variables to Experiment

Jonny M edited this page Mar 10, 2018 · 2 revisions

Experiments require further setup before submitting for optimization. You will need to add variables to your experiment.

Arguments

  • name (str): The name of the variable. Must be unique.
  • v_type (str): Type of variable. (int, float, or enum)
  • v_range (list/tuple): A min and max range to test (only for int/float Variables)
  • values (list): The list of possible enum values (only for enum Variables)
  • step_size(int or float): the preferred step size for use with grid search

Variable Types

  • Integer
  • Float
  • Enum

Setting Variable Ranges and Step Sizes

Integers and Floats require a range and step: v_range=[v_min, v_max] step_size

Setting enum values

enum requires a set of values. values=["v1", "v2", ..., "v3"]

Examples

Add Integer

iris_expt2.add_var(Variable("hidden_size", "int", v_range=[5, 20], step_size=1))

Add float

iris_expt2.add_var(Variable("lr", "float", v_range=[0.001, 0.1], step_size=.01))

Add enum

iris_expt2.add_var(Variable("optimizer", "enum", values=["gd", "adam", "rms"]))