def lrelu(x, leak=0.2, name="lrelu"):
"""Leaky rectifier.
"""
with tf.variable_scope(name):
f1 = 0.5 * (1 + leak)
f2 = 0.5 * (1 - leak)
return f1 * x + f2 * abs(x)
# load CIFAR-10
# trainx, trainy = cifar10_data.load(args.data_dir, subset='train')
# trainx = trainx.transpose(0, 2, 3, 1)
# trainx_unl = trainx.copy()
# trainx_unl2 = trainx.copy()
# testx, testy = cifar10_data.load(args.data_dir, subset='test')
# testx = testx.transpose(0, 2, 3, 1)
# nr_batches_train = int(trainx.shape[0]/args.batch_size)
# nr_batches_test = int(testx.shape[0]/args.batch_size)
# load MNIST data
train_mnist_feature_matching_tf.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录