Train an Artificial Neural Network with TensorFlow's Keras API
Key Takeaways
This video demonstrates how to train an artificial neural network using TensorFlow's Keras API, covering model compilation, training, and evaluation.
Full Transcript
hey I'm Mandy from deep lizard in this episode we'll see how to train an artificial neural network using the Charis api integrated with tensorflow [Music] in previous episodes we went through steps to generate data and also build an artificial neural network so now we'll bring these two together to actually train the network on the data that we created and processed all right so picking up where we were last time in our jupiter notebook make sure that you still have all of your imports included and already ran so that we can continue where we were before so first we have after building our model we are going to call this model dot compiled function and this just prepares the model for training so it gets everything in order that's needed before we can actually train the model so first we are specifying to the compile function what optimizer that we want to use and we are choosing to use the very common optimizer atom with a learning rate of 0.0001 and next we specify the type of loss that we need to use which is in our case we're going to use sparse categorical cross symbol we're going to use sparse categorical cross entropy and then lastly we specify what metrics we want to see so this is just for the model performance what we want to be able to judge our model by and we are specifying this list which just includes accuracy which is a very common way to be able to evaluate model performance so if we run this cell all right so the model has been compiled and is ready for training and training occurs whenever we call this fit function now recall earlier in the course we actually looked at the documentation for this fit function so that we knew how to process our input data so to fit the first parameter that we're specifying is X here which is our input data which is currently stored in this scale to Train samples variable then Y which is our target data or our labels our labels are currently stored in the Train Bulls variable so we are specifying that here next we specify our batch size that we want to use for training so this is how many samples are included in one batch to be passed and processed by the network at one time so we're setting this to 10 and the number of epochs that we want to run we're setting this to 30 so that means that the model is going to process or train on all of the data in the data set 30 times before completing the total training process next we're specifying this shuffle shuffle parameter which we are setting to true now by default this is already set to true but I was just bringing it to your attention to show to make you aware of the fact that the data is being shuffled by default when we pass it to the network which is a good thing because we want any order that is inside of the data set to be kind of erased before we pass the data to the model so that the models not necessarily learning anything about the order of the data set so this is true by default so we don't necessarily have to specify that I was just letting you know and actually we'll see something about that in the next episode about why this is important regarding validation data but we'll see that coming up the last parameter that we specify here is verbose which is just an option to allow us to see output from whenever we run this fit function so we can either set it to 0 1 or 2 2 is the most verbose level in terms of output messages so we are setting that here so that we can get the highest level of output so now let's run the cell so that training can begin all right so training has just stopped and we have run for 30 epochs and if we look at the progress of the model so we're starting out on our first epoch our loss value is currently 0.68 and our accuracy is 50% so no better than chance but pretty quickly looking at the accuracy we can tell that it is steadily increasing all the way until we get to our last epoch which we are yielding 94% accuracy and our losses also steadily be crease from the 0.65 range to now being at point two seven so as you can see the this model trained very quickly with each epoch taking only under one second to run and within 30 Hawks we are already at a 94% accuracy rate now although this is a very simple model and we were training it on very simple data we can see that without much effort at all we were able to yield pretty great results in a relatively quick manner of time as well in subsequent episodes we'll demonstrate how to work with more complex models as well as more complex data but for now hopefully this example serve the purpose of encouraging you on how easy it is to get started with Kerris by the way we are currently in Vietnam filming this episode if you didn't know we also have a vlog channel where we document our travels and share a little bit more about ourselves so check that out at people's our vlog on YouTube also be sure to check out the corresponding blog for this episode along with other resources available on beep laser comm and check out the people's r-type mine where you can gain exclusive access to perks and rewards thanks for contributing to collective intelligence I'll see you next time [Music] [Music]
Original Description
In this episode, we'll demonstrate how to train an artificial neural network using the Keras API integrated within TensorFlow.
🕒🦎 VIDEO SECTIONS 🦎🕒
00:00 Welcome to DEEPLIZARD - Go to deeplizard.com for learning resources
00:30 Compiling the Model
01:40 Training the Model
05:35 Collective Intelligence and the DEEPLIZARD HIVEMIND
💥🦎 DEEPLIZARD COMMUNITY RESOURCES 🦎💥
👋 Hey, we're Chris and Mandy, the creators of deeplizard!
👉 Check out the website for more learning material:
🔗 https://deeplizard.com
💻 ENROLL TO GET DOWNLOAD ACCESS TO CODE FILES
🔗 https://deeplizard.com/resources
🧠 Support collective intelligence, join the deeplizard hivemind:
🔗 https://deeplizard.com/hivemind
🧠 Use code DEEPLIZARD at checkout to receive 15% off your first Neurohacker order
👉 Use your receipt from Neurohacker to get a discount on deeplizard courses
🔗 https://neurohacker.com/shop?rfsn=6488344.d171c6
👀 CHECK OUT OUR VLOG:
🔗 https://youtube.com/deeplizardvlog
❤️🦎 Special thanks to the following polymaths of the deeplizard hivemind:
Tammy
Mano Prime
Ling Li
🚀 Boost collective intelligence by sharing this video on social media!
👀 Follow deeplizard:
Our vlog: https://youtube.com/deeplizardvlog
Facebook: https://facebook.com/deeplizard
Instagram: https://instagram.com/deeplizard
Twitter: https://twitter.com/deeplizard
Patreon: https://patreon.com/deeplizard
YouTube: https://youtube.com/deeplizard
🎓 Deep Learning with deeplizard:
Deep Learning Dictionary - https://deeplizard.com/course/ddcpailzrd
Deep Learning Fundamentals - https://deeplizard.com/course/dlcpailzrd
Learn TensorFlow - https://deeplizard.com/course/tfcpailzrd
Learn PyTorch - https://deeplizard.com/course/ptcpailzrd
Natural Language Processing - https://deeplizard.com/course/txtcpailzrd
Reinforcement Learning - https://deeplizard.com/course/rlcpailzrd
Generative Adversarial Networks - https://deeplizard.com/course/gacpailzrd
🎓 Other Courses:
DL Fundamentals Classic - https://deeplizard.com/
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from deeplizard · deeplizard · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Install Jaxx cryptocurrency wallet on Windows 10 and verify file hash
deeplizard
Jaxx cryptocurrency wallet overview - A Blockchain Interface
deeplizard
Remove Jaxx cryptocurrency wallet from Windows 10
deeplizard
Install Jaxx cryptocurrency wallet Chrome extension
deeplizard
Send Litecoin from GDAX to Jaxx wallet
deeplizard
Send Litecoin from Jaxx wallet to GDAX
deeplizard
Backup and restore Jaxx wallet with passphrase
deeplizard
Send Litecoin to Bittrex using Jaxx and monitor confirmations with BlockCypher
deeplizard
Join a mining pool on Waves platform and lease Waves
deeplizard
ZCASH Explained | An introduction to a privacy based cryptocurrency
deeplizard
ZCash t address creation with Jaxx wallet and private key blockchain discussion
deeplizard
Buy ZCash with Litecoin using the Shifty button in the Jaxx wallet
deeplizard
Buy ZCash with Litecoin using ShapeShift - FAILURE
deeplizard
Litecoin | Jaxx | Shapeshift | zcash | failed
deeplizard
Buy ZCash with Litecoin using ShapeShift - SUCCESS even with Jaxx issues
deeplizard
Explore ZCash blockchain with Zchain block explorer
deeplizard
Zchain ZCash block explorer API - PowerShell Code
deeplizard
Zchain ZCash block explorer API - Introduction
deeplizard
Zchain ZCash block explorer API - Application
deeplizard
Coinbase's Trading Platform | Previously known as GDAX
deeplizard
Coinbase Social Security Number (SSN) Requirement Explained
deeplizard
Who owns Coinbase? Here are some KEY people
deeplizard
How does Coinbase/GDAX secure Bitcoin, Litecoin, Ether?
deeplizard
Coinbase | HackerOne bug bounty program
deeplizard
Is Bitcoin safe at Coinbase/GDAX?
deeplizard
Coinbase Login Demo Using Google Authenticator (2FA)
deeplizard
Coinbase Pro - GDAX | Trading Interface Overview
deeplizard
Coinbase gives $10 in Bitcoin | Watch this before signing up
deeplizard
Coinbase around the globe | What countries are supported?
deeplizard
Order book explained | Trading concept to know
deeplizard
Bid/Ask spread explained | Trading concept to know
deeplizard
Maker vs Taker | Trading concept to know
deeplizard
Market Orders are Always TAKERS (HIGHER FEES)!
deeplizard
Buy as a MAKER (LOWER FEE) on Coinbase Pro - GDAX | Limit Order - Part 1
deeplizard
Buy as a MAKER (LOWER FEE) on Coinbase Pro - GDAX | Limit Order - Part 2
deeplizard
Time-in-force explained | Trading concept to know
deeplizard
Stop order explained | How to stop a loss | Coinbase Pro - GDAX
deeplizard
Stop Order on Coinbase Pro - GDAX | What the WARNINGS Mean
deeplizard
Market price vs Last price | Trading concept to know
deeplizard
Stop Order on Coinbase Pro - GDAX | How it is ACTIVATED
deeplizard
Stop-limit order | How to set the limit | Coinbase Pro - GDAX
deeplizard
Flash CRASH Part 1 | ETH/USD currency pair traded at $0.10
deeplizard
Slippage explained | Trading concept to know
deeplizard
Flash CRASH Part 2 | How did Coinbase Respond?
deeplizard
Buy side stop-limit order | Crypto trading strategy for buying a breakout
deeplizard
Buy side stop-limit order | Triggering under the market price
deeplizard
What is an order book?
deeplizard
What is a market?
deeplizard
What is an exchange?
deeplizard
What is a broker-dealer?
deeplizard
Keras prerequisites
deeplizard
Change Keras backend to Theano
deeplizard
#1 Order types and parameters | Trading on Coinbase Pro - GDAX
deeplizard
Trading strategy for stopping a loss | Don't trade all at once!
deeplizard
#2 Order matching engine | Trading on Coinbase Pro - GDAX
deeplizard
Batch Size in a Neural Network explained
deeplizard
Deep Learning playlist overview & Machine Learning intro
deeplizard
Artificial Neural Networks explained
deeplizard
Regularization in a Neural Network explained
deeplizard
Create confusion matrix for predictions from Keras model
deeplizard
More on: ML Pipelines
View skill →Related Reads
📰
📰
📰
📰
Help Choosing Neural Network Architecture for Matrix Classification
Reddit r/deeplearning
How to Choose the Best Deep Learning Model for Medical Imaging
Medium · Deep Learning
Another Way to Read Neural Geometry
Medium · Data Science
Another Way to Read Neural Geometry
Medium · Deep Learning
Chapters (4)
Welcome to DEEPLIZARD - Go to deeplizard.com for learning resources
0:30
Compiling the Model
1:40
Training the Model
5:35
Collective Intelligence and the DEEPLIZARD HIVEMIND
🎓
Tutor Explanation
DeepCamp AI