官术网_书友最值得收藏!

Creating the TFLearn Layers

Let us learn how to create the layers of the neural network models in TFLearn:

  1. Create an input layer first:
input_layer = tflearn.input_data(shape=[None,num_inputs]
  1. 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')
  1. Add the output layer:
output = tflearn.fully_connected(layer2,n_classes,
activation='softmax')
  1. 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.

主站蜘蛛池模板: 秦安县| 通山县| 安国市| 鸡西市| 佛山市| 长寿区| 新营市| 海阳市| 霞浦县| 临沭县| 上蔡县| 大城县| 肇源县| 永丰县| 巨野县| 体育| 苏尼特左旗| 临夏县| 瑞安市| 堆龙德庆县| 旌德县| 镇雄县| 土默特右旗| 新宁县| 万州区| 永吉县| 卢湾区| 凤山市| 南和县| 句容市| 厦门市| 和田县| 山丹县| 泰宁县| 洛宁县| 石泉县| 开阳县| 长春市| 安徽省| 泸西县| 隆化县|