vDSP equivalent for Linux - linux

I have had good experiences with Apple's vDSP primitives under OS X and iOS.
http://developer.apple.com/library/mac/#documentation/Accelerate/Reference/vDSPRef/Reference/reference.html
Now I am trying to port some code that relies on vDSP to Linux and I wonder if any equivalents are available built into one of the standard libraries.

While there is not presently any library that matches vDSP, there are several alternatives you might explore. A couple off the top of my head:
OpenCV is an impressive collection of image processing and computer vision
routines with a vibrant user and research community.
Eigen is a C++11 template library for linear algebra:
matrices, vectors, numerical solvers, and related algorithms.
My personal recommendation would be Eigen.

Related

Use multiple graphical windows in OCaml

OCaml comes with the Graphics module which allows the use of a graphical window.
Is it possible to open two graphical window, and switch between them ?
The Graphics module provides machine-independent tools but in case of a negative answer, perhaps it would also be interesting to have solutions for different window system, such as X11.
I looked through the Graphics module API and I don't see support for multiple windows. I would assume Graphics was intended as something useful but simple enough to be part of the base OCaml release.
For more complex graphics, it makes sense just to provide OCaml bindings to an existing library. If I go to opam.ocaml.org/packages and search for "graphics" I see a few possibilities.
I have done OpenGL coding in OCaml but in fact I had to build some wrappers for OS-native GUI functionality to create the windows. This was many years ago, however.
The Graphics module is quite limited and is more intended as a simple basic library for teaching purposes. A possible replacement for Graphics might be the tsdl package which is a thin wrapper around the SDL C library which should work on most platforms.

Haskell Graphics Programming in Linux/Unix

I am interested in making a game in Haskell and I am looking for a graphics library. I found one called the HUGS Graphics Library but much to my dismay it only runs on Win32. I was wondering if there was a graphics library for Linux/Unix Haskell programming or am I out of luck. Thank you for reading.
Do you know about hackage? Hosted on hackage are lots of graphics-related libraries. Low level OpenGL bindings (openglraw, glut, hgl, glfw), higher level special-purpose GL libraries (ex: gloss), 2D libraries (cairo, gtk, gd), and more. For 2D I suggest you see this related question.
Raincat is a simple puzzle game written in Haskell that demonstrates graphics library usage and some strait forward techniques. Try looking up some Haskell SDL and OpenGL tutorials to help you in understanding the code. I am looking forward to playing your game.
Regards,
http://hackage.haskell.org/package/Raincat

Neural networks in Haskell - advice

