This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(fannerl_tests). | |
-include_lib("eunit/include/eunit.hrl"). | |
create_test() -> | |
Fann = fannerl:create_standard({2,2,1}), | |
fannerl:get_training_algorithm(Fann), | |
?debugMsg("exiting create_test"). | |
get_mse_test() -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <erl_nif.h> | |
#include <fann.h> | |
#include <string.h> | |
#include <ctype.h> | |
static ErlNifResourceType * FANN_POINTER=NULL; | |
static ErlNifResourceType * TRAIN_DATA_THREAD=NULL; | |
static ErlNifResourceType * TRAIN_DATA_RESOURCE=NULL; | |
struct fann_resource { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(fann_example). | |
-export([run/0]). | |
run() -> | |
Net = fann:create_standard({2,3,1}), | |
fann:set_activation_function_hidden(Net, 5), | |
fann:set_activation_function_hidden(Net, 5), | |
fann:train_on_file(Net, "xor.data", 1000000, 0, 0.001), | |
Mse = fann:get_mse(Net), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <erl_nif.h> | |
#include <fann.h> | |
static ErlNifResourceType * FANN_POINTER=NULL; | |
struct fann_resource { | |
struct fann * ann; | |
}; | |
int check_and_convert_array(ErlNifEnv* env, const ERL_NIF_TERM * tuple_array, |