Does this really have auto diff?
See original GitHub issueI saw that for
//============================================
// Loss functions
case class SoftmaxLoss(actual: Variable, target: Variable) extends Function {
val x: Tensor = actual.data
val y: Tensor = target.data.T
val shiftedLogits: Tensor = x - ns.max(x, axis = 1)
val z: Tensor = ns.sum(ns.exp(shiftedLogits), axis = 1)
val logProbs: Tensor = shiftedLogits - ns.log(z)
val n: Int = x.shape.head
val loss: Double = -ns.sum(logProbs(ns.arange(n), y)) / n
override def forward(): Variable = Variable(Tensor(loss), Some(this))
override def backward(gradOutput: Variable /* not used */ ): Unit = {
val dx = ns.exp(logProbs)
dx(ns.arange(n), y) -= 1
dx /= n
actual.backward(Variable(dx))
}
}
the backward is manually implemented,which should have been automatically derived
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
autodiff
autodiff is a C++17 library that uses modern and advanced programming techniques to enable automatic computation of derivatives in an efficient, easy, and ......
Read more >Automatic differentiation - Wikipedia
Automatic differentiation is distinct from symbolic differentiation and numerical differentiation. Symbolic differentiation faces the difficulty of converting ...
Read more >Differential Blood Count: Procedure and Results - WebMD
A differential blood count is a test that measures your white blood cell. Learn more about why it's done, reference ranges, and more....
Read more >What is Automatic Differentiation? - YouTube
This short tutorial covers the basics of automatic differentiation, a set of techniques that allow us to efficiently compute derivatives of ...
Read more >Complete Blood Count with Differential - Health Encyclopedia
This test is known as red cell distribution width (RDW, RDW-CV, or RDW-SD). For instance, you may have greater differences in red blood...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Implicitly, I think so, yes. The README has a detailed description of how auto diff works. It’s all about Variables and Functions.
thanks,it works! Is auto diff in this project implemented with tape based mechanism?