We proceed with the recipe as follows:
- The first thing we decide is the optimizer that we want. TensorFlow provides you with a wide variety of optimizers. We start with the most popular and simple one, the gradient descent optimizer:
tf.train.GradientDescentOptimizer(learning_rate)
- The learning_rate argument to GradientDescentOptimizer can be a constant or tensor. Its value can lie between 0 and 1.
- The optimizer must be told about the function to be optimized. This is done using its method, minimize. This method computes the gradients and applies the gradients to learning coefficients. The function as defined in TensorFlow docs is the following:
minimize( loss, global_step=None, var_list=None, gate_gradients=GATE_OP, ...