Shortcuts

mmagic.models.archs.sr_backbone

Module Contents

Classes

ResidualBlockNoBN

Residual block without BN.

class mmagic.models.archs.sr_backbone.ResidualBlockNoBN(mid_channels: int = 64, res_scale: float = 1.0)[source]

Bases: torch.nn.Module

Residual block without BN.

It has a style of:

---Conv-ReLU-Conv-+-
 |________________|
Parameters
  • mid_channels (int) – Channel number of intermediate features. Default: 64.

  • res_scale (float) – Used to scale the residual before addition. Default: 1.0.

init_weights() None[source]

Initialize weights for ResidualBlockNoBN.

Initialization methods like kaiming_init are for VGG-style modules. For modules with residual paths, using smaller std is better for stability and performance. We empirically use 0.1. See more details in “ESRGAN: Enhanced Super-Resolution Generative Adversarial Networks”

forward(x: torch.Tensor) torch.Tensor[source]

Forward function.

Parameters

x (Tensor) – Input tensor with shape (n, c, h, w).

Returns

Forward results.

Return type

Tensor

Read the Docs v: latest
Versions
latest
stable
0.x
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.