MCPcopy Create free account

hub / github.com/catalys1/mae-pytorch / functions

Functions50 in github.com/catalys1/mae-pytorch

↓ 4 callersMethodselect_tokens
Return the tokens from `x` corresponding to the indices in `idx`.
mae.py:174
↓ 4 callersMethodtransforms
(self, crop_scale=(0.2, 1), val=False)
datamodule.py:91
↓ 3 callersMethod__init__
( self, image_size: Tuple[int, int] = (224, 224), patch_size: int = 16, keep:
mae.py:268
↓ 3 callersMethodforward
(self, x)
mae.py:411
↓ 3 callersMethodloss_fn
(self, x, y)
mae.py:450
↓ 3 callersMethodtokens_as_image
Reshape a set of token vectors into an image. This is the reverse operation of `image_as_tokens`.
mae.py:192
↓ 2 callersMethodembed
(self, x: torch.Tensor)
mae.py:212
↓ 2 callersMethodimage_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 callersMethodmasked_mse_loss
(self, img: torch.Tensor, recon: torch.Tensor)
mae.py:379
↓ 2 callersMethodpos_encoding
Create sine-cosine positional embeddings. Args: n: the number of embedding vectors, corresponding to the number of tokens (patche
mae.py:136
↓ 2 callersMethodtransforms
(self, val=False)
datamodule.py:150
↓ 2 callersMethodtransforms
(self, val=False)
datamodule.py:195
↓ 2 callersMethodtransforms
(self)
datamodule.py:231
↓ 1 callersMethod__init__
(self, dataset, size=None)
datamodule.py:28
↓ 1 callersMethodforward_features
(self, x: torch.Tensor)
mae.py:230
↓ 1 callersMethodgenerate_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 callersMethodmask_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 callersMethodmasked_image
Return a copy of the image batch, with the masked patches set to 0. Used for visualization.
mae.py:203
↓ 1 callersMethodsave_imgs
(self, imgs: torch.Tensor)
mae.py:348
↓ 1 callersMethodsetup
(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
Methodconfigure_optimizers
(self)
mae.py:359
Methodconfigure_optimizers
(self)
mae.py:421
Methodforward
(self, x: torch.Tensor)
mae.py:59
Methodforward
(self, x: torch.Tensor)
mae.py:238
Methodfreeze_mask
When True, the previously computed mask will be used on new inputs, instead of creating a new one.
mae.py:127
Methodon_train_batch_end
(self, *args, **kwargs)
mae.py:305
Methodon_validation_epoch_end
(self)
mae.py:338
Methodprepare_data
(self)
datamodule.py:147
Methodprepare_data
(self)
datamodule.py:192
Methodprepare_data
(self)
datamodule.py:228
Methodsetup
(self, stage=None)
datamodule.py:107
Methodsetup
(self, stage=None)
datamodule.py:167
Methodsetup
(self, stage=None)
datamodule.py:214
Methodsetup
(self, stage=None)
datamodule.py:239
Methodtest_dataloader
(self)
datamodule.py:255
Methodtest_step
(self, batch: Any, batch_idx: int, *args, **kwargs)
mae.py:441
Methodtrain_dataloader
(self)
datamodule.py:69
Methodtraining_step
(self, batch: Any, batch_idx: int, *args, **kwargs)
mae.py:315
Methodtraining_step
(self, batch: Any, batch_idx: int, *args, **kwargs)
mae.py:425
Methodtransforms
(self, crop_scale=(0.25, 1), val=False)
datamodule.py:134
Methodtransforms
(self, crop_scale=(0.25, 1), val=False)
datamodule.py:142
Methodval_dataloader
(self)
datamodule.py:79
Methodvalidation_step
(self, batch: Any, batch_idx: int, *args, **kwargs)
mae.py:322
Methodvalidation_step
(self, batch: Any, batch_idx: int, *args, **kwargs)
mae.py:432