class_docstr: Classification model following the pattern of tensorizer + encoder.
class_docstr_tok: ["Classification","model","following","the","pattern","of","tensorizer","+","encoder","."]
code: def __init__(
      self, encoder, decoder, output_layer, stage=Stage.TRAIN
  ) -> None:
      super().__init__(stage=stage)
      self.encoder = encoder
      self.decoder = decoder
      self.module_list = [encoder, decoder]
      self.output_layer = output_layer
      self.stage = stage
      self.module_list = [encoder, decoder]
      log_class_usage(__class__)
  
imports: from typing import Dict, List, Optional, Tuple
  import torch
  import torch.nn
  from pytext.common.constants import Stage
  from pytext.config.component import create_loss
  from pytext.data.bert_tensorizer import BERTTensorizer, BERTTensorizerBase
  from pytext.data.dense_retrieval_tensorizer import BERTContextTensorizerForDenseRetrieval, PositiveLabelTensorizerForDenseRetrieval
  from pytext.data.tensorizers import FloatListTensorizer, LabelTensorizer, NtokensTensorizer, Tensorizer
  from pytext.loss import BinaryCrossEntropyLoss, MultiLabelSoftMarginLoss
  from pytext.models.decoders.mlp_decoder import MLPDecoder
  from pytext.models.model import BaseModel, ModelInputBase
  from pytext.models.module import create_module
  from pytext.models.output_layers import ClassificationOutputLayer
  from pytext.models.output_layers.doc_classification_output_layer import BinaryClassificationOutputLayer, MulticlassOutputLayer, MultiLabelOutputLayer
  from pytext.models.pair_classification_model import BasePairwiseModel
  from pytext.models.representations.huggingface_bert_sentence_encoder import HuggingFaceBertSentenceEncoder
  from pytext.models.representations.huggingface_electra_sentence_encoder import HuggingFaceElectraSentenceEncoder
  from pytext.models.representations.representation_base import RepresentationBase
  from pytext.models.representations.transformer_sentence_encoder_base import TransformerSentenceEncoderBase
  from pytext.torchscript.module import ScriptPyTextEmbeddingModuleIndex, ScriptPyTextEmbeddingModuleWithDenseIndex
  from pytext.torchscript.utils import ScriptBatchInput, squeeze_1d, squeeze_2d
  from pytext.utils.label import get_label_weights
  from pytext.utils.usage import log_class_usage
label_desc: Use image node_id 6 to create a new _EncoderBaseModel object from inherited base classes: BaseModel with example: obj = _EncoderBaseModel(encoder, decoder, output_layer, stage)