Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想通过将配置保存到数据库中来使用 FANN,然后在运行期间加载它。所有功能似乎都将网络保存/加载到配置文件中。但我的应用程序不能有临时文件。
如何将培训保存到字符串中/从字符串中加载网络?我正在使用 Python 绑定,但也欢迎使用 C/C++ 答案。
如果您查看https://github.com/libfann/fann/blob/master/src/fann_io.c中的 IO 代码,您可以使用它作为模板读取文件的方式非常轻松地创建自己的 create_from_string 函数。
你试过fann_save吗?
fann_save( ann, "./nets/trained.net" );
它允许保存网络,然后在另一个程序中再次加载它:
ann = fann_create_from_file("./nets/trained.net");