Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/catalys1/mae-pytorch
/ functions
Functions
50 in github.com/catalys1/mae-pytorch
⨍
Functions
50
◇
Types & classes
16
↓ 4 callers
Method
select_tokens
Return the tokens from `x` corresponding to the indices in `idx`.
mae.py:174
↓ 4 callers
Method
transforms
(self, crop_scale=(0.2, 1), val=False)
datamodule.py:91
↓ 3 callers
Method
__init__
( self, image_size: Tuple[int, int] = (224, 224), patch_size: int = 16, keep:
mae.py:268
↓ 3 callers
Method
forward
(self, x)
mae.py:411
↓ 3 callers
Method
loss_fn
(self, x, y)
mae.py:450
↓ 3 callers
Method
tokens_as_image
Reshape a set of token vectors into an image. This is the reverse operation of `image_as_tokens`.
mae.py:192
↓ 2 callers
Method
embed
(self, x: torch.Tensor)
mae.py:212
↓ 2 callers
Method
image_as_tokens
Reshape an image of shape (b, c, h, w) to a set of vectorized patches of shape (b, h*w/p^2, c*p^2). In other words, the set of non-overlapping
mae.py:180
↓ 2 callers
Method
masked_mse_loss
(self, img: torch.Tensor, recon: torch.Tensor)
mae.py:379
↓ 2 callers
Method
pos_encoding
Create sine-cosine positional embeddings. Args: n: the number of embedding vectors, corresponding to the number of tokens (patche
mae.py:136
↓ 2 callers
Method
transforms
(self, val=False)
datamodule.py:150
↓ 2 callers
Method
transforms
(self, val=False)
datamodule.py:195
↓ 2 callers
Method
transforms
(self)
datamodule.py:231
↓ 1 callers
Method
__init__
(self, dataset, size=None)
datamodule.py:28
↓ 1 callers
Method
forward_features
(self, x: torch.Tensor)
mae.py:230
↓ 1 callers
Method
generate_mask_index
Create a randomly permuted token-index tensor for determining which tokens to mask. Args: bs: batch size n_tok: numbe
mae.py:158
↓ 1 callers
Method
mask_input
Mask the image patches uniformly at random, as described in the paper: the patch tokens are randomly permuted (per image), and the first N are
mae.py:215
↓ 1 callers
Method
masked_image
Return a copy of the image batch, with the masked patches set to 0. Used for visualization.
mae.py:203
↓ 1 callers
Method
save_imgs
(self, imgs: torch.Tensor)
mae.py:348
↓ 1 callers
Method
setup
(self, stage=None)
datamodule.py:66
Method
__getitem__
(self, idx)
datamodule.py:37
Method
__init__
( self, data_dir: str, batch_size: int = 64, num_workers: int = 4, pin
datamodule.py:43
Method
__init__
( self, width: int = 768, depth: int = 12, end_norm: bool = True, )
mae.py:43
Method
__init__
( self, image_size: Tuple[int, int] = (224, 224), patch_size: int = 16, keep:
mae.py:76
Method
__init__
( self, ckpt_path: str, )
mae.py:396
Method
__len__
(self)
datamodule.py:34
Method
configure_optimizers
(self)
mae.py:359
Method
configure_optimizers
(self)
mae.py:421
Method
forward
(self, x: torch.Tensor)
mae.py:59
Method
forward
(self, x: torch.Tensor)
mae.py:238
Method
freeze_mask
When True, the previously computed mask will be used on new inputs, instead of creating a new one.
mae.py:127
Method
on_train_batch_end
(self, *args, **kwargs)
mae.py:305
Method
on_validation_epoch_end
(self)
mae.py:338
Method
prepare_data
(self)
datamodule.py:147
Method
prepare_data
(self)
datamodule.py:192
Method
prepare_data
(self)
datamodule.py:228
Method
setup
(self, stage=None)
datamodule.py:107
Method
setup
(self, stage=None)
datamodule.py:167
Method
setup
(self, stage=None)
datamodule.py:214
Method
setup
(self, stage=None)
datamodule.py:239
Method
test_dataloader
(self)
datamodule.py:255
Method
test_step
(self, batch: Any, batch_idx: int, *args, **kwargs)
mae.py:441
Method
train_dataloader
(self)
datamodule.py:69
Method
training_step
(self, batch: Any, batch_idx: int, *args, **kwargs)
mae.py:315
Method
training_step
(self, batch: Any, batch_idx: int, *args, **kwargs)
mae.py:425
Method
transforms
(self, crop_scale=(0.25, 1), val=False)
datamodule.py:134
Method
transforms
(self, crop_scale=(0.25, 1), val=False)
datamodule.py:142
Method
val_dataloader
(self)
datamodule.py:79
Method
validation_step
(self, batch: Any, batch_idx: int, *args, **kwargs)
mae.py:322
Method
validation_step
(self, batch: Any, batch_idx: int, *args, **kwargs)
mae.py:432