Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torch-harmonics
Commits
c44d2d9e
Commit
c44d2d9e
authored
Jul 17, 2025
by
Andrea Paris
Committed by
Boris Bonev
Jul 21, 2025
Browse files
updated docstring
parent
43e3e720
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
18 deletions
+33
-18
torch_harmonics/convolution.py
torch_harmonics/convolution.py
+33
-18
No files found.
torch_harmonics/convolution.py
View file @
c44d2d9e
...
@@ -66,24 +66,39 @@ def _normalize_convolution_tensor_s2(
...
@@ -66,24 +66,39 @@ def _normalize_convolution_tensor_s2(
values based on the basis_norm_mode parameter. It can normalize individual basis
values based on the basis_norm_mode parameter. It can normalize individual basis
functions, compute mean normalization across all basis functions, or use support
functions, compute mean normalization across all basis functions, or use support
weights. The function also optionally merges quadrature weights into the tensor.
weights. The function also optionally merges quadrature weights into the tensor.
Args:
Parameters
psi_idx: Index tensor for the sparse convolution tensor.
-----------
psi_vals: Value tensor for the sparse convolution tensor.
psi_idx: torch.Tensor
in_shape: Tuple of (nlat_in, nlon_in) representing input grid dimensions.
Index tensor for the sparse convolution tensor.
out_shape: Tuple of (nlat_out, nlon_out) representing output grid dimensions.
psi_vals: torch.Tensor
kernel_size: Number of kernel basis functions.
Value tensor for the sparse convolution tensor.
quad_weights: Quadrature weights for numerical integration.
in_shape: Tuple[int]
transpose_normalization: If True, applies normalization in transpose direction.
Tuple of (nlat_in, nlon_in) representing input grid dimensions.
basis_norm_mode: Normalization mode, one of ["none", "individual", "mean", "support"].
out_shape: Tuple[int]
merge_quadrature: If True, multiplies values by quadrature weights.
Tuple of (nlat_out, nlon_out) representing output grid dimensions.
eps: Small epsilon value to prevent division by zero.
kernel_size: int
Number of kernel basis functions.
Returns:
quad_weights: torch.Tensor
torch.Tensor: Normalized convolution tensor values.
Quadrature weights for numerical integration.
transpose_normalization: bool
Raises:
If True, applies normalization in transpose direction.
ValueError: If basis_norm_mode is not one of the supported modes.
basis_norm_mode: str
Normalization mode, one of ["none", "individual", "mean", "support"].
merge_quadrature: bool
If True, multiplies values by quadrature weights.
eps: float
Small epsilon value to prevent division by zero.
Returns
-------
torch.Tensor
Normalized convolution tensor values.
Raises
------
ValueError
If basis_norm_mode is not one of the supported modes.
"""
"""
# exit here if no normalization is needed
# exit here if no normalization is needed
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment