(self, global_step=None)
average model variables, add average_op to UPDATES_OPS
average model variables, add average_op to UPDATES_OPS
average model variables add average_op to UPDATES_OPS
def var_avg(self, global_step=None):
    ''' average model variables, add average_op to UPDATES_OPS'''
    model_avg_conf = self.config['solver']['model_average']
    var_avg_model = model_avg_conf['enable']
    if var_avg_model:
      var_avg_decay = model_avg_conf['var_avg_decay']
      variable_averages = self.get_var_avg_ema(var_avg_decay, global_step)
      apply_op = variable_averages.apply(tf.trainable_variables())
      tf.add_to_collection(tf.GraphKeys.UPDATE_OPS, apply_op)
      utils.log_vars('Avg Trainable Vars', tf.trainable_variables())
def var_avg ( self , global_step = None ) : model_avg_conf = self . config [ 'solver' ] [ 'model_average' ] var_avg_model = model_avg_conf [ 'enable' ] if var_avg_model : var_avg_decay = model_avg_conf [ 'var_avg_decay' ] variable_averages = self . get_var_avg_ema ( var_avg_decay , global_step ) apply_op = variable_averages . apply ( tf . trainable_variables ( ) ) tf . add_to_collection ( tf . GraphKeys . UPDATE_OPS , apply_op ) utils . log_vars ( 'Avg Trainable Vars' , tf . trainable_variables ( ) )