TransportMaps.Maps.Functionals.PointwiseMonotoneLinearSpanTensorizedParametricFunctionalBase
¶
Module Contents¶
Classes¶
Approximation of the type \(f \approx f_{\bf a} = \sum_{{\bf i} \in \mathcal{I}} {\bf a}_{\bf i} \Phi_{\bf i}\), monotonic in \(x_d\) |
|
Approximation of the type \(f \approx f_{\bf a} = \sum_{{\bf i} \in \mathcal{I}} {\bf a}_{\bf i} \Phi_{\bf i}\), monotonic in \(x_d\) |
- class TransportMaps.Maps.Functionals.PointwiseMonotoneLinearSpanTensorizedParametricFunctionalBase.PointwiseMonotoneLinearSpanTensorizedParametricFunctional(basis_list, q=None, p=1.0, w=None, SemilatticeConstructor=LinearSpanSemilattice, semilattice=None, spantype=None, order_list=None, multi_idxs=None, full_basis_list=None)[source]¶
Bases:
TransportMaps.Maps.Functionals.LinearSpanTensorizedParametricFunctionalBase.LinearSpanTensorizedParametricFunctional
,TransportMaps.Maps.Functionals.ParametricMonotoneFunctionalBase.ParametricMonotoneFunctional
Approximation of the type \(f \approx f_{\bf a} = \sum_{{\bf i} \in \mathcal{I}} {\bf a}_{\bf i} \Phi_{\bf i}\), monotonic in \(x_d\)
- Parameters:
- precomp_regression(x, precomp=None, *args, **kwargs)[source]¶
Precompute necessary structures for the speed up of
regression()
- regression(f, fparams=None, d=None, qtype=None, qparams=None, x=None, w=None, x0=None, regularization=None, tol=0.0001, maxit=100, batch_size=(None, None), mpi_pool=None, import_set=set())[source]¶
Compute \({\bf a}^* = \arg\min_{\bf a} \Vert f - f_{\bf a} \Vert_{\pi}\).
- Parameters:
f (
Function
orndarray
[\(m\)]) – function \(f\) or its functions valuesd (Distribution) – distribution \(\pi\)
fparams (dict) – parameters for function \(f\)
qtype (int) – quadrature type to be used for the approximation of \(\mathbb{E}_{\pi}\)
qparams (object) – parameters necessary for the construction of the quadrature
x (
ndarray
[\(m,d\)]) – quadrature points used for the approximation of \(\mathbb{E}_{\pi}\)w (
ndarray
[\(m\)]) – quadrature weights used for the approximation of \(\mathbb{E}_{\pi}\)x0 (
ndarray
[\(N\)]) – coefficients to be used as initial values for the optimizationregularization (dict) – defines the regularization to be used. If
None
, no regularization is applied. If keytype=='L2'
then applies Tikonhov regularization with coefficient in keyalpha
.tol (float) – tolerance to be used to solve the regression problem.
maxit (int) – maximum number of iterations
batch_size (
list
[2] ofint
) – the list contains the size of the batch to be used for each iteration. A size1
correspond to a completely non-vectorized evaluation. A sizeNone
correspond to a completely vectorized one.mpi_pool (
mpi_map.MPI_Pool
) – pool of processes to be usedimport_set (set) – list of couples
(module_name,as_field)
to be imported asimport module_name as as_field
(for MPI purposes)
- Returns:
(
tuple
[\(N\)],list
)) – containing the \(N\) coefficients and log information from the optimizer.
See also
TransportMaps.TriangularTransportMap.regression()
Note
the resulting coefficients \({\bf a}\) are automatically set at the end of the optimization. Use
coeffs()
in order to retrieve them.Note
The parameters
(qtype,qparams)
and(x,w)
are mutually exclusive, but one pair of them is necessary.
- class TransportMaps.Maps.Functionals.PointwiseMonotoneLinearSpanTensorizedParametricFunctionalBase.MonotonicLinearSpanApproximation(*args, **kwargs)[source]¶
Bases:
PointwiseMonotoneLinearSpanTensorizedParametricFunctional
Approximation of the type \(f \approx f_{\bf a} = \sum_{{\bf i} \in \mathcal{I}} {\bf a}_{\bf i} \Phi_{\bf i}\), monotonic in \(x_d\)