- 因爲leaky_relu不支持字符形式,即
# this is wriong
tf.layers.Dense(units,activation='leaky_relu')
# right operation
import tensorflow as tf
from functools import partial
output = tf.layers.dense(input, n_units, activation=partial(tf.nn.leaky_relu, alpha=0.01))