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

Keras-Tuner always returns the same amount of nodes for my #907

Open
MbProg opened this issue Apr 20, 2023 · 0 comments
Open

Keras-Tuner always returns the same amount of nodes for my #907

MbProg opened this issue Apr 20, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@MbProg
Copy link

MbProg commented Apr 20, 2023

I use keras-tuner with RandomSearch to get the number of nodes for my two hidden layers where the second layer must not have more nodes than the first layer and at least 60% of nodes of the first layer. Therefore, I use the following code:

class SimpleMLP(kt.HyperModel):
def build(self,hp):
    first_layer_nodes = hp.Int(name='first_layer_nodes',min_value = 50, max_value=1000,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)

I get random amount of nodes for first_layer_nodes in the given interval. But for second_layer_nodes I always get 30. And I get 30 even first_layer_nodes is 300 or 900 or anything else. It is out of the given interval of min_value and max_value.
What is wrong with the code?

@MbProg MbProg added the bug Something isn't working label Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant