Deep Learning Cheatsheet
Deep Learning Cheatsheet
Star 7,013
Neural Networks
Neural networks are a class of models that are built with layers. Commonly used types
of neural networks include convolutional and recurrent neural networks.
By noting ii the ithith layer of the network and jj the jthjth hidden unit of the layer, we
have:
z[i]j=w[i]jTx+b[i]j zj[i]=wj[i]Tx+bj[i]
where we note ww, bb, zz the weight, bias and output respectively.
Activation function ― Activation functions are used at the end of a hidden unit to
introduce non-linear complexities to the model. Here are the most common ones:
g(z)=max(ϵz,z)g(
g(z)=11+e−zg( g(z)=ez−e−zez+e−zg(z) g(z)=max(0,z)g(
z)=max(ϵz,z)
z)=11+e−z =ez−e−zez+e−z z)=max(0,z)
with ϵ≪1ϵ≪1
Cross-entropy loss ― In the context of neural networks, the cross-entropy
loss L(z,y)L(z,y) is commonly used and is defined as follows:
L(z,y)=−[ylog(z)+(1−y)log(1−z)] L(z,y)=−[ylog(z)+(1−y)log(1−z)]
Learning rate ― The learning rate, often noted αα or sometimes ηη, indicates at which
pace the weights get updated. This can be fixed or adaptively changed. The current
most popular method is called Adam, which is a method that adapts the learning rate.
w⟵w−α∂L(z,y)∂w w⟵w−α∂L(z,y)∂w
Write to cell or Erase a cell or How much to write to How much to reveal
not? not? cell? cell?
LSTM ― A long short-term memory (LSTM) network is a type of RNN model that avoids
the vanishing gradient problem by adding 'forget' gates.
Reinforcement Learning and Control
The goal of reinforcement learning is for an agent to learn how to evolve in an
environment.
Definitions
Markov decision processes ― A Markov decision process (MDP) is a 5-
tuple (S,A,{Psa},γ,R)(S,A,{Psa},γ,R) where:
- SS is the set of states
- AA is the set of actions
- {Psa}{Psa} are the state transition probabilities for s∈Ss∈S and a∈Aa∈A
- γ∈[0,1[γ∈[0,1[ is the discount factor
- R:S×A⟶RR:S×A⟶R or R:S⟶RR:S⟶R is the reward function that the algorithm
wants to maximize
Value function ― For a given policy ππ and a given state ss, we define the value
function VπVπ as follows:
Vπ(s)=E[R(s0)+γR(s1)+γ2R(s2)+...|s0=s,π] Vπ(s)=E[R(s0)+γR(s1)+γ2R(s2)+...|s0=s,π
]
Vi+1(s)=R(s)+maxa∈A[∑s′∈SγPsa(s′)Vi(s′)] Vi+1(s)=R(s)+maxa∈A[∑s′∈SγPsa(s′)Vi(s′)]
Maximum likelihood estimate ― The maximum likelihood estimates for the state
transition probabilities are as follows:
For a more detailed overview of the concepts above, check out the Deep Learning
cheatsheets!