Portability | portable |
---|---|
Stability | experimental |
Maintainer | olivier.boudry@gmail.com |
The Fast Artificial Neural Network Library (FANN) is a free open source neural network library written in C with support for both fully connected and sparsely connected networks (http://leenissen.dk/fann/).
HFANN is a Haskell interface to this library.
- type FannType = Double
- type CFannType = CDouble
- type CFannTypePtr = Ptr CDouble
- type ActivationFunction = Word32
- type TrainAlgorithm = Word32
- type ErrorFunction = Word32
- type StopFunction = Word32
- data Fann = Fann
- type FannPtr = Ptr Fann
- data TrainData = TrainData
- type TrainDataPtr = Ptr TrainData
- type CallbackType = FannPtr -> TrainDataPtr -> Int -> Int -> Float -> Int -> IO Bool
- type CCallbackType = FannPtr -> TrainDataPtr -> CUInt -> CUInt -> CFloat -> CUInt -> IO Int
- activationLinear :: ActivationFunction
- activationThreshold :: ActivationFunction
- activationThresholdSymmetric :: ActivationFunction
- activationSigmoid :: ActivationFunction
- activationSigmoidStepwise :: ActivationFunction
- activationSigmoidSymmetric :: ActivationFunction
- activationSigmoidSymmetricStepwise :: ActivationFunction
- activationGaussian :: ActivationFunction
- activationGaussianSymmetric :: ActivationFunction
- activationGaussianStepwise :: ActivationFunction
- activationElliot :: ActivationFunction
- activationElliotSymmetric :: ActivationFunction
- activationLinearPiece :: ActivationFunction
- activationLinearPieceSymmetric :: ActivationFunction
- trainIncremental :: TrainAlgorithm
- trainBatch :: TrainAlgorithm
- trainRPROP :: TrainAlgorithm
- trainQuickProp :: TrainAlgorithm
- errorFunctionLinear :: ErrorFunction
- errorFunctionTanH :: ErrorFunction
- stopFunctionMSE :: StopFunction
- stopFunctionBit :: StopFunction
- fannCallback :: CallbackType -> IO (FunPtr CCallbackType)
Data Types
The Haskell input/output type
This is the data type used in Haskell to represent the input/output data.
type CFannType = CDoubleSource
The C input/output type
This is the data type used in the C library to represent the input/output data.
type CFannTypePtr = Ptr CDoubleSource
A pointer to the C input/output type
type ActivationFunction = Word32Source
The type of the Activation Function
enumeration
type TrainAlgorithm = Word32Source
The type of the Training Algorithm
enumeration
type ErrorFunction = Word32Source
Error function used during training.
errorFunctionLinear - Standard linear error function. errorFunctionTanH - Tanh error function, usually better but can require a lower learning rate. This error function agressively target outputs that differ much from the desired, while not targetting output that only differ a little that much.
The tanh function is not recommended for cascade training and incremental training.
type StopFunction = Word32Source
Stop function used during training
stopFunctionMSE - stop criteria is Mean Square Error value. stopFunctionBit - stop criteria is number of bits that fail
See getBitFailLimit
, setBitFailLimit
.
The bits are counted in all of the training data, so this number can be higher than the number of training data.
type TrainDataPtr = Ptr TrainDataSource
A pointer to the training data structure type
type CallbackType = FannPtr -> TrainDataPtr -> Int -> Int -> Float -> Int -> IO BoolSource
The Haskell Callback function type
type CCallbackType = FannPtr -> TrainDataPtr -> CUInt -> CUInt -> CFloat -> CUInt -> IO IntSource
The C callback function type
Activation Functions
activationGaussianStepwise :: ActivationFunctionSource
Create a callback function to be used during training for reporting and to stop the training