Add orx-gradient-descent

This commit is contained in:
Edwin Jakobs
2019-09-19 16:18:19 +02:00
parent e2d62e1b02
commit 6eec2919f9
5 changed files with 254 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import org.spekframework.spek2.Spek
import org.spekframework.spek2.style.specification.describe
object TestMinimize : Spek({
describe("a simple 1d function") {
fun parabola(x: DoubleArray): Double {
return (x[0]+1) * (x[0]+1)
}
it("it can be minimized") {
val result = minimize(doubleArrayOf(10.0), f = ::parabola)
println(result.solution[0])
}
}
})