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

Skip certain parameter combinations in the parameter space #528

Open
1 of 5 tasks
Smolky opened this issue Dec 23, 2020 · 2 comments
Open
1 of 5 tasks

Skip certain parameter combinations in the parameter space #528

Smolky opened this issue Dec 23, 2020 · 2 comments

Comments

@Smolky
Copy link

Smolky commented Dec 23, 2020

1) I think Talos should add a method for skip impossible combinations of parameters

If for example, I want to test a CNN with MLP networks, some parameters, such as the kernel_size does not exists in certain combinations. Moreover, if I limit the time or the number of combinations I do not want to waste some impossible combinations.

2) Once implemented, I can see how this feature will

Although there are methods for skip this manually, I think it should be nice to use parameter space in the same way that ParametersGrid from scikit-learn does.

For example:

parameters_to_evaluate = [{
     'number_of_layers': [1, 2, 3, 4, 5, 6, 7, 8],
     'first_neuron': [8, 16, 48, 64, 128, 256],
     'shape': ['funnel', 'brick'],
     'architecture': ['bilstm', 'bigru'],
      'activation': ['relu', 'sigmoid']
}, {
     'number_of_layers': [1, 2, 3, 4, 5, 6, 7, 8],
     'first_neuron': [8, 16, 48, 64, 128, 256],
     'shape': ['funnel', 'brick'],
     'kernel_size': [3, 5],
     'architecture': ['cnn'],
     'activation': ['relu', 'sigmoid']
}]

3) I believe this feature is

  • critically important
  • must have
  • [X ] nice to have

4) Given the chance, I'd be happy to make a PR for this feature

  • definitely
  • possibly
  • unlikely

@mikkokotila
Copy link
Contributor

Just to be safe...

You can achieve it with Scan( ... boolean_limit ... ) or a more custom way where the input model has something that tells Talos

Also, you can within the input model itself handle any logics you like. Talos will compute everything that is in the input model, regardless if it relates with tf/keras or not. This gives you unrestricted power to add any logic to the input model.

I do appreciate that there is a benefit in following a pattern by a library that benefits many in the Talos community. Thank you for suggesting it 👍

@Smolky
Copy link
Author

Smolky commented Dec 30, 2020

Hi. Thanks for your answer. First, I have to thank you for this tool. It is very useful to me.

Before I post my suggestion, I considered the following approaches:

  1. Skip it inside the model, but I tried to return None, None but I think Talos expect both History and Model as output after each iteration. Moreover, I think that if you want to limit the permutations, this approach is not useful because if you set round_limit, Talos will not try as many combinations as it could.
  2. Specify, beforehand, the valid combinations. In this case, I remember that scikit allows list of dictionaries as inputs, but I have no idea how complex it this to implement with Talos.

Kind regards and happy new year

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants