monai.Generator
A simple MONAI generator that turns a latent vector into an image through upsampling convolution layers.
Diffusion and generative · 28 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Parameters
- 3.6K
- Operations
- 28
- Framework
- PyTorch
- Recurrent
- No
- Source
- monai 1.5.2
- License
- Apache-2.0
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m7423
- Graph hash
- 58117f9a4e3797edf8c6c2d7c35e8ad1de2db33678e24f36f2173effe2b5bed7
- Skeleton hash
- cab7a62be1b4beb47cedb60d41897c6ef388001fb5f1aec5db0d57ac2162580b
- Architecture hash
- ef3037fc6a3db6e55e148419b83b21b3a8fcc0276b1f7440c8ebfb85cbad3859
- Diagram SHA-256
- f1c97a603c6b2282051c1e2e3b71c096f3fb8432b933ff0eda96c068698de013
- TorchLens version
- 2.35.3
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
How this diagram was made
monai.networks.nets.Generator(latent_shape=[8], start_shape=[8, 4, 4], channels=[8, 4, 1], strides=[2, 2, 2], kernel_size=3)
What it is
monai.Generator is a simple generator network: it accepts a latent vector and, through a sequence of convolution layers, constructs an output tensor of greater size. The input first passes through a linear layer that converts the vector to an image tensor whose dimensions are set by the start shape. That tensor then goes through the convolution layers and is progressively upsampled with transpose convolutions wherever a stride value is greater than 1.
The layers are built from the channels and strides arguments, which must have the same length, and that length sets the number of layers. By default each layer is a Convolution block or a ResidualUnit block, and overriding the method that creates the layers allows other layer types. In the default definition the spatial size of the output is that of the start shape multiplied by the product of the strides.
Key idea. Generator converts a latent vector to an image tensor with a linear layer and then upsamples it through a sequence of convolution layers using transpose convolutions.
- monai.Generator
- MONAI generator
- GAN generator
- generator network
- latent vector
- transpose convolution
- MONAI
- image generation
AI-written summary, based on the model's documentation and checked automatically against it; not reviewed by a person. Corrections welcome.