ml_artists · TykaDeepDreamField
DeepDream Field (Mike Tyka — AI: DeepDream / Inceptionism)
Inspired by Mike Tyka's AI: DeepDream series (2015-) and his co-authorship of 'Inceptionism: Going Deeper into Neural Networks' with Mordvintsev and Olah. Tyka's method: pick a convnet layer, perform gradient ascent on the image to maximise that layer's L2 activation norm, then zoom in and repeat — features become self-similar at every scale (fractal DeepDream). We replicate the kernel with a synthetic feature map F: each inner iteration computes the gradient of sum(F(I)) w.r.t. pixels via central differences on a sub-sampled grid, then I ← I + α·∇(sum F(I)). A ReLU-like threshold prunes weak features. A per-step fractional zoom-and-resample produces Tyka's fractal self-similarity. The starting image is either white-noise (Google blog default) or low-frequency plasma (Tyka's preferred substrate for his 'pure neural output' works).
▶ Try the live demo (JS port) ▶ Run reference.py via Pyodide 10 formulas have instant JS ports. The Pyodide path runs the actual Python in your browser — first load is ~6 MB, then instant.
Math essence
F: (H,W,3) → (H,W), F(I) = max(Σ_k a_k·sin(k_x·R_θx + k_y·R_θy + φ_k)·gray(I) - τ, 0). Update: I ← I + α·∇Σ F(I) computed by central differences on a subsampled grid (stride = D/32). Zoom: I ← zoom_resample(I, zoom). Phase drift: φ_k ← φ_k + 0.07 each step.
Parameters
| Name | Type | Default | Range | Description |
|---|---|---|---|---|
dim | int | 512 | 128–1500 | Square canvas side length (px). |
n_iter | int | 8 | 1–100 | Gradient-ascent iterations per step. |
step_size | float | 0.5 | 0–5 | Gradient-ascent learning rate α. |
feature_freq | float | 4 | 0.5–30 | Spatial frequency of the dominant feature sinusoid. |
n_octaves | int | 3 | 1–6 | Number of summed sinusoidal octaves in F. |
threshold | float | 0.05 | 0–1 | ReLU-like threshold for feature response (0 disables). |
zoom | float | 0.012 | 0–0.1 | Per-step fractional zoom for fractal DeepDream (0 disables). |
seed_image | str | noise | null–null | noise|plasma — starting image substrate. |
Reference
First 60 lines of reference.py. Full source:
library_external/ml_artists/TykaDeepDreamField/reference.py
"""TykaDeepDreamField — Mike Tyka "iterative DeepDream" kernel.
Mike Tyka, alongside Alexander Mordvintsev and Christopher Olah,
co-created Google's DeepDream (2015) and the *Inceptionism: Going
Deeper into Neural Networks* blog post. Tyka's artistic method,
applied to the *AI: DeepDream* series (2015-): take a starting image,
pick a layer of a pretrained convnet, and *iteratively* perform
gradient ascent on the image to maximize the L2 norm of that layer's
activations — then zoom in and repeat. Lower layers yield geometry
and edges; higher layers hallucinate whole creatures. The image
grows fractal, self-similar detail forever.
We replicate the algorithmic kernel in numpy by simulating the
"maximize a synthetic feature response" loop:
1. Build a synthetic 2-channel "feature map" F from layered
sinusoids at multiple scales.
2. Start with a noise image I.
3. At each step: compute R = ‖F(I)‖_2 (a scalar feature response),
compute its gradient w.r.t. I via central differences, update
I ← I + α·∇R (gradient ascent).
4. Apply a ReLU-like threshold nonlinearity to R periodically so
"weak features" get pruned (mimicking ReLU in the convnet).
5. Repeat, with mild image zoom-and-resample so features become
self-similar across scales (Tyka's "fractal DeepDream").
6. Render the amplified image.
References:
- https://www.miketyka.com/
- https://aiartists.org/mike-tyka
- https://artsandculture.google.com/story/deepdream-the-art-of-neural-networks-gray-area/gAVBUUSCYZ_FNQ
- Mordvintsev, Tyka, Olah — "Inceptionism: Going Deeper into Neural
Networks" (Google Research blog, 2015).
"""
from __future__ import annotations
from typing import ClassVar
import numpy as np
class TykaDeepDreamField:
"""Iterative synthetic-feature amplification — Tyka's DeepDream kernel.
Parameters
----------
dim : int
Square canvas side length (px).
n_iter : int
Number of inner gradient-ascent iterations per ``step`` call.
step_size : float
α — gradient ascent learning rate.
feature_freq : float
Spatial frequency of the dominant feature sinusoid.
n_octaves : int
Number of summed sinusoidal octaves in the feature map.
threshold : float
ReLU-like threshold for the feature response (0 disables).
zoom : float
Per-step fractional zoom-and-resample (Tyka's fractal zoom).
seed_image : str Try running it locally
The reference implementation is self-contained Python with numpy. Install the package and run:
python library_external/ml_artists/TykaDeepDreamField/reference.py Need help? See Learn for the standard environment setup, or Playground for an in-browser sketchbook.
More from ml artists
GAN Watercolor (Helena Sarin — Neural Bricolage / #latentDoodles)
ml_artists · SarinWatercolor
Inspired by Helena Sarin's Neural Bricolage practice (#latentDoodles, GAN Weaver, The Book of veGAN): she trains GANs on her own watercolor paintings and sketches, then curates the output back into analog paintings.
Glitch (Mario Klingemann — glitch-print aesthetic)
ml_artists · KlingemannGlitch
Klingemann's practice amplifies the visible failure modes of digital pipelines — distorted faces mid-decode, colour-shifted artefacts, rectangular datamosh tears — into the subject matter itself.
Memories of Passersby (Mario Klingemann — Memories of Passersby I)
ml_artists · KlingemannMemorex
Inspired by Mario Klingemann's Memories of Passersby I (2018, Sotheby's) — a custom GAN trained on 17th–19th-century portraits that runs forever, never repeats an output, and 'observes itself' in a feedback loop.
Neural Biodiversity (Sofia Crespo — Neural Zoo / Artificial Natural History)
ml_artists · CrespoNeuralBiodiversity
Inspired by Sofia Crespo's Neural Zoo (2018-), Artificial Natural History (2019-), and Beneath the Neural Waves (2021): she uses 3D GANs, CNN-based texture synthesis and 3D style transfer to fabricate a 'natural history book that never was' — chimerical creatures whose anatomies recombine fragments of real species.
Style Transfer Field (Gene Kogan — ml4a)
ml_artists · KoganStyleTransferField
Inspired by Gene Kogan's Experiments with Style Transfer and the ml4a curriculum: neural style transfer iteratively updates an image so its Gram-matrix feature statistics match a style reference — the gradient of the style loss with respect to pixels defines a vector field.