InputTransform¶
- class flash.core.data.io.input_transform.InputTransform[source]¶
- collate()[source]¶
Defines the transform to be applied on a list of sample to create a batch for all stages.
- 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_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
- serve_collate()[source]¶
Defines the transform to be applied on a list of serving sample to create a serving batch.
- 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_batch_transform_on_device()[source]¶
Defines the transform to be applied on a batch of data on device 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 serve_per_batch_transform_on_device(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_per_sample_transform_on_device()[source]¶
Defines the transform to be applied on a single sample on device 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 serve_per_sample_transform_on_device(self) -> Callable: return ApplyToKeys("input", my_func)
- 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_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
- train_collate()[source]¶
Defines the transform to be applied on a list of training sample to create a training batch.
- 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
- val_collate()[source]¶
Defines the transform to be applied on a list of validating sample to create a validating batch.
- 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