SlideShare a Scribd company logo
1 of 16
Download to read offline
1
The AI Workshop – By iTronics
Demo1: Use Numpy.
2
The AI Workshop – By iTronics
Be able to use numpy functions and numpy matrix/vector operations
Understand the concept of "broadcasting"
Be able to vectorize code
Demo 1: Use Numpy
Objecifs???
3
The AI Workshop – By iTronics
Numpy is the main package for scientific computing in Python.
Demo 1: Use Numpy
What is numpy???
4
The AI Workshop – By iTronics
It is maintained by a large community (www.numpy.org).
Demo 1: Use Numpy
Value of numpy???
5
The AI Workshop – By iTronics
They are several key numpy functions such as:
np.exp, np.log, and np.reshape.
Demo 1: Use Numpy
How to use numpy???
6
The AI Workshop – By iTronics
Demo 1: Use Numpy
sigmoid function, np.exp()
7
The AI Workshop – By iTronics
It is a non-linear function used not only in Machine Learning (Logistic
Regression), but also in Deep Learning.
Demo 1: Use Numpy
We do use sigmoid in:
8
The AI Workshop – By iTronics
It is a non-linear function used not only in Machine Learning (Logistic
Regression), but also in Deep Learning.
Demo 1: Use Numpy
Why use np.exp() not math.exp():
9
The AI Workshop – By iTronics
you will need to compute gradients to optimize loss functions using back-
propagation.
Demo 1: Use Numpy
Sigmoid Gradient:
10
The AI Workshop – By iTronics
Two common numpy functions used in deep learning are np.shape and
np.reshape().
X.shape is used to get the shape (dimension) of a matrix/vector X.
X.reshape(...) is used to reshape X into some other dimension.
Demo 1: Use Numpy
Reshaping Array:
11
The AI Workshop – By iTronics
Demo 1: Use Numpy
Reshape an image:
12
The AI Workshop – By iTronics
Demo 1: Use Numpy
Broadcasting and the softmax function:
13
The AI Workshop – By iTronics
Demo 1: Use Numpy
Reshaping Array:
### START CODE HERE ### (≈ 3 lines of code)
x_exp = np.exp(x)
x_sum = np.sum(x_exp, axis = 1, keepdims = True )
s = x_exp/x_sum
### END CODE HERE ###
14
The AI Workshop – By iTronics
Demo 1: Use Numpy
What you need to remember::
-np.exp(x) works for any np.array x and applies the
exponential function to every coordinate
-the sigmoid function and its gradient
-image2vector is commonly used in deep learning
-np.reshape is widely used. In the future, you'll see that
keeping your matrix/vector dimensions straight will go toward
eliminating a lot of bugs.
-numpy has efficient built-in functions
-broadcasting is extremely useful
15
The AI Workshop – By iTronics
Question ???
16
The AI Workshop – By iTronics
Merci pour votre aimable attention.

More Related Content

What's hot

matplotlib-installatin-interactive-contour-example-guide
matplotlib-installatin-interactive-contour-example-guidematplotlib-installatin-interactive-contour-example-guide
matplotlib-installatin-interactive-contour-example-guide
Arulalan T
 

What's hot (20)

Scipy, numpy and friends
Scipy, numpy and friendsScipy, numpy and friends
Scipy, numpy and friends
 
NUMPY
NUMPY NUMPY
NUMPY
 
Essential NumPy
Essential NumPyEssential NumPy
Essential NumPy
 
Numpy
NumpyNumpy
Numpy
 
Daa
DaaDaa
Daa
 
Scientific Python
Scientific PythonScientific Python
Scientific Python
 
Bring your neural networks to the browser with TF.js - Simone Scardapane
Bring your neural networks to the browser with TF.js - Simone ScardapaneBring your neural networks to the browser with TF.js - Simone Scardapane
Bring your neural networks to the browser with TF.js - Simone Scardapane
 
Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...
Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...
Simone Scardapane - Bring your neural networks to the browser with TF.js! - C...
 
