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

Cannot use specific parameter title for custom model config #512

Open
AndrewZhang599 opened this issue Jul 20, 2024 · 3 comments
Open

Cannot use specific parameter title for custom model config #512

AndrewZhang599 opened this issue Jul 20, 2024 · 3 comments

Comments

@AndrewZhang599
Copy link

AndrewZhang599 commented Jul 20, 2024

Describe the bug
Instantiating custom model with parameters that have "_" are unable to be used

To Reproduce

import pandas as pd
import arviz as az
import numpy as np
import pandas as pd
import pytensor
import matplotlib.pyplot as plt 
import hssm
import ssms.basic_simulators

shrink_spot_model = hssm.HSSM(data=test_dataset_sim, 
                              model="custom_model",
                              model_config = {
                                  "list_params": ["v", "a", "z", "t", "p_outer", "p_inner", "p_target", "r", "sda", "alpha"],
                                  "bounds": { 
                                      "v": (-3.0, 3.0), 
                                      "a": (0.3, 3.0), 
                                      "z": (0.1, 0.9),
                                      "t": (0.001, 2),
                                      "p_outer": (-1, 1), 
                                      "p_inner": (-1, 1), 
                                      "p_target": (-1, 1), 
                                      "r": (0.001, 3), 
                                      "sda": (0.001, 3), 
                                      "alpha": (0.001, 5)
                                    
                                  }, 
                                  "backend": "jax"  

                              },
                              loglik= onnx_path,
                              loglik_kind="approx_differentiable", 
                              p_outlier = 0, 

Screenshots
image

Additional context
Works so long as "_" is not a part of parameter name.

@AlexanderFengler
Copy link
Collaborator

I will have a closer look at what can be done on the _get_prefix method, but I am inclined to instead check and throw exception if models have parameters with underscores in them. What do you think @digicosmos86?

@digicosmos86
Copy link
Collaborator

I think this is kind of limiting - there should be plenty of use cases where underscores can be helpful. Let's see if there is another way that gets us around this issue

@AlexanderFengler
Copy link
Collaborator

Let's add more documentation on this but disallow _ in parameter names.
Paul conceded :)

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

No branches or pull requests

3 participants