Safe Haskell | None |
---|
- data Type
- nonempty :: forall a. Gen [a] -> Gen [a]
- mapMonad :: Monad m => (a -> b) -> m [a] -> m [b]
- toGenVector :: Gen [a] -> Gen (Vector a)
- signGen :: Gen Int
- binaryGen :: Gen Int
- patternGen :: Type -> Int -> Gen Pattern
- patternRangeGen :: Type -> (Int, Int) -> Gen Pattern
- boundedListGen :: Gen a -> Int -> Gen [a]
- patListGen :: Type -> Int -> Int -> Gen [Pattern]
- patternsTupleGen :: Type -> Int -> Int -> Gen ([Pattern], [Pattern])
- sameElemList :: a -> Gen [a]
- sameElemVector :: a -> Gen (Vector a)
- allWeightsSame :: Int -> [[Double]]
- boundedReplicateGen :: Int -> Gen a -> Gen [a]
- replaceAtN :: Int -> a -> [a] -> [a]
- crosstalk :: HopfieldData -> Int -> Int -> Int
- trainingPatsAreFixedPoints :: LearningType -> [Pattern] -> Gen Bool
- energyDecreasesAfterUpdate :: LearningType -> ([Pattern], [Pattern]) -> Gen Bool
- repeatedUpdateCheck :: LearningType -> ([Pattern], [Pattern]) -> Gen Bool
- boltzmannBuildGen :: Int -> Int -> Int -> Gen ([Pattern], Int)
- buildBoltzmannCheck :: ([Pattern], Int) -> Gen Bool
- boltzmannAndPatGen :: Int -> Int -> Int -> Gen ([Pattern], Int, Pattern)
- probabilityCheck :: ([Pattern], Int, Pattern) -> Gen Bool
- updateNeuronCheck :: Int -> ([Pattern], Int, Pattern) -> Gen Bool
- buildIntTuple :: Gen (Int, Int)
- binaryCheck :: (Int, Int) -> Bool
- evalRandGen :: Rand StdGen a -> Gen a
Documentation
toGenVector :: Gen [a] -> Gen (Vector a)Source
Convert a list generator to a vector generator
patternGen :: Type -> Int -> Gen PatternSource
patternGen n
: Generates patterns of size n
patternRangeGen :: Type -> (Int, Int) -> Gen PatternSource
patternRangeGen (min, max)
Generates patterns of size ranging
between min and max
boundedListGen :: Gen a -> Int -> Gen [a]Source
boundedListGen g n
: Generates lists (max length n) of the given Gen
patListGen :: Type -> Int -> Int -> Gen [Pattern]Source
patListGen t maxPatSize maxPatListSize
Generates a list of patterns.
The size of each pattern is less than maxPatSize.
The size odf the list is less than maxPatListSize.
The type is required in order to create types specific for Boltzmann,
Hopfield etc.
patternsTupleGen :: Type -> Int -> Int -> Gen ([Pattern], [Pattern])Source
patternsTupleGen g m1 m2
Generates a tuple of lists, as follows:
Uses patListGen to generate 1 list of patterns with length less than m2.
The list itself has to have length less than m1.
The second element of a tuple is a list of patterns which have the same size
as the patterns of the first list.
sameElemList :: a -> Gen [a]Source
sameElemVector :: a -> Gen (Vector a)Source
Generate vectors containing the same element replicated
allWeightsSame :: Int -> [[Double]]Source
Produces a matrix with 0's along the diagonal and 1's otherwise
boundedReplicateGen :: Int -> Gen a -> Gen [a]Source
boundedReplicateGen n g
Generates lists containing g
replicated.
The list is bounded in size by n.
replaceAtN :: Int -> a -> [a] -> [a]Source
Replaces the nth element in the list with r
crosstalk :: HopfieldData -> Int -> Int -> IntSource
trainingPatsAreFixedPoints :: LearningType -> [Pattern] -> Gen BoolSource
Used as a property to check that patterns which are used to create the network are stable in respect to update
energyDecreasesAfterUpdate :: LearningType -> ([Pattern], [Pattern]) -> Gen BoolSource
Trains a network using training_pats
and then updates each
pattern in pats according to the weights of that network.
The aim is to check that the energy decreases after each update.
repeatedUpdateCheck :: LearningType -> ([Pattern], [Pattern]) -> Gen BoolSource
boltzmannBuildGen :: Int -> Int -> Int -> Gen ([Pattern], Int)Source
boltzmannBuildGen maxPatSize maxPatListSize max_hidden
Generates the structures required for creating a Boltzmann machine:
a list of patterns together with the number of hidden layers,
which has to be less than max_hidden.
buildBoltzmannCheck :: ([Pattern], Int) -> Gen BoolSource
boltzmannAndPatGen :: Int -> Int -> Int -> Gen ([Pattern], Int, Pattern)Source
Generates a list of patterns and the number of hidden layers used to train a Boltzmann machine, as well as a generic pattern to recognize on this machine.
probabilityCheck :: ([Pattern], Int, Pattern) -> Gen BoolSource
probabilityCheck (pats, nr_h, pat)
. Trains a Boltzmann machine
using pats
and nr_h
and computes the activation probability for
pat
using this machine, and check if it is indeed a probability,
ie in [0,1]
updateNeuronCheck :: Int -> ([Pattern], Int, Pattern) -> Gen BoolSource
buildIntTuple :: Gen (Int, Int)Source
binaryCheck :: (Int, Int) -> BoolSource
evalRandGen :: Rand StdGen a -> Gen aSource