Leanpub Header

Skip to main content

Practical Python Artificial Intelligence Programming

Using Large Language Models, Deep Learning, Machine Learning, Symbolic AI, and Knowledge Representation

Practical Python Artificial Intelligence Programming
هذا الكتاب هو 100% كاملةأخر تحديث لهذا الكتاب كان فى 2026-08-29
+10,667 words in the last 30 days

A fun dive into AI programming with Python.

الحد الأدنى للسعر

مجاناً!

$25.00

أنت تدفع

مستحقات المؤلف

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
WEB
APP
حول

حول

نبذه عن الكتاب

This book is meant to be a quick 4 to 5 hour introduction to AI for Python programmers. If you have experience with Large Language Models, Deep Learning, general Machine Leaning and Symbolic AI then you can spend a couple of hours experimenting with the examples.

The author has been a general AI practitioner since 1982, developed neural network products and projects since 1986, and deep learning since 2015 and LLMs since 2022. He has written 20+ books and has 50+ US Patents.

مشاركة هذا الكتاب

التصنيفات

الملاحظات

المؤلف

نبذه عن المؤلف

Mark Watson

Mark Watson is a consultant specializing in LLMs, deep learning, machine learning, knowledge graphs, and general artificial intelligence software development. He uses Common Lisp, Clojure, Python, Java, Haskell, and Ruby for development.

He is the author of 20+ published books on Artificial Intelligence, Deep Learning, Java, Ruby, Machine Learning, Common LISP, Clojure, JavaScript, Semantic Web, NLP, C++, Linux, and Scheme. He has 55 US Patents.

Mark's consulting customer list includes: Google, Capital One, Olive AI, CompassLabs, Disney, Sitescout.com, Embed.ly, and Webmind Corporation.

Mark wrote ten traditional published books for McGraw Hill, Springer Verlag, J Wiley, and Morgan Kaufman publishers before adopting the LeanPub self-publishing platform.

The Leanpub Podcast

بودكاست

Podcast Episode

المحتويات

جدول المحتويات

Cover Material, Copyright, and License

Preface

  1. Book Cover
  2. About the Author
  3. Using the Example Code
  4. Acknowledgements

Python Development Environment

  1. Managing Python with uv

Part 1 - Machine Learning

“Classic” Machine Learning

  1. Example Material
  2. Classification Models using Scikit-learn
  3. Classic Machine Learning Wrap-up
  4. Optional Practice Problems

Regression and Clustering

  1. Regression: Predicting Housing Prices
  2. Clustering: Discovering Groups in Data
  3. Regression and Clustering Wrap-up
  4. Optional Practice Problems

Exploratory Data Analysis and Feature Engineering

  1. Exploratory Data Analysis
  2. Feature Engineering
  3. EDA and Feature Engineering Wrap-up
  4. Optional Practice Problems

Anomaly Detection

  1. The Wisconsin Breast Cancer Dataset
  2. Data Preprocessing
  3. Approach 1: Gaussian Statistical Detector
  4. Approach 2: Isolation Forest
  5. Running the Example
  6. Interpreting the Results
  7. Anomaly Detection Wrap-up
  8. Optional Practice Problems

Part 2 - Deep Learning

The Basics of Deep Learning

  1. Using PyTorch for Building a Cancer Prediction Model
  2. Optional Practice Problems

Natural Language Processing Using Deep Learning

  1. Hugging Face and the Transformers Library
  2. Comparing Sentences for Similarity Using Transformer Models
  3. Deep Learning Natural Language Processing Wrap-up
  4. Optional Practice Problems

Part IV - Overviews of Image Generation, Reinforcement Learning, and Recommendation Systems

Overview of Image Generation

  1. Image Generation Using Stable Diffusion and PyTorch
  2. Image Generation Using Google’s Imagen API
  3. Mini-DALL·E: A Lightweight Alternative
  4. Recommended Reading for Image Generation
  5. Optional Practice Problems

Categorical Deep Learning: From Axioms to Implementation using Category Theory

  1. The Para Category and Lens Composition
  2. Markov Categories and Stochastic Morphisms
  3. Invariance and Equivariance: Colimits in Geometry
  4. The Topos Framework: Subobject Classifiers and Sheaves
  5. Natural Transformations and Knowledge Distillation
  6. Categorical Deep Learning Wrap-up
  7. Optional Practice Problems

Overview of Reinforcement Learning (Optional Material)

  1. Overview
  2. Available RL Tools
  3. An Introduction to Markov Decision Process
  4. A Concrete Example: Q-Learning with Gymnasium
  5. Reinforcement Learning Wrap-up
  6. Optional Practice Problems

Overview of Recommendation Systems (Optional Material)

  1. TensorFlow Recommenders
  2. Recommendation Systems Wrap-up

Part 3 - Large Language Models

Introduction to Transformers and Large Language Models

  1. The Transformer Architecture
  2. Tokenization
  3. From Transformers to Large Language Models
  4. Key Capabilities of Modern LLMs
  5. Practical Considerations

LLMs with Public APIs

  1. Setup and Authentication
  2. Text Generation
  3. Thinking Models
  4. Multi-Turn Conversations
  5. Multimodal Input: Analyzing Images
  6. Web Search with LLMs
  7. Structured Output
  8. Practical Considerations
  9. Summary
  10. Optional Practice Problems

LLMs with Local Models

  1. Installing Ollama
  2. Downloading and Running Models
  3. Using Ollama from Python
  4. Reasoning with Local Models
  5. Conversation Memory with Ollama
  6. Prompt Caching for Performance
  7. Image to Text Description (Vision Models)
  8. OpenAI-Compatible API
  9. Alternative Tools for Running Local Models
  10. Hardware Considerations
  11. Summary
  12. Optional Practice Problems

Text Adventure Game with an LLM Game Master

  1. How It Works
  2. The System Prompt
  3. The Game Engine
  4. Playing the Game
  5. Customizing Your Adventure
  6. Why This Matters
  7. Running the Example
  8. Summary

Semantic Web Question Answering with SPARQL and Large Language Models

  1. A Live Example to Motivate the Reader
  2. What This Program Does
  3. The Semantic Web and RDF
  4. SPARQL Query Language
  5. The Shared Library: library.py
  6. Example 1: DBpedia (DBPedia.py)
  7. Example 2: Wikidata (Wikidata.py)
  8. Example 3: Combined DBpedia + Wikidata (DBPedia_and_Wikidata.py)
  9. Running the Code
  10. Example Queries
  11. Troubleshooting
  12. Exercises
  13. Further Reading

Object Oriented AI Agents with NVIDIA’s OO Agents Framework

  1. Why represent an agent as a class
  2. What we will build
  3. The mock destination database
  4. Structured output: the Pydantic models
  5. Configuring the language model
  6. The agent class, method by method
  7. Complete listing of travel_planner_agent.py:
  8. The Makefile and PEP 723 script metadata
  9. Running the example
  10. Interpreting the output
  11. Wrap Up
  12. Optional Practice Problems

Part 4 - Symbolic AI and Knowledge Representation

Symbolic AI

  1. Comparison of Symbolic AI and Deep Learning
  2. Implementing Frame Data Structures in Python
  3. Use Predicate Logic by Calling Swi-Prolog
  4. Swi-Prolog and Python Deep Learning Interop
  5. Soar Cognitive Architecture
  6. Constraint Programming with MiniZinc and Python
  7. Good Old Fashioned Symbolic AI Wrap-up
  8. Optional Practice Problems

Expert Systems Using the Rete Algorithm

  1. 1. Rete Engine Architecture & Design
  2. 2. Implementing the Trickier Parts of Rete
  3. 3. Case Studies & Design Advice
  4. Wrap Up
  5. Optional Practice Problems

A Chess Engine and AI Player in Pure Python

  1. Architecture Overview
  2. Board Representation
  3. Precomputed Move Tables
  4. The Move Class
  5. Move Generation
  6. Make Move and Unmake Move
  7. Zobrist Hashing
  8. Evaluation
  9. Search: Negamax with Alpha-Beta Pruning
  10. The Transposition Table
  11. Quiescence Search
  12. Move Ordering
  13. Iterative Deepening
  14. The Interactive CLI
  15. Testing with Perft
  16. Playing Against the Bot
  17. Running the Example
  18. Why This Matters
  19. Summary

Part 5 - Knowledge Representation