Intellectual technologies
Intellectual technologiesIntellectual technologies
Intellectual technologies
 
Introduction to Pylab and Matploitlib.
Introduction to Pylab and Matploitlib. Introduction to Pylab and Matploitlib.
Introduction to Pylab and Matploitlib.
 
matplotlib-installatin-interactive-contour-example-guide
matplotlib-installatin-interactive-contour-example-guidematplotlib-installatin-interactive-contour-example-guide
matplotlib-installatin-interactive-contour-example-guide
 
The TensorFlow dance craze
The TensorFlow dance crazeThe TensorFlow dance craze
The TensorFlow dance craze
 
2 cs xii_python_functions _ scopes
2 cs xii_python_functions _ scopes2 cs xii_python_functions _ scopes
2 cs xii_python_functions _ scopes
 
Project report on Data Clustering
Project report on Data ClusteringProject report on Data Clustering
Project report on Data Clustering
 
Tensorflow basics
Tensorflow basicsTensorflow basics
Tensorflow basics
 
Introduction to matplotlib
Introduction to matplotlibIntroduction to matplotlib
Introduction to matplotlib
 
A Gentle Introduction to Coding ... with Python
A Gentle Introduction to Coding ... with PythonA Gentle Introduction to Coding ... with Python
A Gentle Introduction to Coding ... with Python
 
Tensorflow in practice by Engineer - donghwi cha
Tensorflow in practice by Engineer - donghwi chaTensorflow in practice by Engineer - donghwi cha
Tensorflow in practice by Engineer - donghwi cha
 
Basic of python for data analysis
Basic of python for data analysisBasic of python for data analysis
Basic of python for data analysis
 
Parallel Programming on the ANDC cluster
Parallel Programming on the ANDC clusterParallel Programming on the ANDC cluster
Parallel Programming on the ANDC cluster
 

Similar to Demo1 use numpy

Python your new best friend
Python your new best friendPython your new best friend
Python your new best friend
Luis Goldster
 
Python your new best friend
Python your new best friendPython your new best friend
Python your new best friend
Fraboni Ec
 
Python your new best friend
Python your new best friendPython your new best friend
Python your new best friend
Young Alista
 
Python your new best friend
Python your new best friendPython your new best friend
Python your new best friend
James Wong
 
Python your new best friend
Python your new best friendPython your new best friend
Python your new best friend
Harry Potter
 
Python your new best friend
Python your new best friendPython your new best friend
Python your new best friend
Tony Nguyen
 
NumPy.pptx Bachelor of Computer Application
NumPy.pptx Bachelor of Computer ApplicationNumPy.pptx Bachelor of Computer Application
NumPy.pptx Bachelor of Computer Application
sharmavishal49202
 

Similar to Demo1 use numpy (20)

Data Analyzing And Visualization Using Python.pptx
Data Analyzing And Visualization Using Python.pptxData Analyzing And Visualization Using Python.pptx
Data Analyzing And Visualization Using Python.pptx
 
Python your new best friend
Python your new best friendPython your new best friend
Python your new best friend
 
Python your new best friend
Python your new best friendPython your new best friend
Python your new best friend
 
Python your new best friend
Python your new best friendPython your new best friend
Python your new best friend
 
Python your new best friend
Python your new best friendPython your new best friend
Python your new best friend
 
Python your new best friend
Python your new best friendPython your new best friend
Python your new best friend
 
Python your new best friend
Python your new best friendPython your new best friend
Python your new best friend
 
Python your new best friend
Python your new best friendPython your new best friend
Python your new best friend
 
Python for ML.pptx
Python for ML.pptxPython for ML.pptx
Python for ML.pptx
 
Machine Learning Lecture Series Lecture 2
Machine Learning Lecture Series Lecture 2Machine Learning Lecture Series Lecture 2
Machine Learning Lecture Series Lecture 2
 
