Core Dependencies from requirements.txt for AI for Beginners: Complete Python Stack
The AI for Beginners curriculum depends on 20 pinned Python packages—including TensorFlow 2.17.0, Keras 3.13.2, pandas 2.2.2, gym 0.26.2, and NLTK 3.10.0—that collectively support deep learning, computer vision, natural language processing, and reinforcement learning experiments across the repository's notebooks.
The microsoft/AI-For-Beginners repository provides a comprehensive, open-source curriculum for learning artificial intelligence. The exact software stack is declared in requirements.txt, which enumerates the core dependencies from requirements.txt for AI for Beginners required to execute the Jupyter notebooks. Installing these pinned packages ensures compatibility with the code samples in the lessons/ directory and prevents version conflicts.
Deep Learning and Neural Network Frameworks
The majority of the curriculum's neural network training relies on the TensorFlow ecosystem, supplemented by PyTorch utilities for model inspection.
TensorFlow, Keras, and TensorBoard
The backbone for deep learning lessons is TensorFlow 2.17.0, specified on line 16 of requirements.txt. It is paired with Keras 3.13.2 (line 5) as the high-level API for building sequential and functional models. Training metrics are visualized through TensorBoard 2.17.1 (line 17), backed by the tensorboard-data-server 0.7.2 (line 13) for efficient log streaming.
import tensorflow as tf
from tensorflow import keras
model = keras.Sequential([
keras.layers.Dense(64, activation='relu', input_shape=(32,)),
keras.layers.Dense(10, activation='softmax')
])
model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'])
PyTorch Model Inspection
While TensorFlow drives most lessons, torchinfo 1.8.0 (line 19) provides layer-by-layer summary utilities for PyTorch networks whenever they appear in the curriculum.
from torchinfo import summary
import torch.nn as nn
class Net(nn.Module):
def __init__(self):
super().__init__()
self.fc = nn.Linear(784, 10)
def forward(self, x):
return self.fc(x)
summary(Net(), input_size=(1, 784))
Pre-trained Models and Datasets
The curriculum leverages ready-made resources through tensorflow-hub 0.16.1 (line 15) for pre-trained model access and tensorflow-datasets 4.9.6 (line 14) for standardized dataset loading.
Natural Language Processing Libraries
Text-based lessons combine classical NLP techniques with modern transformer tooling.
Traditional NLP with NLTK and Gensim
NLTK 3.10.0 (line 6) supplies tokenization, stemming, and corpora handling for introductory NLP modules. Gensim 4.3.3 (line 1) supports topic modeling and word-embedding utilities.
Hugging Face Tokenizers and Wrappers
For transformer-based demonstrations, the repository includes huggingface 0.0.1 (line 3) as a wrapper for the model hub, alongside tokenizers 0.20.0 (line 18) for fast text tokenization compatible with Hugging Face models.
from tokenizers import Tokenizer
tokenizer = Tokenizer.from_pretrained("bert-base-uncased")
encoded = tokenizer.encode("Hello AI for Beginners!")
print(encoded.ids)
Computer Vision and Image Processing
Visual AI lessons depend on three complementary imaging libraries:
- imageio
2.35.0(line 4) simplifies reading and writing image files in notebooks. - pillow
12.2.0(line 8) handles basic image transformations via the PIL fork. - scikit-image
0.24.0(line 10) supplies advanced algorithms for computer vision exercises.
Reinforcement Learning and Interactive Demos
Reinforcement learning modules use gym 0.26.2 (line 2) to instantiate classic control environments such as CartPole. Interactive visualizations and simple game demos are powered by pygame 2.6.0 (line 9).
import gym
env = gym.make('CartPole-v1')
obs = env.reset()
for _ in range(1000):
action = env.action_space.sample()
obs, reward, done, info = env.step(action)
if done:
obs = env.reset()
Data Manipulation, Visualization, and Utilities
Tabular data workflows rely on pandas 2.2.2 (line 7) for manipulation and analysis. Statistical plots are generated with seaborn 0.13.2 (line 11), built on top of Matplotlib. Long-running training loops display progress via tqdm 4.66.5 (line 20), while smart-open 7.0.4 (line 12) enables transparent streaming of large datasets from remote storage.
import pandas as pd
df = pd.read_csv('data.csv')
print(df.head())
import seaborn as sns
import matplotlib.pyplot as plt
sns.lineplot(data=df, x='epoch', y='accuracy')
plt.show()
Installing the Core Dependencies
To replicate the exact environment defined in the Microsoft curriculum, run the following command from the repository root:
pip install -r requirements.txt
This installs all core dependencies from requirements.txt for AI for Beginners in a single step. If you prefer Conda, the repository also provides an environment.yml file that mirrors the Python packages and adds system-level libraries. A separate binder/requirements.txt file exists under the binder/ directory for cloud-based execution via Binder.
Summary
- The
requirements.txtfile inmicrosoft/AI-For-Beginnerspins 20 Python packages that cover deep learning, NLP, computer vision, and reinforcement learning. - TensorFlow
2.17.0and Keras3.13.2form the primary deep learning stack, while torchinfo1.8.0supports PyTorch model summaries. - NLP lessons use NLTK
3.10.0, gensim4.3.3, huggingface0.0.1, and tokenizers0.20.0. - Computer vision workflows depend on imageio
2.35.0, pillow12.2.0, and scikit-image0.24.0. - Reinforcement learning demos require gym
0.26.2and pygame2.6.0. - Alternative environment definitions are available in
environment.ymlandbinder/requirements.txt.
Frequently Asked Questions
What is the main deep learning framework used in AI for Beginners?
The curriculum primarily uses TensorFlow 2.17.0 with the Keras 3.13.2 high-level API for building and training neural networks. These are the central deep-learning dependencies listed in requirements.txt.
How do I install all core dependencies from the requirements.txt file?
Run pip install -r requirements.txt from the root of the cloned repository. This command installs every pinned package—including pandas, seaborn, TensorFlow, and gym—so the notebooks in the lessons/ directory execute without import errors.
Which NLP libraries are included in the AI for Beginners requirements?
The file specifies NLTK 3.10.0 for classical text processing and gensim 4.3.3 for word embeddings. It also includes huggingface 0.0.1 paired with tokenizers 0.20.0 for modern transformer-based NLP tasks.
Are there separate dependency files for different environments?
Yes. In addition to the root requirements.txt, the repository contains an environment.yml for Conda users and a binder/requirements.txt file that configures the runtime for Binder cloud execution.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →