<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Neural Networks - Tag - Jorgen Bergstrom</title><link>https://bergstrom.org/tags/neural-networks/</link><description>Neural Networks - Tag - Jorgen Bergstrom</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><copyright>Jorgen Bergstrom</copyright><lastBuildDate>Sat, 26 Sep 2026 00:00:00 -0500</lastBuildDate><atom:link href="https://bergstrom.org/tags/neural-networks/" rel="self" type="application/rss+xml"/><item><title>A Tiny Neural Network, Explained</title><link>https://bergstrom.org/posts/scalar_autograd_nn/</link><pubDate>Sat, 26 Sep 2026 00:00:00 -0500</pubDate><author>Jorgen Bergstrom</author><guid>https://bergstrom.org/posts/scalar_autograd_nn/</guid><description>Introduction In the previous article we built engine.py: a complete reverse-mode automatic differentiation engine in about 80 lines, built around a single Value class. That engine knows how to record arithmetic on scalars and hand back the gradient of the final result with respect to every scalar that fed into it.
This article builds the next layer on top: nn.py, a small neural-network library in roughly 60 lines (heres the repo).</description></item><item><title>Predicting Cancer with a Tiny Autograd Engine</title><link>https://bergstrom.org/posts/cancer_prediction/</link><pubDate>Sat, 26 Sep 2026 00:00:00 -0500</pubDate><author>Jorgen Bergstrom</author><guid>https://bergstrom.org/posts/cancer_prediction/</guid><description>Introduction In the first two articles of this series we built a reverse-mode autograd engine (engine.py) and a small neural-network library on top of it (nn.py). Together they are about 140 lines of pure Python with no numerical dependencies beyond the standard library.
This article puts them to work on a real problem: predicting whether a breast tumor is malignant from measurements taken from a digitized image. The script is cancer_prediction.</description></item><item><title>Backpropagation Part 3: 1 Hidden Layer, N Perceptrons</title><link>https://bergstrom.org/posts/backpropagation_part_3/</link><pubDate>Sat, 16 Nov 2024 00:00:00 -0500</pubDate><author>Jorgen Bergstrom</author><guid>https://bergstrom.org/posts/backpropagation_part_3/</guid><description>[1 Input] + [1 Hidden Layer with N Perceptrons] + [1 Output] In this example I will extend my previous code to be able to handle a hidden layer with N perceptrons. As before, I will demonstrate the use of the neural network by fitting it to the following mathematical function: $y = 0.1 + 0.1 \cdot x^2$ over the range $x \in [0, 10]$. The C++ implementation for this example can be found in my github account.</description></item><item><title>Backpropagation Part 2: 1 Hidden Layer, 2 Perceptrons</title><link>https://bergstrom.org/posts/backpropagation_part_2/</link><pubDate>Tue, 22 Oct 2024 00:00:00 -0500</pubDate><author>Jorgen Bergstrom</author><guid>https://bergstrom.org/posts/backpropagation_part_2/</guid><description><![CDATA[[1 Input] + [1 Hidden Layer with 2 Perceptrons] + [1 Output] In this example I will create a simple neural network that has one input, one hidden layer with 2 perceptrons, and one output. I will then fit that neural network to the following mathematical function: $y = 0.1 + 0.1 \cdot x^2$ over the range $x \in [0,10]$.
C++ code to solve this problem is listed below:
// 2 Layers: 1 input, 2 hidden, 1 output #include &lt;iostream&gt; #include &lt;fstream&gt; #include &lt;algorithm&gt; #include &lt;cassert&gt; #include &lt;vector&gt; #include &lt;cmath&gt; #include &lt;random&gt; double activation(double x, int type) { if (type==1) return std::max(0.]]></description></item><item><title>Backpropagation Part 1: Single Perceptron</title><link>https://bergstrom.org/posts/backpropagation_part_1/</link><pubDate>Sun, 20 Oct 2024 00:00:00 -0500</pubDate><author>Jorgen Bergstrom</author><guid>https://bergstrom.org/posts/backpropagation_part_1/</guid><description>One Network Layer with 1 Input and 1 Output The simplest neural network architecture consists of a single perceptron. This network has only one input and one output, making it a highly streamlined model. While suitable for theoretical understanding, it is insufficient for real-world applications due to its limited capacity. However, it serves as a fundamental building block for studying the principles of backpropagation and training neural networks.
Code Location You can find the source code for this example here.</description></item><item><title>Neural Network Analysis of Hammer Throw Distance using PyTorch</title><link>https://bergstrom.org/posts/nn_hammer_distance_pytorch/</link><pubDate>Wed, 29 May 2024 00:00:00 -0500</pubDate><author>Jorgen Bergstrom</author><guid>https://bergstrom.org/posts/nn_hammer_distance_pytorch/</guid><description>Summary In this example I have used a “Sequential” neural network model to solve the regression problem of how far a hammer will fly given an initial velocity and angle. A sequential model is linear stack of layers, and allows you to create a Neural Network (NN) by simply adding layers sequentially. Both PyTorch and Keras are popular frameworks for building these NN models. Compared to Kears, the PyTorch approach is exposes more details which makes it more flexible and suitable for complex and dynamic models.</description></item><item><title>Neural Network Analysis of Hammer Throw Distance using Scikit-Learn</title><link>https://bergstrom.org/posts/nn_hammer_distance_sklearn/</link><pubDate>Tue, 28 May 2024 00:00:00 -0500</pubDate><author>Jorgen Bergstrom</author><guid>https://bergstrom.org/posts/nn_hammer_distance_sklearn/</guid><description>Summary The MLPRegressor in scikit-learn is a powerful tool for performing regression tasks using a multi-layer perceptron (MLP), which is a type of artificial neural network. It is a supervised learning algorithm that learns a function that maps input data to continuous output values. It can model complex relationships between features and the target variable.
Code Location You can find the code in this example here. import matplotlib.pyplot as plt import numpy as np from sklearn.</description></item><item><title>Neural Network Analysis of Hammer Throw Distance using TensorFlow Keras</title><link>https://bergstrom.org/posts/nn_hammer_distance_tensorflow/</link><pubDate>Tue, 28 May 2024 00:00:00 -0500</pubDate><author>Jorgen Bergstrom</author><guid>https://bergstrom.org/posts/nn_hammer_distance_tensorflow/</guid><description>Summary The Keras Sequential model is a simple and straightforward way to build neural networks in Keras, a high-level neural networks API running on top of TensorFlow. The Sequential model allows you to stack layers sequentially, meaning each layer has exactly one input tensor and one output tensor. You start by creating an instance of the Sequential model, then add layers to it one by one. Each layer, such as Dense (fully connected), Convolutional, or LSTM (Long Shor-Term Memory), is added using the add method.</description></item></channel></rss>