hopfield-0.1.0.1: Hopfield Networks, Boltzmann Machines and Clusters

Safe HaskellNone

Hopfield.Util

Description

This module uses general purpose functions which are use trought the project. Should not contain any project defined data types. Needs to be kept as general as possible.

Synopsis

Documentation

average :: (Real a, Fractional b) => [a] -> bSource

(*.) :: (Integral a1, Num a) => a -> a1 -> aSource

(.*) :: (Fractional a, Integral a1) => a1 -> a -> aSource

(./) :: (Fractional a, Integral a1) => a1 -> a -> aSource

(./.) :: (Fractional a, Integral a1, Integral a2) => a1 -> a2 -> aSource

(/.) :: (Fractional a, Integral a2) => a -> a2 -> aSource

attachLabels :: String -> [[Showable]] -> StringSource

columnVector :: Vector (Vector a) -> Int -> Vector aSource

combine :: (a -> b -> c) -> [[a]] -> [[b]] -> [[c]]Source

combineVectors :: (a -> b -> c) -> Vector a -> Vector b -> Vector cSource

compareBy :: Ord b => (a -> b) -> a -> a -> OrderingSource

dotProduct :: Num a => Vector a -> Vector a -> aSource

findInList :: Eq a => [a] -> a -> Either a IntSource

fromDataVector :: Storable a => Vector a -> Vector aSource

getBinaryIndices :: Eq a => [a] -> [(a, [Int])]Source

getElemOccurrences :: Ord a => [a] -> [(a, Int)]Source

gibbsSampling :: MonadRandom m => Double -> m IntSource

gibbsSampling a Gives the binary value of a neuron (0 or 1) from the activation sum

hammingDistance :: Vector Int -> Vector Int -> IntSource

list2D :: Vector (Vector a) -> [[a]]Source

Converts a 2D vector into a list of lists

log2 :: Double -> DoubleSource

normal :: forall m. MonadRandom m => Double -> Double -> m DoubleSource

Generates a number sampled from a random distribution, given the mean and standard deviation.

numDiffs :: Eq a => [a] -> [a] -> IntSource

prettyList :: Show a => [a] -> StringSource

printMList :: Show a => [IO a] -> [a -> String] -> IO ()Source

randomBinaryVector :: MonadRandom m => Int -> m (Vector Int)Source

randomElem :: MonadRandom m => [a] -> m aSource

randomSignVector :: MonadRandom m => Int -> m (Vector Int)Source

repeatUntilEqual :: (MonadRandom m, Eq a) => (a -> m a) -> a -> m aSource

repeatUntilEqualOrLimitExceeded :: (MonadRandom m, Eq a) => Int -> (a -> m a) -> a -> m aSource

repeatUntilNothing :: MonadRandom m => (a -> m (Maybe a)) -> a -> m aSource

runT :: forall m a. MonadRandom m => T a -> m aSource

shuffle :: MonadRandom m => Array Int a -> m [a]Source

toArray :: [a] -> Array Int aSource

toBinary :: Int -> Int -> [Int]Source

toDouble :: (Integral a, Num b) => Vector a -> Vector bSource

toPercents :: [Double] -> StringSource

vector2D :: [[a]] -> Vector (Vector a)Source

Converts a list of lists to a 2D vector

unfoldrSelfM :: Monad m => (a -> m (Maybe a)) -> a -> m [a]Source

Executes the monadic action returning a maybe until Nothing is returned, collecting the results in a list.

Like unfoldr, the initial value is not part of the result list.

patternToAsciiArt :: Int -> Pattern -> StringSource