Skip to content

How to create a search space dictionary where one key-value depends on another key-value? #241

Answered by sonichi
wjlgatech asked this question in Q&A
Discussion options

You must be logged in to vote

I'd suggest this:

space = {"n_layers": tune.randint(2, 6)}
for i in range(4):
    space[f"num_units_layer_{i}"] = tune.qrandint(100, 300, q=100)

and in the trainable function, simply ignore the unused hps.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@wjlgatech
Comment options

wjlgatech Oct 3, 2021
Collaborator Author

@wjlgatech
Comment options

wjlgatech Oct 4, 2021
Collaborator Author

Answer selected by wjlgatech
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants