tuple_transforms

Description

Transformations that modify tuples of items on call.

The tuple transformations are all based on TupleTransforms. ReduceTuple can be used to merge the output tuple of a TupleTransforms into one output value. The Identity transformation can be used as dummy transformation where necessary.

Classes

ApplyMask

Given a 3-tuple of input, target, mask apply the mask to the first two.

FlattenTuple

Return the value of a sequence at selected index.

Identity

Simple identity transformation for example for defaults.

OnAll

Apply a given transformation to all tuple items.

OnBothSides

Apply a given transformation to both input and target of a tuple in parallel.

OnIndex

Apply a given transformation to tuple items at given indices.

OnInput

Apply a given one-value transformation only to the input of a two-tuple.

OnTarget

Apply a given one-value transformation only to the target of a two-tuple.

PackMask

Given a 3-tuple of prediction, target, mask tensors merge mask and target and return a two-tuple.

ReduceTuple

Transform an unpacked input tuple and then reduce it to one value using a reduction func.

SameSize

Given a tuple of input and target image, resize the target to the size of the input.

SubsetTuple

Return a tuple only containing the elements at given indices of input tuple.

TupleTransforms

Base class of tuple transformations that accept the same amount of inputs as they provide outputs.

TwoTupleTransforms

Version of TupleTransforms for operating on two-tuples only.

UnfoldTuple

Convenience trafo that takes an iterable and returns it as tuple.

UnpackMask

Undo a PackMask operation on the target.