downhill-0.4.0.0: Reverse mode automatic differentiation
Safe HaskellSafe-Inferred
LanguageHaskell2010

Downhill.Grad

Synopsis

Documentation

class (Scalar v ~ Scalar dv, AdditiveGroup (Scalar v), VectorSpace v, VectorSpace dv) => Dual v dv where Source #

Dual of a vector v is a linear map v -> Scalar v.

Minimal complete definition

Nothing

Methods

evalGrad :: dv -> v -> Scalar v Source #

default evalGrad :: (GDual (Scalar v) (Rep v) (Rep dv), Generic dv, Generic v) => dv -> v -> Scalar v Source #

Instances

Instances details
Dual Integer Integer Source # 
Instance details

Defined in Downhill.Grad

Dual Double Double Source # 
Instance details

Defined in Downhill.Grad

Dual Float Float Source # 
Instance details

Defined in Downhill.Grad

Num a => Dual (AsNum a) (AsNum a) Source # 
Instance details

Defined in Downhill.BVar.Num

Methods

evalGrad :: AsNum a -> AsNum a -> Scalar (AsNum a) Source #

(HasGrad (Scalar v), HasGrad v, HasGrad dv, Dual v dv, Grad dv ~ v, Grad v ~ dv, Tang v ~ v, Tang dv ~ dv, Grad (Scalar dv) ~ Scalar dv) => Dual (BVar r v) (BVar r dv) Source # 
Instance details

Defined in Downhill.BVar

Methods

evalGrad :: BVar r dv -> BVar r v -> Scalar (BVar r v) Source #

(Scalar a ~ Scalar b, Dual a da, Dual b db) => Dual (a, b) (da, db) Source # 
Instance details

Defined in Downhill.Grad

Methods

evalGrad :: (da, db) -> (a, b) -> Scalar (a, b) Source #

(Scalar a ~ Scalar b, Scalar a ~ Scalar c, Dual a da, Dual b db, Dual c dc) => Dual (a, b, c) (da, db, dc) Source # 
Instance details

Defined in Downhill.Grad

Methods

evalGrad :: (da, db, dc) -> (a, b, c) -> Scalar (a, b, c) Source #

class Dual v dv => HilbertSpace v dv where Source #

u . v = evalDual (riesz u) v | du . dv = evalDual du (coriesz dv)

Methods

riesz :: v -> dv Source #

coriesz :: dv -> v Source #

Instances

Instances details
(HilbertSpace v dv, HasGrad (Scalar v), HasGrad v, HasGrad dv, Grad dv ~ v, Grad v ~ dv, Tang v ~ v, Tang dv ~ dv, Grad (Scalar dv) ~ Scalar dv) => HilbertSpace (BVar r v) (BVar r dv) Source # 
Instance details

Defined in Downhill.BVar

Methods

riesz :: BVar r v -> BVar r dv Source #

coriesz :: BVar r dv -> BVar r v Source #

class (Dual (Tang p) (Grad p), Scalar (Tang p) ~ Scalar (Grad p)) => Manifold p Source #

Associated Types

type Tang p :: Type Source #

Tangent space.

type Grad p :: Type Source #

Cotangent space.

Instances

Instances details
Manifold Integer Source # 
Instance details

Defined in Downhill.Grad

Associated Types

type Tang Integer Source #

type Grad Integer Source #

Manifold Double Source # 
Instance details

Defined in Downhill.Grad

Associated Types

type Tang Double Source #

type Grad Double Source #

Manifold Float Source # 
Instance details

Defined in Downhill.Grad

Associated Types

type Tang Float Source #

type Grad Float Source #

Num a => Manifold (AsNum a) Source # 
Instance details

Defined in Downhill.BVar.Num

Associated Types

type Tang (AsNum a) Source #

type Grad (AsNum a) Source #

(HasGrad (MScalar p), HasGrad (Tang p), HasGrad (Grad p), Grad (Grad p) ~ Tang p, Tang (Grad p) ~ Grad p, Tang (Tang p) ~ Tang p, Grad (Tang p) ~ Grad p, Grad (MScalar p) ~ MScalar p, Scalar (Grad p) ~ Scalar (Tang p), Manifold p) => Manifold (BVar r p) Source # 
Instance details

Defined in Downhill.BVar

Associated Types

type Tang (BVar r p) Source #

type Grad (BVar r p) Source #

Manifold a => Manifold (TraversableVar f a) Source # 
Instance details

Defined in Downhill.BVar.Traversable

Associated Types

type Tang (TraversableVar f a) Source #

type Grad (TraversableVar f a) Source #

(HasGrad a, HasGrad b, MScalar b ~ MScalar a) => Manifold (a, b) Source # 
Instance details

Defined in Downhill.Grad

Associated Types

type Tang (a, b) Source #

type Grad (a, b) Source #

(HasGrad a, HasGrad b, HasGrad c, MScalar b ~ MScalar a, MScalar c ~ MScalar a) => Manifold (a, b, c) Source # 
Instance details

Defined in Downhill.Grad

Associated Types

type Tang (a, b, c) Source #

type Grad (a, b, c) Source #

type HasGrad p = (Manifold p, BasicVector (Grad p)) Source #

Differentiable functions don't need to be constrained to vector spaces, they can be defined on other smooth manifolds, too.

type MScalar p = Scalar (Tang p) Source #

type HasGradAffine p = (AffineSpace p, HasGrad p, HasGrad (Tang p), Tang p ~ Diff p, Tang (Tang p) ~ Tang p, Grad (Tang p) ~ Grad p) Source #