class_docstr: Simple convergence criterion based on lack of decrease in loss values.
  
  This rule tracks an exponentially-weighted moving average of the decrease
  in loss values between successive steps, and stops when that average drops
  below a threshold.
  
  ```
  decrease_in_loss[t] = loss[t-1] - loss[t]
  average_decrease_in_loss[t] = (
    (window_size - 1) * average_decrease_in_loss[t - 1] +
     decrease_in_loss[t]) / window_size
  has_converged = (average_decrease_in_loss < threshold)
  ```
  
  The convergence threshold can be set directly as `atol`, or as a fraction
  of the average loss decrease across the first `window_size` steps
  of the optimization:
  `threshold = rtol * average_decrease_in_loss[window_size]`.
  If both `atol` and `rtol` are specified,
  the maximum of the two thresholds is used (equivalently, the optimization
  stops if either of the two conditions is met).
  
  The state propagated across training steps is
  `state[t] = LossNotDecreasingState(loss[t],
                                     average_decrease_in_loss[t],
                                     average_decrease_in_loss[window_size]).
class_docstr_tok: ["Simple","convergence","criterion","based","on","lack","of","decrease","in","loss","values",".","This","rule","tracks","an","exponentially-weighted","moving","average","of","the","decrease","in","loss","values","between","successive","steps",",","and","stops","when","that","average","drops","below","a","threshold",".","``","`","decrease_in_loss","[","t","]","=","loss","[","t-1","]","-","loss","[","t","]","average_decrease_in_loss","[","t","]","=","(","(","window_size","-","1",")","*","average_decrease_in_loss","[","t","-","1","]","+","decrease_in_loss","[","t","]",")","\/","window_size","has_converged","=","(","average_decrease_in_loss","<","threshold",")","``","`","The","convergence","threshold","can","be","set","directly","as","`","atol","`",",","or","as","a","fraction","of","the","average","loss","decrease","across","the","first","`","window_size","`","steps","of","the","optimization",":","`","threshold","=","rtol","*","average_decrease_in_loss","[","window_size","]","`",".","If","both","`","atol","`","and","`","rtol","`","are","specified",",","the","maximum","of","the","two","thresholds","is","used","(","equivalently",",","the","optimization","stops","if","either","of","the","two","conditions","is","met",")",".","The","state","propagated","across","training","steps","is","`","state","[","t","]","=","LossNotDecreasingState","(","loss","[","t","]",",","average_decrease_in_loss","[","t","]",",","average_decrease_in_loss","[","window_size","]",")","."]
code: def rtol(self):
      return self._rtol
  
file_path: probability/tensorflow_probability/python/optimizer/convergence_criteria/loss_not_decreasing.py
imports: import collections
  import tensorflow.compat.v2
  from tensorflow_probability.python.optimizer.convergence_criteria import convergence_criterion
label_desc: Use image node_id 5 for calling the LossNotDecreasing obj's underlying member method code with example usage: obj.rtol() and returns: self