- Mastering TensorFlow 1.x
- Armando Fandango
- 83字
- 2021-06-25 22:50:59
Creating the TFLearn Layers
Let us learn how to create the layers of the neural network models in TFLearn:
- Create an input layer first:
input_layer = tflearn.input_data(shape=[None,num_inputs]
- Pass the input object to create further layers:
layer1 = tflearn.fully_connected(input_layer,10,
activation='relu')
layer2 = tflearn.fully_connected(layer1,10,
activation='relu')
- Add the output layer:
output = tflearn.fully_connected(layer2,n_classes,
activation='softmax')
- Create the final net from the estimator layer such as regression:
net = tflearn.regression(output,
optimizer='adam',
metric=tflearn.metrics.Accuracy(),
loss='categorical_crossentropy'
)
The TFLearn provides several classes for layers that are described in following sub-sections.
推薦閱讀
- Istio入門與實(shí)戰(zhàn)
- 電腦常見問題與故障排除
- 辦公通信設(shè)備維修
- 深入淺出SSD:固態(tài)存儲核心技術(shù)、原理與實(shí)戰(zhàn)
- 單片機(jī)系統(tǒng)設(shè)計(jì)與開發(fā)教程
- 固態(tài)存儲:原理、架構(gòu)與數(shù)據(jù)安全
- 單片機(jī)開發(fā)與典型工程項(xiàng)目實(shí)例詳解
- 無蘋果不生活:OS X Mountain Lion 隨身寶典
- LPC1100系列處理器原理及應(yīng)用
- 電腦組裝與維護(hù)即時(shí)通
- 圖解計(jì)算機(jī)組裝與維護(hù)
- 基于網(wǎng)絡(luò)化教學(xué)的項(xiàng)目化單片機(jī)應(yīng)用技術(shù)
- 筆記本電腦的結(jié)構(gòu)、原理與維修
- 筆記本電腦現(xiàn)場維修實(shí)錄
- 微服務(wù)架構(gòu)實(shí)戰(zhàn):基于Spring Boot、Spring Cloud、Docker