import tensorflow as tf
import get_Dataset
import numpy as np
x_train, y_train, x_test, y_test = get_Dataset.get_Dataset('mnist')
batch_size = 100
x = tf.placeholder(tf.float32, shape=[None, 784])
y = tf.placeholder(tf.float32, shape=[None, 10])
y_ = tf.placeholder(tf.int64, shape=[1, None])
w_l1 = tf.Variable(tf.random_normal([784, 200], dtype=tf.float32))
biase_l1 = tf.Variable(tf.random_normal([200], dtype=tf.float32))
z_l1 = tf.matmul(x, w_l1) + biase_l1
a_l1 = tf.nn.tanh(z_l1)
w_l2 = tf.Variable(tf.random_normal([200, 10], dtype=tf.float32))
biase_l2 = tf.Variable(tf.random_normal([10], dtype=tf.float32))
z_l2 = tf.matmul(a_l1, w_l2) + bia
MNIST本地加载,简单神经网络,run练习
最新推荐文章于 2023-10-17 10:16:40 发布
本文档介绍了如何在本地加载MNIST数据集,并实现一个简单的神经网络进行手写数字识别的训练和运行。通过这次练习,读者可以深入理解神经网络的基本原理和流程。
摘要由CSDN通过智能技术生成