Skip to content
This repository has been archived by the owner on Jan 8, 2023. It is now read-only.

PyTorch support documentation and examples #1

Open
amanoel opened this issue Oct 8, 2018 · 3 comments
Open

PyTorch support documentation and examples #1

amanoel opened this issue Oct 8, 2018 · 3 comments

Comments

@amanoel
Copy link

amanoel commented Oct 8, 2018

Hi, you mention in the readme that the package supports PyTorch models, but in ShadowModelBundle._fit you assume the model has fit method (line 116).
How exactly have you tested the PyTorch models? I was thinking of maybe using pytorch-fitmodule or SuperModule, but if there's a way you recommend already that would be great. Also it would be nice to include an example of how to load PyTorch modules in the package! (maybe I can do a PR after I'm able to do it myself :-)

@bogdan-kulynych
Copy link
Member

bogdan-kulynych commented Oct 8, 2018

Hi, ShadowModelBundle and AttackModelBundle take a scikit-like object, with fit, predict, and predict_proba methods. You can use skorch to wrap your torch model in such an API, or mia's own mia.wrappers.TorchWrapper. You can see example tests that use skorch (shadow, attack, serializers).

@bogdan-kulynych
Copy link
Member

If you can add an example, that would be great!

@bogdan-kulynych bogdan-kulynych changed the title PyTorch support? PyTorch support documentation and examples Oct 8, 2018
@amanoel
Copy link
Author

amanoel commented Oct 8, 2018

Ah great I haven't seen the TorchWrapper! In the end I just wrote my own class, but indeed using skorch should be better, I'll do that instead, thanks.

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

No branches or pull requests

2 participants