Live data from Hacker News

Ask HN: Whats the best way to learn C++ for Deep learning?

news.ycombinator.com

21–30 of 31 posts

Re: Ask HN: Whats the best way to learn C++ for Deep learning?

#21
post #8

Might be 3 different skills here: 1) learn c++ 2) learn deep learning 3) learn c++ with deep learning: much easier once you have done 1) and 2)

I am familiar with Python and learned deep learning that way. Now would like to learn C++...

C++ is IMO a bit at the deep end of the pool. I would begin with tutorial information (Meyers and Stroustrup) and work with that. At some point you will get tired of tutorial exercises and start to see how you can use C++ for the topic of DL. I can't comment on Peters as I am not familiar with that.

Hmmm... It seems not possible to search for "The C++ programming language" on amazon. As fast as I type '++' Amazon deletes the characters. >:( Luckily a search for "The C Programming language" also lists the 4th edition of Stroustrups book. ... And after searching via Google, the Amazon page now works. Weird!

Re: Ask HN: Whats the best way to learn C++ for Deep learning?

#22
post #6

You can look at examples from DyNet ( https://dynet.readthedocs.io/en/latest/cpp_basic_tutorial.ht... ) or the C++ Pytorch bindings ( https://pytorch.org/cppdocs/ ). I would strongly recommend python though, as most deep learning work is done with it.

Seconding this. Keep in mind you're not in a "normal" C environment when dealing with GPUs. It's a profoundly negative experience dealing with chip manufacturers (Nvidia) that push proprietary hardware and actively thwart your efforts at producing stable and correct code. It made me realize why Linus had such animosity towards them.

Welcome to embedded hell.

Im just going to solder this pins together, and leave you this handcrafted compiler - which is actually just a normal c-compiler, with alot of the normal operations not working or replaced with - undocumented- and well you will find out.

GFX Cards are just a thousand embedded controllers, glued to a pipeline.

Re: Ask HN: Whats the best way to learn C++ for Deep learning?

#23
post #20

What is your reason for learning "C++ for deep learning"? This will kind of define how to go about doing it. I can think of a few different reasons you might want to do this: * You DL code in another framework is slow, and you have some custom C++ you want to write to speed it up. For this, you probably want to learn both high performance C++ and/or CUDA kernel development. You can probably avoid diving completely in…

I'm very much into the last point, do you have more detailed resources/suggestions?

Re: Ask HN: Whats the best way to learn C++ for Deep learning?

#25
Plenty of examples with CNTK https://docs.microsoft.com/en-us/cognitive-toolkit/cntk-libr...

Also Nvidia have a course https://courses.nvidia.com/courses/course-v1:DLI+C-AC-01+V1/...

But I am also curious why... this is deep-end stuff if you’ll forgive the pun. Why not start with Keras and only dip into the C++ if you need to?

Re: Ask HN: Whats the best way to learn C++ for Deep learning?

#26
Since half the people are ignoring the question and chipping in their own language recommendations. I will join the bandwagon.

Use Java and enjoy C++ like syntax with 80% equivalent performance (based on my experience)

Then try this library - https://deeplearning4j.org/

Re: Ask HN: Whats the best way to learn C++ for Deep learning?

#27
post #3

I think python is generally used for AI and data science stuff, so you'd probably be better off learning that. That said, I think one of the best ways to learn how to do something is dive right into it. I'm currently in the process of writing a deep learning library in C: https://github.com/siekmanj/sieknet So if you're dead set on C++, I'd say the best way is to try to build something cool right off the bat.

My lab (which does extensive collaboration with industry) is all python... I could see maybe building an application that uses a trained model, but I have to agree that python is the current standard for DL research/work.

Re: Ask HN: Whats the best way to learn C++ for Deep learning?

#28
DL libraries are pretty complex and sparsely documented which can make for a painful learning experience, even if you already know C++. Maybe go and learn some graphics programming with C++. You’ll encounter plenty of matrix manipulation, shaders, OpenGL and the like, and there are plenty of really good learning resources and the immediate visual feedback makes for a compelling experience. Then you can return to DL and understand where things are coming from.

Make sure you learn how to use a debugger. You’ll need it.

Re: Ask HN: Whats the best way to learn C++ for Deep learning?

#29
If you are looking for a computational graph toolkit that is based on clean C++ go for Dynet.

It is very complete. Similar to pytorch (which borrowed some ideas from Dynet) and backed up by top academia (not big tech, hence its lower profile). It has a python wrapper as well, as everything nowadays.

If you are into deep learning for sequence to sequence (machine translation) Marian is also C++ centered. Fastest MT around. Complete (transformer and the like), extendable. Not that reading friendly from what I have heard.

Disclaimer: Python type of guy here.

Re: Ask HN: Whats the best way to learn C++ for Deep learning?

#30

Since half the people are ignoring the question and chipping in their own language recommendations. I will join the bandwagon. Use Java and enjoy C++ like syntax with 80% equivalent performance (based on my experience) Then try this library - https://deeplearning4j.org/

Yes, DL4J is a very nice DL framework. I definitely second the recommendation to give it a shot.
Post reply on HN