giotto-ai / giotto-deep

Deep learning made topological.
Other
79 stars 11 forks source link

Gridsearch for different model architectures that are created dynamically #38

Closed raphaelreinauer closed 2 years ago

raphaelreinauer commented 3 years ago

Is your feature request related to a problem? Please describe. When using the Gridsearch class for testing different model architectures one has to pass a dictionary of models to the init function. The problem with that is that

  1. One has to pass concrete models and not the search space of possible model architecture hyperparameters.
  2. All the models in the dictionary have to be instantiated which could fill up the ram of the GPU easily.

Describe the solution you'd like Instead of passing a dictionary of models allow passing a model architecture that depends on hyperparameters + search space of possible model architecture hyperparameters.

Additional context https://github.com/giotto-ai/giotto-deep/blob/2965f49a5653bc51790bc76c66e21f2e5ca3e65d/gdeep/search/gridsearch.py#L16

matteocao commented 3 years ago

The grid search over models with parameters is possibl: https://github.com/giotto-ai/giotto-deep/blob/4b2f10e37408e840d57823221eeeaea3d8a31705/gdeep/search/gridsearch.py#L93 . However, I would rather describe the architectures parameters inside the nn.Module __init__() function.

This makes the user part less intricate: otherwise, users would have to user @abstractmethod decorators and factory methods when building the models.

I agree that this can become a memory issue: hence, I propose to come back to this point when we have use cases in which this happens and have a use-case guidance on how to solve it.