piglot.utils.reductions.Reduction

class Reduction[source]

Bases: ABC

Abstract class for defining reduction functions.

Methods

reduce

Reduce the input data to a single value.

reduce_torch

Reduce the input data to a single value (with gradients).

test_reduction

Test the reduction function to check batch processing.

reduce(time: ndarray, data: ndarray, params: ndarray) ndarray[source]

Reduce the input data to a single value.

Parameters

timenp.ndarray

Time points of the response.

datanp.ndarray

Data points of the response.

paramsnp.ndarray

Parameters for the given responses.

Returns

np.ndarray

Reduced value of the data.

abstract reduce_torch(time: Tensor, data: Tensor, params: Tensor) Tensor[source]

Reduce the input data to a single value (with gradients).

Parameters

timetorch.Tensor

Time points of the response.

datatorch.Tensor

Data points of the response.

paramstorch.Tensor

Parameters for the given responses.

Returns

torch.Tensor

Reduced value of the data.

test_reduction() None[source]

Test the reduction function to check batch processing.