lost-损失，acc-准确率

1.使用训练过程中，lost值会先减小，然后会一直增大，而acc值却在一直上升
2.使用prelu神经元，lost值增大更快，acc值训练时间长会降低
3.使用elu神经元与prelu神经元相比，elu神经元lost增大更缓慢，acc值能持续增大，prelu神经元的acc值后期会下降

import tensorflow as tf import tensorlayer as tl sess = tf.InteractiveSession()
# 准备数据 X_train, y_train, X_val, y_val, X_test, y_test =
tl.files.load_mnist_dataset(shape=(-1,784)) # 定义 placeholder x =
tf.placeholder(tf.float32, shape=[None,784], name='x') y_ = tf.placeholder(tf.
int64, shape=[None, ], name='y_') # 定义模型 network = tl.layers.InputLayer(x, name=
'input_layer') res_a = network = tl.layers.DenseLayer(network, n_units=200, act
= tf.nn.elu, name='relu1') network = tl.layers.DenseLayer(network, n_units=200,
act = tf.nn.elu, name='relu2') network = tl.layers.DenseLayer(network, n_units=
200, act = tf.nn.elu, name='relu3') res_a = network =
) network = tl.layers.DenseLayer(network, n_units=200, act = tf.nn.elu, name=
'relu4') network = tl.layers.DenseLayer(network, n_units=200, act = tf.nn.elu,
name='relu5') res_a = network = tl.layers.ElementwiseLayer([network, res_a],
n_units=200, act = tf.nn.elu, name='relu6') network =
tl.layers.DenseLayer(network, n_units=200, act = tf.nn.elu, name='relu7') res_a
= network = tl.layers.ElementwiseLayer([network, res_a], combine_fn=tf.add,
name='res_add3') network = tl.layers.DenseLayer(network, n_units=200, act =
tf.nn.elu, name='relu8') network = tl.layers.DenseLayer(network, n_units=200,
act = tf.nn.elu, name='relu9') res_a = network =
) network = tl.layers.DenseLayer(network, n_units=200, act = tf.nn.elu, name=
'relu10') network = tl.layers.DenseLayer(network, n_units=200, act = tf.nn.elu,
name='relu11') res_a = network = tl.layers.ElementwiseLayer([network, res_a],
n_units=10, act = tf.identity, name='output_layer') # 定义损失函数和衡量指标 #
tl.cost.cross_entropy 在内部使用 tf.nn.sparse_softmax_cross_entropy_with_logits() 实现
softmax y = network.outputs cost = tl.cost.cross_entropy(y, y_, name = 'cost')
correct_prediction = tf.equal(tf.argmax(y,1), y_) acc =
tf.reduce_mean(tf.cast(correct_prediction, tf.float32)) y_op =
tf.argmax(tf.nn.softmax(y),1) # 定义 optimizer train_params = network.all_params