Skip to content

TorchParameterizedFunction

Matthias K. Hoffmann edited this page May 6, 2024 · 1 revision

TorchParameterizedFunction Class

The TorchParameterizedFunction class, derived from nn.Module and ABC, provides an abstract base for storing and managing parameterized functions. This class is primarily designed for use within the TorchMovingFrame system but is flexible enough to accommodate other models like polynomial representations.

Class Overview

Inheritance

The TorchParameterizedFunction class inherits from:

  • nn.Module: PyTorch's base class for all neural network modules, enabling parameter tracking, model saving/loading, and more.
  • ABC (Abstract Base Class): Used to define abstract methods that derived classes must implement, ensuring a consistent interface for functions.

Abstract Methods

get_u_fun(self, idx, s0, s1)

  • Description: This is an abstract method that must be implemented by subclasses. It is used to retrieve a parameterized function between two points, s0 and s1, based on the index idx. This function is vital for calculating specific curvature values necessary for the associated moving frame computations.

  • Arguments:

    • idx (int): The index specifying which function to retrieve.
    • s0 (float): The starting arc-length parameter.
    • s1 (float): The ending arc-length parameter.
  • Returns:

    • This method is expected to return a callable function that describes the between the two arc-length parameters s0 and s1.

Clone this wiki locally