You will find below a visualization of basis functions defined by the function build_basis_function
which takes
nb_data
(number of timesteps) and nb_fct
(number of basis functions) as arguments and returns phi
the matrix of basis functions.
nb_fct
.param_lambda
.We can use basis functions to encode trajectories in a compact way. Such encoding aims at encoding the movement as a weighted superposition of simpler movements, whose compression aims at working in a subspace of reduced dimensionality, while denoising the signal and capturing the essential aspects of a movement. We first generate a noisy time trajectory using the function generate_data
.
noise_scale
.
We will use \bm{x} as our dataset vector.build_basis_function
, write a function that takes the basis function matrix \bm{\phi} and determines the Bézier curve
parameters \bm{w} that represents the data the best in least-square sense.In this exercise, we will implement a Newton's method with a line search. For Newton's method, you can refer to Section 3 of the RCFS documentation and for a backtracking line search algorithm, you can refer to Section 8.4 of the RCFS documentation. The goal is to solve an unconstrained optimization problem using Newton's method and see how line search can affect the convergence. You are given an objective function \bm{x}^2 + \bm{x}^3, its first derivative 2\bm{x} + 3\bm{x}^2 and its second derivative 2+6\bm{x}.