RRDBLayer<T>
Layers · AiDotNet.NeuralNetworks.Layers
Residual in Residual Dense Block (RRDB) - the core building block of ESRGAN and Real-ESRGAN generators.
Inheritance: LayerBase<T> → RRDBLayer<T>
Implements: IShapeContract
For Beginners
RRDB is like a “super block” that contains 3 smaller blocks (RDBs).
The key insight is residual-in-residual learning:
- Each RDB has its own residual connection (local)
- The entire RRDB also has a residual connection (global)
This nested residual structure helps:
- Very deep networks train more easily
- Gradients flow better during backpropagation
- The network can learn fine details without losing coarse features
Real-ESRGAN typically uses 23 RRDB blocks, each containing 3 RDBs, for a total of 69 residual dense blocks!
How It Works
RRDB combines 3 Residual Dense Blocks with a global residual connection. This is the architecture from the ESRGAN paper (Wang et al., 2018) that enables training very deep networks for high-quality image super-resolution.
The architecture is:
Reference: Wang et al., “ESRGAN: Enhanced Super-Resolution Generative Adversarial Networks”,
ECCV 2018 Workshops. https://arxiv.org/abs/1809.00219
Constructors
| Constructor | Summary |
|---|---|
RRDBLayer(int numFeatures, int growthChannels, double residualScale) |
Initializes a new RRDB layer. |
Properties
| Property | Summary |
|---|---|
bool SupportsTraining { get; } |
|
double ResidualScale { get; } |
Gets the global residual scaling factor. |
int GrowthChannels { get; } |
Gets the growth channels used in each RDB. |
int NumFeatures { get; } |
Gets the number of feature channels. |
Methods
| Method | Summary |
|---|---|
IReadOnlyList<ILayer<T>> GetSubLayers() |
|
IReadOnlyList<OutputAxisContract> OutputAxesFor(int inputRank) |
|
void ClearGradients() |
|
void ResetState() |
|
void UpdateParameters(T learningRate) |