Background
Gatys, Ecker and Bethge (NIPS 2015) showed that the Gram matrices of intermediate VGG layers encode textural content well enough to synthesize novel images with matching mid-level statistics. It is related to Neural Style Transfer but distinct: no content image, no content loss. Instead a random noise matrix is iteratively optimized to match the Gram-matrix statistics of a single texture donor across five VGG19 layers (first conv plus four pooling layers).
Motivation
The original Caffe implementation is effectively unusable today without significant environment archaeology. PyTorch is today's standard, so this port makes the algorithm usable again without resurrecting a dead framework.
What It Does
Given an input texture, the algorithm synthesizes a new image that shares its statistical fingerprint at multiple scales of the feature hierarchy, without copying any specific spatial structure. The output is called a texform.
Implementation
Delivered as a Jupyter notebook rather than a packaged library: it's a walkthrough of the algorithm, not production tooling. Loss is Gram-matrix MSE across the five selected layers, optimized directly on the pixel values of the output image.