class_docstr: Define how to apply SVD algorithm.
  
  This periodic update and scheduling base SVD algorithm update the original
  weights to make lower rank by SVD for each update_freq steps. During the
  warmup steps, It adjust the rank from the original to target rank gradually.
class_docstr_tok: ["Define","how","to","apply","SVD","algorithm",".","This","periodic","update","and","scheduling","base","SVD","algorithm","update","the","original","weights","to","make","lower","rank","by","SVD","for","each","update_freq","steps",".","During","the","warmup","steps",",","It","adjust","the","rank","from","the","original","to","target","rank","gradually","."]
docstr: Model developer API for optimizing a model for training.
  
  The returned model should be used for compression aware training.
  Args:
    to_optimize: The model to be optimize.
  Returns:
    A wrapped model that has compression optimizers.
docstr_tok: ["Model","developer","API","for","optimizing","a","model","for","training",".","The","returned","model","should","be","used","for","compression","aware","training",".","Args",":","to_optimize",":","The","model","to","be","optimize",".","Returns",":","A","wrapped","model","that","has","compression","optimizers","."]
code: def optimize_model(
      self, to_optimize: tf.keras.Model
  ) -> tf.keras.Model:
      """Model developer API for optimizing a model for training.
  
      The returned model should be used for compression aware training.
      Args:
        to_optimize: The model to be optimize.
      Returns:
        A wrapped model that has compression optimizers.
      """
      # pylint: disable=protected-access
      if (
          not isinstance(to_optimize, tf.keras.Sequential)
          and not to_optimize._is_graph_network
      ):
          raise ValueError(
              "`optimize_model` can only either be a tf.keras Sequential or "
              "Functional model."
          )
      # pylint: enable=protected-access
  
      def _optimize_layer(layer):
          # Require layer to be built so that the SVD-factorized weights
          # can be initialized from the weights.
          if not layer.built:
              raise ValueError(
                  "Applying SVD currently requires passing in a built model"
              )
  
          return algorithm.create_layer_for_training(
              layer, algorithm=self
          )
  
      return tf.keras.models.clone_model(
          to_optimize, clone_function=_optimize_layer
      )
  
file_path: model-optimization/tensorflow_model_optimization/python/core/common/keras/compression/algorithms/periodical_update_and_scheduling.py
imports: from typing import List
  import tensorflow
  from tensorflow_model_optimization.python.core.common.keras.compression import algorithm
label_desc: Use image node_id 7 for calling the SVD obj's underlying member method code with example usage: obj.optimize_model(to_optimize) and returns: tf, algorithm