Take a look at the train_model.py file in the models/tutorial/rnn/quickdraw folder. When it starts to run, an Estimator instance gets created in the create_estimator_and_specs function:
estimator = tf.estimator.Estimator( model_fn=model_fn, config=run_config, params=model_params)
The key parameter passed to the Estimator class is a model function called model_fn that defines:
- Functions to get the input tensor and create convolutional, RNN, and final layers
- Code to call those functions to build the model
- The loss, optimizer, and prediction
Before returning a tf.estimator.EstimatorSpec instance, the model_fn function also has a parameter called mode which can have one of the following three ...