1

I want to use FANN by saving the configuration into a database, then load it during runs. All of the functions seem to be saving/loading networks into config files. But my application can't have temporary files.

How can I save a training into a string / load a network from a string? I am using the Python bindings, but a C/C++ answer is also welcome.

user4157124
  • 2,809
  • 13
  • 27
  • 42
MrFox
  • 1,244
  • 1
  • 11
  • 24

2 Answers2

0

If you look at the IO code in, https://github.com/libfann/fann/blob/master/src/fann_io.c you can very easily create your own create_from_string function using how it reads the file as a template.

wi1
  • 486
  • 3
  • 14
-1

Did you try fann_save ?

train.c

fann_save( ann, "./nets/trained.net" );

It allows to save the network and then load it again in another program:

simulate.c

ann = fann_create_from_file("./nets/trained.net");
Luis
  • 3,327
  • 6
  • 35
  • 62