-
大小:文件類型: .rar金幣: 1下載: 0 次發(fā)布日期: 2022-02-12
- 語言: 其他
- 標簽: TensorFlow??代碼??電子書??
資源簡介
TensorFlow實戰(zhàn)_黃文堅 高清完整書籍和代碼.rar
代碼片段和文件信息
#%%
#?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}))
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???90940515??2017-12-11?15:42??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼\TensorFlow實戰(zhàn)_黃文堅(完整).pdf
?????文件??????10244??2017-12-11?15:43??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼\TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\.DS_Store
?????文件???????1784??2017-12-11?15:43??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼\TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\3_2_HelloWorld(1).py
?????文件???????5792??2017-12-11?15:43??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼\TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\4_2_AutoEncoer.py
?????文件???????1992??2017-12-11?15:43??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼\TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\4_4_MLP(1).py
?????文件???????2957??2017-12-11?15:43??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼\TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\5_2_CNN_MNIST.py
?????文件???????5745??2017-12-11?15:43??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼\TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\5_3_CNN_CIFAR10.py
?????文件???????7667??2017-12-11?15:43??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼\TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\6_1_AlexNet.py
?????文件???????6608??2017-12-11?15:43??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼\TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\6_2_VGG.py
?????文件??????18116??2017-12-11?15:43??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼\TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\6_3_InceptionNet.py
?????文件??????17493??2017-12-11?15:43??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼\TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\6_4_ResNet.py
?????文件???????8950??2017-12-11?15:43??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼\TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\7_1_Word2Vec.py
?????文件???????9474??2017-12-11?15:43??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼\TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\7_2_LSTM.py
?????文件???????4521??2017-12-11?15:43??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼\TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\7_3_BiRNN.py
?????文件???????6861??2017-12-11?15:43??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼\TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\8_2_PolicyNetwork.py
?????文件???????4481??2017-12-11?15:43??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼\TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\8_3_GridWorld.py
?????文件???????8766??2017-12-11?15:43??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼\TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\8_3_Value_Network.py
?????文件???????6503??2017-12-11?15:43??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼\TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\9_1_TensorBoard.py
?????文件???????8930??2017-12-11?15:43??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼\TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\9_2_MultiGPU.py
?????文件??????10556??2017-12-11?15:42??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼\TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\9_3_Distributed.py
?????文件????????131??2017-12-11?15:42??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼\TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼\Tensorflow?and?Word2vec.txt
?????目錄??????????0??2017-12-11?15:43??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼\TensorFlow實戰(zhàn)代碼\TensorFlow實戰(zhàn)代碼
?????目錄??????????0??2017-12-11?15:42??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼\TensorFlow實戰(zhàn)代碼
?????目錄??????????0??2017-12-11?15:42??TensorFlow實戰(zhàn)_黃文堅?完整書籍和代碼
-----------?---------??----------?-----??----
?????????????91088086????????????????????24
- 上一篇:自動控制原理-胡壽松第六版清晰
- 下一篇:軟件工程導(dǎo)論(第六版)張海藩
評論
共有 條評論