HaskellNN-0.1.3: High Performance Neural Network in Haskell

MaintainerKiet Lam <ktklam9@gmail.com>

AI.Model.GenericModel

Description

This module provides a generic module for initiialization and training of neural networks

User must provide the needed functions

Synopsis

Documentation

data GenericModel Source

Generic neural network model for expansion

Constructors

GenericModel 

Fields

cost :: Cost

The cost model of the model

net :: Network

The neural network to be used for modeling

initializeModelSource

Arguments

:: Activation

The activation model of each neuron

-> Cost

The cost model of the output neurons compared to the expected output

-> [Int]

The architecture of the network e.g., a 2-3-1 architecture would be [2,3,1]

-> Double

The regularization constant should be 0 if you do not want regularization

-> StdGen

The random generator

-> GenericModel

Returns the initialized model

Initialize neural network model with the weights randomized within [-1.0,1.0]

getOutputSource

Arguments

:: GenericModel

The model of interest

-> Vector Double

The input vector to the input layer

-> Vector Double

The output of the network model

Get the output of the model

trainModelSource

Arguments

:: GenericModel

The model to be trained

-> TrainingAlgorithm

The training algorithm to be used

-> Double

The precision to train with regards to the cost function

-> Int

The maximum amount of epochs to train

-> Matrix Double

The input matrix

-> Matrix Double

The expected output matrix

-> GenericModel

Returns the trained model

Train the model given the parameters and the training algorithm