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

  • 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:

  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.

主站蜘蛛池模板: 嘉祥县| 抚顺县| 泰顺县| 桂东县| 崇仁县| 宜黄县| 东光县| 镇坪县| 清远市| 嘉善县| 平昌县| 鄂托克前旗| 永顺县| 无锡市| 天柱县| 容城县| 日喀则市| 剑川县| 义乌市| 天峨县| 科技| 陆河县| 志丹县| 北安市| 驻马店市| 清河县| 左云县| 巢湖市| 三穗县| 周至县| 阿合奇县| 东宁县| 吉林省| 新民市| 林西县| 阿坝| 内丘县| 本溪| 克拉玛依市| 屯门区| 巴中市|