allennlp.training.trainer_pieces

class allennlp.training.trainer_pieces.TrainerPieces[source]

Bases: tuple

We would like to avoid having complex instantiation logic taking place in Trainer.from_params. This helper class has a from_params that instantiates a model, loads train (and possibly validation and test) datasets, constructs a Vocabulary, creates data iterators, and handles a little bit of bookkeeping. If you’re creating your own alternative training regime you might be able to use this.

classmethod from_params(params: allennlp.common.params.Params, serialization_dir: str, recover: bool = False, cache_directory: str = None, cache_prefix: str = None) → 'TrainerPieces'[source]
property iterator

Alias for field number 1

property model

Alias for field number 0

property params

Alias for field number 6

property test_dataset

Alias for field number 4

property train_dataset

Alias for field number 2

property validation_dataset

Alias for field number 3

property validation_iterator

Alias for field number 5