🎓 A1Learner
🔍
0 of 50 lessons completed

Python ML Machine Learning vs Deep Learning vs AI

Artificial intelligence is the big idea. Machine learning is one way to reach it, and deep learning is one kind of machine learning.

Three ideas, three sizes

AI holds four ideas. Machine learning holds two of them. Deep learning holds one.

ai = {"chatbot", "spam filter", "chess program", "face unlock"}
ml = {"spam filter", "face unlock"}
dl = {"face unlock"}
print(len(ai))
print(len(ml))
print(len(dl))

Deep learning sits inside machine learning

Face unlock sits inside deep learning. The spam filter does not. The chess program sits outside machine learning.

ai = {"chatbot", "spam filter", "chess program", "face unlock"}
ml = {"spam filter", "face unlock"}
dl = {"face unlock"}
print("face unlock" in dl)
print("spam filter" in dl)
print("chess program" in ml)

A fixed rule checks a list

Hello is on the known list. Goodbye is not. The rule cannot learn a new word on its own.

known = ["hello", "thanks"]
print("hello" in known)
print("goodbye" in known)

Example

ai = {"chatbot", "spam filter", "chess program", "face unlock", "photo search"}
ml = {"spam filter", "face unlock", "photo search"}
dl = {"face unlock", "photo search"}
print("AI ideas:", len(ai))
print("ML ideas:", len(ml))
print("Deep learning ideas:", len(dl))
print("Deep learning inside ML:", dl <= ml)
print("ML inside AI:", ml <= ai)
print("Chess program uses rules:", "chess program" in ai and "chess program" not in ml)

Key points

  • Artificial intelligence: a program that does a job that needs human thought, like talking or seeing
  • Machine learning: one way to build artificial intelligence, by learning from examples
  • Deep learning: machine learning with a neural network, a layered web of small units that learn together
  • Neural network: layers of small units that pass numbers along and learn from examples
  • Classical machine learning: machine learning without a neural network, using simpler methods on tables of numbers
  • Use deep learning for photos, sound, and long text. Use classical machine learning for neat tables of numbers.

In this example, the three sets show the nesting. Artificial intelligence is the widest set. Machine learning sits inside it. Deep learning sits inside machine learning. The chess program is artificial intelligence built from rules, not from examples. The nesting is the whole idea. Each word names a smaller set than the last.

Note

Deep learning needs far more examples and far more computing power than classical machine learning.

Try it Yourself

Edit the code, then press Run.

Running is simulated · Python Playground

Exercise

What is deep learning?