FTT

FTT(
    self,
    bases: ApproxBases,
    tt: TT | None = None,
    num_error_samples: int = 1000,
)

A functional tensor train, defined on \([-1, 1]^{d}\).

Parameters

bases : ApproxBases

A set of basis functions for each dimension of the FTT.

tt : TT | None = None

A tensor train object.

num_error_samples : int = 1000

The number of samples to use to estimate the \(L_{2}\) error of the FTT during its construction.

Methods

Name Description
approximate Constructs a FTT approximation to a target function.
eval Evaluates the FTT.

approximate

FTT.approximate(
    target_func: Callable[[Tensor], Tensor],
    reference: Reference | None = None,
)

Constructs a FTT approximation to a target function.

Parameters

target_func : Callable[[Tensor], Tensor]

The target function, \(f : [-1, 1]^{d} \rightarrow \mathbb{R}\).

reference : Reference | None = None

The reference measure. If provided, this will be used to generate the initial index sets for the underlying TT. Otherwise, these sets will be generated by sampling uniformly from the underlying tensor grid.

eval

FTT.eval(ls: Tensor, direction: Direction | None = None)

Evaluates the FTT.

Returns the functional tensor train approximation to the target function for either the first or last \(k\) variables, for a set of points mapped to the domain of the basis functions.

Parameters

ls : Tensor

An \(n \times d\) matrix containing a set of samples mapped to the domain of the FTT basis functions.

direction : Direction | None = None

The direction in which to iterate over the cores.

Returns

Gs_prod : Tensor

An \(n \times n_{k}\) matrix, where each row contains the product of the first or last (depending on direction) \(k\) tensor cores evaluated at the corresponding sample in ls.