lnccbrown / HSSM

Development of HSSM package
Other
71 stars 10 forks source link

Add `ddm_sdv` onnx model to 🤗 #412

Open jainraj opened 2 months ago

jainraj commented 2 months ago

HSSM version 0.2.0

To Reproduce

import numpy
import hssm
hssm.set_floatX("float32")
cav_data = hssm.load_data("cavanagh_theta")

Bug 1: Bounds by default

ddm_model = hssm.HSSM(
    data=cav_data,
    model='ddm_sdv',
    p_outlier=0.05,
)

Output:

ValueError: Please specify the prior or bounds for sv.

I think this should be solved by using the right bounds variable in defaults.py - which I see has happened in main brain, but please confirm.

Bug 2: So I proceeded to explicitly give the bounds, but.

ddm_model = hssm.HSSM(
    data=cav_data,    
    model='ddm_sdv',
    p_outlier=0.05,
    include=[
        {
            "name": "sv", 
            "bounds": (0, numpy.inf),
        },
    ],
)
ddm_model.sample()

Output:

TypeError: Invalid dtype for variable sv_interval__. Can not cast to float32 with casting rule no.

Unsure what is causing this.

Bug 3: So I moved to approx_differentiable, but.

ddm_model = hssm.HSSM(
    data=cav_data,    
    model='ddm_sdv',
    loglik_kind='approx_differentiable',
    p_outlier=0.05,
)

Output:

Entry Not Found for url: https://huggingface.co/franklab/HSSM/resolve/main/ddm_sdv.onnx.

I guess the compiled version from Huggingface was removed?

So I moved to blackbox likelihood, but for my actual use case, I have a hierarchical model for t parameter and I am facing the same issue as #411, i.e., high r-hats for all t parameters :(

digicosmos86 commented 2 months ago

Hi @jainraj,

The bounds with ddm_sdv was indeed a bug that was fixed in this PR. However, this change has not yet made into an official release on PyPI yet. You can download the dev version of HSSM with this command pip install git+https://github.com/lnccbrown/HSSM.git.

We'll look into the other bugs. There should be ddm_sdv.onnx on huggingface, so that one is a weird one :).

Thanks! Paul

digicosmos86 commented 1 month ago

Confirmed that the onnx model for ddm_sdv was not uploaded to HuggingFace. @AlexanderFengler do you have a model that can be uploaded?

jainraj commented 2 weeks ago

Any ETA on this?