# Fidex and FidexGlo: From Local Explanations to Global Explanations of Deep Models +
## 3 Materials and Methods
### [PERSON] and [PERSON] presented the discretized interpretable multilayer perceptron (DIMLP [11]), a model that allows us to generate propositional rules using the FidexGlo algorithm described in Section 3.5. In a general multilayer perceptron (MLP), we denote \(x^{(0)}\) as the vector for the input layer. For layer \(l+1\ \ (l\geq 0)\), the activation values \(x^{(l+1)}\) of the neurons are  
\[x^{(l+1)}=F(W^{(l)}x^{(l)}+b^{(l)}). \tag{1}\]  
\(W^{(l)}\) is a matrix of weight parameters between two successive layers \(l\) and \(l+1\); \(b^{(l)}\) is a vector also called the bias and \(F\) is an activation function. Usually, \(F\) is a sigmoid \(\sigma(x)\):  
\[\sigma(x)=\frac{1}{1+\exp(-x)}. \tag{2}\]  
In a DIMLP, \(W^{(0)}\) is a diagonal matrix. Moreover, the activation function applied to \(x^{(1)}\) is a staircase function \(S(x)\). Here, \(S(x)\) approximates with \(\Theta\) steps a sigmoid function:  
\[S(x)=\sigma(\alpha_{min}),\ \ \ \text{if}\ x\leq\alpha_{min}; \tag{3}\]  
\(\alpha_{min}\) represents the abscissa of the first step. By default, \(\alpha_{min}=-5\).  
\[S(x)=\sigma(\alpha_{max}),\ \ \ \text{if}\ x\geq\alpha_{max}; \tag{4}\]\(\alpha_{max}\) represents the abscissa of the last step. By default, \(\alpha_{max}=5\). Between \(\alpha_{min}\) and \(\alpha_{max}\), \(S(x)\) is calculated as follows:  
\[S(x)=\sigma(\alpha_{min}+\left[\Theta\cdot\frac{x-\alpha_{min}}{\alpha_{max}- \alpha_{min}}\right](\frac{\alpha_{max}-\alpha_{min}}{\Theta})); \tag{5}\]  
with \([\ ]\) designating the integer-part function. For \(l\geq 2\), DIMLP and MLP are the same model.  
In a DIMLP, it is possible to determine the location of boundaries between classes. Specifically, these boundaries are axis-parallel hyperplanes. Consider the example of a step activation function, which is a special case of a staircase function. The step function is  
\[t(x)=\left\{\begin{array}{ll}1&\text{if }x>0;\\ 0&\text{otherwise.}\end{array}\right. \tag{6}\]  
Figure 1 shows a DIMLP with an input neuron a hidden neuron and an output neuron. Below the network are samples belonging to two classes: circles and squares. Due to the hidden neuron's step activation function, we have a potential discriminant hyperplane in \(-b/w\) (equal to three). The reason is that the step function defines a possible boundary where \(w*x+b=0\).  
After activating \(h\), if the value of \(w^{\prime}\) is zero, the circles and the triangles are indistinguishable, as the signal entering \(y\) will always be negative. With \(w^{\prime}\) equal to \(10\) and \(b^{\prime}\) equal to \(-6\), if \(h\) is \(0\), the signal entering \(y\) is negative; otherwise, if \(h\) is equal to one, the signal entering \(y\) is positive. We therefore have a hyperplane that allows us to define two propositional rules:  
* if \(x>3\), then the class is triangle;
* if \(x\leq 3\), then the class is circle.  
Regardless of the number of hidden layers, the first always determines the discriminative hyperplane location. When using the staircase activation function, the maximum number of discriminating hyperplanes per input variable is equal to the number of \(\Theta\) steps in Equation (5). Our previous rule extraction algorithm [12] was based on constructing a DT with the location of a hyperplane at each node. Each path from the root to a leaf represented a propositional rule. Finally, a greedy algorithm progressively removed rule antecedents and rules [12].  
Figure 1: A DIMLP network that discriminates circles and triangles. The step activation function for neuron \(h\) creates a hyperplane at \(x=3\). Generally, the presence or absence of this hyperplane depends on the values of \(w^{\prime}\) and \(b^{\prime}\).  
The position of the hyperplanes \(hp_{i}\) for each input variable \(x_{i}\) is  
\[hp_{i}=\frac{1}{w_{i}}\cdot(\ \ (\alpha_{min}-b_{i})+\frac{k}{\Theta}\cdot(\alpha_{ max}-\alpha_{min})\ \ ); \tag{7}\]  
with \(k=0,\ \ldots,\ \Theta\).