Skip to content

Automatic Differentiation framework for Scala

Notifications You must be signed in to change notification settings

SemanticBeeng/scalaad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scalaad

Automatic differentiation for Scala

Use

import com.kogecoo.scalaad.graph.Var  // always need to import
import com.kogecoo.scalaad.ScalarRule.Implicits._  // when x is a scalar variable

val x = Var(5.0)
val y = 2 * x + 3 * x * y

// forward-mode automatic differentiation
// partial differentiation w.r.t x
println(y.deriv(x))

// reverse-mode automatic differentiation computes a gradient
println(y.grad())

// we can get partial differentiation through `gradient` after running grad()
println(x.gradient)
println(y.gradient)

TODO

  • test
  • make it to be multiple package
  • exclude Nd4jRule and BreezeRule to other package
  • maven repo

Reference

About

Automatic Differentiation framework for Scala

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages