具体描述
Learn how to apply TensorFlow to a wide range of deep learning and Machine Learning problems with this practical guide on training CNNs for image classification, image recognition, object detection and many computer vision challenges.
作者简介
目录信息
Copyright and Credits
Hands-On Convolutional Neural Networks with TensorFlow
Packt Upsell
Why subscribe?
PacktPub.com
Contributors
About the authors
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Conventions used
Get in touch
Reviews
Setup and Introduction to TensorFlow
The TensorFlow way of thinking
Setting up and installing TensorFlow
Conda environments
Checking whether your installation works
TensorFlow API levels
Eager execution
Building your first TensorFlow model
One-hot vectors
Splitting into training and test sets
Creating TensorFlow graphs
Variables
Operations
Feeding data with placeholders
Initializing variables
Training our model
Loss functions
Optimization
Evaluating a trained model
The session
Summary
Deep Learning and Convolutional Neural Networks
AI and ML
Types of ML
Old versus new ML
Artificial neural networks
Activation functions
The XOR problem
Training neural networks
Backpropagation and the chain rule
Batches
Loss functions
The optimizer and its hyperparameters
Underfitting versus overfitting
Feature scaling
Fully connected layers
A TensorFlow example for the XOR problem
Convolutional neural networks
Convolution
Input padding
Calculating the number of parameters (weights)
Calculating the number of operations
Converting convolution layers into fully connected layers
The pooling layer
1x1 Convolution
Calculating the receptive field
Building a CNN model in TensorFlow
TensorBoard
Other types of convolutions
Summary
Image Classification in TensorFlow
CNN model architecture
Cross-entropy loss (log loss)
Multi-class cross entropy loss
The train/test dataset split
Datasets
ImageNet
CIFAR
Loading CIFAR
Image classification with TensorFlow
Building the CNN graph
Learning rate scheduling
Introduction to the tf.data API
The main training loop
Model Initialization
Do not initialize all weights with zeros
Initializing with a mean zero distribution
Xavier-Bengio and the Initializer
Improving generalization by regularizing
L2 and L1 regularization
Dropout
The batch norm layer
Summary
Object Detection and Segmentation
Image classification with localization
Localization as regression
TensorFlow implementation
Other applications of localization
Object detection as classification – Sliding window
Using heuristics to guide us (R-CNN)
Problems
Fast R-CNN
Faster R-CNN
Region Proposal Network
RoI Pooling layer
Conversion from traditional CNN to Fully Convnets
Single Shot Detectors – You Only Look Once
Creating training set for Yolo object detection
Evaluating detection (Intersection Over Union)
Filtering output
Anchor Box
Testing/Predicting in Yolo
Detector Loss function (YOLO loss)
Loss Part 1
Loss Part 2
Loss Part 3
Semantic segmentation
Max Unpooling
Deconvolution layer (Transposed convolution)
The loss function
Labels
Improving results
Instance segmentation
Mask R-CNN
Summary
VGG, Inception Modules, Residuals, and MobileNets
Substituting big convolutions
Substituting the 3x3 convolution
VGGNet
Architecture
Parameters and memory calculation
Code
More about VGG
GoogLeNet
Inception module
More about GoogLeNet
Residual Networks
MobileNets
Depthwise separable convolution
Control parameters
More about MobileNets
Summary
Autoencoders, Variational Autoencoders, and Generative Adversarial Networks
Why generative models
Autoencoders
Convolutional autoencoder example
Uses and limitations of autoencoders
Variational autoencoders
Parameters to define a normal distribution
VAE loss function
Kullback-Leibler divergence
Training the VAE
The reparameterization trick
Convolutional Variational Autoencoder code
Generating new data
Generative adversarial networks
The discriminator
The generator
GAN loss function
Generator loss
Discriminator loss
Putting the losses together
Training the GAN
Deep convolutional GAN
WGAN
BEGAN
Conditional GANs
Problems with GANs
Loss interpretability
Mode collapse
Techniques to improve GANs' trainability
Minibatch discriminator
Summary
Transfer Learning
When?
How? An overview
How? Code example
TensorFlow useful elements
An autoencoder without the decoder
Selecting layers
Training only some layers
Complete source
Summary
Machine Learning Best Practices and Troubleshooting
Building Machine Learning Systems
Data Preparation
Split of Train/Development/Test set
Mismatch of the Dev and Test set
When to Change Dev/Test Set
Bias and Variance
Data Imbalance
Collecting more data
Look at your performance metric
Data synthesis/Augmentation
Resample Data
Loss function Weighting
Evaluation Metrics
Code Structure best Practice
Singleton Pattern
Recipe for CNN creation
Summary
Training at Scale
Storing data in TFRecords
Making a TFRecord
Storing encoded images
Sharding
Making efficient pipelines
Parallel calls for map transformations
Getting a batch
Prefetching
Tracing your graph
Distributed computing in TensorFlow
Model/data parallelism
Synchronous/asynchronous SGD
When data does not fit on one computer
The advantages of NoSQL systems
Installing Cassandra (Ubuntu 16.04)
The CQLSH tool
Creating databases, tables, and indexes
Doing queries in Python
Populating tables in Python
Doing backups
Scaling computation in the cloud
EC2
AMI
Storage (S3)
SageMaker
Summary
References
Chapter 1
Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 7
Chapter 9
Other Books You May Enjoy
Leave a review - let other readers know what you think
· · · · · · (收起)
读后感
用户评价
这本书的封面设计着实吸引人眼球,那种深沉的蓝色调配合着简洁的几何线条,立刻给人一种专业而又不失现代感的感觉。我喜欢它传递出的那种“动手实践”的信号,仿佛书中的每一个章节都在向读者发出邀请,去亲手搭建和调试那些复杂的神经网络模型。从装帧质量来看,纸张的厚度和印刷的清晰度都无可挑剔,这对于需要长时间阅读技术书籍的我来说至关重要,阅读体验非常舒适,没有出现反光或者墨水模糊的问题。仅仅是翻阅目录,就能感受到作者在内容编排上的用心良苦,层次分明,似乎是从最基础的概念娓娓道来,逐步深入到那些尖端的技术挑战中去。这种结构上的严谨性,往往预示着内文的逻辑推导会非常顺畅,减少了读者在理解过程中可能遇到的认知障碍。我期待它能真正做到言传身教,不仅仅是理论的堆砌,而是提供大量可以直接运行的代码示例,帮助我快速将抽象的数学原理转化为实际可操作的解决方案。总而言之,初步印象是非常积极的,它成功地在专业性与易读性之间找到了一个很好的平衡点。
这本书的排版风格非常注重读者的阅读流畅性。它没有采用那种一味堆砌文字的密集排版,而是巧妙地利用了大量的留白和恰当的字体切换来区分代码块、公式和正文解释。这种视觉上的呼吸感极大地缓解了长时间阅读技术文档带来的疲劳感。我特别欣赏它在引入新术语时所采用的处理方式,通常会先用一个粗体突出显示,紧接着就是一段简洁明了的定义,让人能够迅速抓住重点。更让我惊喜的是,某些章节似乎还穿插了一些“历史回顾”或者“思想演变”的小插曲,这些非核心内容的加入,非但没有拖慢节奏,反而极大地丰富了知识的立体感,让技术不再是冰冷的逻辑,而是有血有肉的发展脉络。这种叙事手法的运用,使得技术书籍读起来不再像在啃干涩的教科书,而更像是在与一位经验丰富的导师进行深入的探讨,让人忍不住想一页接一页地读下去,探索下一个知识点会如何展开。
这本书带给我最大的感触在于其“完整性”和“一致性”。从头到尾,作者构建了一个连贯的知识图谱,各个模块之间的衔接处理得天衣缝合,没有出现那种前后脱节、需要读者自行脑补连接的生硬过渡。特别是当涉及到复杂的模型架构时,作者运用了非常统一的符号约定和流程图示,确保读者在追踪数据流向和参数更新路径时,能够保持清晰的思路,不至于迷失在错综复杂的网络结构之中。这种精心维护的内部一致性,极大地降低了读者的认知负荷,使学习过程变得更加高效和平滑。我可以想象,这本书的编辑和审校过程必然是极其严格的,才能保证如此高水准的专业术语使用和逻辑严密性。它不仅仅是一本学习指南,更像是一套经过实战检验的工程范式,提供了从理论到部署的完整蓝图。对于任何希望系统性掌握该领域核心技能的人来说,这无疑是一笔宝贵的知识投资。
坦率地说,我最初对这本书抱持着一丝谨慎的期望,毕竟市面上关于深度学习的书籍浩如烟海,真正能让人醍醐灌顶的凤毛麟角。但这本书在处理核心概念的讲解时,展现出一种罕见的清晰度和洞察力。它没有简单地罗列公式,而是着重于解释“为什么”要这样做,以及不同选择背后的权衡利弊。尤其是对于梯度下降、反向传播这类基础却又最容易被肤浅对待的部分,作者投入了大量的笔墨进行细致的剖析,配合着精妙的图示,使得即便是初次接触这些概念的读者也能建立起坚实的直觉。这种对基础的重视程度,是区分一本优秀教材和平庸参考书的关键所在。我注意到它似乎非常强调实践中的“陷阱”和“调优技巧”,这比单纯的理论讲解更有价值,因为在真实的项目中,我们往往被各种意料之外的错误和性能瓶颈所困扰。如果这本书能在这方面提供真正实用的指导方针,那它将远远超越一本普通的教程,成为我工作台上不可或缺的参考手册。
从技术选型的角度来看,这本书的选择是极其明智且具有前瞻性的。它没有固步自封于某一个特定的框架版本,而是着眼于构建可迁移的知识体系。虽然它基于某个流行的深度学习库,但作者似乎有意地引导读者去理解底层API的运作原理,而不是仅仅停留在调用现成函数的层面。这种深度挖掘的倾向,对于希望未来能灵活应对框架更新或需要进行底层性能优化的工程师来说,无疑是巨大的福音。我观察到书中对模型评估指标的讨论非常深入,超越了常见的准确率和召回率,涉及到了更细致的如FPR、AUC曲线的解读,这体现了作者对实际应用场景中数据不平衡问题的深刻理解。很多初级读物往往会草草带过这些关键的性能度量,而这本书显然更关注如何真正衡量一个模型的“好坏”,而不是仅仅让它在测试集上跑出一个虚高的数字。这种对细节的执着,是专业书籍必备的素养。
介绍基础概念,附实例代码,每章节比较精要,看起来比较轻松愉快不会枯燥,适合入门科普,按需自己查阅资料进行针对性深入学习。
介绍基础概念,附实例代码,每章节比较精要,看起来比较轻松愉快不会枯燥,适合入门科普,按需自己查阅资料进行针对性深入学习。
介绍基础概念,附实例代码,每章节比较精要,看起来比较轻松愉快不会枯燥,适合入门科普,按需自己查阅资料进行针对性深入学习。
介绍基础概念,附实例代码,每章节比较精要,看起来比较轻松愉快不会枯燥,适合入门科普,按需自己查阅资料进行针对性深入学习。
介绍基础概念,附实例代码,每章节比较精要,看起来比较轻松愉快不会枯燥,适合入门科普,按需自己查阅资料进行针对性深入学习。