Tensorlayer神经网络基本定义结构

  • 首先:
network = tf.layers.InputLayer(x, name = 'input_layer')
  • 然后:
conv:
     network = .....
fc:
     network = FlattenLayer(network, name='flatten')
     network = DenseLayer(network, n_units=1024, act=tf.nn.relu, name='fc1')
     network = DenseLayer(network, n_units=1024, act=tf.nn.relu, name='fc2')
     network = DenseLayer(network, n_units=2, act=tl.activation.identity, name='fc3')

最后:

y = network.outputs
logit = tf.nn.softmax(y)

输出预测logit值

你可能感兴趣的:(Tensorlayer神经网络基本定义结构)