You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/07/26 05:03:06 UTC

[GitHub] [incubator-mxnet] kshitij12345 commented on a change in pull request #15109: [DOC] refine autograd docs

kshitij12345 commented on a change in pull request #15109: [DOC] refine autograd docs
URL: https://github.com/apache/incubator-mxnet/pull/15109#discussion_r307589169
 
 

 ##########
 File path: docs/api/python/autograd/autograd.md
 ##########
 @@ -76,7 +82,63 @@ Detailed tutorials are available in Part 1 of
 [the MXNet gluon book](http://gluon.mxnet.io/).
 
 
+# Higher order gradient
+
+Some operators support higher order gradients. Meaning that you calculate the gradient of the
+gradient. For this the operator's backward must be as well differentiable. Some operators support
+differentiating multiple times, and others two, most just once.
+
+For calculating higher order gradients, we can use the `mx.autograd.grad` function while recording
+and then call backward, or call `mx.autograd.grad` two times. If we do the later is important that
+the first call uses `create_graph=True` and `retain_graph=True` and the second call uses
+`create_graph=False` and `retain_graph=True`. Otherwise we will not get the results that we want. If
 
 Review comment:
   So I guess `retain` keeps the intermediate gradient buffer but not the node and `create_graph` keeps the nodes as well?
   Thanks  for the pointer. Will try to look into the imperative.cc.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services