Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow list hyperparameters in method JSON #60

Merged
merged 7 commits into from
Jan 17, 2018

Conversation

bcyphers
Copy link
Contributor

@bcyphers bcyphers commented Jan 16, 2018

First, this PR moves a lot of hyperparameter logic from BTB to ATM. Specifically, all conditional hyperparameters are handled on the ATM side now. Categorical hyperparameters will remain in BTB, but the BTB categoricals will not be relevant to ATM anymore.

The bigger change is the addition of List hyperparameters: you can now add a single hyperparameter that represents a list of many hyperparameters of the same type and range. For example, in multi_layer_perceptron.json:

        "hidden_layer_sizes": {
            "type": "list",
            "sizes": [1, 2, 3],
            "element": {
                "type": "int",
                "range": [2, 300]
            }
        },

Lists need to be defined with caution. Behind the scenes, the list is translated to a single "size" hyperparameter along with a list of "element" hyperparameters conditioned on every possible value of "size". For example, the above code would define the following hyperpartitions:

hidden_layer_sizes_size = 1
  hidden_layer_sizes[0] = ?

hidden_layer_sizes_size = 2
  hidden_layer_sizes[0] = ?
  hidden_layer_sizes[1] = ?

hidden_layer_sizes_size = 3
  hidden_layer_sizes[0] = ?
  hidden_layer_sizes[1] = ?
  hidden_layer_sizes[2] = ?

Note that "sizes" must be defined as a list of possible values, not a range. This should make it harder to accidentally create O(n2) conditional hyperparameters by defining a list with a huge range.

Finally, categorical hyperparameters are now defined with a list of "values" instead of a "range". This is meant to make it less confusing when defining int or int_cat parameters. For example:

"param_a": {
    "type": "int_cat",
    "values": [1, 3]         # Only includes the values 1 and 3
},

is different from

"param_b": {
    "type": "int",
    "range": [1, 3]         # Includes the values 1, 2, and 3
},

…ather than a method code

in addition, all paths should now be relative to the project root (rather than ./)
@bcyphers
Copy link
Contributor Author

bcyphers commented Jan 16, 2018

Updated: I'm including custom method passing and absolute paths with this PR for convenience.

From the commit:
"add custom method definitions: users can pass a path to method JSON rather than a method code
in addition, all paths should now be relative to the project root (rather than ./)"

This now addresses #61 and part of #52.

@bcyphers bcyphers merged commit 4f9b483 into master Jan 17, 2018
@bcyphers bcyphers deleted the bcyphers/method_json_lists branch January 17, 2018 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant