Safe Haskell | None |
---|---|
Language | Haskell98 |
- oneHot :: forall n. KnownNat n => Int -> Maybe (S (D1 n))
- hotMap :: (Ord a, KnownNat n) => Proxy n -> [a] -> Maybe (Map a Int, Vector a)
- makeHot :: forall a n. (Ord a, KnownNat n) => Map a Int -> a -> Maybe (S (D1 n))
- unHot :: forall a n. KnownNat n => Vector a -> S (D1 n) -> Maybe a
- sample :: forall a n m. (KnownNat n, MonadRandom m) => Double -> Vector a -> S (D1 n) -> m a
Documentation
oneHot :: forall n. KnownNat n => Int -> Maybe (S (D1 n)) Source #
From an int which is hot, create a 1D Shape with one index hot (1) with the rest 0. Rerurns Nothing if the hot number is larger than the length of the vector.
hotMap :: (Ord a, KnownNat n) => Proxy n -> [a] -> Maybe (Map a Int, Vector a) Source #
Create a one hot map from any enumerable. Returns a map, and the ordered list for the reverse transformation