Recognising distributions with neural network I am wondering what is the right NN structure when the aim is to classify distribution function. 
Let's for example consider two $p$-dimensional probability distributions $D_Z$, $D_X$ (for example $D_Z\sim N(0, 1)$ and $D_X\sim N(0,2)$). 
Let $X, Z\in\mathbb R^{n\times p}$ be the matrix  composed by $n$ samples of the $D_X$ and $D_Z$ distribution respectively.  The  aim is to construct a $NN$ such that $NN(X_{new}) = 0 $ and $NN(Z_{new})=1$.
The main point here is that a single row in $X$ is in general not enough to recognise the underling distribution $D_X$ while it should be possible using as input $k>>0$ samples of $X$. 
This can probably be estimated using as input of the network $k$ rows of $X$  as a sample for class 0 and $k$ rows of $Z$ as sample for class 1.
I am wondering if better results can  be obtained using a convolution or recurrent input layer.   
EDIT: 
The distribution does not have a closed form and the number of samples I'll get is quiet small.    
My aim is not to correctly classify each sample individually but a batch of samples $X^k\in\mathbb R^{k\times p}$.   
The data can be modified in such a way to use as input of the network $X^k$ rather than a single row of $X$. I'm wondering if in this a convolution could help.
 A: If your distribution has a closed form density, then it would make sense to just compare KL divergences between your input and the two output distributions and then settle on the one that gives you less KL divergence. 
The case with no closed form density is more interesting. If you can easily generate samples from either distribution (or have a pre-labeled training set), then you could try a simple mixture-of-experts architecture, where the input is a single vector (row) and the output is a 0-1 prediction. You then average predictions over your full $X$ and use logistic loss on the final result. In other words, we're training a function NN for each individual sample $x_i$, such that our output for $X$ is $\frac{1}{n}\sum_{i=1}^nNN(X_i)$, where $X_i$ is the $i$'th row of $X$, for a total of $n$ rows. You can then train $NN$ by generating random samples from either distribution and labelling them $0,1$, and using something like binary-loss. 
Personally I don't see any advantage of using a convolutional or RNN architecture for this, because presumably your samples are iid, and the output should be invariant under permutations of the rows of $X$.
A: I assume that the samples from $D_Z$ and $D_X$ are iid. That is, for any $X_{new}$ input, your NN shouldn't care if you randomly swap rows, but it should care if you randomly swap columns. Therefore one $\mathbb{R}^{k \times p}$ input to your network should be invariant to translation along the vertical direction, but not invariant along the horizontal direction.
With that said, I think you should use an ordinary vanilla neural network with $k p$ inputs, but with the weight sharing condition that $W_i^l = W_{i+p}^l$ for the first layer, where the subscript indicates the index of the input node, and the superscript $l$ indicates the index of the node in the first hidden layer. In words, the weight corresponding to the $i,j$th element of $X_{new}$ is the same as the weight corresponding to the $(i+p),j$th element of $X_{new}$ for a given node in the hidden layer.
With this weight sharing condition, your NN does not treat the $j$th element of one row in $X_{new}$ differently than the $j$th element of another row, so swapping rows in your $X_{new}$ would not change the result. Also, this NN only needs to learn as many weights as a NN with only $p$ inputs, but it still makes use of all $k \times p$ inputs as a single entry. This is much simpler than the kind of weight-sharing scheme you find in a CNN.
