class_docstr: Style-based GAN
  Reference:
  
      Tero Karras, Samuli Laine, Timo Aila. "A Style-Based Generator 
      Architecture for Generative Adversarial Networks." *CVPR*, 2019
class_docstr_tok: ["Style-based","GAN","Reference",":","Tero","Karras",",","Samuli","Laine",",","Timo","Aila",".","``","A","Style-Based","Generator","Architecture","for","Generative","Adversarial","Networks",".","''","*","CVPR","*",",","2019"]
code: def hybrid_forward(
      self,
      F,
      x,
      step=0,
      alpha=-1,
      noise=None,
      mean_style=None,
      style_weight=0,
      mixing_range=(-1, -1),
  ):
      styles = []
  
      if type(x) not in (list, tuple):
          x = [x]
  
      for i in x:
          styles.append(self.style(i))
  
      batch = x[0].shape[0]
  
      if noise is None:
          noise = []
  
          for i in range(step + 1):
              size = 4 * 2**i
              noise.append(
                  nd.random.randn(
                      batch, 1, size, size, ctx=x[0].context
                  )
              )
  
      if mean_style is not None:
          styles_norm = []
  
          for style in styles:
              styles_norm.append(
                  mean_style + style_weight * (style - mean_style)
              )
  
          styles = styles_norm
  
      nd_styles = nd.empty(
          (len(styles), styles[0].shape[0], styles[0].shape[1])
      )
  
      for i, style in enumerate(styles):
          nd_styles[i] = style
  
      return self.generator(nd_styles, noise, step, alpha, mixing_range)
  
file_path: gluon-cv/scripts/gan/stylegan/model.py
imports: import random
  import numpy
  from math import sqrt
  import mxnet
  import mxnet.ndarray
  from modules import *
label_desc: Use image node_id 2 for calling the StyledGenerator obj's underlying member method code with example usage: obj.hybrid_forward(F, x, step, alpha, noise, mean_style, style_weight, mixing_range) and returns: self