class_docstr: A PID controller for ODE adaptive step size control.
class_docstr_tok: ["A","PID","controller","for","ODE","adaptive","step","size","control","."]
code: def propose_step(self, error):
      inv_error = 1 / (float(error) + self.eps)
      if not self.errs:
          self.errs = [inv_error, inv_error, inv_error]
      self.errs[0] = inv_error
      factor = (
          self.errs[0] ** self.b1
          * self.errs[1] ** self.b2
          * self.errs[2] ** self.b3
      )
      factor = self.limiter(factor)
      accept = factor >= self.accept_safety
      if accept:
          self.errs[2] = self.errs[1]
          self.errs[1] = self.errs[0]
      self.h *= factor
      return accept
  
imports: import math
  import torch
  import torchsde
  from scipy import integrate
  from torch import nn
  from torchdiffeq import odeint
  from tqdm.auto import tqdm, trange
label_desc: Use image node_id 3 for calling the PIDStepSizeController obj's underlying member method code with example usage: obj.propose_step(error) and returns: accept