I noticed that after switching from generating bf.datasets on-the-fly to loading pre-simulated data, ContinuousApproximator.sample() fails since the adapter is not called before sampling anymore. Concretely, in line 141 of continuous_approximator.py, the adapter is called with strict=False to process the observed data (and not require parameter keys while doing so):
conditions = self.adapter(conditions, strict=False, stage="inference", **kwargs)
This raises the following error in the adapters forward() method when working with loaded data:
"ValueError: Cannot call `forward` with `strict=False` before calling `forward` with `strict=True`.".
The error is easily fixed by manually calling the adapter on the data before sampling, but of course unexpected for the user and should therefore be handled internally.
@LarsKue @stefanradev93: what do you think would be a principled handling of this behavior?