def mlp_func(self):
func = self._config.get('Functions', 'mlp_func')
if func == 'identity':
return tf.identity
elif func == 'leaky_relu':
return lambda x: tf.maximum(.1*x, x)
else:
return getattr(tf.nn, func)
文章目录