code: def __init__(self, cfg):
      super(Capsule, self).__init__()
  
      if cfg.dim_strategy == "cat":
          cfg.in_channels = cfg.word_dim + 2 * cfg.pos_dim
      else:
          cfg.in_channels = cfg.word_dim
  
      # capsule config
      cfg.input_dim_capsule = cfg.out_channels
      cfg.num_capsule = cfg.num_attributes
  
      self.num_attributes = cfg.num_attributes
      self.embedding = Embedding(cfg)
      self.cnn = CNN(cfg)
      self.capsule = CapsuleLayer(cfg)
  
file_path: DeepKE/src/deepke/attribution_extraction/standard/models/Capsule.py
imports: import os
  import sys
  import torch
  from .None import BasicModule
  from module import Embedding, CNN
  from module import Capsule
  from utils import seq_len_to_mask, to_one_hot
label_desc: Use image node_id 1 to create a new Capsule object from inherited base classes: BasicModule with example: obj = Capsule(cfg)