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

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.

主站蜘蛛池模板: 时尚| 鄂伦春自治旗| 定西市| 新蔡县| 东海县| 祁连县| 佛学| 苍南县| 南皮县| 乌苏市| 兴安县| 玉树县| 孝义市| 博罗县| 高雄县| 阜南县| 轮台县| 北碚区| 五大连池市| 神木县| 克什克腾旗| 武鸣县| 全州县| 综艺| 天柱县| 汽车| 凤翔县| 察雅县| 临夏市| 淳化县| 桂阳县| 雷州市| 镇远县| 普定县| 二连浩特市| 肥乡县| 阿图什市| 南康市| 文山县| 岗巴县| 辽宁省|