Multiply#
- class deeptrack.features.Multiply(value: float | Callable[[...], float] = 0, **kwargs: dict[str, Any])#
Bases:
ArithmeticOperationFeatureMultiply the input by a value.
This feature performs element-wise multiplication (*) of the input.
Parameters#
- value: PropertyLike[int or float], optional
The value to multiply the input. Defaults to 0.
- **kwargs: Any
Additional keyword arguments passed to the parent constructor.
Examples#
>>> import deeptrack as dt
Start by creating a pipeline using Multiply: >>> pipeline = dt.Value([1, 2, 3]) >> dt.Multiply(value=5) >>> pipeline.resolve() [5, 10, 15]
Alternatively, this pipeline can be created using: >>> pipeline = dt.Value([1, 2, 3]) * 5
Or: >>> pipeline = 5 * dt.Value([1, 2, 3])
Or, more explicitly: >>> input_value = dt.Value([1, 2, 3]) >>> mul_feature = dt.Multiply(value=5) >>> pipeline = mul_feature(input_value)