lnccbrown / lnccbrown/HSSM

Cannot use specific parameter title for custom model config

Open
#512 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
124
Forks
24
Avg merge
19h 32m
Merged PRs (30d)
60

Description

**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](https://github.com/user-attachments/assets/aa79858b-bcf8-4103-bb7f-4bb1ac791cc7)

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the problem from the HSSM(data=..., model="custom_model", model_config=...) example, focusing on parameter names containing underscores such as p_outer and p_inner. Trace the custom model configuration entry point and compare it with names without underscores; done means custom parameters containing underscores can be instantiated successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, pandas, python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.