Python-Libraries,Numpy,Pandas,Matplotlib.pptx
Python-Libraries,Numpy,Pandas,Matplotlib.pptxPython-Libraries,Numpy,Pandas,Matplotlib.pptx
Python-Libraries,Numpy,Pandas,Matplotlib.pptx
 
NumPy.pptx Bachelor of Computer Application
NumPy.pptx Bachelor of Computer ApplicationNumPy.pptx Bachelor of Computer Application
NumPy.pptx Bachelor of Computer Application
 
Natural language processing open seminar For Tensorflow usage
Natural language processing open seminar For Tensorflow usageNatural language processing open seminar For Tensorflow usage
Natural language processing open seminar For Tensorflow usage
 
Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117Power ai tensorflowworkloadtutorial-20171117
Power ai tensorflowworkloadtutorial-20171117
 
Transfer Leaning Using Pytorch synopsis Minor project pptx
Transfer Leaning Using Pytorch  synopsis Minor project pptxTransfer Leaning Using Pytorch  synopsis Minor project pptx
Transfer Leaning Using Pytorch synopsis Minor project pptx
 
NumPy.pptx
NumPy.pptxNumPy.pptx
NumPy.pptx
 
NumPy.pptx
NumPy.pptxNumPy.pptx
NumPy.pptx
 
Machine_learning_internship_report_facemaskdetection.pptx
Machine_learning_internship_report_facemaskdetection.pptxMachine_learning_internship_report_facemaskdetection.pptx
Machine_learning_internship_report_facemaskdetection.pptx
 
ACM init()- Day 4
ACM init()- Day 4ACM init()- Day 4
ACM init()- Day 4
 
Tensorflow - Intro (2017)
Tensorflow - Intro (2017)Tensorflow - Intro (2017)
Tensorflow - Intro (2017)
 

More from Romaric Saounde Tsopnang

More from Romaric Saounde Tsopnang (20)

Aq switches2 - Beginner
Aq   switches2 - BeginnerAq   switches2 - Beginner
Aq switches2 - Beginner
 
Aq les conditionnelles - Débutant
Aq   les conditionnelles - DébutantAq   les conditionnelles - Débutant
Aq les conditionnelles - Débutant
 
Ap les boucles - Débutants
Ap   les boucles - DébutantsAp   les boucles - Débutants
Ap les boucles - Débutants
 
Ap loops2 - Beginner
Ap   loops2 - BeginnerAp   loops2 - Beginner
Ap loops2 - Beginner
 
Ao light nxt2 - Beginner
Ao   light nxt2 - BeginnerAo   light nxt2 - Beginner
Ao light nxt2 - Beginner
 
An capteur de couleur - Débutant
An   capteur de couleur - DébutantAn   capteur de couleur - Débutant
An capteur de couleur - Débutant
 
An color Sensor - Beginner
An   color Sensor - BeginnerAn   color Sensor - Beginner
An color Sensor - Beginner
 
Al capteur tactile - Débutant
Al   capteur tactile - DébutantAl   capteur tactile - Débutant
Al capteur tactile - Débutant
 
Al touch2 - Beginner
Al   touch2 - BeginnerAl   touch2 - Beginner
Al touch2 - Beginner
 
Ak custom imagessounds2 - Beginner
Ak   custom imagessounds2 - BeginnerAk   custom imagessounds2 - Beginner
Ak custom imagessounds2 - Beginner
 
Ak image et son standard - Débutant
Ak   image et son standard - DébutantAk   image et son standard - Débutant
Ak image et son standard - Débutant
 
Aj display2 - Beginner
Aj   display2 - BeginnerAj   display2 - Beginner
Aj display2 - Beginner
 
Aj affichage - Débutant
Aj   affichage - DébutantAj   affichage - Débutant
Aj affichage - Débutant
 
Ai turning2 - Beginner
Ai   turning2 - BeginnerAi   turning2 - Beginner
Ai turning2 - Beginner
 
