class_docstr: Encoder network class.
  
  Args:
      etype (str): Type of encoder network.
      idim (int): Number of dimensions of encoder network.
      elayers (int): Number of layers of encoder network.
      eunits (int): Number of lstm units of encoder network.
      eprojs (int): Number of projection units of encoder network.
      subsample (np.array): Subsampling number. e.g. 1_2_2_2_1
      dropout (float): Dropout rate.
code: def __init__(
      self,
      etype,
      idim,
      elayers,
      eunits,
      eprojs,
      subsample,
      dropout,
      in_channel=1,
  ):
      super(Encoder, self).__init__()
      typ = etype.lstrip("vgg").rstrip("p")
      if typ not in ["lstm", "gru", "blstm", "bgru"]:
          logging.error(
              "Error: need to specify an appropriate encoder architecture"
          )
      with self.init_scope():
          if etype.startswith("vgg"):
              if etype[-1] == "p":
                  self.enc = chainer.Sequential(
                      VGG2L(in_channel),
                      RNNP(
                          get_vgg2l_odim(idim, in_channel=in_channel),
                          elayers,
                          eunits,
                          eprojs,
                          subsample,
                          dropout,
                          typ=typ,
                      ),
                  )
                  logging.info(
                      "Use CNN-VGG + " + typ.upper() + "P for encoder"
                  )
              else:
                  self.enc = chainer.Sequential(
                      VGG2L(in_channel),
                      RNN(
                          get_vgg2l_odim(idim, in_channel=in_channel),
                          elayers,
                          eunits,
                          eprojs,
                          dropout,
                          typ=typ,
                      ),
                  )
                  logging.info(
                      "Use CNN-VGG + " + typ.upper() + " for encoder"
                  )
              self.conv_subsampling_factor = 4
          else:
              if etype[-1] == "p":
                  self.enc = chainer.Sequential(
                      RNNP(
                          idim,
                          elayers,
                          eunits,
                          eprojs,
                          subsample,
                          dropout,
                          typ=typ,
                      )
                  )
                  logging.info(
                      typ.upper()
                      + " with every-layer projection for encoder"
                  )
              else:
                  self.enc = chainer.Sequential(
                      RNN(
                          idim,
                          elayers,
                          eunits,
                          eprojs,
                          dropout,
                          typ=typ,
                      )
                  )
                  logging.info(
                      typ.upper() + " without projection for encoder"
                  )
              self.conv_subsampling_factor = 1
  
imports: import logging
  import chainer
  import chainer.functions
  import chainer.links
  import numpy
  from chainer import cuda
  from espnet.nets.chainer_backend.nets_utils import _subsamplex
  from espnet.nets.e2e_asr_common import get_vgg2l_odim
label_desc: Use image node_id 1 to create a new Encoder object from inherited base classes: chainer with example: obj = Encoder(etype, idim, elayers, eunits, eprojs, subsample, dropout, in_channel)