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

SolverInterface changes #116

Closed
dario-coscia opened this issue Jun 15, 2023 · 2 comments
Closed

SolverInterface changes #116

dario-coscia opened this issue Jun 15, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request high priority Higher priority

Comments

@dario-coscia
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
I would like to implement a Solver for the new v0.1 version with multiple neural networks as models (for example a GAN) and multiple optimisers. Nevertheless, the solver interface takes only one model. If I want to define two models, I need to use the class Network in the GAN solver to do all the checks. Same story for optimisers. It could lead to high code redundancy.

Describe the solution you'd like
We can make in SolverInterface a list of models instead, and also a list of optimisers. So the __init__ would become:

class SolverInterface(pl.LightningModule, metaclass=ABCMeta):
    """ Solver base class. """
    def __init__(self, models, optimizers, problem, extra_features=None):

In this way when creating a new solver we can make all the checks in the SolverInterface class, avoiding repetition in the code for each solver.

Additional context
Add any other context or screenshots about the feature request here.

@dario-coscia dario-coscia added the enhancement New feature or request label Jun 15, 2023
@dario-coscia dario-coscia self-assigned this Jun 15, 2023
@dario-coscia
Copy link
Collaborator Author

I will do a pull request for the v0.1 version (#85)

@dario-coscia
Copy link
Collaborator Author

Fixed in c7574d2, closing the issue.

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

No branches or pull requests

1 participant