class_docstr: The variance exploding stochastic differential equation (SDE) scheduler.
  
  :param snr: coefficient weighting the step from the model_output sample (from the network) to the random noise.
  :param sigma_min: initial noise scale for sigma sequence in sampling procedure. The minimum sigma should mirror the
          distribution of the data.
  :param sigma_max: :param sampling_eps: the end value of sampling, where timesteps decrease progessively from 1 to
  epsilon. :param correct_steps: number of correction steps performed on a produced sample. :param tensor_format:
  "np" or "pd" for the expected format of samples passed to the Scheduler.
class_docstr_tok: ["The","variance","exploding","stochastic","differential","equation","(","SDE",")","scheduler",".",":","param","snr",":","coefficient","weighting","the","step","from","the","model_output","sample","(","from","the","network",")","to","the","random","noise",".",":","param","sigma_min",":","initial","noise","scale","for","sigma","sequence","in","sampling","procedure",".","The","minimum","sigma","should","mirror","the","distribution","of","the","data",".",":","param","sigma_max",":",":","param","sampling_eps",":","the","end","value","of","sampling",",","where","timesteps","decrease","progessively","from","1","to","epsilon",".",":","param","correct_steps",":","number","of","correction","steps","performed","on","a","produced","sample",".",":","param","tensor_format",":","''","np","''","or","``","pd","''","for","the","expected","format","of","samples","passed","to","the","Scheduler","."]
docstr: Predict the sample at the previous timestep by reversing the SDE.
docstr_tok: ["Predict","the","sample","at","the","previous","timestep","by","reversing","the","SDE","."]
code: def step_pred(
      self,
      model_output: Union[paddle.Tensor, np.ndarray],
      timestep: int,
      sample: Union[paddle.Tensor, np.ndarray],
      seed=None,
  ):
      """
      Predict the sample at the previous timestep by reversing the SDE.
      """
      if seed is not None:
          self.set_seed(seed)
      # TODO(Patrick) non-Pypaddle
  
      timestep = timestep * paddle.ones(
          sample.shape[0]
      )  # paddle.repeat_interleave(timestep, sample.shape[0])
      timesteps = (timestep * (len(self.timesteps) - 1)).astype("int64")
  
      sigma = self.discrete_sigmas[timesteps]
      adjacent_sigma = self.get_adjacent_sigma(timesteps, timestep)
      drift = self.zeros_like(sample)
      diffusion = (sigma**2 - adjacent_sigma**2) ** 0.5
  
      # equation 6 in the paper: the model_output modeled by the network is grad_x log pt(x)
      # also equation 47 shows the analog from SDE models to ancestral sampling methods
      drift = drift - diffusion[:, None, None, None] ** 2 * model_output
  
      #  equation 6: sample noise for the diffusion term of
      noise = self.randn_like(sample)
      prev_sample_mean = (
          sample - drift
      )  # subtract because `dt` is a small negative timestep
      # TODO is the variable diffusion the correct scaling term for the noise?
      prev_sample = (
          prev_sample_mean + diffusion[:, None, None, None] * noise
      )  # add impact of diffusion field g
  
      return {
          "prev_sample": prev_sample,
          "prev_sample_mean": prev_sample_mean,
      }
  
file_path: PaddleHub/modules/image/text_to_image/stable_diffusion_inpainting/diffusers/schedulers/scheduling_sde_ve.py
imports: from typing import Union
  import numpy
  import paddle
  from ..configuration_utils import ConfigMixin
  from ..configuration_utils import register_to_config
  from .scheduling_utils import SchedulerMixin
label_desc: Use image node_id 6 for calling the ScoreSdeVeScheduler obj's underlying member method code with example usage: obj.step_pred(model_output, timestep, sample, seed) and returns: dict