Skip to content

INFO 527 — Neural Networks: Assignment 3 (Feedforward Neural Networks). Implementation of deep, wide, and regularized feedforward neural networks using TensorFlow Keras. Includes experiments with dropout and early stopping, tested via pytest for performance verification. Part of the Master’s in MIS/ML program at the University of Arizona.

Notifications You must be signed in to change notification settings

JDede1/info527-neural-networks-assignment3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

INFO 527 — Neural Networks

Assignment 3: Feedforward Neural Networks

Objectives

The objectives of this assignment are to:

  1. Get familiar with the TensorFlow Keras framework for training neural networks.
  2. Experiment with various hyperparameter choices in feedforward networks.

This assignment builds upon your understanding of backpropagation by introducing high-level model construction using the TensorFlow Keras API. You will design, train, and compare multiple neural network architectures across different datasets.


Files in This Repository

File Description
notebooks/nn.ipynb Main notebook containing the full implementation of feedforward networks in Keras.
notebooks/nn.py Exported Python version of the notebook used for pytest testing.
notebooks/feedforward_networks.ipynb Notebook for running tests and recording pytest results.
results/nn.html Exported HTML version of the notebook for grading and readability.
tests/test_nn.py Provided test file used to validate correctness using pytest.
README.md This documentation file explaining objectives, setup, and submission instructions.
requirements.txt Python dependencies for reproducibility.
.gitignore Specifies intentionally untracked files to keep the repository clean.

Functions to Implement (in nn.py)

You will complete the following functions using the TensorFlow Keras API:

Function Description Marks
create_auto_mpg_deep_and_wide_networks(n_inputs, n_outputs) Creates one deep and one wide neural network for predicting vehicle fuel efficiency (Auto MPG dataset). Both models should have a similar number of parameters and identical activation functions. 5
create_activity_dropout_and_nodropout_networks(n_inputs, n_outputs) Creates one neural network with dropout after each Dense layer and another without dropout for classifying human activities (UCI-HAR dataset). 5
create_income_earlystopping_and_noearlystopping_networks(n_inputs, n_outputs) Creates two neural networks for classifying income level (Adult dataset) — one using early stopping during training and one without early stopping. 5
Total Marks 15

Environment Setup

This project reuses the shared environment created for previous assignments.

# Activate your existing environment
source ~/venvs/ml-env/bin/activate

# Navigate to the assignment directory
cd ~/projects/info527-neural-networks-assignment3

# Install dependencies
pip install -r requirements.txt

requirements.txt

tensorflow>=2.13
keras>=2.13
numpy>=1.24
pytest>=7.0
jupyter>=1.0
ipykernel>=6.0

Testing Instructions

  1. Run all cells in nn.ipynb to complete your implementation.

  2. Export the notebook as:

    • nn.ipynb
    • nn.html
    • nn.py
  3. Copy nn.py into the same folder as test_nn.py.

  4. Run pytest to verify correctness:

pytest tests/test_nn.py

Expected Output:

8.2 RMSE for baseline on Auto MPG
6.2 RMSE for deep on Auto MPG
3.9 RMSE for wide on Auto MPG
.
18.2% accuracy for baseline on UCI-HAR
93.8% accuracy for dropout on UCI-HAR
91.7% accuracy for no dropout on UCI-HAR
.
25.4% accuracy for baseline on census income
79.0% accuracy for early on census income
77.8% accuracy for late on census income
.
============================== 3 passed in 23.16s ==============================

Submission Files

Submit the following for grading:

  • nn.ipynb
  • nn.html
  • nn.py
  • feedforward_networks.ipynb (with pytest results)

Repository Information

Repository name: info527-neural-networks-assignment3

Description: Implementation of feedforward neural networks using TensorFlow Keras, including deep vs. wide architectures, dropout regularization, and early stopping. Includes pytest validation and reproducibility setup. Part of the Master’s in MIS/ML program at the University of Arizona.


Author

This repository was completed as part of INFO 527: Neural Networks, under the M.S. in Information Science and Machine Learning program (2023–2025).

About

INFO 527 — Neural Networks: Assignment 3 (Feedforward Neural Networks). Implementation of deep, wide, and regularized feedforward neural networks using TensorFlow Keras. Includes experiments with dropout and early stopping, tested via pytest for performance verification. Part of the Master’s in MIS/ML program at the University of Arizona.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published