Keras 3
The Comprehensive Guide to Deep Learning with the Keras API and Python
Información
- Editorial: SAP PRESS
- Autores: Mohammad Nauman
- Año: 2025
- Edición: 1
- Páginas: 629
- Idioma: Inglés
Descripción
Harness the power of AI with this guide to using Keras! Start by reviewing the fundamentals of deep learning and installing the Keras API. Next, follow Python code examples to build your own models, and then train them using classification, gradient descent, and regularization. Design large-scale, multilayer models and improve their decision making with reinforcement learning. With tips for creating generative AI models, this is your cutting-edge resource for working with deep learning!
- Learn to use Keras for deep learning
- Work with techniques such as gradient descent, classification, regularization, and more
- Build and train convolutional neural networks, transformers, and autoencoders
Aspectos Destacados
- Neural networks
- Gradient descent
- Classification
- Regularization
- Convolutional neural networks (CNNs)
- Functional API
- Transformer architecture
- Reinforcement learning
- Autoencoders
- Stable Diffusion
Aprenderás sobre
- Deep Learning Basics:
Understand the foundations of deep learning, machine learning, and neural networks. Learn core concepts like gradient descent, classification, and regularization to fine-tune your models and minimize loss function.
- Model Development and Training:
Follow step-by-step instructions to build models in Keras: develop a convolutional neural network, apply the functional API for complex models, and implement transformer architecture. Use reinforcement learning to improve your models’ decision-making.
- Generative AI Models:
Build and train your own generative AI models! Get hands-on with text to image techniques and work with variational autoencoders and generative adversarial networks.
Tabla de Contenidos
- 1 Introduction
- 1.1 Overview of Deep Learning
- 1.1.1 The Success of Deep Learning
- 1.1.2 The Two Pillars Supporting These Breakthroughs
- 1.1.3 Why Now?
- 1.2 Why Keras
- 1.3 The Structure of This Book
- 1.4 How to Use This Book
- 1.4.1 Why Keras Installation Comes Later
- 1.4.2 Suggested Reading Strategy
- 2 Introduction to the Core of Machine Learning
- 2.1 What Is Machine Learning?
- 2.1.1 Helping the Machine Recognize Digits
- 2.1.2 The Outdated Method—Rule-Based Learning
- 2.1.3 Case Study in Machine Learning Code
- 2.1.4 Structuring the Learning Process
- 2.1.5 Analyzing the Machine’s Learning Process
- 2.1.6 Lessons Learned from the Code Case Study
- 2.2 Types of Machine Learning
- 2.2.1 Supervised Learning
- 2.2.2 Unsupervised Learning
- 2.3 The Magic Sauce: Reinforcement Learning
- 2.3.1 The Building Blocks of Reinforcement Learning
- 2.3.2 Key Applications for Reinforcement Learning
- 2.3.3 Challenges in Implementing Reinforcement Learning
- 2.4 Basics of Neural Networks
- 2.4.1 Core Components of Neural Networks
- 2.4.2 The Unintuitive Process of Learning
- 2.4.3 Clearing Up Some Misconceptions
- 2.5 Setting Up Your Environment
- 2.6 Summary
- 3 Fundamentals of Gradient Descent
- 3.1 Understanding Gradient Descent
- 3.1.1 The Basic Setup
- 3.1.2 Formalizing the Process: Training Phase
- 3.1.3 From Training to Deployment: Making It Work in the Real World
- 3.1.4 The Process of Learning
- 3.1.5 Finding the Best Parameters: Minimizing the Loss
- 3.1.6 Lifting the Assumptions of a Single Input Feature
- 3.1.7 Higher Dimensions in Gradient Descent
- 3.2 Types of Gradient Descent: Batch, Stochastic, Mini-Batch
- 3.2.1 Contour Plots for Visualization of Gradient Descent
- 3.2.2 Improving the Efficiency of Batch Gradient Descent
- 3.2.3 A Paradox in the Use of Stochastic Gradient Descent
- 3.3 Learning Rate and Optimization
- 3.4 Implementing Gradient Descent in Code
- 3.4.1 Gradient Descent from Scratch
- 3.4.2 Gradient Descent Using Keras
- 3.5 Summary
- 4 Classification Through Gradient Descent
- 4.1 Classification Basics
- 4.1.1 Classification Problem Setup
- 4.1.2 First Attempt Using Gradient Descent
- 4.1.3 Second Attempt: Fixing the Issues in the First Attempt
- 4.1.4 Third Attempt: Fixing the Loss Function
- 4.1.5 Squishing Functions and Decision Boundaries
- 4.1.6 Learning Process Summary
- 4.2 Nonlinear Relationships and Neural Networks
- 4.2.1 Feature Transformations
- 4.2.2 The Kernel Trick, Logistic Regression, and All of Machine Learning
- 4.3 Binary vs. Multi-Class Classification
- 4.3.1 The One-vs-All Approach
- 4.3.2 The Softmax Classifier
- 4.4 Loss Functions: Cross-Entropy
- 4.4.1 Categorical Cross-Entropy
- 4.4.2 Pitfall to Avoid When Using Cross Entropies
- 4.4.3 Sparse Categorical Cross-Entropy
- 4.5 Building a Classifier with Gradient Descent
- 4.5.1 Layers in Code
- 4.5.2 Choice of Loss Function
- 4.5.3 Parameter Counts
- 4.5.4 The Density of Keras Code
- 4.6 Summary
- 5 Deep Dive into Keras
- 5.1 Introduction to Keras Framework
- 5.1.1 The Philosophy Behind Keras: Making AI Human-Friendly
- 5.1.2 Evolution Through Adaptability
- 5.1.3 Keras 3.0: The Multi-Engine Framework
- 5.1.4 Key Strengths of Keras
- 5.1.5 Keras in the Real World
- 5.2 Setting Up Keras
- 5.2.1 Setting Up Python
- 5.2.2 TensorFlow Installation and Points to Keep in Mind
- 5.2.3 Setting Up CUDA for GPU Acceleration
- 5.2.4 Installing Keras
- 5.2.5 Using a GPU in Google Collaboratory
- 5.3 Building Your First Model
- 5.3.1 Why NumPy Matters for Machine Learning
- 5.3.2 Symbolic Computation: The Magic Behind Neural Networks
- 5.4 Implementing Core Concepts in Keras: Gradient Descent and Classification
- 5.4.1 The Building Blocks of a Cat-Dog Classifier
- 5.4.2 Getting and Fixing the Data
- 5.4.3 Performance Optimization and Model Specification
- 5.4.4 Evaluation Metrics
- 5.4.5 Guiding the Training Through Callbacks and Checkpoints
- 5.4.6 Evaluating the Model
- 5.5 Summary
- 6 Regularization Techniques
- 6.1 An Overview of Overfitting and Underfitting: Do You Need More Data?
- 6.1.1 From Lines to Curves: Adding Polynomial Features
- 6.1.2 Using Increasingly Complex Models
- 6.1.3 The Balance of Complexity
- 6.1.4 Regularization Term
- 6.1.5 Adjusting the Complexity Knob
- 6.1.6 Do I Need More Data
- 6.1.7 Reporting the Final Results: Validation Set
- 6.2 Dropout: Concept and Implementation
- 6.2.1 The Problem: Co-Adaptation and Overfitting
- 6.2.2 The Road to Memorization
- 6.2.3 The Ensemble Intuition Behind Dropout
- 6.2.4 Dropout Mechanics
- 6.2.5 Finding the Sweet Spot: Dropout Rates in Practice
- 6.2.6 Implementing Dropout in Pure Python
- 6.2.7 Common Pitfalls and Debugging Tips
- 6.3 Other Regularization Methods: L1 and L2 Regularization
- 6.3.1 L1 Regularization (Lasso)
- 6.3.2 Elastic Net: Combining L1 and L2
- 6.3.3 When Not to Use Regularization
- 6.3.4 Practical Considerations: Dropout vs. L1/L2 in Neural Networks
- 6.4 Applying Regularization in Keras
- 6.4.1 Implementing L2 Regularization in Keras
- 6.4.2 Dropout in Keras
- 6.4.3 Beyond Basic Dropout: Specialized Variants
- 6.4.4 Finding the Perfect Dropout Rate: A Systematic Approach
- 6.5 Summary
- 7 Convolutional Neural Networks
- 7.1 Introduction to Convolutional Neural Networks
- 7.1.1 The Limitation of Fully Connected Networks
- 7.1.2 The Learning Standstill
- 7.1.3 Solving the Vanishing Gradient Problem
- 7.1.4 Dense vs. Sparse Connections
- 7.1.5 From Convolution to Neural Networks: The Conv2D Layer
- 7.2 Convolutional Layers, Pooling Layers and Fully Connected Layers
- 7.2.1 Core Implementation of a Convolutional Layer
- 7.2.2 The Hidden Superpowers of Convolutional Layers
- 7.2.3 Pooling Layers: The Image Simplifiers
- 7.2.4 Global Pooling
- 7.2.5 Bringing It All Together: Fully Connected Layers in CNNs
- 7.3 Implementing CNNs with Keras
- 7.3.1 Conv2D vs. Conv1D
- 7.3.2 The Opposite of Convolution: Deconvolution Layers
- 7.4 The “Shapes” Problem
- 7.5 Case Study: Image Classification
- 7.6 Summary
- 8 Exploring the Keras Functional API
- 8.1 Overview of Keras Functional API
- 8.1.1 The Information Bottleneck
- 8.1.2 Networks as Directed Acyclic Graphs
- 8.1.3 The Functional Programming Heritage
- 8.1.4 Key Advantages of the Functional API
- 8.2 Building Complex Models with the Functional API
- 8.2.1 Overview of the Functional API Syntax
- 8.2.2 Creating Models with the Functional API
- 8.2.3 Best Practices for Complex Models
- 8.2.4 Handling Multiple Inputs and Outputs
- 8.2.5 Example: Building an Image Captioning Model
- 8.2.6 Residual Connections
- 8.2.7 Branching Architectures
- 8.3 Use Cases and Examples
- 8.3.1 Image Classification with ResNet
- 8.3.2 Siamese Networks for Similarity Learning
- 8.3.3 U-Net for Image Segmentation
- 8.4 Using Transfer Learning to Customize Models for Your Organization
- 8.4.1 The Why of Transfer Learning
- 8.4.2 Leveraging Pretrained Models from Keras
- 8.4.3 The Process of Transfer Learning
- 8.4.4 Reloading an Existing Model
- 8.5 Summary
- 9 Understanding Transformers
- 9.1 The Theory Behind Transformers
- 9.1.1 A Simple Time Series Example
- 9.1.2 From Numbers to Words: The Challenge of Text Data
- 9.1.3 GloVe: Learning the Language of Vectors
- 9.1.4 A Gentle Introduction to Attention
- 9.1.5 Why Transformers Revolutionized Natural Language Processing and Beyond
- 9.2 Components: Attention Mechanism, Encoder, Decoder
- 9.2.1 The Conversation Between Words
- 9.2.2 Why Position Information Matters
- 9.2.3 Encoder Structure: The Information Processing Powerhouse
- 9.2.4 Decoder Structure: Creating New Sequences from Understanding
- 9.3 Implementing Transformers in Keras
- 9.3.1 The Encoder Block
- 9.3.2 The Decoder Block
- 9.3.3 The Transformer: Putting the Encoder and Decoder Together
- 9.4 Case Study: Large Language Model Chatbot
- 9.4.1 Structure of Modern Keras Transformer Models
- 9.4.2 Working with Pretrained Models from Kaggle Hub
- 9.5 Summary
- 10 Reinforcement Learning: The Secret Sauce
- 10.1 Introduction to Reinforcement Learning
- 10.1.1 The Problem of Learning by Doing
- 10.1.2 Brief History and Major Breakthroughs
- 10.1.3 Real-World Applications
- 10.1.4 Challenges Unique to Reinforcement Learning
- 10.2 Key Concepts: Agents, Environments, Rewards
- 10.2.1 Structure of the Reinforcement Learning Framework
- 10.2.2 Environment Design and State Representation
- 10.2.3 Understanding Agents and Policy Functions
- 10.2.4 Reward Engineering and Signal Design
- 10.2.5 The Exploration vs. Exploitation Dilemma
- 10.3 Popular Algorithms: Q-Learning, Policy Gradients, and Deep Q-Networks
- 10.3.1 The Markov Decision Processes
- 10.3.2 Value Functions and Q-Tables
- 10.3.3 Building the Q-Table
- 10.3.4 Q-Learning Algorithm: A Worked Example
- 10.3.5 Q-Learning and Associated Issues
- 10.3.6 The Limits of Tabular Q-Learning
- 10.4 Implementing Reinforcement Learning Models in Keras
- 10.4.1 Our First Reinforcement Learning Environment
- 10.4.2 Implementing the Deep Q-Network Algorithm with Keras
- 10.4.3 Experience Replay and Target Networks: The Foundations of Stable Deep Reinforcement Learning
- 10.5 Reinforcement Learning in Large Language Models
- 10.5.1 The Fundamental Challenge: Moving Beyond Prediction
- 10.5.2 Challenges and Limitations
- 10.5.3 Future Directions and Emerging Approaches
- 10.6 Summary
- 11 Autoencoders and Generative AI
- 11.1 Introduction to Autoencoders
- 11.1.1 What Are Autoencoders?
- 11.1.2 Autoencoder Architecture Deep Dive
- 11.1.3 Building Your First Autoencoder in Keras
- 11.1.4 Types of Autoencoders
- 11.2 Variational Autoencoders
- 11.2.1 Navigating the Space with Uncertainty
- 11.2.2 Mathematical Framework of Variational Autoencoders
- 11.2.3 Variational Autoencoder Implementation in Keras
- 11.3 Generative Adversarial Networks
- 11.3.1 The Adversarial Game
- 11.3.2 Generative Adversarial Network Architecture
- 11.3.3 Other Variations
- 11.3.4 Generative Adversarial Network Implementation in Keras
- 11.3.5 Implementation Challenges
- 11.4 Summary
- 12 Advanced Generative AI: Stable Diffusion
- 12.1 Theory Behind Stable Diffusion
- 12.1.1 From Previous Generative Models to Diffusion
- 12.1.2 Diffusion Process Fundamentals
- 12.1.3 Reverse Diffusion: Learning to Denoise
- 12.1.4 Connections to Physical Processes
- 12.1.5 Denoising Diffusion Probabilistic Models
- 12.1.6 Latent Diffusion and Stable Diffusion Architecture
- 12.1.7 Cross-Attention: The Bridge Between Text and Images
- 12.2 How Stable Diffusion Uses Core Concepts
- 12.2.1 Efficient Diffusion Through Learned Representations
- 12.2.2 Advanced Attention Mechanisms
- 12.2.3 Training Strategies and Optimization
- 12.3 Implementing Stable Diffusion Models
- 12.3.1 Environment and Data Prep
- 12.3.2 Setting Up an Evaluation Measure
- 12.3.3 Model Description and Time-Step Encodings
- 12.3.4 Diffusion and Reverse Diffusion
- 12.3.5 The Generation Engine
- 12.3.6 Following Progress in the Training Process
- 12.4 Case Study: Image Generation
- 12.4.1 Loading Pretrained Models from Keras Hub
- 12.4.2 Loading Models Through Keras Hub
- 12.4.3 Using Stable Diffusion Models
- 12.4.4 Beyond Image Generation to More Complex Workflows
- 12.5 Summary
- 13 Recap of Key Concepts
- 13.1 Future Trends in Deep Learning
- 13.1.1 Advanced Architecture Trajectories
- 13.1.2 Reinforcement Learning Frontiers
- 13.1.3 Generative AI Revolution
- 13.2 Tips for Staying Updated with Advancements
- 13.2.1 Technical Skills Maintenance
- 13.2.2 Following Tutorials and Keras Codebase
- 13.2.3 Research Consumption Strategy
- 13.2.4 Community Engagement
- 13.3 Following the Latest Research
- 13.3.1 Technical Deep Dives
- 13.3.2 Practical Research Integration
- 13.3.3 Parting Words
Descargo de responsabilidad
SAP, otros productos SAP y servicios mencionados aquí así como sus respectivos logos son marca registrada de SAP SE (o una compañía afiliada de SAP) en Alemania y otros países. Nuestra compañía no está afiliada con SAP SE ni con ninguna de sus compañías afiliadas incluyendo pero no limitada a: Sybase, Business Objects, Hybris, Ariba y SuccessFactors. Todos los otros nombres, marcas, logos, etc. son marcas o servicios registrados de sus respectivos propietarios.