SlideShare uma empresa Scribd logo
1 de 26
Tópicos
• Regressão Linear e Regressão Logística
• Método do Gradiente
• Redes Neurais
• Forward e Backward Propagation
• Inicialização
• Otimizações
Conteúdo básico para entender redes neurais
2
Regressão Linear
Todo o conteúdo básico para entender redes neurais
3
Hipótese:
𝒚 = 𝒘𝒙 + 𝒃
Função de custo:
𝑳 =
𝟏
𝟐𝒎
𝒊=𝟏
𝒎
𝒚(𝒊) − 𝒚(𝒊) 𝟐
Conteúdo básico para entender redes neurais
Área [pés²]
Preço[1000’sUS$]
Regressão Logística
Todo o conteúdo básico para entender redes neurais
4
Hipótese:
𝒚 = 𝒘𝒙 + 𝒃
Hipótese:
𝒚 = 𝝈 𝒘𝒙 + 𝒃
𝜎 𝑥 =
1
1 + 𝑒 𝑥
𝑥 𝑐
0,5
𝑥 𝑐
0,50,5
𝑥 𝑐
Conteúdo básico para entender redes neurais
Regressão Logística
Todo o conteúdo básico para entender redes neurais
5
Hipótese:
𝒚 = 𝝈 𝒘 𝟏 𝒙 𝟏 + 𝒘 𝟐 𝒙 𝟐 + 𝒃
Conteúdo básico para entender redes neurais
Regressão Logística
Todo o conteúdo básico para entender redes neurais
6
Hipótese:
𝒚 = 𝝈 𝒘 𝟏 𝒙 𝟏 + 𝒘 𝟐 𝒙 𝟐 + 𝒃𝒚 𝟏
𝒚 𝟐
𝒚 𝟑
=
𝝈 𝒘 𝟏𝟏 𝒙 𝟏 + 𝒘 𝟏𝟐 𝒙 𝟐 + 𝒃 𝟏
𝝈 𝒘 𝟐𝟏 𝒙 𝟏 + 𝒘 𝟐𝟐 𝒙 𝟐 + 𝒃 𝟐
𝝈 𝒘 𝟑𝟏 𝒙 𝟏 + 𝒘 𝟑𝟐 𝒙 𝟐 + 𝒃 𝟑
Hipótese:
0,7
0,2
0,1
=
𝝈 𝒘 𝟏𝟏 𝒙 𝟏 + 𝒘 𝟏𝟐 𝒙 𝟐 + 𝒃 𝟏
𝝈 𝒘 𝟐𝟏 𝒙 𝟏 + 𝒘 𝟐𝟐 𝒙 𝟐 + 𝒃 𝟐
𝝈 𝒘 𝟑𝟏 𝒙 𝟏 + 𝒘 𝟑𝟐 𝒙 𝟐 + 𝒃 𝟑
Hipótese:
Conteúdo básico para entender redes neurais
Todo o conteúdo básico para entender redes neurais
7
Cross-Entropy
𝑫 𝒚, 𝒚 ≠ 𝑫 𝒚, 𝒚
𝑫 𝒚, 𝒚 = −
𝒌=𝟏
𝑲
𝒚 𝒌 𝒍𝒐𝒈 𝒚 𝒌 + 𝟏 − 𝒚 𝒌 𝒍𝒐𝒈 𝟏 − 𝒚 𝒌𝑫 𝒚, 𝒚 = −
𝒌=𝟏
𝑲
𝒚 𝒌 𝒍𝒐𝒈 𝒚 𝒌 + 𝟏 − 𝒚 𝒌 𝒍𝒐𝒈 𝟏 − 𝒚 𝒌𝑫 𝒚, 𝒚 = −
𝒌=𝟏
𝑲
𝒚 𝒌 𝒍𝒐𝒈 𝒚 𝒌 + 𝟏 − 𝒚 𝒌 𝒍𝒐𝒈 𝟏 − 𝒚 𝒌𝑫 𝒚, 𝒚 = −
𝒌=𝟏
𝑲
𝒚 𝒌 𝒍𝒐𝒈 𝒚 𝒌 + 𝟏 − 𝒚 𝒌 𝒍𝒐𝒈 𝟏 − 𝒚 𝒌
𝒚 𝒚
0,7
0,2
0,1
𝟏, 𝟎
𝟎, 𝟎
𝟎, 𝟎
Conteúdo básico para entender redes neurais
Função de custo
𝑳 =
𝟏
𝒎
𝒊=𝟏
𝒎
𝑫 𝝈 𝑾𝒙(𝒊)
+ 𝒃 , 𝒚(𝒊)
Todo o conteúdo básico para entender redes neurais
8
Conteúdo básico para entender redes neurais
Estrutura de uma regressão logística
𝑳 =
𝟏
𝒎
𝒊=𝟏
𝒎
𝑫 𝝈 𝑾𝒙(𝒊)
+ 𝒃 , 𝒚(𝒊)
Todo o conteúdo básico para entender redes neurais
9
2,0
1,0
0,1
𝒚
0,7
0,2
0,1
1,0
0,0
0,0
𝒚
𝑫 𝒚, 𝒚𝑾𝒙 + 𝒃
2,0
1,0
0,1
𝒙 𝒔𝒄𝒐𝒓𝒆
𝝈 𝑾𝒙 + 𝒃
Conteúdo básico para entender redes neurais
Método do Gradiente (Gradient Descent)
Todo o conteúdo básico para entender redes neurais
10
Figura 1. Método do gradiente (Coursera).
𝑳 𝒘 𝟏, 𝒘 𝟐
𝒘 𝟏
𝒘 𝟐
Conteúdo básico para entender redes neurais
Método do Gradiente (Gradient Descent)
Todo o conteúdo básico para entender redes neurais
11
Figura 2. Função convexa (Coursera).
𝑳𝒘𝟏,𝒘𝟐
𝒘 𝟏 𝒘 𝟐
Conteúdo básico para entender redes neurais
Método do Gradiente (Gradient Descent)
Todo o conteúdo básico para entender redes neurais
12
Figura 3. Método do gradiente (Udacity).
𝑳 𝒘 𝟏, 𝒘 𝟐
𝒘 𝟏
𝒘 𝟐
−𝜶∆𝑳 𝒘 𝟏, 𝒘 𝟐
dezenas de iterações
utiliza todos os dados
a cada iteração
Conteúdo básico para entender redes neurais
Método do Gradiente Estocástico (S. G. D.)
Todo o conteúdo básico para entender redes neurais
13
Figura 4. Método do gradiente estocástico (Udacity).
𝑳 𝒘 𝟏, 𝒘 𝟐
𝒘 𝟏
𝒘 𝟐
−𝜶∆𝑳 𝒘 𝟏, 𝒘 𝟐
dezenas de iterações
utiliza todos os dados
a cada iteração
de centenas a milhares utiliza uma pequena
amostra aleatória dos dados
Conteúdo básico para entender redes neurais
Método do Gradiente Estocástico (S. G. D.)
Todo o conteúdo básico para entender redes neurais
14
Figura 5. Otimizações do método do gradiente estocástico (Udacity).
𝑳 𝒘 𝟏, 𝒘 𝟐
𝒘 𝟏
𝒘 𝟐
−𝜶𝑴 𝒘 𝟏, 𝒘 𝟐
𝑴 ← 𝟎, 𝟗𝑴 + ∆𝑳
Conteúdo básico para entender redes neurais
Redes Neurais
Todo o conteúdo básico para entender redes neurais
15
𝟏
𝒙 𝟏
𝒙 𝟐
𝟏
𝒂 𝟏
(𝟐)
𝒂 𝟐
(𝟐)
𝒚 𝟏
𝒚
𝒚 𝟐
𝒚 𝒚 𝟐
𝟏
𝒙 𝟏
𝒙 𝟐
𝟏
𝒂 𝟏
(𝟐)
𝒂 𝟐
(𝟐)
𝟏
𝒂 𝟏
(𝟑)
𝒂 𝟐
(𝟑)
𝒚 𝟏
𝒚 𝟐
𝒚 𝟑
Conteúdo básico para entender redes neurais
Redes Neurais
Todo o conteúdo básico para entender redes neurais
16
Figura 6. Redes Neurais (Udacity).
h
𝒙 𝒚
𝒚𝒙 𝑾 𝒃
𝑾(𝟏)
𝑾(𝟐)𝒃(𝟏) 𝒃(𝟐)
Conteúdo básico para entender redes neurais
Redes Neurais
Todo o conteúdo básico para entender redes neurais
17
Figura 7. Largura e profundidade de uma Rede Neural (Udacity).
larga profunda
(wide) (deep)
vs.
𝒚𝒙
𝒚𝒙
Conteúdo básico para entender redes neurais
Redes Neurais
Todo o conteúdo básico para entender redes neurais
18
Figura 8. Mimetização do processo de aprendizagem humana (Udacity).
𝒚𝒙
Conteúdo básico para entender redes neurais
Forward Propagation
Todo o conteúdo básico para entender redes neurais
19
𝟏
𝒙 𝟏
𝒙 𝟐
𝟏
𝒂 𝟏
(𝟐)
𝒂 𝟐
(𝟐)
𝟏
𝒂 𝟏
(𝟑)
𝒂 𝟐
(𝟑)
𝒚 𝟏
𝒚 𝟐
𝒚 𝟑
𝒂(𝟏) = 𝒙(𝒊)
𝒂(𝟐) = 𝝈 𝑾(𝟏) 𝒂(𝟏) + 𝒃(𝟏)
𝒂(𝟑) = 𝝈 𝑾(𝟐) 𝒂(𝟐) + 𝒃(𝟐)
𝒂(𝟒) = 𝝈 𝑾(𝟑) 𝒂(𝟑) + 𝒃(𝟑) = 𝒚
𝑾(𝟏)
𝒃(𝟏) 𝑾(𝟐)
𝒃(𝟐) 𝑾(𝟑)
𝒃(𝟑)
Conteúdo básico para entender redes neurais
Backward Propagation
Todo o conteúdo básico para entender redes neurais
20
𝟏
𝒙 𝟏
𝒙 𝟐
𝟏
𝜹 𝟏
(𝟐)
𝜹 𝟐
(𝟐)
𝟏
𝜹 𝟏
(𝟑)
𝜹 𝟐
(𝟑)
𝜹 𝟏
(𝟒)
𝜹 𝟐
(𝟒)
𝜹 𝟑
(𝟒)
𝜹(𝟒) = 𝒂(𝟒) − 𝒚(𝒊) = 𝒚 − 𝒚(𝒊)
𝜹(𝟑) = 𝑾 𝟑 𝑻 𝜹(𝟒) .∗ 𝒂′(𝟑)
𝜹(𝟐) = 𝑾 𝟐 𝑻 𝜹(𝟑) .∗ 𝒂′(𝟐)
𝝏𝑳(𝑾)
𝝏𝑾𝒍
= 𝜹(𝒍+𝟏) 𝒂 𝒍 𝑻
𝜹(𝟏)
Conteúdo básico para entender redes neurais
𝑾(𝟏) 𝑾(𝟐) 𝑾(𝟑)
𝒂′(𝒍)
= 𝒂(𝒍)
.∗ 𝟏 − 𝒂(𝒍)
Inicialização
Todo o conteúdo básico para entender redes neurais
21
Figura 10. Normalização da entrada (Udacity).
mal condicionado bem condicionado
Variâncias
equivalentes
Médias
iguais a zero
Conteúdo básico para entender redes neurais
Inicialização
𝑳 =
𝟏
𝒎
𝒊=𝟏
𝒎
𝑫 𝝈 𝑾𝒙(𝒊)
+ 𝒃 , 𝒚(𝒊)
Todo o conteúdo básico para entender redes neurais
22
𝒙𝒋
(𝒊)
=
𝒙𝒋
(𝒊)
− 𝝁(𝒊)
𝝈(𝒊)
Conteúdo básico para entender redes neurais
∅
Todo o conteúdo básico para entender redes neurais
23
Otimizações – Regularização L2
𝑳′
= 𝑳 + 𝜷
𝟏
𝟐
𝑾 𝟐
𝟐
novo custo
custo
𝑾 𝟐
𝟐
= 𝑾 𝑻
𝑾
𝑾
Conteúdo básico para entender redes neurais
Otimizações – Drop out
Todo o conteúdo básico para entender redes neurais
24
𝟏, 𝟎
𝟎, 𝟐
−𝟎, 𝟑
𝟎, 𝟓
𝟏, 𝟎
𝟎, 𝟐
−𝟎, 𝟑
𝟎, 𝟓
𝟎, 𝟎
𝟎, 𝟐
−𝟎, 𝟑
𝟎, 𝟎
𝟏, 𝟎
𝟎, 𝟐
𝟎, 𝟎
𝟎, 𝟎
𝟎, 𝟎
𝟎, 𝟐
𝟎, 𝟎
𝟎, 𝟓
ativações
Conteúdo básico para entender redes neurais
𝒚𝒙
Otimizações – Drop out
Todo o conteúdo básico para entender redes neurais
25
𝟏, 𝟎
𝟎, 𝟐
−𝟎, 𝟑
𝟎, 𝟓
𝟎, 𝟎
𝟎, 𝟐
𝟎, 𝟎
𝟎, 𝟓
treinamento
𝒚 𝒕
𝟎
𝒙𝟐
𝟎
𝒙𝟐
𝟏, 𝟎
𝟎, 𝟐
−𝟎, 𝟑
𝟎, 𝟓
𝟏, 𝟎
𝟎, 𝟐
−𝟎, 𝟑
𝟎, 𝟓
validação
𝒚 𝒗
Conteúdo básico para entender redes neurais
Referências
Machine Learning –
https://www.coursera.org/learn/machine-learning
Deep Learning –
https://br.udacity.com/course/deep-learning--ud730/
NLP with Deep Learning –
http://web.stanford.edu/class/cs224n/syllabus.html
TensorFlow
https://www.tensorflow.org/
GitHub – Pedro Lelis
https://github.com/PedroLelis/udacity-deep-learning
Todo o conteúdo básico para entender redes neurais
26
Conteúdo básico para entender redes neurais

