class_docstr: Fits a Gaussian Mixture in the Autoencoder's latent space.
  
  Args:
      model (BaseAE): The vae model to sample from.
      sampler_config (BaseSamplerConfig): An instance of BaseSamplerConfig in which any sampler's
          parameters is made available. If None a default configuration is used. Default: None.
  
  .. note::
  
      The method :class:`~pythae.samplers.GaussianMixtureSampler.fit` must be called to fit the sampler
      before sampling.
class_docstr_tok: ["Fits","a","Gaussian","Mixture","in","the","Autoencoder","'s","latent","space",".","Args",":","model","(","BaseAE",")",":","The","vae","model","to","sample","from",".","sampler_config","(","BaseSamplerConfig",")",":","An","instance","of","BaseSamplerConfig","in","which","any","sampler's","parameters","is","made","available",".","If","None","a","default","configuration","is","used",".","Default",":","None",".","..","note",":",":","The","method",":","class",":","`","~pythae.samplers.GaussianMixtureSampler.fit","`","must","be","called","to","fit","the","sampler","before","sampling","."]
code: def __init__(
      self,
      model: BaseAE,
      sampler_config: GaussianMixtureSamplerConfig = None,
  ):
      if sampler_config is None:
          sampler_config = GaussianMixtureSamplerConfig()
  
      BaseSampler.__init__(
          self, model=model, sampler_config=sampler_config
      )
  
      self.n_components = sampler_config.n_components
  
file_path: benchmark_VAE/src/pythae/samplers/gaussian_mixture/gaussian_mixture_sampler.py
imports: import logging
  from typing import Union
  import numpy
  import torch
  from sklearn import mixture
  from torch.utils.data import DataLoader, Dataset
  from ...data.datasets import collate_dataset_output
  from ...data.preprocessors import DataProcessor
  from ...models import BaseAE
  from ..base import BaseSampler
  from .gaussian_mixture_config import GaussianMixtureSamplerConfig
label_desc: Use image node_id 1 to create a new GaussianMixtureSampler object from inherited base classes: BaseSampler with example: obj = GaussianMixtureSampler(model, sampler_config)