sbi icon indicating copy to clipboard operation
sbi copied to clipboard

Deprecate the simple interface.

Open michaeldeistler opened this issue 3 years ago • 1 comments

Currently, in our simple interface, we only allow very few kwargs. We could add two arguments init_kwargs and call_kwargs, which would both be dictionaries. Not sure if we want this (it's also covered in the flexible interface), but we should discuss.

This had been requested by Miles in #275

michaeldeistler avatar Jul 30 '20 11:07 michaeldeistler

More context:

The simple interface is here:

https://github.com/sbi-dev/sbi/blob/c3c2b6e142fb4c57d5599effc1f01f8222a37c57/sbi/inference/base.py#L35

i.e., it's a single function that takes simulator, prior, method and budget and runs SBI to return a posterior object. We created it to show how simple inference with sbi can be. However, it's also quite rigid, which is why one should work with the "flexible interface" our actual API instead.

We can make the simple interface more flexible by adding additional kwargs that are passed on to the inference methods.

I think it's nice to keep infer for illustration, but to remove it from all the tutorials. We can keep it in minimal.py and in getting_started but we should add the kwargs there as well and add a note that in practice, the flexible interface should be used really.

janfb avatar Feb 28 '24 15:02 janfb

I can look into this (but cannot assign myself yet)

Baschdl avatar Mar 18 '24 12:03 Baschdl

Apart from getting_started, it's also used in 01_gaussian_amortized.ipynb but I think that makes sense as only the next notebook introduces the flexible interface. ~~Just to double check, call_kwargs is intended for build_posterior and not train, right? (Resolved by Michael asking sth. similar in #1014)~~

Baschdl avatar Mar 18 '24 18:03 Baschdl