Ask HN: Full-on machine learning for 2020, what are the best resources?
I want to focus on Machine Learning for this 2020 but I see to many options; Deep Learning, AI, Statistical Theory, Computational Cognitive and more... but to focus just on ML, where should I start? I work mostly as a data analyst on pharma where the focus is batch process.
121 comments
[ 1310 ms ] story [ 2956 ms ] thread[0]http://course18.fast.ai/ml
I've started/stopped a few courses with Georgia Tech's OMSCS program as well which might have been useful, but I still feel like I'm missing some of the mathematical foundation to allow me to make more sense of those courses so Fast.ai's approach seems like it could be a better fit for someone like myself that's more interested in the practical aspects of using it (I just haven't made the effort to go through their content myself).
https://fast.ai - good intro on practical neural networks.
I wrote a guide to ML based NLP. We identify if a sentence is a question, statement or command using neural networks:
https://github.com/lettergram/sentence-classification
The truth is you don’t need to understand all the math right away with neural networks. Mostly it’s getting an understanding of why you use a given layer, bias, etc and when. Once you get some intuition then I’d learn the math.
That’s at least how I instruct others. In any case, there are lots of guides for any flavor. I’d start with deep learning and focus on the “practical” then move to the “theoretical”.
https://fast.ai is unsafe.
Also bear in mind that courses like fast.ai (as you see plastered on here), aggresively market themselves by answering questions all over the internet. Its a form of SEO.
EDIT (Adding this here to explain my point better):
My opinion is that the theory starts to make sense after you know how to use the models and have seen different models produce different results.
Very few people can read about bias variance trade off and in the course of using a model, understand how to take that concept and directly apply it to the problem they are solving. In retrospect, they can look back and understand the outcomes. Also, most theory is useless in the application of ML, and only useful in the active research of new machine learning methods and paradigms. Courses make the mistake of mixing in that useless information.
The same thing is true of the million different optimizers for neural networks. Why different ones work better in different cases is something you would learn when trying to squeeze out performance on a neural network. Who here is intelligent enough to read a bunch about SGD and optimization theory (Adam etc), understand the implications, and then use different optimizers in different situations? No one.
I'm much better off having a mediocre NN, googling, "How to improve my VGG image model accuracy", and then finding out that I should tweak learning rates. Then I google learning rate, read a bit, try it on my model. Rinse and repeat.
Also, I will throw in my consiracy theory that most ML researchers and such push the theory/deep stats requirement as a form of gatekeeping. Modern deep learning results are extremely thin when it comes to theoretical backing.
Learn top down, not bottom up.
Watch maybe one or two short videos on back propagation. You don't need to be muddled in the theory and the math - you can become productive right away.
Once you start playing with pytorch and tensorflow models (train them yourself or do transfer learning), you'll start to develop an intuition for how the network graphs fit together. You'll also pick up tools like tensorboard.
Also, do transfer learning. It's so awesome to train on a publicly-available high quality and large data set, train for a lot of epochs for good problem domain fit, then swap out your own smaller data set. It's magical.
I have a feeling that ML in the future will be like engineering today. You can learn by doing and don't need a degree or formal background to be productive and eventually design your own networks.
I have no formal training (save one undergrad course that was way outdated in "general AI"), and I've designed my own TTS and voice conversion networks. I have real time models that run on the CPU for both of these, and as far as I know they're more performant than anything else out there (on CPU).
Eventually you might start reading papers. (You'll be productive long before you need to do this.) Most ML papers are open access, but review (broad survey) articles might need pirating. Thankfully there are websites that can help you get these. The papers aren't hard to read if you've spent some time playing with the networks they pertain to. Read the summary, abstract, and figures before diving into the paper. It may take a few reads and some googling.
You do not need to be a data scientist. Anybody can do it. That said, a good GPU will help a lot. I'm using two 1080Ti in SLI and they're pretty decent.
I’m someone who took all those math courses and some grad ML coursework. And what that means is that I’m qualified to try and hack together some specific research level things that a practitioner will be confused by, and then try to write a paper about it. It doesn’t mean I’m qualified to do what the practitioner does. Frankly I never ran my code on anything other than MNIST yet and don’t know the different architectures or applications well, since they’re not directly what I work on. They’re just different things, as I see it.
You can also use Google colab for a free GPU/TPU
An alternative is that, by not knowing what you are doing, you may not see all the options that exist -- and when you hit a problem too hard, you just throw more hardware (GPUs) at it.
This is not to say it is not sometimes a valid approach, but I'd be wary of someone who say hasn't had any formal training in C, and says that his stuff is more performant that anything out there- just because lack of training causes not knowing stuff that already exists.
Maybe some will. I just explained that I'm running my models on CPUs, so I'm actually developing sparse and efficient resource constrained models that evaluate quickly.
I've been working with libtorch's JIT engine in Rust (tch.rs bindings).
I'm currently trying to adapt Melgan to the Voice Conversion problem domain so I can get real time, high-fidelity VC without using a classical vocoder. WORLD works great and quickly, but it's a poor substitute for the real thing as it only maps the fundamental frequency, spectral envelope, and aperiodicity. Melgan is super high quality and faaast.
Also check out ParallelWaveGAN, another high-quality and very fast (on CPU) neural vocoder.
[1] https://en.m.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effec...
Very few people can read about bias variance trade off and in the course of using a model, understand how to take that concept and directly apply it to the problem they are solving. In retrospect, they can look back and understand the outcomes. Also, most theory is useless in the application of ML, and only usefull in the active research of new machine learning methods and paradigms. Courses make the mistake of mixing in that useless information.
The same thing is true of the million different optimizers for neural networks. Why different ones work better in different cases is something you would learn when trying to squeeze out performance on a neural network. Who here is intelligent enough to read a bunch about SGD and optimization theory (Adam etc), understand the implications, and then use different optimizers in different situations? No one.
I'm much better off having a mediocre NN, googling, "How to improve my VGG image model accuracy", and then finding out that I should tweak learning rates. Then I google learning rate, read a bit, try it on my model. Rinse and repeat.
Then I tried Kaggle's mini-course. It kickstarted me into ML and motivated me to learn the theory as I go. For example, when I got to apply Random Forest Regressor, I went to Wikipedia and tried to read on it. Got some idea. And the progress is good.
Maybe for some of us, I think top-down is motivating and makes the learning process enjoyable.
One cannot do ML without some basic theoretical knowledge of Statistics and Probability. This gives you the What and the Why behind everything. GI-GO is more true of ML than other disciplines. The techniques used are so opaque that if you don't know what you are doing, you can never trust the results.
The best approach is to learn both concurrently. Learn some theory, apply it and understand that applications including pitfalls, then learn a bit more and repeat. Incremental learning with a solid base. It's fun to hate on academia but this is how experts with deep knowledge of a domain get to where they are.
That said, playing for 1-2 weeks might be a good start towards getting motivated for learning the difficult and dry theory needed to excel in this field.
However, in a business setting, starting from practice is much more effective. As a lead dev and a manager who's had over 20 years of experience in AI/ML I've trained several engineers in building ML systems.
I always start with a business problem and point them to resources (frameworks, blogs, jupyter notebooks) to help them along. The problem is small enough for them to solve in less than a quarter. I avoid micromanaging them and will only answer larger questions by providing more resources. If they really get stuck I'll sit with them and walk through the issue. I have yet to have an engineer be unable to 1) get a model working and 2) tune it to production quality.
Which, well, I use as an opening quote to my intro to deep learning, https://github.com/stared/thinking-in-tensors-writing-in-pyt....
BTW: While information theory is everywhere, I have to yet see where measure theory makes a practical impact on practical deep learning. The importance of pure math for practical machine learning is highly overrated (and I speak as someone who did study that).
No. You will not get beyond copy-paste level without being comfortable with ML foundations. That doesn't mean you need to be able to prove variational inference bounds in your sleep, but you'll want to know why we need things like lower bounds for approximate inference.
but everyone else in here is hyping fastai, which is not just copy-paste but wrapped copy-paste at that (so you're not even learning pytorch).
How to learn ML? Do fastai + reading Daphne Koller's and Chris Bishop's books on PGMs + re-implementing a paper on Gaussian process classification + another paper on GNNs + ....
1. fastai is neural nets 2. bishop's book (and whoever else's) are grad books that require considerable mathematical training to really profit from 3. the aforementioned books don't teach anything practical!
so ultimately i completely agree with the op of this thread - just jump in and read around when things don't work how you expect.
1.) Trains classifier 2.) My train error was so low! Why is my validation error so high 2.) Googles -> Why is my classifier training error lower than my validation error 3.) Learns about overfitting 4.) learns about bias variance
Its always a natural progression. Reading about this stuff without encountering it means it usually doesnt stick, and really doesnt make that much sense.
> All of the theory and such is mostly worthless, its too much to learn from scratch and you will probably use very little of it.
i, too, believe in code before theory. but not for stats, artificial intelligence, or machine learning, numerical computing, etc. why?
because, for instance, if you compare a popular & successful machine learning framework to a "build your own deep neural network in 150 lines of python", the difference as far as data structures or programming constructs choices will be staggering.
especially if you are an experienced programmer. or just someone who cares about the data structures and programming constructs in the first place. but these choices are not accidental!
you will find that "parameters" are represented by a "class", ie. objects with associated operations and not values. why? because you want to do things like accumulate contributions to derivatives, and all these other calculus things i thought i was never going to ever use.
theory is important for people who truly care!
As someone that learned a good bit of the math and implemented NN code with backprop from scratch, I agree with the parent. To learn the math and get better results than cutting edge ML researchers would be as likely as winning the lottery.
As an exercise, the math is fun to learn and not terribly complicated for backprop type of stuff.
If you want to go an applied route I'd suggest starting somewhere like Kaggle and looking through the competitions for ones vaguely similar to yours. They've done all the hard work of choosing a challenging but solvable problem, sourcing and splitting the data, and choosing a metric. You then can see what techniques actually work really well, and benchmark different approaches. Academic challenges like Imagenet or Coco are also good for this, but you'll have to work harder to find relevant resources.
Once you've done this a couple of times, you can start framing your own problems, collecting and annotating your own datasets, deploying and maintaining models.
If you want to make serious money solving real problems, take the time to learn about automated differentiation and all the related mathematics about how gradients flow backwards through the network.
But like the coding slave (great nick BTW) said, first play a bit, then learn how it works. Image transformation GANs are a lot of fun.
Here's why the learning part will be crucial to differentiate you from all the clueless outsourced cheap labor:
Recently, there has been a load of new AI papers by so-called scientists on optical flow, and even the greatest new approaches using millions of parameters and costing hundreds of thousands of dollars to train still DO NOT reach the general level of quality that the 2004 census transform approach had.
Similarly, there have been high-profile papers where people randomly chained together TensorFlow operations to build their loss function, oblivious to the fact that some intermediate operations were not differentiable and, hence, their loss would never back-propagate. As a result, all of their claims had to be fraudulent because one could mathematically prove that their network was incapable of learning.
The larger AI competitions have by now limited the number of submissions that teams are allowed to make per week, simply to discourage people from trying to guess the test results when their AI doesn't work as it should.
Or consider the Uber pedestrian fatality where their neural network was overtrained ( = bad loss function ) to the point where it was unwilling to recognize bicycles at night.
And lastly, not knowing about gradient descent will just waste boatloads of money by 100x-ing your training time. Most stereo disparity and depth estimation AI papers use loss functions that only work on adjacent pixels. That means for a single correction to propagate to all pixels in a HD frame, you'll need 1920 iterations when only 1 could be sufficient.
You will find that my examples are all from autonomous driving. That's because here the discrepancy between GPU-powered brute force amateurs and skilled professionals is the most striking. German luxury cars have integrated lane-keeping, street sign recognition, and safety distance keeping for 10+ years, so for those tasks there are proven algorithms that work on a Pentium III in real time. And now there's lots of NVIDIA GPU kiddies trying to reinvent the wheel with limited success.
For your future employer, you having a firm grasp of how gradients work is the difference between mediocre and state of the art results, and between affordable and too expensive. So if there is one single AI skill that is both exhausting to learn and crucially important, it is differentiation and gradient flow.
Learning the fundamentals of a field is supposed to be gatekeeping. It's what stops you from making stupid mistakes. The field of ML is littered with horrible errors made by people who don't know the fundamentals.
Please don't follow this terrible advice.
I think there's a huge difference between research and learning enough to scrap something together for a hobby project. The deep maths can come later.
I don't need to study compiler theory to use GCC.
* Non-ML: Input + {Rules} = Output
* ML: Input + Output = {Rules}
where "{Rules}" = Infinite set of possible "Programs" each of which is a trace through a very large state space of variables.
In the first case, we humans use all our ingenuity to write the program and tweak it to get the right results. We already know the difficulties involved in writing "correct" programs but have mastered it to some extent.
In the second case, you cannot do that. Your "Programs" are derived by the system and encoded in numbers. How in the world do you even know that your encodings are correct? This is why you need the techniques of Mathematics to transform (eg. Linear Algebra) and constrain (eg. Inferential Statistics/Probability) the output "Rules" so you can have some measure of confidence in it. This is the fundamental challenge inherent in ML.
Easy, you know that they aren't and will ever be entirely correct for complex enough ML problems, just like humans. The ways to handle its errors is not an ML topic though, you just have to ensure via old fashioned system design that the system you build doesn't depend on any ML model to always output correct results.
At the same time, there is a difference whether one starts learning that, and one wants to apply it in a large, production system with social implications (be it advertising, medicine, or anything). Hobby projects, or even small startups, rarely fall in that region.
Moreover, even a profound knowledge of mathematics does not give any edge in ethics, or even - awareness of problems with real data (noise, bias, malicious use, social reception, etc).
I think this advice is directionally correct - reading through a theory-dense textbook like Bishop, which many consider to be a foundational ML textbook, is likely to be a bad use of your time. However, I think it does help to start with some theory, if only to give you the vocabulary with which to think about and get help with issues that you run into. At the risk of sounding like a broken record, Andrew Ng’s class on Coursera (https://www.coursera.org/learn/machine-learning) is quite good - it’s accessible with a bit of basic calculus knowledge (simple single variable derivatives and partial derivatives are all you need) and basic linear algebra (like, matrix multiplication). The whole class took me around 30 hours to get through, so if you’re determined, you could probably finish it in 2-3 weeks even if you’re pretty busy.
Also, if you like having text notes to refer to, I made these notes for myself a few years back when taking the class: https://github.com/tlv/ml_ng. There are some spots where, for my own understanding (I’m a bit of a stickler for mathematical rigor), I added more of the reasoning/equation pushing that Ng glosses over in his lectures. I would say that for a practical understanding of how to apply the concepts covered in the class, there’s no need to read those parts carefully (there’s a reason why Ng glossed over them).
But yeah, to all the people saying you should start by reading entire textbooks on multivariable calculus, statistics, and linear algebra...that’s not necessary. Most ML engineers I’ve met (and even most industry researchers, although my sample size there is much smaller) don’t understand all of those things that deeply.
Also, one last semi-related note - if you’re reading a paper and get intimidated by some really complex math, oftentimes that math is just included to make the paper look more impressive, and sometimes it’s not even correct.
2. Implement their methods from scratch (i.e. numpy not pytorch)
3. Experiment a bit, tweaking the models/algs to gain intuition
4. Repeat 1-3
lol this is basically impossible and completely pointless. please show me a numpy implementation of BERT or CycleGAN or deformable convolutions (note that jax != numpy). it's like suggesting implementing a kernel to someone who wants to learn about virtual memory or scheduling.
better advice would be take a paper and implement the model using pytorch without looking at their implementation and fiddle with that.
If you want to really understand the fundamentals of machine learning (deep learning is just one subset of ML!), there is no substitute for picking up one of the classic texts like: Elements of Statistical Learning (https://web.stanford.edu/~hastie/ElemStatLearn/), Machine Learning: A Probabalistic Approach (https://www.cs.ubc.ca/~murphyk/MLbook/) and going through it slowly.
I'd recommend a two pronged approach: dig into fast.ai while reading a chapter a week (or at w/e pace matches your schedule) of w/e ML textbook you end up choosing. Despite all of the hype of deep learning, you really can do some pretty sweet things (ex: classify images/text) with neural nets within a day or two of getting started. Machine learning is a broad field, and you'll find that you will never know as much as you think you should, and that's okay. The most important thing is to stick to a schedule and be consistent with your learning. Good luck on this journey :)
Personally, I enjoyed both Andrew Ng's and Geoffrey Hinton's respective courses on ML and Neural Networks on Coursera. You may also want to check out Michael Neilsen's online essay on deep learning (http://neuralnetworksanddeeplearning.com). Ultimately I would also encourage you to supplement your understanding by applying this work to your own applications. The universe is often the best teacher.
To be very blunt, in 2020 most ML is still glorified statistics, except you lose the insights and explanations. The only tangible improvements can be random forests - some times. 99% of the stuff you can do with basic statistics. 99% of the coders I know just don't know statistics besides the mean (and even with that, they do senseless things like doing means of means)
So learn statistics - basic statistics, like in the "for dummies" book series.
If you want to be a little more practical, stats "for dummies" is often found in disciplines that depends on stats, but are not very good in math - biology, psychology, and economics are great candidates.
So just download biology basis stats (to know how to compare means - this gives you the A/B test superpower), then psychology factor analysis (to know PCA - this gives you the dimension reduction superpower) then econometrics basic regression (to know linear regression)
With these 3 superpowers, you will be able to do more than most of the "machine learning" people. When you have mastered that, try stuff like random forest, and see if you still think it's as cool as it's hyped to be.
That said, I am not as cynical about “machine learning.” ML and “data science” brought the importance of prediction front and center, i.e. can you fit a model that accurately predict the target value given a previously seen input? This point is made by the recently published stats textbook Computer Age Statistical Inference (Efron and Hastie).
In some applications, it may be beneficial to choose black box models with high predictive accuracy, as the goal for these applications is prediction, not interpreting individual model coefficients.
[0] https://www.coursera.org/learn/machine-learning
[1] https://www.coursera.org/specializations/deep-learning
https://old.reddit.com/r/MachineLearning/comments/ei2iz6/d_i...
I'd compare ML with weather models: we understand physics driving individual particles, we understand the high level diff equations, but as complexity builds up, we have to resort to intuition to develop at least somewhat working weather models.
- MIT: Big Picture of Calculus
- Harvard: Stats 110
- MIT: Matrix Methods in Data Analysis, Signal Processing, and Machine Learning
If any of these seem too difficult - Khan Academy Precalculus (they also have Linear Algebra and Calculus material).
This gives you a math foundation. Some books more specific to ML:
- Foundations of Data Science - Blum et al.
- Elements of Statistical Learning - Hastie et al. The simpler version of this book - Introduction to Statistical Learning - also has a free companion course on Stanford's website.
- Machine Learning: A Probabilistic Perspective - Murphy
That's a lot of material to cover. And at some point you should start experimenting and building things yourself of course. If you'are already familiar with Python, the Data Science Handbook (Jake Vanderplas) is a good guide through the ecosystem of libraries that you would commonly use.
Things I don't recommend - Fast.ai, Goodfellow's Deep Learning Book, Bishop's Pattern Recognition and ML book, Andrew Ng's ML course, Coursera, Udacity, Udemy, Kaggle.
Geron Aurelien's Oreilly book is great - Hands-On Machine Learning with Scikit-Learn and TensorFlow. Get the second edition which covers Tensorflow 2.
But it's ok to start using libraries and fitting models without understanding how they work deeply, and coming back to these books later (just make sure you come back; there's lots of useful ideas in them!) In which case I'd recommend some of the resources the parent doesn't recommend
This doesn't work. ISL is good, but it aims to be accessible by excluding most of the math. So if you go over it, you'll neither "deeply understand ML techniques", nor will you encounter enough math that you can learn along the way as you suggest.
One thing I would add is replicate a couple of ML papers. It can help develop a lot of intuition about the specific area.
You probably are, but for learning purposes that doesn't matter at all.
You can find it from O'Reilly here (http://shop.oreilly.com/product/0636920215912.do) or on Amazon here (https://www.amazon.com/Building-Machine-Learning-Powered-App...).
Any tool needs an applied field but any applied field does not need all the tools. You have an applied field already (pharma), so start looking for one or two state-of-the-art ML papers for that? Happy 2020 and good luck, it’s going to be fun!
I hear that C++ is a nightmare to work with and was wondering if Rust,Julia, or even Swift would be worth learning instead.
I know Python but deep learning frameworks seem to be written in C++, so to come up with new layers I need to understand C++, which I was told has lot of peculiarities that takes time to pick up. Compiler isn’t also very user friendly (what I’ve read)
If you know the basics of programming and have the persistence to. RTFM (Read The Fucking Manual), C++ will not give you any trouble. In fact, you might actually start to enjoy it more than the other languages you used in the past.
All that said, if you are focusing on machine learning rather than programming, then you should look into Python and R. A great resource is “an introduction to data science with R” by David Langer: https://m.youtube.com/watch?v=32o0DnuRjfg
If you want to write your own for fun, then there are some great algebra libraries in C++ you can use or you can use bindings for PyTorch or TF.
I was originally trying to create a new type of convolution layer in Keras and asked in their official google board, stackoverflow etc , after being stuck for a while but the answers I got weren’t solving the problem.
I haven’t tried creating custom layers in Pytorch yet though so maybe it’s possible to do so with Pytorch and can just learn C++ for other purposes.
https://youtu.be/FGfx8CQHdQA
https://youtu.be/OcUXjk7DFvU
https://arxiv.org/abs/1907.07587
https://youtu.be/7Yq1UyncDNc
https://youtu.be/_E2zEzNEy-8
https://youtu.be/6ntJ_al4oXA
https://youtu.be/HfiRnfKxI64
A lot of original excellent data processing, statistical analysis, and ML libraries were built into Python and R, so all the deep learning stuff was built on top of those. R is somewhat harder to integrate into a production pipeline due to its typical reliance on something like RStudio, so Python ended up being the de facto standard as it is also well supported in cloud computing environments.
With TensorFlow API's being written for Swift, we might start to see Swift competing with Python.