Can anybody suggest me tutorial, book, blog or share code sample for neural networks in Haskell ? I have experience in neural networks in imperative languages, but I want try that in Haskell.
There are several libraries on Hackage:
HaskellNN A Haskell library which uses hmatrix (and, transitively, GSL and libLBFGS C libraries) to do heavy lifting (GPL). Claims to be fast.
instinct A pure-Haskell library which claims to be fast (BSD).
hnn A minimal Haskell Neural Network Library (LGPL).
bindings-fann Bindings to FANN library.
hfann Other bindings to FANN library.
You may find this sample application useful. It uses back-propagation. I wrote an article discussing the example, explaining how the use of a functional paradigm affects the design. The article should appear in the next issue of The Monad Reader.
The DataHaskell community keeps a more up-to-date list of Hackage packages at http://www.datahaskell.org/docs/community/current-environment.html#neural-networks
As of 2019-08-26, it recommends these packages:
neural (CPU-only, see issue 10)
backprop-learn uses the backprop library (CPU-only?)
grenade (dependently typed! Comfortable API, but CPU-only so far, see issue 55 / issue 35 / issue 6)
hasktorch (Haskell bindings to the C libs underlying PyTorch, early development but it should let you train on GPU)
tensorflow (Haskell bindings to TF; most likely what you'd use in production, but intimidating API; can run on GPU)
(and sibe (CPU-only), though under the ML heading, implements neural networks)
There's a series of blog posts on using TensorFlow from Haskell at https://mmhaskell.com/blog/2017/8/14/starting-out-with-haskell-tensor-flow / https://mmhaskell.com/blog/2017/8/21/digging-in-deep-solving-a-real-problem-with-haskell-tensor-flow etc.
If you're interested in autograd/differentiable programming, the backprop-learn author shows how to add dependent types to a neural network and how to do automatic differentiation (as in TF) from Haskell, which is what eventually turned into the backprop library. See also the ad library (quick demo here).

High-level level language for image processing

My final year project group is planning to build a real time application with neural network support and need to handle image processing efficiently, Any language suggestions would be very much helpful. Thanks.
Mathematica may offer some useful features. The last couple of releases have added quite a lot of image processing functionality. You can get a taste by looking at these blog entries:
How to Make a Webcam Intruder Alarm with Mathematica
The Battle of the Marlborough Maze at Blenheim Palace Continues
The Incredible Convenience of Mathematica Image Processing
Mathematica is an interpreted language, which would appear to present an obstacle to your real-time constraints. However, Mathematica has always integrated well will foreign code (notably C, Java and .NET) and the latest release adds considerable new capabilities with respect to C-code generation, dynamic-library loading and CUDA / OpenCL GPU programming.
Alas, Mathematica is not FOSS and is pretty expensive for commercial use. However, they give great student discounts (90%+, last time I checked) and some college/university departments have site licenses.
On the down side, the Mathematica language is quite unconventional and it takes time to get into the swing of things. IMO, the effort is worth it, but the learning curve might be too long if your project timelines are short.
Note: I am not affiliated with WRI in any way.
My suggestion is OpenCV and C++. OpenCV is also usable with Python, but I don't recommend it if you need to write fast code, Python can be really slow.
How about Python? There is PIL, which
adds image processing capabilities to your Python interpreter. This library supports many file formats, and provides powerful image processing and graphics capabilities.
An introductory article about NN with python and a feed forward NN library:
http://www.ibm.com/developerworks/library/l-neurnet/
http://pypi.python.org/pypi/ffnet/0.6
Matlab provides a lot of features for image processing. May be slightly slow, but I assume performance is not an issue.
ImageMagick is suppose to be real good, but I have no first-hand experience. Mathematica?

What type of programs are C/C++ used for now? [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
in which area is c++ mostly used?
I started off with C in school, went to Java and now I primarily use the P's(Php, Perl, Python) so my exposure to the lower level languages have all but disappeared. I would like to get back into it but I can never justify using C over Perl or Python. What real-world apps are being built with these languages? Any suggestions if I want to dive back in, what can I do with C/C++ that I can't easily do with Perl/Python?
To borrow some text from the answer I had for another related question:
Device drivers in native code.
High performance floating point number crunching (i.e. SIMD).
Easy ability to interface with assembly language routines.
Manage memory manually for extended execution runs.
Most of my work has been C and C++. I studied computer engineering in school and worked with embedded devices. My Master's degree had an emphasis in graphics and visualization. One of our visualization apps was written in Python, but for the most part, graphics demands C/C++ for the speed. I now work with embedded devices running Windows Mobile and Windows CE - all C++, though you can do a lot with C#. I previously worked in simulations, which was all C++ code on the backend. C++ is still king for time-sensitive IO, embedded applications, graphics and simulations.
Basically, if you need tight control of timing, you go lower level. Or if you need light-weight (ie, small program size, small memory footprint)
Somewhat unscientifically I took a look on Sourceforge and the top twenty projects/language break-down is currently thus:
Java(43,199)
C++(34,313)
PHP(28,333)
C(26,711)
C#(12,298)
Python(12,222)
JavaScript(10,307)
Perl(8,931)
Unix Shell(3,618)
Delphi/Kylix(3,353)
Visual Basic(3,044)
Visual Basic .NET(2,513)
Assembly(2,283)
JSP(1,891)
Ruby(1,731)
PL/SQL(1,669)
Objective C(1,424)
ASP.NET(1,344)
Tcl(1,241)
ActionScript(1,164)
Perl + Python together still total less than C alone. I have no idea why Java is so high, I know of no single Java developer and have not seen a single Java project, but I am sure someone is using it! For probably the same reason, you are not seeing much C/C++, you are just not working in a domain where it figures highly. I work in embedded systems where C and C++ are ubiquitous and Python comes nowhere. Different languages are encountered to different extents in different worlds.
You ask what you can do with C/C++ that you cannot do easily with Perl/Python; well the answer is plenty, real-time embedded systems for one; but if that is not what you want/need to do, then there is no reason to. On the other hand I might ask the reverse; I'd use C++ for things you might use Python for, simply because for me it would be easier and quicker (than learning a new language and getting the tools working)
C/C++ can be, and is, used for nearly all "types" of programs.
There are some major advantages to C and C++:
Potentially better performance
Easier to build interoperable libraries, especially if working with libraries usable from multiple languages.
well the interpreters for your "P's" languages are most certainly written in c/c++. Most OS code is written in C/C++. On the application side, if you are into games, they are generally written in c/c++. Anything that needs high performance and or low memory is a good candidate.
I've used Gsoap, a c++ soap client implementation for a web service that got HUGE traffic.
Most desktop/console applications with a bias toward graphics rely heavily on C++. This includes CAD software and AAA video games, among other things.

Resources