Reshaping pyg mini-batch #4056
Unanswered
Gaurangkarwande
asked this question in
Q&A
Replies: 1 comment 2 replies
-
This looks correct to me, but I'm not entirely sure why you cannot simply process the CNN of shape |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am working on a problem where I construct a graph of images. Each node is an image and has dimensions
1x224x224
. Hence if there are 36 nodes in a graph, a single graph will have dimensions36x1x224x224
. Now, I am working with a batch size of 100. Hence, the dimensions of input to the model are100x36x1x224x224
. However, pyg creates a single disconnected graph of all graphs in the batch. Hence the actual input to the model is of size3600x1x224x224
. Now I want to pass each of the nodes through a CNN encoder. Hence I reshape the the tensor inside the model to100x36x1x224x224
and now pass a batch of nodes to the CNN encoder. The CNN encoder extracts a1024
dimensional feature vector for each image/node. I then again reshape the CNN output as it was earlier, i.e.3600x1024
.I wanted to know whether the internally structure of my graph is maintained in all these reshapings. That is when reshape from
3600x1x224x224
to100x36x1x224x224
, I am actually getting 36 images of size1x224x224
in a single sample of the batch.Beta Was this translation helpful? Give feedback.
All reactions