mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

Gradient reversal layer without custom operator

Open wellner opened this issue 10 years ago • 4 comments

I'm looking to implement unsupervised transfer learning architectures based on "gradient reversal" http://arxiv.org/abs/1505.07818 . The idea is outlined nicely in this graphic from the paper:

screen shot 2016-08-23 at 9 54 08 am

Any ideas on how to implement this approach without defining a custom gradient reversal operator/layer? I'd prefer to use the Scala-Package which doesn't have support for custom layers yet.

wellner avatar Aug 23 '16 14:08 wellner

use negative learning rate for some layers?

piiswrong avatar Aug 23 '16 23:08 piiswrong

Ah, I think I can see how to do that via a combination of shared weights and explicitly setting learning rates (negative). Thanks!!

wellner avatar Aug 24 '16 17:08 wellner

I implemented this as custom operator currently, however I think this would be of interest to others. Would it make sense to implement it in Cpp as a standard or contrib operator? If yes I can PR it.

ifeherva avatar Dec 12 '18 01:12 ifeherva

Hi @ifeherva, thanks for the work you've done in making a gradient reversal layer! Do you know how I can use it while using MX-net as my backend for Keras?

gspell avatar Jun 17 '20 23:06 gspell