小编Sha*_*wen的帖子

在TensorFlow中实施对抗性训练

我想为我的神经网络实现以下成本函数:

这利用了神经网络的对抗性输入来改进泛化[参考].

具体来说,我遇到了麻烦 部分.在我的TensorFlow图中,我已经定义了作为一项行动.我该怎么喂 除了以外的参数

到目前为止,我发现这样做的唯一方法是定义一个并行网络 与我的原始网络共享权重并传递它 在其feed_dict论点中.如果可能的话,我想避免重新定义我的整个网络.我怎样才能做到这一点?


我的TensorFlow模型写成:

x = tf.placeholder(tf.float32, [None, 32, 32]);
... # A simple neural network
y = tf.add(tf.matmul(h, W1), b1);
cross_entropy = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(y, t));
Run Code Online (Sandbox Code Playgroud)

可能相关:

tf.stop_gradient(输入,名称=无)

停止渐变计算.

......还有更多的东西......

  • 对抗性训练,通过对抗性示例生成过程不会发生反向训练.

https://www.tensorflow.org/versions/r0.7/api_docs/python/train.html#stop_gradient

neural-network tensorflow

6
推荐指数
1
解决办法
1375
查看次数

标签 统计

neural-network ×1

tensorflow ×1