栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

windows下OpenNN的编译与使用

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

windows下OpenNN的编译与使用

下载OpenNN

OpenNN是C++编写的神经网络库,从官网上下载后,使用VisualStudio打开可见如下项目树

其中项目opennn是用于生成静态链接库的,而其他所有项目都是案例。右键点击项目opennn,然后选择生成,VS将会自动编译出opennn.lib文件。新项目必须包含这个lib文件。

仅有lib文件是不够的,还需要一系列头文件来说明这个lib文件内部到底有什么函数。opennn的所有头文件(.h)都存放在./opennn目录下。

新建项目

(1)新建一个C++控制台项目
(2)在根目录新建lib文件夹,将opennn.lib文件复制到该文件夹中
(3)在根目录新建include文件夹,把opennn的所有头文件(.h)都复制到该文件夹中
(4)打开项目属性,设置包含目录,如下图

(5)设置链接的库文件,如下图

(6)项目的cpp文件中写入以下代码。这段代码来自./blank,意思是一个空的神经网络项目,不实现任何功能

//   OpenNN: Open Neural Networks Library
//   www.opennn.org
//
//   B L A N K   A P P L I C A T I O N
//
//   Artificial Intelligence Techniques SL
//   artelnics@artelnics.com

// System includes

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

// Systems Complementaries

#include 
#include 
#include 


// OpenNN includes

#include "opennn.h"

using namespace OpenNN;
using namespace std;
using namespace chrono;



int main(void)
{
    try
    {
        cout << "OpenNN. Blank Application." << endl;

        return 0;
    }
    catch(exception& e)
    {
        cerr << e.what() << endl;

        return 1;
    }
}


// OpenNN: Open Neural Networks Library.
// Copyright(C) 2005-2020 Artificial Intelligence Techniques, SL.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

(7)编译运行之后显示

OpenNN. Blank Application.

说明opennn已经可以正常运行

最后,我把lib文件夹和include文件夹整理如下,如有需要即可下载:
https://download.csdn.net/download/weixin_43325228/86246277

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/1018218.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号