Deep Learning Flashcards
Deep Learning
deep learning wins over traditional machine
learning
image processing, computer vision, speech recognition, machine translation, art, medical imaging, medical information processing, robotics and control, bio-informatics, natural language processing (NLP), cybersecurity
DL areas
Deep Neural Network (DNN)
Convolutional Neural Network (CNN)
Recurrent Neural Network (RNN) : Long Short Term Memory (LSTM) & Gated Recurrent Units (GRU),
Auto-Encoder (AE),
Deep Belief Network (DBN),
the Generative Adversarial Network (GAN),
Deep Reinforcement Learning (DRL)
DL
Deep Learning (DL) : ML : Neural Networks (NN)
DL approaches
Like machine learning, deep learning approaches can be categorized as follows:
supervised,
semi-supervised or partially supervised,
unsupervised
Reinforcement Learning (RL) or Deep RL (DRL)
Supervised learning
uses labeled data
environment has a set of inputs and corresponding outputs(𝑥𝑡, 𝑦𝑡)~𝜌.
input xt, the intelligent agent predicts 𝑦̂𝑡 = 𝑓(𝑥𝑡),
the agent will receive a loss value 𝑙(𝑦𝑡, 𝑦̂𝑡).
The agent will then iteratively modify the network parameters for better
approximation of the desired outputs.
After successful training,
the agent will be able to get the correct answers to questions
from the environment. There are different supervised learning
approaches for deep leaning including Deep Neural Networks
(DNN), Convolutional Neural Networks (CNN), Recurrent
Neural Networks (RNN) including Long Short Term Memory
(LSTM), and Gated Recurrent Units (GRU).
These networks
are described in Sections 2, 3, 4, and 5 respectively.
- forward propagation algorithm
code to do forward propagation (prediction) for NN
1st input: how many accounts they have
2nd input: how many children they have
model will predict how many transactions the user makes in the next year.
input_data
weights are available in a dictionary called weights
array of weights for the 1st node in the hidden layer are in weights[‘node_0’]
array of weights for the 2nd node in the hidden layer are in weights[‘node_1’]
GluonTS
toolkit for building time series models based on
deep learning and
probabilistic modeling techniques
https://arxiv.org/pdf/1906.05264.pdf
- Rectified Linear Activation Function
“activation function” is a function applied at each node.
It converts the node’s input into some output.
The rectified linear activation function (called ReLU) has been shown to lead to very high-performance networks. This function takes a single number as an input, returning 0 if the input is negative, and the input if the input is positive.
52 transactions
- predict_with_network()
predict_with_network() will generate predictions for multiple data observations, which are pre-loaded as input_data. As before, weights are also pre-loaded. In addition, the relu() function you defined in the previous exercise has been pre-loaded.
- Forward propagation in a deeper network
You now have a model with 2 hidden layers.
The values for an input data point are shown inside the input nodes.
The weights are shown on the edges/lines.
What prediction would this model make on this data point?
Assume the activation function at each node is the identity function.
That is, each node’s output will be the same as its input.
So the value of the bottom node in the first hidden layer is -1, and not 0, as it would be if the ReLU activation function was used.
- Multi-layer neural networks
In this exercise, you’ll write code to do forward propagation for a neural network with 2 hidden layers. Each hidden layer has two nodes. The input data has been preloaded as input_data. The nodes in the first hidden layer are called node_0_0 and node_0_1. Their weights are pre-loaded as weights[‘node_0_0’] and weights[‘node_0_1’] respectively.
The nodes in the second hidden layer are called node_1_0 and node_1_1. Their weights are pre-loaded as weights[‘node_1_0’] and weights[‘node_1_1’] respectively.
We then create a model output from the hidden nodes using weights pre-loaded as weights[‘output’]
Representations are learned
How are the weights that determine the features/interactions in Neural Networks created?
model training process sets them to optimize predictive accuracy.
Levels of representation
Which layers of a model capture more complex or “higher level” interactions?
The last layers capture the most complex interactions.
Calculating model errors
What is the error (predicted - actual) for the following network when the input data is [3, 2] and the actual value of the target (what you are trying to predict) is 5?
The network generates a prediction of 16, which results in an error of 11
Understanding how weights change model accuracy
Imagine you have to make a prediction for a single data point. The actual value of the target is 7.
The weight going from node_0 to the output is 2, as shown below.
If you increased it slightly, changing it to 2.01, would the predictions become more accurate, less accurate, or stay the same?
Increasing the weight to 2.01 would increase the resulting error from 9 to 9.08, making the predictions less accurate.
increasing the weight will lead to a greater or smaller error
The value at node_0 is not 0, so increasing or decreasing the weight going from it to the output will have an affect on the accuracy of the predictions.
Coding how weight changes affect accuracy
02 01
change weights in a real network and see how they affect model accuracy!
Its weights have been pre-loaded as weights_0.
Your task in this exercise is to update a single weight in weights_0 to create weights_1,
which gives a perfect prediction (in which the predicted value is equal to target_actual: 3)
You’ll use the predict_with_network() function,
which takes an array of data as the first argument,
and weights as the second argument.