class_docstr: CNN-LSTM embedder (based on Ma and Hovy. 2016)
  
  Args:
      word_vocab_size (int): word vocabulary size
      num_labels (int): number of labels (classifier)
      word_embedding_dims (int, optional): word embedding dims
      char_embedding_dims (int, optional): character embedding dims
      cnn_kernel_size (int, optional): character CNN kernel size
      cnn_num_filters (int, optional): character CNN number of filters
      lstm_hidden_size (int, optional): LSTM embedder hidden size
      lstm_layers (int, optional): num of LSTM layers
      bidir (bool, optional): apply bi-directional LSTM
      dropout (float, optional): dropout rate
      padding_idx (int, optinal): padding number for embedding layers
class_docstr_tok: ["CNN-LSTM","embedder","(","based","on","Ma","and","Hovy",".","2016",")","Args",":","word_vocab_size","(","int",")",":","word","vocabulary","size","num_labels","(","int",")",":","number","of","labels","(","classifier",")","word_embedding_dims","(","int",",","optional",")",":","word","embedding","dims","char_embedding_dims","(","int",",","optional",")",":","character","embedding","dims","cnn_kernel_size","(","int",",","optional",")",":","character","CNN","kernel","size","cnn_num_filters","(","int",",","optional",")",":","character","CNN","number","of","filters","lstm_hidden_size","(","int",",","optional",")",":","LSTM","embedder","hidden","size","lstm_layers","(","int",",","optional",")",":","num","of","LSTM","layers","bidir","(","bool",",","optional",")",":","apply","bi-directional","LSTM","dropout","(","float",",","optional",")",":","dropout","rate","padding_idx","(","int",",","optinal",")",":","padding","number","for","embedding","layers"]
docstr: CNN-LSTM forward step
  
  Args:
      words (torch.tensor): words
      word_chars (torch.tensor): word character tensors
  
  Returns:
      torch.tensor: logits of model
docstr_tok: ["CNN-LSTM","forward","step","Args",":","words","(","torch.tensor",")",":","words","word_chars","(","torch.tensor",")",":","word","character","tensors","Returns",":","torch.tensor",":","logits","of","model"]
code: def forward(self, words, word_chars, **kwargs):
      """
      CNN-LSTM forward step
  
      Args:
          words (torch.tensor): words
          word_chars (torch.tensor): word character tensors
  
      Returns:
          torch.tensor: logits of model
      """
      word_embeds = self.word_embeddings(words)
      char_embeds = self.char_embeddings(word_chars)
      saved_char_size = char_embeds.size()[:2]
      char_embeds = char_embeds.permute(0, 1, 3, 2)
      input_size = char_embeds.size()
      squashed_shape = [-1] + list(input_size[2:])
      char_embeds_reshape = char_embeds.contiguous().view(
          *squashed_shape
      )  # (samples * timesteps, input_size)
      char_embeds = self.conv1(char_embeds_reshape)
      char_embeds = char_embeds.permute(0, 2, 1)
      char_embeds = self.relu(char_embeds)
      char_embeds, _ = torch.max(char_embeds, 1)  # global max pooling
      new_size = saved_char_size + char_embeds.size()[1:]
      char_features = char_embeds.contiguous().view(new_size)
  
      features = torch.cat((word_embeds, char_features), -1)
      features = self.dropout(features)
  
      self.lstm.flatten_parameters()
      lstm_out, _ = self.lstm(features)
      lstm_out = self.dropout(lstm_out)
      logits = self.dense(lstm_out)
  
      return logits
  
file_path: nlp-architect/nlp_architect/nn/torch/modules/embedders.py
imports: import os
  from typing import List
  import torch
  from torch import nn
  import torch.nn.functional
  from nlp_architect.utils.io import load_json_file
  from nlp_architect.utils.text import n_letters
label_desc: Use image node_id 3 for calling the CNNLSTM obj's underlying member method code with example usage: obj.forward(words, word_chars) and returns: logits