Add#
- class deeptrack.features.Add(value: float | Callable[[...], float] = 0, **kwargs: dict[str, Any])#
Bases:
ArithmeticOperationFeatureAdd a value to the input.
This feature performs element-wise addition (+) to the input.
Parameters#
- value: PropertyLike[int or float], optional
The value to add to the input. Defaults to 0.
- **kwargs: dict of str to Any
Additional keyword arguments passed to the parent constructor.
Examples#
>>> import deeptrack as dt
Create a pipeline using Add: >>> pipeline = dt.Value([1, 2, 3]) >> dt.Add(value=5) >>> pipeline.resolve() [6, 7, 8]
Alternatively, the pipeline can be created using operator overloading: >>> 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]) >>> sum_feature = dt.Add(value=5) >>> pipeline = sum_feature(input_value)