code: def step(self):
      assert self._cur_step is not None
      if self._cur_step >= self.num_steps:
          return
      if self._cur_step == 0:
          self._info("Running...")
  
      # Hyperparameters.
      t = self._cur_step / self.num_steps
      noise_strength = (
          self._dlatent_std
          * self.initial_noise_factor
          * max(0.0, 1.0 - t / self.noise_ramp_length) ** 2
      )
      lr_ramp = min(1.0, (1.0 - t) / self.lr_rampdown_length)
      lr_ramp = 0.5 - 0.5 * np.cos(lr_ramp * np.pi)
      lr_ramp = lr_ramp * min(1.0, t / self.lr_rampup_length)
      learning_rate = self.initial_learning_rate * lr_ramp
  
      # Train.
      feed_dict = {
          self._noise_in: noise_strength,
          self._lrate_in: learning_rate,
      }
      _, dist_value, loss_value = tflib.run(
          [self._opt_step, self._dist, self._loss], feed_dict
      )
      tflib.run(self._noise_normalize_op)
  
      # Print status.
      self._cur_step += 1
      if self._cur_step == self.num_steps or self._cur_step % 10 == 0:
          self._info(
              "%-8d%-12g%-12g"
              % (self._cur_step, dist_value, loss_value)
          )
      if self._cur_step == self.num_steps:
          self._info("Done.")
  
file_path: insightface/reconstruction/ostec/external/stylegan2/projector.py
imports: import numpy
  import tensorflow
  import dnnlib
  import dnnlib.tflib
  from training import misc
label_desc: Use image node_id 6 for calling the Projector obj's underlying member method code with example usage: obj.step() without return types