Shortcuts

mmedit.models.editors.swinir.swinir_utils

Module Contents

Functions

_ntuple(n)

A to_tuple function generator. It returns a function, this function

drop_path(x[, drop_prob, training, scale_by_keep])

Drop paths (Stochastic Depth) per sample (when applied in main path of

window_partition(x, window_size)

param x

(B, H, W, C)

window_reverse(windows, window_size, H, W)

param windows

(num_windows*B, window_size, window_size, C)

Attributes

to_2tuple

mmedit.models.editors.swinir.swinir_utils._ntuple(n)[源代码]

A to_tuple function generator. It returns a function, this function will repeat the input to a tuple of length n if the input is not an Iterable object, otherwise, return the input directly.

参数

n (int) – The number of the target length.

mmedit.models.editors.swinir.swinir_utils.to_2tuple[源代码]
mmedit.models.editors.swinir.swinir_utils.drop_path(x, drop_prob: float = 0.0, training: bool = False, scale_by_keep: bool = True)[源代码]

Drop paths (Stochastic Depth) per sample (when applied in main path of residual blocks).

This is the same as the DropConnect impl I created for EfficientNet, etc networks, however, the original name is misleading as ‘Drop Connect’ is a different form of dropout in a separate paper… See discussion: https://github.com/tensorflow/tpu/issues/494#issuecomment-532968956 I’ve opted for changing the layer and argument names to ‘drop path’ rather than mix DropConnect as a layer name and use ‘survival rate’ as the argument.

mmedit.models.editors.swinir.swinir_utils.window_partition(x, window_size)[源代码]
参数
  • x – (B, H, W, C)

  • window_size (int) – window size

返回

(num_windows*B, window_size, window_size, C)

返回类型

windows

mmedit.models.editors.swinir.swinir_utils.window_reverse(windows, window_size, H, W)[源代码]
参数
  • windows – (num_windows*B, window_size, window_size, C)

  • window_size (int) – Window size

  • H (int) – Height of image

  • W (int) – Width of image

返回

(B, H, W, C)

返回类型

x

Read the Docs v: latest
Versions
master
latest
stable
zyh-doc-notfound-extend
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.