Shortcuts

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

predict_collate()[source]

Defines the transform to be applied on a list of predicting sample to create a predicting batch.

Return type

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

serve_collate()[source]

Defines the transform to be applied on a list of serving sample to create a serving batch.

Return type

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

test_collate()[source]

Defines the transform to be applied on a list of testing sample to create a testing batch.

Return type

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

train_collate()[source]

Defines the transform to be applied on a list of training sample to create a training batch.

Return type

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

property transforms: Dict[str, Optional[Dict[str, Callable]]]

The transforms currently being used by this InputTransform.

Return type

Dict[str, Optional[Dict[str, Callable]]]

val_collate()[source]

Defines the transform to be applied on a list of validating sample to create a validating batch.

Return type

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

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

Callable

val_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 validating stage.

Return type

Callable

val_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 validating stage.

Return type

Callable

Read the Docs v: 0.7.4
Versions
latest
stable
0.7.4
0.7.3
0.7.2
0.7.1
0.7.0
0.6.0
0.5.2
0.5.1
0.5.0
0.4.0
0.3.2
0.3.1
0.3.0
0.2.3
0.2.2
0.2.1
0.2.0
0.1.0post1
docs-fix_typing
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.