Skip to main content

tensor-flow-assignments

Deep Learning lab assignments written as runnable TensorFlow/Keras scripts. Each assignment is a standalone Python module that you can run from the command line or import.

ID Assignment Data needed
2 MLP comparison: 1 hidden layer + ReLU vs 2 hidden layers + Tanh Fashion-MNIST CSVs
3 Regularization: baseline vs L2 vs Dropout Fashion-MNIST CSVs
4 Activation functions: Sigmoid vs Tanh vs ReLU Fashion-MNIST CSVs
5b CNN vs MLP with data augmentation CIFAR-10 image folders
6a LSTM for IMDB sentiment classification IMDB Dataset.csv
6b Simple RNN for IMDB sentiment classification IMDB Dataset.csv
7a Transfer learning with ResNet50 (cats vs dogs) cats_and_dogs_filtered
7b Transfer learning with VGG16 (cats vs dogs) cats_and_dogs_filtered
8 Hyperparameter tuning with TensorBoard logging Fashion-MNIST CSVs

Installation

pip install tensor-flow-assignments

Requires Python 3.10 or newer. TensorFlow, NumPy, pandas, Matplotlib and scikit-learn are installed automatically.

Usage

The package installs a tensor_flow_ command:

tensor_flow_ list                       # show all assignments
tensor_flow_ run 4 --help               # options for one assignment
tensor_flow_ run 4                      # run with the default file names in the current folder
tensor_flow_ run 2 --train-csv data/fashion-mnist_train.csv --test-csv data/fashion-mnist_test.csv
tensor_flow_ run 6a --csv "IMDB Dataset.csv" --epochs 3
tensor_flow_ run 7a --data-dir cats_and_dogs_filtered          # downloads ImageNet weights
tensor_flow_ run 8 --save-plots plots                         # save plots instead of showing them

Each assignment can also be run as a module or imported:

python -m tensor_flow_.assignment_3 --epochs 8
from tensor_flow_ import assignment_4
assignment_4.main(["--epochs", "2", "--save-plots", "plots"])

Common options

Option Meaning
--epochs N Number of training epochs (each assignment keeps its original default)
--save-plots DIR Save every plot as a PNG in DIR instead of opening a window
--train-csv, --test-csv Fashion-MNIST / MNIST CSV paths (assignments 2, 3, 4, 8)
--csv IMDB CSV path (assignments 6a, 6b)
--data-dir Image folder (assignments 5b, 7a, 7b)
--weights Local pretrained weights file (assignments 7a, 7b); omit to download ImageNet weights

Datasets

The datasets are not included in the package.

  • Fashion-MNIST CSV: fashion-mnist_train.csv and fashion-mnist_test.csv, with a label column and pixel1 ... pixel784 columns (available on Kaggle).
  • IMDB: IMDB Dataset.csv with review and sentiment columns (Kaggle "IMDB Dataset of 50K Movie Reviews").
  • CIFAR-10 folders: train/<class>/ and test/<class>/ image folders.
  • Cats vs dogs: cats_and_dogs_filtered/train/{cats,dogs} and cats_and_dogs_filtered/validation/{cats,dogs}.

Building and publishing

pip install build twine
python -m build                 # creates dist/*.whl and dist/*.tar.gz
twine check dist/*
twine upload dist/*             # needs a PyPI account and API token

To try a release first, upload to TestPyPI with twine upload --repository testpypi dist/*.

License

MIT

Metadata

Release files for tensor-flow-assignments 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tensor-flow-assignments 0.1.0
File Size Uploaded Provenance Actions
tensor_flow_assignments-0.1.0.tar.gz 13.5 kB Without provenance Details for tensor_flow_assignments-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tensor-flow-assignments 0.1.0
File Interpreter ABI Platform Actions
tensor_flow_assignments-0.1.0-py3-none-any.whl Python 3 none any Details for tensor_flow_assignments-0.1.0-py3-none-any.whl

Total release size: 35.5 kB

Release files / tensor_flow_assignments-0.1.0.tar.gz

Download URL tensor_flow_assignments-0.1.0.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
615701fec915070d795a198467d47e591199d95bb78bc39471e2621777794079
BLAKE2b-256 checksum
How to use checksums
9a5d9d9d32533c8819f45d38203b9d20aff42f23f17af66ab743586e45779b07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / tensor_flow_assignments-0.1.0-py3-none-any.whl

Download URL tensor_flow_assignments-0.1.0-py3-none-any.whl
Size 22.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1fd10c4c8511e0c5a4afd4539eea65355d1059247eb2b343c0694ec5d65f0c02
BLAKE2b-256 checksum
How to use checksums
f2e6470889b4e7efdde514c031399e9d8e635e0ac0dc2f0bf1f367dcff3723b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for tensor-flow-assignments 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page