neuralmonkey.decoders.ctc_decoder module

class neuralmonkey.decoders.ctc_decoder.CTCDecoder(name: str, encoder: neuralmonkey.model.stateful.TemporalStateful, vocabulary: neuralmonkey.vocabulary.Vocabulary, data_id: str, max_length: int = None, merge_repeated_targets: bool = False, merge_repeated_outputs: bool = True, beam_width: int = 1, reuse: neuralmonkey.model.model_part.ModelPart = None, save_checkpoint: str = None, load_checkpoint: str = None, initializers: List[Tuple[str, Callable]] = None) → None

Bases: neuralmonkey.model.model_part.ModelPart

Connectionist Temporal Classification.

See tf.nn.ctc_loss, tf.nn.ctc_greedy_decoder etc.

__init__(name: str, encoder: neuralmonkey.model.stateful.TemporalStateful, vocabulary: neuralmonkey.vocabulary.Vocabulary, data_id: str, max_length: int = None, merge_repeated_targets: bool = False, merge_repeated_outputs: bool = True, beam_width: int = 1, reuse: neuralmonkey.model.model_part.ModelPart = None, save_checkpoint: str = None, load_checkpoint: str = None, initializers: List[Tuple[str, Callable]] = None) → None

Construct a new parameterized object.

Parameters:
  • name – The name for the model part. Will be used in the variable and name scopes.
  • reuse – Optional parameterized part with which to share parameters.
  • save_checkpoint – Optional path to a checkpoint file which will store the parameters of this object.
  • load_checkpoint – Optional path to a checkpoint file from which to load initial variables for this object.
  • initializers – An InitializerSpecs instance with specification of the initializers.
cost
decoded
feed_dict(dataset: neuralmonkey.dataset.Dataset, train: bool = False) → Dict[tensorflow.python.framework.ops.Tensor, Any]

Return a feed dictionary for the given feedable object.

Parameters:
  • dataset – A dataset instance from which to get the data.
  • train – Boolean indicating whether the model runs in training mode.
Returns:

A FeedDict dictionary object.

logits
runtime_loss
train_loss
train_targets