spec2vec.utils module

class spec2vec.utils.ModelSaver(num_of_epochs: int, iterations: List, filename: str)[source]

Bases: gensim.models.callbacks.CallbackAny2Vec

Callback to save model during training (when specified).

__init__(num_of_epochs: int, iterations: List, filename: str)[source]
Parameters
  • num_of_epochs – Total number of training epochs.

  • iterations – Number of total iterations or list of iterations at which to save the model.

  • filename – Filename to save model.

on_epoch_end(model)[source]

Allow saving model during training when specified in iterations.

class spec2vec.utils.TrainingProgressLogger(num_of_epochs: int)[source]

Bases: gensim.models.callbacks.CallbackAny2Vec

Callback to log training progress.

__init__(num_of_epochs: int)[source]
Parameters

num_of_epochs – Total number of training epochs.

on_epoch_end(model)[source]

Return progress of model training