Shortcuts

FlashCallback

class flash.core.data.callback.FlashCallback[source]

FlashCallback is an extension of pytorch_lightning.callbacks.Callback.

A callback is a self-contained program that can be reused across projects. Flash and Lightning have a callback system to execute callbacks when needed. Callbacks should capture any NON-ESSENTIAL logic that is NOT required for your lightning module to run.

Same as PyTorch Lightning, Callbacks can be provided directly to the Trainer:

trainer = Trainer(callbacks=[MyCustomCallback()])
on_collate(batch, running_stage)[source]

Called once collate has been applied to a sequence of samples.

Return type

None

on_per_batch_transform(batch, running_stage)[source]

Called once per_batch_transform has been applied to a batch.

Return type

None

on_per_batch_transform_on_device(batch, running_stage)[source]

Called once per_batch_transform_on_device has been applied to a sample.

Return type

None

on_per_sample_transform(sample, running_stage)[source]

Called once per_sample_transform has been applied to a sample.

Return type

None

on_per_sample_transform_on_device(sample, running_stage)[source]

Called once per_sample_transform_on_device has been applied to a sample.

Return type

None