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

PyTorch as computational backend #51

Open
timothyb0912 opened this issue Sep 5, 2020 · 1 comment
Open

PyTorch as computational backend #51

timothyb0912 opened this issue Sep 5, 2020 · 1 comment
Assignees

Comments

@timothyb0912
Copy link
Owner

Request

Currently, PyLogit is built atop numpy and scipy.sparse for computational of choice probabilities, gradients, and hessians. This computational backend has at least two problems.

  1. It restricts us to analytical derivatives that must be programmed by hand.
  2. It practically restricts us to batch optimization since stochasatic optimization methods are currently only in libraries with automatic differentiation support.

Note, packages such as autograd and jax are of no help here because they don't support sparse matrices.

PyLogit should move to using PyTorch as its computational backend. There are almost no immediately known downsides. Upsides include resolving both problems above, allowing essentially arbitrary chocie models to be estimated through PyLogit, and providing access to a large and growing ecosystem of tools that are all designed around PyTorch (e.g. for model serialization, for scikit-learn compatibility, for standardization of model estimation code by end users, etc.).

@danhphan
Copy link

Hi @timothyb0912, how is the progress of this feature going?

I am currently using pylogit for the mnl estimation of a large data set (million rows) with a large number of alternatives. I have some experience with pytorch, and would like to integrate pytorch's mini-batch optimization into pylogit.

Should we develop another estimation.py file in pylogit? Do you have a plan for this feature or any advice where I should start?

Really appreciate your help!

Thank you.

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

No branches or pull requests

2 participants