matlab neural network toolbox

走远了吗. 提交于 2019-12-29 08:24:08

问题


I used the matlab neural network to train on some data but I want to run this neural network in c++ program,how to do that?


回答1:


You can use ML to generate your feature set (input layer) and then use an open source C++ NN implementation to do training/classification. (E.g., http://takinginitiative.net/2008/04/23/basic-neural-network-tutorial-c-implementation-and-source-code/) If you want to use ML to train and C++ to classify it shouldn't be too difficult to write some additional code to write out the trained network in a way that can be read in by the C++ classifier.




回答2:


You can use the Matlab Compiler that generates code you can embed in your C++ application




回答3:


I'm using Matlab R2013a. If you are still facing with this issue, try to look at this location

Matlab\R2013a\toolbox\nnet\nnet\nnderivative\+nnMex2

inside Matlab directory. I found there file "yy.cpp" which contains mexFunction which does the thing. Very likely that Matlab calls this function to simulate network.

Seems that it's possible to integrate this function into your project after slight refactoring. At least I plan to do so. :-)



来源:https://stackoverflow.com/questions/5192165/matlab-neural-network-toolbox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!