Skip to main content

10 - Data Augmentation and Synthetic Data Generation: Growing Datasets

Rotation, mixup, CutMix, SMOTE, text and time series and generative models, with experiments on what goes wrong: changed labels and test-set leakage.

What do you think about this article?

At a Glance

Rotation, mixup, CutMix, SMOTE, text and time series and generative models, with experiments on what goes wrong: changed labels and test-set leakage.

More data from the same data: under which condition it works

When a dataset is small, or a class has ten examples against a thousand, the temptation is to generate more starting from the ones you have. Data augmentation does it in two ways: by applying transformations that, in your judgement, do not change the label (rotating a photo of a cat by a few degrees), or by interpolating between existing examples (mixup, SMOTE). In both cases a single rule applies, and this article puts it to the test with experiments: augmentation builds into the model an assumption about what must not matter, and if the assumption is wrong the model gets worse. Each technique has its formula, a hand calculation and a check, and two experiments show what goes wrong: an augmentation that changes the meaning of the data and one that contaminates the test set.

Geometric transformations are matrix products (linear algebra), the VAE loss contains the KL of information theory, and the mixed labels of mixup require the cross-entropy with non-one-hot labels, as in loss functions. This is the last article of the series.

Geometric transformations: matrices applied to pixels

A rotation by angle \theta in the plane is the matrix \begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix}, a change of scale is a diagonal matrix with the factors s_x and s_y. Translation is not linear in two dimensions, but it becomes so in homogeneous coordinates: you add a coordinate equal to 1 and use a 3 \times 3 matrix with (t_x, t_y) in the last column, so that rotation, scaling and translation combine by multiplying matrices. Hand check: rotating (1, 0) by 90^\circ gives (0, 1); rotating (1, 1) by 45^\circ gives (0, \sqrt{2}). The order of the factors matters, because the matrix product is not commutative: rotating (1, 0) by 90^\circ and then translating by (2, 0) gives (2, 1), translating and then rotating gives (0, 3).

import numpy as np

def rot(deg):
    t = np.radians(deg)
    return np.array([[np.cos(t), -np.sin(t)], [np.sin(t), np.cos(t)]])

print("(1, 0) rotated by 90 degrees:", np.round(rot(90) @ [1, 0], 4))
print("(1, 1) rotated by 45 degrees:", np.round(rot(45) @ [1, 1], 4), " (0, sqrt(2) =", round(2 ** 0.5, 4), ")")

# homogeneous coordinates: rotation and translation together in a 3x3 matrix
R = np.eye(3); R[:2, :2] = rot(90)
T = np.eye(3); T[:2, 2] = [2, 0]
p = np.array([1, 0, 1])
print("first rotate, then translate:", np.round(T @ R @ p, 4)[:2])
print("first translate, then rotate:", np.round(R @ T @ p, 4)[:2], "  <- the order matters")

# image: for each destination pixel we look up the source pixel (inverse map)
def rotate_image(img, deg):
    h, w = img.shape
    c = np.array([(h - 1) / 2, (w - 1) / 2])
    out = np.zeros_like(img)
    Rinv = rot(deg).T                                  # the inverse of a rotation is the transpose
    for i in range(h):
        for j in range(w):
            si, sj = np.rint(Rinv @ (np.array([i, j]) - c) + c).astype(int)
            if 0 <= si < h and 0 <= sj < w:
                out[i, j] = img[si, sj]
    return out

img = np.arange(25).reshape(5, 5)
ks = [k for k in (1, -1) if np.array_equal(rotate_image(img, 90), np.rot90(img, k))]
print("90-degree rotation equal to np.rot90 with k =", ks)
print("0-degree rotation leaves the image intact:", np.array_equal(rotate_image(img, 0), img))

# Output:
# (1, 0) rotated by 90 degrees: [0. 1.]
# (1, 1) rotated by 45 degrees: [0.     1.4142]  (0, sqrt(2) = 1.4142 )
# first rotate, then translate: [2. 1.]
# first translate, then rotate: [0. 3.]   <- the order matters
# 90-degree rotation equal to np.rot90 with k = [1]
# 0-degree rotation leaves the image intact: True

