Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Hands-On Vision and Behavior for Self-Driving Cars

You're reading from  Hands-On Vision and Behavior for Self-Driving Cars

Product type Book
Published in Oct 2020
Publisher Packt
ISBN-13 9781800203587
Pages 374 pages
Edition 1st Edition
Languages
Authors (2):
Luca Venturi Luca Venturi
Profile icon Luca Venturi
Krishtof Korda Krishtof Korda
Profile icon Krishtof Korda
View More author details

Table of Contents (17) Chapters

Preface 1. Section 1: OpenCV and Sensors and Signals
2. Chapter 1: OpenCV Basics and Camera Calibration 3. Chapter 2: Understanding and Working with Signals 4. Chapter 3: Lane Detection 5. Section 2: Improving How the Self-Driving Car Works with Deep Learning and Neural Networks
6. Chapter 4: Deep Learning with Neural Networks 7. Chapter 5: Deep Learning Workflow 8. Chapter 6: Improving Your Neural Network 9. Chapter 7: Detecting Pedestrians and Traffic Lights 10. Chapter 8: Behavioral Cloning 11. Chapter 9: Semantic Segmentation 12. Section 3: Mapping and Controls
13. Chapter 10: Steering, Throttle, and Brake Control 14. Chapter 11: Mapping Our Environments 15. Assessments 16. Other Books You May Enjoy

Visualizing the activations

Now we can train a neural network. Great. But what exactly is the neural network able to see and understand? That's a difficult question to answer, but as convolutions output an image, we could try to show this. Let's now try to show the activation for the first 10 images of the MINST test dataset:

  1. First, we need to build a model, derived from our previous model, that reads from the input and gets as output the convolutional layer that we want. The name can be taken from the summary. We will visualize the first convolutional layer, conv2d_1:
    conv_layer = next(x.output for x in model.layers if     x.output.name.startswith(conv_name))act_model = models.Model(inputs=model.input, outputs=[conv_layer])activations = act_model.predict(x_test[0:num_predictions, :, :, :])
  2. Now, for each test image, we can take all the activations and chain them together to get an image:
    col_act = []
    for pred_idx, act in enumerate(activations...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}