Conv2d

https://pytorch.org/docs/stable/generated/torch.nn.Conv2d.html

Input Image
Input image for Conv2d
Load Conv2d
import svetoviz_webgpu as sv

# 1. Prepare 2D image data (Batch, Channels, H, W)
# Loaded and normalized from sample_image.jpg
input_tensor = torch.randn(1, 3, 224, 224)

# 2. Define the 2D Convolutional module
conv2d = nn.Conv2d(in_channels=3, out_channels=16, kernel_size=3, stride=1, padding=1)

def terminal_callback(buffer, message, images, files):
    # 3. Process the image through the module
    output = conv2d(input_tensor)

    # Log the feature map shape to the Svetoviz terminal
    buffer.send_system_message(f"Processed image. Shape: {list(output.shape)}")

# 4. Start the interactive session
sv.pytorch(module=conv2d, terminal_callback=terminal_callback)
Activation input and output
Conv2d activations
Output mapping
Conv2d mapping
Selected output value
Conv2d weights
Filter and bias
Conv2d bias
Kernel
Conv2d feature maps
Kernel up close
Conv2d receptive field
Color map Inferno
Conv2d feature maps
Color map Viridis
Conv2d receptive field