class_docstr: Squeeze and Excitation layer (SE) proposed in [Squeeze-and-Excitation Networks](https://arxiv.org/abs/1709.01507).
class_docstr_tok: ["Squeeze","and","Excitation","layer","(","SE",")","proposed","in","[","Squeeze-and-Excitation","Networks","]","(","https",":","\/\/arxiv.org\/abs\/1709.01507",")","."]
code: def __init__(self, in_channels: int, reduced_channels: int):
      super().__init__()
  
      self.pooler = nn.AdaptiveAvgPool2d((1, 1))
      self.attention = nn.Sequential(
          nn.Conv2d(in_channels, reduced_channels, kernel_size=1),
          nn.ReLU(),
          nn.Conv2d(reduced_channels, in_channels, kernel_size=1),
          nn.Sigmoid(),
      )
  
imports: from typing import Optional
  import torch
  import torch.utils.checkpoint
  from torch import Tensor, nn
  from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
  from ...activations import ACT2FN
  from ...file_utils import add_code_sample_docstrings, add_start_docstrings, add_start_docstrings_to_model_forward
  from ...modeling_outputs import BaseModelOutputWithNoAttention, BaseModelOutputWithPoolingAndNoAttention, ImageClassifierOutputWithNoAttention
  from ...modeling_utils import PreTrainedModel
  from ...utils import logging
  from .configuration_regnet import RegNetConfig
label_desc: Use image node_id 1 to create a new RegNetSELayer object from inherited base classes: nn with example: obj = RegNetSELayer(in_channels, reduced_channels)