RoughPy reference

class roughpy.BrownianStream

A Brownian motion stream.

static with_generator()
class roughpy.ChannelType

Members:

IncrementChannel

ValueChannel

CategoricalChannel

LieChannel

CategoricalChannel = <ChannelType.CategoricalChannel: 2>
IncrementChannel = <ChannelType.IncrementChannel: 0>
LieChannel = <ChannelType.LieChannel: 3>
ValueChannel = <ChannelType.ValueChannel: 1>
property name
property value
class roughpy.Context

A Contexts allows us to provide a width, depth, and a coefficient field for a Tensor. They also provide access to the Baker-Campbell-Hausdorff formula. They are the environment in which calculations are done. They are used everywhere in RoughPy, for any Stream or algebraic object.

cbh()

Computes the Campbell-Baker-Haussdorff product of a number of Lie elements within that Context, using the truncation levels. Lie objects need to have the same width, but truncation level might differ.

compute_signature()

Computes the signature of a Stream.

ctype

Coefficient type. One of SPReal, DPReal, Rational, PolyRational.

depth

Maximum degree for Lie objects, FreeTensor objects, etc. (deprecated, use ctx instead).

lie_basis

An instance of LieBasis with the Context ‘s width and depth.

lie_size()

A shortcut for lie_basis.size().

lie_to_tensor()

Linear embedding of the Lie algebra into the FreeTensor algebra.

tensor_basis

An instance of TensorBasis with the Context ‘s width and depth.

tensor_size()

A shortcut for tensor_basis.size().

tensor_to_lie()

Linear embedding of the FreeTensor algebra into the Lie algebra.

to_logsignature()

Takes some argument (signature), equivalent to tensor_to_lie(signature.log()).

width

Alphabet size, dimension of the underlying space (deprecated, use ctx instead).

zero_lie()

Get a new Lie with value zero.

class roughpy.DPReal
class roughpy.DateTimeInterval

An Interval which describes a region of time.

dt_inf(self: roughpy._roughpy.DateTimeInterval) object
dt_sup(self: roughpy._roughpy.DateTimeInterval) object
class roughpy.Dyadic

A dyadic rational number.

static dyadic_equals(lhs: roughpy._roughpy.Dyadic, rhs: roughpy._roughpy.Dyadic) bool

Check if two dyadic rationals are equivalent, \(k_1=k_2\), \(n_1=n_2\).

property k
property n
static rational_equals(lhs: roughpy._roughpy.Dyadic, rhs: roughpy._roughpy.Dyadic) bool

Check if \(\frac{k_1}{2^{n_1}} = \frac{k_2}{2^{n_2}}\) as rational numbers, e.g. \(\frac{2}{2^1} = \frac{1}{2^0}\) as rationals, but not as dyadics, as neither \(k_1=k_2\) nor \(n_1=n_2\).

rebase(self: roughpy._roughpy.Dyadic, resolution: int) bool
class roughpy.DyadicInterval

A dyadic interval.

dyadic_excluded_end()

If the Interval type is clopen, returns the supremum. If the Interval is opencl, returns the infimum.

dyadic_included_end()

If the Interval type is clopen, returns the infimum. If the Interval is opencl, returns the supremum.

dyadic_inf()

Returns the infimum of a DyadicInterval.

dyadic_sup()

Returns the supremum of a DyadicInterval.

shrink_left()

Split the Interval in half, take the left.

shrink_right()

Split the Interval in half, take the right.

shrink_to_contained_end()

Same as shrink_interval() functions, but aware of the type (clopen, opencl).

shrink_to_omitted_end()

Same as shrink_interval() functions, but aware of the type (clopen, opencl).

static to_dyadic_intervals()

Dissect an Interval into a Partition of DyadicInterval objects.

class roughpy.ExternalDataStream

A Stream that acquires its data dynamically from an external source.

static from_uri()
class roughpy.FreeTensor

Element of the (truncated) tensor algebra.

A FreeTensor object supports arithmetic operators, providing both objects are compatible, along with comparison operators. The multiplication operator for this class is the free tensor multiplication (concatenation of tensor words). Moreover, FreeTensor objects are iterable, where the items are tuples of TensorKey and float corresponding to the non-zero elements of the FreeTensor.

The class also supports (implicit and explicit) conversion to a Numpy array type, so it can be used as an argument to any function that takes Numpy arrays. The array representation of a FreeTensor is one-dimensional. Alternatively, one can construct d-dimensional arrays containing the elements of degree d by using the degree_array() method.

