0% found this document useful (0 votes)
19 views5 pages

LAB SHEET 1 Basics

The document provides an overview of popular deep learning frameworks, including TensorFlow, PyTorch, Keras, MXNet, Caffe, JAX, and Theano, highlighting their strengths and ideal use cases. It also outlines a basic workflow for building and training deep learning models, including data preparation, model building, training, testing, and visualization. Additionally, it offers practical setup instructions and tips for beginners to get started with deep learning projects.

Uploaded by

falishaumaiza6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views5 pages

LAB SHEET 1 Basics

The document provides an overview of popular deep learning frameworks, including TensorFlow, PyTorch, Keras, MXNet, Caffe, JAX, and Theano, highlighting their strengths and ideal use cases. It also outlines a basic workflow for building and training deep learning models, including data preparation, model building, training, testing, and visualization. Additionally, it offers practical setup instructions and tips for beginners to get started with deep learning projects.

Uploaded by

falishaumaiza6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Deep learning frameworks are tools or libraries that make it easier to build, train, and deploy

deep learning models. These frameworks handle the complex math and computations
behind neural networks, so you can focus on designing your model. Here are some of the
most popular ones explained simply:

1. TensorFlow

 What it is: A flexible framework created by Google.

 What it’s good for: Works for beginners and advanced users. Great for building large,
scalable models.

 Why it’s useful: It provides pre-built tools (like Keras) for easy use, but you can also
dive deep into advanced features.

2. PyTorch

 What it is: A popular framework created by Facebook.

 What it’s good for: Research and quick experimentation. It’s very user-friendly and
works well for small and medium-sized projects.

 Why it’s useful: It feels natural to code in and is popular among researchers and
developers.

3. Keras

 What it is: A high-level API (built on top of TensorFlow).

 What it’s good for: Beginners who want to start with deep learning quickly.

 Why it’s useful: It’s simple and intuitive, making it great for fast prototyping.

4. MXNet

 What it is: A framework developed by Amazon.

 What it’s good for: Scalability across devices and platforms.

 Why it’s useful: It’s efficient for distributed computing and often used in cloud
environments.

5. Caffe

 What it is: A lightweight and fast framework.

 What it’s good for: Image processing tasks like recognizing objects in photos.
 Why it’s useful: It’s optimized for speed and works well for computer vision
applications.

6. JAX

 What it is: A newer framework by Google.

 What it’s good for: Advanced computations and machine learning research.

 Why it’s useful: Combines ease of use with powerful tools for faster execution.

7. Theano

 What it is: One of the oldest deep learning frameworks.

 What it’s good for: Learning the basics of deep learning (though it’s no longer
actively developed).

 Why it’s useful: It helped inspire the creation of modern frameworks.

In summary:

 Beginners: Try Keras or PyTorch.

 Advanced researchers: Use PyTorch or JAX.

 For scalability: Choose TensorFlow or MXNet.

 For specific tasks (e.g., computer vision): Look at Caffe.

Summary of Workflow:

 Load and prepare the data.


 Build the neural network.
 Train the model using training data.
 Test the model on new data.
 Visualize predictions.
1. Set Up Your Environment

 Install Required Tools:


You’ll need a code editor (like Jupyter Notebook or VS Code) and a Python
environment. Install necessary libraries like TensorFlow or PyTorch using this
command:

pip install tensorflow keras

# or

pip install torch torchvision

 Use Google Colab (Optional):


If you don’t want to install anything, use Google Colab, a free, browser-based tool for
running deep learning code.

2. Understand the Goal of the Lab

 Start simple, like building a basic neural network. For example:

o Classify handwritten digits (e.g., the MNIST dataset).

o Predict a simple output from given data.

3. Load the Dataset

 Deep learning usually starts with data. Most labs use preloaded datasets. For
example:

from tensorflow.keras.datasets import mnist

(x_train, y_train), (x_test, y_test) = mnist.load_data()

4. Prepare the Data

 Neural networks work best with numbers between 0 and 1. Normalize your data:

x_train = x_train / 255.0

x_test = x_test / 255.0

5. Build a Simple Model


 Define a basic neural network with one or two layers:

from tensorflow.keras import Sequential

from tensorflow.keras.layers import Flatten, Dense

model = Sequential([

Flatten(input_shape=(28, 28)),

Dense(128, activation='relu'),

Dense(10, activation='softmax')

])

6. Compile the Model

 Tell your model how to learn (loss function) and how to improve (optimizer):

model.compile(optimizer='adam',

loss='sparse_categorical_crossentropy',

metrics=['accuracy'])

7. Train the Model

 Fit your model to the data:

model.fit(x_train, y_train, epochs=5)

8. Test the Model

 Evaluate how well your model performs on unseen data:

test_loss, test_acc = model.evaluate(x_test, y_test)

print(f"Test accuracy: {test_acc}")

9. Visualize Results

 Plot some predictions or metrics to understand the results:

import matplotlib.pyplot as plt


plt.imshow(x_test[0], cmap='gray')

prediction = model.predict(x_test[0:1])

print(f"Predicted label: {prediction.argmax()}")

10. Reflect and Experiment

 Think about what worked well and what didn’t.

 Experiment with changing the number of layers, units, or epochs.

You might also like