Skip to content

Commit

Permalink
add debug
Browse files Browse the repository at this point in the history
  • Loading branch information
jackaraz committed Feb 15, 2024
1 parent 807ec2c commit 06dd5a2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/spey/backends/distributions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Autograd based differentiable distribution classes"""

import logging
import warnings
from typing import Any, Callable, Dict, List, Text, Union

Expand All @@ -8,7 +9,9 @@
from autograd.scipy.stats.poisson import logpmf
from scipy.stats import multivariate_normal, norm, poisson

# pylint: disable=E1101
# pylint: disable=E1101, W1203

log = logging.getLogger("Spey")

__all__ = ["Poisson", "Normal", "MultivariateNormal", "MainModel", "ConstraintModel"]

Expand Down Expand Up @@ -239,11 +242,13 @@ def __init__(self, pdf_descriptions: List[Dict[Text, Any]]):
self._pdfs = []
distributions = {"normal": Normal, "multivariatenormal": MultivariateNormal}

log.debug("Adding constraint terms:")
for desc in pdf_descriptions:
assert desc["distribution_type"].lower() in [
"normal",
"multivariatenormal",
], f"Unknown distribution type: {desc['distribution_type']}"
log.debug(f"{desc}")
self._pdfs.append(
distributions[desc["distribution_type"]](
*desc.get("args", []), **desc.get("kwargs", {})
Expand Down

0 comments on commit 06dd5a2

Please sign in to comment.