h$#&      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrst u v w x y z { | } ~                                          NonevdownhillKey and value.downhillHeterogeneous map with  as a key.downhill A key of OpenMap.    None'(/?downhill 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'(29<=>? 4"downhill/When sparsity is not needed, we can use vector v as a builder of itself.  DenseVector takes care of that.&downhillNormally graph node would compute the sum of gradients and then propagate it to ancestor nodes. That's the best strategy when some computation needs to be performed for backpropagation. Some operations, like constructing/deconstructing tuples or wrapping/unwrapping, don't need to compute the sum. Doing so only destroys sparsity. A node of type SparseVector v won't sum the gradients, it will simply forward builders to its parents.*downhill VecBuilder v& is a sparse representation of vector v. Edges of a computational graph produce builders, which are then summed into vectors in nodes. Monoid operation  means addition of vectors, but it doesn't need to compute the sum immediately - it might defer computation until + is evaluated. sumBuilder mempty = zeroV sumBuilder (x <> 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 >? Jdownhill?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 evaluationRSTUVWXYUVWRSTXYNone'([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).cdownhillCollects duplicate nodes in -! tree and converts it to a graph. Z[\]^_`abc ^_`ab\]Z[cNone'(->?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 ijklmnghopqNone ?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-9>?vdownhillDifferentiable functions don't need to be constrained to vector spaces, they can be defined on other smooth manifolds, too.wdownhillTangent space.xdownhillCotangent space.zdownhillDual of a vector v is a linear map  v -> Scalar v.tuvxwyz{z{vxwyut  Safe-Inferred'(?downhillSame 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)  None&'(-./<=>?*downhill+Variable is a value paired with derivative.downhill#A variable with derivative of zero.downhill$A variable with identity derivative.downhillReverse mode differentiation.   None&?t Safe-Inferred>?mdownhill 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 xNone25678<=>?^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.None <=?downhillAsNum 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.2.0.0-6axYiP8DrkfDH6cm24Ji1BDownhill.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 GradBuilderHasGradTangGradMScalarDualevalGrad $fGDualsU1U1 $fGDualsV1V1$fGDuals:*::*: $fGDualsM1M1 $fGDualsK1K1$fDualDoubleDouble$fDualFloatFloat$fDual(,,)(,,) $fDual(,)(,)$fDualIntegerInteger$fHasGradDouble$fHasGradFloat$fHasGradInteger $fHasGrad(,,) $fHasGrad(,)lift1lift2lift3 lift1_sparse lift2_sparse lift3_sparse lift1_dense lift2_dense lift3_denseT3T2BVar bvarValuebvarGradconstantvar$fInnerSpaceBVar$fAffineSpaceBVar$fVectorSpaceBVar$fFloatingBVar$fFractionalBVar $fNumBVar$fAdditiveGroupBVar MetricTensor evalMetric innerProductsqrNorm$fMetricTensorDoubleDouble$fMetricTensorFloatFloat$fMetricTensor(,,)(,,)$fMetricTensor(,)(,)$fMetricTensorIntegerInteger$fMetricTensorpL2TraversableVarunTraversableVarsplitTraversablebackpropTraversablebackpropTraversable_GradOnly backpropTraversable_ValueAndGrad$fVectorSpaceTraversableMetric $fAdditiveGroupTraversableMetric$fBasicVectorIntmapVector$fDualIntmapVectorIntmapVector$fVectorSpaceIntmapVector$fAdditiveGroupIntmapVector$fHasGradTraversableVar-$fMetricTensorTraversableVarTraversableMetric$fShowIntmapVector$fGenericTraversableMetric$fFunctorTraversableVar$fFoldableTraversableVar$fTraversableTraversableVar$fMonoidIntmapVector$fSemigroupIntmapVectorNumBVarAsNumunAsNum backpropNum numbvarValue$fAffineSpaceAsNum$fBasicVectorAsNum$fVectorSpaceAsNum$fAdditiveGroupAsNum$fMetricTensorAsNumAsNum$fHasGradAsNum$fDualAsNumAsNum $fShowAsNum $fNumAsNum$fFractionalAsNum$fFloatingAsNumbaseGHC.StableName StableNameGHC.Base<>mempty