1

I am currently doing a master's in applied mathematics, and I recently got interested in machine learning and artificial intelligence, and I am thinking of going for a Ph.D. in this area. I have a reasonable maths and stats background, but I haven't done any course in ML/AI. Next semester, I am thinking of doing courses in ML (uses the book by Bishop), AI (uses the book by Norvig) and reinforcement learning at my university. Another advanced course in C++ is being offered, which I am also very interested to take, but the problem is it will be very difficult to manage all of these courses together. I have some knowledge of C++ (built some parts of a reasonably big project in the past but got a bit rusty nowadays) and very basic knowledge of Python, though I find Python much easier to learn and use than C++.

So, my question is: how important is C++ if I go for a Ph.D. in ML/AI/CV/NLP, etc.? Should I bother taking the C++ course or be more focused on Python and do the other three courses i.e., ML, AI, and reinforcement learning?

nbro
  • 39,006
  • 12
  • 98
  • 176
uuuuuuuuuu
  • 111
  • 2
  • 1
    Most real machine learning is done on the GPU, so using python and C++ shouldn't offer that much of a difference in what you can achieve, it would mostly just be that python is 10x easier to use. For example, a lot of the state of the art in machine learning is written using python libraries that handle the complicated GPU stuff for you. There's arguments to be made for C++, but in regards to machine learning, I really don't think it has a place. Python is just better in almost every way IMO – Recessive Jul 09 '21 at 04:00
  • @Recessive Ok, so I better of with ignoring C++ at the moment and mainly focus on the other three courses - ML, AI, and RL. Also, another question - Would you recommend taking the AI course (Book by Norvig is used) because some people said that the book is quite outdated and so is the course and is not that relevant nowadays? – uuuuuuuuuu Jul 09 '21 at 06:39
  • 1
    I learnt all I know through playing around with projects and reading disjointed resources online, so I'm afraid I don't know. However, I can point you towards the Stanford lectures on Youtube (cs231n). They're free and very good. A bit complex if you're just starting, but very informative – Recessive Jul 09 '21 at 06:42
  • 1
    Consider also *generating* C (or C++) code -it could be compiled into a plugin- (see [this answer](https://softwareengineering.stackexchange.com/a/257873/40065)...), and combining *existing* libraries. We aim to do so in [RefPerSys](http://refpersys.org/) – Basile Starynkevitch Jul 11 '21 at 21:04
  • 1
    Learn also *several* programming languages. For example, Scheme (with [SICP](https://mitpress.mit.edu/sites/default/files/sicp/index.html)...) or Prolog. And read the [Dragon book](https://en.wikipedia.org/wiki/Dragon_Book_(computer_science)) to understand how programming languages get implemented. See also [Pitrat's blog](http://bootstrappingartificialintelligence.fr/WordPress3/). – Basile Starynkevitch Jul 11 '21 at 21:11
  • 1
    Consider also reading Pitrat's last book [*Artificial Beings: the conscience of a conscious machine*](https://www.amazon.com/Artificial-Beings-Conscience-Conscious-Machine/dp/1848211015) – Basile Starynkevitch Jul 12 '21 at 06:21

2 Answers2

3

Of course, whether or not you will need to know and use C++ depends on the topics you will research during your Ph.D. or job. If you'll need just to use and/or combine some existing ML models (yes, in a Ph.D., you're expected to come up with new ideas/tools), then you won't probably need to know C++, as the most commonly used libraries for machine learning nowadays, such as TensorFlow, Keras, or PyTorch, have their main APIs written in Python (but there are also APIs written in other languages, but they are not typically as mature as the Python ones), although the core of these libraries is or can be written in C++, but you may never need to have to look at the core of these libraries.

I can say that I also know C++ (of course, not everything or every detail and library, and, of course, my knowledge of it also becomes rusty if I don't use it for a long time), but I rarely need to use my knowledge of C++ to do research in ML or AI (which is what I am currently doing), but, again, it all depends on the topic of your Ph.D. For example, if you wanted to contribute to the progress of OpenCog or if your Ph.D. involved an efficient implementation of some algorithm or data structure, then it may be a good idea to know C++, C, or a programming language like Rust.

nbro
  • 39,006
  • 12
  • 98
  • 176
2

In my experience, knowledge of any particular programming language does not matter. What matters is that you can quickly pick up the basics of a given language.

In my professional work I have been programming in Scala, Java, Groovy, and now Lisp; I didn't really know any of these languages before my working with them (except for Java). But I have been able to pick up a working knowledge in them due to general familiarity with programming (I have been programming in a variety of languages for the past 35 years).

I would assume that knowledge of a specific language becomes relevant if you are acctually working on the tools themselves, where advanced proficiency would be required. For applications using existing libraries this is generally not necessary. As long as you can work with the language, and are able to diagnose why something didn't work, then you should be fine.

Programming concepts are in my view far more important than a specific language.

Oliver Mason
  • 5,322
  • 12
  • 32