Shortcuts

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

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_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

serve_collate()[source]

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

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_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

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_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

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_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

train_collate()[source]

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

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

val_collate()[source]

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

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

Read the Docs v: latest
Versions
latest
stable
0.8.2
0.8.1.post0
0.8.1
0.8.0
0.7.5
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
Downloads
html
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.