# Post-Authorship Attribution Using Regularized Deep Neural Network
## 3 Proposed Method
### CNN Character-Level Layer  
The CNN character-level layer landscapes three essential components, which are character embedding, temporal convolution, and max-over-time pooling. Character embedding is a numeric-vector representation for a word constructed from the character n-grams. The PAA system receives as input a sequence of characters of a post. It finds the corresponding one-hot vector representation for each character through a dictionary of \(m\) characters. The maximum length of a post is 512 characters, while the maximum number of sentences in a document is bounded at 280 because of variations in the lengths of posts. If the maximum length of a post surpasses 512 characters, the sequence is padded at the preprocessing stage to have the same length because truncating the sequence will yield worse performance [75]. English-language training datasets were utilized in this study. The dictionary that supports embedding contains 70 English characters, which include 26 letters, 10 numeric letters, and 34 other letters such as white space as follows:  
\[\text{abcdefghijklmnopqrstuvwxyz-,\text{\text{\text{\text{,}}}}:\text{\text{ \text{\text{\text{\text{\text{\text{\text{\text{\text{\text{\text{\text  
The CNN character-level layer of the proposed RDNN method is a slight variant of the deep CNN character-level [92]. In the CNN layer, each word in a post is replaced with its one-hot vector representation. Hence, we denoted \(V\) to be the fixed vocabulary size of \(d\) being the dimensionality of character embedding, and \(X\in\mathbb{R}^{d\times|V|}\) to be the matrix  
Figure 1: The architecture of the RDNN PAA system.  
of character embeddings. Suppose a word, \(w\in V\), of length \(l\) is made up of a sequence of characters \([c_{1},c_{2},\ldots,c_{l}]\), the character-level representation of \(w\) is given by the matrix \(C^{w}\in\mathbb{R}^{d\times l}\), where the \(j\)-the column corresponds to the character embedding \(c_{j}\) is the \(c_{j}\)-th column of matrix \(X\). The \(C^{w}\) matrix can be padded with zero for batch processing to ensure that the number of columns is equal to the maximum length of a sentence for all words \(V\).  
The temporal convolution exhibits longer memory than recurrent networks and is applied in this study to give better performance for character-sequence modeling. The convolution operations are performed between the input matrix and multiple filter kernels with stacking to form the input matrix. A new narrow convolution is used between \(X^{w}\) and a kernel \(H\in\mathbb{R}^{d\times\omega}\) as a filter. Here \(\omega\) is the width after adding a bias \(b\) and applying a nonlinearity to obtain \(f^{w}\in\mathbb{R}^{l-(\omega-1)}\) a feature map. The \(i\)th element of \(f^{w}\) is explicitly defined as follows.  
\[f^{w}[i]=\tanh(X^{w}[*,i:i+\omega-1],H+b) \tag{1}\]  
Here, \(X^{k}[*,i:i+\omega-1]\) is the \(i\)-to-\((i+\omega-1)\)-th column of \(X^{w}\) and \(P,S=Tr(PS^{T})\) is the Frobenius inner product operation.  
The max-over-time pooling operation is ultimately applied to obtain a fixed dimensional representation of a word, which is the output of the DHN-BLSTM layer. The max over time of Equation (2) was taken as the feature corresponding to the filter \(H\) to extract the highest value for a given filter. Each filter is essentially picking out a character n-gram with a size of the n-gram that corresponds to the filter width. Finally, we take the max-over-time as follows.  
\[y^{w}=\max_{i}f^{w}[i] \tag{2}\]