I have a simple use case, but I cannot find any solution to this problem anywhere:
I have two hyperparameters which I want to tune with keras-tuner
:
- Amount of nodes of the first hidden layer
- Amount of nodes of the second hidden layer
Now, I want to the amount of nodes of the second hidden layer to not exceed the amount of the first one and have at least 60% of the amount of the first one.
I tried different options, but all fail and I get for some reason always 30
for the second one:
first_layer_nodes = hp.Int(name='first_layer_nodes',min_value = 50, max_value=300,step=32)
second_layer_nodes = hp.Int(name='second_layer_nodes',min_value = int(first_layer_nodes*0.6), max_value=first_layer_nodes, step = 32)
or
first_layer_nodes = hp.Int(name='first_layer_nodes',min_value = 50, max_value=300,step=32)
second_layer_nodes = hp.Int(name='second_layer_nodes',min_value = int(hp.get('first_layer_nodes')*0.6), max_value=hp.get('first_layer_nodes'), step = 32)
How can I accomplish this?