tensor-ops-0.1.0.0: Tensor manipulation operations with tensorflow-style automatic differentiation

Safe HaskellNone
LanguageHaskell2010

TensorOps.Backend.NTensor

Documentation

data NTensor :: (k -> Type -> Type) -> Type -> [k] -> Type Source #

Instances

(Vec k2 v, RealFloat a, Nesting1 (* -> *) k2 (Proxy k2) Functor v, Nesting1 (* -> *) k2 (Sing k2) Applicative v, Nesting1 (* -> *) k2 (Proxy k2) Foldable v, Nesting1 (* -> *) k2 (Proxy k2) Traversable v, Nesting1 (* -> *) k2 (Sing k2) Distributive v, Eq1 k2 (IndexN k2)) => Tensor k2 (NTensor k2 v a) Source # 

Associated Types

type ElemT (NTensor k2 v a) (t :: [NTensor k2 v a] -> Type) :: Type Source #

Methods

liftT :: SingI [NTensor k2 v a] o => (Vec n (ElemT (NTensor k2 v a) t) -> ElemT (NTensor k2 v a) t) -> Vec n (t o) -> t o Source #

gmul :: (SingI [NTensor k2 v a] ((NTensor k2 v a ++ Reverse (NTensor k2 v a) os) ns), SingI [NTensor k2 v a] ((NTensor k2 v a ++ ms) ns)) => Length (NTensor k2 v a) ms -> Length (NTensor k2 v a) os -> Length (NTensor k2 v a) ns -> t ((NTensor k2 v a ++ ms) os) -> t ((NTensor k2 v a ++ Reverse (NTensor k2 v a) os) ns) -> t ((NTensor k2 v a ++ ms) ns) Source #

sumT :: SingI [NTensor k2 v a] o => [t o] -> t o Source #

scaleT :: SingI [NTensor k2 v a] o => ElemT (NTensor k2 v a) t -> t o -> t o Source #

transp :: (SingI [NTensor k2 v a] ns, SingI [NTensor k2 v a] (Reverse (NTensor k2 v a) ns)) => t ns -> t (Reverse (NTensor k2 v a) ns) Source #

mapRows :: SingI [NTensor k2 v a] ((NTensor k2 v a ++ ns) ms) => Length (NTensor k2 v a) ns -> (t ms -> t ms) -> t ((NTensor k2 v a ++ ns) ms) -> t ((NTensor k2 v a ++ ns) ms) Source #

sumRows :: (SingI [NTensor k2 v a] ((NTensor k2 v a ': n) ns), SingI [NTensor k2 v a] ns) => t ((NTensor k2 v a ': n) ns) -> t ns Source #

diag :: SingI [NTensor k2 v a] ((NTensor k2 v a ': n) ns) => Uniform (NTensor k2 v a) n ns -> t ((NTensor k2 v a ': n) [NTensor k2 v a]) -> t ((NTensor k2 v a ': n) ns) Source #

getDiag :: SingI (NTensor k2 v a) n => Uniform (NTensor k2 v a) n ns -> t ((NTensor k2 v a ': n) ((NTensor k2 v a ': n) ns)) -> t ((NTensor k2 v a ': n) [NTensor k2 v a]) Source #

genRand :: (ContGen d, PrimMonad m, SingI [NTensor k2 v a] ns) => d -> Gen (PrimState m) -> m (t ns) Source #

generateA :: (Applicative f, SingI [NTensor k2 v a] ns) => (Prod (NTensor k2 v a) (IndexN (NTensor k2 v a)) ns -> f (ElemT (NTensor k2 v a) t)) -> f (t ns) Source #

ixRows :: (Applicative f, SingI [NTensor k2 v a] ((NTensor k2 v a ++ ms) os)) => Length (NTensor k2 v a) ms -> Length (NTensor k2 v a) os -> (Prod (NTensor k2 v a) (IndexN (NTensor k2 v a)) ms -> t ns -> f (t os)) -> t ((NTensor k2 v a ++ ms) ns) -> f (t ((NTensor k2 v a ++ ms) os)) Source #

(!) :: t ns -> Prod (NTensor k2 v a) (IndexN (NTensor k2 v a)) ns -> ElemT (NTensor k2 v a) t Source #

(NFData a, Nesting * k (Proxy k) NFData v) => Nesting1 * [k] w NFData (NTensor k v a) Source # 

Methods

nesting1 :: NTensor k v a a -> Wit (c (v a)) Source #

(NFData a, Nesting * k (Proxy k) NFData v) => NFData1 [k] (NTensor k v a) Source # 

Methods

rnf1 :: f a -> () Source #

(Num a, SingI [k] ns, Nesting1 (* -> *) k (Proxy k) Functor v, Nesting1 (* -> *) k (Sing k) Applicative v) => Num (NTensor k v a ns) Source # 

Methods

(+) :: NTensor k v a ns -> NTensor k v a ns -> NTensor k v a ns #

(-) :: NTensor k v a ns -> NTensor k v a ns -> NTensor k v a ns #

(*) :: NTensor k v a ns -> NTensor k v a ns -> NTensor k v a ns #

negate :: NTensor k v a ns -> NTensor k v a ns #

abs :: NTensor k v a ns -> NTensor k v a ns #

signum :: NTensor k v a ns -> NTensor k v a ns #

fromInteger :: Integer -> NTensor k v a ns #

Generic (NTensor k v a ns) Source # 

Associated Types

type Rep (NTensor k v a ns) :: * -> * #

Methods

from :: NTensor k v a ns -> Rep (NTensor k v a ns) x #

to :: Rep (NTensor k v a ns) x -> NTensor k v a ns #

(NFData a, Nesting * k (Proxy k) NFData v) => NFData (NTensor k v a ns) Source # 

Methods

rnf :: NTensor k v a ns -> () #

type ElemT k (NTensor k v a) Source # 
type ElemT k (NTensor k v a) = a
type Rep (NTensor k v a ns) Source # 
type Rep (NTensor k v a ns) = D1 (MetaData "NTensor" "TensorOps.Backend.NTensor" "tensor-ops-0.1.0.0-FrwKbhy3KHG8SCnsuIUxIs" True) (C1 (MetaCons "NTensor" PrefixI True) (S1 (MetaSel (Just Symbol "getNVec") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Nested k v ns a))))

type NTensorV = NTensor (Flip2 VectorT I) Double Source #