Yes, this is exactly what I want ^^. Actually my model is more complicate than this, it’s just to start. And the reason why I want to do this with weights with this shape is that it fits a real-word observation model but describing it is too long.
What I want to model afterwards:
Given input and weights (this last has mandatory a shape (blabla,blabla,1,1)), make a 2d convolution and obtain the 4d output, make some transformations on it and obtain a 2d matrix (let’s name it a_{i,j}) that actually represents for me a probability matrix, make a multinomial sampling (let’s say 3000) on this last and obtain another 2d matrix that sum up to 3000 and which represents my data (let’s name it b_{i,j}).
The goal is to maximize the log-likelihood(data=b_{i,j}; params=input,weights) = Sum_{i,j} {b_{i,j}*log (a_{i,j}))} = Sum{i,j} {b_{i,j}*log(transformations(torch.nn.functional.conv2d(inputs,weights))_{i,j}}.
(That also means that I want actually to learn not only weights, but also the input. Whatever for now.)