Upgrade AutoDiff support of trigonometric ops, also fix some problems with MstAlgebra #140

Merged
CommanderTvis merged 5 commits from autodiff-update into dev 2020-09-20 18:21:37 +03:00
Showing only changes of commit 1b426d79b4 - Show all commits

View File

@ -217,7 +217,7 @@ fun <T : Any, F : ExtendedField<T>> AutoDiffField<T, F>.sinh(x: Variable<T>): Va
derive(variable { sin(x.value) }) { z -> x.d += z.d * cosh(x.value) } derive(variable { sin(x.value) }) { z -> x.d += z.d * cosh(x.value) }
fun <T : Any, F : ExtendedField<T>> AutoDiffField<T, F>.cosh(x: Variable<T>): Variable<T> = fun <T : Any, F : ExtendedField<T>> AutoDiffField<T, F>.cosh(x: Variable<T>): Variable<T> =
derive(variable { cos(x.value) }) { z -> x.d -= z.d * sinh(x.value) } derive(variable { cos(x.value) }) { z -> x.d += z.d * sinh(x.value) }
fun <T : Any, F : ExtendedField<T>> AutoDiffField<T, F>.tanh(x: Variable<T>): Variable<T> = fun <T : Any, F : ExtendedField<T>> AutoDiffField<T, F>.tanh(x: Variable<T>): Variable<T> =
derive(variable { tan(x.value) }) { z -> derive(variable { tan(x.value) }) { z ->