Skip to content

Commit

Permalink
small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsKue committed Aug 30, 2024
1 parent be7c666 commit 230d094
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 1 addition & 3 deletions bayesflow/networks/summary_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def call(self, x: Tensor, **kwargs) -> Tensor:
def compute_metrics(self, x: Tensor, stage: str = "training") -> dict[str, Tensor]:
outputs = self(x, training=stage == "training")

metrics = {}
metrics = {"outputs": outputs}

if self.base_distribution is not None:
samples = self.base_distribution.sample((keras.ops.shape(x)[0],))
Expand All @@ -40,6 +40,4 @@ def compute_metrics(self, x: Tensor, stage: str = "training") -> dict[str, Tenso
for metric in self.metrics:
metrics[metric.name] = metric(outputs, samples)

metrics["outputs"] = outputs

return metrics
2 changes: 0 additions & 2 deletions bayesflow/simulators/hierarchical_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

from .simulator import Simulator

ShapeLike = Sequence[int | Sequence[int], ...]


class HierarchicalSimulator(Simulator):
def __init__(self, hierarchy: Sequence[Simulator]):
Expand Down

0 comments on commit 230d094

Please sign in to comment.