GQ / lab logES / EN
← Back to the log

2025

Neural network foundations, from the perceptron to a tuned DNN

A perceptron and gradient descent written from scratch in NumPy, and a deep regression network tuned with Keras Tuner.

Neural network foundations, from the perceptron to a tuned DNN

Problem

Understand how a neural network learns before relying on frameworks, then apply it to a real regression problem.

Data

AND/OR truth tables for the perceptron, an analytic cost function for gradient descent, and a course-provided regression dataset (8 numeric features `x1`…`x8`, target `y`) for the DNN.

Method

A step-function perceptron for AND/OR gates, gradient descent on a cost function, and a 3-hidden-layer DNN with EDA, Keras Tuner, early stopping and 5-fold cross-validation.

Result

The regression DNN reached a test RMSE of 89.8 (5-fold CV, 92.6 ± 40.7), with fold-to-fold variability documented as a model limitation.

Stack

  • Python
  • NumPy
  • TensorFlow
  • Keras Tuner
  • scikit-learn

Context

Course: Machine Learning II · Machine Learning III · 2025

View the code on GitHub ↗