Lambda
- class hybrid_learning.datasets.transforms.common.Lambda(fun)[source]
Bases:
Transform
Generic lambda transformation that applies the given function.
Warning
Note that lambda functions by default cannot be pickled and thus will cause errors when used in a multiprocessing context! It is strongly recommended to provide a callable object instead.
Public Data Attributes:
Settings to reproduce the instance.
Inherited from : py: class:Transform
IDENTITY_CLASS
The identity class or classes for composition / addition.
Settings to reproduce the instance.
Public Methods:
apply_to
(*inp)Application of the lambda.
Inherited from : py: class:Transform
apply_to
(*inp)Application of the lambda.
Special Methods:
__repr__
()Return repr(self).
__init__
(fun)Init.
Inherited from : py: class:Transform
__repr__
()Return repr(self).
__eq__
(other)Return self==value.
__copy__
()Return a shallow copy of self using settings.
__add__
(other)Return a flat composition of
self
withother
.__radd__
(other)Return a flat composition of
other
andself
.__call__
(*inps)General call to the transformation.
- Parameters
fun (Callable) –
- fun: Callable
The function to apply on call.