Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class NatKind k => Tensor t where
- data VFunc n = VF {}
- data TOp :: [[k]] -> [[k]] -> Type where
- gradTOp :: (Tensor t, RealFloat (ElemT t)) => TOp ns '['[]] -> Prod t ns -> Prod t ns
- idOp :: forall ns. TOp ns ns
- firstOp :: forall os ns ms. (Known Length ns, Known Length ms) => TOp ns ms -> TOp (ns ++ os) (ms ++ os)
- secondOp :: forall os ns ms. Known Length os => TOp ns ms -> TOp (os ++ ns) (os ++ ms)
- (*>>) :: forall as bs cs ds. (Known Length as, Known Length bs) => TOp as bs -> TOp (bs ++ cs) ds -> TOp (as ++ cs) ds
- (<<*) :: forall as bs cs ds. (Known Length as, Known Length bs) => TOp (bs ++ cs) ds -> TOp as bs -> TOp (as ++ cs) ds
- (***) :: forall as bs cs ds. (Known Length as, Known Length cs) => TOp as cs -> TOp bs ds -> TOp (as ++ bs) (cs ++ ds)
- (&&&) :: forall as bs cs. (Known Length bs, SingI as) => TOp as bs -> TOp as cs -> TOp as (bs ++ cs)
Documentation
class NatKind k => Tensor t where Source #
liftT :: SingI o => (Vec n (ElemT t) -> ElemT t) -> Vec n (t o) -> t o Source #
gmul :: (SingI (Reverse os ++ ns), SingI (ms ++ ns)) => Length ms -> Length os -> Length ns -> t (ms ++ os) -> t (Reverse os ++ ns) -> t (ms ++ ns) Source #
sumT :: SingI o => [t o] -> t o Source #
scaleT :: SingI o => ElemT t -> t o -> t o Source #
transp :: (SingI ns, SingI (Reverse ns)) => t ns -> t (Reverse ns) Source #
mapRows :: SingI (ns ++ ms) => Length ns -> (t ms -> t ms) -> t (ns ++ ms) -> t (ns ++ ms) Source #
sumRows :: (SingI (n ': ns), SingI ns) => t (n ': ns) -> t ns Source #
diag :: SingI (n ': ns) => Uniform n ns -> t '[n] -> t (n ': ns) Source #
getDiag :: SingI n => Uniform n ns -> t (n ': (n ': ns)) -> t '[n] Source #
genRand :: (ContGen d, PrimMonad m, SingI ns) => d -> Gen (PrimState m) -> m (t ns) Source #
generateA :: (Applicative f, SingI ns) => (Prod (IndexN k) ns -> f (ElemT t)) -> f (t ns) Source #
ixRows :: (Applicative f, SingI (ms ++ os)) => Length ms -> Length os -> (Prod (IndexN k) ms -> t ns -> f (t os)) -> t (ms ++ ns) -> f (t (ms ++ os)) Source #
(Vec k2 v, BLAS k2 b, RealFloat (ElemB k2 b), Nesting1 (* -> *) k2 (Proxy k2) Functor v, Nesting1 (* -> *) k2 (Proxy k2) Foldable v, Nesting1 (* -> *) k2 (Sing k2) Applicative v, Nesting1 (* -> *) k2 (Sing k2) Distributive v, Eq1 k2 (IndexN k2)) => Tensor k2 (BTensor k2 v b) Source # | |
(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 # | |
Function and gradient
firstOp :: forall os ns ms. (Known Length ns, Known Length ms) => TOp ns ms -> TOp (ns ++ os) (ms ++ os) Source #
(*>>) :: forall as bs cs ds. (Known Length as, Known Length bs) => TOp as bs -> TOp (bs ++ cs) ds -> TOp (as ++ cs) ds infixr 0 Source #
(<<*) :: forall as bs cs ds. (Known Length as, Known Length bs) => TOp (bs ++ cs) ds -> TOp as bs -> TOp (as ++ cs) ds infixr 2 Source #
(***) :: forall as bs cs ds. (Known Length as, Known Length cs) => TOp as cs -> TOp bs ds -> TOp (as ++ bs) (cs ++ ds) Source #
(&&&) :: forall as bs cs. (Known Length bs, SingI as) => TOp as bs -> TOp as cs -> TOp as (bs ++ cs) Source #