piglot.utils.reductions.SimpleReduction

class SimpleReduction(reduction: Callable[[Tensor, Tensor], Tensor])[source]

Bases: Reduction

Reduction function defined from a lambda function (without using the parameters).

Methods

reduce

Reduce the input data to a single value.

reduce_torch

Reduce the input data to a single value.

test_reduction

Test the reduction function to check batch processing.

reduce(time: ndarray, data: ndarray, params: ndarray) ndarray

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.

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

Reduce the input data to a single value.

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

Test the reduction function to check batch processing.