Open nile649 opened 5 years ago
It is mixing regularization in the paper. Mixing regularization makes model robust when more than 1 latent code used for generation. (style mixing.)
Thankyou
could you also explain what is inject_index and crossover do.
if len(style) < 2:
inject_index = [len(self.progression) + 1]
else:
inject_index = random.sample(list(range(step)), len(style) - 1)
crossover = 0
for i, (conv, to_rgb) in enumerate(zip(self.progression, self.to_rgb)):
if mixing_range == (-1, -1):
if crossover < len(inject_index) and i > inject_index[crossover]:
crossover = min(crossover + 1, len(style))
style_step = style[crossover]
To do mixing regularization, you should choice some layers (index), and use secondary latent codes after that layer. inject_index and crossover is for implement this.
style_step = style[crossover] gives learned style from latent code, rather layer where one need to mix.
I am sorry, I am very much stuck on the same line.
Yes, it works by get style codes using index of layers and inject it to that layer.