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

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.

主站蜘蛛池模板: 连云港市| 个旧市| 阿城市| 鸡西市| 华亭县| 永嘉县| 布尔津县| 镇平县| 泗阳县| 内丘县| 四川省| 天镇县| 泾阳县| 内江市| 普安县| 阳江市| 若羌县| 易门县| 芜湖市| 保定市| 射阳县| 湟源县| 游戏| 宜阳县| 尼木县| 安康市| 佳木斯市| 凉山| 新乡县| 句容市| 杭州市| 西华县| 阜康市| 安康市| 确山县| 鄂伦春自治旗| 安西县| 磐安县| 徐闻县| 苏尼特右旗| 荃湾区|