<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Fernando Biesdorf on Medium]]></title>
        <description><![CDATA[Stories by Fernando Biesdorf on Medium]]></description>
        <link>https://medium.com/@biesdorf?source=rss-bf29a0f2153------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Nx85Bz8s1TLbWJ7C.jpg</url>
            <title>Stories by Fernando Biesdorf on Medium</title>
            <link>https://medium.com/@biesdorf?source=rss-bf29a0f2153------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 07:37:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@biesdorf/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Automated Data Augmentation, Step by Step]]></title>
            <link>https://medium.com/@biesdorf/automated-data-augmentation-step-by-step-19562fc5cc2e?source=rss-bf29a0f2153------2</link>
            <guid isPermaLink="false">https://medium.com/p/19562fc5cc2e</guid>
            <dc:creator><![CDATA[Fernando Biesdorf]]></dc:creator>
            <pubDate>Wed, 23 Sep 2026 14:42:57 GMT</pubDate>
            <atom:updated>2026-09-23T14:42:57.614Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o5rRqcXfxu2zWaDXDC_DJw.png" /><figcaption>Rotating -3 or 3 degrees could be better, gotta try.</figcaption></figure><p>A neural network that classifies photos needs many labelled examples. Labeling is slow and expensive. Data augmentation is simple: you change the images you already have, a little, in different ways (see below). A dog photographed from the left is still a dog. A dog in a darker room is still a dog. The label is the same but different variations can be made part of the training dataset when training a model.</p><p>Automated means the changes happen in code, inside the data pipeline, before the images reach the model. They are random, so the same picture comes back different on the next epoch. In Python, this is straightforward: one call per operation in TensorFlow: flip, random crop, rotate, brightness, contrast, hue.</p><p>Crops help the most. AlexNet took 224 by 224 patches out of 256 by 256 images, which multiplied their training set by 2048.</p><p>You can also measure whether a modification is worth keeping. Train twice, once with it and once without, and compare the validation accuracy. Some augmentations help, some end up reducing the accuracy.</p><p>- The label must stay the same after the transformation. For example, a mirrored 7 is not a 7.</p><p>- Augment the training set only. Validation and test stay fixed.</p><p>- Look at a few augmented images before you train on them. Most bugs are obvious for humans to detect, some secondary automation can be used to address this issue as well.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19562fc5cc2e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ImageNet Classification with Deep Convolutional Neural Networks]]></title>
            <link>https://medium.com/@biesdorf/imagenet-classification-with-deep-convolutional-neural-networks-c3e793f686b6?source=rss-bf29a0f2153------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3e793f686b6</guid>
            <dc:creator><![CDATA[Fernando Biesdorf]]></dc:creator>
            <pubDate>Sun, 13 Sep 2026 18:18:41 GMT</pubDate>
            <atom:updated>2026-09-13T18:18:41.727Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://papers.nips.cc/paper/2012/file/c399862d3b9d6b76c8436e924a68c45b-Paper.pdf">Krizhevsky, Sutskever and Hinton, NIPS 2012.</a> A summary.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_TSL8IRdlyhE6zLBgmHt1w.png" /><figcaption>The model architecture</figcaption></figure><p>Introduction</p><p>Until 2012, object recognition used hand-designed features and small image collections of tens of thousands of pictures. Real photos vary too much for that. ImageNet changed the situation: 15 million labelled images in 22,000 categories. The authors wanted to demonstrate that a large convolutional neural network, trained directly on those images, could learn the features itself and beat every previous method.</p><p>Procedures</p><p>The network has eight learned layers: five convolutional and three fully connected, 60 million parameters in total. It was trained on 1.2 million ImageNet pictures for 1,000 classes, using two GTX 580 GPUs of 3 GB each, for about six days. Three ideas made it possible. ReLU units instead of tanh, which train much faster. Data augmentation with random crops and color variation. And dropout in the fully connected layers.</p><p>Results</p><p>On ILSVRC-2010 the network obtained 37.5% top-1 and 17.0% top-5 error, against 47.1% and 28.2% for the previous best. In the 2012 competition it reached 15.3% top-5 error, while the second place obtained 26.2%. Depth was essential: removing a single convolutional layer cost about 2% accuracy. The learned filters recognise edges, colours and blobs, and similar images produce similar internal vectors.</p><p>Conclusion</p><p>The authors conclude that a large, deep convolutional network trained with supervision alone can solve a very difficult recognition problem, and that its depth is what makes it work. No unsupervised pre-training was necessary. Their results were still limited by available GPU memory and training time, so they expected better numbers simply from bigger networks, and they proposed to apply the same approach to video.</p><p>Personal Notes</p><p>Using Dropout was used to reduce over-fitting, it not only made the model more robust but also doubled the time for the training to converge. It has it’s costs, but it is viable because nowadays we have much more compute power. Splitting the work across infra is a concern of ML engineers, not only ML Ops Engineers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3e793f686b6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Batch please!]]></title>
            <link>https://medium.com/@biesdorf/batch-please-cbfbb327f9d0?source=rss-bf29a0f2153------2</link>
            <guid isPermaLink="false">https://medium.com/p/cbfbb327f9d0</guid>
            <dc:creator><![CDATA[Fernando Biesdorf]]></dc:creator>
            <pubDate>Thu, 10 Sep 2026 15:15:09 GMT</pubDate>
            <atom:updated>2026-09-11T12:25:12.887Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XAO3DEdIQ0243F_jU1zLqg.png" /><figcaption>Gradient Descent not always a descent gradient, o/ that is normal.</figcaption></figure><p><strong># A few concepts related to training your deep learning neural networks.</strong></p><p><strong>## Feature Scaling</strong></p><p>ou will start with some data, the data will have some aspects that will be useful to determine the Y_hat. Those aspects are the “Features”, and that is what the model is trained on. You need feature scaling because some features will be represented mathematically as a range/distribution of 0 to 1, others from 0 to 1000. If some measures in your dataset are done in mm, and some others are done in meters, the model will be trained on the numbers only. Scaling the features is putting all the numbers in a way that allows the model to learn while being forgiven for not understanding the real world. With scaled features, the gradient descent will be more efficient, so training the model will require fewer passes.</p><p>- <strong>Pro:</strong> Faster, more stable gradient descent; no feature dominates by unit alone.</p><p>- <strong>Con:</strong>Must persist the scaler and apply identically at inference; loses original units.</p><p><strong>## Batch Normalization</strong></p><p>A Batch is a subset of the training data. When you split the data into batches, you do that with the goal of training the model chunk-by-chunk. But the batches themselves aren’t what gets normalized. Batch Normalization normalizes the input to the activation function. After each layer computes its outputs, BN standardizes those values around mean 0, std 1. Without it, activation scales drift as the weights change, and gradients can explode or vanish. Batch norm’s real benefit is that it smooths the loss surface, letting you use a much larger learning rate.</p><p>- <strong>Pro:</strong> Smooths the loss surface; allows much larger learning rates; mild regularization.</p><p>- <strong>Con:</strong> Depends on batch size (unstable when small); adds compute. At inference there is no batch, so it must use running mean/variance saved during training; forgetting `model.eval()` silently corrupts predictions.</p><p><strong>## Mini-batch Gradient Descent</strong></p><p>Mini-batch Gradient Descent means computing the gradient once per batch. Batch Gradient Descent means calculating the gradient at once (one batch) for the whole data set. And SGD, stochastic gradient descent, means calculating it for single rows.</p><p>- <strong>Pro:</strong> Balances speed and stability; fits in memory; gradient noise helps escape saddle points.</p><p>- <strong>Con:</strong> Extra hyperparameter (batch size); noisier convergence than full-batch.</p><p><strong>## Gradient Descent with Momentum</strong></p><p>With momentum, you keep a running average of past gradients and move in that combined direction instead. Consistent directions get reinforced, zigzags get damped.</p><p>- <strong>Pro: </strong>Damps zigzag, accelerates consistent directions; escapes shallow local minima and plateaus.</p><p>- <strong>Con:</strong> Adds a hyperparameter, the momentum coefficient beta (typically 0.9); too much momentum overshoots the minimum.</p><p><strong>## RMSProp Optimization</strong></p><p>Root Mean Square Propagation keeps score of how big recent gradients are, per parameter, then divides each new gradient step by the square root of that average, dampening big changes and boosting small changes.</p><blockquote><strong>Rho </strong>(called <strong>beta2</strong> in Adam) is the decay rate of the running average of squared gradients: avg = rho * avg + (1 — rho) * gradient². At rho = 0.9 the average remembers roughly the last 10 gradients; higher rho means a longer memory and smoother, more sluggish step sizes, lower rho reacts faster but noisier.</blockquote><p>- <strong>Pro:</strong> Per-parameter step sizes; handles sparse and badly scaled gradients well.</p><p>- <strong>Con:</strong> No momentum, so direction still zigzags; sensitive to the decay rate rho.</p><p><strong>## Adam Optimization</strong></p><p>Adam (Adaptive Moment Estimation) combines the two previous techniques. From momentum it takes a running average of the gradients (the direction); from RMSProp it takes a running average of the squared gradients (the step size). It divides each step by the square root of the second average and applies a bias correction early in training, when the running averages are still warming up.</p><p>- <strong>Pro:</strong> Momentum plus per-parameter step sizes; robust defaults, converges fast with little tuning.</p><p>- <strong>Con:</strong> Three hyperparameters; can generalize worse than tuned SGD with momentum.</p><blockquote>To counter that: use <strong>AdamW</strong> (decoupled weight decay), which closes most of the generalization gap, or <strong>switch optimizers mid-training</strong>. The split is by phase, not by batch: run most epochs on Adam, then the final 20–40% on SGD with momentum, with a fresh learning rate for the SGD phase since Adam’s effective step size does not carry over. When in doubt, train both and let them compete.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/251/1*wE5fFGaoQi5HkurRjsH7CQ.gif" /></figure><p><strong>## Learning Rate Decay</strong></p><p>Learning Rate Decay shrinks the learning rate as training progresses, using a schedule: a fixed step every few epochs, a smooth exponential, or 1/t. Big steps first for speed, small steps later for precision.</p><p>- <strong>Pro:</strong> Fast early progress, precise late convergence; usually a free accuracy gain.</p><p>- <strong>Con:</strong> Schedule is another thing to tune; decaying too early stalls training.</p><blockquote>To counter that: make the schedule reactive instead of fixed. `ReduceLROnPlateau` only cuts the LR when validation loss stops improving for a set number of epochs (its <strong>patience</strong>, the same idea early stopping uses), so it cannot decay too early. Or use warmup plus cosine decay as a default, which is robust across most setups and leaves you only the initial LR to tune (pick it with an LR range test).</blockquote><blockquote><strong>LR range test: </strong>a short throwaway run where you sweep the learning rate from tiny to huge (exponentially, over a few hundred iterations) and plot loss against LR. The loss dips, flattens, then blows up; pick your initial LR near the steepest downward part, roughly an order of magnitude below where it diverges.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cbfbb327f9d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>