Skip to main content

batch_operations

Operations done at batch time defined here.

Classes

AlbumentationsImageTransformation

class AlbumentationsImageTransformation(    *,    name: str = None,    output: bool = False,    arg: Any,    step: DataSplit,    transformations: List[Union[str, Dict[str, _JSONDict]]],):

Represents image transformations done on a single column at batch time.

Arguments

  • arg: The argument to the transformation.
  • name: The name of the transformation. If not provided a unique name will be generated from the class name.
  • output: Whether or not this transformation should be included in the final output. Defaults to False.
  • step: Denotes whether transformations should be performed at training, validation or test time.
  • transformations: List of transformations to be performed in order as one transformation.

Raises

  • TransformationRegistryError: If the transformation name is already in use.
  • TransformationRegistryError: If the transformation name hasn't been provided and the transformation is not registered.
  • ValueError: If the output is set to False.

Method generated by attrs for class AlbumentationsImageTransformation.

Variables

  • static transformations : List[Union[str, Dict[str, Dict[str, Any]]]]

Static methods


schema

def schema()> marshmallow.schema.Schema:

Inherited from:

BatchTimeOperation.schema :

Gets an instance of the Schema associated with this Transformation.

Raises

  • TypeError: If the transformation doesn't have a TransformationSchema as the schema.

Methods


get_callable

def get_callable(    self,)> bitfount.transformations.batch_operations._AlbumentationsAugmentation:

Returns callable which performs the transformations.

Returns The callable to perform transformations.

BatchTimeOperation

class BatchTimeOperation(    *, name: str = None, output: bool = False, arg: Any, step: DataSplit,):

Class just to denote that transformation will happen at batch time.

All batch time operations must be unary operations.

Arguments

  • arg: The argument to the transformation.
  • name: The name of the transformation. If not provided a unique name will be generated from the class name.
  • output: Whether or not this transformation should be included in the final output. Defaults to False.
  • step: Denotes whether transformations should be performed at training, validation or test time.

Raises

  • TransformationRegistryError: If the transformation name is already in use.
  • TransformationRegistryError: If the transformation name hasn't been provided and the transformation is not registered.

Method generated by attrs for class BatchTimeOperation.

Variables

Static methods


schema

def schema()> marshmallow.schema.Schema:

Inherited from:

UnaryOperation.schema :

Gets an instance of the Schema associated with this Transformation.

Raises

  • TypeError: If the transformation doesn't have a TransformationSchema as the schema.