SYMBOL INDEX (626 symbols across 143 files) FILE: args.py function str2bool (line 9) | def str2bool(v): class Args (line 19) | class Args: method __init__ (line 23) | def __init__(self): method update (line 31) | def update(self): method _get_parser (line 38) | def _get_parser(): method get_args (line 57) | def get_args(self): method get_name (line 60) | def get_name(self): method get_instance (line 64) | def get_instance() -> (argparse.Namespace, Any): FILE: augmentation/post.py class ClipSTD (line 5) | class ClipSTD(nn.Module): method forward (line 7) | def forward(self, x: torch.tensor, inflate: float = 1., per_sample: bo... class Clip (line 14) | class Clip(nn.Module): method forward (line 16) | def forward(self, x: torch.tensor) -> torch.tensor: class LInfClip (line 20) | class LInfClip(nn.Module): method __init__ (line 21) | def __init__(self, original: torch.tensor, eps: float = 16 / 255): method forward (line 27) | def forward(self, x: torch.tensor) -> torch.tensor: class L2Clip (line 31) | class L2Clip(nn.Module): method __init__ (line 32) | def __init__(self, original: torch.tensor, eps: float = 16 / 255): method forward (line 38) | def forward(self, x: torch.tensor) -> torch.tensor: FILE: augmentation/pre.py class Gray4D (line 6) | class Gray4D(nn.Module): method __init__ (line 7) | def __init__(self, n_channels: int = 3): method forward (line 11) | def forward(self, x: torch.tensor) -> torch.tensor: class Layered (line 16) | class Layered(nn.Module): method __init__ (line 17) | def __init__(self, x: torch.tensor): method forward (line 21) | def forward(self, x: torch.tensor) -> torch.tensor: class Jitter (line 25) | class Jitter(nn.Module): method __init__ (line 26) | def __init__(self, lim: int = 32): method forward (line 30) | def forward(self, x: torch.tensor) -> torch.tensor: class ColorJitter (line 36) | class ColorJitter(nn.Module): method __init__ (line 37) | def __init__(self, batch_size: int, shuffle_every: bool = False, mean:... method shuffle (line 44) | def shuffle(self): method forward (line 48) | def forward(self, img: torch.tensor) -> torch.tensor: class GaussianNoise (line 54) | class GaussianNoise(nn.Module): method __init__ (line 55) | def __init__(self, batch_size: int, shuffle_every: bool = False, std: ... method shuffle (line 63) | def shuffle(self): method forward (line 67) | def forward(self, img: torch.tensor) -> torch.tensor: class ColorJitterR (line 73) | class ColorJitterR(ColorJitter): method forward (line 74) | def forward(self, img: torch.tensor) -> torch.tensor: class Centering (line 80) | class Centering(nn.Module): method __init__ (line 81) | def __init__(self, size: int, std: float): method forward (line 86) | def forward(self, img: torch.tensor) -> torch.tensor: class Zoom (line 94) | class Zoom(nn.Module): method __init__ (line 95) | def __init__(self, out_size: int = 384): method forward (line 99) | def forward(self, img: torch.tensor) -> torch.tensor: class Tile (line 103) | class Tile(nn.Module): method __init__ (line 104) | def __init__(self, rep: int = 384 // 16): method forward (line 108) | def forward(self, x: torch.tensor) -> torch.tensor: class RepeatBatch (line 118) | class RepeatBatch(nn.Module): method __init__ (line 119) | def __init__(self, repeat: int = 32): method forward (line 123) | def forward(self, img: torch.tensor): class MaskBatch (line 127) | class MaskBatch(nn.Module): method forward (line 128) | def forward(self, x: torch.tensor) -> torch.tensor: method __init__ (line 131) | def __init__(self, count: int = -1): class Flip (line 136) | class Flip(nn.Module): method __init__ (line 137) | def __init__(self, p: float = 0.5): method forward (line 141) | def forward(self, x: torch.tensor) -> torch.tensor: FILE: cam/activation_helper.py class ActivationHelper (line 7) | class ActivationHelper: method __init__ (line 8) | def __init__(self, how_many_patches: int): method __call__ (line 12) | def __call__(self, score: torch.tensor) -> (int, int): method most_salient (line 23) | def most_salient(self, x: torch.tensor, model, patch_size: int) -> tor... method least_salient_pos (line 30) | def least_salient_pos(self, x: torch.tensor, model, patch_size: int) -... FILE: cam/base.py class BatchFeed (line 10) | class BatchFeed: method __init__ (line 11) | def __init__(self, model: ViTPatchFeatWrapper): method _batch_gen (line 16) | def _batch_gen(x: torch.tensor, batch_size) -> torch.tensor: method __call__ (line 21) | def __call__(self, x: torch.tensor, batch_size: int = 32, reduction: s... class Stitcher (line 27) | class Stitcher: method __init__ (line 30) | def __init__(self, model: ViTPatchFeatWrapper, patch_size: int, image_... method max_score (line 36) | def max_score(self, ims: Union[torch.tensor, list], score: float, orig... method __call__ (line 45) | def __call__(self, original: torch.tensor, score: float, x: torch.tens... method select_images (line 51) | def select_images(self, original, patch) -> list: method select_patch (line 62) | def select_patch(self, x) -> torch.tensor: class SniperStitcher (line 68) | class SniperStitcher(Stitcher): method select_images (line 70) | def select_images(self, original, patch) -> list: FILE: cam/model.py function project_back (line 7) | def project_back(act: torch.tensor) -> torch.tensor: class ViTPatchFeatWrapper (line 25) | class ViTPatchFeatWrapper: method __init__ (line 26) | def __init__(self, hook: ViTAttHookHolder, key: str, feature: int): method __call__ (line 30) | def __call__(self, x: torch.tensor): FILE: datasets/base.py class EasyDataset (line 6) | class EasyDataset: method __init__ (line 7) | def __init__(self, mean, std): method eval (line 12) | def eval(self) -> VisionDataset: method train (line 15) | def train(self) -> VisionDataset: FILE: datasets/cifar.py class Cifar (line 8) | class Cifar(EasyDataset): method __init__ (line 9) | def __init__(self, mean: List, std: List, data_class: Any): method eval (line 18) | def eval(self) -> VisionDataset: method train (line 21) | def train(self) -> VisionDataset: FILE: datasets/imagenet.py class ImageNet (line 8) | class ImageNet(EasyDataset): method __init__ (line 11) | def __init__(self): method eval (line 19) | def eval(self) -> VisionDataset: method train (line 22) | def train(self) -> VisionDataset: FILE: datasets/imagenet_boxes.py class BackgroundForegroundImageNet (line 7) | class BackgroundForegroundImageNet(ImageFolder): method __init__ (line 11) | def __init__(self, root: str = './data/imagenet/train/', download=True... method __len__ (line 31) | def __len__(self): method __getitem__ (line 34) | def __getitem__(self, item): FILE: datasets/inits.py class GreatInit (line 8) | class GreatInit(Dataset): method __init__ (line 9) | def __init__(self, root: str = 'data/inits/images', subset: str = 'inv... method __len__ (line 15) | def __len__(self): method __getitem__ (line 18) | def __getitem__(self, item: int) -> torch.tensor: FILE: datasets/normalizer.py class Normalizer (line 5) | class Normalizer(nn.Module): method __init__ (line 6) | def __init__(self, mean, std): method forward (line 11) | def forward(self, t: torch.tensor) -> torch.tensor: method get_normal (line 14) | def get_normal(self, t: torch.Tensor) -> torch.Tensor: method get_unit (line 17) | def get_unit(self, t: torch.Tensor) -> torch.Tensor: FILE: datasets/vit_imagenet.py class ImageNet (line 8) | class ImageNet(EasyDataset): method __init__ (line 11) | def __init__(self, img_size: int = 384): method eval (line 20) | def eval(self) -> VisionDataset: method train (line 23) | def train(self) -> VisionDataset: FILE: experiments/it0/resnet18example.py function main (line 16) | def main(): FILE: experiments/it1/bn.py function main (line 16) | def main(): FILE: experiments/it10/param_tune.py function main (line 14) | def main(): FILE: experiments/it11/clip_best_eval.py function main (line 11) | def main(): FILE: experiments/it11/clip_mask.py function main (line 15) | def main(): FILE: experiments/it11/costum_imagenet.py class BackgroundForegroundImageNet (line 7) | class BackgroundForegroundImageNet(ImageFolder): method __init__ (line 11) | def __init__(self, root: str = '.', download=True, boxes: str = None, ... method __len__ (line 30) | def __len__(self): method __getitem__ (line 33) | def __getitem__(self, item): FILE: experiments/it11/get_indices.py function main (line 5) | def main(): FILE: experiments/it11/read_xml.py function translate_obj (line 8) | def translate_obj(cls: str, obj) -> list: function objects (line 18) | def objects(expected_class: str, path: str) -> list: function get_path (line 25) | def get_path(xml_path: str) -> str: function translate_folder (line 29) | def translate_folder(xml_folder: str, root: str) -> {}: function translate_dataset (line 34) | def translate_dataset(root: str, classes: list): function main (line 39) | def main(): FILE: experiments/it11/test_dataset.py function main (line 13) | def main(): FILE: experiments/it11/test_foreground.py function test1 (line 8) | def test1(): function test2 (line 15) | def test2(): FILE: experiments/it11/vis_clip.py function main (line 14) | def main(): FILE: experiments/it12/lr_rate.py function main (line 14) | def main(): FILE: experiments/it12/vis38.py function main (line 14) | def main(): FILE: experiments/it13/fore_back.py function main (line 22) | def main(): FILE: experiments/it13/plot_rotate.py function main (line 19) | def main(): FILE: experiments/it13/plot_shift.py function main (line 17) | def main(): FILE: experiments/it13/rotate.py class Rotation (line 14) | class Rotation(nn.Module): method __init__ (line 15) | def __init__(self, count: int = 360 // 30): method forward (line 20) | def forward(self, x: torch.tensor) -> torch.tensor: function main (line 29) | def main(): FILE: experiments/it13/runner/adversarial.py class Modifier (line 6) | class Modifier: method __call__ (line 7) | def __call__(self, *inputs) -> torch.tensor: method attack (line 10) | def attack(self, *inputs) -> torch.tensor: FILE: experiments/it13/runner/correct.py class CorrectClassLoss (line 12) | class CorrectClassLoss(nn.Module): method forward (line 13) | def forward(self, output: torch.tensor, y: torch.tensor): class CorrectTrainer (line 17) | class CorrectTrainer: method __init__ (line 18) | def __init__(self, model: nn.Module, loader: DataLoader = None, loss: ... method _method_for_one_epoch (line 30) | def _method_for_one_epoch(self) -> float: method train (line 69) | def train(self) -> float: FILE: experiments/it13/runner/free.py class FreeTrainer (line 11) | class FreeTrainer: method __init__ (line 12) | def __init__(self, model: nn.Module, loader: DataLoader = None, loss: ... method _method_for_one_epoch (line 24) | def _method_for_one_epoch(self) -> float: method train (line 53) | def train(self) -> float: FILE: experiments/it13/runner/general_runner.py class BaseRunner (line 12) | class BaseRunner: method __init__ (line 13) | def __init__(self, model: nn.Module, loader: DataLoader = None, loss: ... method _method_for_one_epoch (line 22) | def _method_for_one_epoch(self) -> (float, float): class Trainer (line 48) | class Trainer(BaseRunner): method __init__ (line 49) | def __init__(self, model: nn.Module, loader: DataLoader = None, loss: ... method train (line 53) | def train(self) -> (float, float): class Evaluator (line 59) | class Evaluator(BaseRunner): method __init__ (line 60) | def __init__(self, model: torch.nn.Module, loader: DataLoader = None, ... method eval (line 65) | def eval(self) -> (float, float): FILE: experiments/it13/runner/status.py class ItemIterator (line 5) | class ItemIterator: method iterator_item (line 7) | def iterator_item(self): method __iter__ (line 10) | def __iter__(self): method __getitem__ (line 13) | def __getitem__(self, item): method __len__ (line 16) | def __len__(self): class Status (line 20) | class Status(ItemIterator): method iterator_item (line 22) | def iterator_item(self): method __init__ (line 25) | def __init__(self, loader: DataLoader, num_elements: int, template: st... method print (line 29) | def print(self, *values): class Meter (line 34) | class Meter: method __init__ (line 35) | def __init__(self): method reset (line 39) | def reset(self): method __add__ (line 42) | def __add__(self, other: (float, float)): method value (line 48) | def value(self) -> float: FILE: experiments/it13/shift.py class Shift (line 14) | class Shift(nn.Module): method __init__ (line 15) | def __init__(self, count_per_dim: int = 4, shift_per_dim: int = 4): method forward (line 19) | def forward(self, x: torch.tensor) -> torch.tensor: function main (line 30) | def main(): FILE: experiments/it14/every_and_cls.py class ViTInput (line 21) | class ViTInput(nn.Module): method __init__ (line 22) | def __init__(self, vit: Union[ViT, AugmentedModel]): method forward (line 29) | def forward(self, x: torch.tensor) -> torch.tensor: class ViTPre (line 37) | class ViTPre(nn.Sequential): method __init__ (line 38) | def __init__(self, vit: AugmentedModel): class ViTTransformer (line 42) | class ViTTransformer(nn.Module): method __init__ (line 43) | def __init__(self, vit: Union[ViT, AugmentedModel], sl: slice = None): method forward (line 49) | def forward(self, x: torch.tensor, mask: torch.tensor = None) -> torch... class ViTHead (line 55) | class ViTHead(nn.Module): method __init__ (line 56) | def __init__(self, vit: Union[ViT, AugmentedModel], sl: slice = None): method forward (line 63) | def forward(self, x: torch.tensor) -> torch.tensor: function main (line 69) | def main(): FILE: experiments/it14/every_except_cls_accuracy.py class ViTInput (line 21) | class ViTInput(nn.Module): method __init__ (line 22) | def __init__(self, vit: Union[ViT, AugmentedModel]): method forward (line 29) | def forward(self, x: torch.tensor) -> torch.tensor: class ViTPre (line 37) | class ViTPre(nn.Sequential): method __init__ (line 38) | def __init__(self, vit: AugmentedModel): class ViTTransformer (line 42) | class ViTTransformer(nn.Module): method __init__ (line 43) | def __init__(self, vit: Union[ViT, AugmentedModel], sl: slice = None): method forward (line 49) | def forward(self, x: torch.tensor, mask: torch.tensor = None) -> torch... class ViTHead (line 55) | class ViTHead(nn.Module): method __init__ (line 56) | def __init__(self, vit: Union[ViT, AugmentedModel], sl: slice = None): method forward (line 63) | def forward(self, x: torch.tensor) -> torch.tensor: function main (line 69) | def main(): FILE: experiments/it14/layer_accuracy.py class ViTInput (line 21) | class ViTInput(nn.Module): method __init__ (line 22) | def __init__(self, vit: Union[ViT, AugmentedModel]): method forward (line 29) | def forward(self, x: torch.tensor) -> torch.tensor: class ViTPre (line 37) | class ViTPre(nn.Sequential): method __init__ (line 38) | def __init__(self, vit: AugmentedModel): class ViTTransformer (line 42) | class ViTTransformer(nn.Module): method __init__ (line 43) | def __init__(self, vit: Union[ViT, AugmentedModel], sl: slice = None): method forward (line 49) | def forward(self, x: torch.tensor, mask: torch.tensor = None) -> torch... class ViTHead (line 55) | class ViTHead(nn.Module): method __init__ (line 56) | def __init__(self, vit: Union[ViT, AugmentedModel], sl: slice = None): method forward (line 63) | def forward(self, x: torch.tensor) -> torch.tensor: function main (line 69) | def main(): FILE: experiments/it14/lr_clip.py function main (line 14) | def main(): FILE: experiments/it14/lr_rate.py function main (line 14) | def main(): FILE: experiments/it14/random_patch_accuracy.py class ViTInput (line 21) | class ViTInput(nn.Module): method __init__ (line 22) | def __init__(self, vit: Union[ViT, AugmentedModel]): method forward (line 29) | def forward(self, x: torch.tensor) -> torch.tensor: class ViTPre (line 37) | class ViTPre(nn.Sequential): method __init__ (line 38) | def __init__(self, vit: AugmentedModel): class ViTTransformer (line 42) | class ViTTransformer(nn.Module): method __init__ (line 43) | def __init__(self, vit: Union[ViT, AugmentedModel], sl: slice = None): method forward (line 49) | def forward(self, x: torch.tensor, mask: torch.tensor = None) -> torch... class ViTHead (line 55) | class ViTHead(nn.Module): method __init__ (line 56) | def __init__(self, vit: Union[ViT, AugmentedModel], sl: slice = None): method forward (line 63) | def forward(self, x: torch.tensor) -> torch.tensor: function main (line 69) | def main(): FILE: experiments/it15/vis35.py function main (line 14) | def main(): FILE: experiments/it15/vis98.py function main (line 14) | def main(): FILE: experiments/it16/best35.py function main (line 10) | def main(): FILE: experiments/it16/best98.py function main (line 11) | def main(): FILE: experiments/it16/layer_accuracy.py class ViTInput (line 21) | class ViTInput(nn.Module): method __init__ (line 22) | def __init__(self, vit: Union[ViT, AugmentedModel]): method forward (line 29) | def forward(self, x: torch.tensor) -> torch.tensor: class ViTPre (line 37) | class ViTPre(nn.Sequential): method __init__ (line 38) | def __init__(self, vit: AugmentedModel): class ViTTransformer (line 42) | class ViTTransformer(nn.Module): method __init__ (line 43) | def __init__(self, vit: Union[ViT, AugmentedModel], sl: slice = None): method forward (line 49) | def forward(self, x: torch.tensor, mask: torch.tensor = None) -> torch... class ViTHead (line 55) | class ViTHead(nn.Module): method __init__ (line 56) | def __init__(self, vit: Union[ViT, AugmentedModel], sl: slice = None): method forward (line 63) | def forward(self, x: torch.tensor) -> torch.tensor: class ViTFeatSelector (line 68) | class ViTFeatSelector(nn.Module): method __init__ (line 69) | def __init__(self, sl: slice = None): method forward (line 73) | def forward(self, x: torch.tensor) -> torch.tensor: class ViTCLSLayer (line 78) | class ViTCLSLayer(nn.Sequential): method __init__ (line 79) | def __init__(self, vit: AugmentedModel, layer: int): function main (line 85) | def main(): FILE: experiments/it16/mask35.py function main (line 15) | def main(): FILE: experiments/it16/mask98.py function main (line 15) | def main(): FILE: experiments/it16/reconstruct.py function main (line 15) | def main(): FILE: experiments/it17/cls.py class ViTInput (line 21) | class ViTInput(nn.Module): method __init__ (line 22) | def __init__(self, vit: Union[ViT, AugmentedModel]): method forward (line 29) | def forward(self, x: torch.tensor) -> torch.tensor: class ViTPre (line 37) | class ViTPre(nn.Sequential): method __init__ (line 38) | def __init__(self, vit: AugmentedModel): class ViTTransformer (line 42) | class ViTTransformer(nn.Module): method __init__ (line 43) | def __init__(self, vit: Union[ViT, AugmentedModel], sl: slice = None): method forward (line 49) | def forward(self, x: torch.tensor, mask: torch.tensor = None) -> torch... class ViTHead (line 55) | class ViTHead(nn.Module): method __init__ (line 56) | def __init__(self, vit: Union[ViT, AugmentedModel], sl: slice = None): method forward (line 63) | def forward(self, x: torch.tensor) -> torch.tensor: class ViTFeatSelector (line 68) | class ViTFeatSelector(nn.Module): method __init__ (line 69) | def __init__(self, sl: slice = None): method forward (line 73) | def forward(self, x: torch.tensor) -> torch.tensor: class ViTCLSLayer (line 78) | class ViTCLSLayer(nn.Module): method __init__ (line 79) | def __init__(self, vit: AugmentedModel, layer: int): method forward (line 88) | def forward(self, x: torch.tensor) -> torch.tensor: function main (line 100) | def main(): FILE: experiments/it17/convert.py function convert (line 19) | def convert(old_file: str, new_file: str): function main (line 28) | def main(): FILE: experiments/it17/main_cherry_clip.py function gen (line 89) | def gen(arr): function generate (line 95) | def generate(indices, per_row: int = 7, per_page: int = 4, tvs: list = N... function generate2 (line 140) | def generate2(indices, per_row: int = 7, per_page: int = 6, folder: str ... function print35 (line 172) | def print35(): function print98 (line 188) | def print98(): function fake_arr (line 204) | def fake_arr(arr): FILE: experiments/it18/best99.py function main (line 13) | def main(): FILE: experiments/it18/fb_example.py function main (line 12) | def main(): FILE: experiments/it18/mask.py function main (line 15) | def main(): FILE: experiments/it2/layered.py function main (line 23) | def main(): FILE: experiments/it2/layered2.py function main (line 23) | def main(): FILE: experiments/it2/layered3.py function main (line 16) | def main(): FILE: experiments/it2/try.py function main (line 8) | def main(): FILE: experiments/it2/vis.py function main (line 20) | def main(): FILE: experiments/it3/check_hooks_correctness.py function to_numpy (line 15) | def to_numpy(x): function main (line 30) | def main(): FILE: experiments/it3/make_heap.py class FeatHeap (line 27) | class FeatHeap: method __init__ (line 28) | def __init__(self, limit: int = 24 * 24, feat_count: int = 10): method convert (line 33) | def convert(self, act: torch.tensor, start: int, images: torch.tensor)... method __add__ (line 52) | def __add__(self, tup: tuple): function main (line 67) | def main(): FILE: experiments/it3/predict_checkpoint_size.py function main (line 9) | def main(): FILE: experiments/it4/debug.py function main (line 13) | def main(): FILE: experiments/it4/tile.py function main (line 13) | def main(): FILE: experiments/it4/visualize.py class FeatHeap (line 27) | class FeatHeap: method __init__ (line 28) | def __init__(self, limit: int = 24 * 24, feat_count: int = 10): method convert (line 34) | def convert(self, act: torch.tensor, start: int, images: torch.tensor)... method __add__ (line 57) | def __add__(self, tup: tuple): function main (line 74) | def main(): FILE: experiments/it5/best.py function main (line 14) | def main(): FILE: experiments/it5/stitch.py function get_patches (line 13) | def get_patches(image_size: int, patch_size: int): function main (line 24) | def main(): FILE: experiments/it6/best.py function main (line 14) | def main(): FILE: experiments/it6/class.py function main (line 13) | def main(): FILE: experiments/it6/head.py function main (line 14) | def main(): FILE: experiments/it6/lr_rate.py function main (line 14) | def main(): FILE: experiments/it6/score.py function main (line 14) | def main(): FILE: experiments/it7/lh_pass.py function roll_n (line 14) | def roll_n(X, axis, n): function fftshift (line 22) | def fftshift(X): function ifftshift (line 33) | def ifftshift(X): function h_pass (line 45) | def h_pass(img: torch.tensor, filter_rate: float = 0.95): function l_pass (line 61) | def l_pass(img: torch.tensor, filter_rate: float = 0.95) -> torch.tensor: class FreqPass (line 65) | class FreqPass(nn.Module): method __init__ (line 66) | def __init__(self, high: bool = True, rate: float = 0.95): method forward (line 70) | def forward(self, x: torch.tensor) -> torch.tensor: function main (line 75) | def main(): FILE: experiments/it7/no_pos.py class PatchShuffle (line 13) | class PatchShuffle(nn.Module): method __init__ (line 14) | def __init__(self, image_size: int = 384, patch_size=16): method forward (line 18) | def forward(self, x: torch.tensor) -> torch.tensor: function main (line 28) | def main(): FILE: experiments/it8/cj_std.py function main (line 14) | def main(): FILE: experiments/it8/gaus.py function main (line 14) | def main(): FILE: experiments/it8/high.py function main (line 14) | def main(): FILE: experiments/it8/lr_rate.py function main (line 14) | def main(): FILE: experiments/it8/score.py function main (line 14) | def main(): FILE: experiments/it9/best_eval.py function main (line 11) | def main(): FILE: experiments/it9/best_train.py function main (line 11) | def main(): FILE: experiments/it9/get_images.py function main (line 14) | def main(): FILE: experiments/it9/get_mask.py function main (line 15) | def main(): FILE: experiments/it9/vis.py function main (line 14) | def main(): FILE: hooks/base.py class BasicHook (line 5) | class BasicHook: method __init__ (line 6) | def __init__(self, module: nn.Module): method close (line 10) | def close(self): method base_hook_fn (line 13) | def base_hook_fn(self, model: nn.Module, input_t: torch.tensor, output... method hook_fn (line 18) | def hook_fn(self, model: nn.Module, x: torch.tensor): FILE: hooks/hook_holder.py class HookHolder (line 5) | class HookHolder(ItemIterator): method __init__ (line 6) | def __init__(self, classifier: nn.Module, hook_class, layer_class): method iterator_item (line 10) | def iterator_item(self): method check_for_attr (line 13) | def check_for_attr(self, attr: str, hook_class): method _broadcast (line 18) | def _broadcast(self, func_name: str, *to_propagate): method _gather (line 23) | def _gather(self, attr: str) -> list: method close (line 26) | def close(self): FILE: hooks/layer.py class LayerHook (line 5) | class LayerHook: method __init__ (line 6) | def __init__(self, classifier: nn.Module, layer_class, layer_depth: in... method __call__ (line 10) | def __call__(self) -> torch.tensor: FILE: hooks/timed_hook.py class TimedHookHolder (line 4) | class TimedHookHolder(HookHolder): method get_activations (line 5) | def get_activations(self): method get_layer (line 11) | def get_layer(self, item): method set_seed (line 15) | def set_seed(self, seed: int): method set_target (line 18) | def set_target(self, target: list): method reset (line 21) | def reset(self): FILE: hooks/transformer/vit.py class ViTHook (line 11) | class ViTHook(BasicHook): method __init__ (line 12) | def __init__(self, module: nn.Module, return_output: bool, name: str): method base_hook_fn (line 17) | def base_hook_fn(self, model: nn.Module, input_t: torch.tensor, output... method hook_fn (line 22) | def hook_fn(self, model: nn.Module, x: torch.tensor): class FakeHookWrapper (line 26) | class FakeHookWrapper: method __init__ (line 27) | def __init__(self, value): class ViTAbsHookHolder (line 31) | class ViTAbsHookHolder(nn.Module): class ViTAttHookHolder (line 35) | class ViTAttHookHolder(ViTAbsHookHolder): method __init__ (line 36) | def __init__(self, classifier: nn.Module, in_feat: bool = False, keys:... method scores (line 53) | def scores(self): method forward (line 59) | def forward(self, x: torch.tensor) -> ({}, torch.tensor): class ViTGeLUHook (line 71) | class ViTGeLUHook(ViTAbsHookHolder): method __init__ (line 72) | def __init__(self, classifier: nn.Module, sl: slice = None): method forward (line 80) | def forward(self, x: torch.tensor) -> ({}, torch.tensor): class ClipGeLUHook (line 88) | class ClipGeLUHook(ViTAbsHookHolder): method __init__ (line 89) | def __init__(self, classifier: nn.Module, sl: slice = None): method forward (line 97) | def forward(self, x: torch.tensor) -> ({}, torch.tensor): class SimpleViTGeLUHook (line 106) | class SimpleViTGeLUHook(ViTGeLUHook): method forward (line 108) | def forward(self, x: torch.tensor) -> torch.tensor: class SimpleClipGeLUHook (line 115) | class SimpleClipGeLUHook(ClipGeLUHook): method forward (line 117) | def forward(self, x: torch.tensor) -> torch.tensor: class SaliencyViTGeLUHook (line 125) | class SaliencyViTGeLUHook(ViTGeLUHook): method forward (line 127) | def forward(self, x: torch.tensor, l: int, f: int) -> torch.tensor: class SaliencyClipGeLUHook (line 133) | class SaliencyClipGeLUHook(ClipGeLUHook): method forward (line 135) | def forward(self, x: torch.tensor, l: int, f: int) -> torch.tensor: class ReconstructionViTGeLUHook (line 141) | class ReconstructionViTGeLUHook(ViTGeLUHook): method forward (line 142) | def forward(self, x: torch.tensor) -> torch.tensor: class ReconstructionClipGeLUHook (line 148) | class ReconstructionClipGeLUHook(ClipGeLUHook): method forward (line 149) | def forward(self, x: torch.tensor) -> torch.tensor: FILE: inversion/imagenet_invertor.py class ImageNetVisualizer (line 12) | class ImageNetVisualizer: method __init__ (line 13) | def __init__(self, loss_array: LossArray, saver: AbstractSaver = None,... method __call__ (line 27) | def __call__(self, img: torch.tensor = None, optimizer: optim.Optimize... FILE: inversion/utils.py function new_init (line 4) | def new_init(size: int, batch_size: int = 1, last: torch.nn = None, padd... FILE: loss/base.py function _abbreviation (line 6) | def _abbreviation(name: str) -> str: function _round (line 13) | def _round(num: float) -> str: class InvLoss (line 21) | class InvLoss: method __init__ (line 22) | def __init__(self, coefficient: float = 1.0): method __call__ (line 27) | def __call__(self, x: torch.tensor) -> torch.tensor: method loss (line 32) | def loss(self, x: torch.tensor): method __str__ (line 35) | def __str__(self): method reset (line 38) | def reset(self) -> torch.tensor: class LossArray (line 42) | class LossArray: method __init__ (line 43) | def __init__(self): method __add__ (line 47) | def __add__(self, other: InvLoss): method __call__ (line 51) | def __call__(self, x: torch.tensor): method header (line 56) | def header(self) -> str: method __str__ (line 60) | def __str__(self): method reset (line 64) | def reset(self): FILE: loss/hooks/activation.py class AbsActivationHook (line 7) | class AbsActivationHook(BasicHook): method __init__ (line 8) | def __init__(self, module: nn.Module, feature: int = 0, targets: list ... method hook_fn (line 14) | def hook_fn(self, model: nn.Module, x: torch.tensor): method reset (line 17) | def reset(self): method set_feature (line 24) | def set_feature(self, feature: int): method set_target (line 27) | def set_target(self, target: list): method __call__ (line 30) | def __call__(self) -> torch.tensor: class ActivationHook (line 36) | class ActivationHook(AbsActivationHook): method hook_fn (line 37) | def hook_fn(self, model: nn.Module, input_t: torch.Tensor): class ActivationReluHook (line 44) | class ActivationReluHook(AbsActivationHook): method hook_fn (line 45) | def hook_fn(self, model: nn.Module, input_t: torch.Tensor): class TargetActivationHook (line 53) | class TargetActivationHook(AbsActivationHook): method hook_fn (line 54) | def hook_fn(self, model: nn.Module, input_t: torch.Tensor): class ContrastiveActivationHook (line 61) | class ContrastiveActivationHook(AbsActivationHook): method hook_fn (line 62) | def hook_fn(self, model: nn.Module, input_t: torch.Tensor): class ViTCLSActivationHook (line 71) | class ViTCLSActivationHook(AbsActivationHook): method hook_fn (line 72) | def hook_fn(self, model: nn.Module, input_t: torch.Tensor): class ViTMeanActivationHook (line 82) | class ViTMeanActivationHook(AbsActivationHook): method hook_fn (line 83) | def hook_fn(self, model: nn.Module, input_t: torch.Tensor): FILE: loss/hooks/batch_norm.py class BatchNormHookHookAbs (line 9) | class BatchNormHookHookAbs(AbsActivationHook): method hook_fn (line 10) | def hook_fn(self, model: nn.Module, x: torch.tensor): method get_mean_var (line 14) | def get_mean_var(x: torch.tensor) -> (torch.tensor, torch.tensor): method normalize_eval (line 19) | def normalize_eval(model: nn.Module, x: torch.tensor) -> torch.tensor: class MatchModelBNStatsHook (line 26) | class MatchModelBNStatsHook(BatchNormHookHookAbs): method hook_fn (line 27) | def hook_fn(self, model: nn.Module, input_t: torch.Tensor): FILE: loss/image_net.py class MatchBatchNorm (line 15) | class MatchBatchNorm(InvLoss): method __init__ (line 16) | def __init__(self, bn: BaseFakeBN, coefficient: float = 1.): method loss (line 20) | def loss(self, x: torch.tensor) -> torch.tensor: class TotalVariation (line 24) | class TotalVariation(InvLoss): method loss (line 25) | def loss(self, x: torch.tensor): method __init__ (line 28) | def __init__(self, p: int = 2, size: int = 224, coefficient: float = 1.): class NormalVariation (line 34) | class NormalVariation(InvLoss): method loss (line 35) | def loss(self, x: torch.tensor): method __init__ (line 38) | def __init__(self, p: int = 2, size: int = 224, coefficient: float = 1.): class ColorVariation (line 44) | class ColorVariation(InvLoss): method loss (line 45) | def loss(self, x: torch.tensor): method __init__ (line 48) | def __init__(self, p: int = 2, size: int = 224, coefficient: float = 1.): class CrossEntropyLoss (line 54) | class CrossEntropyLoss(InvLoss): method loss (line 55) | def loss(self, x: torch.tensor): method __init__ (line 58) | def __init__(self, model: torch.nn.Module, label: torch.tensor, coeffi... class BatchAugment (line 65) | class BatchAugment(InvLoss): method loss (line 66) | def loss(self, x: torch.tensor): method __init__ (line 71) | def __init__(self, other: InvLoss, aug: torch.tensor = None): class NetworkPass (line 77) | class NetworkPass(InvLoss): method __init__ (line 78) | def __init__(self, model: torch.nn.Module): method loss (line 82) | def loss(self, x: torch.tensor): class BatchNorm1stLayer (line 87) | class BatchNorm1stLayer(InvLoss): method loss (line 88) | def loss(self, x: torch.tensor) -> torch.tensor: method reset (line 91) | def reset(self) -> torch.tensor: method __init__ (line 94) | def __init__(self, bn_hook: TimedHookHolder, layer: int = 0, coefficie... class ViTFeatHook (line 100) | class ViTFeatHook(InvLoss): method __init__ (line 101) | def __init__(self, hook: ViTAbsHookHolder, key: str, coefficient: floa... method loss (line 106) | def loss(self, x: torch.tensor): class ViTEnsFeatHook (line 113) | class ViTEnsFeatHook(ViTFeatHook): method __init__ (line 114) | def __init__(self, hook: ViTAbsHookHolder, key: str, feat: int = 0, co... method loss (line 118) | def loss(self, x: torch.tensor): class ReconstructionLoss (line 125) | class ReconstructionLoss(ViTFeatHook): method __init__ (line 126) | def __init__(self, hook: ViTAbsHookHolder, x: torch.tensor, key: str, ... method loss (line 132) | def loss(self, x: torch.tensor): class ViTHeadHook (line 136) | class ViTHeadHook(ViTEnsFeatHook): method loss (line 137) | def loss(self, x: torch.tensor): class ViTScoreHook (line 143) | class ViTScoreHook(ViTEnsFeatHook): method loss (line 144) | def loss(self, x: torch.tensor): class LayerActivationNorm (line 153) | class LayerActivationNorm(InvLoss): method __init__ (line 154) | def __init__(self, hook: LayerHook, model: torch.nn.Module, coefficien... method loss (line 158) | def loss(self, x: torch.tensor) -> torch.tensor: class ActivationNorm (line 163) | class ActivationNorm(InvLoss): method loss (line 164) | def loss(self, x: torch.tensor): method __init__ (line 167) | def __init__(self, activation_hook: TimedHookHolder, layer: int, coeff... method reset (line 172) | def reset(self) -> torch.tensor: class ColorDistribution (line 176) | class ColorDistribution(InvLoss): method loss (line 177) | def loss(self, x: torch.tensor): method __init__ (line 180) | def __init__(self, normalizer: Normalizer, coefficient: float = 1.): FILE: loss/regularizers/batch_norm.py class FakeBatchNorm (line 6) | class FakeBatchNorm(nn.Module): method __init__ (line 7) | def __init__(self, resnet_function, normalizer: Normalizer): method forward (line 13) | def forward(self, x: torch.tensor) -> torch.tensor: FILE: loss/regularizers/image.py class TotalVariation (line 8) | class TotalVariation(nn.Module): method __init__ (line 9) | def __init__(self, p: int = 2): method forward (line 13) | def forward(self, x: torch.tensor) -> torch.tensor: class NormalVariation (line 22) | class NormalVariation(TotalVariation): method forward (line 23) | def forward(self, x: torch.tensor, per_sample: bool = True) -> torch.t... class ColorVariation (line 29) | class ColorVariation(TotalVariation): method forward (line 30) | def forward(self, x: torch.tensor) -> torch.tensor: class L1Norm (line 35) | class L1Norm(nn.Module): method forward (line 36) | def forward(self, x: torch.tensor) -> torch.tensor: class L2Norm (line 40) | class L2Norm(nn.Module): method forward (line 41) | def forward(self, x: torch.tensor) -> torch.tensor: class FakeColorDistribution (line 45) | class FakeColorDistribution(nn.Module): method __init__ (line 46) | def __init__(self, normalizer: Normalizer): method forward (line 50) | def forward(self, x: torch.tensor) -> torch.tensor: FILE: model/augmented.py class AugmentedModel (line 5) | class AugmentedModel(nn.Module): method __init__ (line 6) | def __init__(self, classifier: nn.Module, augmentations: nn.Module = N... method forward (line 11) | def forward(self, *inputs: [torch.Tensor]) -> [torch.Tensor]: class BNModel (line 16) | class BNModel(nn.Module): method __init__ (line 17) | def __init__(self, conv: nn.Module, bn: nn.Module): method forward (line 22) | def forward(self, x: torch.tensor): FILE: model/library/base.py class InvertModel (line 8) | class InvertModel(ItemIterator): method iterator_item (line 12) | def iterator_item(self): method __init__ (line 15) | def __init__(self, name: str, constructor, constructor_args: dict, ima... method __call__ (line 22) | def __call__(self, normalize: bool = True, grad: bool = False) -> (tor... class TorchVisionModel (line 34) | class TorchVisionModel(InvertModel): method __init__ (line 35) | def __init__(self, constructor, batch_size: int): class ModelLibrary (line 43) | class ModelLibrary(ItemIterator): method iterator_item (line 45) | def iterator_item(self): method __init__ (line 48) | def __init__(self, other_models: list): method names (line 52) | def names(self) -> dict: method __str__ (line 55) | def __str__(self): method _fw_score (line 64) | def _fw_score(q: str, reference: str) -> int: method _amin_score (line 74) | def _amin_score(q: str, reference: str) -> float: method search (line 78) | def search(self, query: str, top_k=5): FILE: model/library/cnns/alexnet.py class AlexNet (line 6) | class AlexNet(TorchVisionModel): FILE: model/library/cnns/densenet.py class DensNet (line 6) | class DensNet(TorchVisionModel): FILE: model/library/cnns/googlenet.py class GoogleNet (line 6) | class GoogleNet(TorchVisionModel): FILE: model/library/cnns/inception.py class Inception (line 6) | class Inception(TorchVisionModel): FILE: model/library/cnns/mnasnet.py class MNasNet (line 6) | class MNasNet(TorchVisionModel): FILE: model/library/cnns/mobilenet.py class MobileNet (line 6) | class MobileNet(TorchVisionModel): FILE: model/library/cnns/resnet.py class ResNet (line 7) | class ResNet(TorchVisionModel): FILE: model/library/cnns/robust.py function robust_resnet50 (line 9) | def robust_resnet50(): class RobustResNet50 (line 17) | class RobustResNet50(InvertModel): method __init__ (line 18) | def __init__(self, constructor, batch_size: int): FILE: model/library/cnns/shufflenet.py class ShuffleNet (line 6) | class ShuffleNet(TorchVisionModel): FILE: model/library/cnns/squeezenet.py class SqueezeNet (line 6) | class SqueezeNet(TorchVisionModel): FILE: model/library/cnns/vggs.py class VGG (line 6) | class VGG(TorchVisionModel): FILE: model/library/transformers/base.py class TransformerModel (line 9) | class TransformerModel(InvertModel): method __call__ (line 12) | def __call__(self, normalize: bool = True, grad: bool = False): class TimmModel (line 19) | class TimmModel(TransformerModel): method get_size_based_on_name (line 22) | def get_size_based_on_name(self, name: str) -> int: method __init__ (line 25) | def __init__(self, o: int, batch_size: int): FILE: model/library/transformers/clip.py class ClipWrapper (line 10) | class ClipWrapper(nn.Module): method __init__ (line 11) | def __init__(self, clip): method forward (line 15) | def forward(self, x: torch.tensor) -> torch.tensor: class CLIP (line 19) | class CLIP(TransformerModel): method __init__ (line 20) | def __init__(self, o: int, batch_size: int): FILE: model/library/transformers/coat.py class CoaT (line 5) | class CoaT(TimmModel): FILE: model/library/transformers/convit.py class ConViT (line 5) | class ConViT(TimmModel): FILE: model/library/transformers/deit.py class DeiT (line 8) | class DeiT(TransformerModel): method __init__ (line 9) | def __init__(self, o: int, batch_size: int): FILE: model/library/transformers/levit.py class LeViT (line 5) | class LeViT(TimmModel): method get_size_based_on_name (line 7) | def get_size_based_on_name(self, name:str) -> int: FILE: model/library/transformers/mixer.py class Mixer (line 5) | class Mixer(TimmModel): FILE: model/library/transformers/pit.py class PiT (line 5) | class PiT(TimmModel): FILE: model/library/transformers/resmpl.py class ResMLP (line 5) | class ResMLP(TimmModel): FILE: model/library/transformers/swin.py class Swin (line 5) | class Swin(TimmModel): FILE: model/library/transformers/twin.py class Twin (line 5) | class Twin(TimmModel): FILE: model/library/transformers/vit.py class ViT (line 9) | class ViT(TransformerModel): method __init__ (line 10) | def __init__(self, o: int, batch_size: int): FILE: model/utils.py function default_bn (line 9) | def default_bn(): FILE: saliency_tools/guided.py class GuidedBackProp (line 4) | class GuidedBackProp: method __init__ (line 9) | def __init__(self, model): method update_relus (line 16) | def update_relus(self): function generate_gradients (line 50) | def generate_gradients(self, input_image, target_class): FILE: saliency_tools/vanilla.py class VanillaBackProp (line 5) | class VanillaBackProp: method __init__ (line 10) | def __init__(self, model): method generate_gradients (line 14) | def generate_gradients(self, input_image, target_class): FILE: saver/base.py class AbstractSaver (line 10) | class AbstractSaver: method __init__ (line 11) | def __init__(self, extension: str, folder: str = None, save_id: bool =... method _get_mkdir_path (line 18) | def _get_mkdir_path(self, *path): method save (line 26) | def save(self, result: torch.Tensor, *path): method save_function (line 30) | def save_function(self, result: Any, path: str): class ImageSaver (line 34) | class ImageSaver(AbstractSaver): method save_function (line 35) | def save_function(self, result: Any, path: str): method get_nrow (line 40) | def get_nrow() -> torch.tensor: method __init__ (line 49) | def __init__(self, folder: str, save_id: bool = False): class TensorSaver (line 54) | class TensorSaver(AbstractSaver): method save_function (line 55) | def save_function(self, result: Any, path: str): method __init__ (line 58) | def __init__(self, folder: str, save_id: bool = False): class ExperimentSaver (line 62) | class ExperimentSaver(AbstractSaver): method save_function (line 63) | def save_function(self, result: Any, path: str): method save (line 66) | def save(self, result: torch.Tensor, *path): method __init__ (line 71) | def __init__(self, folder: str, save_id: bool = False, disk_saver: boo... FILE: train_cifar100.py function get_cifar100_loaders (line 20) | def get_cifar100_loaders(batch_size=128, train=None): function main (line 34) | def main(): FILE: utils/bn.py class Accumulator (line 7) | class Accumulator: method __init__ (line 8) | def __init__(self): method __add__ (line 11) | def __add__(self, other): method value (line 17) | def value(self) -> np.ndarray: method save (line 21) | def save(self, name: str): function get_len (line 25) | def get_len(model: torch.nn.Module): function get_mean (line 30) | def get_mean(model: torch.nn.Module) -> np.ndarray: function get_var (line 34) | def get_var(model: torch.nn.Module) -> np.ndarray: function get_stat_params (line 38) | def get_stat_params(model: torch.nn.Module, get_all: bool = False) -> Li... function get_error (line 50) | def get_error(first: np.ndarray, other: np.ndarray) -> float: function replace_bn (line 56) | def replace_bn(model: torch.nn.Module, mean: np.ndarray, var: np.ndarray... function replace_bn_with_multiplicative_inverse (line 67) | def replace_bn_with_multiplicative_inverse(model: torch.nn.Module): function random_model (line 74) | def random_model(model: torch.nn.Module): function shirt_on_model (line 82) | def shirt_on_model(model: torch.nn.Module, mean, var): function get_var_params (line 93) | def get_var_params(model: torch.nn.Module) -> torch.Tensor: FILE: utils/classification.py function get_acc (line 10) | def get_acc(output: torch.Tensor, y: torch.Tensor) -> (float, int): function get_acc5 (line 16) | def get_acc5(output: torch.Tensor, y: torch.Tensor) -> (float, int): function print_acc_stats (line 23) | def print_acc_stats(pred: np.ndarray, y: np.ndarray): function get_confusion (line 35) | def get_confusion(e_pred: np.ndarray, e_label: np.ndarray) -> np.ndarray: function tqdm_stat (line 44) | def tqdm_stat(tqdm_obj: tqdm, template: str, values: List[Any]): FILE: utils/device.py function to_device (line 6) | def to_device(x: Union[Tensor, nn.Module, list, tuple, dict], device: st... function to_cuda (line 21) | def to_cuda(x: Union[Tensor, list, tuple, dict, nn.Module]) -> \ FILE: utils/experiment.py function _load (line 10) | def _load(file_address: str) -> int: function _save (line 21) | def _save(file_address: str, cur: int): function get_exp_no (line 26) | def get_exp_no() -> int: function _two_digits (line 33) | def _two_digits(cur: str) -> str: function _time (line 37) | def _time(): function _get_exp_name (line 43) | def _get_exp_name() -> str: function _fancy_print (line 56) | def _fancy_print(): function _fix_random_seed (line 60) | def _fix_random_seed(seed: int = 6247423): function exp_starter_pack (line 70) | def exp_starter_pack() -> (str, Namespace, dict): FILE: utils/iterators.py class ItemIterator (line 1) | class ItemIterator: method iterator_item (line 3) | def iterator_item(self): method __iter__ (line 6) | def __iter__(self): method __getitem__ (line 9) | def __getitem__(self, item): method __len__ (line 12) | def __len__(self): FILE: utils/jasper/metrics.py function __levenshtein (line 4) | def __levenshtein(a: List, b: List) -> int: function word_error_rate (line 26) | def word_error_rate(hypotheses: List[str], references: List[str]) -> (fl... FILE: utils/jasper/translator.py class Translator (line 7) | class Translator: method __init__ (line 8) | def __init__(self, converter: Manifest): method __call__ (line 12) | def __call__(self, prediction: torch.Tensor, length: torch.Tensor) -> ... FILE: utils/jasper_iterator.py function layer_range (line 6) | def layer_range(stop=-1): function feature_range (line 13) | def feature_range(layer: int, stop=-1): FILE: utils/log.py function _convert_form (line 4) | def _convert_form(f): function j_print (line 11) | def j_print(*args, file=None): function j_header (line 16) | def j_header(*args, file=None): FILE: utils/pickle.py function load_pickle (line 4) | def load_pickle(file_name: str) -> list: FILE: utils/regularizers.py function get_tv (line 4) | def get_tv(t: torch.Tensor) -> torch.Tensor: function get_shadow_tv (line 13) | def get_shadow_tv(t: torch.Tensor) -> torch.Tensor: FILE: utils/statistics.py class Meter (line 1) | class Meter: method __init__ (line 2) | def __init__(self): method reset (line 6) | def reset(self): method __add__ (line 9) | def __add__(self, other: (float, float)): method value (line 15) | def value(self) -> float: FILE: utils/training.py function save_model (line 5) | def save_model(model: torch.nn.Module, exp_name: str, epoch: int, root: ... function load_model (line 12) | def load_model(model: torch.nn.Module, checkpoint: str, root='checkpoint... FILE: visualize.py function visualize_feature (line 16) | def visualize_feature(layer, feature):