Divide#
- class deeptrack.features.Divide(value: float | Callable[[...], float] = 0, **kwargs: dict[str, Any])#
Bases:
ArithmeticOperationFeatureDivide the input with a value.
This feature performs element-wise division (/) of the input.
Parameters#
- value: PropertyLike[int or float], optional
The value to divide 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 Divide: >>> pipeline = Value([1, 2, 3]) >> Divide(value=5) >>> pipeline.resolve() [0.2 0.4 0.6]
Equivalently, this pipeline can be created using: >>> pipeline = Value([1, 2, 3]) / 5
Which is not equivalent to: >>> pipeline = 5 / Value([1, 2, 3]) # Different result.
Or, more explicitly: >>> input_value = Value([1, 2, 3]) >>> truediv_feature = Divide(value=5) >>> pipeline = truediv_feature(input_value)