InputTransform¶
- class flash.core.data.io.input_transform.InputTransform(running_stage=<property object>)[source]¶
- collate()[source]¶
Defines the transform to be applied on a list of sample to create a batch for all stages.
- Return type
- input_per_batch_transform()[source]¶
Defines the transform to be applied on the value associated with the “input” key of batch on cpu for all stages stage.
- Return type
- input_per_batch_transform_on_device()[source]¶
Defines the transform to be applied on the value associated with the “input” key of batch on device for all stages stage.
- Return type
- input_per_sample_transform()[source]¶
Defines the transform to be applied on the value associated with the “input” key of each sample on device for all stages stage.
- Return type
- input_per_sample_transform_on_device()[source]¶
Defines the transform to be applied on the value associated with the “input” key of each sample on device for all stages stage.
- Return type
- per_batch_transform()[source]¶
Defines the transform to be applied on a batch of data on cpu for all stages stage.
The input data of the transform would have the following form:
{ DataKeys.INPUT: ..., DataKeys.TARGET: ..., DataKeys.METADATA: ..., }
You would need to use
flash.core.data.transforms.ApplyToKeys
as follows:from flash.core.data.transforms import ApplyToKeys class MyInputTransform(InputTransform): def per_batch_transform(self) -> Callable: return ApplyToKeys("input", my_func)
- Return type
- per_batch_transform_on_device()[source]¶
Defines the transform to be applied on a batch of data on device for all stages stage.
The input data of the transform would have the following form:
{ DataKeys.INPUT: ..., DataKeys.TARGET: ..., DataKeys.METADATA: ..., }
You would need to use
flash.core.data.transforms.ApplyToKeys
as follows:from flash.core.data.transforms import ApplyToKeys class MyInputTransform(InputTransform): def per_batch_transform_on_device(self) -> Callable: return ApplyToKeys("input", my_func)
- Return type
- per_sample_transform()[source]¶
Defines the transform to be applied on a single sample on cpu for all stages stage.
The input data of the transform would have the following form:
{ DataKeys.INPUT: ..., DataKeys.TARGET: ..., DataKeys.METADATA: ..., }
You would need to use
flash.core.data.transforms.ApplyToKeys
as follows:from flash.core.data.transforms import ApplyToKeys class MyInputTransform(InputTransform): def per_sample_transform(self) -> Callable: return ApplyToKeys("input", my_func)
- Return type
- per_sample_transform_on_device()[source]¶
Defines the transform to be applied on a single sample on device for all stages stage.
The input data of the transform would have the following form:
{ DataKeys.INPUT: ..., DataKeys.TARGET: ..., DataKeys.METADATA: ..., }
You would need to use
flash.core.data.transforms.ApplyToKeys
as follows:from flash.core.data.transforms import ApplyToKeys class MyInputTransform(InputTransform): def per_sample_transform_on_device(self) -> Callable: return ApplyToKeys("input", my_func)
- Return type
- predict_collate()[source]¶
Defines the transform to be applied on a list of predicting sample to create a predicting batch.
- Return type
- predict_input_per_batch_transform()[source]¶
Defines the transform to be applied on the value associated with the “input” key of each single sample on cpu for the predicting stage.
- Return type
- predict_input_per_batch_transform_on_device()[source]¶
Defines the transform to be applied on the value associated with the “input” key of each single sample on device for the predicting stage.
- Return type
- predict_input_per_sample_transform()[source]¶
Defines the transform to be applied on the value associated with the “input” key of each single sample on cpu for the predicting stage.
- Return type
- predict_input_per_sample_transform_on_device()[source]¶
Defines the transform to be applied on the value associated with the “input” key of each single sample on device for the predicting stage.
- Return type
- predict_per_batch_transform()[source]¶
Defines the transform to be applied on a batch of data on cpu for the predicting stage.
The input data of the transform would have the following form:
{ DataKeys.INPUT: ..., DataKeys.TARGET: ..., DataKeys.METADATA: ..., }
You would need to use
flash.core.data.transforms.ApplyToKeys
as follows:from flash.core.data.transforms import ApplyToKeys class MyInputTransform(InputTransform): def per_batch_transform(self) -> Callable: return ApplyToKeys("input", my_func)
- Return type
- predict_per_batch_transform_on_device()[source]¶
Defines the transform to be applied on a batch of data on device for the predicting stage.
The input data of the transform would have the following form:
{ DataKeys.INPUT: ..., DataKeys.TARGET: ..., DataKeys.METADATA: ..., }
You would need to use
flash.core.data.transforms.ApplyToKeys
as follows:from flash.core.data.transforms import ApplyToKeys class MyInputTransform(InputTransform): def per_batch_transform_on_device(self) -> Callable: return ApplyToKeys("input", my_func)
- Return type
- predict_per_sample_transform()[source]¶
Defines the transform to be applied on a single sample on cpu for the predicting stage.
The input data of the transform would have the following form:
{ DataKeys.INPUT: ..., DataKeys.TARGET: ..., DataKeys.METADATA: ..., }
You would need to use
flash.core.data.transforms.ApplyToKeys
as follows:from flash.core.data.transforms import ApplyToKeys class MyInputTransform(InputTransform): def per_sample_transform(self) -> Callable: return ApplyToKeys("input", my_func)
- Return type
- predict_per_sample_transform_on_device()[source]¶
Defines the transform to be applied on a single sample on device for the predicting stage.
The input data of the transform would have the following form:
{ DataKeys.INPUT: ..., DataKeys.TARGET: ..., DataKeys.METADATA: ..., }
You would need to use
flash.core.data.transforms.ApplyToKeys
as follows:from flash.core.data.transforms import ApplyToKeys class MyInputTransform(InputTransform): def per_sample_transform_on_device(self) -> Callable: return ApplyToKeys("input", my_func)
- Return type
- predict_target_per_batch_transform()[source]¶
Defines the transform to be applied on the value associated with the “target” key of each single sample on cpu for the predicting stage.
- Return type
- predict_target_per_batch_transform_on_device()[source]¶
Defines the transform to be applied on the value associated with the “target” key of each single sample on device for the predicting stage.
- Return type
- predict_target_per_sample_transform()[source]¶
Defines the transform to be applied on the value associated with the “target” key of each single sample on cpu for the predicting stage.
- Return type
- predict_target_per_sample_transform_on_device()[source]¶
Defines the transform to be applied on the value associated with the “target” key of each single sample on device for the predicting stage.
- Return type
- serve_collate()[source]¶
Defines the transform to be applied on a list of serving sample to create a serving batch.
- Return type
- serve_input_per_batch_transform()[source]¶
Defines the transform to be applied on the value associated with the “input” key of each single sample on cpu for the serving stage.
- Return type
- serve_input_per_sample_transform()[source]¶
Defines the transform to be applied on the value associated with the “input” key of each single sample on cpu for the serving stage.
- Return type
- serve_per_batch_transform()[source]¶
Defines the transform to be applied on a batch of data on cpu for the serving stage.
The input data of the transform would have the following form:
{ DataKeys.INPUT: ..., DataKeys.TARGET: ..., DataKeys.METADATA: ..., }
You would need to use
flash.core.data.transforms.ApplyToKeys
as follows:from flash.core.data.transforms import ApplyToKeys class MyInputTransform(InputTransform): def per_batch_transform(self) -> Callable: return ApplyToKeys("input", my_func)
- Return type
- serve_per_sample_transform()[source]¶
Defines the transform to be applied on a single sample on cpu for the serving stage.
The input data of the transform would have the following form:
{ DataKeys.INPUT: ..., DataKeys.TARGET: ..., DataKeys.METADATA: ..., }
You would need to use
flash.core.data.transforms.ApplyToKeys
as follows:from flash.core.data.transforms import ApplyToKeys class MyInputTransform(InputTransform): def per_sample_transform(self) -> Callable: return ApplyToKeys("input", my_func)
- Return type
- serve_target_per_batch_transform()[source]¶
Defines the transform to be applied on the value associated with the “target” key of each single sample on cpu for the serving stage.
- Return type
- serve_target_per_sample_transform()[source]¶
Defines the transform to be applied on the value associated with the “target” key of each single sample on cpu for the serving stage.
- Return type
- target_per_batch_transform()[source]¶
Defines the transform to be applied on the value associated with the “target” key of batch on cpu for all stages stage.
- Return type
- target_per_batch_transform_on_device()[source]¶
Defines the transform to be applied on the value associated with the “target” key of batch on device for all stages stage.
- Return type
- target_per_sample_transform()[source]¶
Defines the transform to be applied on the value associated with the “target” key of each sample on device for all stages stage.
- Return type
- target_per_sample_transform_on_device()[source]¶
Defines the transform to be applied on the value associated with the “target” key of each sample on device for all stages stage.
- Return type
- test_collate()[source]¶
Defines the transform to be applied on a list of testing sample to create a testing batch.
- Return type
- test_input_per_batch_transform()[source]¶
Defines the transform to be applied on the value associated with the “input” key of each single sample on cpu for the testing stage.
- Return type
- test_input_per_batch_transform_on_device()[source]¶
Defines the transform to be applied on the value associated with the “input” key of each single sample on device for the testing stage.
- Return type
- test_input_per_sample_transform()[source]¶
Defines the transform to be applied on the value associated with the “input” key of each single sample on cpu for the testing stage.
- Return type
- test_input_per_sample_transform_on_device()[source]¶
Defines the transform to be applied on the value associated with the “input” key of each single sample on device for the testing stage.
- Return type
- test_per_batch_transform()[source]¶
Defines the transform to be applied on a batch of data on cpu for the testing stage.
The input data of the transform would have the following form:
{ DataKeys.INPUT: ..., DataKeys.TARGET: ..., DataKeys.METADATA: ..., }
- Return type
- test_per_batch_transform_on_device()[source]¶
Defines the transform to be applied on a batch of data on device for the testing stage.
The input data of the transform would have the following form:
{ DataKeys.INPUT: ..., DataKeys.TARGET: ..., DataKeys.METADATA: ..., }
- Return type
- test_per_sample_transform()[source]¶
Defines the transform to be applied on a single sample on cpu for the testing stage.
The input data of the transform would have the following form:
{ DataKeys.INPUT: ..., DataKeys.TARGET: ..., DataKeys.METADATA: ..., }
- Return type
- test_per_sample_transform_on_device()[source]¶
Defines the transform to be applied on a single sample on device for the testing stage.
The input data of the transform would have the following form:
{ DataKeys.INPUT: ..., DataKeys.TARGET: ..., DataKeys.METADATA: ..., }
- Return type
- test_target_per_batch_transform()[source]¶
Defines the transform to be applied on the value associated with the “target” key of each single sample on cpu for the testing stage.
- Return type
- test_target_per_batch_transform_on_device()[source]¶
Defines the transform to be applied on the value associated with the “target” key of each single sample on device for the testing stage.
- Return type
- test_target_per_sample_transform()[source]¶
Defines the transform to be applied on the value associated with the “target” key of each single sample on cpu for the testing stage.
- Return type
- test_target_per_sample_transform_on_device()[source]¶
Defines the transform to be applied on the value associated with the “target” key of each single sample on device for the testing stage.
- Return type
- train_collate()[source]¶
Defines the transform to be applied on a list of training sample to create a training batch.
- Return type
- train_input_per_batch_transform()[source]¶
Defines the transform to be applied on the value associated with the “input” key of each single sample on cpu for the training stage.
- Return type
- train_input_per_batch_transform_on_device()[source]¶
Defines the transform to be applied on the value associated with the “input” key of each single sample on device for the training stage.
- Return type
- train_input_per_sample_transform()[source]¶
Defines the transform to be applied on the value associated with the “input” key of each single sample on cpu for the training stage.
- Return type
- train_input_per_sample_transform_on_device()[source]¶
Defines the transform to be applied on the value associated with the “input” key of each single sample on device for the training stage.
- Return type
- train_per_batch_transform()[source]¶
Defines the transform to be applied on a batch of data on cpu for the training stage.
The input data of the transform would have the following form:
{ DataKeys.INPUT: ..., DataKeys.TARGET: ..., DataKeys.METADATA: ..., }
- Return type
- train_per_batch_transform_on_device()[source]¶
Defines the transform to be applied on a batch of data on device for the training stage.
The input data of the transform would have the following form:
{ DataKeys.INPUT: ..., DataKeys.TARGET: ..., DataKeys.METADATA: ..., }
- Return type
- train_per_sample_transform()[source]¶
Defines the transform to be applied on a single sample on cpu for the training stage.
The input data of the transform would have the following form:
{ DataKeys.INPUT: ..., DataKeys.TARGET: ..., DataKeys.METADATA: ..., }
- Return type
- train_per_sample_transform_on_device()[source]¶
Defines the transform to be applied on a single sample on device for the training stage.
The input data of the transform would have the following form:
{ DataKeys.INPUT: ..., DataKeys.TARGET: ..., DataKeys.METADATA: ..., }
- Return type
- train_target_per_batch_transform()[source]¶
Defines the transform to be applied on the value associated with the “target” key of each single sample on cpu for the training stage.
- Return type
- train_target_per_batch_transform_on_device()[source]¶
Defines the transform to be applied on the value associated with the “target” key of each single sample on device for the training stage.
- Return type
- train_target_per_sample_transform()[source]¶
Defines the transform to be applied on the value associated with the “target” key of each single sample on cpu for the training stage.
- Return type
- train_target_per_sample_transform_on_device()[source]¶
Defines the transform to be applied on the value associated with the “target” key of each single sample on device for the training stage.
- Return type
- property transforms: Dict[str, Optional[Dict[str, Callable]]]¶
The transforms currently being used by this
InputTransform
.
- val_collate()[source]¶
Defines the transform to be applied on a list of validating sample to create a validating batch.
- Return type
- val_input_per_batch_transform()[source]¶
Defines the transform to be applied on the value associated with the “input” key of each single sample on cpu for the validating stage.
- Return type
- val_input_per_batch_transform_on_device()[source]¶
Defines the transform to be applied on the value associated with the “input” key of each single sample on device for the validating stage.
- Return type
- val_input_per_sample_transform()[source]¶
Defines the transform to be applied on the value associated with the “input” key of each single sample on cpu for the validating stage.
- Return type
- val_input_per_sample_transform_on_device()[source]¶
Defines the transform to be applied on the value associated with the “input” key of each single sample on device for the validating stage.
- Return type
- val_per_batch_transform()[source]¶
Defines the transform to be applied on a batch of data on cpu for the validating stage.
The input data of the transform would have the following form:
{ DataKeys.INPUT: ..., DataKeys.TARGET: ..., DataKeys.METADATA: ..., }
You would need to use
flash.core.data.transforms.ApplyToKeys
as follows:from flash.core.data.transforms import ApplyToKeys class MyInputTransform(InputTransform): def per_batch_transform(self) -> Callable: return ApplyToKeys("input", my_func)
- Return type
- val_per_batch_transform_on_device()[source]¶
Defines the transform to be applied on a batch of data on device for the validating stage.
The input data of the transform would have the following form:
{ DataKeys.INPUT: ..., DataKeys.TARGET: ..., DataKeys.METADATA: ..., }
You would need to use
flash.core.data.transforms.ApplyToKeys
as follows:from flash.core.data.transforms import ApplyToKeys class MyInputTransform(InputTransform): def per_batch_transform_on_device(self) -> Callable: return ApplyToKeys("input", my_func)
- Return type
- val_per_sample_transform()[source]¶
Defines the transform to be applied on a single sample on cpu for the validating stage.
The input data of the transform would have the following form:
{ DataKeys.INPUT: ..., DataKeys.TARGET: ..., DataKeys.METADATA: ..., }
You would need to use
flash.core.data.transforms.ApplyToKeys
as follows:from flash.core.data.transforms import ApplyToKeys class MyInputTransform(InputTransform): def per_sample_transform(self) -> Callable: return ApplyToKeys("input", my_func)
- Return type
- val_per_sample_transform_on_device()[source]¶
Defines the transform to be applied on a single sample on device for the validating stage.
The input data of the transform would have the following form:
{ DataKeys.INPUT: ..., DataKeys.TARGET: ..., DataKeys.METADATA: ..., }
You would need to use
flash.core.data.transforms.ApplyToKeys
as follows:from flash.core.data.transforms import ApplyToKeys class MyInputTransform(InputTransform): def per_sample_transform_on_device(self) -> Callable: return ApplyToKeys("input", my_func)
- Return type
- val_target_per_batch_transform()[source]¶
Defines the transform to be applied on the value associated with the “target” key of each single sample on cpu for the validating stage.
- Return type
- val_target_per_batch_transform_on_device()[source]¶
Defines the transform to be applied on the value associated with the “target” key of each single sample on device for the validating stage.
- Return type