Power#

class deeptrack.features.Power(value: float | Callable[[...], float] = 0, **kwargs: dict[str, Any])#

Bases: ArithmeticOperationFeature

Raise the input to a power.

This feature performs element-wise power (**) of the input.

Parameters#

value: PropertyLike[int or float], optional

The value to take the power of 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 Power: >>> pipeline = dt.Value([1, 2, 3]) >> dt.Power(value=3) >>> pipeline.resolve() [1, 8, 27]

Equivalently, this pipeline can be created using: >>> pipeline = dt.Value([1, 2, 3]) ** 3

Which is not equivalent to: >>> pipeline = 3 ** dt.Value([1, 2, 3]) # Different result.

Or, more explicitly: >>> input_value = dt.Value([1, 2, 3]) >>> pow_feature = Power(value=3) >>> pipeline = pow_feature(input_value)