h&&Q!Y      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrst u v w x y z { | } ~                                                  Safe-InferreddownhillKey and value.downhillHeterogeneous map with  as a key.downhill A key of OpenMap.     Safe-Inferred)*1downhill with existential set of nodes.downhill NodeMap s f is a map where value of type f x is associated with key  NodeKey s x. Type variable s tracks the set of nodes. Lookups never fail. Maps can be zipped without losing any nodes.downhill(Valid key, guaranteed to be a member of sdownhillIf key belongs to s,  tryLookup will return a proof of this fact and a corresponding value from the map. Otherwise returns Nothing.   Safe-Inferred)*5 y) = sumBuilder x ^+^ sumBuilder y  must be cheap.  must be O(1).-downhillExpr a v( represents a linear expression of type v), containing some free variables of type a.0downhill Argument f in Term f x must be linear function. That's a law."#$%&'()*,+-/.01234567-/.01)*,+&'("#$%345672 Safe-Inferred LJdownhill?Linear expression, made for backpropagation. It is similar to - BackFun, but has a more flexible form.Ldownhill Creates a BackGrad1 that is backed by a real node. Gradient of type v9 will be computed and stored in a graph for this node.MdownhillinlineNode f x will apply function f to variable x without creating a node. All of the gradients coming to this expression will be forwarded to the parents of x7. However, if this expression is used more than once, f will be evaluated multiple times, too. It is intended to be used for newtype wrappers. inlineNode f x7 also doesn't prevent compiler to inline and optimize xOdownhillBackGrad- doesn't track the type of the node. Type of BackGrad# can be changed freely as long as  VecBuilder stays the same.JKLMNOJKLMNO Safe-Inferred)*Rdownhill%Edge type for forward mode evaluationUdownhill&Edge type for backward mode evaluationRSTUVWXYUVWRSTXY Safe-Inferred)*Zdownhill(Computational graph under construction. Open refers to the set of the nodes @ new nodes can be added to this graph. Once the graph is complete the set of nodes will be frozen and the type of the graph will become Graph (Downhill.Internal.Graph module).downhillMaintains a cache of visited -s.downhillbuildExpr action key will run action, associate result with key and store it in cache. If key is already in cache, action will not be run.cdownhillCollects duplicate nodes in -! tree and converts it to a graph. Z[\]^_`abc ^_`ab\]Z[c Safe-Inferred)*/mdownhillInner node. This does not include initial node. Contains a list of ingoing edges. odownhillForward mode evaluationpdownhill?Reverse edges. Turns reverse mode evaluation into forward mode.qdownhill$Will crash if graph has invalid keys ghijklmnopq ijklmnghopq Safe-Inferred  sdownhillPurity of this function depends on laws of arithmetic and linearity law of 0. If your addition is approximately associative, then this function is approximately pure. Fair?rssr  Safe-Inferred/<vdownhillDifferentiable functions don't need to be constrained to vector spaces, they can be defined on other smooth manifolds, too.xdownhillTangent space.ydownhillCotangent space.{downhillu  . v = evalDual (riesz u) v | du  . dv = evalDual du (coriesz dv)~downhillDual of a vector v is a linear map  v -> Scalar v. tuvwyxz{}|~ ~{}|wyxvzut  Safe-Inferred)*fdownhillSame as  sparseNode!, included here for completeness.    Safe-Inferred ()*downhill getFst :: (BasicVector (DualOf a), BasicVector (DualOf b)) => BackGrad r (a, b) -> BackGrad r a getFst (T2 x _) = x mkPair :: (BasicVector (DualOf a), BasicVector (DualOf b)) => BackGrad r a -> BackGrad r b -> BackGrad r (a, b) mkPair x y = (T2 x y)   Safe-Inferred()*/01?downhill+Variable is a value paired with derivative.downhill#A variable with derivative of zero.downhill$A variable with identity derivative.downhillReverse mode differentiation.    Safe-Inferred(H Safe-InferredEdownhill MetricTensor converts gradients to vectors.It is really inverse of a metric tensor, because it maps cotangent space into tangent space. Gradient descent doesn't need metric tensor, it needs inverse.downhillm must be symmetric: 9evalGrad x (evalMetric m y) = evalGrad y (evalMetric m x)downhill 0innerProduct m x y = evalGrad x (evalMetric m y)downhill  sqrNorm m x = innerProduct m x x Safe-Inferred589:;? downhill IntmapVector serves as a gradient of .downhill1Provides HasGrad instance for use in deriving viadownhill Note that splitTraversable won't be useful for top level BVar, because the type  Grad (f a) is not exposed.downhill #backpropTraversable one combine funone- is a value to be backpropagated. In case of p being scalar, set one$ to 1 to compute unscaled gradient.combine is given value of a parameter and its gradient to construct result, just like zipWith.fun& is the function to be differentiated.downhillLike , but returns gradient only.downhill4 specialized to return a pair of value and gradient. Safe-Inferred ?!5downhillAsNum a' implements many instances in terms of Num a instance. !!"#$%&'()**++,,-./01234556789:;<=>?@ABCDEFGHIJKLMNNOPQRSTUUVWWXYZ[[\\]]^_`abcdeeffghiijklmn o p q r s t u v w x y z { | } ~                               n            'downhill-0.4.0.0-Lk1VxmWwJTYGRbf6qfoMXvDownhill.Internal.Graph.OpenMapDownhill.Internal.Graph.NodeMapDownhill.Linear.ExprDownhill.Linear.BackGradDownhill.Internal.Graph.Types!Downhill.Internal.Graph.OpenGraphDownhill.Internal.Graph.GraphDownhill.Linear.Backprop Downhill.GradDownhill.Linear.LiftDownhill.Linear.Prelude Downhill.BVarDownhill.BVar.PreludeDownhill.MetricDownhill.BVar.TraversableDownhill.BVar.Num SomeOpenItemOpenMapOpenKeyemptymapmapMaybe mapWithKeylookuptoListelemsintersectionWithinsertadjust makeOpenKey SomeNodeMap IsNodeSet KeyAndValueNodeMapNodeKey toListWith tryLookupgeneratezipWith fromOpenMap$fIsNodeSetNodeSetWrapper DenseVector DenseBuilder SparseVectorunSparseVector BasicVector VecBuilder sumBuilderidentityBuilderExprExprVarExprSumTerm maybeToMonoidtoDenseBuildergenericSumBuildergenericIdentityBuildergenericSumMaybeBuildergenericIdentityMaybeBuilder$fSemigroupDenseSemibuilder$fGBasicVectorU1U1$fGBasicVectorV1V1$fGBasicVector:*::*:$fGBasicVectorM1M1$fGBasicVectorK1K1$fBasicVectorDenseVector$fBasicVectorDouble$fBasicVectorFloat$fBasicVector(,,)$fBasicVector(,)$fBasicVectorInteger$fBasicVectorSparseVector$fAdditiveGroupDenseVector$fVectorSpaceDenseVector$fSemigroupDenseBuilder$fMonoidDenseBuilder$fSemigroupSparseVectorBackGradrealNode inlineNode sparseNode castBackGrad$fVectorSpaceBackGrad$fAdditiveGroupBackGradFwdFununFwdFunBackFun unBackFun flipBackFun flipFwdFun OpenGraphOpenNodeOpenEdge OpenEndpointOpenSourceNode OpenInnerNoderecoverSharing$fFunctorTreeBuilder$fApplicativeTreeBuilder$fMonadTreeBuilder SomeGraphGraphgraphInnerNodesgraphFinalNodeNode evalGraphtransposeGraphunsafeFromOpenGraph buildGraphbackprop HasGradAffine GradBuilderHasGradManifoldTangGradMScalar HilbertSpacerieszcorieszDualevalGrad $fGDualsU1U1 $fGDualsV1V1$fGDuals:*::*: $fGDualsM1M1 $fGDualsK1K1$fDualDoubleDouble$fDualFloatFloat$fDual(,,)(,,) $fDual(,)(,)$fDualIntegerInteger$fManifoldDouble$fManifoldFloat$fManifoldInteger$fManifold(,,) $fManifold(,)lift1lift2lift3 lift1_sparse lift2_sparse lift3_sparse lift1_dense lift2_dense lift3_denseT3T2BVar bvarValuebvarGradconstantvar$fInnerSpaceBVar$fHilbertSpaceBVarBVar$fManifoldBVar$fDualBVarBVar$fAffineSpaceBVar$fVectorSpaceBVar$fFloatingBVar$fFractionalBVar $fNumBVar$fAdditiveGroupBVar MetricTensor evalMetric innerProductsqrNorm$fMetricTensorDoubleDouble$fMetricTensorFloatFloat$fMetricTensor(,,)(,,)$fMetricTensor(,)(,)$fMetricTensorIntegerInteger$fMetricTensorpL2TraversableVarunTraversableVarsplitTraversablebackpropTraversablebackpropTraversable_GradOnly backpropTraversable_ValueAndGrad$fVectorSpaceTraversableMetric $fAdditiveGroupTraversableMetric$fBasicVectorIntmapVector$fDualIntmapVectorIntmapVector$fVectorSpaceIntmapVector$fAdditiveGroupIntmapVector$fManifoldIntmapVector$fManifoldTraversableVar-$fMetricTensorTraversableVarTraversableMetric$fShowIntmapVector$fGenericTraversableMetric$fFunctorTraversableVar$fFoldableTraversableVar$fTraversableTraversableVar$fMonoidIntmapVector$fSemigroupIntmapVectorNumBVarAsNumunAsNum backpropNum numbvarValue$fAffineSpaceAsNum$fBasicVectorAsNum$fVectorSpaceAsNum$fAdditiveGroupAsNum$fMetricTensorAsNumAsNum$fManifoldAsNum$fDualAsNumAsNum $fShowAsNum $fNumAsNum$fFractionalAsNum$fFloatingAsNumbaseGHC.StableName StableNameGHC.Base<>mempty TreeBuilder buildExpr IntmapVector