backprop-0.2.3.0: Heterogeneous automatic differentation

Copyright(c) Justin Le 2018
LicenseBSD3
Maintainerjustin@jle.im
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Prelude.Backprop.Num

Contents

Description

Provides the exact same API as Prelude.Backprop, except requiring Num instances for all types involved instead of Backprop instances.

Since: 0.2.0.0

Synopsis

Foldable and Traversable

sum :: (Foldable t, Functor t, Num (t a), Num a, Reifies s W) => BVar s (t a) -> BVar s a Source #

sum, but with Num constraints instead of Backprop constraints.

product :: (Foldable t, Functor t, Num (t a), Fractional a, Reifies s W) => BVar s (t a) -> BVar s a Source #

product, but with Num constraints instead of Backprop constraints.

length :: (Foldable t, Num (t a), Num b, Reifies s W) => BVar s (t a) -> BVar s b Source #

length, but with Num constraints instead of Backprop constraints.

minimum :: (Foldable t, Functor t, Num a, Ord a, Num (t a), Reifies s W) => BVar s (t a) -> BVar s a Source #

minimum, but with Num constraints instead of Backprop constraints.

maximum :: (Foldable t, Functor t, Num a, Ord a, Num (t a), Reifies s W) => BVar s (t a) -> BVar s a Source #

maximum, but with Num constraints instead of Backprop constraints.

traverse :: (Traversable t, Applicative f, Foldable f, Num a, Num b, Num (t b), Reifies s W) => (BVar s a -> f (BVar s b)) -> BVar s (t a) -> BVar s (f (t b)) Source #

traverse, but with Num constraints instead of Backprop constraints.

See vector-sized for a fixed-length vector type with a very appropriate Num instance!

Prior to v0.2.3, required a Num constraint on f (t b).

toList :: (Traversable t, Num a, Reifies s W) => BVar s (t a) -> [BVar s a] Source #

toList, but with Num constraints instead of Backprop constraints.

Since: 0.2.2.0

mapAccumL :: (Traversable t, Num b, Num c, Reifies s W) => (BVar s a -> BVar s b -> (BVar s a, BVar s c)) -> BVar s a -> BVar s (t b) -> (BVar s a, BVar s (t c)) Source #

mapAccumL, but with Num constraints instead of Backprop constraints.

Prior to v0.2.3, required a Num constraint on t b.

Since: 0.2.2.0

mapAccumR :: (Traversable t, Num b, Num c, Reifies s W) => (BVar s a -> BVar s b -> (BVar s a, BVar s c)) -> BVar s a -> BVar s (t b) -> (BVar s a, BVar s (t c)) Source #

mapAccumR, but with Num constraints instead of Backprop constraints.

Prior to v0.2.3, required a Num constraint on t b.

Since: 0.2.2.0

foldr :: (Traversable t, Num a, Reifies s W) => (BVar s a -> BVar s b -> BVar s b) -> BVar s b -> BVar s (t a) -> BVar s b Source #

foldr, but with Num constraints instead of Backprop constraints.

Since: 0.2.3.0

foldl' :: (Traversable t, Num a, Reifies s W) => (BVar s b -> BVar s a -> BVar s b) -> BVar s b -> BVar s (t a) -> BVar s b Source #

foldl', but with Num constraints instead of Backprop constraints.

Since: 0.2.3.0

Functor and Applicative

fmap :: (Traversable f, Num a, Num b, Reifies s W) => (BVar s a -> BVar s b) -> BVar s (f a) -> BVar s (f b) Source #

fmap, but with Num constraints instead of Backprop constraints.

Prior to v0.2.3, required a Num constraint on f b.

(<$>) :: (Traversable f, Num a, Num b, Reifies s W) => (BVar s a -> BVar s b) -> BVar s (f a) -> BVar s (f b) Source #

Alias for fmap.

pure :: (Foldable t, Applicative t, Num (t a), Num a, Reifies s W) => BVar s a -> BVar s (t a) Source #

pure, but with Num constraints instead of Backprop constraints.

liftA2 :: (Traversable f, Applicative f, Num a, Num b, Num c, Reifies s W) => (BVar s a -> BVar s b -> BVar s c) -> BVar s (f a) -> BVar s (f b) -> BVar s (f c) Source #

liftA2, but with Num constraints instead of Backprop constraints.

Prior to v0.2.3, required a Num constraint on f c.

liftA3 :: (Traversable f, Applicative f, Num a, Num b, Num c, Num d, Reifies s W) => (BVar s a -> BVar s b -> BVar s c -> BVar s d) -> BVar s (f a) -> BVar s (f b) -> BVar s (f c) -> BVar s (f d) Source #

liftA3, but with Num constraints instead of Backprop constraints.

Prior to v0.2.3, required a Num constraint on f d.

Numeric

fromIntegral :: (Integral a, Integral b, Reifies s W) => BVar s a -> BVar s b Source #

fromIntegral, but with Num constraints instead of Backprop constraints.

Since: 0.2.1.0

realToFrac :: (Fractional a, Real a, Fractional b, Real b, Reifies s W) => BVar s a -> BVar s b Source #

realToFrac, but with Num constraints instead of Backprop constraints.

Since: 0.2.1.0

round :: (RealFrac a, Integral b, Reifies s W) => BVar s a -> BVar s b Source #

round, but with Num constraints instead of Backprop constraints.

Since: 0.2.3.0

fromIntegral' :: (Integral a, RealFrac b, Reifies s W) => BVar s a -> BVar s b Source #

fromIntegral', but with Num constraints instead of Backprop constraints.

Since: 0.2.3.0

Misc

coerce :: Coercible a b => BVar s a -> BVar s b Source #

Coerce items inside a BVar.