- 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.
推薦閱讀
- 零點起飛學(xué)Xilinx FPG
- 深入理解Spring Cloud與實戰(zhàn)
- Mastering Delphi Programming:A Complete Reference Guide
- 深入淺出SSD:固態(tài)存儲核心技術(shù)、原理與實戰(zhàn)
- 從零開始學(xué)51單片機C語言
- Large Scale Machine Learning with Python
- 筆記本電腦維修300問
- 微控制器的應(yīng)用
- 主板維修實踐技術(shù)
- Arduino案例實戰(zhàn)(卷Ⅳ)
- 快·易·通:2天學(xué)會電腦組裝·系統(tǒng)安裝·日常維護與故障排除
- Nagios系統(tǒng)監(jiān)控實踐(原書第2版)
- FPGA進階開發(fā)與實踐
- Machine Learning Projects for Mobile Applications
- 電腦軟硬件維修寶典