gaasher / I-JEPA

Implementation of I-JEPA from "Self-Supervised Learning from Images with a Joint-Embedding Predictive Architecture"
MIT License
254 stars 26 forks source link

A code problem #7

Closed hendredlorentz closed 1 year ago

hendredlorentz commented 1 year ago

block_h = int(torch.sqrt(torch.tensor(num_patches_block / aspect_ratio))) How should this code be understood? Why is the square root needed here and why is it divided by the aspect ratio?tks.

gaasher commented 1 year ago

The square root is used here to find the height of the block in terms of patches while maintaining the desired number of patches in the block and the desired aspect ratio.

So basically we can calculate the number of patches in the block as follows: block_h (aspect_ratio block_h) = num_patches_block therefore to get block h we have to take a square root of num_patches_block/aspect ratio

hendredlorentz commented 1 year ago

tks!

hendredlorentz commented 1 year ago

Excuse me, may I know your email address? I have some questions regarding my own experimental part that I would like to discuss with you.

gaasher commented 1 year ago

My email is gabrielasher2002@gmail.com. Feel free to ask any questions!

hendredlorentz commented 1 year ago

Okay, I have sent an email to your email address and I look forward to your help.