資源簡介

代碼片段和文件信息
#%%
#?Copyright?2015?The?TensorFlow?Authors.?All?Rights?Reserved.
#
#?Licensed?under?the?Apache?License?Version?2.0?(the?“License“);
#?you?may?not?use?this?file?except?in?compliance?with?the?License.
#?You?may?obtain?a?copy?of?the?License?at
#
#?????http://www.apache.org/licenses/LICENSE-2.0
#
#?Unless?required?by?applicable?law?or?agreed?to?in?writing?software
#?distributed?under?the?License?is?distributed?on?an?“AS?IS“?BASIS
#?WITHOUT?WARRANTIES?OR?CONDITIONS?OF?ANY?KIND?either?express?or?implied.
#?See?the?License?for?the?specific?language?governing?permissions?and
#?limitations?under?the?License.
#?==============================================================================
from?tensorflow.examples.tutorials.mnist?import?input_data
mnist?=?input_data.read_data_sets(“MNIST_data/“?one_hot=True)
print(mnist.train.images.shape?mnist.train.labels.shape)
print(mnist.test.images.shape?mnist.test.labels.shape)
print(mnist.validation.images.shape?mnist.validation.labels.shape)
import?tensorflow?as?tf
sess?=?tf.InteractiveSession()
x?=?tf.placeholder(tf.float32?[None?784])
W?=?tf.Variable(tf.zeros([784?10]))
b?=?tf.Variable(tf.zeros([10]))
y?=?tf.nn.softmax(tf.matmul(x?W)?+?b)
y_?=?tf.placeholder(tf.float32?[None?10])
cross_entropy?=?tf.reduce_mean(-tf.reduce_sum(y_?*?tf.log(y)?reduction_indices=[1]))
train_step?=?tf.train.GradientDescentOptimizer(0.5).minimize(cross_entropy)
tf.global_variables_initializer().run()
for?i?in?range(1000):
????batch_xs?batch_ys?=?mnist.train.next_batch(100)
????train_step.run({x:?batch_xs?y_:?batch_ys})
correct_prediction?=?tf.equal(tf.argmax(y?1)?tf.argmax(y_?1))
accuracy?=?tf.reduce_mean(tf.cast(correct_prediction?tf.float32))
print(accuracy.eval({x:?mnist.test.images?y_:?mnist.test.labels}))
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????841??2017-04-20?10:35??解壓密碼.txt
?????文件???????1784??2017-03-18?21:48??TensorFlow實戰代碼——黃文堅\TensorFlow實戰代碼\3_2?HelloWorld.py
?????文件???????5792??2017-03-18?21:46??TensorFlow實戰代碼——黃文堅\TensorFlow實戰代碼\4_2?AutoEncoer.py
?????文件???????1992??2017-03-18?21:49??TensorFlow實戰代碼——黃文堅\TensorFlow實戰代碼\4_4?MLP.py
?????文件???????2957??2017-03-18?21:57??TensorFlow實戰代碼——黃文堅\TensorFlow實戰代碼\5_2?CNN_MNIST.py
?????文件???????5745??2017-03-18?21:57??TensorFlow實戰代碼——黃文堅\TensorFlow實戰代碼\5_3?CNN_CIFAR10.py
????.......??????7667??2017-03-18?21:46??TensorFlow實戰代碼——黃文堅\TensorFlow實戰代碼\6_1_AlexNet.py
????.......??????6608??2017-03-18?21:57??TensorFlow實戰代碼——黃文堅\TensorFlow實戰代碼\6_2_VGG.py
????.......?????18116??2017-03-18?21:57??TensorFlow實戰代碼——黃文堅\TensorFlow實戰代碼\6_3_InceptionNet.py
????.......?????17493??2017-03-18?21:58??TensorFlow實戰代碼——黃文堅\TensorFlow實戰代碼\6_4_ResNet.py
????.......??????8950??2017-03-18?21:51??TensorFlow實戰代碼——黃文堅\TensorFlow實戰代碼\7_1_Word2Vec.py
????.......??????9474??2017-03-18?21:50??TensorFlow實戰代碼——黃文堅\TensorFlow實戰代碼\7_2_LSTM.py
????.......??????4521??2017-03-18?21:47??TensorFlow實戰代碼——黃文堅\TensorFlow實戰代碼\7_3_BiRNN.py
????.......??????6861??2017-03-18?21:58??TensorFlow實戰代碼——黃文堅\TensorFlow實戰代碼\8_2_PolicyNetwork.py
????.......??????4481??2017-03-18?21:44??TensorFlow實戰代碼——黃文堅\TensorFlow實戰代碼\8_3_GridWorld.py
????.......??????8766??2017-03-18?21:44??TensorFlow實戰代碼——黃文堅\TensorFlow實戰代碼\8_3_Value_Network.py
????.......??????6503??2017-03-18?21:59??TensorFlow實戰代碼——黃文堅\TensorFlow實戰代碼\9_1_TensorBoard.py
????.......??????8930??2017-03-18?21:50??TensorFlow實戰代碼——黃文堅\TensorFlow實戰代碼\9_2_MultiGPU.py
????.......?????10556??2017-03-18?21:59??TensorFlow實戰代碼——黃文堅\TensorFlow實戰代碼\9_3_Distributed.py
?????文件????????131??2017-04-05?10:33??TensorFlow實戰代碼——黃文堅\TensorFlow實戰代碼\Tensorflow?and?Word2vec.txt
?????目錄??????????0??2017-11-13?21:35??TensorFlow實戰代碼——黃文堅\TensorFlow實戰代碼
?????目錄??????????0??2017-04-20?10:31??TensorFlow實戰代碼——黃文堅
-----------?---------??----------?-----??----
???????????????138168????????????????????22
評論
共有 條評論