function_wrapper module¶
Function wrappers to provide API-compatible functions
- wrap_compact_arguments_function(f, dimensions)[source]¶
Take a function that evaluates on a sequence of arguments with values in compact intervals provided as a list of shape (d,2) where each element is the pair (lower,upper) of interval boundaries and return a function that evaluates on pytorch batches in the unit hypercube, weighted by the proper Jacobian factor to preserve integrals.
Explicitly: f(x_1,x_2,…,x_N) where x_i are numbers in [dimensions[i][0], dimensions[i][1]] returns a single float.
- wrap_hypercube_arguments_function(f)[source]¶
Take a function that evaluates on a sequence of arguments with values in the unit hypercube and return a function that evaluates on pytorch batches in the unit hypercube, weighted by the proper Jacobian factor to preserve integrals.
Explicitly: f(x_1,x_2,…,x_N) where x_i are numbers in [0, 1] returns a single float.
- wrap_numpy_compact_batch_function(f, dimensions)[source]¶
Take a function that evaluates on numpy batches with values in compact intervals provided as a list of shape (d,2) where each element is the pair (lower,upper) of interval boundaries. and return a function that evaluates on pytorch batches in the unit hypercube, weighted by the proper Jacobian factor to preserve integrals.