cs 180 / 280a · proj. 3

fun with flow models

part a: exploring the power of flow models

in the first part of this project, i used the pretrained PixNerd-XXL-P16-T2I model to explore how a flow model turns noise into an image. i started by adding noise to a real photograph and comparing a few ways of recovering it. once that was working, i used the same sampling process to generate new images, change existing photos with text prompts, and make images that look different when they are rotated or viewed from a distance.

for the denoising examples, i used a picture of my friend rohan at little plearn thai kitchen with a halloween-themed thai tea. the image is center-cropped and resized to 512×512, and its RGB values are normalized to [−1, 1]. i kept the same image and noise for the early comparisons so that the differences would come from the denoising methods themselves. for guided sampling, i used an euler step size of 0.02, guidance weight w = 7, and an empty text prompt for the unconditional prediction.

original image of my friend Rohan at Little Plearn Thai Kitchen with a Halloween-Themed Thai Tea
original image

1.1 constructing noisy training inputs

before trying to remove any noise, i first needed a way to construct the noisy images. i did this by linearly interpolating between a gaussian noise tensor and the original photo. the value of t controls how much of each goes into the result: at t = 0, the input is entirely noise, and at t = 1, it is the original image. this is different from simply adding noise on top of a photo because the image itself is also multiplied by t.

the three examples below use t = 0.25, 0.50, and 0.75 with the same noise tensor. at 0.25, it is hard to make out much beyond the broad colors of the scene. as t increases, rohan’s face, the lettering on his shirt, and the drink become easier to recognize. i saved these exact inputs to reuse in the following sections so that each method would have to reconstruct the same starting image.

x(t) = (1 − t)ε + t·x(1)

original and noisy inputs · t = 0.25, 0.50, 0.75
original and noisy inputs · t = 0.25, 0.50, 0.75

1.2 classical denoising

i started with gaussian blur as a denoising baseline, which connects back to the filtering work from project 2. averaging nearby pixels can reduce the random variations caused by noise, but it also smooths out real edges and texture. before applying the blur, i divided the noisy image by t to restore the amplitude of the original image contribution. but this rescales the noise too, so it does not solve the denoising problem on its own.

for each input, i tried σ = 1, 2, 4, 8, and 16 and chose the result with the lowest mean squared error against the original photo. the selected values were 8, 4, and 1 for t = 0.25, 0.50, and 0.75, respectively. the tradeoff is especially clear in the first result: a strong blur removes much of the grain, but it also greatly blurs the facial features, shirt lettering, and background details. with less noise to begin with, a smaller blur is enough to preserve more of the original detail.

t = 0.25 · noisy input and gaussian blur · σ = 8
t = 0.25 · noisy input and gaussian blur · σ = 8
t = 0.50 · noisy input and gaussian blur · σ = 4
t = 0.50 · noisy input and gaussian blur · σ = 4
t = 0.75 · noisy input and gaussian blur · σ = 1
t = 0.75 · noisy input and gaussian blur · σ = 1

1.3 one-step denoising

next, i used the pretrained model to predict how the noisy image should change as it moves toward a clean image. the model predicts a velocity, so i multiplied that prediction by the remaining time, 1 − t, and added it to the input. this gives a clean-image estimate from just one model prediction. i used the prompt “a high quality photo” for all three inputs so that the comparison would focus on the amount of noise rather than a change in the text condition.

the model recovers much more recognizable structure than gaussian blur does, especially when comparing the two methods at t = 0.25. it can produce a face and a table even when the input is heavily corrupted, but recovering a plausible photo is not quite the same as recovering the exact original. some details of the drink and shirt get simplified or changed. the inputs at larger t values retain more information, so their reconstructions stay closer to the original photo.

x̂(1) = x(t) + (1 − t)·v(x(t), t, c)

t = 0.25 · original, noisy input, one-step estimate
t = 0.25 · original, noisy input, one-step estimate
t = 0.50 · original, noisy input, one-step estimate
t = 0.50 · original, noisy input, one-step estimate
t = 0.75 · original, noisy input, one-step estimate
t = 0.75 · original, noisy input, one-step estimate

