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

Safe HaskellNone
LanguageHaskell2010

TensorOps.Tensor

Synopsis

Documentation

konst :: (Tensor t, SingI n) => ElemT t -> t n Source #

map :: forall k o t. (SingI o, Tensor t) => (ElemT t -> ElemT t) -> t o -> t o Source #

zipN :: (SingI o, Tensor t) => (Vec n (ElemT t) -> ElemT t) -> Vec n (t o) -> t o Source #

zip :: (SingI o, Tensor t) => (ElemT t -> ElemT t -> ElemT t) -> t o -> t o -> t o Source #

zip3 :: (SingI o, Tensor t) => (ElemT t -> ElemT t -> ElemT t -> ElemT t) -> t o -> t o -> t o -> t o Source #

add :: (Tensor t, SingI o) => t o -> t o -> t o Source #

gradLift Source #

Arguments

:: (Tensor t, RealFloat (ElemT t), SingI o) 
=> VFunc n 
-> Vec n (t o)

inputs

-> t o

d target / d outputs

-> Vec n (t o)

d target / d inputs

TODO: memoize vfGrad f x somehow?

inner :: forall t ms ns o. (Tensor t, SingI (o ': ns), SingI (ms ++ ns)) => Length ms -> Length ns -> t (ms >: o) -> t (o ': ns) -> t (ms ++ ns) Source #

outer :: (Tensor t, SingI ns, SingI (ms ++ ns)) => Length ms -> Length ns -> t ms -> t ns -> t (ms ++ ns) Source #

outerV :: (Tensor t, SingI '[n], SingI '[m, n]) => t '[m] -> t '[n] -> t '[m, n] Source #

dot :: forall t m. (Tensor t, SingI '[m]) => t '[m] -> t '[m] -> t '[] Source #

matVec :: (Tensor t, SingI '[n], SingI '[m]) => t '[m, n] -> t '[n] -> t '[m] Source #

vecMat :: (Tensor t, SingI '[m, n], SingI '[n]) => t '[m] -> t '[m, n] -> t '[n] Source #

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

fromList :: (Tensor t, SingI ns) => [ElemT t] -> Maybe (t ns) Source #

generate :: forall k t ns. (Tensor t, SingI ns) => (Prod (IndexN k) ns -> ElemT t) -> t ns Source #

rows :: (Tensor t, Applicative f, SingI (ms ++ os)) => Length ms -> Length os -> (t ns -> f (t os)) -> t (ms ++ ns) -> f (t (ms ++ os)) Source #

toRows :: (Tensor t, SingI n) => t (n ': ns) -> [t ns] Source #

ixElems :: forall k f t ns. (Applicative f, Tensor t, SingI ns) => (Prod (IndexN k) ns -> ElemT t -> f (ElemT t)) -> t ns -> f (t ns) Source #

elems :: (Applicative f, Tensor t, SingI ns) => (ElemT t -> f (ElemT t)) -> t ns -> f (t ns) Source #

itoList :: forall k t ns. (Tensor t, SingI ns) => t ns -> [(Prod (IndexN k) ns, ElemT t)] Source #

toList :: (Tensor t, SingI ns) => t ns -> [ElemT t] Source #

unScalar :: forall t. Tensor t => t '[] -> ElemT t Source #

oneHot :: forall k t n. (Tensor t, Eq1 (IndexN k), SingI n) => ElemT t -> ElemT t -> IndexN k n -> t '[n] Source #

argMax :: forall k t n. (SingI n, Tensor t, Ord (ElemT t), NonZero n) => t '[n] -> IndexN k n Source #

argMin :: forall k t n. (SingI n, Tensor t, Ord (ElemT t), NonZero n) => t '[n] -> IndexN k n Source #