Shortcuts

Variational Callbacks

Useful callbacks for GANs, variational-autoencoders or anything with latent spaces.


Latent Dim Interpolator

Interpolates latent dims.

Example output:

Example latent space interpolation
class pl_bolts.callbacks.variational.LatentDimInterpolator(interpolate_epoch_interval=20, range_start=- 5, range_end=5, steps=11, num_samples=2, normalize=True)[source]

Bases: pytorch_lightning.callbacks.

Interpolates the latent space for a model by setting all dims to zero and stepping through the first two dims increasing one unit at a time.

Default interpolates between [-5, 5] (-5, -4, -3, …, 3, 4, 5)

Example:

from pl_bolts.callbacks import LatentDimInterpolator

Trainer(callbacks=[LatentDimInterpolator()])
Parameters
  • interpolate_epoch_interval (int) – default 20

  • range_start (int) – default -5

  • range_end (int) – default 5

  • steps (int) – number of step between start and end

  • num_samples (int) – default 2

  • normalize (bool) – default True (change image to (0, 1) range)

Read the Docs v: stable
Versions
latest
stable
0.3.2
0.3.1
0.3.0
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.1
docs-build-rtd
0.1.0
Downloads
pdf
html
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.