basicsr.archs.rcan_arch
- class basicsr.archs.rcan_arch.ChannelAttention(num_feat, squeeze_factor=16)[source]
Bases:
ModuleChannel attention used in RCAN.
- Parameters:
num_feat (int) – Channel number of intermediate features.
squeeze_factor (int) – Channel squeeze factor. Default: 16.
- forward(x)[source]
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- training: bool
- class basicsr.archs.rcan_arch.RCAB(num_feat, squeeze_factor=16, res_scale=1)[source]
Bases:
ModuleResidual Channel Attention Block (RCAB) used in RCAN.
- Parameters:
num_feat (int) – Channel number of intermediate features.
squeeze_factor (int) – Channel squeeze factor. Default: 16.
res_scale (float) – Scale the residual. Default: 1.
- forward(x)[source]
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- training: bool
- class basicsr.archs.rcan_arch.RCAN(num_in_ch, num_out_ch, num_feat=64, num_group=10, num_block=16, squeeze_factor=16, upscale=4, res_scale=1, img_range=255.0, rgb_mean=(0.4488, 0.4371, 0.404))[source]
Bases:
ModuleResidual Channel Attention Networks.
Paper: Image Super-Resolution Using Very Deep Residual Channel Attention NetworksReference: https://github.com/yulunzhang/RCAN
- Parameters:
num_in_ch (int) – Channel number of inputs.
num_out_ch (int) – Channel number of outputs.
num_feat (int) – Channel number of intermediate features. Default: 64.
num_group (int) – Number of ResidualGroup. Default: 10.
num_block (int) – Number of RCAB in ResidualGroup. Default: 16.
squeeze_factor (int) – Channel squeeze factor. Default: 16.
upscale (int) – Upsampling factor. Support 2^n and 3. Default: 4.
res_scale (float) – Used to scale the residual in residual block. Default: 1.
img_range (float) – Image range. Default: 255.
rgb_mean (tuple[float]) – Image mean in RGB orders. Default: (0.4488, 0.4371, 0.4040), calculated from DIV2K dataset.
- forward(x)[source]
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- training: bool
- class basicsr.archs.rcan_arch.ResidualGroup(num_feat, num_block, squeeze_factor=16, res_scale=1)[source]
Bases:
ModuleResidual Group of RCAB.
- Parameters:
num_feat (int) – Channel number of intermediate features.
num_block (int) – Block number in the body network.
squeeze_factor (int) – Channel squeeze factor. Default: 16.
res_scale (float) – Scale the residual. Default: 1.
- forward(x)[source]
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- training: bool