neuralmonkey.runners.logits_runner module

A runner outputing logits or normalized distriution from a decoder.

class neuralmonkey.runners.logits_runner.LogitsExecutable(all_coders: Set[neuralmonkey.model.model_part.ModelPart], fetches: Dict[tensorflow.python.framework.ops.Tensor, Union[int, float, numpy.ndarray]], vocabulary: neuralmonkey.vocabulary.Vocabulary, normalize: bool, pick_index: Union[int, NoneType]) → None

Bases: neuralmonkey.runners.base_runner.Executable

__init__(all_coders: Set[neuralmonkey.model.model_part.ModelPart], fetches: Dict[tensorflow.python.framework.ops.Tensor, Union[int, float, numpy.ndarray]], vocabulary: neuralmonkey.vocabulary.Vocabulary, normalize: bool, pick_index: Union[int, NoneType]) → None

Initialize self. See help(type(self)) for accurate signature.

collect_results(results: List[Dict]) → None
next_to_execute() → Tuple[Set[neuralmonkey.model.model_part.ModelPart], Union[Dict, List], List[Dict[tensorflow.python.framework.ops.Tensor, Union[int, float, numpy.ndarray]]]]

Get the feedables and tensors to run.

class neuralmonkey.runners.logits_runner.LogitsRunner(output_series: str, decoder: neuralmonkey.decoders.classifier.Classifier, normalize: bool = True, pick_index: int = None, pick_value: str = None) → None

Bases: neuralmonkey.runners.base_runner.BaseRunner

A runner which takes the output from decoder.decoded_logits.

The logits / normalized probabilities are outputted as tab-separates string values. If the decoder produces a list of logits (as the recurrent decoder), the tab separated arrays are separated with commas. Alternatively, we may be interested in a single distribution dimension.

__init__(output_series: str, decoder: neuralmonkey.decoders.classifier.Classifier, normalize: bool = True, pick_index: int = None, pick_value: str = None) → None

Initialize the logits runner.

Parameters:
  • output_series – Name of the series produced by the runner.
  • decoder – A decoder having logits.
  • normalize – Flag whether the logits should be normalized with softmax.
  • pick_index – If not None, it specifies the index of the logit or the probability that should be on output.
  • pick_value – If not None, it specifies a value from the decoder’s vocabulary whose logit or probability should be on output.
get_executable(compute_losses: bool, summaries: bool, num_sessions: int) → neuralmonkey.runners.logits_runner.LogitsExecutable
loss_names