Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Generative AI with Python and PyTorch
  • Table Of Contents Toc
  • Feedback & Rating feedback
Generative AI with Python and PyTorch

Generative AI with Python and PyTorch - Second Edition

By : Joseph Babcock, Raghav Bali
5 (1)
close
close
Generative AI with Python and PyTorch

Generative AI with Python and PyTorch

5 (1)
By: Joseph Babcock, Raghav Bali

Overview of this book

Become an expert in Generative AI through immersive, hands-on projects that leverage today’s most powerful models for Natural Language Processing (NLP) and computer vision. Generative AI with Python and PyTorch is your end-to-end guide to creating advanced AI applications, made easy by Raghav Bali, a seasoned data scientist with multiple patents in AI, and Joseph Babcock, a PhD and machine learning expert. Through business-tested approaches, this book simplifies complex GenAI concepts, making learning both accessible and immediately applicable. From NLP to image generation, this second edition explores practical applications and the underlying theories that power these technologies. By integrating the latest advancements in LLMs, it prepares you to design and implement powerful AI systems that transform data into actionable intelligence. You’ll build your versatile LLM toolkit by gaining expertise in GPT-4, LangChain, RLHF, LoRA, RAG, and more. You’ll also explore deep learning techniques for image generation and apply styler transfer using GANs, before advancing to implement CLIP and diffusion models. Whether you’re generating dynamic content or developing complex AI-driven solutions, this book equips you with everything you need to harness the full transformative power of Python and AI.
Table of Contents (19 chapters)
close
close
17
Other Books You May Enjoy
18
Index

To get the most out of this book

Before diving into the chapters, it’s essential to ensure you have the right setup and foundational knowledge to make the most of this book. Here’s what you’ll need.

Basic understanding of Python syntax and programming experience will help you understand the majority of the code base. Additionally, an intermediate-level understanding of concepts related to machine learning and deep learning would enable you to appreciate and understand complex generative models and techniques discussed throughout the book. A quick setup guide is as follows:

  • Hardware (minimum):
    • 512-GB HDD
    • 32 GB RAM
    • Intel Core i5 processor or better/Apple Silicon M1 or better
    • Access to a 32-GB graphics card or better (T4 or better)
  • Software:
    • Python 3.11 and above
    • Pytorch 2.5.x and above
  • Chrome/Safari/Firefox browser for directly executing code through Google Colab or other cloud services

Chapter-specific dependencies are mentioned within the respective chapters, along with the associated Jupyter Notebooks and GitHub repository.

Download the example code files

The code bundle for the book is hosted on GitHub at https://github.com/PacktPublishing/Generative-AI-with-Python-and-PyTorch-Second-Edition. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://packt.link/gbp/9781835884447.

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. For example; “The --name option will set the name of the cluster to cluster01, and --config tells the installer to use the cluster01-kind.yaml config file.”

A block of code is set as follows:

datafile_path = ./metamorphosis_franz_kafka.txt'
# Load the text file
text = open(datafile_path, 'rb').read().decode(encoding='utf-8')
print ('Book contains a total of {} characters'.format(len(text)))

Any command-line input or output is written as follows:

PS C:\Users\mlb> kubectl create ns not-going-to-work
 namespace/not-going-to-work created

Bold: Indicates a new term, an important word, or words that you see on the screen, for example, in menus or dialog boxes, also appear in the text like this. For example: “Hit the Finish Login button at the bottom of the screen.”

Warnings or important notes appear like this.

Tips and tricks appear like this.

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Generative AI with Python and PyTorch
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon