Can we compute co-variance using neural network? Can we compute covariance using the neural network? If so, it would be interesting to know the required architecture.
 A: There have been measures defined for class-adjacency for a neural-net classifier. The class-conditional bias metric does just that.
Define a $c \times c$ contingency table $M$ (also called confusion matrix), where the columns indicate the true categories $j \in \{1,\ldots,c\}$ and the rows $i \in \{1,\ldots,c\}$ the class lables as assigned by the winner-takes-all rule by a well-trained neural net classifier. Define 
\begin{equation}
R_j^i = \frac{m_{j,\,i}}{ \sum_{i=0,\, i \neq j}^{c} m_{j,\,i}}
\end{equation}
as the reduced marginal probability, omitting the actual assigned-to class $j$. (See Fig. 3 in the reference below for an illustration). The expected number of misclassified cases for assigned class $j$ is given by the reduced marginal probability. Now compute the class-specific dispersion term as:
\begin{equation}
X_j = \sum_{i \neq j} \frac{\left[m_{j,\,i} - \left(\sum_{l \neq j} R_j^l \times ( \sum_{k \neq j} m_{j,\,k}) \right) \right]^2}{\sum_{l \neq j} R_j^l \times ( \sum_{k \neq j} m_{j,\,k})}
\end{equation}
The term $X_j$ is $\chi^2$-distributed. Define now the class bias measure
\begin{equation}
\theta_j = 1 - \chi^2(X_j,df)
\end{equation}
with $df=c-2$.
Define finally the reverse dispersion measure as
\begin{equation}
\pi_j = 1 - \theta_j
\end{equation}
With these class-conditional probabilities you compute the probability that the misclassified cases of class $j$ follow the reduced marginal distribution, or just have a systematic tendency to become misclassified into specific classes.
I have decided to provide an example.
Given the true classes in the columns, and the classifier-assigned classes in the rows, the table $M$ becomes
M A  B  C
A 26  1 11
B  4 23  4
C  3  9 18

The true class distribution is for the classes A, B and C:
(26+4+3)=33, (1+23+9)=33, (11+4+18)=33.
For the first row $j=1$:
$R_1^2 = 1/(1+11) = 0.08$ and $R_1^3=11/(1+11)=0.92$
the second row $j=2$:
$R_2^1 = 4/(4+4) = 0.50$ and $R_2^3=4/(4+4)=0.50$
and the third row $j=3$
$R_3^1 = 3/(3+9) = 0.25$ and $R_3^2=3/(3+9)=0.75$
Compute $X_1$ as
\begin{equation}
X_1 = \frac{[1-(0.5 \times 12)]^2}{0.5 \times 12} + 
  \frac{[11-(0.5 \times 12)]^2}{0.5 \times 12} = 4.17 + 4.17 = 8.33
\end{equation}
We can now calculate the bias $\theta_1$ as
$\theta_1 = 1 - \chi_2(8.33,1) \approx 1-0.002 = 0.998$
The dispersion of class $1$ is $\pi_1 = 1 - 0.998 = 0.002$.
Clearly, the misclassified cases assigned class label $A$ are
significatly biased towards class $C$. The classes $A$ and $C$
are 'closer' in the 'class space' than the classes $A$ and $B$.
Hence the bias $\theta_1$ of 0.998.
[M. Egmont-Petersen, J.L. Talmon, J. Brender, P. NcNair. On the quality of neural net classifiers, Artificial Intelligence in Medicine, Vol. 6, No. 5, pp. 359-381, 199 4].
