Skip to content

Commit b30eff1

Browse files
committed
undo potential fix for iid sampling
1 parent 0cb4f17 commit b30eff1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sbi/samplers/score/score.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,9 @@ def initialize(self, num_samples: int) -> Tensor:
102102
init_shape = (
103103
num_samples,
104104
) + self.input_shape # just use num_samples, not num_batch
105-
# NOTE: for the IID setting we need to scale the noise with iid batch size
106-
eps = torch.randn(init_shape, device=self.device) / self.batch_shape.numel()
105+
# NOTE: for the IID setting we might need to scale the noise with iid batch
106+
# size, as in equation (7) in the paper.
107+
eps = torch.randn(init_shape, device=self.device)
107108
mean, std, eps = torch.broadcast_tensors(self.init_mean, self.init_std, eps)
108109
return mean + std * eps
109110

0 commit comments

Comments
 (0)