(loss, var_list)
return optimizer
Pre-training optimizer.
Pre-training optimizer.
Pre - training optimizer .
def optimizer(loss, var_list):
    """Pre-training optimizer."""
    initial_learning_rate = 0.02
    decay = 0.95
    num_decay_steps = 150
    batch = tf.Variable(0)
    learning_rate = tf.train.exponential_decay(
        initial_learning_rate,
        batch,
        num_decay_steps,
        decay,
        staircase=True
    )
    learning_rate = initial_learning_rate
    optimizer = tf.train.GradientDescentOptimizer(learning_rate).minimize(
        loss,
        global_step=batch,
        var_list=var_list
    )
    return optimizer
def optimizer ( loss , var_list ) : initial_learning_rate = 0.02 decay = 0.95 num_decay_steps = 150 batch = tf . Variable ( 0 ) learning_rate = tf . train . exponential_decay ( initial_learning_rate , batch , num_decay_steps , decay , staircase = True ) learning_rate = initial_learning_rate optimizer = tf . train . GradientDescentOptimizer ( learning_rate ) . minimize ( loss , global_step = batch , var_list = var_list ) return optimizer