docstr: Get normalized probabilities (or log probs) from a net's output.
docstr_tok: ["Get","normalized","probabilities","(","or","log","probs",")","from","a","net","'s","output","."]
code: def get_normalized_probs(self, net_output, log_probs):
      """Get normalized probabilities (or log probs) from a net's output."""
      logits = net_output  # [batch, vocab]
      if log_probs:
          return F.log_softmax(logits, dim=1)
      else:
          return F.softmax(logits, dim=1)
  
file_path: translate/pytorch_translate/word_prediction/word_predictor.py
imports: import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 5 for calling the WordPredictor obj's underlying member method code with example usage: obj.get_normalized_probs(net_output, log_probs) and returns: F, F