Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a DropConnect layer in Keras? [closed]

Tags:

python

keras

I came across an implementation of DropConnect layer in TensorLayer: http://tensorlayer.readthedocs.io/en/latest/modules/layers.html but I need a Keras equivalent. Are there any implementations for DropConnect on Keras? If not, can any existing Keras layers be converted to DropConnect?

like image 275
Prateek Dewan Avatar asked May 26 '17 10:05

Prateek Dewan


2 Answers

As of keras 2.0.6 No the is no DropConnect layer. Though it would be better to have one. Here's the link to the documentation https://keras.io/layers/core/ As soon as they have one it will be updated in there. Also no existing layers can be converted to DropConnect. Hope they add in future soon.

like image 86
WaterRocket8236 Avatar answered Oct 04 '22 22:10

WaterRocket8236


Currently there is no official Keras implementation of DropConnect layer, but you can use the implementation from this github: https://github.com/andry9454/KerasDropconnect.
There they explain how to use their code.
The DropConnect classes are in ddrop/layers.py.
So basically they've created the custom Keras Dense-layer (class that extends the Dense layer) and implements "dropping" of weights and also a custom Keras layer-wrapper which you can use.
I've used only the wrapper, I've tried the extended Dense layer but it looks like it has some fixable issues...
I'm not sure if the wrapper works for layers that aren't Dense layers, you can try it...

like image 20
Master M Avatar answered Oct 04 '22 23:10

Master M