1.4 visualizing velocity

to understand what the one-step denoiser was doing, i looked at the update it adds to the noisy image. since i know the original photograph, i can also calculate the exact update that would recover it by subtracting the noisy input from the clean image. the figures below put this ground-truth update next to the model’s predicted update, followed by an error map showing where they disagree.

for each pixel, i calculated the root-mean-square difference between the two updates across the RGB channels. i computed that error before clipping or scaling anything for display. the predicted and ground-truth updates share one symmetric color scale, where middle gray represents zero, and the error maps use the same limits across all three times. that makes the rows comparable: the darker error maps at larger t show that the remaining update is smaller and its absolute prediction error is lower, although this alone does not tell us the relative accuracy of the velocity prediction.

t = 0.25 · noisy image, predicted update, ground-truth update, RGB RMS error
t = 0.25 · noisy image, predicted update, ground-truth update, RGB RMS error
t = 0.50 · noisy image, predicted update, ground-truth update, RGB RMS error
t = 0.50 · noisy image, predicted update, ground-truth update, RGB RMS error
t = 0.75 · noisy image, predicted update, ground-truth update, RGB RMS error
t = 0.75 · noisy image, predicted update, ground-truth update, RGB RMS error

1.5 iterative denoising with euler sampling

one-step denoising assumes that a single velocity prediction is enough to get from the noisy input to the clean endpoint. the learned velocity can change as the image changes, though, so i also implemented euler sampling to follow it in smaller steps. after each update, i evaluated the model again using the new image and time. starting from the saved t = 0.50 input, a step size of 0.02 gives 25 updates before reaching t = 1.

i displayed the initial state and every fifth update to show how the grain gradually disappears. the final comparison uses the same starting input for gaussian blur, one-step denoising, and euler denoising. both model-based methods preserve the scene much better than the blur baseline, and the iterative version keeps more of the shirt pattern than the one-step result. it still does not reproduce every detail of the original, but recomputing the direction gives it more opportunities to refine the reconstruction along the way.

x(t + h) = x(t) + h·v(x(t), t, c)

euler trajectory · t = 0.50, 0.60, 0.70, 0.80, 0.90, 1.00
euler trajectory · t = 0.50, 0.60, 0.70, 0.80, 0.90, 1.00
same t = 0.50 input · original, gaussian blur, one-step estimate, euler denoising
same t = 0.50 input · original, gaussian blur, one-step estimate, euler denoising

1.6 generating images from noise

once the euler sampler was working on a partially noisy photograph, i could use it to generate an image without supplying a photograph at all. i started from gaussian noise at t = 0 and ran 50 updates to reach t = 1, again using “a high quality photo” as the prompt. the five results below come from independent initial noises, so each one follows its own path through the model.

even though the prompt does not ask for a particular subject, all five outputs are images of people. they also vary quite a bit in quality. some have distorted facial features, and one looks more like a painting than a photograph. these results show that the sampler can turn pure noise into recognizable images, but the generic prompt alone does not consistently produce the kind of clean photograph i would expect from the wording.

ordinary conditional generation · prompt: “a high quality photo”
ordinary conditional generation · prompt: “a high quality photo”

2.1 classifier-free guidance

for classifier-free guidance, i evaluated the model twice at the same image and time: once with the photo prompt and once with an empty prompt. i then used the difference between those predictions to strengthen the direction associated with the text condition. in the convention used for part a, the guided velocity is the conditional prediction plus w times that difference. setting w = 0 therefore gives the ordinary conditional prediction from the previous section.

i used w = 7 and reused the same five initial noise tensors so that the before-and-after comparison would be meaningful. the guided outputs look much more like conventional portrait photographs, with clearer faces and more consistent lighting. they also have a more similar composition to one another. guidance improves how strongly the results follow the idea of a high-quality photo here, but some of the variety in the original set is lost.

vcfg = vc + w·(vc − vu)

before guidance · ordinary conditional sampling
before guidance · ordinary conditional sampling
with guidance · w = 7 · step size 0.02
with guidance · w = 7 · step size 0.02

3.1 image-to-image editing

for image-to-image editing, i returned to the same idea of mixing an input image with noise and then sampling back toward t = 1. the difference is that i varied the starting time to control how much of the input remained before denoising. i tried this on the campanile, the photo of rohan, and a photo of me at the torii gates in kyoto, japan, using “a high quality photo” as the prompt for all three. each sweep uses starting times 0.02, 0.04, 0.06, 0.10, 0.14, 0.25, and 0.50.

at the smaller starting times, there is so little image information left that the result can become a different person or even an unrelated object. the campanile still tends to leave a tall shape against the sky, while the personal photos change more dramatically. at t = 0.25 and 0.50, the original scenes are much easier to recognize. this makes the starting time a useful control over the edit: preserving more of the input also gives the model less room to reinterpret it.

campanile · original and seven starting times · prompt: “a high quality photo”
campanile · original and seven starting times · prompt: “a high quality photo”
rohan · original and seven starting times · prompt: “a high quality photo”
rohan · original and seven starting times · prompt: “a high quality photo”
Torii gates · original and seven starting times · prompt: “a high quality photo”
Torii gates · original and seven starting times · prompt: “a high quality photo”

3.1 editing hand-drawn and web images

i also tried the same editing procedure on images that were not photographs: an otter illustration from the web, a diet coke drawing, and a drawing of the “Don’t Be Dumb” emoji from A$AP Rocky merch i bought at his concert. i used the same generic photo prompt and the same seven starting times as above. this lets me see what the model does when the input’s colors and shapes are recognizable, but its style is quite different from the photographs the prompt asks for.

at very low starting times, the connection to the input can disappear almost completely. the otter illustration sometimes becomes a portrait, while the diet coke drawing becomes a small gray case at t = 0.02. as more of the input is preserved, the lettering on the can and the face of the merch emoji return. the model does not automatically turn every drawing into a realistic photo; in several of these results, it keeps much of the drawing’s original style instead.

web otter illustration · original and seven starting times · prompt: “a high quality photo”
web otter illustration · original and seven starting times · prompt: “a high quality photo”
diet coke drawing · original and seven starting times · prompt: “a high quality photo”
diet coke drawing · original and seven starting times · prompt: “a high quality photo”
Don’t Be Dumb · A$AP Rocky merch emoji · original and seven starting times · prompt: “a high quality photo”
Don’t Be Dumb · A$AP Rocky merch emoji · original and seven starting times · prompt: “a high quality photo”

3.2 text-guided image editing

the previous section used the same generic prompt for every image. here, i changed the prompt to describe the edit i wanted while keeping the sampling procedure and starting times the same. i asked for oski for the campanile, a smiling werewolf with a pint of guinness for rohan’s photo, and arnold schwarzenegger flexing in front of the eiffel tower for the torii gates photo. the full prompts are shown with each set of results.

at low starting times, the prompt has enough freedom to replace most of the scene. at higher times, the original photo becomes much harder to change. the intermediate werewolf results are a good example of the two constraints working together: the subject changes, but parts of the pose, table, and restaurant setting remain. in the campanile sweep, the bear imagery gradually gives way to decorations on a tower, while the torii gates sweep brings back the red gates as the starting time increases.

campanile · prompt: “A photograph of Oski the Bear (UC Berkeley Mascot)”
campanile · prompt: “A photograph of Oski the Bear (UC Berkeley Mascot)”
rohan · prompt: “A photograph of a smiling Werewolf with a pint of Guinness”
rohan · prompt: “A photograph of a smiling Werewolf with a pint of Guinness”
Torii gates · prompt: “A photograph of Arnold Schwarzenegger flexing in front of the Eiffel Tower”
Torii gates · prompt: “A photograph of Arnold Schwarzenegger flexing in front of the Eiffel Tower”

3.3 visual anagrams

for the visual anagrams, i wanted one image to support two different interpretations depending on which way it is rotated. i predicted a guided velocity for the upright image with the first prompt, then rotated the input by 180° and predicted another velocity with the second prompt. before averaging the two, i rotated the second velocity back into the original orientation. using that average in each euler step lets both prompts influence the same final image.

my first pair uses “an oil painting of a fluffy baby penguin” and “an oil painting of an old wizard’s face with a flowing white beard”. this works particularly well because the penguin’s dark body and pale chest become the wizard’s hat and beard when rotated. the second pair uses “an oil painting of a single golden flaky crescent-shaped croissant, centered on a dark background” and “an oil painting of a sleeping orange cat curled up, with its face and ears visible, centered on a dark background”. the orange curled shape connects the two subjects, although the sleeping cat is easier to recognize than the croissant.

baby penguin upright / old wizard rotated 180° · w = 7
baby penguin upright / old wizard rotated 180° · w = 7
croissant upright / sleeping orange cat rotated 180° · w = 7
croissant upright / sleeping orange cat rotated 180° · w = 7

3.4 hybrid images

this section connects back to the hybrid images from project 2. instead of combining the frequency components of two finished images, i combined the frequency components of two guided velocity predictions at every sampling step. one prompt supplies the low-frequency structure, and the other supplies the high-frequency detail. i used a 265×265 gaussian kernel with σ = 16 to form the low-pass component, then subtracted the blur from the other prediction to obtain its high-pass component.

i tried cookie / sunflower and yoda / forest as the two prompt pairs. each result is shown at a larger size and as a 64×64 distant view so that the change in appearance is easier to compare. the sunflower dominates the first result at both sizes, so the cookie reading is not very convincing. the forest result works well: up close, the branches and ferns stand out, while from a distance they come together into a recognizable green face with yoda’s pointed ears. this pair gives a stronger change in appearance between the two viewing sizes than the cookie / sunflower example.

vhybrid = lowpass(va) + vb − lowpass(vb)

near · “a detailed oil painting of a sunflower with dark seeds and golden petals”
near · “a detailed oil painting of a sunflower with dark seeds and golden petals”
distant · “an oil painting of a round chocolate chip cookie” · 64×64
distant · “an oil painting of a round chocolate chip cookie” · 64×64
near · “a detailed oil painting of a mossy forest with tangled branches and ferns”
near · “a detailed oil painting of a mossy forest with tangled branches and ferns”
distant · “an oil painting of Yoda’s face with large pointed ears” · 64×64
distant · “an oil painting of Yoda’s face with large pointed ears” · 64×64

part b: flow matching from scratch

in part a, the pretrained model already knew how to move from noise toward an image, and my job was to decide how to sample from it. for part b, i trained the models myself on MNIST. i started with a UNet that removes noise in one step, then added time conditioning so it could learn a velocity field, and finally added digit labels to control which number it generated.

MNIST contains 60,000 training images and 10,000 test images, each 28×28 with pixel values in [0, 1]. i ran the training on a tesla t4 GPU. the flow models still move from gaussian noise at t = 0 to an image at t = 1, but part b uses a different guidance convention: the unconditional prediction plus γ times the conditional-minus-unconditional difference. i used γ = 5 when sampling from the class-conditioned model.

b.1.1 implementing the UNet

i built the UNet from convolution, batch normalization, and GELU blocks. the encoder first processes the 28×28 input, then downsamples it to 14×14 and 7×7. an average pooling operation compresses the 7×7 features to a 1×1 bottleneck. the decoder reverses this process with transposed convolutions until the output has the same spatial dimensions as the input.

the skip connections are important because reducing an image to a small bottleneck can discard the local information needed to reconstruct its strokes. i concatenated the encoder features with the decoder features at matching resolutions, giving the later layers access to both the compressed representation and the earlier spatial detail. for the single-step denoiser, i used 128 hidden channels and a final convolution that produces one grayscale output channel.

b.1.2 noisy inputs and single-step denoising

for this first denoising task, i constructed the input by adding gaussian noise directly to a clean MNIST digit. i reused one noise tensor while changing σ through 0, 0.2, 0.4, 0.5, 0.6, 0.8, and 1.0, so the figure shows the effect of increasing the strength of the same noise pattern. at σ = 0, the digit is unchanged; by σ = 1.0, much of its shape is hidden.

this noising process is slightly different from the interpolation in part a. the clean digit is not multiplied by a time value here, so increasing σ only changes the amount of noise added to it. the denoiser’s job is to take that corrupted image and predict the original digit in one forward pass.

z = x + σ·ε

one MNIST training image · increasing gaussian noise from σ = 0 to 1.0
one MNIST training image · increasing gaussian noise from σ = 0 to 1.0

b.1.2.1 training the denoiser

i trained the unconditional UNet for five epochs with batch size 256 and Adam at a learning rate of 1e-4. each time a batch was loaded, i added fresh gaussian noise with σ = 0.5. generating the noise during training means the model sees different corruptions of the same digit across epochs, rather than memorizing one fixed noisy version of each training image.

for the loss, i compared the predicted image with the clean digit using mean squared error. the curve drops sharply during the first part of training and then improves more gradually. this is a reconstruction task, so the model is rewarded for recovering the particular digit that produced its input. the next section checks what happens when the amount of corruption changes from the σ = 0.5 used during training.

single-step denoiser training loss · five epochs · σ = 0.5 · Adam lr = 1e-4
single-step denoiser training loss · five epochs · σ = 0.5 · Adam lr = 1e-4

b.1.2.2 out-of-distribution testing

after training at σ = 0.5, i tested the denoiser on a held-out digit with several different noise levels. i kept the underlying image and noise realization fixed while varying σ, which makes it easier to see when the reconstruction begins to change. the figure shows the model’s outputs across the same seven values used in the noising visualization.

near and below the training noise level, the reconstructed 7 remains fairly clear. at σ = 0.8 and 1.0, extra strokes appear and the shape becomes less reliable. the model has learned how to handle a particular range of corruption, so increasing the noise does not simply make the result blurrier; it can change which strokes the model thinks belong in the digit. this figure shows one test example, so it illustrates the behavior without measuring performance across the full test set.

held-out digit reconstruction · σ = 0, 0.2, 0.4, 0.5, 0.6, 0.8, 1.0
held-out digit reconstruction · σ = 0, 0.2, 0.4, 0.5, 0.6, 0.8, 1.0

b.1.2.3 denoising pure noise

i then trained a fresh UNet with the same hidden dimension, batch size, learning rate, and five-epoch schedule, but replaced the corrupted-digit inputs with pure gaussian noise. each noise input was independent of the clean digit used as its target. i kept eight fixed noise inputs for the visualizations so that i could compare the outputs after epochs 1 and 5.

although the loss decreases, the outputs all look like similar blurry averages rather than different handwritten numbers. to see why this happens, let X be a clean MNIST image and Z be the independent gaussian noise given to the network. for a particular input Z = z, call the network’s output a. minimizing MSE means choosing a to minimize the expected squared distance to all possible target images. differentiating that expected loss gives the conditional mean as the optimal prediction:

ℓ(a; z) = E[‖a − X‖² | Z = z]

∇ₐℓ(a; z) = 2a − 2E[X | Z = z]

∇ₐℓ = 0 ⇒ D*(z) = E[X | Z = z]

X ⟂ Z ⇒ E[X | Z = z] = E[X] = μ

μ ≈ (1/N) Σᵢ xᵢ

because the noise and target are independent, conditioning on z tells us nothing about which digit to predict. the optimal output is therefore the same mean image μ for every noise input. the last line estimates this expectation by averaging the N training images separately at each pixel, so strokes from different digits overlap into a blurry shape. training pushes the network toward this solution, although a finite training run does not have to reach the exact mean. the decreasing loss is consistent with learning that average, rather than learning to generate distinct digits.

eight fixed pure-noise inputs · predictions after epoch 1 (top) and epoch 5 (bottom)
eight fixed pure-noise inputs · predictions after epoch 1 (top) and epoch 5 (bottom)
pure-noise training loss · five epochs · independent noise inputs and clean-digit targets
pure-noise training loss · five epochs · independent noise inputs and clean-digit targets

b.2.1 time-conditioned flow matching

the pure-noise experiment shows why directly predicting a clean image from an unrelated noise input is not enough. for flow matching, i instead trained the network to predict how an intermediate image should move along the path from noise to a digit. i sampled a noise image and a time t for each clean training image, interpolated between the two, and used the difference between the clean image and noise as the target velocity.

the network also needs to know where along that path it is operating. i added two fully connected blocks that turn the scalar time into embeddings with the appropriate channel dimensions, then multiplied those embeddings into the decoder features at two resolutions. this gives the same UNet a way to change its prediction depending on whether it is looking at an almost-noisy input or one that is already close to a digit.

x(t) = (1 − t)·x(0) + t·x(1)

Target velocity: v = x(1) − x(0)

b.2.2 training the time-conditioned UNet

i trained the time-conditioned model for ten epochs with 64 hidden channels, batch size 64, and Adam starting at a learning rate of 1e-2. for every batch, i drew fresh noise and a random time for each image. the loss compares the model’s predicted velocity with the ground-truth difference between the digit and its sampled noise, rather than comparing the output directly with a clean image.

i also used an exponential learning-rate scheduler, multiplying the learning rate by γ = 0.1^(1/10) ≈ 0.7943 after each epoch. over ten epochs, this reduces it to one tenth of its starting value. the training curve falls quickly at the beginning and then settles into a lower range with variation between batches. learning the field across different times is what will let me repeatedly query the network during sampling instead of relying on one large denoising step.

time-conditioned flow-matching training loss · ten epochs · exponential learning-rate decay · γ = 0.1^(1/10) ≈ 0.7943
time-conditioned flow-matching training loss · ten epochs · exponential learning-rate decay · γ = 0.1^(1/10) ≈ 0.7943

b.2.3 sampling from the time-conditioned UNet

once the model was trained, i started from gaussian noise and used its predicted velocity to take 50 euler steps toward t = 1. after each step, i passed the updated image and time back into the network to get the next direction. this is the same sampling idea used in part a, except that the velocity field now comes from the smaller model i trained on MNIST.

i compared outputs after epochs 1, 5, and 10 using the same initial noise. the epoch-1 result has several disconnected or extra strokes, while the later results have a more coherent digit-like shape. they are still imperfect, and this comparison only contains one sample per checkpoint. it shows the progression of this particular input rather than establishing how consistently the model generates legible digits.

x(t + h) = x(t) + h·v(x(t), t)

h = 1 / 50

time-conditioned samples · epochs 1, 5, 10 · 50 euler steps
time-conditioned samples · epochs 1, 5, 10 · 50 euler steps

b.2.4 class-conditioned flow matching

the time-conditioned model has to learn the shapes of all ten digits without being told which one to generate. to give it that extra control, i added a one-hot vector representing the digit class and embedded it with two more fully connected blocks. time t is represented as a scalar because its numerical ordering has a meaning: increasing t moves us from noise toward a clean image. digit labels do not have that same ordering. using a one-hot vector avoids suggesting that, for example, an 8 should be more similar to a 7 than to a 1 just because their labels are closer numerically.