For an image you do not move the source pixels, but for each destination pixel you compute where it comes from: the function uses the inverse rotation, which for a rotation is the transpose (rot(deg).T), and takes the nearest pixel. This avoids the holes that the forward transformation would leave. The centre is ((h-1)/2, (w-1)/2) and not (h/2, w/2): trying (h/2, w/2) on a 5 \times 5 image the result does not coincide with np.rot90, because the image slides by half a pixel and a row stays empty. The last two lines are the checks: at 90 degrees the result coincides with np.rot90 and at zero degrees the image is left intact. With intermediate angles the nearest pixel introduces jagged edges: libraries interpolate linearly between pixels.

When augmentation changes the label: the digits 6 and 9

A transformation is legitimate only if the label remains true after it. Turning a photo of a cat upside down by 180° leaves it a cat (and a horizontal flip likewise), but rotating a 6 by 180° produces a 9. You measure it on the scikit-learn digits dataset (8×8 digits). You train a logistic regression on the original digits, then on these plus the copies rotated by 180° with the same label, and evaluate on unseen original digits.

import numpy as np
from sklearn.datasets import load_digits
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split

X, y = load_digits(return_X_y=True)
X_tr, X_te, y_tr, y_te = train_test_split(X, y, test_size=0.3, random_state=0, stratify=y)
rot180 = lambda A: A.reshape(-1, 8, 8)[:, ::-1, ::-1].reshape(-1, 64)      # rotate each 8x8 image by 180 degrees

base = LogisticRegression(max_iter=5000).fit(X_tr, y_tr)
print(f"trained on the original digits: test accuracy = {base.score(X_te, y_te):.3f}")

# augmentation that changes the semantics: add the copies rotated by 180 degrees with the SAME label
aug = LogisticRegression(max_iter=5000).fit(np.vstack([X_tr, rot180(X_tr)]), np.concatenate([y_tr, y_tr]))
print(f"with copies rotated by 180 degrees: test accuracy = {aug.score(X_te, y_te):.3f}")
rec = lambda m: np.array([(m.predict(X_te[y_te == c]) == c).mean() for c in range(10)])
r0, r1 = rec(base), rec(aug)
for c in range(10):
    print(f"digit {c}: recall {r0[c]:.3f} -> {r1[c]:.3f}  ({r1[c] - r0[c]:+.3f})")

# Output:
# trained on the original digits: test accuracy = 0.961
# with copies rotated by 180 degrees: test accuracy = 0.887
# digit 0: recall 0.981 -> 0.981  (+0.000)
# digit 1: recall 0.982 -> 0.873  (-0.109)
# digit 2: recall 0.981 -> 0.925  (-0.057)
# digit 3: recall 0.964 -> 0.909  (-0.055)
# digit 4: recall 0.963 -> 0.907  (-0.056)
# digit 5: recall 0.945 -> 1.000  (+0.055)
# digit 6: recall 0.981 -> 0.907  (-0.074)
# digit 7: recall 0.944 -> 0.833  (-0.111)
# digit 8: recall 0.885 -> 0.808  (-0.077)
# digit 9: recall 0.981 -> 0.722  (-0.259)

The accuracy falls from 0.961 to 0.887. The biggest damage is on the 9: the recall goes from 0.981 to 0.722 (-0.259), because the model has seen "rotated 9" (that is a 6) with the label 9. But it is not the only one: the 7 loses 0.111, the 1 loses 0.109, the 8 0.077, the 6 0.074. Only the 0, almost symmetric, stays unchanged, and the 5 improves by 0.055. The 180° rotation turns several digits into shapes that the model associates with other classes, and the listing does not explain every case: it measures the effect per class. The operational rule is to ask, for each transformation, which classes it turns into others; an empirical check like this costs a few minutes.

Mixup: interpolating examples and labels

Mixup (Zhang et al., 2018) trains the model on convex combinations of pairs of examples and of their labels: \tilde{x} = \lambda x_i + (1-\lambda)x_j and \tilde{y} = \lambda y_i + (1-\lambda)y_j with \lambda \sim \text{Beta}(\alpha, \alpha). With x_i = (1, 0) of class 1 and x_j = (0, 1) of class 2 and \lambda = 0.3 you get \tilde{x} = (0.3;\ 0.7) and \tilde{y} = (0.3;\ 0.7): the label is a distribution that sums to 1 and the loss is the cross-entropy against it. The authors report that in their experiments on ImageNet values of \alpha between 0.1 and 0.4 improve on standard training, while large \alpha lead to underfitting.

