code: def forward(self, x, concept_matrix):
      device = torch.device(torch.get_device(x))
  
      x_hidden = x.reshape(len(x), self.d_feat, -1)  # [N, F, T]
      x_hidden = x_hidden.permute(0, 2, 1)  # [N, T, F]
      x_hidden, _ = self.rnn(x_hidden)
      x_hidden = x_hidden[:, -1, :]
  
      # Predefined Concept Module
  
      stock_to_concept = concept_matrix
  
      stock_to_concept_sum = (
          torch.sum(stock_to_concept, 0)
          .reshape(1, -1)
          .repeat(stock_to_concept.shape[0], 1)
      )
      stock_to_concept_sum = stock_to_concept_sum.mul(concept_matrix)
  
      stock_to_concept_sum = stock_to_concept_sum + (
          torch.ones(
              stock_to_concept.shape[0], stock_to_concept.shape[1]
          ).to(device)
      )
      stock_to_concept = stock_to_concept / stock_to_concept_sum
      hidden = torch.t(stock_to_concept).mm(x_hidden)
  
      hidden = hidden[hidden.sum(1) != 0]
  
      concept_to_stock = self.cal_cos_similarity(x_hidden, hidden)
      concept_to_stock = self.softmax_t2s(concept_to_stock)
  
      e_shared_info = concept_to_stock.mm(hidden)
      e_shared_info = self.fc_es(e_shared_info)
  
      e_shared_back = self.fc_es_back(e_shared_info)
      output_es = self.fc_es_fore(e_shared_info)
      output_es = self.leaky_relu(output_es)
  
      # Hidden Concept Module
      i_shared_info = x_hidden - e_shared_back
      hidden = i_shared_info
      i_stock_to_concept = self.cal_cos_similarity(
          i_shared_info, hidden
      )
      dim = i_stock_to_concept.shape[0]
      diag = i_stock_to_concept.diagonal(0)
      i_stock_to_concept = i_stock_to_concept * (
          torch.ones(dim, dim) - torch.eye(dim)
      ).to(device)
      row = torch.linspace(0, dim - 1, dim).to(device).long()
      column = i_stock_to_concept.max(1)[1].long()
      value = i_stock_to_concept.max(1)[0]
      i_stock_to_concept[row, column] = 10
      i_stock_to_concept[i_stock_to_concept != 10] = 0
      i_stock_to_concept[row, column] = value
      i_stock_to_concept = i_stock_to_concept + torch.diag_embed(
          (i_stock_to_concept.sum(0) != 0).float() * diag
      )
      hidden = torch.t(i_shared_info).mm(i_stock_to_concept).t()
      hidden = hidden[hidden.sum(1) != 0]
  
      i_concept_to_stock = self.cal_cos_similarity(
          i_shared_info, hidden
      )
      i_concept_to_stock = self.softmax_t2s(i_concept_to_stock)
      i_shared_info = i_concept_to_stock.mm(hidden)
      i_shared_info = self.fc_is(i_shared_info)
  
      i_shared_back = self.fc_is_back(i_shared_info)
      output_is = self.fc_is_fore(i_shared_info)
      output_is = self.leaky_relu(output_is)
  
      # Individual Information Module
      individual_info = x_hidden - e_shared_back - i_shared_back
      output_indi = individual_info
      output_indi = self.fc_indi(output_indi)
      output_indi = self.leaky_relu(output_indi)
  
      # Stock Trend Prediction
      all_info = output_es + output_is + output_indi
      pred_all = self.fc_out(all_info).squeeze()
  
      return pred_all
  
imports: from __future__ import division
  from __future__ import print_function
  import os
  import numpy
  import pandas
  from typing import Text, Union
  import urllib.request
  import copy
  from ...utils import get_or_create_path
  from ...log import get_module_logger
  import torch
  import torch.nn
  import torch.optim
  from .pytorch_utils import count_parameters
  from ...model.base import Model
  from ...data.dataset import DatasetH
  from ...data.dataset.handler import DataHandlerLP
  from ...contrib.model.pytorch_lstm import LSTMModel
  from ...contrib.model.pytorch_gru import GRUModel
label_desc: Use image node_id 3 for calling the HISTModel obj's underlying member method code with example usage: obj.forward(x, concept_matrix) and returns: pred_all