There are methods for computing the tensor exponential, exp(), logarithm, log(), and the antipode, antipode(). See the documentation of these methods for more information.

A tensor can be created from an array-like object containing the coefficients of the keys, in their standard order. Since tensors must be created with both an alphabet size and depth, we need to provide at least the depth argument. However, it is recommended that you also provided the width argument, otherwise it is assumed that the tensor has degree 1 and the alphabet size will be determined from the length of the argument.

>>> ts1 = rp.FreeTensor([1.0, 2.0, 3.0], depth=2)
>>> print(ts1)
{ 1() 2(1) 3(2) }
>>> ts2 = rp.FreeTensor([1.0, 2.0, 3.0], width=2, depth=2)
>>> print(ts2)
{ 1() 2(1) 3(2) }

If the width argument is provided, this construction can be used to construct FreeTensor objects of any degree, up to the maximum. The Context class provides a method tensor_size() that can be used to get the dimension of the tensor up to a given degree.

add_mul()

Adds to the instance a product of algebra instances.

add_scal_div()

A version of \(+=\) fused with rational division.

add_scal_mul()

A version of \(+=\) fused with scalar multiplication.

antipode()

Compute the antipode of a FreeTensor instance

property context

Provide an algebra context in which to create the algebra.

degree()

Less than or equal to depth, not fixed, measure of what we have.

dimension()

The number of elements that are represented by the vector.

property dtype

Scalar type for the algebra (deprecated, use ctx instead). Can be a RoughPy data type (SPReal, DPReal, Rational, PolyRational), or a numpy dtype.

exp()

Computes the truncated exponential of a FreeTensor instance.

fmexp()

Fused multiply exponential operation for FreeTensor objects. Computes \(a exp(x)\).

is_zero()

Bool, checks if empty, i.e. all coefficients are zero.

log()

Computes the truncated log of the argument up to degree max_degree

property max_degree

Set out by the basis, i.e. depth.

mul_sdiv()

Multiply and scalar divide.

mul_smul()

Multiply and scalar multiply.

size()

Total number of non-zero elements represented by the vector, measure of sparsity.

property storage_type

sparse or dense

sub_mul()

Subtracts to the instance a product of algebra instances.

sub_scal_div()

A version of \(-=\) fused with rational division.

sub_scal_mul()

A version of \(-=\) fused with scalar multiplication.

property width

Alphabet size, dimension of the underlying space (deprecated, use ctx instead).

class roughpy.FreeTensorIteratorItem
key(self: roughpy._roughpy.FreeTensorIteratorItem) roughpy._roughpy.TensorKey
value(self: roughpy._roughpy.FreeTensorIteratorItem) roughpy._roughpy.Scalar
class roughpy.FunctionStream

A stream generated dynamically by calling a function.

static from_function()
class roughpy.HPReal
class roughpy.Interval

Interval objects are used to query a Stream to get a signature() or a log_signature(). They are a time-like axis which is closed on the left, open on the right, e.g. \([0,1)\).

RoughPy is very careful in how it works with intervals.

One design goal is that it should be able to handle jumps in the underlying signal that occur at particular times, including the beginning or end of the Interval, and still guarantee that if you combine the signature() over adjacent Interval, you always get the signature() over the entire Interval. This implies that there has to be a decision about whether data at the exact beginning or exact end of the Interval is included.

