Neural Networks with TensorFlow and PyTorch
- 13 hours on-demand video
- 1 downloadable resource
- Full lifetime access
- Access on mobile and TV
- Certificate of Completion
Get your team access to 4,000+ top Udemy courses anytime, anywhere.Try Udemy for Business
- Get hands-on and understand Neural Networks with TensorFlow and PyTorch
- Understand how and when to apply autoencoders
- Develop an autonomous agent in an Atari environment with OpenAI Gym
- Apply NLP and sentiment analysis to your data
- Develop a multilayer perceptron neural network to predict fraud and hospital patient readmission
- Build convolutional neural network classifier to automatically identify a photograph
- Learn how to build a recurrent neural network to forecast time series and stock market data
- Know how to build Long Short Term Memory Model (LSTM) model to classify movie reviews as positive or negative using Natural Language Processing (NLP)
- Get familiar with PyTorch fundamentals and code a deep neural network
- Perform image captioning and grammar parsing using Natural Language Processing
- Basic knowledge of Python is required. Familiarity with TensorFlow and PyTorch will be beneficial.
TensorFlow is quickly becoming the technology of choice for deep learning and machine learning, because of its ease to develop powerful neural networks and intelligent machine learning applications. Like TensorFlow, PyTorch has a clean and simple API, which makes building neural networks faster and easier. It's also modular, and that makes debugging your code a breeze. If you’re someone who wants to get hands-on with Deep Learning by building and training Neural Networks, then go for this course.
This course takes a step-by-step approach where every topic is explicated with the help of a real-world examples. You will begin with learning some of the Deep Learning algorithms with TensorFlow such as Convolutional Neural Networks and Deep Reinforcement Learning algorithms such as Deep Q Networks and Asynchronous Advantage Actor-Critic. You will then explore Deep Reinforcement Learning algorithms in-depth with real-world datasets to get a hands-on understanding of neural network programming and Autoencoder applications. You will also predict business decisions with NLP wherein you will learn how to program a machine to identify a human face, predict stock market prices, and process text as part of Natural Language Processing (NLP). Next, you will explore the imperative side of PyTorch for dynamic neural network programming. Finally, you will build two mini-projects, first focusing on applying dynamic neural networks to image recognition and second NLP-oriented problems (grammar parsing).
By the end of this course, you will have a complete understanding of the essential ML libraries TensorFlow and PyTorch for developing and training neural networks of varying complexities, without any hassle.
Meet Your Expert(s):
We have the best work of the following esteemed author(s) to ensure that your learning journey is smooth:
Roland Meertens is currently developing computer vision algorithms for self-driving cars. Previously he has worked as a research engineer at a translation department. Examples of things he has made are a Neural Machine Translation implementation, a post-editor, and a tool that estimates the quality of a translated sentence. Last year, he worked at the Micro Aerial Vehicle Laboratory at the university of Delft, on indoor localization (SLAM) and obstacle avoidance behaviors for a drone that delivers food inside a restaurant. Another thing he worked on was detecting and following people using onboard computer vision algorithms on a stereo camera. For his Master's thesis, he did an internship at a company called SpirOps, where he worked on the development of a dialogue manager for project Romeo. In his Artificial Intelligence study, he specialized in cognitive artificial intelligence and brain-computer interfacing.
Harveen Singh Chadha is an experienced researcher in Deep Learning and is currently working as a Self Driving Car Engineer. He is currently focused on creating an ADAS (Advanced Driver Assistance Systems) platform. His passion is to help people who currently want to enter into the Data Science Universe.
Anastasia Yanina is a Senior Data Scientist with around 5 years of experience. She is an expert in Deep Learning and Natural Language processing and constantly develops her skills as far as possible. She is passionate about human-to-machine interactions. She believes that bridging the gap may become possible with deep neural network architectures.
- This course is for machine learning developers, engineers, and data science professionals who want to work with neural networks and deep learning using powerful Python libraries, TensorFlow and PyTorch.
People often discuss whether being good at deep learning requires a lot of knowledge like a scientist, or requires a lot of practice like an artist. You need a combination of both to build state of the art models.
Understand that deep learning requires knowledge
Understand that deep learning requires practice
Understand that you need both to build state of the art models.
In this course, the viewers only need to install one thing, and that is Docker. With this tool, we put a "virtual operating system" on the viewer’s computer which has all dependencies that they need for this course.
Understand what Docker is
Learn about Downloading Docker
Installe Docker in your system
Learn how to download the source code for this course and build the Docker image. The author will show what commands to enter, and how viewers can open the Jupyter Notebook. Finally, he will show viewers what a Jupyter Notebook is and how it works.
Build the Docker image
Open the Jupyter Notebook for this section
Understand how to use a Jupyter Notebook
Look at the TensorFlow software, and understand what its definition is. The author will build some graphs, and will explain what they do and how to evaluate them in a session. Some TensorFlow functions are compared to their NumPy equivalent.
Understand what TensorFlow is
Build a graph
Evaluate this graph in a session
Although during training it may look as if our neural network learned to classify everything, it's possible it does not generalize to the whole dataset. To see how well our network performs we have to split our data into training and test set.
Know why you want to split your data
Learn how to split data with SKLearn
Evaluate network performance with part of the data
In this video, we will explore other activation functions, and will look at how well the network performs the ReLU function which is used as activation function.
Define a variable that contains the activation function
Change the activation function to RELU
Visualize several activation functions
There are several better methods to estimate these hyperparameters, and we will try grid-search over the learning rate parameter to improve our performance.
Learn what hyperparameters are
Learn about methods to tweak hyperparameters
Do a grid-search over the learning rate variable
We want to download a dataset with images of written digits and save these digits to our datasets folder. We will visualize them with Matplotlib after reshaping them.
Load the MNIST data with TensorFlow
Reshape the vectors to represent an image
Visualize the images with Matplotlib
We will apply what we learned in the previous section on these images and build a deep Neural Network with fully connected layers. We will also write an evaluation function that determines the accuracy of a Neural Network.
Build a deep Neural Network with dense layers
Determine the accuracy of our solution
Compare our result to the state of the art
If you move an image, it's still easy for humans to recognize the image. With our dense layers, the network has to "learn" all positions a character can be at. We will introduce convolutional layers and pooling layers to counter this problem
Understand what convolutional and max pooling layers are
Apply convolutional and max pooling layers in our network
See that we improved our accuracy
Knowing the output activations of a neural network is great, but often you want to see a "probability" per output class. To do this we introduce the softmax function.
Understand what the softmax function does
Add the softmax function to our Neural Network
Inspect the output of the softmax function and linear weighing
We currently used the mean squared error loss function and normal gradient descent. The softmax cross entropy function performs better for classification functions. We will also look at the momentum and the adam optimizer, which often perform better.
Understand what the softmax cross entropy function does
Understand what the momentum and adam optimizer do
Compare our performance with our previous performance
As there are a lot of images, loading them all into our memory would require a lot from our computer space. Instead we will build a pipeline in TensorFlow that reads the images when we need them.
Partition filenames in a train and test set partition vector
Build an input queue with filenames and labels
Preprocess images inside the TensorFlow graph
Each layer learns to respond to the output of the previous layer during backpropagation. A trick to speed up this process AND get better results is called batch normalization. We will add it to the layers in our network.
Understand why batch normalization works
Add batch normalization layers to our network
Compare the output of non-batch normalization and batch normalization
Neural networks sometimes learn something you don't expect. Looking at activations can be an important tool to verify your network is learning something that makes sense. We will also evaluate the performance of our network by drawing a ROC curve.
Visualize the output of a convolutional layer
Explain what the ROC curve is
Draw the ROC curve for our Neural Network
There are a lot of different problems in machine learning you can approach with neural networks. In this section, we are going to learn about autoencoders, siamese Neural Networks, and reinforcement learning.
Discuss what knowledge you should have
Explain what we will learn
During this course, we will download one program with all dependencies using Docker. This video will show you what to download to set up your machine learning workspace.
Download the code for this course
Build and start the Docker container
Sometimes the problem with your Neural Network is not in the network, but in the data you put into it (or get out of it). Luckily, we can inspect both with TensorBoard.
Write inputs to your network to TensorBoard
Look at if the input is correct
Merge all summaries so you can write them all at once
It's often difficult to work with noisy input data. Neural Networks tend to "overfit" on certain patterns, which are disturbed by this noise. Dropout is an effective way to reduce your testing error.
Understand what dropout does
Add dropout to our autoencoder
Compare the results to a network without dropout
By setting the variables in the latent layer to random values, we could generate "new" images of characters. As we don't know in what range we could pick these values, we add an extra loss to our autoencoder that specifies the range we want.
Understand what a variational autoencoder is
Add an extra factor to our loss function
Generate new images of characters
Siamese Neural Networks map input to an output vector. The idea is that this output is similar for similar characters. In this video, we will create such a network with TensorFlow.
Create a Neural Network with shared layers for the input
Determine the distance between the output of your layers
Train the network to create the correct distance
We defined our network in the previous video. Now it's time to train and test it. We use the data load functions from the first video to train and evaluate our performance.
Train the network using our training data
Evaluate the network using our testing data
Determine the accuracy on top-5 and top-20 test cases
In this video, we will explore two different loss functions: a cross-entropy error on the last layer, and a contrastive loss function that works like a "spring".
Try a cross-entropy error on our last layer
Try a contrastive loss error on our last layer
Compare the performance of all three loss functions
We previously built a lot of large neural networks, and will continue to do so in the next section. In this video, we will analyze what factors influence the speed with which we train our Neural Network.
Look at the influence of batch sizes
Look at the influence of the size of dense layers
Look at the influence of the size of convolutional layers
You could try to solve this environment with one simple matrix multiplication with the input. This essentially gives you a single Neural Network, but no way to optimize this with gradient descent.
Frame the problem as single-layer neural network
Generate random matrices and evaluate how good they are
Pick the best matrix till we find one that solves the problem
We will take a look at reinforcement learning, which is a technique where an autonomous agent learns by getting rewards whenever he does something good! We will discuss what q-learning is, and how deep q-networks work.
Learn what deep-q networks are
Implement deep q-networks in TensorFlow
In the previous video, our neural network did not fully solve the environment. In this video, we will look at two tricks that will improve the performance of our Neural Network: epsilon annealing, and limiting the replay memory.
Limit the replay memory
Anneal epsilon during training
Evaluate our newly trained agent
For dataflow and imperative programming you need different tools. Dynamic graphs allow using imperative paradigm. Learning about dynamic graph key features and differences from the static ones is important as far as it goes to writing effective easy-to-read code in PyTorch.
Compare PyTorch and TensorFlow to feel differences in graph definitions
Compare static and dynamic graphs, its pros. and cons.
Learn about dynamic graph applications
Sometimes, there is a necessity to use functions from the Numpy library. This may give more freedom and allow you not to implement some math by yourself. We will explore parameter-less Numpy extensions in this video.
Understand why Numpy extensions are useful
Explore the presented code
Run it on your own
C++ extensions come in two flavors: They can be built with the library called Setuptools, or “just in time”. Setuptools gives you more freedom, but also requires more advanced skills. We will learn how to write C++ extensions using the LLTM example from the official tutorial.
Explore script that uses Setuptools to compile C++ code
Learn about Aten library and pybind11
Define simple C++ code for forward and backward passes
The JIT compilation mechanism provides you with a way of compiling and loading your extensions on the fly by calling a simple function in PyTorch’s API. This way is very simple, but is appropriate only for trivial cases.
Learn about torch.utils. cpp_extension.load()
Learn about an ability to write your own build file
Try to compile and load your extension on the fly
We will learn how to use pretrained neural network for generating image captions and try to fine-tune it on Flickr 8k dataset.
Download Flickr 8k dataset, pretrained model weights and vocabulary
Import encoder and decoder from model.py, implement evaluation function
Fine-tune your network on the Flickr 8k dataset
The ordinary case is that most of your features are words. But we need a cool way to represent them in machine-readable format paying attention to the semantics.
Learn about nn.Embedding
Learn how to load pretrained word vectors
Create neural network with embedding layer (GloVe pretrained vectors)
Understanding the sentence sentiment may be extremely useful in many other NLP tasks. With PyTorch you can build a neural network for detecting whether the sentence is positive or negative.
Prepare the data using TorchText
Build a vocabulary
Implement a neural network overall
Generative models form the basis of machine translation, image captioning, question answering and more. We will learn how to build a model that will generate new poems having been trained on Shakespeare’s poems.
Download the texts
Implement encoder-decoder architecture
Train the network and evaluate the results