Learn Before
Code
RegNetX32 Code Implementation
The RegNetX32 model can be implemented programmatically by subclassing the generic AnyNet architecture and supplying its specific hyperparameters. The model initialization establishes stem channels, a group width of , and a bottleneck ratio of . The body of the network is configured through an architectural tuple defining the depths and channel widths of its stages, specifically using depths of and channels of for the first two stages. This setup automates the construction of the network's sequential blocks.
PyTorch Implementation:
class RegNetX32(AnyNet): def __init__(self, lr=0.1, num_classes=10): stem_channels, groups, bot_mul = 32, 16, 1 depths, channels = (4, 6), (32, 80) super().__init__( ((depths[0], channels[0], groups, bot_mul), (depths[1], channels[1], groups, bot_mul)), stem_channels, lr, num_classes)
MXNet Implementation:
class RegNetX32(AnyNet): def __init__(self, lr=0.1, num_classes=10): stem_channels, groups, bot_mul = 32, 16, 1 depths, channels = (4, 6), (32, 80) super().__init__( ((depths[0], channels[0], groups, bot_mul), (depths[1], channels[1], groups, bot_mul)), stem_channels, lr, num_classes)
JAX Implementation:
class RegNetX32(AnyNet): lr: float = 0.1 num_classes: int = 10 stem_channels: int = 32 arch: tuple = ((4, 32, 16, 1), (6, 80, 16, 1))
TensorFlow Implementation:
class RegNetX32(AnyNet): def __init__(self, lr=0.1, num_classes=10): stem_channels, groups, bot_mul = 32, 16, 1 depths, channels = (4, 6), (32, 80) super().__init__( ((depths[0], channels[0], groups, bot_mul), (depths[1], channels[1], groups, bot_mul)), stem_channels, lr, num_classes)
0
1
Updated 2026-05-13
Tags
D2L
Dive into Deep Learning @ D2L