piglot.utils.reductions.SimpleReduction
- class SimpleReduction(reduction: Callable[[Tensor, Tensor], Tensor])[source]
Bases:
ReductionReduction function defined from a lambda function (without using the parameters).
Methods
Reduce the input data to a single value.
Reduce the input data to a single value.
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.