Skip to content

Commit 6d0dba4

Browse files
authored
Merge pull request #22 from gjbex/feature/pytorch
Add PyTorch MNIST example
2 parents 3f293ff + f2bee0f commit 6d0dba4

File tree

6 files changed

+1085
-0
lines changed

6 files changed

+1085
-0
lines changed

source-code/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ to create it. There is some material not covered in the presentation as well.
1919

2020
## What is it?
2121
* [`keras`](keras): illustration of using Keras for machine learning.
22+
* [`pytorch`](pytorch): illustration of using PyTorch for machine learning.
2223
* [`parameter-optimization`](parameter-optimization): example of parameter
2324
optimization kusing hyperopt, although the examples do not optimize
2425
hyperparameters in machine learning, that would be very similar.

source-code/pytorch/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# ignore data directory
2+
data/
3+
# ignore model checkpoints
4+
mnist_cnn.pt

source-code/pytorch/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# PyTorch
2+
3+
PyTorch is a popular open-source machine learning library developed by
4+
Facebook's AI Research lab. It provides a flexible and dynamic computational
5+
graph, making it easy to build and train deep learning models. PyTorch is
6+
widely used in both academia and industry for various applications, including
7+
natural language processing, computer vision, and reinforcement learning.
8+
9+
10+
## What is it?
11+
12+
1. `mnist.ipynb`: Jupyter notebook that demonstrates how to train a simple neural network on the
13+
MNIST dataset using PyTorch. It includes code for loading the dataset,
14+
defining the model architecture, training the model, and evaluating its
15+
performance.
16+
1. `environment.yml`: Conda environment file that specifies the dependencies
17+
required to run the `mnist.ipynb` notebook. It includes PyTorch and other
18+
necessary libraries.
19+
1. `pytorch_linux64_conda_specs.txt`: Text file containing the specifications
20+
for creating a Conda environment with PyTorch for Linux 64-bit systems.
21+
It lists the required packages and their versions.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: pytorch
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- jupyterlab
6+
- pytorch
7+
- torchvision
8+
9+
prefix: "/home/gjb/mambaforge/envs/pytorch"

0 commit comments

Comments
 (0)