Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ndarray: porting Python's autograd (#274)
Ref: https://github.com/apache/incubator-mxnet/blob/065adb3702c110af7b537799be3ec9c16c27a72b/python/mxnet/autograd.py * API ported * attach_grad * grad * mark_variables * get_symbol * record * pause * train_mode * predict_mode * backward * An example ```julia x = NDArray([1 2; 3 4]) mx.attach_grad!(x) y = mx.record() do mx.square(x) end mx.backward!(y) mx.getgrad(x) # 2×2 Array{Int64,2}: # 2 4 # 6 8 ```
- Loading branch information