The convention in RoughPy are that we use clopen intervals, and that data at beginning of the Interval is seen, and data at the end of the Interval is seen in the next Interval. A second design goal is that the code should be efficient, and so the internal representation of a Stream involves caching the signature() over dyadic intervals of different resolutions. Recovering the signature() over any Interval using the cache has logarithmic complexity (using at most \(2n\) tensor multiplications, when \(n\) is the internal resolution of the Stream. Resolution refers to the length of the finest granularity at which we will store information about the underlying data.

Any event occurs within one of these finest granularity intervals, multiple events occur within the same Interval resolve to a more complex log_signature() which correctly reflects the time sequence of the events within this grain of time. However, no query of the Stream is allowed to see finer resolution than the internal resolution of the Stream, it is only allowed to access the information over Interval objects that are a union of these finest resolution granular intervals. For this reason, a query over any Interval is replaced by a query is replaced by a query over an Interval whose endpoints have been shifted to be consistent with the granular resolution, obtained by rounding these points to the contained end-point of the unique clopen granular Interval containing this point. In particular, if both the left-hand and right-hand ends of the Interval are contained in the clopen granular Interval, we round the Interval to the empty Interval. Specifying a resolution of \(32\) or \(64\) equates to using respective integer arithmetic.

We can create an Interval to query a Stream over, for example to compute a signature(), in the following way. The example below is the interval \([0,1)\), over the Reals.

interval = rp.RealInterval(0, 1)

Note

Clopen is currently the only supported interval type.

contains()

Takes either a number, tells you if it’s there or not, OR takes an Interval, tells you if that Interval is fully contained in the other Interval.

excluded_end()

If the Interval type is clopen, returns the supremum. If the Interval is opencl, returns the infimum.

included_end()

If the Interval type is clopen, returns the infimum. If the Interval is opencl, returns the supremum.

inf()

Returns the infimum of an Interval.

intersects_with()

Checks whether two Interval objects overlap.

property interval_type
sup()

Returns the supremum of an Interval.

class roughpy.IntervalType

Either clopen or opencl, although only clopen supported currently.

Members:

Clopen

Clopen = <IntervalType.Clopen: 0>
property name
property value
class roughpy.Lie

Lie elements live in the free Lie Algebra. Group-like elements have a one-to-one correspondence with a Stream. That is, for every group-like element, there exists a Stream where the signature() of that Stream is the group-like element. For more information on Lie Algebras, see Reutenauer and Bourbaki.

You will most commonly encounter Lie objects when taking the log_signature() of a path. We can use the Dynkin map to transfer between Lie and signature objects.

To construct a Lie, you will need data. For example, we can construct a Lie using a list of polynomials.

>>> lie_data_x = [
    1 * roughpy.Monomial("x1"),  # channel (1)
    1 * roughpy.Monomial("x2"),  # channel (2)
    1 * roughpy.Monomial("x3"),  # channel (3)
    1 * roughpy.Monomial("x4"),  # channel ([1, 2])
    1 * roughpy.Monomial("x5"),  # channel ([1, 3])
    1 * roughpy.Monomial("x6"),  # channel ([2, 3])
    ]

>>> lie_x = rp.Lie(lie_data_x, width=3, depth=2, dtype=rp.RationalPoly)
>>> print(f"{lie_x=!s}")
    lie_x={ { 1(x1) }(1) { 1(x2) }(2) { 1(x3) }(3) { 1(x4) }([1,2]) { 1(x5) }([1,3]) { 1(x6) }([2,3]) }

You will also need to provide the following parameters:

ctx

Provide an algebra context in which to create the algebra, takes priority over the next 3.

Or

dtype

Scalar type for the algebra (deprecated, use ctx instead). Can be a RoughPy data type (rp.SPReal, rp.DPReal, rp.Rational, rp.PolyRational), or a Numpy dtype.

depth

Maximum degree for Lie and FreeTensor objects, etc. (deprecated, use ctx instead)

width

Alphabet size, dimension of the underlying space (deprecated, use ctx instead)

Optional parameters:

vector_type

dense or sparse

keys

List/array of keys to go along with scalars provided as an array argument.

add_mul()

Adds to the instance a product of algebra instances.

add_scal_div()

A version of \(+=\) fused with rational division.

add_scal_mul()

A version of \(+=\) fused with scalar multiplication.

property context

Provide an algebra context in which to create the algebra.

degree()

Less than or equal to depth, not fixed, measure of what we have.

dimension()

The number of elements that are represented by the vector.

property dtype

Scalar type for the algebra (deprecated, use ctx instead). Can be a RoughPy data type (SPReal, DPReal, Rational, PolyRational), or a numpy dtype.

is_zero()

Bool, checks if empty, i.e. all coefficients are zero.

property max_degree

Set out by the basis, i.e. depth.

mul_sdiv()

Multiply and scalar divide.

mul_smul()

Multiply and scalar multiply.

size()

Total number of non-zero elements represented by the vector, measure of sparsity.

property storage_type

sparse or dense

sub_mul()

Subtracts to the instance a product of algebra instances.

sub_scal_div()

A version of \(-=\) fused with rational division.

sub_scal_mul()

A version of \(-=\) fused with scalar multiplication.

property width

Alphabet size, dimension of the underlying space (deprecated, use ctx instead).

class roughpy.LieBasis
property depth

Truncation level

property dimension

The number of elements represented by the vector.

index_to_key(self: roughpy._roughpy.LieBasis, index: int) roughpy._roughpy.LieKey

Takes an integer and returns a key at that index.

key_to_index(self: roughpy._roughpy.LieBasis, key: roughpy._roughpy.LieKey) int

Takes a key and returns an integer corresponding to the index.

parents(self: roughpy._roughpy.LieBasis, key: roughpy._roughpy.LieKey) tuple[int | None, int | None]

Splits off the first letter and returns the letter and the remainder of the word.

size(self: roughpy._roughpy.LieBasis, arg0: int) int

How big the dimension will be at a particular degree.

property width

Alphabet size

class roughpy.LieIncrementStream

A basic Stream type defined by a sequence of increments of fixed size at specified time intervals.

static from_increments()
class roughpy.LieIteratorItem
key(self: roughpy._roughpy.LieIteratorItem) roughpy._roughpy.LieKey
value(self: roughpy._roughpy.LieIteratorItem) roughpy._roughpy.Scalar
class roughpy.LieKey

Same as a TensorKey, Hall word, element of the Hall basis for the free Lie algebra.

class roughpy.LieKeyIterator

Iterator over range of Hall set members.

class roughpy.Monomial

Polynomial scalar type

degree()
class roughpy.Partition

An Interval into which there are a number of intermediate points which represent the end points of sub intervals. Partition of an Interval in the real line.

insert_intermediate(self: roughpy._roughpy.Partition, arg0: float) None

Cuts one of the intermediate intervals in half.

intermediates(self: roughpy._roughpy.Partition) list[float]

List of intermediate end points.

merge(self: roughpy._roughpy.Partition, arg0: roughpy._roughpy.Partition) roughpy._roughpy.Partition

The union of the partitions.

mesh(self: roughpy._roughpy.Partition) float

Length of the largest sub interval.

refine_midpoints(self: roughpy._roughpy.Partition) roughpy._roughpy.Partition

Inserts the midpoint between all of the intermediates.

class roughpy.PiecewiseAbelianStream

A stream formed of a sequence of interval-Lie pairs.

static construct()
roughpy.PolynomialScalar

alias of Polynomial

class roughpy.Rational
class roughpy.RationalPoly
class roughpy.RealInterval

A half-open Interval in the real line.

class roughpy.SPReal
class roughpy.Scalar

A generic scalar value.

scalar_type()
to_float()
class roughpy.ScalarMeta

Scalar meta class

class roughpy.ScalarTypeBase

Base class for scalar type

class roughpy.ShuffleTensor

Element of the shuffle tensor algebra.

ShuffleTensor objects are one way of representing the linear functionals on FreeTensor objects. The shuffle product corresponds to point-wise multiplication of the continuous functions on paths via the signature correspondence. For more information on shuffle tensors, see Reutenauer, Free Lie Algebras.

Shuffle tensors are useful because they represent functions on paths via the signature().

You can construct ShuffleTensor objects in the following way, here we use polynomial coefficients:

>>> shuffle_tensor = ShuffleTensor([1 * Monomial(f"x{i}") for i in range(7)], width=2, depth=2, dtype=roughpy.RationalPoly)

Which would look like this:

{ { 1(x0) }() { 1(x1) }(1) { 1(x2) }(2) { 1(x3) }(1,1) { 1(x4) }(1,2) { 1(x5) }(2,1) { 1(x6) }(2,2) }

You construct with data, which for the example above was the following list:

[{ 1(x0) }, { 1(x1) }, { 1(x2) }, { 1(x3) }, { 1(x4) }, { 1(x5) }, { 1(x6) }]

As well as data, you will need to provide the following parameters:

ctx

Provide an algebra context in which to create the algebra, takes priority over the next 3.

Or

dtype

Scalar type for the algebra (deprecated, use ctx instead). Can be a RoughPy data type (rp.SPReal, rp.DPReal, rp.Rational, rp.PolyRational), or a Numpy dtype.

depth

Maximum degree for Lie objects, FreeTensor objects, etc. (deprecated, use ctx instead)

width

Alphabet size, dimension of the underlying space (deprecated, use ctx instead)

Optional parameters:

vector_type

dense or sparse

keys

List/array of keys to go along with scalars provided as an array argument.

You can shuffle two tensors together, using *. For example, using x and y for indeterminate names for shuffle_tensor1 and shuffle_tensor2, for the above tensor we could do:

>>> result = shuffle_tensor1*shuffle_tensor2

The result would look like this:

result={ { 1(x0 y0) }() { 1(x0 y1) 1(x1 y0) }(1) { 1(x0 y2) 1(x2 y0) }(2) { 1(x0 y3) 2(x1 y1) 1(x3 y0) }(1,1) { 1(x0 y4) 1(x1 y2) 1(x2 y1) 1(x4 y0) }(1,2) { 1(x0 y5) 1(x1 y2) 1(x2 y1) 1(x5 y0) }(2,1) { 1(x0 y6) 2(x2 y2) 1(x6 y0) }(2,2) }
add_mul()

Adds to the instance a product of algebra instances.

add_scal_div()

A version of \(+=\) fused with rational division.

add_scal_mul()

A version of \(+=\) fused with scalar multiplication.

property context

Provide an algebra context in which to create the algebra.

degree()

Less than or equal to depth, not fixed, measure of what we have.

dimension()

The number of elements that are represented by the vector.

property dtype

Scalar type for the algebra (deprecated, use ctx instead). Can be a RoughPy data type (SPReal, DPReal, Rational, PolyRational), or a numpy dtype.

is_zero()

Bool, checks if empty, i.e. all coefficients are zero.

property max_degree

Set out by the basis, i.e. depth.

mul_sdiv()

Multiply and scalar divide.

mul_smul()

Multiply and scalar multiply.

size()

Total number of non-zero elements represented by the vector, measure of sparsity.

property storage_type

sparse or dense

sub_mul()

Subtracts to the instance a product of algebra instances.

sub_scal_div()

A version of \(-=\) fused with rational division.

sub_scal_mul()

A version of \(-=\) fused with scalar multiplication.

property width

Alphabet size, dimension of the underlying space (deprecated, use ctx instead).

class roughpy.ShuffleTensorIteratorItem
key(self: roughpy._roughpy.ShuffleTensorIteratorItem) roughpy._roughpy.TensorKey
value(self: roughpy._roughpy.ShuffleTensorIteratorItem) roughpy._roughpy.Scalar
class roughpy.Stream

A Stream means an object that provides the signature() or log_signature() over any Interval. For more information on Stream objects, see Lyons and McLeod and Lyons et al..

Stream objects are parametrised sequential data viewed via Rough Path theory as a rough path.

You can construct a Stream in many ways. You can use Lie increments:

>>> roughpy.LieIncrementStream.from_increments(data, indices=times, ctx=context)

Tick streams:

# create tick stream data
>>> data = { 1.0: [("first", "increment", 1.0),("second", "increment", 2.0)],
 2.0: [("first", "increment", 1.0)]
 }

# construct stream
>>> tick_stream = TickStream.from_data(data, width=2, depth=2, dtype=DPReal)

Brownian streams:

# Generating on demand from a source of randomness with normal increments that approximate Brownian motion
>>> brownian_stream = BrownianStream.with_generator(width=2, depth=2, dtype=DPReal)

Piecewise abelian streams:

# create piecewise lie data
>>> piecewise_intervals = [RealInterval(float(i), float(i + 1)) for i in range(5)]

>>> piecewise_lie_data = [
(interval,
brownian_stream.log_signature(interval))
for interval in piecewise_intervals
]

# construct stream
>>> piecewise_abelian_stream = PiecewiseAbelianStream.construct(piecewise_lie_data, width=2, depth=2, dtype=DPReal)

Function streams:

# create a function to generate a stream from
>>> def func(t, ctx):
...     return Lie(np.array([t, 2*t]), ctx=ctx)

#construct stream
>>> function_stream = rp.FunctionStream.from_function(func, width=2, depth=2, dtype=rp.DPReal)

External source data:

# create a stream from an external source
# here we use a sound file, but other formats are supported
>>> roughpy.ExternalDataStream.from_uri("/path/to/sound_file.mp3", depth=2)

All of these Stream objects are constructed with different data types.

As well as data, you will need to provide the following parameters:

ctx

Provide an algebra context in which to create the algebra, takes priority over the next 3.

Or

dtype

Scalar type for the algebra (deprecated, use ctx instead). Can be a RoughPy data type (rp.SPReal, rp.DPReal, rp.Rational, rp.PolyRational), or a Numpy dtype.

depth

Maximum degree for Lie objects, FreeTensor objects, etc. (deprecated, use ctx instead)

width

Alphabet size, dimension of the underlying space (deprecated, use ctx instead)

Stream objects also have the following optional parameters:

schema

An abstract description of what the comprises the channels of the underlying space in schema form. Can be deduced from data/constructor. If provided must be “correct” (i.e. width must be correct).

channel_types

Sequence of channel types, str name of channel type (e.g. increment), or dict of name: type pairs. Used to construct a schema if you don’t have one of those already.

include_time

Bool, indicates whether the parameter value should be included as a stream channel.

vtype

Default vector type for algebras return from Stream methods. (dense or sparse). Default is currently dense, although this will change to be determined by the form of the underlying Stream.

resolution

Resolution for the dyadic dissection of the domain, and the default resolution used in signature() / log_signature() calculations.

support

Interval of parameter values on which the Stream has meaning.

indices

For LieIncrementStreams, optionally provide a list/array of parameter values at which each row of the input data occurs. (default, row “i” occurs at parameter value “i”), or integer indicating the “column” of data that corresponds to the parameter. (Must be present in all rows)

ctx

Provide an algebra context in which to create the algebra.

dtype

Scalar type for the algebra (deprecated, use ctx instead). Can be a RoughPy data type (rp.SPReal, rp.DPReal, rp.Rational, rp.PolyRational), or a numpy dtype.

log_signature()

Compute the log signature of the Stream over an Interval.

resolution

resolution for the dyadic dissection of the domain, and the default resolution used in signature/log_signature calculations.

restrict()

Create a new Stream with the same data but restricted to a given Interval.

signature()

Compute the signature() of the Stream over an Interval.

signature_derivative()

Compute the derivative of a signature calculation with respect to a perturbation of the underlying path.

simplify()

Produce a piecewise abelian path subordinate to the given Partition.

support

Interval of parameter values on which the Stream has meaning.

width

Alphabet size, dimension of the underlying space (deprecated, use ctx instead).

class roughpy.StreamInterface

The stream interface is the means by which one converts an example of streaming data into a rough path.

class roughpy.StreamSchema
static from_data()
get_labels()
insert_categorical()
insert_increment()
insert_value()
static parse()
width()
class roughpy.TensorBasis
property depth

Truncation level

property dimension

The number of elements represented by the vector.

index_to_key(self: roughpy._roughpy.TensorBasis, index: int) roughpy._roughpy.TensorKey

Takes an integer and returns a key at that index.

key_to_index(self: roughpy._roughpy.TensorBasis, key: roughpy._roughpy.LieKey) int

Takes a key and returns an integer corresponding to the index.

parents(self: roughpy._roughpy.TensorBasis, key: roughpy._roughpy.TensorKey) tuple[int | None, int | None]

Splits off the first letter and returns the letter and the remainder of the word.

size(self: roughpy._roughpy.TensorBasis, arg0: int) int

How big the dimension will be at a particular degree.

property width

Alphabet size

class roughpy.TensorKey
basis(self: roughpy._roughpy.TensorKey) rpy::algebra::Basis<rpy::algebra::TensorBasisInterface>
degree(self: roughpy._roughpy.TensorKey) int
property max_degree
reverse(self: roughpy._roughpy.TensorKey) roughpy._roughpy.TensorKey
split_n(self: roughpy._roughpy.TensorKey, n: int) tuple[roughpy._roughpy.TensorKey, roughpy._roughpy.TensorKey]
to_index(self: roughpy._roughpy.TensorKey) int
to_letters(self: roughpy._roughpy.TensorKey) list[int]
property width
class roughpy.TensorKeyIterator

Iterator over tensor words.

class roughpy.TickStream

Tick stream

static from_data()
class roughpy.TickStreamConstructionHelper

Helps the stream figure out what its schema should be. A means of constructing the schema for a stream.

add_categorical()
add_increment()
add_time_channel()
add_value()
class roughpy.VectorType

Members:

DenseVector

SparseVector

DenseVector = <VectorType.DenseVector: 0>
SparseVector = <VectorType.SparseVector: 1>
property name
property value
roughpy.adjoint_to_free_multiply(multiplier: object, arg: object) object

Performs the adjoint of the free multiplication, \(A > A\).

class roughpy.bfloat16
roughpy.free_multiply(left: object, right: object) object
roughpy.get_context(width: int, depth: int, coeffs: object = None, **kwargs) object

Takes width, depth, and coeff as minimum, returns a Context with that configuration, has other keywords that aren’t fully realised yet.

roughpy.half_shuffle_multiply(left: object, right: object) object

Use a multiplication that isn’t the native one. For example, half shuffle two ShuffleTensor objects. Do what’s not allowed by type using * (ish).

roughpy.segment(interval: roughpy._roughpy.Interval, predicate: Callable[[roughpy._roughpy.Interval], bool], max_depth: int) list[roughpy._roughpy.RealInterval]

Perform dyadic segmentation on an Interval.

roughpy.shuffle_multiply(left: object, right: object) object

Shuffle two FreeTensor objects. Use a multiplication that isn’t the native one.