Ai virages - Débutant
Ai   virages - DébutantAi   virages - Débutant
Ai virages - Débutant
 
Ah pseudocode2 - Beginner
Ah   pseudocode2 - BeginnerAh   pseudocode2 - Beginner
Ah pseudocode2 - Beginner
 
Ah pseudocode-fr - Débutant
Ah   pseudocode-fr - DébutantAh   pseudocode-fr - Débutant
Ah pseudocode-fr - Débutant
 
Ag moving straight2 - Beginner
Ag   moving straight2 - BeginnerAg   moving straight2 - Beginner
Ag moving straight2 - Beginner
 
Ag deplacement droit - Débutant
Ag   deplacement droit - DébutantAg   deplacement droit - Débutant
Ag deplacement droit - Débutant
 
Af port view2 - Beginner
Af   port view2 - BeginnerAf   port view2 - Beginner
Af port view2 - Beginner
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Demo1 use numpy

  • 1. 1 The AI Workshop – By iTronics Demo1: Use Numpy.
  • 2. 2 The AI Workshop – By iTronics Be able to use numpy functions and numpy matrix/vector operations Understand the concept of "broadcasting" Be able to vectorize code Demo 1: Use Numpy Objecifs???
  • 3. 3 The AI Workshop – By iTronics Numpy is the main package for scientific computing in Python. Demo 1: Use Numpy What is numpy???
  • 4. 4 The AI Workshop – By iTronics It is maintained by a large community (www.numpy.org). Demo 1: Use Numpy Value of numpy???
  • 5. 5 The AI Workshop – By iTronics They are several key numpy functions such as: np.exp, np.log, and np.reshape. Demo 1: Use Numpy How to use numpy???
  • 6. 6 The AI Workshop – By iTronics Demo 1: Use Numpy sigmoid function, np.exp()
  • 7. 7 The AI Workshop – By iTronics It is a non-linear function used not only in Machine Learning (Logistic Regression), but also in Deep Learning. Demo 1: Use Numpy We do use sigmoid in:
  • 8. 8 The AI Workshop – By iTronics It is a non-linear function used not only in Machine Learning (Logistic Regression), but also in Deep Learning. Demo 1: Use Numpy Why use np.exp() not math.exp():
  • 9. 9 The AI Workshop – By iTronics you will need to compute gradients to optimize loss functions using back- propagation. Demo 1: Use Numpy Sigmoid Gradient:
  • 10. 10 The AI Workshop – By iTronics Two common numpy functions used in deep learning are np.shape and np.reshape(). X.shape is used to get the shape (dimension) of a matrix/vector X. X.reshape(...) is used to reshape X into some other dimension. Demo 1: Use Numpy Reshaping Array:
  • 11. 11 The AI Workshop – By iTronics Demo 1: Use Numpy Reshape an image:
  • 12. 12 The AI Workshop – By iTronics Demo 1: Use Numpy Broadcasting and the softmax function:
  • 13. 13 The AI Workshop – By iTronics Demo 1: Use Numpy Reshaping Array: ### START CODE HERE ### (≈ 3 lines of code) x_exp = np.exp(x) x_sum = np.sum(x_exp, axis = 1, keepdims = True ) s = x_exp/x_sum ### END CODE HERE ###
  • 14. 14 The AI Workshop – By iTronics Demo 1: Use Numpy What you need to remember:: -np.exp(x) works for any np.array x and applies the exponential function to every coordinate -the sigmoid function and its gradient -image2vector is commonly used in deep learning -np.reshape is widely used. In the future, you'll see that keeping your matrix/vector dimensions straight will go toward eliminating a lot of bugs. -numpy has efficient built-in functions -broadcasting is extremely useful
  • 15. 15 The AI Workshop – By iTronics Question ???
  • 16. 16 The AI Workshop – By iTronics Merci pour votre aimable attention.