c code generation to dll file

You are not quite sure where to place your question or issue? You want to suggest a new forum or want to provide feedback to the board itself?

Try here!
budunoff
Posts: 4
Joined: Sat 1. Feb 2014, 14:28

c code generation to dll file

Postby budunoff » Sat 1. Feb 2014, 14:51

hi, im new to programming and to membrain, but i like membrain with all its possibilities. i created a net that works great for my needs and i want to make a dll file that will be able to "store" the finished net so that i will be able to import a function that will use that net, something like:
"func(input1,input2,.....,inputn){return out1,out2,...,outn;}"
i did search the forum and the help file and didnt find anything relevant(again i have very basic knowlege of programming). if i did miss such a topic i apologise for repeating questions and please send a link. if not i would really apreciate if someone could help me with my problem or send a link to somwhere that explains how to make a dll file with the generate c code option. i use microsoft visual c++ express. thank you.

User avatar
TJetter
Posts: 269
Joined: Sat 13. Oct 2012, 11:04

Re: c code generation to dll file

Postby TJetter » Sat 1. Feb 2014, 15:52

Hi,

budunoff wrote: if i did miss such a topic i apologise for repeating questions and please send a link

you are right, the help file and the forum currently have no dedicated section which would talk about the MemBrain dll, I will consider to add these in the future.
However, there's a brief documentation section on the MemBrain homepage on the web page:
http://www.membrain-nn.de/english/details_en.htm
Watch out for the section 'THE MEMBRAIN DLL' on this page.
budunoff wrote:if not i would really apreciate if someone could help me with my problem or send a link to somwhere that explains how to make a dll file with the generate c code option.

The C code generation option and the MemBrain dll are two separate and independent things:
The C Code generation feature (also described on the web page linked above) allows to generate source code in the programming language 'C' for a single, frozen neural net. Then use any 'C' compiler to translate this source code into executable code which becomes an integral part of your application, which is presumably also developed in C or C++.

The MemBrain dll is automatically available on your machine in the dub directory 'DLL' of your MemBrain installation once you have installed MemBrain. You don't need any C Code generation to use the dll: The dll is a library that can be loaded by your application (e.g. from C# or C/C++) and which then allows to load MemBrain nets directly from file (*.mbn) just a MemBrain does. You can think of the MemBrain dll as a MemBrain version without Graphical User Interface (GUI) but with almost all features that the GUI featured version of MemBrain has. There is one point where the dll can do even more than MemBrain: It is able to loade more that one neural net at the same time and switch between the loaded nets during operation.

What you need in order to use the dll is getting familiar with loading and accessing a native Windows dll from within your programming language. What programming language are you using? If you use C# then there is already an object oriented wrapper available on the download page of the MemBrain Homepage.

Kind regards,
Thomas Jetter

budunoff
Posts: 4
Joined: Sat 1. Feb 2014, 14:28

Re: c code generation to dll file

Postby budunoff » Sat 8. Feb 2014, 18:54

hi, thank you for your answer, it really helped. but now i have a new problem :( . i downloaded the c# wrapper and i cant build it to make a dll file, and so i cant make use of it. i now use visual studio 2013 express. if you can help me with how to build it or link to a built membrainLib.dll it would be great. also if there is a list of functions it would be very helping i did go through them(i couldnt build the file (assemblyInfo.cs missing) but i did look through the functions), i couldnt understand how do you actually use it and what is the "idx"(how you find it, i thought that you choose neurons by name), and where do i put inputs and where and how do i recieve the outputs. i know that i have a lot of questions but if you have a little time please help me out becouse i struggle with it for a while now. thank you in front Alex. :D

budunoff
Posts: 4
Joined: Sat 1. Feb 2014, 14:28

Re: c code generation to dll file

Postby budunoff » Sat 8. Feb 2014, 19:02

i forgot to add that i couldnt add reference to file like mbdllwrapper.dll and membraindll.dll(and 64x) it gave me an error... :? . i use c# on visual studio 2013, windows7 sp1.

budunoff
Posts: 4
Joined: Sat 1. Feb 2014, 14:28

Re: c code generation to dll file

Postby budunoff » Sat 8. Feb 2014, 22:28

update: i managed to build membrainlib.dll... 8-) , but when i try to debug membrainlibusageexample i get an error MemBrainDLL not found/cant load membrain.dll anyone knows what to do? thank you.
Alex.

User avatar
TJetter
Posts: 269
Joined: Sat 13. Oct 2012, 11:04

Re: c code generation to dll file

Postby TJetter » Sat 8. Feb 2014, 23:24

budunoff wrote:when i try to debug membrainlibusageexample i get an error MemBrainDLL not found/cant load membrain.dll

Have you copied MemBrainDll.dll into the working directory of your application (where your *.exe resides)? If this doesn't work then try to copy the dll to C:\Windows\SysWOW64.

Regards
Thomas Jetter


Return to “Miscellaneous Topics”