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_dataloader(dataset, batch_size, num_workers=None, shuffle=True)[source]
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

predict(classifier, file_to_predict, label2idx)[source]
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:
Returns:

Trained autoencoder.

Return type:

Autoencoder

train_classifier(train_dataset, val_dataset, label2idx, parameters, autoencoder)[source]

Font classifier training loop.

Parameters:
Returns:

Trained classifier.

Return type:

Classifier

fontr.pipelines.data_science.pipeline module

create_pipeline(**kwargs)[source]
Return type:

Pipeline