Skip to content

Incorporate experimental differentiation into Swift release toolchains

Notifications You must be signed in to change notification settings

binderh/differentiation

 
 

Repository files navigation

Differentiation

A workaround for enabling differentiation in Swift until the standard library officially supports it. This is not needed in Swift development builds, and it may not reflect the most recent commits to the standard library.

Note: There are bugs in Swift's current implementation of differentiation. Proceed at your own risk.

How to Use

import Differentiation

struct Example: Differentiable {
    var x: Float
}

@differentiable(reverse)
func foo(x: Float) -> Float {
    ...
}

Demonstration

This package was been used in an iOS sample project to find velocity from physics equations.

About

Incorporate experimental differentiation into Swift release toolchains

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 73.7%
  • Python 26.3%