bindings-fann (empty) → 0.0.2
raw patch · 12 files changed
Files
- LICENSE +29/−0
- Setup.hs +2/−0
- bindings-fann.cabal +29/−0
- src/Bindings/Fann.hs +1/−0
- src/Bindings/Fann/Constants.hsc +38/−0
- src/Bindings/Fann/CreationDestructionExecution.hsc +16/−0
- src/Bindings/Fann/DataStructures.hsc +14/−0
- src/Bindings/Fann/ErrorHandling.hsc +16/−0
- src/Bindings/Fann/InputOutput.hsc +13/−0
- src/Bindings/Fann/Options.hsc +41/−0
- src/Bindings/Fann/Training.hsc +14/−0
- src/Bindings/Fann/TrainingData.hsc +23/−0
+ LICENSE view
@@ -0,0 +1,29 @@+Copyright (c) <2009>, <Maurício C. Antunes>+All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are+met:++ * Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer.++ * Redistributions in binary form must reproduce the above copyright+ notice, this list of conditions and the following disclaimer in the+ documentation and/or other materials provided with the distribution.++ * Neither the name of the author nor the names of contributors+ may be used to endorse or promote products derived from this+ software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED+TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ bindings-fann.cabal view
@@ -0,0 +1,29 @@+cabal-version: >= 1.2.3+name: bindings-fann+synopsis:+ Low level bindings to FANN neural network library.+version: 0.0.2+license: BSD3+license-file: LICENSE+maintainer: Maurício C. Antunes <mauricio.antunes@gmail.com>+author: Maurício C. Antunes+build-type: Simple+category: FFI+library+ hs-source-dirs: src+ extensions:+ ForeignFunctionInterface+ build-depends:+ base >= 3 && < 5,+ bindings-DSL >= 1.0 && < 1.1+ exposed-modules:+ Bindings.Fann+ Bindings.Fann.Constants+ Bindings.Fann.CreationDestructionExecution+ Bindings.Fann.DataStructures+ Bindings.Fann.ErrorHandling+ Bindings.Fann.InputOutput+ Bindings.Fann.Options+ Bindings.Fann.Training+ Bindings.Fann.TrainingData+ pkgconfig-depends: fann >=1.2 && <2
+ src/Bindings/Fann.hs view
@@ -0,0 +1,1 @@+module Bindings.Fann (module Bindings.Fann.Constants,module Bindings.Fann.CreationDestructionExecution,module Bindings.Fann.DataStructures,module Bindings.Fann.ErrorHandling,module Bindings.Fann.InputOutput,module Bindings.Fann.Options,module Bindings.Fann.TrainingData,module Bindings.Fann.Training) where {import Bindings.Fann.Constants;import Bindings.Fann.CreationDestructionExecution;import Bindings.Fann.DataStructures;import Bindings.Fann.ErrorHandling;import Bindings.Fann.InputOutput;import Bindings.Fann.Options;import Bindings.Fann.TrainingData;import Bindings.Fann.Training}
+ src/Bindings/Fann/Constants.hsc view
@@ -0,0 +1,38 @@+#include <bindings.dsl.h>+#include <fann.h>+#include <fann_errno.h>++-- | <http://leenissen.dk/fann/fann_1_2_0/x1994.html>++module Bindings.Fann.Constants where+#strict_import++#num FANN_TRAIN_INCREMENTAL+#num FANN_TRAIN_BATCH+#num FANN_TRAIN_RPROP+#num FANN_TRAIN_QUICKPROP+#num FANN_THRESHOLD+#num FANN_THRESHOLD_SYMMETRIC+#num FANN_LINEAR+#num FANN_SIGMOID+#num FANN_SIGMOID_STEPWISE+#num FANN_SIGMOID_SYMMETRIC+#num FANN_SIGMOID_SYMMETRIC_STEPWISE+#num FANN_ERRORFUNC_LINEAR+#num FANN_ERRORFUNC_TANH+#num FANN_E_NO_ERROR+#num FANN_E_CANT_OPEN_CONFIG_R+#num FANN_E_CANT_OPEN_CONFIG_W+#num FANN_E_WRONG_CONFIG_VERSION+#num FANN_E_CANT_READ_CONFIG+#num FANN_E_CANT_READ_NEURON+#num FANN_E_CANT_READ_CONNECTIONS+#num FANN_E_WRONG_NUM_CONNECTIONS+#num FANN_E_CANT_OPEN_TD_W+#num FANN_E_CANT_OPEN_TD_R+#num FANN_E_CANT_READ_TD+#num FANN_E_CANT_ALLOCATE_MEM+#num FANN_E_CANT_TRAIN_ACTIVATION+#num FANN_E_CANT_USE_ACTIVATION+#num FANN_E_TRAIN_DATA_MISMATCH+
+ src/Bindings/Fann/CreationDestructionExecution.hsc view
@@ -0,0 +1,16 @@+#include <bindings.dsl.h>+#include <fann.h>++-- | <http://leenissen.dk/fann/fann_1_2_0/c253.html#api.sec.create_destroy>++module Bindings.Fann.CreationDestructionExecution where+#strict_import+import Bindings.Fann.DataStructures++#ccall fann_create_array , CFloat -> CFloat -> CUInt -> Ptr CUInt -> IO (Ptr <fann>)+#ccall fann_create_shortcut_array , CFloat -> CUInt -> Ptr CUInt -> IO (Ptr <fann>)+#ccall fann_destroy , Ptr <fann> -> IO ()+#ccall fann_run , Ptr <fann> -> Ptr CFloat -> IO (Ptr CFloat)+#ccall fann_randomize_weights , Ptr <fann> -> CFloat -> CFloat -> IO ()+#ccall fann_init_weights , Ptr <fann> -> Ptr <fann_train_data> -> IO ()+#ccall fann_print_connections , Ptr <fann> -> IO ()
+ src/Bindings/Fann/DataStructures.hsc view
@@ -0,0 +1,14 @@+#include <bindings.dsl.h>+#include <fann.h>++-- | <http://leenissen.dk/fann/fann_1_2_0/x1595.html>++module Bindings.Fann.DataStructures where+#strict_import++#opaque_t struct fann+#opaque_t struct fann_train_data+#opaque_t struct fann_error+#opaque_t struct fann_neuron+#opaque_t struct fann_layer+
+ src/Bindings/Fann/ErrorHandling.hsc view
@@ -0,0 +1,16 @@+#include <bindings.dsl.h>+#include <fann.h>++-- | <http://leenissen.dk/fann/fann_1_2_0/x1499.html>++module Bindings.Fann.ErrorHandling where+#strict_import+import Bindings.Fann.DataStructures++#ccall fann_get_errno , Ptr <fann_error> -> IO CUInt+#ccall fann_get_errstr , Ptr <fann_error> -> IO CString+#ccall fann_reset_errno , Ptr <fann_error> -> IO ()+#ccall fann_reset_errstr , Ptr <fann_error> -> IO ()+#ccall fann_set_error_log , Ptr <fann_error> -> Ptr CFile -> IO ()+#ccall fann_print_error , Ptr <fann> -> IO ()+
+ src/Bindings/Fann/InputOutput.hsc view
@@ -0,0 +1,13 @@+#include <bindings.dsl.h>+#include <fann.h>++-- | <http://leenissen.dk/fann/fann_1_2_0/x472.html>++module Bindings.Fann.InputOutput where+#strict_import+import Bindings.Fann.DataStructures++#ccall fann_save , Ptr <fann> -> CString -> IO ()+#ccall fann_save_to_fixed , Ptr <fann> -> CString -> IO ()+#ccall fann_create_from_file , CString -> IO (Ptr <fann>)+
+ src/Bindings/Fann/Options.hsc view
@@ -0,0 +1,41 @@+#include <bindings.dsl.h>+#include <fann.h>++-- | <http://leenissen.dk/fann/fann_1_2_0/x938.html>++module Bindings.Fann.Options where+#strict_import+import Bindings.Fann.DataStructures++#ccall fann_print_parameters , Ptr <fann> -> IO ()+#ccall fann_get_training_algorithm , Ptr <fann> -> IO CUInt+#ccall fann_set_training_algorithm , Ptr <fann> -> CUInt -> IO ()+#ccall fann_get_learning_rate , Ptr <fann> -> IO CFloat+#ccall fann_set_learning_rate , Ptr <fann> -> CFloat -> IO ()+#ccall fann_get_activation_function_hidden , Ptr <fann> -> IO CUInt+#ccall fann_set_activation_function_hidden , Ptr <fann> -> CUInt -> IO ()+#ccall fann_get_activation_function_output , Ptr <fann> -> IO CUInt+#ccall fann_set_activation_function_output , Ptr <fann> -> CUInt -> IO ()+#ccall fann_get_activation_steepness_hidden , Ptr <fann> -> IO CFloat+#ccall fann_set_activation_steepness_hidden , Ptr <fann> -> CFloat -> IO ()+#ccall fann_get_activation_steepness_output , Ptr <fann> -> IO CFloat+#ccall fann_set_activation_steepness_output , Ptr <fann> -> CFloat -> IO ()+#ccall fann_set_train_error_function , Ptr <fann> -> CUInt -> IO ()+#ccall fann_get_train_error_function , Ptr <fann> -> IO CUInt+#ccall fann_get_quickprop_decay , Ptr <fann> -> IO CFloat+#ccall fann_set_quickprop_decay , Ptr <fann> -> CFloat -> IO ()+#ccall fann_get_quickprop_mu , Ptr <fann> -> IO CFloat+#ccall fann_set_quickprop_mu , Ptr <fann> -> CFloat -> IO ()+#ccall fann_get_rprop_increase_factor , Ptr <fann> -> IO CFloat+#ccall fann_set_rprop_increase_factor , Ptr <fann> -> CFloat -> IO ()+#ccall fann_get_rprop_decrease_factor , Ptr <fann> -> IO CFloat+#ccall fann_set_rprop_decrease_factor , Ptr <fann> -> CFloat -> IO ()+#ccall fann_get_rprop_delta_min , Ptr <fann> -> IO CFloat+#ccall fann_set_rprop_delta_min , Ptr <fann> -> CFloat -> IO ()+#ccall fann_get_rprop_delta_max , Ptr <fann> -> IO CFloat+#ccall fann_set_rprop_delta_max , Ptr <fann> -> CFloat -> IO ()+#ccall fann_get_num_input , Ptr <fann> -> IO CUInt+#ccall fann_get_num_output , Ptr <fann> -> IO CUInt+#ccall fann_get_total_neurons , Ptr <fann> -> IO CUInt+#ccall fann_get_total_connections , Ptr <fann> -> IO CUInt+
+ src/Bindings/Fann/Training.hsc view
@@ -0,0 +1,14 @@+#include <bindings.dsl.h>+#include <fann.h>++-- | <http://leenissen.dk/fann/fann_1_2_0/x534.html>++module Bindings.Fann.Training where+#strict_import+import Bindings.Fann.DataStructures++#ccall fann_train , Ptr <fann> -> Ptr CFloat -> Ptr CFloat -> IO ()+#ccall fann_test , Ptr <fann> -> Ptr CFloat -> Ptr CFloat -> IO (Ptr CFloat)+#ccall fann_get_MSE , Ptr <fann> -> IO CFloat+#ccall fann_reset_MSE , Ptr <fann> -> IO ()+
+ src/Bindings/Fann/TrainingData.hsc view
@@ -0,0 +1,23 @@+#include <bindings.dsl.h>+#include <fann.h>++-- | <http://leenissen.dk/fann/fann_1_2_0/x609.html>++module Bindings.Fann.TrainingData where+#strict_import+import Bindings.Fann.DataStructures++#ccall fann_read_train_from_file , CString -> IO (Ptr <fann_train_data>)+#ccall fann_save_train , Ptr <fann_train_data> -> Ptr CFile -> IO ()+#ccall fann_save_train_to_fixed , Ptr <fann_train_data> -> Ptr CFile -> CUInt -> IO ()+#ccall fann_destroy_train , Ptr <fann_train_data> -> IO ()+#ccall fann_train_epoch , Ptr <fann> -> Ptr <fann_train_data> -> IO CFloat+#ccall fann_test_data , Ptr <fann> -> Ptr <fann_train_data> -> IO CFloat+#ccall fann_train_on_data , Ptr <fann> -> Ptr <fann_train_data> -> CUInt -> CUInt -> CFloat -> IO ()+#ccall fann_train_on_data_callback , Ptr <fann> -> Ptr <fann_train_data> -> CUInt -> CUInt -> CFloat -> FunPtr (CUInt -> CFloat -> IO CInt) -> IO ()+#ccall fann_train_on_file , Ptr <fann> -> CString -> CUInt -> CUInt -> CFloat -> IO ()+#ccall fann_train_on_file_callback , Ptr <fann> -> CString -> CUInt -> CUInt -> CFloat -> FunPtr (CUInt -> CFloat -> IO CInt) -> IO ()+#ccall fann_shuffle_train_data , Ptr <fann_train_data> -> IO ()+#ccall fann_merge_train_data , Ptr <fann_train_data> -> Ptr <fann_train_data> -> IO (Ptr <fann_train_data>)+#ccall fann_duplicate_train_data , Ptr <fann_train_data> -> IO (Ptr <fann_train_data>)+