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

Plugins Should be Addable from the Strategy Constructor #126

Closed
vlomonaco opened this issue Oct 12, 2020 · 2 comments
Closed

Plugins Should be Addable from the Strategy Constructor #126

vlomonaco opened this issue Oct 12, 2020 · 2 comments
Labels
good first issue Good for newcomers Training Related to the Training module

Comments

@vlomonaco
Copy link
Member

vlomonaco commented Oct 12, 2020

A the moment plugins should be added manually inside a strategy:

        self.evaluation_plugin = EvaluationPlugin()
        self.add_plugin(self.evaluation_plugin)

It would be nice to give the possibility to add them from the constructor of the Strategy:

    cl_strategy = Naive(
        model, 'classifier', SGD(model.parameters(), lr=0.001, momentum=0.9),
        CrossEntropyLoss(), train_mb_size=100, train_epochs=4, test_mb_size=100,
        evaluation_protocol=evaluation_protocol, device=device, plugins=[x(), y(), z()])
@vlomonaco vlomonaco added good first issue Good for newcomers Training Related to the Training module labels Oct 12, 2020
@vlomonaco vlomonaco changed the title Plugins Should be Addable for the Strategy Constructor Plugins Should be Addable from the Strategy Constructor Oct 12, 2020
@AndreaCossu
Copy link
Collaborator

Is this issue still unresolved? If I look at the code I find that plugins can be passed directly to the strategy constructor as requested.

@vlomonaco
Copy link
Member Author

Sorry, yes this was fixed this morning in vlomonaco@457130c, thanks for the heads up!

vlomonaco pushed a commit that referenced this issue Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers Training Related to the Training module
Projects
None yet
Development

No branches or pull requests

2 participants