MNIST dataset
1.Summarization
2.loading
import tensorflow as tf
mnist = tf.keras.datasets.mnist
(x_train, y_train),(x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0
model = tf.keras.models.Sequential([
tf.keras.layers.Flatten(),
tf.keras.layers.Dense(512, activation=tf.nn.relu),
tf.keras.layers.Dropout(0.2),
tf.keras.layers.Dense(10, activation=tf.nn.softmax)
])
model.compile(optimizer='adam',
loss='sparse_categorical_crossentropy',
metrics=['accuracy'])
model.fit(x_train, y_train, epochs=5)
model.evaluate(x_test, y_test)
the Result
Cloud TPU
Tensor Processing Unit
It is a ASIC specially designed for machine learning and TensorFlow customization (integrated circuit chip technology). The TPU is a programmable AI accelerator that provides high throughput, low precision calculations (such as 8 bits), oriented to use or run models rather than training models.
它是一个专门为机器学习和TensorFlow定制的ASIC(集成电路芯片技术)。TPU是一个可编程的人工智能加速器,提供高吞吐量的低精度计算(如8位),面向使用或运行模型而不是训练模型。
The Unknown Word
The First Column | The second Column |
---|---|
domain-specific handware | 领域定制硬件 |
TPU | Tensor Processing Unit张量处理单元 |
Tensor | 张量,代表了N维数组 |
Flow | 流,代表了基于数据流图的计算 |
customization | 定制 |
low precision | 低精度 |
precision | [pri'sigen]精度 |