import numpy as np

def mixup(x1, y1, x2, y2, lam):
    return lam * x1 + (1 - lam) * x2, lam * y1 + (1 - lam) * y2

xi, yi = np.array([1.0, 0.0]), np.array([1.0, 0.0])      # one-hot labels
xj, yj = np.array([0.0, 1.0]), np.array([0.0, 1.0])
x_new, y_new = mixup(xi, yi, xj, yj, 0.3)
print("lambda = 0.3 ->", x_new, y_new, " label sum =", y_new.sum())

rng = np.random.default_rng(0)
for alpha in (0.2, 1.0):
    lam = rng.beta(alpha, alpha, size=100_000)
    print(f"alpha = {alpha}: mean lambda = {lam.mean():.3f},  share with lambda < 0.1 or > 0.9 = {np.mean((lam < 0.1) | (lam > 0.9)):.3f}")

# Output:
# lambda = 0.3 -> [0.3 0.7] [0.3 0.7]  label sum = 1.0
# alpha = 0.2: mean lambda = 0.499,  share with lambda < 0.1 or > 0.9 = 0.671
# alpha = 1.0: mean lambda = 0.500,  share with lambda < 0.1 or > 0.9 = 0.201

The listing explains what a small \alpha means: with \alpha = 0.2 the 67.1\% of the \lambda fall below 0.1 or above 0.9, that is the mixtures are almost always "one example with a trace of the other"; with \alpha = 1 (\lambda uniform) the share drops to 20.1\% and half-and-half mixes are common. The mean of \lambda is 0.5 in both cases, and this is why the mean says nothing about the effect: the shape of the distribution is what counts. Mixup is an assumption about the model (between two examples the behaviour is linear) more than a transformation that preserves semantics; the benefit has to be verified on your own problem.

CutMix: pasting a piece of another image

CutMix (Yun et al., 2019) replaces a rectangle of an image with the corresponding rectangle of another, and mixes the labels in proportion to the area: \tilde{y} = \lambda y_A + (1-\lambda)y_B. To obtain \lambda you choose a rectangle with sides r_w = W\sqrt{1-\lambda} and r_h = H\sqrt{1-\lambda}, so that the ratio of the areas is 1 - \lambda. A 16 \times 16 crop on 32 \times 32 has area 256/1024 = 0.25 and therefore \lambda = 0.75. The centre of the rectangle is chosen at random and the rectangle has to be clipped at the borders if it falls outside the image: the original paper therefore recomputes \lambda on the effective area.

import numpy as np

