-
Notifications
You must be signed in to change notification settings - Fork 84
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
Replace pystan models with numpyro #377
Conversation
- Hangs if running multithreaded, possibly because bpl-next uses jax which is itself uses multiprocessing. See jax-ml/jax#1805 but changing multiprocessing in AIrsenal gives errors about sqlalchemy session not being pickle-able. - bpl-next predictions occasionally have nan values
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Hopefully have a working team model now, but could do with someone checking what I've done to avoid NaNs and for adding new teams. Also have an idea to get around the multiprocessing issue - we should be able to pre-generate score probabilities for each fixture and pass those to each thread rather than the team model (may also be a bit quicker as we'd only compute them once per fixture rather than once per player like we do currently) |
though actually looks like very limited benefit over single threaded
…titute/AIrsenal into feature/313-pyro
Nice work Nick! Quick comparison before/after new player model (but using Stan player model:
NumPyro player model:
New model seems to like Jesus and Firmino a decent chunk more than the old model (NumPyro scores also look higher in general). |
Interesting!! |
…titute/AIrsenal into feature/313-pyro
I think we just predict 0 for new players as they have 0 recent minutes, so they probably don't make it as far as the player model. The model seems to predict Firmino and Salah to have very similar score/assist probabilities - I'm wondering if it's something to do with priors (we have a position-dependent prior and Salah scores much more than an average midfielder but Firmino (maybe) much less than an average striker - perhaps the prior is dragging them both towards the mean). |
Hmm... that would make sense, but not sure why it would be any different to what it was with the Stan model...? For the new players, I think you're right - it's the minutes that gives them zero. I looked at what the model itself predicts for their p(score) etc. though, and it's very close to the position-dependent averages, which I guess is what we want. |
See: