class_docstr: CoFrNet_Model is the base class for Continued Fractions Nets (CoFrNets).
  
  References:
      .. [#1] CoFrNets: Interpretable Neural Architecture Inspired by Continued Fractions, NeurIPS 2021. 
      Isha Puri, Amit Dhurandhar, Tejaswini Pedapati, Karthikeyan Shanmugam, Dennis Wei, Kush R Varshney. 
      https://proceedings.neurips.cc/paper/2021/file/b538f279cb2ca36268b23f557a831508-Paper.pdf
class_docstr_tok: ["CoFrNet_Model","is","the","base","class","for","Continued","Fractions","Nets","(","CoFrNets",")",".","References",":","..","[","#","1","]","CoFrNets",":","Interpretable","Neural","Architecture","Inspired","by","Continued","Fractions",",","NeurIPS","2021",".","Isha","Puri",",","Amit","Dhurandhar",",","Tejaswini","Pedapati",",","Karthikeyan","Shanmugam",",","Dennis","Wei",",","Kush","R","Varshney",".","https",":","\/\/proceedings.neurips.cc\/paper\/2021\/file\/b538f279cb2ca36268b23f557a831508-Paper.pdf"]
docstr: Initialize CoFrNet_Model
docstr_tok: ["Initialize","CoFrNet_Model"]
code: def __init__(self, connections):
      """
      Initialize CoFrNet_Model
      """
      super(CoFrNet_Model, self).__init__()
      self.connections = connections  # 3D array
      self.input_features = len(connections[0])
      self.output_features = len(connections[-1][0])
      self.num_total_parameters = 0
      self.dropout = nn.Dropout(0.1)
      self.layers = nn.ModuleList()
  
      for i in range(0, len(self.connections)):
          if i == len(self.connections) - 1:
              self.layers.append(
                  nn.Linear(
                      len(self.connections[i]), self.output_features
                  )
              )  # connection to output layer
          else:
              self.num_total_parameters = (
                  self.num_total_parameters
                  + np.count_nonzero(np.asarray(self.connections[i]))
              )
              self.layers.append(
                  CustomizedLinear(torch.tensor(self.connections[i]))
              )
  
imports: import sys
  import pandas
  import numpy
  import torch
  import torch.nn
  from torch.autograd import Function
  from torch.nn.parameter import Parameter
  import torch.nn.functional
  from sklearn.preprocessing import MinMaxScaler
  from sklearn.model_selection import train_test_split
  from aix360.algorithms.cofrnet.utils import generate_connections
  from aix360.algorithms.cofrnet.utils import process_data
  from aix360.algorithms.cofrnet.CustomizedLinearClasses import CustomizedLinearFunction
  from aix360.algorithms.cofrnet.CustomizedLinearClasses import CustomizedLinear
  from aix360.algorithms.die import DIExplainer
label_desc: Use image node_id 1 to create a new CoFrNet_Model object from inherited base classes: nn with example: obj = CoFrNet_Model(connections)