I no use any external filter as parameters in my neural network, I no use anything like,
nn.Conv2d(3, 10, 3)

because I do not want filters as parameters that update for every image, instead I represent each pixel in image with embedding.
for example, if I have image like,
x = torch.randn(1, 1, 5, 5)

then I represent each pixel with an embedding, so, if these 25 pixels where different then I would do,
y = nn.Embedding(25, 10)

I use cifar10 dataset, so an image in it is like, (multiplied by 255 to get integer)
image1238×384 33.1 KB
Some of these values are negative, so I add 256 to all of them, to make all value positive, and in my embedding, I use,
y = nn.Embedding(512, 10)

it appears to me that it has less than 512 variants of pixels, so one of them would be a white pixel, one of them would a black pixel and so on, each represented by 10 numbers.
so for each image, only pixels that are part of it would get updated, for example if in a dog image, there is no white pixel, then that embedding would stay as it is, no update.
During training phase, representation of each pixel is randomly initialized, so
white pixel -> [10 random numbers]
black pixel -> [10 random numbers]

if our neural network make wrong prediction, then these representations of pixels get updated, so after training,
white pixel -> [10 learnt numbers]
black pixel -> [10 learnt numbers]

and then carry on these learnt pixel representation to do testing.
My neural network is learning the representation of each pixel, that is just like we use word embedding for text, I use pixel embedding for image.
Am I doing something wrong here?