class_docstr: Solver for compression task.
  
  The diffusion task allows for MultiBand diffusion model training.
  
  Args:
      cfg (DictConfig): Configuration.
class_docstr_tok: ["Solver","for","compression","task",".","The","diffusion","task","allows","for","MultiBand","diffusion","model","training",".","Args",":","cfg","(","DictConfig",")",":","Configuration","."]
docstr: Build model and optimizer as well as optional Exponential Moving Average of the model.
          
docstr_tok: ["Build","model","and","optimizer","as","well","as","optional","Exponential","Moving","Average","of","the","model","."]
code: def build_model(self):
      """Build model and optimizer as well as optional Exponential Moving Average of the model."""
      # Model and optimizer
      self.model = models.builders.get_diffusion_model(self.cfg).to(
          self.device
      )
      self.optimizer = builders.get_optimizer(
          self.model.parameters(), self.cfg.optim
      )
      self.register_stateful("model", "optimizer")
      self.register_best_state("model")
      self.register_ema("model")
  
imports: import typing
  import flashy
  import julius
  import omegaconf
  import torch
  import torch.nn.functional
  from .None import builders
  from .None import base
  from ..None import models
  from ..modules.diffusion_schedule import NoiseSchedule
  from ..metrics import RelativeVolumeMel
  from ..models.builders import get_processor
  from ..utils.samples.manager import SampleManager
  from ..solvers.compression import CompressionSolver
label_desc: Use image node_id 4 for calling the DiffusionSolver obj's underlying member method code with example usage: obj.build_model() without return types