mmagic.utils.sampler
¶
Module Contents¶
Classes¶
Dummy sampler only return input args multiple times. |
|
Noise sampler to by call models.noise_fn to generate noise. |
|
Sampler loop the train_dataloader. |
|
Sampler loop the val_dataloader. |
Functions¶
|
Check whether target key is in the sample_kwargs. |
|
Get a sampler to loop input data. |
- mmagic.utils.sampler._check_keys(sample_kwargs: dict, key: str) None [源代码]¶
Check whether target key is in the sample_kwargs.
- mmagic.utils.sampler.get_sampler(sample_kwargs: dict, runner: Optional[mmengine.runner.Runner])[源代码]¶
Get a sampler to loop input data.
- 参数
sample_kwargs (dict) – _description_
runner (Optional[Runner]) – _description_
- 返回
_description_
- 返回类型
_type_
- class mmagic.utils.sampler.ArgumentsSampler(sample_kwargs: dict, runner: Optional[mmengine.runner.Runner] = None)[源代码]¶
Dummy sampler only return input args multiple times.
- class mmagic.utils.sampler.NoiseSampler(sample_kwargs: dict, runner: mmengine.runner.Runner)[源代码]¶
Noise sampler to by call models.noise_fn to generate noise.