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

Check passing initialized modules #106

Open
kulbachcedric opened this issue Jan 2, 2025 Discussed in #105 · 2 comments
Open

Check passing initialized modules #106

kulbachcedric opened this issue Jan 2, 2025 Discussed in #105 · 2 comments
Labels
enhancement New feature or request

Comments

@kulbachcedric
Copy link
Collaborator

kulbachcedric commented Jan 2, 2025

This issue proposes changes to enhance flexibility in handling PyTorch modules by allowing initialized modules to be passed to the base classes. This could help streamline workflows where pre-initialized or pre-trained models are frequently used.

Current Implementation

The current Regressor and similar classes require a module type (Type[torch.nn.Module]) to instantiate a model internally. This design works well for simple use cases but restricts flexibility when users need to use pre-initialized modules.

Discussion Points

  1. Impact on Existing Workflows:
    Will allowing initialized modules complicate initialization for existing users?

  2. Documentation Updates:
    How should we structure documentation to highlight this change?

However, with this change we would diverge from skorch.

Best
Cedric

@kulbachcedric kulbachcedric added the enhancement New feature or request label Jan 2, 2025
@kulbachcedric
Copy link
Collaborator Author

Hi @hoanganhngo610 , @lucasczz

I worked a little bit on the code, what do you think ?
We could still have all the features, however, all tests need to be refactored ...

Best
Cedric

@lucasczz
Copy link
Collaborator

lucasczz commented Jan 2, 2025

Hi @kulbachcedric,
That looks good 👍
I think it's a good idea to allow already initialized modules for. Makes it easier if you want to set some model hyperparameters before passing the module to DeepRiver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants