Created
          January 28, 2018 03:19 
        
      - 
      
- 
        Save cavaunpeu/43dad7900050891a34ba8f902b24ed0f to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # halp? | |
| def foo(x, y): | |
| return f(x, y) + g(x, y) | |
| g_foo = grad(foo, argnum=1) | |
| bar = a + b | |
| g_bar = tf.gradients(bar, var_list) | |
| # g_bar == g_foo(x, y) ... TRUE | |
| # Now, changing the respective plus signs to minus signs ... | |
| def foo(x, y): | |
| return f(x, y) - g(x, y) | |
| g_foo = grad(foo, argnum=1) | |
| bar = a - b | |
| g_bar = tf.gradients(bar, var_list) | |
| # g_bar == g_foo(x, y) ... FALSE | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment