一、Estimator简介
Estimator是一种可极大地简化机器学习编程的高阶 TensorFlow API。它提供了对较低级别Tensorflow核心操作的高级抽象。
Keras也是它抽象化了深度学习模型组件,如层 layers, 激活函数activation functions 和优化器optimizers,使开发人员更容易使用。
二、Estimator案例参考
手写数字识别的写法参考
import tensorflow as tf
(x_train, y_train),(x_test, y_test) = tf.keras.datasets.mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0
estimator = tf.keras.estimator.model_to_estimator(model, model_dir='./estimator_dir')
BATCH_SIZE = 32
def tra