You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a proposal for a path based interface to esig to be the primary interface for computing signatures and log signatures. This will provide a Path class, which is initialised with some collection of data that constitutes either the increments or the values of a (rough) path. The path class will be responsible for selecting the correct underlying type of the path, and link functions to compute the signature, log signature, and various other metrics associated with the path.
Path class
The first iteration of the path class will provide functions to compute the signature and log signature to a specific depth. This class will be implemented at the Python level, and be a simple interface to various C++ level Path types that will not be available to the user. The minimal template for this class is as follows.
classPath:
""" Interface class for various computations involving rough paths. """def__init__(self, data, type=None):
# Create a new instance, either deriving the underlying type# from the data, or using the type argumentdefsignature(self, depth: int=2, lower: Optional[int] =None,
upper: Optional[int] =None) ->Signature:
""" Compute the signature of the path up to the given depth (default = 2). Optionally restrict the range over which the signature is computed. """deflog_signature(self, depth: int=2, lower: Optional[int] =None,
upper: Optional[int] =None) ->LogSignature:
""" Compute the log signature of the path up to the given depth (default = 2). Optionally restrict the range over which the log signature is computed. """
The Signature and LogSignature classes indicated above are thin wrappers around the libalgebra free_tensor and lie types, respectively, that allows direct inspection and computation with these underlying objects.
This Path class should also have methods to inspect the width, data, and underlying path type (as an Enum value or similar).
Path backends
The backend paths are C++ layer classes that actually implement the various types of rough path. For instance, the basic path type is a LieIncrementPath, which simply has a list of Lie increments stored in an array. This is the type of path assumed by the tosig interface as it stands.
Other types of path that could be implemented include generated paths (where there is a definite function that defines the increment over a given width), value paths, and time indexed paths.
Old tosig interface
The tosig module currently provides a very simple interface broadly based around two functions stream2sig and stream2logsig. For the sake of backwards compatibility, the way these functions work should not change externally.
However, we can adjust the function here actually make use of the C++ paths interface to dramatically simplify the background code.
The text was updated successfully, but these errors were encountered:
This is a proposal for a path based interface to esig to be the primary interface for computing signatures and log signatures. This will provide a
Path
class, which is initialised with some collection of data that constitutes either the increments or the values of a (rough) path. The path class will be responsible for selecting the correct underlying type of the path, and link functions to compute the signature, log signature, and various other metrics associated with the path.Path class
The first iteration of the path class will provide functions to compute the signature and log signature to a specific depth. This class will be implemented at the Python level, and be a simple interface to various C++ level Path types that will not be available to the user. The minimal template for this class is as follows.
The
Signature
andLogSignature
classes indicated above are thin wrappers around the libalgebrafree_tensor
andlie
types, respectively, that allows direct inspection and computation with these underlying objects.This
Path
class should also have methods to inspect the width, data, and underlying path type (as an Enum value or similar).Path backends
The backend paths are C++ layer classes that actually implement the various types of rough path. For instance, the basic path type is a
LieIncrementPath
, which simply has a list of Lie increments stored in an array. This is the type of path assumed by thetosig
interface as it stands.Other types of path that could be implemented include generated paths (where there is a definite function that defines the increment over a given width), value paths, and time indexed paths.
Old tosig interface
The
tosig
module currently provides a very simple interface broadly based around two functionsstream2sig
andstream2logsig
. For the sake of backwards compatibility, the way these functions work should not change externally.However, we can adjust the function here actually make use of the C++ paths interface to dramatically simplify the background code.
The text was updated successfully, but these errors were encountered: