def soft_update(self, local_model, target_model):
    'Soft update model parameters.'
    local_weights = np.array(local_model.get_weights())
    target_weights = np.array(target_model.get_weights())
    assert (len(local_weights) == len(target_weights)), 'Local and target model parameters must have the same size'
    new_weights = ((self.tau * local_weights) + ((1 - self.tau) * target_weights))
    target_model.set_weights(new_weights)
Soft update model parameters.
def soft_update(self, local_model, target_model):
    
    local_weights = np.array(local_model.get_weights())
    target_weights = np.array(target_model.get_weights())
    assert (len(local_weights) == len(target_weights)), 'Local and target model parameters must have the same size'
    new_weights = ((self.tau * local_weights) + ((1 - self.tau) * target_weights))
    target_model.set_weights(new_weights)