diffusion_models.gaussian_diffusion.base_diffuser ================================================= .. py:module:: diffusion_models.gaussian_diffusion.base_diffuser Module Contents --------------- .. py:class:: BaseDiffuser(beta_scheduler) Initializes the object with the specified beta scheduler. BaseDiffuser is an abstract base class for different diffuser implementations. It defines the interface that all diffusers should adhere to. :param beta_scheduler: The beta scheduler used by the diffuser. .. warning:: Do not instantiate this class directly. Instead, build your own Diffuser by inheriting from BaseDiffuser. (see :class:`~.gaussian_diffuser.GaussianDiffuser`) .. py:attribute:: beta_scheduler :type: diffusion_models.gaussian_diffusion.beta_schedulers.BaseBetaScheduler The beta scheduler used by the diffuser. .. py:property:: steps :type: List[int] :abstractmethod: Returns the list of steps used in the denoising process. .. py:method:: get_timestep(number_of_images, idx) :abstractmethod: Get timestep information used for denoising. .. py:method:: diffuse_batch(images) :abstractmethod: Diffuse a batch of images. :param images: A tensor containing a batch of images. :returns: A tuple containing three tensors - images: Diffused batch of images. - noise: Noise added to the images. - timesteps: Timesteps used for diffusion. .. py:method:: denoise_batch(images, model) :abstractmethod: Denoise a batch of images. :param images: A tensor containing a batch of images to denoise. :param model: The model to be used for denoising. :returns: A list of tensors containing a batch of denoised images. .. py:method:: to(device = 'cpu') :abstractmethod: Moves the data to the specified device. This performs a similar behaviour to the `to` method of PyTorch. :param device: The device to which the method should move the data. It should be a string indicating the desired device. Default is "cpu".