human
I am working on the file "00_Miscellaneous/tfx/01_tf_estimator_deepdive.ipynb".
The first task is:
9. Adaptive learning rate

exponential_decay
consine_decay
linear_cosine_decay
consine_decay_restarts
polynomial decay
piecewise_constant_decay
Can you write Python program for it?

=====
What is a the Python program you requested?
assistant
#Here is the Python program you requested.

def create_estimator(params, run_config):
  
  wide_columns, deep_columns = create_feature_columns()
  
  def _update_optimizer(initial_learning_rate, decay_steps):
    
    # learning_rate = tf.train.exponential_decay(
    #   initial_learning_rate,
    #   global_step=tf.train.get_global_step(),
    #   decay_steps=decay_steps,
    #   decay_rate=0.9
    # )

    learning_rate = tf.train.cosine_decay_restarts(
      initial_learning_rate,
      tf.train.get_global_step(),
      first_decay_steps=50,
      t_mul=2.0,
      m_mul=1.0,
      alpha=0.0,
    )

    tf.summary.scalar('learning_rate', learning_rate)

    return tf.train.AdamOptimizer(learning_rate=learning_rate)
    
  estimator = tf.estimator.DNNLinearCombinedClassifier(

    n_classes=len(TARGET_LABELS),
    label_vocabulary=TARGET_LABELS,
    weight_column=WEIGHT_COLUMN_NAME,

    dnn_feature_columns=deep_columns,
    dnn_optimizer=lambda: _update_optimizer(params.learning_rate, params.max_steps),
    dnn_hidden_units=params.hidden_units,
    dnn_dropout=params.dropout,
    batch_norm=True,
    
    linear_feature_columns=wide_columns,
    linear_optimizer='Ftrl',
    
    config=run_config
  )
  
  return estimator

params.learning_rate = 0.1
params.max_steps = 1000
run_config = tf.estimator.RunConfig(
    tf_random_seed=RANDOM_SEED,
    save_checkpoints_steps=200,
    model_dir=model_dir,
)

if COLAB:
  from tensorboardcolab import *
  TensorBoardColab(graph_path=model_dir)

estimator = create_estimator(params, run_config)
run_experiment(estimator, params, run_config)