fontr.pipelines.data_science package
Complete Data Science pipeline for the spaceflights tutorial
Submodules
fontr.pipelines.data_science.nodes module
- evaluate_autoencoder(autoencoder, test_dataset, parameters)[source]
Evaluate autoencoder on test dataset. TODO implement this
- Parameters:
autoencoder (ScriptModule) – Autoencoder.
test_dataset (KedroPytorchImageDataset) – Test set images.
parameters (dict) – Evaluation parameters
- Raises:
NotImplementedError – Raised on every invocation.
- evaluate_classifier(classifier, test_dataset, label2idx, parameters)[source]
Evaluate classifier on test dataset
- Parameters:
classifier (ScriptModule) – Trained classifier
test_dataset (KedroPytorchImageDataset) – test dataset
label2idx (dict) – labels
parameters (dict) – pipeline parameters
- get_transforms(num_of_patches=10)[source]
Get transforms that should be used with dataloader to prepare the data to be used by models.
- Parameters:
num_of_patches (int, optional) – Number of patches that is created for each image.
- Return type:
Sequential
- serialize_model_to_torch_jit(model, torch_jit_serialization_method)[source]
Serialize pl.LightningModule object to TorchScript JIT format
- Parameters:
model (pl.LightningModule) – Model to be serialized
torch_jit_serialization_method (str) – ‘trace’ or ‘script’
- Returns:
Serialized model
- Return type:
ScriptModule
- train_autoencoder(train_dataset, val_dataset, parameters)[source]
Autoencoder training loop.
- Parameters:
train_dataset (KedroPytorchImageDataset) – Training images.
val_dataset (KedroPytorchImageDataset) – Validation images.
parameters (dict) – Training configuration.
- Returns:
Trained autoencoder.
- Return type:
- train_classifier(train_dataset, val_dataset, label2idx, parameters, autoencoder)[source]
Font classifier training loop.
- Parameters:
train_dataset (KedroPytorchImageDataset) – Training images.
val_dataset (KedroPytorchImageDataset) – Validation images.
label2idx (dict) – Mapping from label name to label index.
parameters (dict) – Training parameters
- Returns:
Trained classifier.
- Return type: