Exercises

Complete the following exercises in your own time and to improve your own learning experience. Improving your understanding of the material will make you a more successful deep learner, and you will likely enjoy this book better as well:

  1. In the Chapter_2_1.py example, change the Conv2D layers to use a different filter size. Run the sample again, and see what effect this has on training performance and accuracy.
  2. Comment out or delete a couple of the MaxPooling layers and corresponding UpSampling layers in the Chapter_2_1.py example. Remember, if you remove a pooling layer between layers 2 and 3, you likewise need to remove the up-sampling to remain consistent. Run the sample again, and see what effect this has on training time, accuracy, and performance.
  3. Alter the Conv2D layers in the Chapter_2_2.py example using a different filter size. See what effect this has on training.
  1. Alter the Conv2D layers in the Chapter_2_2.py example by using a stride value of 2. You may need to consult the Keras docs in order to do this. See what effect this has on training.
  2. Alter the MaxPooling layers in the Chapter_2_2.py example by altering the pooling dimensions. See what effect this has on training.
  3.  Remove all or comment out different MaxPooling layers used in the Chapter_2_3.py example. What happens if all the pooling layers are commented out? Do you need to increase the training epochs now?
  4. Alter the use of Dropout in the various examples used throughout this chapter. This includes adding dropout. Test the effects of using different levels of dropout.
  5. Modify the sample in Chapter_2_4.py so that the model produces better accuracy. What do you need to do in order to improve training performance?
  6. Modify the sample in Chapter_2_4.py to predict more than one character in the sequence. If you need help, go back and review the original blog post for more information.
  7. What happens if you change the number of units that the three LSTM layers use in the Chapter_2_5.py example? What if you increase the value to 128, 32, or 16? Try these values to understand the effect they have.

Feel free to expand on these exercises on your own. Try to write a new example on your own as well, even if it is just a simple one. There really is no better way to learn to code than to write your own.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset