class_docstr: Discretized mixture of logistic distributions loss
  
  Adapted from wavenet vocoder
  (https://github.com/r9y9/wavenet_vocoder/blob/master/wavenet_vocoder/mixture.py)
  Explanation of loss (https://github.com/Rayhane-mamah/Tacotron-2/issues/155)
  
  Args:
      y_hat (Tensor): Predicted output (n_batch x n_time x n_channel)
      y (Tensor): Target (n_batch x n_time x 1)
      num_classes (int): Number of classes
      log_scale_min (float): Log scale minimum value
      reduce (bool): If True, the losses are averaged or summed for each minibatch
  
  Returns
      Tensor: loss
class_docstr_tok: ["Discretized","mixture","of","logistic","distributions","loss","Adapted","from","wavenet","vocoder","(","https",":","\/\/github.com\/r9y9\/wavenet_vocoder\/blob\/master\/wavenet_vocoder\/mixture.py",")","Explanation","of","loss","(","https",":","\/\/github.com\/Rayhane-mamah\/Tacotron-2\/issues\/155",")","Args",":","y_hat","(","Tensor",")",":","Predicted","output","(","n_batch","x","n_time","x","n_channel",")","y","(","Tensor",")",":","Target","(","n_batch","x","n_time","x","1",")","num_classes","(","int",")",":","Number","of","classes","log_scale_min","(","float",")",":","Log","scale","minimum","value","reduce","(","bool",")",":","If","True",",","the","losses","are","averaged","or","summed","for","each","minibatch","Returns","Tensor",":","loss"]
code: def __init__(
      self, num_classes=65536, log_scale_min=None, reduce=True
  ):
      super(MoLLoss, self).__init__()
      self.num_classes = num_classes
      self.log_scale_min = log_scale_min
      self.reduce = reduce
  
file_path: audio/examples/pipeline_wavernn/losses.py
imports: import math
  import torch
  from torch import nn
  from torch.nn import functional
label_desc: Use image node_id 1 to create a new MoLLoss object from inherited base classes: nn with example: obj = MoLLoss(num_classes, log_scale_min, reduce)