You will need to make sure that you have an internet browser and access to Google Colabs at the following site: http://colab.research.google.com/.
Although this book assumes no prior exposure to deep learning or machine learning, you have to have some familiarity with linear algebra and Python programming in order to get the most out of this book.
In order to ensure compatibility with future releases of Python libraries for machine and deep learning, we have included a list of current versions produced with the !pip freeze command in the code bundle and on the GitHub repository of this book; however, these are only for reference and future compatibility – remember that Google Colabs already has all the necessary setup.
We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out! Again, the list of libraries is for reference, but Google Colabs has the latest setup.
If you are using the digital version of this book, we advise you to type the code yourself or access the code via the GitHub repository (link available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.
Once you reach the end of your learning journey using this book, celebrate, and pay close attention to the last chapter of the book, which will point you in new directions. Remember to always keep learning: it is one of the keys to success in life.
Download the example code files
You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.
You can download the code files by following these steps:
- Log in or register at www.packt.com.
- Select the Support tab.
- Click on Code Downloads.
- Enter the name of the book in the Search box and follow the onscreen instructions.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
- WinRAR/7-Zip for Windows
- Zipeg/iZip/UnRarX for Mac
- 7-Zip/PeaZip for Linux
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Deep-Learning-for-Beginners. In case there's an update to the code, it will be updated on the existing GitHub repository.
Download the color images
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://static.packt-cdn.com/downloads/9781838640859_ColorImages.pdf.
Conventions used
There are a number of text conventions used throughout this book.
CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "The predict() methods in the latent encoder model, latent_ncdr, and the autoencoder model produce the output at the specified layers."
A block of code is set as follows:
x = np.array([[1., 1., 0., 1., 1., 0., 0., 0.]]) #216
encdd = latent_ncdr.predict(x)
x_hat = autoencoder.predict(x)
print(encdd)
print(x_hat)
print(np.mean(np.square(x-x_hat)))
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
import matplotlib.pyplot as plt
plt.plot(hist.history['loss'])
plt.title('Model reconstruction loss')
plt.ylabel('MSE')
plt.xlabel('Epoch')
plt.show()
Any command-line input or output is written as follows:
$ pip install tensorflow-gpu
Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "The first important thing is a new activation function called the hyperbolic tangent."