(self)
添加更新算子到model.metrics_updates。
添加更新算子到model.metrics_updates。
添加更新算子到model . metrics_updates。
def inject(self):
        """添加更新算子到model.metrics_updates。
        """
        self.initialize()
        for w1, w2 in zip(self.ema_weights, self.model.weights):
            op = K.moving_average_update(w1, w2, self.momentum)
            self.model.metrics_updates.append(op)
def inject ( self ) : self . initialize ( ) for w1 , w2 in zip ( self . ema_weights , self . model . weights ) : op = K . moving_average_update ( w1 , w2 , self . momentum ) self . model . metrics_updates . append ( op )