What is the best programming language to implement neural networks?
Asked Answered
B

10

19

I'm not looking for a Neural Networks library, since I'm creating new kinds of networks. For that I need a good "dataflow" language.

Of course you can do this in C, C++, Java and co. but dealing from scratch with the multithreading etc. would be a nightmare.

At the other extremity, languages like Oz or Erlang seem more adapted, but they don't have many libraries, and they are harder to master (it's easy to play with them, but is it OK to create complete software ?).

What would you suggest ?

Berman answered 1/7, 2011 at 10:39 Comment(1)
This link might be helpfull. trapexit.org/Erlang_and_Neural_NetworksFrontlet
I
15

I watched an interesting conference presentation about using Erlang for Neural Networks. You might want to check it out:

From Telecom Networks to Neural Networks; Erlang, as the unintentional Neural Network Programming Language

I also know that the presented system is going to be open-sourced any day now according the authors tweet.

Inflation answered 1/7, 2011 at 14:46 Comment(5)
Yes thanks, I've seen it too, very interesting. I might go with this solution, Erlang seems quite mature now. My only concern with this solution is the complete asynchronousness of the network, you have no way to control any "timing".Berman
In Erlang, you can deal with time and synchronization very easily. Much easier that in any other practical languages. So even if the basic system doesn't support that out of the box, it may not be very hard to extend it. Erlang is great for doing concurrent soft real-time systems by design. Besides telecom, there are other classes of systems that rely on this property, including trading, CEP, etc.Inflation
Luopan, accept this answer if it is the best solution for youOnwards
it is easy to deal with synchronization in such a network. Along signal (as a part of message) you can keep 'generation' of the message. You can also maintain 'tick' messages. Yet another approach would use states machines consuming just one signal and handling sync in some event way.Isolation
Look at Gene Sher's post below, for a direct link to the library referenced above.Halla
I
10

Erlang is very well suited for NN.

  1. Neurons can be modeled by processes (no problem with having millions of them)
  2. Connections/synapses can be represented by PIDs of target neuron. It is very easy to initialize such a network as part of standard init procedure in OTP. Communication would be realized by message passing.
  3. Maybe it would be good to have global address space in ETS/mnesia (build in datastores) in order to do dynamic reconfiguration of network structure.
  4. Pattern matching in receive block can determine what kind of signal neuron receives and modify it on the fly.
  5. It would be very easy to monitor such a network.

Also consider that Erlang NN would be 'live' all the time. You would be able to query neurons, layers, routers etc any time. In C/C++ you just read current state of arrays/data structure.

Regarding performance, we all know that C/C++ is orders of magnitude faster than Erlang, however NN topic is tricky.

If the network would hold very few neurons, in very wide address space, in regular array, iterating over it again and again could be costly (in C). Equivalent situation in Erlang would be solved by single query to root/roots (input layer) neurons, which would propagate query directly to well addressed neighborhs.

Isolation answered 3/7, 2011 at 0:12 Comment(1)
The difference in performance between C/C++ and Erlang is VERY test dependant. For small tests like incrementing the fields in an array C/C++ is definitely much faster than Erlang, but for large, real applications the difference will be very small, if there is any at all. Complexity tends to favour those systems which are designed to handle it, like Erlang.Chili
M
6

DXNN1, and DXNN2 which was built and introduced in the textbook: Handbook of Neuroevolution Through Erlang: http://www.amazon.com/Handbook-Neuroevolution-Through-Erlang-Gene/dp/1461444624/ref=zg_bs_760204_22

Are open source and available at: https://github.com/CorticalComputer

Mcilroy answered 29/6, 2013 at 18:57 Comment(2)
The link in the post above is the open source library that alavrik was writing about.Halla
Extra points for probably the author himself giving the answer?Hardiman
A
3

If you are interested in data flow programming and multi-threading then I would suggest National Instruments LabVIEW. In this case you don't need to bother about multi-threading since its already there and you can also use OOP since now OOP is also native with LabVIEW. LabVIEW OOP is also purely based on data flow programming paradigm.

Aspergillum answered 17/12, 2012 at 10:7 Comment(0)
E
2

If you have any Java experience, then use Scala which is a JVM language that is based on the same concept of "actors" as Erlang. But it is less strict than Erlang and can easily use any existing Java libraries.

Then, when you find a computationally expensive task that would work better in Erlang, you can use Erlang's jinterface library to communicate between your Scala code and your distributed Erlang nodes.

Equivocate answered 7/7, 2011 at 5:7 Comment(0)
B
1

Using Java does not mean dealing from scratch with multithreading - just use one of numerous Java Actor Libraries.

Bartholemy answered 27/12, 2011 at 3:28 Comment(0)
S
0

Why reinvent the wheel? Try PyBrain. It's free and very comprehensive:

Smythe answered 1/7, 2011 at 10:52 Comment(3)
Thanks ! But I'm trying to avoid (for performance reasons) my old love Ruby, so I cannot cheat her with Python :)Berman
@Luopan : I don't see that fact mentioned in your question. Why limit yourself with arbitrary criteria?Smythe
You also can try Peach, both Peach and PyBrain are developed with the concern of performance (Peach is based on NumPy, that is implemented in C), and both are used successfully in scientific (with a lot of processing) applications.Km
E
0

It's not a language in and of itself, but Emergent is very powerful and can be highly customized (it has a full scripting language).

It's open source, too, which could be helpful as a guide if you need to make your own version for your novel architectures.

Ellett answered 1/7, 2011 at 10:55 Comment(0)
J
0

Another big plus for Erlang is full integration with Drakon

http://drakon-editor.sourceforge.net/drakon-erlang/intro.html

Joiejoin answered 8/8, 2015 at 23:41 Comment(0)
G
-1

It all depends on your application. C++, Python are some good programming languages for machine learning

Gasket answered 6/7, 2017 at 8:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.