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

Support multiple input for forward #354

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
handle multiparameter input
  • Loading branch information
amal-ghamdi committed Feb 9, 2024
commit aaa15769448d8e2189bf897850be724c21a639e9
4 changes: 3 additions & 1 deletion cuqi/likelihood/_likelihood.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from __future__ import annotations
from typing import Union
from cuqi.model import Model
from cuqi.utilities import get_non_default_args, _get_python_variable_name
from cuqi.utilities import get_non_default_args, _get_python_variable_name,\
_split_stacked_args
from cuqi.geometry import _DefaultGeometry1D
from cuqi.density import Density, EvaluatedDensity
import warnings
Expand Down Expand Up @@ -59,6 +60,7 @@ def _constant(self):

def _logd(self, *args, **kwargs):
"""Return the log-likelihood function at given value"""
args, kwargs = _split_stacked_args(self.geometry, *args, **kwargs)
return self.distribution(*args, **kwargs).logd(self.data)

def _gradient(self, *args, **kwargs):
Expand Down