May 2019
Intermediate to advanced
272 pages
7h 19m
English
Unlike traditional GAN setups, the training loop for the Progressive Growing of GANs methodology requires transitioning from a block of lower resolution to a block of a higher resolution. Given that blocks at lower resolution consume less memory, we can also modify the batch size according to the current block at hand:
while cur_nimg < total_kimg * 1000: # block processing kimg = cur_nimg / 1000.0 phase_idx = int(np.floor((kimg + transition_kimg) / phase_kdur)) phase_idx = max(phase_idx, 0.0) phase_kimg = phase_idx * phase_kdur # update batch size and ones vector if we switched phases if phase_idx_prev < phase_idx: batch_size = MINIBATCH_OVERWRITES[phase_idx] train_iterator = iterate_minibatches(glob_str, batch_size) ones ...
Read now
Unlock full access