Mais conteúdo relacionado

Destaque

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 

Destaque (20)

Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 

Apresentação Nubank - Neural Network - 18 de abril de 2017

  • 1.
  • 2. Tópicos • Regressão Linear e Regressão Logística • Método do Gradiente • Redes Neurais • Forward e Backward Propagation • Inicialização • Otimizações Conteúdo básico para entender redes neurais 2
  • 3. Regressão Linear Todo o conteúdo básico para entender redes neurais 3 Hipótese: 𝒚 = 𝒘𝒙 + 𝒃 Função de custo: 𝑳 = 𝟏 𝟐𝒎 𝒊=𝟏 𝒎 𝒚(𝒊) − 𝒚(𝒊) 𝟐 Conteúdo básico para entender redes neurais Área [pés²] Preço[1000’sUS$]
  • 4. Regressão Logística Todo o conteúdo básico para entender redes neurais 4 Hipótese: 𝒚 = 𝒘𝒙 + 𝒃 Hipótese: 𝒚 = 𝝈 𝒘𝒙 + 𝒃 𝜎 𝑥 = 1 1 + 𝑒 𝑥 𝑥 𝑐 0,5 𝑥 𝑐 0,50,5 𝑥 𝑐 Conteúdo básico para entender redes neurais
  • 5. Regressão Logística Todo o conteúdo básico para entender redes neurais 5 Hipótese: 𝒚 = 𝝈 𝒘 𝟏 𝒙 𝟏 + 𝒘 𝟐 𝒙 𝟐 + 𝒃 Conteúdo básico para entender redes neurais
  • 6. Regressão Logística Todo o conteúdo básico para entender redes neurais 6 Hipótese: 𝒚 = 𝝈 𝒘 𝟏 𝒙 𝟏 + 𝒘 𝟐 𝒙 𝟐 + 𝒃𝒚 𝟏 𝒚 𝟐 𝒚 𝟑 = 𝝈 𝒘 𝟏𝟏 𝒙 𝟏 + 𝒘 𝟏𝟐 𝒙 𝟐 + 𝒃 𝟏 𝝈 𝒘 𝟐𝟏 𝒙 𝟏 + 𝒘 𝟐𝟐 𝒙 𝟐 + 𝒃 𝟐 𝝈 𝒘 𝟑𝟏 𝒙 𝟏 + 𝒘 𝟑𝟐 𝒙 𝟐 + 𝒃 𝟑 Hipótese: 0,7 0,2 0,1 = 𝝈 𝒘 𝟏𝟏 𝒙 𝟏 + 𝒘 𝟏𝟐 𝒙 𝟐 + 𝒃 𝟏 𝝈 𝒘 𝟐𝟏 𝒙 𝟏 + 𝒘 𝟐𝟐 𝒙 𝟐 + 𝒃 𝟐 𝝈 𝒘 𝟑𝟏 𝒙 𝟏 + 𝒘 𝟑𝟐 𝒙 𝟐 + 𝒃 𝟑 Hipótese: Conteúdo básico para entender redes neurais
  • 7. Todo o conteúdo básico para entender redes neurais 7 Cross-Entropy 𝑫 𝒚, 𝒚 ≠ 𝑫 𝒚, 𝒚 𝑫 𝒚, 𝒚 = − 𝒌=𝟏 𝑲 𝒚 𝒌 𝒍𝒐𝒈 𝒚 𝒌 + 𝟏 − 𝒚 𝒌 𝒍𝒐𝒈 𝟏 − 𝒚 𝒌𝑫 𝒚, 𝒚 = − 𝒌=𝟏 𝑲 𝒚 𝒌 𝒍𝒐𝒈 𝒚 𝒌 + 𝟏 − 𝒚 𝒌 𝒍𝒐𝒈 𝟏 − 𝒚 𝒌𝑫 𝒚, 𝒚 = − 𝒌=𝟏 𝑲 𝒚 𝒌 𝒍𝒐𝒈 𝒚 𝒌 + 𝟏 − 𝒚 𝒌 𝒍𝒐𝒈 𝟏 − 𝒚 𝒌𝑫 𝒚, 𝒚 = − 𝒌=𝟏 𝑲 𝒚 𝒌 𝒍𝒐𝒈 𝒚 𝒌 + 𝟏 − 𝒚 𝒌 𝒍𝒐𝒈 𝟏 − 𝒚 𝒌 𝒚 𝒚 0,7 0,2 0,1 𝟏, 𝟎 𝟎, 𝟎 𝟎, 𝟎 Conteúdo básico para entender redes neurais
  • 8. Função de custo 𝑳 = 𝟏 𝒎 𝒊=𝟏 𝒎 𝑫 𝝈 𝑾𝒙(𝒊) + 𝒃 , 𝒚(𝒊) Todo o conteúdo básico para entender redes neurais 8 Conteúdo básico para entender redes neurais
  • 9. Estrutura de uma regressão logística 𝑳 = 𝟏 𝒎 𝒊=𝟏 𝒎 𝑫 𝝈 𝑾𝒙(𝒊) + 𝒃 , 𝒚(𝒊) Todo o conteúdo básico para entender redes neurais 9 2,0 1,0 0,1 𝒚 0,7 0,2 0,1 1,0 0,0 0,0 𝒚 𝑫 𝒚, 𝒚𝑾𝒙 + 𝒃 2,0 1,0 0,1 𝒙 𝒔𝒄𝒐𝒓𝒆 𝝈 𝑾𝒙 + 𝒃 Conteúdo básico para entender redes neurais
  • 10. Método do Gradiente (Gradient Descent) Todo o conteúdo básico para entender redes neurais 10 Figura 1. Método do gradiente (Coursera). 𝑳 𝒘 𝟏, 𝒘 𝟐 𝒘 𝟏 𝒘 𝟐 Conteúdo básico para entender redes neurais
  • 11. Método do Gradiente (Gradient Descent) Todo o conteúdo básico para entender redes neurais 11 Figura 2. Função convexa (Coursera). 𝑳𝒘𝟏,𝒘𝟐 𝒘 𝟏 𝒘 𝟐 Conteúdo básico para entender redes neurais
  • 12. Método do Gradiente (Gradient Descent) Todo o conteúdo básico para entender redes neurais 12 Figura 3. Método do gradiente (Udacity). 𝑳 𝒘 𝟏, 𝒘 𝟐 𝒘 𝟏 𝒘 𝟐 −𝜶∆𝑳 𝒘 𝟏, 𝒘 𝟐 dezenas de iterações utiliza todos os dados a cada iteração Conteúdo básico para entender redes neurais
  • 13. Método do Gradiente Estocástico (S. G. D.) Todo o conteúdo básico para entender redes neurais 13 Figura 4. Método do gradiente estocástico (Udacity). 𝑳 𝒘 𝟏, 𝒘 𝟐 𝒘 𝟏 𝒘 𝟐 −𝜶∆𝑳 𝒘 𝟏, 𝒘 𝟐 dezenas de iterações utiliza todos os dados a cada iteração de centenas a milhares utiliza uma pequena amostra aleatória dos dados Conteúdo básico para entender redes neurais
  • 14. Método do Gradiente Estocástico (S. G. D.) Todo o conteúdo básico para entender redes neurais 14 Figura 5. Otimizações do método do gradiente estocástico (Udacity). 𝑳 𝒘 𝟏, 𝒘 𝟐 𝒘 𝟏 𝒘 𝟐 −𝜶𝑴 𝒘 𝟏, 𝒘 𝟐 𝑴 ← 𝟎, 𝟗𝑴 + ∆𝑳 Conteúdo básico para entender redes neurais
  • 15. Redes Neurais Todo o conteúdo básico para entender redes neurais 15 𝟏 𝒙 𝟏 𝒙 𝟐 𝟏 𝒂 𝟏 (𝟐) 𝒂 𝟐 (𝟐) 𝒚 𝟏 𝒚 𝒚 𝟐 𝒚 𝒚 𝟐 𝟏 𝒙 𝟏 𝒙 𝟐 𝟏 𝒂 𝟏 (𝟐) 𝒂 𝟐 (𝟐) 𝟏 𝒂 𝟏 (𝟑) 𝒂 𝟐 (𝟑) 𝒚 𝟏 𝒚 𝟐 𝒚 𝟑 Conteúdo básico para entender redes neurais
  • 16. Redes Neurais Todo o conteúdo básico para entender redes neurais 16 Figura 6. Redes Neurais (Udacity). h 𝒙 𝒚 𝒚𝒙 𝑾 𝒃 𝑾(𝟏) 𝑾(𝟐)𝒃(𝟏) 𝒃(𝟐) Conteúdo básico para entender redes neurais
  • 17. Redes Neurais Todo o conteúdo básico para entender redes neurais 17 Figura 7. Largura e profundidade de uma Rede Neural (Udacity). larga profunda (wide) (deep) vs. 𝒚𝒙 𝒚𝒙 Conteúdo básico para entender redes neurais
  • 18. Redes Neurais Todo o conteúdo básico para entender redes neurais 18 Figura 8. Mimetização do processo de aprendizagem humana (Udacity). 𝒚𝒙 Conteúdo básico para entender redes neurais
  • 19. Forward Propagation Todo o conteúdo básico para entender redes neurais 19 𝟏 𝒙 𝟏 𝒙 𝟐 𝟏 𝒂 𝟏 (𝟐) 𝒂 𝟐 (𝟐) 𝟏 𝒂 𝟏 (𝟑) 𝒂 𝟐 (𝟑) 𝒚 𝟏 𝒚 𝟐 𝒚 𝟑 𝒂(𝟏) = 𝒙(𝒊) 𝒂(𝟐) = 𝝈 𝑾(𝟏) 𝒂(𝟏) + 𝒃(𝟏) 𝒂(𝟑) = 𝝈 𝑾(𝟐) 𝒂(𝟐) + 𝒃(𝟐) 𝒂(𝟒) = 𝝈 𝑾(𝟑) 𝒂(𝟑) + 𝒃(𝟑) = 𝒚 𝑾(𝟏) 𝒃(𝟏) 𝑾(𝟐) 𝒃(𝟐) 𝑾(𝟑) 𝒃(𝟑) Conteúdo básico para entender redes neurais
  • 20. Backward Propagation Todo o conteúdo básico para entender redes neurais 20 𝟏 𝒙 𝟏 𝒙 𝟐 𝟏 𝜹 𝟏 (𝟐) 𝜹 𝟐 (𝟐) 𝟏 𝜹 𝟏 (𝟑) 𝜹 𝟐 (𝟑) 𝜹 𝟏 (𝟒) 𝜹 𝟐 (𝟒) 𝜹 𝟑 (𝟒) 𝜹(𝟒) = 𝒂(𝟒) − 𝒚(𝒊) = 𝒚 − 𝒚(𝒊) 𝜹(𝟑) = 𝑾 𝟑 𝑻 𝜹(𝟒) .∗ 𝒂′(𝟑) 𝜹(𝟐) = 𝑾 𝟐 𝑻 𝜹(𝟑) .∗ 𝒂′(𝟐) 𝝏𝑳(𝑾) 𝝏𝑾𝒍 = 𝜹(𝒍+𝟏) 𝒂 𝒍 𝑻 𝜹(𝟏) Conteúdo básico para entender redes neurais 𝑾(𝟏) 𝑾(𝟐) 𝑾(𝟑) 𝒂′(𝒍) = 𝒂(𝒍) .∗ 𝟏 − 𝒂(𝒍)
  • 21. Inicialização Todo o conteúdo básico para entender redes neurais 21 Figura 10. Normalização da entrada (Udacity). mal condicionado bem condicionado Variâncias equivalentes Médias iguais a zero Conteúdo básico para entender redes neurais
  • 22. Inicialização 𝑳 = 𝟏 𝒎 𝒊=𝟏 𝒎 𝑫 𝝈 𝑾𝒙(𝒊) + 𝒃 , 𝒚(𝒊) Todo o conteúdo básico para entender redes neurais 22 𝒙𝒋 (𝒊) = 𝒙𝒋 (𝒊) − 𝝁(𝒊) 𝝈(𝒊) Conteúdo básico para entender redes neurais ∅
  • 23. Todo o conteúdo básico para entender redes neurais 23 Otimizações – Regularização L2 𝑳′ = 𝑳 + 𝜷 𝟏 𝟐 𝑾 𝟐 𝟐 novo custo custo 𝑾 𝟐 𝟐 = 𝑾 𝑻 𝑾 𝑾 Conteúdo básico para entender redes neurais
  • 24. Otimizações – Drop out Todo o conteúdo básico para entender redes neurais 24 𝟏, 𝟎 𝟎, 𝟐 −𝟎, 𝟑 𝟎, 𝟓 𝟏, 𝟎 𝟎, 𝟐 −𝟎, 𝟑 𝟎, 𝟓 𝟎, 𝟎 𝟎, 𝟐 −𝟎, 𝟑 𝟎, 𝟎 𝟏, 𝟎 𝟎, 𝟐 𝟎, 𝟎 𝟎, 𝟎 𝟎, 𝟎 𝟎, 𝟐 𝟎, 𝟎 𝟎, 𝟓 ativações Conteúdo básico para entender redes neurais 𝒚𝒙
  • 25. Otimizações – Drop out Todo o conteúdo básico para entender redes neurais 25 𝟏, 𝟎 𝟎, 𝟐 −𝟎, 𝟑 𝟎, 𝟓 𝟎, 𝟎 𝟎, 𝟐 𝟎, 𝟎 𝟎, 𝟓 treinamento 𝒚 𝒕 𝟎 𝒙𝟐 𝟎 𝒙𝟐 𝟏, 𝟎 𝟎, 𝟐 −𝟎, 𝟑 𝟎, 𝟓 𝟏, 𝟎 𝟎, 𝟐 −𝟎, 𝟑 𝟎, 𝟓 validação 𝒚 𝒗 Conteúdo básico para entender redes neurais
  • 26. Referências Machine Learning – https://www.coursera.org/learn/machine-learning Deep Learning – https://br.udacity.com/course/deep-learning--ud730/ NLP with Deep Learning – http://web.stanford.edu/class/cs224n/syllabus.html TensorFlow https://www.tensorflow.org/ GitHub – Pedro Lelis https://github.com/PedroLelis/udacity-deep-learning Todo o conteúdo básico para entender redes neurais 26 Conteúdo básico para entender redes neurais