Spline#
- class Spline(order=4, knots=None, control_points=None)[source]#
Bases:
Module
Spline model.
- Parameters:
order (int) – the order of the spline.
knots (torch.Tensor) – the knot vector.
control_points (torch.Tensor) – the control points.
- basis(x, k, i, t)[source]#
Recursive function to compute the basis functions of the spline.
- Parameters:
x (torch.Tensor) – points to be evaluated.
k (int) – spline degree
i (int) – the index of the interval
t (torch.Tensor) – vector of knots
- Returns:
the basis functions evaluated at x
- Return type:
- forward(x)[source]#
Forward pass of the spline model.
- Parameters:
x (torch.Tensor) – points to be evaluated.
- Returns:
the spline evaluated at x
- Return type: