Keras中是否有DropConnect层?

问题描述 投票:9回答:3

我在TensorLayer中遇到了DropConnect层的实现:http://tensorlayer.readthedocs.io/en/latest/modules/layers.html但我需要Keras等价物。在Keras上有DropConnect的实现吗?如果没有,是否可以将任何现有的Keras层转换为DropConnect?

python keras
3个回答
1
投票

从keras 2.0.6开始,没有DropConnect层。虽然最好有一个。这里是文档https://keras.io/layers/core/的链接一旦有了文档,它就会在那里更新。此外,现有图层也无法转换为DropConnect。希望他们很快就能加入。


0
投票

here是将TensorLayer和Keras结合使用的简单方法,因此您无需重新实现Keras中的dropconnect层。


0
投票

您可以使用Lambda图层转换tf实现。

Using Tensorflow Layers in Keras

https://nickcdryan.com/2017/06/13/dropconnect-implementation-in-python-and-tensorflow/

def dropConnect(x):
    return tf.nn.dropout(x, rate = 1 - p) * p
model.add(Lambda(dropConnect))   
© www.soinside.com 2019 - 2024. All rights reserved.