mr2.nn.attention.AttentionGate
- class mr2.nn.attention.AttentionGate[source]
Bases:
ModuleAttention gate from Attention UNet.
The attention mechanism from the attention UNet [OKT18].
References
- ..[OKT18] Oktay, Ozan, et al. “Attention U-net: Learning where to look for the pancreas.” MIDL (2018).
- __init__(n_dim: int, channels_gate: int, channels_in: int, channels_hidden: int, concatenate: bool = False)[source]
Initialize the attention gate.
- Parameters:
n_dim (
int) – The dimension, i.e. 1, 2 or 3.channels_gate (
int) – The number of channels in the gate tensor.channels_in (
int) – The number of channels in the input tensor.channels_hidden (
int) – The number of internal, hidden channels.concatenate (
bool, default:False) – Whether to concatenate the gated signal with the gate signal in the channel dimension (1)