Open panwanke opened 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(...)
--> simulator
obs_angle = ssms.basic_simulators.simulator.simulator(...)in
likelihoods.ipynb`
Replace all config.update("jax_enable_x64", False)
and pytensor.config.floatX = "float32"
with hssm.set_floatX("float32")
hssm.set_floatX
consistently in all notebooks?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.
The major modifications are the file path references.
cavanagh_theta_test.csv
and cavanagh_idata.nc
were referenced in plotting.ipynb
, and they were in the tests/fixtures
folder. So I mapped that folder to the docker's src
directory as shown below. This allows you to reference this data via src/cavanagh_theta_test.csv
.
*.onnx
exist under fixtures and may not be downloadable on some network conditions, to facilitate the use of these models in docker, I added loglik="src/*onnx"
to all places where onnx is needed, including pymc.ipynb
, likelihoods.ipynb
and main_tutorials.ipynb
. such as
model_model_comp_1 = hssm.HSSM(
data=dataset_model_comp,
model="angle",
loglik="src/angle.onnx",
a=1.0,
)
@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 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
)
Add a dockerfile for dockerizing the HSSM and a
docker-image.yml
for allowing github action. I tested the all notebooks intutorials
folder, and fix some issues.