Skip to content

Keras implementation of a gradient reversal layer for the Tensorflow backend

License

Notifications You must be signed in to change notification settings

ccarliu/gradient_reversal_keras_tf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Gradient Reversal Layer for Keras

Keras implementation of a gradient inversion layer for the Tensorflow backend, following the paper Domain-Adversarial Training of Neural Networks. Modified the Theano version by Pumpikano found here, expanding on the work done by VanushVaswani found here.

The layer can be placed in a Functional model such as:

Flip = flipGradientTF.GradientReversal(hp_lambda)
dann_in = Flip(previous_layer_output)
dann_out = Dense(2)(dann_in)

where hp_lambda is the constant which multiplies the flipped gradient.

An example of a model where this is implemented (with full code) can be found here: https://github.com/michetonu/DA-RNN_manoeuver_anticipation

About

Keras implementation of a gradient reversal layer for the Tensorflow backend

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%