class_docstr: Optimizer that implements the Conditional Gradient optimization.
  
  This optimizer helps handle constraints well.
  
  Currently only supports frobenius norm constraint or nuclear norm
  constraint.
  See https://arxiv.org/pdf/1803.06453.pdf
  
  ```
  variable -= (1-learning_rate) * (variable + lambda_ * gradient
      / (frobenius_norm(gradient) + epsilon))
  ```
  
  Note that `lambda_` here refers to the constraint "lambda" in
  the paper. `epsilon` is constant with tiny value as compared to
  the value of frobenius norm of gradient. The purpose of `epsilon`
  here is to avoid the case that the value of frobenius norm of
  gradient is 0.
  
  In this implementation, `epsilon` defaults to $10^{-7}$.
  
  For nucler norm constraint, the formula is as following:
  
  ```
  variable -= (1-learning_rate) * (variable
      + lambda_ * top_singular_vector(gradient))
  ```
class_docstr_tok: ["Optimizer","that","implements","the","Conditional","Gradient","optimization",".","This","optimizer","helps","handle","constraints","well",".","Currently","only","supports","frobenius","norm","constraint","or","nuclear","norm","constraint",".","See","https",":","\/\/arxiv.org\/pdf\/1803.06453.pdf","``","`","variable","-=","(","1-learning_rate",")","*","(","variable","+","lambda_","*","gradient","\/","(","frobenius_norm","(","gradient",")","+","epsilon",")",")","``","`","Note","that","`","lambda_","`","here","refers","to","the","constraint","``","lambda","''","in","the","paper",".","`","epsilon","`","is","constant","with","tiny","value","as","compared","to","the","value","of","frobenius","norm","of","gradient",".","The","purpose","of","`","epsilon","`","here","is","to","avoid","the","case","that","the","value","of","frobenius","norm","of","gradient","is","0",".","In","this","implementation",",","`","epsilon","`","defaults","to","$","10^","{","-7","}","$",".","For","nucler","norm","constraint",",","the","formula","is","as","following",":","``","`","variable","-=","(","1-learning_rate",")","*","(","variable","+","lambda_","*","top_singular_vector","(","gradient",")",")","``","`"]
code: def _resource_apply_dense(self, grad, var, apply_state=None):
      var_device, var_dtype = var.device, var.dtype.base_dtype
      coefficients = (apply_state or {}).get(
          (var_device, var_dtype)
      ) or self._fallback_apply_state(var_device, var_dtype)
      lr = coefficients["learning_rate"]
      lambda_ = coefficients["lambda_"]
      epsilon = coefficients["epsilon"]
      if self.ord == "fro":
          norm = tf.convert_to_tensor(
              self._frobenius_norm(grad),
              name="norm",
              dtype=var.dtype.base_dtype,
          )
          s = grad / (norm + epsilon)
      else:
          top_singular_vector = tf.convert_to_tensor(
              self._top_singular_vector(grad),
              name="top_singular_vector",
              dtype=var.dtype.base_dtype,
          )
          s = top_singular_vector
  
      var_update = tf.math.multiply(var, lr) - (1 - lr) * lambda_ * s
      return var.assign(var_update, use_locking=self._use_locking)
  
file_path: addons/tensorflow_addons/optimizers/conditional_gradient.py
imports: import tensorflow
  from tensorflow_addons.optimizers import KerasLegacyOptimizer
  from tensorflow_addons.utils.types import FloatTensorLike
  from typeguard import typechecked
  from typing import Union, Callable
label_desc: Use image node_id 7 for calling the ConditionalGradient obj's underlying member method code with example usage: obj._resource_apply_dense(grad, var, apply_state) and returns: var