Exercise 1. Create a set of 2x2 pixel toy example images.

To get us started, we'll build a toy data set - a small collection of ridiculously small images. This won't be good enough to test our final autoencoder, but it will at least let us see whether the code we've written is runnable.

This is a great trick any time you are doing algorithm development. I didn't invent it, but now I never leave home without it. Having a dead simple example, one where you know exactly what the answer should be, gives you a canary in the coal mine. It won't show you if your algorithm is working as well as you want, but it will show you whether anything is horrendously wrong. There are lots of subtle bugs, especially in complex algorithms like neural networks, that you would never notice if you didn't run some trivial examples through the system.

Coding challenge

  • Create a module called data_loader_two_by_two.py.
  • Within it, create a function called get_data_sets().
  • Withing that, create a list of two-dimensional numpy arrays, called examples.
  • Make each array two rows by two columns.
  • Limit the values between 0 and 1.
  • Make sure each array is different from all the others.
  • Create at least 8. More is even better.

My Solution

Here's the Exercise 1 GitHub repository.

Complete and Continue  
Discussion

7 comments