Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Neural Network Projects with Python

You're reading from   Neural Network Projects with Python The ultimate guide to using Python to explore the true power of neural networks through six projects

Arrow left icon
Product type Paperback
Published in Feb 2019
Publisher Packt
ISBN-13 9781789138900
Length 308 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
James Loy James Loy
Author Profile Icon James Loy
James Loy
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Machine Learning and Neural Networks 101 2. Predicting Diabetes with Multilayer Perceptrons FREE CHAPTER 3. Predicting Taxi Fares with Deep Feedforward Networks 4. Cats Versus Dogs - Image Classification Using CNNs 5. Removing Noise from Images Using Autoencoders 6. Sentiment Analysis of Movie Reviews Using LSTM 7. Implementing a Facial Recognition System with Neural Networks 8. What's Next? 9. Other Books You May Enjoy

Setting up your computer for machine learning

Before we dive deeper into neural networks and machine learning, let's make sure that you have set up your computer properly, so that you can run the code in this book smoothly.

In this book, we will use the Python programming language for each neural network project. Along with Python itself, we also require several Python libraries, such as Keras, pandas, NumPy, and many more. There are several ways to install Python and the required libraries, but the easiest way by far is to use Anaconda.

Anaconda is a free and open source distribution of Python and its libraries. Anaconda provides a handy package manager that allows us to easily install Python and all other libraries that we require. To install Anaconda, simply head to the website at https://www.anaconda.com/distribution/ and download the Anaconda installer (select the Python 3.x installer).

Besides Anaconda, we also require Git. Git is essential for machine learning and software engineering in general. Git allows us to easily download code from GitHub, which is probably the most widely used software hosting service. To install Git, head to the Git website at https://git-scm.com/book/en/v2/Getting-Started-Installing-Git. You can simply download and run the appropriate installer for your OS.

Once Anaconda and Git are installed, we are ready to download the code for this book. The code that you see in this book can be found in our accompanying GitHub repository.

To download the code, simply run the following command from a command line (use Terminal if you're using macOS/Linux, and if you're using Windows, use the Anaconda Command Prompt):

$ git clone https://github.com/PacktPublishing/Neural-Network-Projects-with-Python

The git clone command will download all the Python code in this book to your computer.

Once that's done, run the following command to move into the folder that you just downloaded:

$ cd Neural-Network-Projects-with-Python

Within the folder, you will find a file titled environment.yml. With this file, we can install Python and all the required libraries into a virtual environment. You can think of a virtual environment as an isolated, sandboxed environment where we can install a fresh copy of Python and all the required libraries. The environment.yml file contains instructions for Anaconda to install a specific version of each library into a virtual environment. This ensures that the Python code will be executed in a standardized environment that we have designed.

To install the required dependencies using Anaconda and the environment.yml file, simply execute the following command from a command line:

$ conda env create -f environment.yml

Just like that, Anaconda will install all required packages into a neural-network-projects-python virtual environment. To enter this virtual environment, we execute this next command:

$ conda activate neural-network-projects-python

That's it! We are now in a virtual environment with all dependencies installed. To execute a Python file in this virtual environment, we can run something like this:

$ python Chapter01\keras_chapter1.py

To leave the virtual environment, we can run the following command:

$ conda deactivate

Just note that you should be within the virtual environment (by running conda activate neural-network-projects-python first) whenever you run any Python code provided by us.

Now that we've set up our computer, let's return back to neural networks. We'll look at the theory behind neural networks, and how to program one from scratch in Python.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image