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

Easy way to store predictions? #25

Closed
EmmaRocheteau opened this issue Feb 25, 2020 · 2 comments
Closed

Easy way to store predictions? #25

EmmaRocheteau opened this issue Feb 25, 2020 · 2 comments

Comments

@EmmaRocheteau
Copy link

Hi! Thanks for making such a great tool! I've had the pleasure of exploring it over the weekend. My question about whether it's easy to store the predictions made by the model? Or should I write my own code for this and make a new folder etc. Just want to check whether you've already made a framework for this

@jenspetersen
Copy link
Contributor

Hi Emma,

glad you like trixi :) I'm assuming you're using an ExperimentLogger in some way (PytorchExperimentLogger is a subclass, and PytorchExperiment automatically uses it)? The ExperimentLogger has a method save_numpy_data that you could use, it writes to the "save" folder in your experiment, see here. You can also write to a subfolder in "save" like this

myexplogger.save_numpy_data(model_prediction.detach().cpu().numpy(), "predictions/epochXYZ.npy")

when you're on Linux (otherwise use "\\" instead of "/"). Hope that helps?

Jens

@EmmaRocheteau
Copy link
Author

Yup! I'm following the PyTorchExperiment format, so I've written my own setup, train, validate and test functions. That's fantastic! You've saved me a bunch of time thank you.

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

No branches or pull requests

2 participants