Skip to content

Tensorflow: Generalizing Across Domains via Cross-Gradient Training

Notifications You must be signed in to change notification settings

gpascualg/CrossGrad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generalizing Across Domains via Cross-Gradient Training

Tensorflow implementation of the paper Generalizing Across Domains via Cross-Gradient Training.

Usage

The file crossgrad.py contains the base tensorflow implementation with no dependencies (except for tensorflow itself and the util.py supplied in this same repository).

An example of usage can be found in the notebook CrossGrad.ipynb, which requires to run:

Understanding crossgrad function

In crossgrad.py you can find the base function for the model. Its parameters map to the paper ones as (see Figure 2, Algorithm 1):

  • labels_fn: $C_{\theta_l}$
  • latent_fn: $G_{\theta^1_d}$ (defaults to a simple CNN + dense network with final dimension controlled by latent_space_dimensions)
  • domain_fn: $S_{\theta^2_d}$ (defaults to a simple 2-dense network)
  • $x$: As the paper, features
  • domain: $d$
  • labels: $y$
  • epsilon_d: $\epsilon_d$
  • epsilon_l: $\epsilon_l$
  • alpha_d: $\alpha_d$
  • alpha_l: $\alpha_l$
  • params: Not in the paper, some configuration (such as 'summaries' and 'data_format')

About

Tensorflow: Generalizing Across Domains via Cross-Gradient Training

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published