Maintainer | Kiet Lam <ktklam9@gmail.com> |
---|

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

User must provide the needed functions

- data GenericModel = GenericModel {}
- initializeModel :: Activation -> Cost -> [Int] -> Double -> StdGen -> GenericModel
- getOutput :: GenericModel -> Vector Double -> Vector Double
- trainModel :: GenericModel -> TrainingAlgorithm -> Double -> Int -> Matrix Double -> Matrix Double -> GenericModel

# Documentation

:: 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]

:: 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

:: 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