diffusion_models.evaluation.checkpoint ====================================== .. py:module:: diffusion_models.evaluation.checkpoint .. autoapi-nested-parse:: Score a saved training checkpoint with FID / KID. Module Contents --------------- .. py:function:: evaluate_checkpoint(checkpoint_path, number_of_samples = 10000, batch_size = 100, device = 'cuda', use_ema = True, compute_kid = True, kid_subset_size = 1000, steps = None, seed = 0, num_workers = 4) Compute FID/KID of a checkpoint produced by ``diffusion-models train``. The model and the reference dataset are rebuilt from the resolved config stored in the checkpoint. The reference images are the config's ``eval_dataset`` when it has one, otherwise its ``dataset`` with ``split="valid"`` when that dataset has a ``split`` option. :param checkpoint_path: The checkpoint to evaluate. :param number_of_samples: The number of real and generated images compared. :param batch_size: The batch size used for sampling and feature extraction. :param device: The device to use. :param use_ema: Prefer the EMA weights when the checkpoint has them. :param compute_kid: Whether to also compute KID. :param kid_subset_size: The KID subset size. :param steps: Overrides the number of DDIM sampling steps, when the diffuser has that option. :param seed: The seed of the sampling noise. :param num_workers: Dataloader workers used to read the real images. :returns: The ``FID`` (and ``KID``) scores.