opennmt.models.catalog module

Catalog of predefined models.

class opennmt.models.catalog.ListenAttendSpell[source]

Bases: opennmt.models.sequence_to_sequence.SequenceToSequence

Defines a model similar to the “Listen, Attend and Spell” model described in https://arxiv.org/abs/1508.01211.

auto_config(num_devices=1)[source]

Returns automatic configuration values specific to this model.

Parameters:num_devices – The number of devices used for the training.
Returns:A partial training configuration.
class opennmt.models.catalog.NMTBig[source]

Bases: opennmt.models.catalog._RNNBase

Defines a bidirectional LSTM encoder-decoder model.

class opennmt.models.catalog.NMTMedium[source]

Bases: opennmt.models.catalog._RNNBase

Defines a medium-sized bidirectional LSTM encoder-decoder model.

class opennmt.models.catalog.NMTSmall[source]

Bases: opennmt.models.catalog._RNNBase

Defines a small unidirectional LSTM encoder-decoder model.

class opennmt.models.catalog.SeqTagger[source]

Bases: opennmt.models.sequence_tagger.SequenceTagger

Defines a bidirectional LSTM-CNNs-CRF as described in https://arxiv.org/abs/1603.01354.

auto_config(num_devices=1)[source]

Returns automatic configuration values specific to this model.

Parameters:num_devices – The number of devices used for the training.
Returns:A partial training configuration.
class opennmt.models.catalog.Transformer(dtype=tf.float32)[source]

Bases: opennmt.models.transformer.Transformer

Defines a Transformer model as decribed in https://arxiv.org/abs/1706.03762.

class opennmt.models.catalog.TransformerFP16[source]

Bases: opennmt.models.catalog.Transformer

Defines a Transformer model that uses half-precision floating points.

class opennmt.models.catalog.TransformerAAN[source]

Bases: opennmt.models.transformer.Transformer

Defines a Transformer model as decribed in https://arxiv.org/abs/1706.03762 with cumulative average attention in the decoder as described in https://arxiv.org/abs/1805.00631.

class opennmt.models.catalog.TransformerBig[source]

Bases: opennmt.models.transformer.Transformer

Defines a large Transformer model as decribed in https://arxiv.org/abs/1706.03762.