def cutmix(a, b, lam, rng):
    H, W = a.shape
    rh, rw = int(H * np.sqrt(1 - lam)), int(W * np.sqrt(1 - lam))      # side of the crop: the area is (1 - lam)
    cy, cx = rng.integers(0, H), rng.integers(0, W)                     # centre chosen at random
    y1, y2 = np.clip(cy - rh // 2, 0, H), np.clip(cy + rh // 2, 0, H)
    x1, x2 = np.clip(cx - rw // 2, 0, W), np.clip(cx + rw // 2, 0, W)
    out = a.copy()
    out[y1:y2, x1:x2] = b[y1:y2, x1:x2]
    lam_adj = 1 - (y2 - y1) * (x2 - x1) / (H * W)                       # recomputed after clipping at the borders
    return out, lam_adj

a, b = np.zeros((32, 32)), np.ones((32, 32))
print("16 x 16 crop on 32 x 32: area 256 / 1024 = 0.25  ->  lambda = 0.75")
rng = np.random.default_rng(0)
out, lam_adj = cutmix(a, b, 0.75, rng)
print(f"one crop (random centre): requested lambda 0.75, lambda_adj = {lam_adj:.4f}, share of pixels taken from b = {out.mean():.4f}")
lams = [cutmix(a, b, 0.75, rng)[1] for _ in range(5000)]
print(f"over 5000 trials: requested lambda 0.75, mean of lambda_adj = {np.mean(lams):.4f}  (crops at the borders are smaller)")

# Output:
# 16 x 16 crop on 32 x 32: area 256 / 1024 = 0.25  ->  lambda = 0.75
# one crop (random centre): requested lambda 0.75, lambda_adj = 0.7969, share of pixels taken from b = 0.2031
# over 5000 trials: requested lambda 0.75, mean of lambda_adj = 0.8097  (crops at the borders are smaller)

In the listing, a crop whose centre falls near the border is shortened and the correct value for the label is no longer the requested 0.75 but the 0.7969 computed on the effective pixels. Over 5000 trials the mean of the corrected \lambda is 0.8097: the crops clipped at the borders are smaller than expected, and if the nominal \lambda were used the label would systematically overstate the contribution of the pasted image. The recomputation is the detail that distinguishes a correct implementation from one that labels imprecisely.

SMOTE: interpolating in feature space for the rare class

SMOTE generates synthetic examples for the minority class by taking an example \mathbf{x}_i, one of its k neighbours of the same class \mathbf{x}_{nn} and a random number \lambda \in [0, 1]: \mathbf{x}_{\text{new}} = \mathbf{x}_i + \lambda(\mathbf{x}_{nn} - \mathbf{x}_i). The new point lies on the segment that joins them. By hand, from (1, 2) towards (3, 6) with \lambda = 0.25 you get (1.5;\ 3.0). The imbalanced-learn documentation warns that basic SMOTE does not distinguish easy and hard examples and can connect normal examples with outliers, producing a suboptimal boundary. The library is not installed in the environment of this article: the listing uses a small implementation of its own, which reproduces the idea.

The most frequent mistake is applying SMOTE before splitting into training and test. The synthetic points are interpolations of real examples, so if the split happens afterwards, a test positive has among its neighbours, in the training set, synthetic points built also from itself: the model "recognises" it. To measure it you use pure-noise data, in which features and label have no relationship and an honest model must learn nothing.

import numpy as np
from sklearn.neighbors import KNeighborsClassifier, NearestNeighbors

def smote(X_min, n_new, k, rng):
    nn = NearestNeighbors(n_neighbors=min(k, len(X_min) - 1) + 1).fit(X_min)
    idx = nn.kneighbors(X_min, return_distance=False)[:, 1:]            # excludes the point itself
    out = []
    for _ in range(n_new):
        i = rng.integers(len(X_min))
        j = idx[i, rng.integers(idx.shape[1])]
        out.append(X_min[i] + rng.random() * (X_min[j] - X_min[i]))
    return np.array(out)

rng = np.random.default_rng(0)
print("by hand: (1, 2) towards (3, 6) with lambda = 0.25 ->", np.array([1, 2]) + 0.25 * (np.array([3, 6]) - np.array([1, 2])))

# do the new points lie on the segment between two original points?
Xm = rng.normal(size=(8, 3))
syn = smote(Xm, 50, 3, rng)
d = np.array([np.min([np.linalg.norm(s - Xm[i]) + np.linalg.norm(s - Xm[j]) - np.linalg.norm(Xm[i] - Xm[j]) for i in range(8) for j in range(8) if i != j]) for s in syn])
print(f"minimum deviation from collinearity (0 = on a segment between two originals): max = {d.max():.1e}")

# Pure-noise data: no relationship between features and label. An honest model must learn nothing.
def run(leaky, seed):
    r = np.random.default_rng(seed)
    X = r.normal(size=(300, 20)); y = (r.random(300) < 0.1).astype(int)
    if leaky:                                         # SMOTE on the WHOLE dataset, then the split
        extra = smote(X[y == 1], int((y == 0).sum() - (y == 1).sum()), 5, r)
        X, y = np.vstack([X, extra]), np.concatenate([y, np.ones(len(extra), int)])
        order = r.permutation(len(X)); tr, te = order[: len(X) // 2], order[len(X) // 2:]
        Xtr, ytr, Xte, yte = X[tr], y[tr], X[te], y[te]
    else:                                             # split first, SMOTE only on the training set
        order = r.permutation(300); tr, te = order[:150], order[150:]
        Xtr, ytr, Xte, yte = X[tr], y[tr], X[te], y[te]
        extra = smote(Xtr[ytr == 1], int((ytr == 0).sum() - (ytr == 1).sum()), 5, r)
        Xtr, ytr = np.vstack([Xtr, extra]), np.concatenate([ytr, np.ones(len(extra), int)])
    m = KNeighborsClassifier(1).fit(Xtr, ytr)
    pos = yte == 1
    return (m.predict(Xte[pos]) == 1).mean() if pos.any() else np.nan

for leaky in (True, False):
    rec = [run(leaky, s) for s in range(20)]
    print(f"{'SMOTE before the split' if leaky else 'SMOTE on training only'}: recall of the positives (pure noise), mean over 20 trials = {np.nanmean(rec):.3f}")

# Output:
# by hand: (1, 2) towards (3, 6) with lambda = 0.25 -> [1.5 3. ]
# minimum deviation from collinearity (0 = on a segment between two originals): max = 4.4e-16
# SMOTE before the split: recall of the positives (pure noise), mean over 20 trials = 0.994
# SMOTE on training only: recall of the positives (pure noise), mean over 20 trials = 0.306

The first check verifies that the generated points really lie on a segment between two originals (deviation of the order of 10^{-16}). Then the experiment. With SMOTE applied before the split, the recall of the positives on pure noise is 0.994: a 1-NN classifier "predicts" almost all the positives of a test set built from data that contain no signal at all. With SMOTE on the training set only, the recall is 0.306, the level of a model that has no information. The comparison between the two numbers measures the contamination. The rule is the same for every form of augmentation: split first, augment only the training set, and leave the test set as it is. In cross-validation the augmentation goes inside each fold.

Text and time series

For text, Wei and Zou (2019, EDA) propose four simple operations, described in the paper and used for classifiers trained on small datasets:

  • synonym replacement: choose n words that are not stop words and replace them with a synonym
  • random insertion: insert at a random position a synonym of a randomly chosen word
  • random swap: swap the positions of two words
  • random deletion: remove each word with probability p

These are operations that do not know the meaning of the sentence, and so they can change it. The listing lists all the single-word deletions from "the movie is not good": removing "not" produces "the movie is good", with the sentiment label inverted. This is why augmentation on text requires low probabilities and a spot check. Another technique, cited by Wei and Zou among earlier work, is back-translation (translating into another language and back), which requires a translation model. For time series a simple technique is jittering: you add Gaussian noise \epsilon_t \sim \mathcal{N}(0, \sigma^2) to every point. Since the noise is independent of the signal, the variance increases by about \sigma^2, as the last part of the listing verifies (0.0105 against 0.0100 for \sigma = 0.1): choosing \sigma is choosing how much noise the model has to ignore.

import numpy as np

# Random word deletion (one of the four EDA operations): which deletions change the meaning?
frase = "the movie is not good".split()
for i, parola in enumerate(frase):
    print(f"deleting {parola!r:8}: {' '.join(frase[:i] + frase[i + 1:])!r}")

# Jittering a series: add Gaussian noise with standard deviation sigma
t = np.linspace(0, 8000 * np.pi, 400_000)
x = np.sin(t)
rng = np.random.default_rng(0)
sigma = 0.1
xj = x + rng.normal(0, sigma, size=x.shape)
print(f"original variance {x.var():.4f}, after jitter {xj.var():.4f}, increase {xj.var() - x.var():.4f} (sigma^2 = {sigma ** 2})")

# Output:
# deleting 'the'   : 'movie is not good'
# deleting 'movie' : 'the is not good'
# deleting 'is'    : 'the movie not good'
# deleting 'not'   : 'the movie is good'
# deleting 'good'  : 'the movie is not'
# original variance 0.5000, after jitter 0.5105, increase 0.0105 (sigma^2 = 0.010000000000000002)

Of the techniques for series, time warping and window cropping should be chosen like noise: by asking which property of the series must stay invariant. A series in which the frequency carries the information (the heartbeat) does not tolerate a time warping that changes it.

Generative models: GAN and VAE

A generative model learns the distribution of the data and samples new examples from it. In a GAN (Goodfellow et al., 2014) a generator G and a discriminator D play a zero-sum game: \min_G\max_D\ \mathbb{E}_{x \sim p_{\text{data}}}[\log D(x)] + \mathbb{E}_{z \sim p_z}[\log(1 - D(G(z)))]. For a fixed G the optimal discriminator is D^*(x) = p_{\text{data}}(x)/(p_{\text{data}}(x) + p_g(x)), and substituting it the value of the game becomes -\log 4 + 2\,\text{JSD}(p_{\text{data}} \| p_g), where JSD is the Jensen-Shannon divergence, built from the KL of the article on information theory. The minimum is -\log 4, reached when p_g = p_{\text{data}}. It is a property of the optimum: it does not guarantee that real training reaches it.

A VAE (Kingma and Welling) maximises the variational lower bound: \mathbb{E}_{q(z|x)}[\log p(x|z)] - D_{\text{KL}}(q(z|x)\|p(z)) \leq \log p(x). The first term measures the reconstruction, the second forces the latent distribution to stay close to the Gaussian prior, so that new data can be sampled from p(z). In a solvable case (p(z) = \mathcal{N}(0,1), p(x|z) = \mathcal{N}(z, 1), hence p(x) = \mathcal{N}(0, 2)) the bound can be verified: for x = 1, \log p(x) = -1.5155.

import numpy as np

pd = np.array([0.5, 0.3, 0.2])                   # data distribution
for name, pg in (("different generator", np.array([0.2, 0.3, 0.5])), ("perfect generator", pd.copy())):
    d_star = pd / (pd + pg)                      # optimal discriminator D*(x) = p_data / (p_data + p_g)
    V = np.sum(pd * np.log(d_star)) + np.sum(pg * np.log(1 - d_star))
    m = (pd + pg) / 2
    kl = lambda a, b: np.sum(a * np.log(a / b))
    jsd = 0.5 * kl(pd, m) + 0.5 * kl(pg, m)
    print(f"{name}: V(D*, G) = {V:.4f}   -log 4 + 2 JSD = {-np.log(4) + 2 * jsd:.4f}   (-log 4 = {-np.log(4):.4f})")

# VAE ELBO in a solvable case: p(z) = N(0,1), p(x|z) = N(z,1)  ->  p(x) = N(0,2)
x = 1.0
log_px = -0.5 * np.log(2 * np.pi * 2) - x ** 2 / (2 * 2)
def elbo(m, s2):                                  # q(z|x) = N(m, s2)
    rec = -0.5 * np.log(2 * np.pi) - 0.5 * ((x - m) ** 2 + s2)       # E_q[log p(x|z)]
    kl = 0.5 * (m ** 2 + s2 - np.log(s2) - 1)                        # KL(q || N(0,1))
    return rec - kl
print(f"log p(x) = {log_px:.4f}")
print(f"ELBO with q = N(0, 1)        : {elbo(0.0, 1.0):.4f}  (<= log p(x))")
print(f"ELBO with q = N(x/2, 1/2)    : {elbo(x / 2, 0.5):.4f}  (q equal to the true posterior: equality)")

# Output:
# different generator: V(D*, G) = -1.2535   -log 4 + 2 JSD = -1.2535   (-log 4 = -1.3863)
# perfect generator: V(D*, G) = -1.3863   -log 4 + 2 JSD = -1.3863   (-log 4 = -1.3863)
# log p(x) = -1.5155
# ELBO with q = N(0, 1)        : -1.9189  (<= log p(x))
# ELBO with q = N(x/2, 1/2)    : -1.5155  (q equal to the true posterior: equality)

The first block verifies the GAN formula on two outcomes: with a different generator, the value of the game computed with D^* coincides with -\log 4 + 2\,\text{JSD} = -1.2535; with a perfect generator it equals -\log 4 = -1.3863. The second verifies the property of the VAE: with an approximate distribution q = \mathcal{N}(0,1) the bound is -1.9189, below \log p(x); with q = \mathcal{N}(x/2, 1/2), which is the true posterior in this model, the bound equals -1.5155 and equality holds. The distance between the two figures is precisely the KL between q and the posterior. Using generated data as augmentation is more delicate than interpolation: the generator learns from the data you have, so it adds no new information, and the synthetic examples inherit the errors and gaps of the starting dataset.

What you can do now

You can express geometric transformations as matrices and compose them in the right order, compute by hand a mixup example, a CutMix crop and a SMOTE point, and verify them with NumPy. Above all you know the two conditions that decide whether augmentation helps: the transformations must preserve the label (the rotated digits 6 and 9 bring the accuracy down from 0.961 to 0.887) and must be applied only to the training set, after the split (SMOTE before the split takes the recall on pure noise from 0.306 to 0.994). This closes the series: from linear algebra to Transformers, every formula had a hand calculation and a check, and this is the method you can take to any machine learning article you will meet.

Sources

Try These Tools

Free developer tools related to this topic.

Commenti

Caricamento commenti...

Sign in to comment

New articles and tools on Telegram too

The Telegram channel flags the site's new articles and tools.

Did you like this article?

Explore other content on the blog or discover my projects