Getting Setup To Use Graph and Relational Databases

  1. Querying Wikidata with SPARQL and Python
  2. The SQLite Relational Database for Knowledge Representation
  3. Optional Practice Problems

Optional Material: A Deeper Dive Into Semantic Web and Linked Data

  1. Overview and Theory

Open Knowledge Format (OKF) for Human-Agent Systems

  1. References & Inspiration
  2. What is Open Knowledge Format (OKF)?
  3. Sample Knowledge Bundle Structure
  4. Python Architecture: The OKF Explorer
  5. Example Output
  6. Wrap Up
  7. Optional Practice Problems

Symbolic Math in Pure Python

  1. 1. Why Symbolic Computation Matters
  2. 2. The Expression Vocabulary
  3. 3. Simplification: the Algebraic Engine
  4. 4. Pretty-Printing: Trees Back into Math
  5. 5. Differentiation: Rules as Recursion
  6. 6. Integration: Recognizing Patterns
  7. 7. Numeric Evaluation: Closing the Loop
  8. 8. The Self-Verifying Demo
  9. 9. Running the Code
  10. 10. Interpreting the Results
  11. 11. What to Build Next

أيضا بواسطة المؤلف

أيضا بواسطة المؤلف

Leanpub بدون شروط, بدون مجازفه, 100% ضمان لسعادتك معنا

فى خلال 60 يوم من الشراء تستطيع أن تسترد 100% من الذى دفعته فى أى مشتريات من Leanpub , بنقرتين من الماوس. ألقى نظره على كامل الشروط.

اكسب 8$ على كل عملية شراء بقيمة 10$، و16$ على كل عملية شراء بقيمة 20$

نحن ندفع عائدات بنسبة ٨٠٪ على المشتريات التي تبلغ قيمتها 7.99$ أو أكثر، وعائدات بنسبة ٨٠٪ مع خصم رسوم ثابتة قدرها 50 سنتاً على المشتريات التي تتراوح بين 0.99$ و7.98$. تكسب 8$ على كل بيع بقيمة 10$، و16$ على كل بيع بقيمة 20$. لذلك، إذا بعنا 5000 نسخة غير مستردة من كتابك بسعر 20$، ستكسب 80,000$.

(نعم، بعض المؤلفين قد كسبوا بالفعل أكثر من ذلك بكثير على Leanpub.)

في الواقع، كسب المؤلفون أكثر من 14 مليون دولار من خلال الكتابة والنشر والبيع على Leanpub.

تعرف على المزيد حول الكتابة على Leanpub

تحديثات مجانية. خالي من حماية DRM.

إذا اشتريت كتابًا من Leanpub، فستحصل على تحديثات مجانية طالما يقوم المؤلف بتحديث الكتاب! يستخدم العديد من المؤلفين Leanpub لنشر كتبهم أثناء الكتابة. جميع القراء يحصلون على تحديثات مجانية، بغض النظر عن متى اشتروا الكتاب أو كم دفعوا (بما في ذلك مجانًا).

معظم كتب Leanpub متوفرة بتنسيق PDF (للكمبيوتر)، EPUB (للهواتف والأجهزة اللوحية و Kindle). يتم عرض التنسيقات التي يتضمنها الكتاب في الزاوية العلوية اليمنى من هذه الصفحة.

وأخيرًا، الكتب من Leanpub لا تحتوي على أي هراء حماية حقوق النسخ DRM، لذا يمكنك قراءتها بسهولة على أي جهاز مدعوم.

تعرف على المزيد حول تنسيقات الكتب الإلكترونية من Leanpub وأماكن قراءتها

اكتب وانشر على Leanpub

يستخدم المؤلفون والناشرون Leanpub لنشر كتب إلكترونية رائعة قيد التقدم والمكتملة، تمامًا مثل هذه. يمكنك استخدام Leanpub للكتابة، والنشر وبيع كتابك أيضًا! Leanpub هو منصة قوية للمؤلفين الجادين، يجمع بين تدفق الكتابة والنشر البسيط والأنيق مع متجر يركز على بيع الكتب الإلكترونية قيد التقدم. Leanpub هو آلة كتابة سحرية للمؤلفين: فقط اكتب بنص عادي، ولنشر كتابك الإلكتروني، فقط اضغط على زر. إنه حقًا بهذه السهولة.

تعرف على المزيد حول الكتابة على Leanpub