lnccbrown / HSSM

Development of HSSM package
Other
70 stars 10 forks source link

dockerHSSM #439

Open panwanke opened 1 month ago

panwanke commented 1 month ago

Add a dockerfile for dockerizing the HSSM and a docker-image.yml for allowing github action. I tested the all notebooks in tutorials folder, and fix some issues.

panwanke commented 1 month ago

Thank you for your reply. I am reporting the issues and changes in the notebooks below. These issues have been discussed with Alex and any help needed is appreciated.

obs_angle = ssms.basic_simulators.simulator(...) --> simulatorobs_angle = ssms.basic_simulators.simulator.simulator(...)inlikelihoods.ipynb`

Replace all config.update("jax_enable_x64", False) and pytensor.config.floatX = "float32" with hssm.set_floatX("float32")

Remove missing api in main_tutorial.ipynb:

from hssm.distribution_utils import (
    make_distribution,  # A general function for making Distribution classes
    make_distribution_from_onnx,  # Makes Distribution classes from onnx files
    make_distribution_from_blackbox,  # Makes Distribution classes from callables
)

to

from hssm.distribution_utils import make_distribution

There is a compatibility issus with latests pymc(5.15) that makes .graph() not work. So, in the docker env, I fix pymc version to 5.14. image

The major modifications are the file path references.

digicosmos86 commented 1 month ago

@panwanke Thank you again for your help with this! We really appreciate the effort in fixing the inconsistencies in our notebooks! In principle I agree with all the changes but the last one. We want to keep the notebooks directly executable in Google Colab, so switching to a local reference to the onnx files might break that. Maybe you can download all networks from the huggingface repo to the docker image, and then add references (commented out) to the onnx files locally? People can then uncomment the code when there is no Internet

panwanke commented 1 month ago

@panwanke Thank you again for your help with this! We really appreciate the effort in fixing the inconsistencies in our notebooks! In principle I agree with all the changes but the last one. We want to keep the notebooks directly executable in Google Colab, so switching to a local reference to the onnx files might break that. Maybe you can download all networks from the huggingface repo to the docker image, and then add references (commented out) to the onnx files locally? People can then uncomment the code when there is no Internet

Thanks for the suggestion. I'm sorry I didn't think about running in colab before. I've now commented out where I need to use onnx and added an explanation. For example, like this,

ddm_model_approx_diff = hssm.HSSM(
    data, model="ddm", 
    loglik_kind="approx_differentiable",
    loglik="ddm.onnx",          # will be downloaded from huggingface
    # loglik="src/ddm.onnx", # If running in dockerHSSM, the local file is available
)