11# This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
22# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
33
4+ import warnings
45from abc import ABC
56from copy import deepcopy
67from typing import Any , Callable , Dict , Optional , Union
@@ -94,11 +95,11 @@ def append_simulations(
9495 theta: Parameter sets.
9596 x: Simulation outputs.
9697 exclude_invalid_x: Whether invalid simulations are discarded during
97- training. If `False`, SNLE raises an error when invalid simulations are
98+ training. If `False`, NLE raises an error when invalid simulations are
9899 found. If `True`, invalid simulations are discarded and training
99100 can proceed, but this gives systematically wrong results.
100101 from_round: Which round the data stemmed from. Round 0 means from the prior.
101- With default settings, this is not used at all for `SNLE `. Only when
102+ With default settings, this is not used at all for `NLE `. Only when
102103 the user later on requests `.train(discard_prior_samples=True)`, we
103104 use these indices to find which training data stemmed from the prior.
104105 data_device: Where to store the data, default is on the same device where
@@ -108,6 +109,11 @@ def append_simulations(
108109 NeuralInference object (returned so that this function is chainable).
109110 """
110111
112+ if exclude_invalid_x :
113+ warnings .warn (
114+ "NLE gives systematically wrong results when exclude_invalid_x=True." ,
115+ stacklevel = 2 ,
116+ )
111117 # pyright false positive, will be fixed with pyright 1.1.310
112118 return super ().append_simulations ( # type: ignore
113119 theta = theta ,
0 commit comments