OnTarget
- class hybrid_learning.datasets.transforms.tuple_transforms.OnTarget(trafo)[source]
Bases:
_PartialTupleTrafo
,TwoTupleTransforms
Apply a given one-value transformation only to the target of a two-tuple. Shortcut for
OnIndices([1], trafo)
with tuple length enforcement.Public Data Attributes:
Inherited from : py: class:_PartialTupleTrafo
settings
Settings to reproduce the instance.
Inherited from : py: class:Transform
IDENTITY_CLASS
The identity class or classes for composition / addition.
settings
Settings to reproduce the instance.
Public Methods:
apply_to
(inp, target)Application of the transformation to the target.
Inherited from : py: class:TwoTupleTransforms
apply_to
(inp, target)Application of the transformation to the target.
Inherited from : py: class:TupleTransforms
apply_to
(inp, target)Application of the transformation to the target.
Inherited from : py: class:Transform
apply_to
(inp, target)Application of the transformation to the target.
Special Methods:
Inherited from : py: class:_PartialTupleTrafo
__init__
(trafo)Init.
Inherited from : py: class:TwoTupleTransforms
__call__
(inp, target)Apply the transformation to the tuple
(inp, target)
; the output again is a tuple.Inherited from : py: class:TupleTransforms
__init__
(trafo)Init.
__call__
(inp, target)Apply the transformation to the tuple
(inp, target)
; the output again is a tuple.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__
(inp, target)Apply the transformation to the tuple
(inp, target)
; the output again is a tuple.
- Parameters
trafo (Callable) –