Syllabus Lesson 21 of 246 · Module 1: Python for this course
Module 1: Python for this course

Gate: Python for this course (AI off)

Why it matters Pass this and you are ready for the rest of the course. Already know Python and NumPy? You can take this gate first, before the other lessons: passing it marks this module done and opens the next one.

Six short tasks, AI tutor off. Everything here was covered in the lessons above.

Words and symbols in this lesson
array
a NumPy block of numbers, all the same type, that does maths on every item at once
mean, spread
the average, and roughly how far values sit from it (standard deviation)
epoch
one full pass over the training data
Your turn

  1. count_above(xs, limit): how many numbers in a list are strictly above limit.
  2. column_means(X): the mean of each column of a 2D array.
  3. standardise(X): each column to mean 0 and spread 1 (columns with spread 0 become zeros).
  4. center_crop(img, size): the size by size square in the middle of a square image (the image side and size are both even).
  5. best_epoch(val_loss): the epoch number, counting from 1, with the lowest value.
  6. letter_counts(text): a dictionary of how often each letter a to z appears, ignoring case and anything that is not a letter. Only letters that appear are keys: letter_counts("Aa b!") is {'a': 2, 'b': 1}.

AI off: no tutor, hints or worked solution on this one. Your own thinking only.

Spotted a problem in this lesson? Report it · Ask about this lesson

Code · runs in your browser
Output

        

Your progress is counted anonymously. Change this