- 首先:
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)
輸出預(yù)測(cè)logit值