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

Safe HaskellNone
LanguageHaskell2010

TensorOps.TOp

Synopsis

Documentation

liftOp :: SingI o => Uniform o ns -> VFunc (Len ns) -> TOp ns '[o] Source #

Lift any `R^N -> R^M` function over every element in a n-tensor list, producing a m-tensor list.

gmul :: forall ms os ns. (SingI (Reverse os ++ ns), SingI (ms ++ ns), SingI (ms ++ os)) => Length ms -> Length os -> Length ns -> TOp '[ms ++ os, Reverse os ++ ns] '[ms ++ ns] Source #

transpOp :: forall ns. (SingI ns, SingI (Reverse ns)) => Length ns -> TOp '[ns] '[Reverse ns] Source #

shuffle :: forall ns ms. SingI ns => Prod (Index ns) ms -> TOp ns ms Source #

shuffleF :: forall ns ms. (forall f. Prod f ns -> Prod f ms) -> (forall f. Prod f ms -> Prod f ns) -> TOp ns ms Source #

shuffleF' :: forall ns ms. SingI ns => (forall f. Prod f ns -> Prod f ms) -> (forall f. Prod f ms -> Prod ([] :.: f) ns) -> TOp ns ms Source #

sumRows :: forall n ns. (SingI n, SingI ns) => TOp '[n ': ns] '[ns] Source #

sumOp :: SingI n => Uniform n ns -> TOp ns '[n] Source #

scale :: SingI ns => (forall a. RealFloat a => a) -> TOp '[ns] '[ns] Source #

konst :: forall n ns. SingI n => Uniform n ns -> (forall a. RealFloat a => a) -> TOp '[] ns Source #

negate :: SingI ns => TOp '[ns] '[ns] Source #

map' :: SingI n => (forall a. RealFloat a => a -> a) -> (forall a. RealFloat a => a -> a) -> TOp '[n] '[n] Source #

map :: SingI n => (forall a. RealFloat a => a -> a) -> TOp '[n] '[n] Source #

add :: SingI n => TOp '[n, n] '[n] Source #

add3 :: SingI n => TOp '[n, n, n] '[n] Source #

zipN' :: SingI n => Uniform n ns -> (forall a. RealFloat a => Vec (Len ns) a -> a) -> (forall a. RealFloat a => Vec (Len ns) a -> Vec (Len ns) a) -> TOp ns '[n] Source #

zipN :: SingI n => Uniform n ns -> (forall a. RealFloat a => Vec (Len ns) a -> a) -> TOp ns '[n] Source #

zip' :: SingI n => (forall a. RealFloat a => a -> a -> a) -> (forall a. RealFloat a => a -> a -> (a, a)) -> TOp '[n, n] '[n] Source #

zip :: SingI n => (forall a. RealFloat a => a -> a -> a) -> TOp '[n, n] '[n] Source #

zip3' :: SingI n => (forall a. RealFloat a => a -> a -> a -> a) -> (forall a. RealFloat a => a -> a -> a -> (a, a, a)) -> TOp '[n, n, n] '[n] Source #

zip3 :: SingI n => (forall a. RealFloat a => a -> a -> a -> a) -> TOp '[n, n, n] '[n] Source #

replicate :: SingI n => Uniform n ns -> TOp '[n] ns Source #

duplicate :: SingI n => TOp '[n] '[n, n] Source #

inner :: forall ms ns o. (SingI (o ': ns), SingI (ms >: o), SingI (ms ++ ns)) => Length ms -> Length ns -> TOp '[ms >: o, o ': ns] '[ms ++ ns] Source #

outer :: (SingI ms, SingI ns, SingI (ms ++ ns)) => Length ms -> Length ns -> TOp '[ms, ns] '[ms ++ ns] Source #

dot :: SingI m => TOp '['[m], '[m]] '['[]] Source #

matVec :: (SingI m, SingI n) => TOp '['[m, n], '[n]] '['[m]] Source #

vecMat :: (SingI m, SingI n) => TOp '['[m], '[m, n]] '['[n]] Source #

matMat :: (SingI m, SingI n, SingI o) => TOp '['[m, n], '[n, o]] '['[m, o]] Source #

swap :: TOp '[ms, ns] '[ns, ms] Source #

swap' :: forall ns ms. Length ns -> Length ms -> TOp (ns ++ ms) (ms ++ ns) Source #

drop :: forall ms ns. SingI (ns ++ ms) => Length ns -> TOp (ns ++ ms) ms Source #

take :: forall ns ms. SingI (ns ++ ms) => Length ns -> Length ms -> TOp (ns ++ ms) ns Source #