the class FCBlocks turn those one-hot vectors into learned representations that scale the UNet’s feature channels according to the requested digit. in the earlier time-conditioned model, i multiplied the features by a learned time embedding, not by the raw scalar t. with class conditioning, the class embedding takes over that scaling role, and the learned time embedding is added as an offset instead. intuitively, the class-dependent scales can emphasize or suppress channels useful for a particular digit, while the time-dependent shifts adjust the features for the current denoising stage. both embeddings are learned during training and broadcast across the spatial dimensions at the two conditioning points in the decoder.

during training, i dropped the class condition for 10% of the examples by setting the one-hot vector to zero. the network therefore learns to make predictions both with and without a digit label. at sampling time, i can evaluate those two cases on the same input and combine their velocities using classifier-free guidance. i used γ = 5 to strengthen the influence of the requested digit.

Time-only conditioning: f ← et(t) ⊙ f

Class + time conditioning: f ← ec(c) ⊙ f + et(t)

vcfg = vu + γ·(vc − vu)

γ = 5

b.2.5 training and learning-rate comparison

for the class-conditioned model, i kept 64 hidden channels and batch size 64, with class dropout probability 0.1. the first run used Adam starting at 1e-2 and the same exponential scheduler as the time-conditioned experiment, with γ = 0.1^(1/10) ≈ 0.7943, training for ten epochs. to see whether i could remove the scheduler, i trained a fresh model at a constant learning rate of 1e-3 for twenty epochs. the smaller initial rate gives more conservative updates, while the longer run gives the model more time to learn.

the full-range loss plot shows the large initial drop, and the zoomed plot makes the later behavior easier to compare. both runs reach a much lower loss than they started with. the sample grids below also show that the constant-rate model produces cleaner digits early on, although this comparison changes more than the scheduler alone: it uses a different initial learning rate, and its final checkpoint has twice as many training epochs. i included matching-epoch results so that the effect of the additional training is visible separately.

class-conditioned training loss · full range (top), zoomed to MSE 0–0.3 (bottom) · scheduled lr = 1e-2 / constant lr = 1e-3
class-conditioned training loss · full range (top), zoomed to MSE 0–0.3 (bottom) · scheduled lr = 1e-2 / constant lr = 1e-3

b.2.6 sampling from the class-conditioned UNet

i generated four examples of each digit with 300 euler steps and guidance scale 5. each column corresponds to one requested class, from 0 through 9. i reused the same initial noises across checkpoints and between the scheduled and constant-rate models so that changes in the grids would reflect the learned models rather than different sampling inputs. the results are shown side by side at epochs 1, 5, and 10, with the scheduled model on the left and the constant-rate model on the right. the constant-rate model’s additional training results at epochs 15 and 20 are shown below. i trained the constant-rate model for more epochs because its smaller learning rate generally makes each parameter update more conservative, so the extra epochs give it more updates to learn.

the scheduled model’s epoch-1 outputs have some broken or extra strokes, particularly in the curved digits. by epochs 5 and 10, most columns contain clearly recognizable examples of the requested number. the constant-rate model also produces legible digits, showing that lowering the learning rate can work without exponential decay in this experiment. its later checkpoints change the shapes and thickness of the strokes, but the improvement from epoch 10 to epoch 20 is much less dramatic than the change during the early training epochs.

scheduled learning rate · epoch 1 · four samples per class · 300 steps · γ = 5
scheduled learning rate · epoch 1 · four samples per class · 300 steps · γ = 5
constant lr = 1e-3 · epoch 1 · same labels, initial noises, and sampling settings
constant lr = 1e-3 · epoch 1 · same labels, initial noises, and sampling settings
scheduled learning rate · epoch 5
scheduled learning rate · epoch 5
constant lr = 1e-3 · epoch 5
constant lr = 1e-3 · epoch 5
scheduled learning rate · epoch 10
scheduled learning rate · epoch 10
constant lr = 1e-3 · epoch 10
constant lr = 1e-3 · epoch 10
constant lr = 1e-3 · epoch 15 · additional training
constant lr = 1e-3 · epoch 15 · additional training
constant lr = 1e-3 · epoch 20 · additional training
constant lr = 1e-3 · epoch 20 · additional training