mmagic.engine.hooks.pggan_fetch_data_hook
¶
Module Contents¶
Classes¶
PGGAN Fetch Data Hook. |
Attributes¶
- class mmagic.engine.hooks.pggan_fetch_data_hook.PGGANFetchDataHook[source]¶
Bases:
mmengine.hooks.Hook
PGGAN Fetch Data Hook.
- Parameters
interval (int, optional) – The interval of calling this hook. If set to -1, the visualization hook will not be called. Defaults to 1.
- before_train_iter(runner, batch_idx: int, data_batch: DATA_BATCH = None) None [source]¶
All subclasses should override this method, if they need any operations before each training iteration.
- Parameters
runner (Runner) – The runner of the training process.
batch_idx (int) – The index of the current batch in the train loop.
data_batch (dict or tuple or list, optional) – Data from dataloader.
- update_dataloader(dataloader: torch.utils.data.dataloader.DataLoader, curr_scale: int) Optional[torch.utils.data.dataloader.DataLoader] [source]¶
Update the data loader.
- Parameters
dataloader (DataLoader) – The dataloader to be updated.
curr_scale (int) – The current scale of the generated image.
- Returns
- The updated dataloader. If the dataloader do
not need to update, return None.
- Return type
Optional[DataLoader]