lucid  0.0.1
Lifting-based Uncertain Control Invariant Dynamics
Loading...
Searching...
No Matches
lucid::ConstantTruncatedFourierFeatureMap Class Referencefinal

Truncated Fourier feature map using fixed intervals between each interval of the normal distribution. More...

#include <ConstantTruncatedFourierFeatureMap.h>

Inheritance diagram for lucid::ConstantTruncatedFourierFeatureMap:
lucid::TruncatedFourierFeatureMap lucid::FeatureMap

Public Member Functions

RectSet get_periodic_set () const override
 Return the periodic input domain for this linear truncated Fourier map.
 
std::unique_ptr< FeatureMapclone () const override
 Clone the feature map.
 
std::string to_string () const override
 Obtain the string representation of this object.
 
- Public Member Functions inherited from lucid::TruncatedFourierFeatureMap
 TruncatedFourierFeatureMap (int num_frequencies, const Matrix &prob_per_dim, const Matrix &omega_per_dim, ConstVectorRef sigma_l, Scalar sigma_f, const RectSet &X_bounds)
 Construct a truncated Fourier feature map.
 
 TruncatedFourierFeatureMap (int num_frequencies, const Matrix &prob_per_dim, const Matrix &omega_per_dim, double sigma_l, Scalar sigma_f, const RectSet &X_bounds)
 Construct a truncated Fourier feature map.
 
Vector map_vector (ConstVectorRef x) const
 Given a \( \texttip{d}{Dimension of the vector space} \) dimensional vector \( \texttip{x}{Element of the vector space} \), project it to the unit hypercube \( [0, 1]^d \), then compute the feature map.
 
Vector invert_vector (ConstVectorRef y) const
 Given a @2M+1 dimensional vector \( \texttip{y}{Element of the vector space} \), invert the feature map to obtain the original input vector.
 
Matrix map_matrix (ConstMatrixRef x) const
 Given an \( \texttip{n}{Number of samples} \times \texttip{d}{Dimension of the vector space} \) dimensional matrix \( \texttip{x}{Element of the vector space} \), project each row vector to the unit hypercube \( [0, 1]^d \), then compute the feature map.
 
Dimension dimension () const
 Get read-only access to the dimension of the the feature map space.
 
const Matrix & omega () const
 Get read-only access to the frequency matrix of the truncated Fourier feature map.
 
const Vector & weights () const
 Get read-only access to the weights matrix of the truncated Fourier feature map.
 
int num_frequencies () const
 Get read-only access to the number of frequencies per dimension of the truncated Fourier feature map.
 
Scalar captured_probability () const
 Get read-only access to the probability captured by the Fourier expansion of the truncated Fourier feature map.
 
const RectSetX_bounds () const
 Get read-only access to the limits of the original input space.
 
double sigma_f () const
 Get read-only access to the sigma_f value of the truncated Fourier feature map.
 
const Vector & sigma_l () const
 Get read-only access to the sigma_l value of the truncated Fourier feature map.
 
std::unique_ptr< FeatureMapclone () const override
 Clone the feature map.
 
- Public Member Functions inherited from lucid::FeatureMap
Matrix operator() (ConstMatrixRef x) const
 Apply the feature map to a vector.
 
Matrix invert (ConstMatrixRef y) const
 Apply the inverse feature map to a vector.
 

Additional Inherited Members

- Protected Member Functions inherited from lucid::TruncatedFourierFeatureMap
Matrix apply_impl (ConstMatrixRef x) const override
 Given an \( \texttip{n}{Number of samples} \times \texttip{d}{Dimension of the vector space} \) dimensional matrix \( \texttip{x}{Element of the vector space} \), project each row vector to the unit hypercube \( [0, 1]^d \), then compute the feature map.
 
Matrix invert_impl (ConstMatrixRef y) const override
 Concrete implementation of invert().
 
- Protected Attributes inherited from lucid::TruncatedFourierFeatureMap
int num_frequencies_
 Number of frequencies per dimension.
 
Matrix omega_
 Frequencies matrix.
 
Vector weights_
 Weights matrix.
 
Scalar sigma_f_
 \( \sigma_f \) value
 
Vector sigma_l_
 \( \sigma_l \) vector
 
RectSet X_bounds_
 Limits of the input space expressed as a matrix. The set is a rectangle.
 
Scalar captured_probability_
 Probability captured by the Fourier expansion. NaN if not computed.
 

Detailed Description

Truncated Fourier feature map using fixed intervals between each interval of the normal distribution.

The weights are computed from the n-dimensional cumulative distribution function of the normal distribution with standard deviation \( \sigma_l \), i.e.

\[ w_j^2 := \int_{(2\zeta_j-1)\pi}^{(2\zeta_j+1)\pi}\mathcal{N}(d\xi|0,\Sigma), 1 \le j \le M . \]

Important
LogTruncatedFourierFeatureMap is deprecated. Use the LinearTruncatedFourierFeatureMap instead.
See also
TruncatedFourierFeatureMap

Member Function Documentation

◆ clone()

std::unique_ptr< FeatureMap > lucid::ConstantTruncatedFourierFeatureMap::clone ( ) const
nodiscardoverridevirtual

Clone the feature map.

Create a new instance of the feature map with the same parameters.

Returns
new instance of the feature map

Implements lucid::FeatureMap.

◆ get_periodic_set()

RectSet lucid::ConstantTruncatedFourierFeatureMap::get_periodic_set ( ) const
nodiscardoverridevirtual

Return the periodic input domain for this linear truncated Fourier map.

We want to find a space such that the smallest frequency is able to complete a full period. Given that frequencies are defined as \( \omega P(x) \), where \( P(x) \) is the projection to the unit hypercube of the original domain, we want to find the upper bound of the periodic domain \( \bar{x} \) such that

\[\omega P(\bar{x}) = 2\pi \]

for the smallest \( \omega \). Graphically,

New max (x̄)
┌───────────────────────────────●
│ │
│ │
│ Old max │
├───────────────────────● │
│ │ │
│ │ │
│ │ │
│ │ │
│ Min │ │
●───────────────────────┴───────┘

Notice how the lower bound remains fixed, while the upper bound is shifted to create the periodic domain.

Note
The periodic domain could be smaller than the original domain, depending on the values of \( \sigma_l \).
Precondition
\( \sigma_l \) must have the same dimension as the input space.
All values in \( \sigma_l \) must be greater than 0.
Returns
new RectSet representing the periodic input domain

Reimplemented from lucid::TruncatedFourierFeatureMap.

◆ to_string()

std::string lucid::ConstantTruncatedFourierFeatureMap::to_string ( ) const
nodiscardoverridevirtual

Obtain the string representation of this object.

Returns
string representation of this object

Reimplemented from lucid::FeatureMap.


The documentation for this class was generated from the following files: