lnccbrown / HSSM

Development of HSSM package
Other
77 stars 11 forks source link

Cannot get HSSM to run via different platforms #309

Closed leonarahel closed 5 months ago

leonarahel commented 11 months ago

Hey,

I am trying to install and run HSSM on different systems, I tried Windows10, Linux, and Colab and each try gets me differently far however I haven't gotten it to actually run, and maybe I am missing something.

When I install it on Windows it will fail to install wheels If I try it on Linux, the different versions of numpy, are not compatible with the versions of python required, The python versions are 3.10 or 3.11, and the numpy version is 1.22, when in an empty environment just trying to install hssm it will install a version of numpy that a later installation of numba is not compatible with. While when I try in colab everything installs. However, once I create a ddm and sample from it, it gives back different arbitrary numbers and upon checking the sampling chains they did not converge and did not even leave the spot (they remain at the value they were initialized on: flat line).

When installing on linux or windows it also does not make a difference if I pull it via github or use pip.

Since I will eventually need to work on participant data, colab is not really an option for the final solution but I wanted to check what I am missing.

I hope this is enough information, tell me if you need anything else and thank you for your help!

Best wishes, Leona

leonarahel commented 11 months ago

Oh now I got it to the point on linux again where I had it on Colab :D where it installs but all the sampling chains are flat lines.

digicosmos86 commented 11 months ago

Hi Leona,

Can you share your model specification? It is our experience that sometimes the specification of the t parameter can greatly affect sampling. Also we are experiencing some issues with initial values when the model involves regressions on parameters a, z, and t. That's a problem that we are working on fixing right now. We expect to have a solution for that soon.

BTW, you should be able to install hssm from github on Windows. We have built wheels for all HSSM dependencies and that should solve the problems with wheels on Windows.

Hope this helps Paul

leonarahel commented 11 months ago

Hey, thank you for the quick answer. I got struck down with covid this is why I am a little late.

I am using the very unspecified model given in the first steps tutorial. I will attach some screenshots of what I am doing and what the outputs are:

Importing and basics How data is set up The outputs

Thank you again for your help!

digicosmos86 commented 11 months ago

Sorry to hear about covid! Hope you are feeling better!

It seems that your responses are coded (1.0, 2.0). HSSM at the moment only accepts (-1, 1) or (0, 1) coded binary responses. Can you try changing how you code the responses?

leonarahel commented 11 months ago

Thank you!

I changed it to 1 and -1 and the same issue remains. Also regardless of whether I have them as ints or floats.

digicosmos86 commented 11 months ago

This is indeed very strange. Could you try sampling using simulated data? That'd helpful for us to see if this is a data or system specific issue or something else. The easiest way to simulate a dataset is:

v_true, a_true, z_true, t_true = [0.5, 1.5, 0.5, 0.5]
dataset = hssm.simulate_data(
    model="ddm",
    theta=[v_true, a_true, z_true, t_true],
    size=1000,
)

Thanks!

leonarahel commented 11 months ago

With this simulated data it works! So its probably something about the data. But I don't know what it is :/

I tried to make everything the same data types now (np.float64), have really only the two columns in the correct order. The only thing that I notice that is really different is that our subject only have about 2 seconds to respond so the maximum response time is like 1.4 and our minimum response time is very small, but above 0. I thought though that it would not make a difference?

frankmj commented 11 months ago

I noticed your data has a "stim" column so you probably want a model that varies e.g. drift rate by stim. in the simulated data there is one set of parameters but in your experimental data you are trying to fit one set of parameters lumped across all these stim conditions -- so e.g. if choices are more likely to be response 1 for some stim and response 2 for other stims, the current model could only try to fit choices on average and essentially predict randomness. (This shouldn't lead to an inability to sample but just poor fit to the data, so there is still an issue here - but you can try a model where you add a v ~ stim regressor, but I would suggest first z-scoring the stim column).

On Mon, Nov 13, 2023 at 5:56 AM leonarahel @.***> wrote:

With this simulated data it works! So its probably something about the data. But I don't know what it is :/

— Reply to this email directly, view it on GitHub https://github.com/lnccbrown/HSSM/issues/309#issuecomment-1807932136, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG7TFAXSJO5K2OW7EUHSL3YEH4GDAVCNFSM6AAAAAA6XY43B2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBXHEZTEMJTGY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

leonarahel commented 11 months ago

Alright thats true the answer depends on the condition which one is more likely. The task that they have is that they see facial expressions that can be completely happy or fearful, but than the faces can also be morphed into ambiguous expressions that are morphed between certain degrees of happy or fearful. With button press they indicate whether a face is more happy (1) or fearful (2). However I tried it just now isolated on the trials in the unambiguous happy condition and the same issue comes up, still the sampling chain does not diverge from a certain value.

Really, thank you so much for the help! I did get this same model to run in the docker version of HDDM, even across all the conditions. I wanted to switch to HSSM because some time in the future I will need to implement a multichoice DDM and I was told that in HSSM it will be possible to customize your models in that way.