Possible using
values:
With using="c.mafR"
four different MAFs are computed in every iteration:
the density of statistics given parameters (providing the likelihood), the joint density, the instrumental density of parameters, and the “instrumental posterior” density of parameters given the data.
With using="MAFmix"
, MAFs are computed only for the joint density and the instrumental density. The likelihood is deduced from them and a multivariate Gaussian mixture model is used to infer the “instrumental posterior” density.
using="mafR"
can be used to let Infusion select one of the above options. "MAFmix"
is currently called as it is faster, but this is liable to change in the future, so do not use this if you want a repeatable workflow.
Possible template
values for MAF.options
:
"PSM19"
defines a template list of control values recommended by Papamakarios et al. (2019, Section 5.1).
"zuko-like"
defines a template list of values inspired from the tutorials of the zuko Python package, with some extra twists. Concretely, their definition is
if (template == "zuko-like") {
optns <- list(design_hidden_layers = .design_hidden_layers_MGM_like,
MAF_patience = 30, MAF_auto_layers = 3L, Adam_learning_rate = 0.001)
}
else if (template == "PSM19") {
optns <- list(design_hidden_layers = .design_hidden_layers_PSM19,
MAF_patience = 20, MAF_auto_layers = 5L, Adam_learning_rate = 1e-04)
}
and any replacement value should match the types (function, numeric, integer...) of the shown values, and the formals of the internal functions, in order to avoid cryptic errors.
The internal .design_hidden_layers...
functions return a vector of numbers \(H_i\) of hidden values per layer \(i\) of the neural network. THevector has an attribute giving the resulting approximate number of parameters \(P\) of the deep-learning model according to Supplementary Table 1 of Papamakarios et al. 2017. \(H_i=\)50L
for "PSM19"
. For "zuko-like"
, a typically higher value will be used. It is defined as a power of two such that \(P\) is of the order of 8 to 16 times the default number of parameters of the multivariate gaussian mixture model that could be used instead of MAFs.
Other controls which can be modified through the ... are
* MAF_validasize
, a function which returns the size of the validation set,
whose default definition returns 5% of its input value nr
which is the number of samples in the reference table (consistently with Papamakarios et al., 2019);
* MAF_batchsize
, a function that returns the batch size for the Adam optimizer. Its default simply returns 100L
, but non-default functions can be defined, with at least the ... as formal arguments (more elaborate formals are possible but not part of the API).