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

Returning predictions #22

Open
PatWalters opened this issue Aug 14, 2024 · 1 comment
Open

Returning predictions #22

PatWalters opened this issue Aug 14, 2024 · 1 comment

Comments

@PatWalters
Copy link

I've been hacking on the code and trying to modify model.train_and_test to return the predictions. I thought I could just put

pred = trainer.predict(fastprop_model, test_dataloader)

in place of

test_results = trainer.test(fastprop_model, test_dataloader, verbose=False)

However, the correlations I calculate from the values returned in pred are much lower than those returned in test_results. What am I missing?

@JacksonBurns
Copy link
Owner

Ah, I've built a foot gun here - the predict method in fastprop automatically applies the feature scaling to its inputs, which is needed for inference when loading from a checkpoint but breaks the workflow in your case.

You can comment out the part of the predict method responsible for this here to get it to work now:
https://github.com/JacksonBurns/fastprop/blob/main/fastprop/model.py#L174-L175

There's a clever solution to make this work more generally, I am sure.

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