artist.optim.regularizers

Classes

Regularizer

Initialize the base regularizer.

SmoothnessRegularizer

Initialize the regularizer.

IdealSurfaceRegularizer

Initialize the regularizer.

Module Contents

class artist.optim.regularizers.Regularizer(reduction_dimensions: tuple[int, Ellipsis])

Initialize the base regularizer.

Parameters

reduction_dimensionstuple[int, …]

The dimensions along which to reduce the regularization term.

reduction_dimensions
abstractmethod __call__(current_control_points: torch.Tensor, original_control_points: torch.Tensor, device: torch.device | None = None, **kwargs: Any) torch.Tensor

Compute the regularization.

Parameters

current_control_pointstorch.Tensor

The current control points. Shape is [number_of_heliostats, number_of_facets_per_surface, number_of_control_points_u_direction, number_of_control_points_v_direction, 3].

original_control_pointstorch.Tensor

The current control points. Shape is [number_of_heliostats, number_of_facets_per_surface, number_of_control_points_u_direction, number_of_control_points_v_direction, 3].

devicetorch.device | None

The device on which to perform computations or load tensors and models (default is None). If None, ARTIST will automatically select the most appropriate device (CUDA or CPU) based on availability and OS.

**kwargsAny

Keyword arguments.

Raises

NotImplementedError

This abstract method must be overridden.

class artist.optim.regularizers.SmoothnessRegularizer(reduction_dimensions: tuple[int, Ellipsis])

Bases: Regularizer

Initialize the regularizer.

Parameters

reduction_dimensionstuple[int, …]

Dimensions along which to reduce the loss.

__call__(current_control_points: torch.Tensor, original_control_points: torch.Tensor, device: torch.device | None = None, **kwargs: Any) torch.Tensor

Compute the Laplacian regularization loss.

The loss measures how much each control-point displacement differs from the average of its four immediate neighbors, thereby penalizing localized, non-smooth deformations.

Parameters

current_control_pointstorch.Tensor

The current control points. Shape is [number_of_heliostats, number_of_facets_per_surface, number_of_control_points_u_direction, number_of_control_points_v_direction, 3].

original_control_pointstorch.Tensor

The original control points. Shape is [number_of_heliostats, number_of_facets_per_surface, number_of_control_points_u_direction, number_of_control_points_v_direction, 3].

devicetorch.device | None

The device on which to perform computations or load tensors and models (default is None). If None, ARTIST will automatically select the most appropriate device (CUDA or CPU) based on availability and OS.

Returns

torch.Tensor

Laplacian regularization loss per surface.

class artist.optim.regularizers.IdealSurfaceRegularizer(reduction_dimensions: tuple[int, Ellipsis])

Bases: Regularizer

Initialize the regularizer.

Parameters

reduction_dimensionstuple[int, …]

Dimensions along which to reduce the loss.

__call__(current_control_points: torch.Tensor, original_control_points: torch.Tensor, device: torch.device | None = None, **kwargs: Any) torch.Tensor

Compute the L2 loss between current control points and original control points.

Parameters

current_control_pointstorch.Tensor

The current control points. Shape is [number_of_heliostats, number_of_facets_per_surface, number_of_control_points_u_direction, number_of_control_points_v_direction, 3].

original_control_pointstorch.Tensor

The current control points. Shape is [number_of_heliostats, number_of_facets_per_surface, number_of_control_points_u_direction, number_of_control_points_v_direction, 3].

devicetorch.device | None

The device on which to perform computations or load tensors and models (default is None). If None, ARTIST will automatically select the most appropriate device (CUDA or CPU) based on availability and OS.

Returns

torch.Tensor

L2 deviation loss per surface.