Open eerolinna opened 5 years ago
Hmm. I do not remember right now. But if I remember correctly it should work if we points to the R file or read it in in the global environment. Need to check though.
The python version of bayesbench currently has
- inference_engine: mymethod.my_inference_method
posterior_name: "8_schools|noncentered"
...
This tells bayesbench where to find the custom inference method. The dot notation is python specific though, so we could have something like
- inference_engine_module: mymethod
inference_engine: my_inference_method
posterior_name: "8_schools|noncentered"
...
Here inference_engine_module
can be anything that python can find, so a local file or a package installed from the package manager. If import mymethod
works in python code then bayesbench will find it no matter where it is. I guess library(mymethod)
would be the equivalent R code
We could also have inference_engine_file
instead of inference_engine_module
where the value would be the full path to the file. This works well for local files but not so well for installed packages.
Do you think something like this would be good for the R version too?
Any comments?
Also to expand a bit, lets say someone has written R package bayesbench_vi_methods
that includes a new VI method called very_nice_vi
. I want to use it with bayesbench, I guess the config would need to be something like
- inference_engine_module: bayesbench_vi_methods
inference_engine: very_nice_vi
posterior_name: eight_schools_noncentered
Lets say I have a new inference method implemented in the file
mymethod.R
and I want to run it on 8 schools.
If I use
stan_vb
I can have a config file like this, right?Then with
my_inference_method
can I just have a config file like this?How does bayesbench know where to find the R file
mymethod.R
?