class_docstr: .. math::
  
      L = \beta \| h_t-h_{t+1} \|_2^2,
  
  where :math:`h_t` is the output of the RNN at timestep t,
  :math:`h_{t+1}` is the output of the RNN at timestep t+1, :math:`\beta`
  is scaling coefficient.
  
  The implementation follows [MMS17]_.
  Computes Temporal Activation Regularization Loss. (alias: TAR)
  
  Parameters
  ----------
  beta
      The scaling coefficient of the regularization.
  weight
      Global scalar weight for loss.
  batch_axis
      The axis that represents mini-batch.
  time_axis
      The axis that represents time-step.
class_docstr_tok: ["..","math",":",":","L","=","\\beta","\\|","h_t-h_","{","t+1","}","\\|_2^2",",","where",":","math",":","`","h_t","`","is","the","output","of","the","RNN","at","timestep","t",",",":","math",":","`","h_","{","t+1","}","`","is","the","output","of","the","RNN","at","timestep","t+1",",",":","math",":","`","\\beta","`","is","scaling","coefficient",".","The","implementation","follows","[","MMS17","]","_.","Computes","Temporal","Activation","Regularization","Loss",".","(","alias",":","TAR",")","Parameters","--","--","--","--","--","beta","The","scaling","coefficient","of","the","regularization",".","weight","Global","scalar","weight","for","loss",".","batch_axis","The","axis","that","represents","mini-batch",".","time_axis","The","axis","that","represents","time-step","."]
code: def __init__(
      self,
      beta: float = 0,
      weight: Optional[float] = None,
      batch_axis: int = 1,
      time_axis: int = 0,
      **kwargs,
  ):
      super().__init__(weight, batch_axis, **kwargs)
      self._beta = beta
      self._batch_axis = batch_axis
      self._time_axis = time_axis
  
file_path: gluonts/src/gluonts/mx/block/regularization.py
imports: from typing import List, Optional
  from mxnet.gluon.loss import Loss
  from gluonts.core.component import validated
  from gluonts.mx import Tensor
label_desc: Use image node_id 1 to create a new TemporalActivationRegularizationLoss object from inherited base classes: Loss with example: obj = TemporalActivationRegularizationLoss(beta, weight, batch_axis, time_axis)