Skip to content

Commit 863412c

Browse files
fix doc for control coefficients
1 parent c76cf21 commit 863412c

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

pina/model/spline.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ class Spline(torch.nn.Module):
1818
1919
where:
2020
21-
- :math:`C_i \in \mathbb{R}` are the control points. These fixed points
22-
influence the shape of the curve but are not generally interpolated,
23-
except at the boundaries under certain knot multiplicities.
21+
- :math:`C \in \mathbb{R}^n` are the learnable control coefficients. Its
22+
entries :math:`C_i` influence the shape of the curve but are not generally
23+
interpolated, except under certain knot multiplicities.
2424
- :math:`B_{i,k}(x)` are the B-spline basis functions of order :math:`k`,
2525
i.e., piecewise polynomials of degree :math:`k-1` with support on the
2626
interval :math:`[x_i, x_{i+k}]`.
2727
- :math:`X = \{ x_1, x_2, \dots, x_m \}` is the non-decreasing knot vector.
2828
2929
If the first and last knots are repeated :math:`k` times, then the curve
30-
interpolates the first and last control points.
30+
interpolates the first and last control coefficients.
3131
3232
3333
.. note::

pina/model/spline_surface.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ class SplineSurface(torch.nn.Module):
1515
1616
.. math::
1717
18-
S(x, y) = \sum_{i,j=1}^{n_x, n_y} B_{i,k}(x) B_{j,s}(y) C_{i,j},
19-
\quad x \in [x_1, x_m], y \in [y_1, y_l]
18+
S(x, y) = \sum_{i=1}^{n_x} \sum_{j=1}^{n_y} B_{i,k}(x) B_{j,s}(y)
19+
C_{i,j}, \quad x \in [x_1, x_m], y \in [y_1, y_l]
2020
2121
where:
2222
23-
- :math:`C_{i,j} \in \mathbb{R}^2` are the control points. These fixed
24-
points influence the shape of the surface but are not generally
25-
interpolated, except at the boundaries under certain knot multiplicities.
23+
- :math:`C \in \mathbb{R}^{n_x \times n_y}` is the matrix of learnable
24+
control coefficients. Its entries :math:`C_{i,j}` influence the shape of
25+
the surface but are not generally interpolated, except under certain knot
26+
multiplicities.
2627
- :math:`B_{i,k}(x)` and :math:`B_{j,s}(y)` are the B-spline basis functions
2728
defined over two orthogonal directions, with orders :math:`k` and
2829
:math:`s`, respectively.
@@ -268,8 +269,8 @@ def control_points(self, control_points):
268269
# Check control points
269270
if control_points.shape != __valid_shape:
270271
raise ValueError(
271-
"control_points must be of the correct shape. ",
272-
f"Expected {__valid_shape}, got {control_points.shape}.",
272+
f"control_points must be of the correct shape. "
273+
f"Expected {__valid_shape}, got {control_points.shape}."
273274
)
274275

275276
# Register control points as a learnable parameter

0 commit comments

Comments
 (0)