Skip to content

Commit

Permalink
fix bug when semip is passed None for likelihood (facebookresearch#347)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebookresearch#347

Adds a check to make sure likelihood class is not None when constructing the likelihood of SemiP from a config

Reviewed By: mshvartsman

Differential Revision: D57624855

fbshipit-source-id: 514996c4f2c97c98d33171e811199ad47466a98e
  • Loading branch information
crasanders authored and facebook-github-bot committed May 22, 2024
1 parent 6cf932a commit 23ac907
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aepsych/models/semi_p.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,10 @@ def from_config(cls, config: Config) -> SemiParametricGPModel:

if hasattr(likelihood_cls, "from_config"):
likelihood = likelihood_cls.from_config(config)
else:
elif likelihood_cls is not None:
likelihood = likelihood_cls()
else:
likelihood = None

stim_dim = config.getint(classname, "stim_dim", fallback=0)

Expand Down

0 comments on commit 23ac907

Please sign in to comment.