-
大小: 3KB文件類型: .zip金幣: 1下載: 0 次發(fā)布日期: 2021-01-06
- 語言: Python
- 標(biāo)簽: TensorFlow??Python??
資源簡介
使用TensorFlow實現(xiàn)簡單的手寫數(shù)字0-9識別,下載后解壓配置環(huán)境運行。
代碼片段和文件信息
#?softmax_1.py
#?添加娟娟神經(jīng)網(wǎng)絡(luò)
from?tensorflow.examples.tutorials.mnist?import?input_data
import?matplotlib.pyplot?as?plt
import?tensorflow?as?tf
import?numpy?as?np
import?os
os.environ[‘TF_CPP_MIN_LOG_LEVEL‘]?=?‘2‘
mnist?=?input_data.read_data_sets(‘MNIST_data‘?one_hot=True)
sess?=?tf.InteractiveSession()
x?=?tf.placeholder(“float“?shape=[None?784])
y_?=?tf.placeholder(“float“?shape=[None?10])
W?=?tf.Variable(tf.zeros([78410]))
b?=?tf.Variable(tf.zeros([10]))
y?=?tf.nn.softmax(tf.matmul(xW)?+?b)
#?卷積神經(jīng)網(wǎng)絡(luò)
def?weight_variable(shape):
??initial?=?tf.truncated_normal(shape?stddev=0.1)
??return?tf.Variable(initial)
def?bias_variable(shape):
??initial?=?tf.constant(0.1?shape=shape)
??return?tf.Variable(initial)
def?conv2d(x?W):
??return?tf.nn.conv2d(x?W?str
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????3261??2018-05-20?12:18??softmax_1.py
?????文件????????3408??2018-05-20?12:18??softmax_regresession.py
評論
共有 條評論