SYMBOL INDEX (1793 symbols across 247 files) FILE: code/ASR/Adapter/balanced_sampler.py class BalancedBatchSampler (line 11) | class BalancedBatchSampler(torch.utils.data.sampler.Sampler): method __init__ (line 15) | def __init__(self, dataset, labels=None): method __iter__ (line 36) | def __iter__(self): method _get_label (line 43) | def _get_label(self, dataset, idx): method __len__ (line 53) | def __len__(self): FILE: code/ASR/Adapter/data_load.py function read_json_file (line 33) | def read_json_file(fname): function load_json (line 37) | def load_json(train_json_file, dev_json_file, test_json_file): function load_data (line 60) | def load_data(root_path, dataset, args): function load_multilingual_data (line 184) | def load_multilingual_data(root_path, datasets, args, languages): function load_token_list (line 348) | def load_token_list(token_file): function load_bpemodel (line 355) | def load_bpemodel(root_path, dataset): FILE: code/ASR/Adapter/e2e_asr_adaptertransformer.py class SimAdapter (line 38) | class SimAdapter(MultiHeadedAttention): method __init__ (line 39) | def __init__(self, n_feat, dropout_rate, fusion_languages=None, num_sh... method forward_qkv (line 54) | def forward_qkv(self, query, key, value): method forward_attention (line 60) | def forward_attention(self, value, scores): method forward (line 68) | def forward(self, query, key, value, residual=None): class Adapter (line 79) | class Adapter(torch.nn.Module): method __init__ (line 80) | def __init__(self, adapter_dim, embed_dim): method forward (line 86) | def forward(self, z): class CustomEncoderLayer (line 90) | class CustomEncoderLayer(EncoderLayer): method forward (line 91) | def forward(self, x, mask, cache=None): class AdaptiveEncoderLayer (line 119) | class AdaptiveEncoderLayer(CustomEncoderLayer): method __init__ (line 120) | def __init__( method forward (line 154) | def forward(self, x, mask, language, cache=None, use_sim_adapter=True): class AdaptiveEncoder (line 177) | class AdaptiveEncoder(Encoder): method __init__ (line 178) | def __init__( method forward (line 252) | def forward(self, xs, masks, language, use_sim_adapter=True): class CustomDecoderLayer (line 258) | class CustomDecoderLayer(DecoderLayer): method forward (line 259) | def forward(self, tgt, tgt_mask, memory, memory_mask, cache=None): class AdaptiveDecoderLayer (line 309) | class AdaptiveDecoderLayer(CustomDecoderLayer): method __init__ (line 310) | def __init__( method forward (line 346) | def forward(self, tgt, tgt_mask, memory, memory_mask, language, cache=... class AdaptiveDecoder (line 369) | class AdaptiveDecoder(Decoder): method __init__ (line 370) | def __init__( method forward (line 454) | def forward(self, tgt, tgt_mask, memory, memory_mask, language, use_si... method forward_one_step (line 464) | def forward_one_step(self, tgt, tgt_mask, memory, memory_mask, languag... class E2E (line 482) | class E2E(E2ETransformer): method __init__ (line 483) | def __init__(self, idim, odim_dict, args, languages, ignore_id=-1): method reset_sim_adapter_parameters (line 584) | def reset_sim_adapter_parameters(self): method enable_sim_adapter_training (line 594) | def enable_sim_adapter_training(self): method get_fusion_guide_loss (line 605) | def get_fusion_guide_loss(self, language): method get_fusion_regularization_loss (line 625) | def get_fusion_regularization_loss(self): method enable_adapter_training (line 637) | def enable_adapter_training(self, specified_languages=None, shared_ada... method forward (line 661) | def forward(self, xs_pad, ilens, ys_pad, language, use_sim_adapter=True): method calculate_all_ctc_probs (line 740) | def calculate_all_ctc_probs(self, xs_pad, ilens, ys_pad, language): method calculate_all_attentions (line 761) | def calculate_all_attentions(self, xs_pad, ilens, ys_pad, language): method calculate_sim_adapter_attentions (line 786) | def calculate_sim_adapter_attentions(self, xs_pad, ilens, ys_pad, lang... method encode (line 800) | def encode(self, x, language): method set_recognize_language_branch (line 806) | def set_recognize_language_branch(self, language): method recognize_batch (line 808) | def recognize_batch(self, xs, recog_args, char_list=None, rnnlm=None, ... FILE: code/ASR/Adapter/train.py function add_custom_arguments (line 26) | def add_custom_arguments(parser): function train_epoch (line 69) | def train_epoch(dataloader, model, optimizer, epoch=None): function train_maml_epoch (line 129) | def train_maml_epoch(dataloader, model, optimizer, epoch=None): function test (line 205) | def test(epoch, dataloader, model, model_path=None, language=None, visua... function train (line 272) | def train(dataloaders, model, optimizer, save_path): FILE: code/ASR/Adapter/utils.py function load_head_from_pretrained_model (line 10) | def load_head_from_pretrained_model(model, model_path): function load_adapter_from_pretrained_model (line 22) | def load_adapter_from_pretrained_model(model, model_path, src_adapter, t... function str2bool (line 39) | def str2bool(str): function setup_logging (line 41) | def setup_logging(verbose=1): function dict_average (line 55) | def dict_average(dic): function load_pretrained_model (line 66) | def load_pretrained_model(model, model_path, modules_to_load=None, exclu... function torch_save (line 86) | def torch_save(model, save_path, optimizer=None, local_rank=0): function torch_load (line 94) | def torch_load(snapshot_path, model, optimizer=None): function compute_wer (line 109) | def compute_wer(ref, hyp, normalize=False): function token2text (line 194) | def token2text(tokens, bpemodel=None): function recognize_and_evaluate (line 204) | def recognize_and_evaluate(dataloader, model, args, model_path=None, wer... FILE: code/ASR/CMatch/ctc_aligner.py function np2tensor (line 12) | def np2tensor(array, device=None): function pad_list (line 21) | def pad_list(xs, pad_value=0., pad_left=False): class CTCForcedAligner (line 41) | class CTCForcedAligner(object): method __init__ (line 42) | def __init__(self, blank=0, char_list=None): method __call__ (line 46) | def __call__(self, logits, elens, ys): method align (line 69) | def align(self, log_probs, elens, ys, ylens, add_eos=True): function _flip_label_probability (line 177) | def _flip_label_probability(log_probs, xlens): function _flip_path_probability (line 197) | def _flip_path_probability(cum_log_prob, xlens, path_lens): function _computes_transition (line 219) | def _computes_transition(seq_log_prob, same_transition, outside, function make_pad_mask (line 236) | def make_pad_mask(seq_lens): function _label_to_path (line 250) | def _label_to_path(labels, blank): function _flip_path (line 254) | def _flip_path(path, path_lens): FILE: code/ASR/CMatch/data_load.py function read_json_file (line 118) | def read_json_file(fname): function load_json (line 124) | def load_json(train_json_file, dev_json_file, test_json_file): function load_data (line 149) | def load_data(root_path, dataset, args, function load_token_list (line 287) | def load_token_list(token_file): function load_bpemodel (line 295) | def load_bpemodel(root_path, dataset): FILE: code/ASR/CMatch/distances.py function CORAL (line 3) | def CORAL(source, target): class MMD_loss (line 22) | class MMD_loss(torch.nn.Module): method __init__ (line 23) | def __init__(self, kernel_type='rbf', kernel_mul=2.0, kernel_num=5): method guassian_kernel (line 30) | def guassian_kernel(self, source, target, kernel_mul=2.0, kernel_num=5... method linear_mmd2 (line 49) | def linear_mmd2(self, f_of_X, f_of_Y): method forward (line 55) | def forward(self, source, target): FILE: code/ASR/CMatch/e2e_asr_udatransformer.py function adapt_loss (line 13) | def adapt_loss(source, target, adapt_loss="mmd"): class Discriminator (line 26) | class Discriminator(torch.nn.Module): method __init__ (line 27) | def __init__(self, input_dim=256, hidden_dim=256): method forward (line 34) | def forward(self, x): class ReverseLayerF (line 40) | class ReverseLayerF(torch.autograd.Function): method forward (line 42) | def forward(ctx, x, alpha): method backward (line 46) | def backward(ctx, grad_output): class CustomEncoderLayer (line 50) | class CustomEncoderLayer(EncoderLayer): method forward (line 51) | def forward(self, x, mask, cache=None): class CustomEncoder (line 83) | class CustomEncoder(Encoder): method __init__ (line 84) | def __init__( method forward (line 152) | def forward(self, xs, masks, return_repr=False): class CustomDecoderLayer (line 176) | class CustomDecoderLayer(DecoderLayer): method forward (line 177) | def forward(self, tgt, tgt_mask, memory, memory_mask, cache=None): class CustomDecoder (line 246) | class CustomDecoder(Decoder): method __init__ (line 247) | def __init__( method forward (line 310) | def forward(self, tgt, tgt_mask, memory, memory_mask, return_repr=False): class CustomSpeechTransformer (line 349) | class CustomSpeechTransformer(SpeechTransformer): method __init__ (line 350) | def __init__(self, *args, **kwargs): class UDASpeechTransformer (line 384) | class UDASpeechTransformer(CustomSpeechTransformer): method __init__ (line 385) | def __init__(self, *args, **kwargs): method forward (line 410) | def forward(self, method adversarial_loss (line 605) | def adversarial_loss(self, src_hs_pad, tgt_hs_pad, alpha=1.0): method get_enc_repr (line 620) | def get_enc_repr(self, method cmatch_loss_func (line 678) | def cmatch_loss_func(self, n_classes, FILE: code/ASR/CMatch/train.py function add_custom_arguments (line 24) | def add_custom_arguments(parser): function test (line 68) | def test(dataloader, model, model_path=None): function train (line 90) | def train(dataloaders, model, optimizer, save_path): function train_epoch (line 130) | def train_epoch(dataloader, model, optimizer, epoch=None): function train_uda_epoch (line 160) | def train_uda_epoch(train_loaders, model, optimizer, epoch): FILE: code/ASR/CMatch/utils.py function str2bool (line 9) | def str2bool(str): function setup_logging (line 12) | def setup_logging(verbose=1): function dict_average (line 26) | def dict_average(dic): function load_pretrained_model (line 37) | def load_pretrained_model(model, model_path, modules_to_load=None, exclu... function torch_save (line 57) | def torch_save(model, save_path, optimizer=None, local_rank=0): function torch_load (line 65) | def torch_load(snapshot_path, model, optimizer=None): function compute_wer (line 80) | def compute_wer(ref, hyp, normalize=False): function recognize_and_evaluate (line 164) | def recognize_and_evaluate(dataloader, model, args, model_path=None, wer... FILE: code/DeepDA/backbones.py function get_backbone (line 12) | def get_backbone(name): class DaNNBackbone (line 20) | class DaNNBackbone(nn.Module): method __init__ (line 21) | def __init__(self, n_input=224*224*3, n_hidden=256): method forward (line 28) | def forward(self, x): method output_num (line 35) | def output_num(self): class AlexNetBackbone (line 39) | class AlexNetBackbone(nn.Module): method __init__ (line 40) | def __init__(self): method forward (line 50) | def forward(self, x): method output_num (line 56) | def output_num(self): class ResNetBackbone (line 59) | class ResNetBackbone(nn.Module): method __init__ (line 60) | def __init__(self, network_type): method forward (line 75) | def forward(self, x): method output_num (line 88) | def output_num(self): FILE: code/DeepDA/data_loader.py function load_data (line 4) | def load_data(data_folder, batch_size, train, num_workers=0, **kwargs): function get_data_loader (line 27) | def get_data_loader(dataset, batch_size, shuffle=True, drop_last=False, ... class _InfiniteSampler (line 33) | class _InfiniteSampler(torch.utils.data.Sampler): method __init__ (line 35) | def __init__(self, sampler): method __iter__ (line 38) | def __iter__(self): class InfiniteDataLoader (line 43) | class InfiniteDataLoader: method __init__ (line 44) | def __init__(self, dataset, batch_size, shuffle=True, drop_last=False,... method __iter__ (line 64) | def __iter__(self): method __len__ (line 68) | def __len__(self): FILE: code/DeepDA/loss_funcs/adv.py class LambdaSheduler (line 7) | class LambdaSheduler(nn.Module): method __init__ (line 8) | def __init__(self, gamma=1.0, max_iter=1000, **kwargs): method lamb (line 14) | def lamb(self): method step (line 19) | def step(self): class AdversarialLoss (line 22) | class AdversarialLoss(nn.Module): method __init__ (line 26) | def __init__(self, gamma=1.0, max_iter=1000, use_lambda_scheduler=True... method forward (line 33) | def forward(self, source, target): method get_adversarial_result (line 43) | def get_adversarial_result(self, x, source=True, lamb=1.0): class ReverseLayerF (line 56) | class ReverseLayerF(Function): method forward (line 58) | def forward(ctx, x, alpha): method backward (line 63) | def backward(ctx, grad_output): class Discriminator (line 67) | class Discriminator(nn.Module): method __init__ (line 68) | def __init__(self, input_dim=256, hidden_dim=256): method forward (line 84) | def forward(self, x): FILE: code/DeepDA/loss_funcs/bnm.py function BNM (line 3) | def BNM(src, tar): FILE: code/DeepDA/loss_funcs/coral.py function CORAL (line 4) | def CORAL(source, target, **kwargs): FILE: code/DeepDA/loss_funcs/daan.py class DAANLoss (line 3) | class DAANLoss(AdversarialLoss, LambdaSheduler): method __init__ (line 4) | def __init__(self, num_class, gamma=1.0, max_iter=1000, **kwargs): method forward (line 14) | def forward(self, source, target, source_logits, target_logits): method get_local_adversarial_result (line 30) | def get_local_adversarial_result(self, x, logits, c, source=True, lamb... method update_dynamic_factor (line 47) | def update_dynamic_factor(self, epoch_length): FILE: code/DeepDA/loss_funcs/lmmd.py class LMMDLoss (line 6) | class LMMDLoss(MMDLoss, LambdaSheduler): method __init__ (line 7) | def __init__(self, num_class, kernel_type='rbf', kernel_mul=2.0, kerne... method forward (line 16) | def forward(self, source, target, source_label, target_logits): method cal_weight (line 43) | def cal_weight(self, source_label, target_logits): FILE: code/DeepDA/loss_funcs/mmd.py class MMDLoss (line 4) | class MMDLoss(nn.Module): method __init__ (line 5) | def __init__(self, kernel_type='rbf', kernel_mul=2.0, kernel_num=5, fi... method guassian_kernel (line 12) | def guassian_kernel(self, source, target, kernel_mul, kernel_num, fix_... method linear_mmd2 (line 31) | def linear_mmd2(self, f_of_X, f_of_Y): method forward (line 37) | def forward(self, source, target): FILE: code/DeepDA/main.py function get_parser (line 11) | def get_parser(): function set_random_seed (line 54) | def set_random_seed(seed=0): function load_data (line 63) | def load_data(args): function get_model (line 77) | def get_model(args): function get_optimizer (line 82) | def get_optimizer(model, args): function get_scheduler (line 88) | def get_scheduler(optimizer, args): function test (line 92) | def test(model, target_test_loader, args): function train (line 109) | def train(source_loader, target_train_loader, target_test_loader, model,... function main (line 171) | def main(): FILE: code/DeepDA/models.py class TransferNet (line 7) | class TransferNet(nn.Module): method __init__ (line 8) | def __init__(self, num_class, base_net='resnet50', transfer_loss='mmd'... method forward (line 33) | def forward(self, source, target, source_label): method get_parameters (line 60) | def get_parameters(self, initial_lr=1.0): method predict (line 83) | def predict(self, x): method epoch_based_processing (line 90) | def epoch_based_processing(self, *args, **kwargs): FILE: code/DeepDA/transfer_losses.py class TransferLoss (line 5) | class TransferLoss(nn.Module): method __init__ (line 6) | def __init__(self, loss_type, **kwargs): method forward (line 25) | def forward(self, source, target, **kwargs): FILE: code/DeepDA/utils.py class AverageMeter (line 1) | class AverageMeter(object): method __init__ (line 4) | def __init__(self): method reset (line 7) | def reset(self): method update (line 13) | def update(self, val, n=1): function str2bool (line 19) | def str2bool(v): FILE: code/DeepDG/alg/alg.py function get_algorithm_class (line 29) | def get_algorithm_class(algorithm_name): FILE: code/DeepDG/alg/algs/ANDMask.py class ANDMask (line 8) | class ANDMask(ERM): method __init__ (line 9) | def __init__(self, args): method update (line 14) | def update(self, minibatches, opt, sch): method mask_grads (line 44) | def mask_grads(self, tau, gradients, params): FILE: code/DeepDG/alg/algs/CORAL.py class CORAL (line 7) | class CORAL(ERM): method __init__ (line 8) | def __init__(self, args): method coral (line 13) | def coral(self, x, y): method update (line 26) | def update(self, minibatches, opt, sch): FILE: code/DeepDG/alg/algs/DANN.py class DANN (line 11) | class DANN(Algorithm): method __init__ (line 13) | def __init__(self, args): method update (line 24) | def update(self, minibatches, opt, sch): method predict (line 50) | def predict(self, x): FILE: code/DeepDG/alg/algs/DIFEX.py class DIFEX (line 12) | class DIFEX(Algorithm): method __init__ (line 13) | def __init__(self, args): method teanettrain (line 35) | def teanettrain(self, dataloaders, epochs, opt1, sch1): method coral (line 58) | def coral(self, x, y): method update (line 71) | def update(self, minibatches, opt, sch): method predict (line 115) | def predict(self, x): FILE: code/DeepDG/alg/algs/ERM.py class ERM (line 11) | class ERM(Algorithm): method __init__ (line 16) | def __init__(self, args): method update (line 25) | def update(self, minibatches, opt, sch): method predict (line 37) | def predict(self, x): FILE: code/DeepDG/alg/algs/GroupDRO.py class GroupDRO (line 6) | class GroupDRO(ERM): method __init__ (line 11) | def __init__(self,args): method update (line 16) | def update(self, minibatches, opt,sch): FILE: code/DeepDG/alg/algs/MLDG.py class MLDG (line 12) | class MLDG(ERM): method __init__ (line 13) | def __init__(self, args): method update (line 17) | def update(self, minibatches, opt, sch): FILE: code/DeepDG/alg/algs/MMD.py class MMD (line 8) | class MMD(ERM): method __init__ (line 9) | def __init__(self, args): method my_cdist (line 14) | def my_cdist(self, x1, x2): method gaussian_kernel (line 22) | def gaussian_kernel(self, x, y, gamma=[0.001, 0.01, 0.1, 1, 10, 100, method mmd (line 32) | def mmd(self, x, y): method update (line 38) | def update(self, minibatches, opt, sch): FILE: code/DeepDG/alg/algs/Mixup.py class Mixup (line 9) | class Mixup(ERM): method __init__ (line 10) | def __init__(self, args): method update (line 14) | def update(self, minibatches, opt, sch): FILE: code/DeepDG/alg/algs/RSC.py class RSC (line 10) | class RSC(ERM): method __init__ (line 11) | def __init__(self, args): method update (line 17) | def update(self, minibatches, opt, sch): FILE: code/DeepDG/alg/algs/VREx.py class VREx (line 7) | class VREx(ERM): method __init__ (line 10) | def __init__(self, args): method update (line 15) | def update(self, minibatches, opt, sch): FILE: code/DeepDG/alg/algs/base.py class Algorithm (line 5) | class Algorithm(torch.nn.Module): method __init__ (line 7) | def __init__(self, args): method update (line 10) | def update(self, minibatches, opt, sch): method predict (line 13) | def predict(self, x): FILE: code/DeepDG/alg/modelopera.py function get_fea (line 6) | def get_fea(args): function accuracy (line 16) | def accuracy(network, loader): FILE: code/DeepDG/alg/opt.py function get_params (line 5) | def get_params(alg, args, inner=False, alias=True, isteacher=False): function get_optimizer (line 49) | def get_optimizer(alg, args, inner=False, alias=True, isteacher=False): function get_scheduler (line 56) | def get_scheduler(optimizer, args): FILE: code/DeepDG/datautil/getdataloader.py function get_img_dataloader (line 11) | def get_img_dataloader(args): FILE: code/DeepDG/datautil/imgdata/imgdataload.py class ImageDataset (line 10) | class ImageDataset(object): method __init__ (line 11) | def __init__(self, dataset, task, root_dir, domain_name, domain_label=... method set_labels (line 35) | def set_labels(self, tlabels=None, label_type='domain_label'): method target_trans (line 42) | def target_trans(self, y): method input_trans (line 48) | def input_trans(self, x): method __getitem__ (line 54) | def __getitem__(self, index): method __len__ (line 61) | def __len__(self): FILE: code/DeepDG/datautil/imgdata/util.py function image_train (line 7) | def image_train(dataset, resize_size=256, crop_size=224): function image_test (line 28) | def image_test(dataset, resize_size=256, crop_size=224): function rgb_loader (line 45) | def rgb_loader(path): function l_loader (line 51) | def l_loader(path): FILE: code/DeepDG/datautil/mydataloader.py class _InfiniteSampler (line 6) | class _InfiniteSampler(torch.utils.data.Sampler): method __init__ (line 9) | def __init__(self, sampler): method __iter__ (line 12) | def __iter__(self): class InfiniteDataLoader (line 18) | class InfiniteDataLoader: method __init__ (line 19) | def __init__(self, dataset, weights, batch_size, num_workers): method __iter__ (line 44) | def __iter__(self): method __len__ (line 48) | def __len__(self): FILE: code/DeepDG/datautil/util.py function Nmax (line 6) | def Nmax(test_envs, d): function random_pairs_of_minibatches_by_domainperm (line 13) | def random_pairs_of_minibatches_by_domainperm(minibatches): function random_pairs_of_minibatches (line 30) | def random_pairs_of_minibatches(args, minibatches): FILE: code/DeepDG/network/Adver_network.py class ReverseLayerF (line 6) | class ReverseLayerF(Function): method forward (line 8) | def forward(ctx, x, alpha): method backward (line 13) | def backward(ctx, grad_output): class Discriminator (line 18) | class Discriminator(nn.Module): method __init__ (line 19) | def __init__(self, input_dim=256, hidden_dim=256, num_domains=4): method forward (line 34) | def forward(self, x): FILE: code/DeepDG/network/common_network.py class feat_bottleneck (line 7) | class feat_bottleneck(nn.Module): method __init__ (line 8) | def __init__(self, feature_dim, bottleneck_dim=256, type="ori"): method forward (line 17) | def forward(self, x): class feat_classifier (line 24) | class feat_classifier(nn.Module): method __init__ (line 25) | def __init__(self, class_num, bottleneck_dim=256, type="linear"): method forward (line 36) | def forward(self, x): class feat_classifier_two (line 41) | class feat_classifier_two(nn.Module): method __init__ (line 42) | def __init__(self, class_num, input_dim, bottleneck_dim=256): method forward (line 50) | def forward(self, x): FILE: code/DeepDG/network/img_network.py class VGGBase (line 9) | class VGGBase(nn.Module): method __init__ (line 10) | def __init__(self, vgg_name): method forward (line 20) | def forward(self, x): class ResBase (line 31) | class ResBase(nn.Module): method __init__ (line 32) | def __init__(self, res_name): method forward (line 46) | def forward(self, x): class DTNBase (line 60) | class DTNBase(nn.Module): method __init__ (line 61) | def __init__(self): method forward (line 79) | def forward(self, x): class LeNetBase (line 85) | class LeNetBase(nn.Module): method __init__ (line 86) | def __init__(self): method forward (line 99) | def forward(self, x): FILE: code/DeepDG/network/util.py function calc_coeff (line 6) | def calc_coeff(iter_num, high=1.0, low=0.0, alpha=10.0, max_iter=10000.0): function init_weights (line 10) | def init_weights(m): FILE: code/DeepDG/train.py function get_args (line 15) | def get_args(): FILE: code/DeepDG/utils/util.py function set_random_seed (line 11) | def set_random_seed(seed=0): function save_checkpoint (line 21) | def save_checkpoint(filename, alg, args): function train_valid_target_eval_names (line 29) | def train_valid_target_eval_names(args): function alg_loss_dict (line 45) | def alg_loss_dict(args): function print_args (line 61) | def print_args(args, print_list): function print_environ (line 70) | def print_environ(): class Tee (line 81) | class Tee: method __init__ (line 82) | def __init__(self, fname, mode="a"): method write (line 86) | def write(self, message): method flush (line 91) | def flush(self): function img_param_init (line 96) | def img_param_init(args): FILE: code/clip/clip_model.py class ClipModel (line 14) | class ClipModel(object): method __init__ (line 28) | def __init__(self, model_name='Vit-B/32', device='cuda', logger=None): method index_to_model (line 39) | def index_to_model(self, index): method get_model_name_by_index (line 43) | def get_model_name_by_index(index): method get_image_features (line 48) | def get_image_features(self, image, need_preprocess=False): method get_text_feature (line 55) | def get_text_feature(self, text): method get_text_features_list (line 61) | def get_text_features_list(self, texts, train=False): method get_similarity (line 74) | def get_similarity(self, image_features, text_features): method get_topk (line 80) | def get_topk(self, image, text, k=1): method feature_extraction (line 85) | def feature_extraction(self, dataloader): method finetune (line 101) | def finetune(self, dataloader, testloader, optimizer, nepochs=10, save... method evaluate (line 138) | def evaluate(self, dataloader, modelpath=None): FILE: code/clip/data/data_loader.py class ImageTextData (line 10) | class ImageTextData(object): method __init__ (line 12) | def __init__(self, dataset, root, preprocess, prompt='a picture of a'): method __getitem__ (line 32) | def __getitem__(self, index): method __len__ (line 39) | def __len__(self): method get_data_name_by_index (line 43) | def get_data_name_by_index(index): FILE: code/clip/data/download_data.py function stage_path (line 20) | def stage_path(data_dir, name): function download_and_extract (line 29) | def download_and_extract(url, dst, remove=True): function download_vlcs (line 97) | def download_vlcs(data_dir): function download_mnist (line 107) | def download_mnist(data_dir): function download_pacs (line 115) | def download_pacs(data_dir): function download_office_home (line 128) | def download_office_home(data_dir): function download_domain_net (line 141) | def download_domain_net(data_dir): function download_terra_incognita (line 167) | def download_terra_incognita(data_dir): function download_sviro (line 250) | def download_sviro(data_dir): FILE: code/clip/data/download_data_azcopy.py function get_args (line 19) | def get_args(): FILE: code/clip/main.py function get_args (line 12) | def get_args(): function main (line 35) | def main(args): function sweep_index (line 71) | def sweep_index(model=-1, data=-1): function sweep (line 87) | def sweep(model=-1, data=-1): FILE: code/clip/test_clip.py function get_args (line 44) | def get_args(): function load_data (line 52) | def load_data(dataset): function load_model (line 73) | def load_model(modelname): function classify_imagenetr (line 79) | def classify_imagenetr(imagenet_r, imagenetr_labels, model, preprocess, ... function perform_inference (line 105) | def perform_inference(model_index, data_index): function gather_res (line 121) | def gather_res(mid): function test (line 132) | def test(): function sweep (line 142) | def sweep(): FILE: code/clip/utils.py function load_csv (line 7) | def load_csv(folder, src_domain, tar_domain): function kernel (line 14) | def kernel(ker, X1, X2, gamma): function set_seed (line 35) | def set_seed(seed): function set_gpu (line 43) | def set_gpu(gpuid): function get_logger (line 47) | def get_logger(logger_name, log_file, level=logging.INFO): function gather_res (line 61) | def gather_res(model_name_lst, data_name_lst): function convert_models_to_fp32 (line 73) | def convert_models_to_fp32(model): FILE: code/deep/B-JMMD/caffe/include/caffe/layers/bjmmd_layer.hpp type caffe (line 12) | namespace caffe { class BJMMDLossLayer (line 15) | class BJMMDLossLayer : public LossLayer { method BJMMDLossLayer (line 17) | explicit BJMMDLossLayer(const LayerParameter& param) method ExactNumTopBlobs (line 25) | virtual inline int ExactNumTopBlobs() const { return -1; } method ExactNumBottomBlobs (line 26) | virtual inline int ExactNumBottomBlobs() const { return -1; } method MinBottomBlobs (line 27) | virtual inline int MinBottomBlobs() const { return 2; } method MaxBottomBlobs (line 28) | virtual inline int MaxBottomBlobs() const { return 4; } FILE: code/deep/B-JMMD/caffe/src/caffe/layers/bjmmd_layer.cpp type caffe (line 5) | namespace caffe { FILE: code/deep/CSG/a-domainbed/main.py class MergeIters (line 17) | class MergeIters: method __init__ (line 18) | def __init__(self, *itrs): method __iter__ (line 23) | def __iter__(self): method __len__ (line 27) | def __len__(self): return self.len FILE: code/deep/CSG/a-domainbed/visual.py class MergeIters (line 36) | class MergeIters: method __init__ (line 37) | def __init__(self, *itrs): method __iter__ (line 42) | def __iter__(self): method __len__ (line 46) | def __len__(self): return self.len function get_input_transform (line 48) | def get_input_transform(): function get_visual (line 59) | def get_visual(ag, ckpt, archtype, shape_x, dim_y, FILE: code/deep/CSG/a-imageclef/visual.py function get_input_transform (line 32) | def get_input_transform(): function get_visual (line 43) | def get_visual(ag, ckpt, archtype, shape_x, dim_y, FILE: code/deep/CSG/a-mnist/makedata.py function select_xy (line 12) | def select_xy(dataset, selected_y = (0,1), piltransf = None, ytransf = N... function get_shift_transf (line 20) | def get_shift_transf(pleft: list, distr: str, loc: float, scale: float): FILE: code/deep/CSG/arch/backbone.py class AlexNetFc (line 12) | class AlexNetFc(nn.Module): method __init__ (line 13) | def __init__(self): method forward (line 22) | def forward(self, x): method output_num (line 28) | def output_num(self): class ResNet18Fc (line 32) | class ResNet18Fc(nn.Module): method __init__ (line 33) | def __init__(self): method forward (line 47) | def forward(self, x): method output_num (line 60) | def output_num(self): class ResNet34Fc (line 64) | class ResNet34Fc(nn.Module): method __init__ (line 65) | def __init__(self): method forward (line 79) | def forward(self, x): method output_num (line 92) | def output_num(self): class ResNet50Fc (line 96) | class ResNet50Fc(nn.Module): method __init__ (line 97) | def __init__(self): method forward (line 111) | def forward(self, x): method output_num (line 124) | def output_num(self): class ResNet101Fc (line 128) | class ResNet101Fc(nn.Module): method __init__ (line 129) | def __init__(self): method forward (line 143) | def forward(self, x): method output_num (line 156) | def output_num(self): class ResNet152Fc (line 160) | class ResNet152Fc(nn.Module): method __init__ (line 161) | def __init__(self): method forward (line 175) | def forward(self, x): method output_num (line 188) | def output_num(self): FILE: code/deep/CSG/arch/cnn.py function init_linear (line 27) | def init_linear(nnseq, wmean, wstd, bval): class CNNsvy1x (line 34) | class CNNsvy1x(nn.Module): method __init__ (line 35) | def __init__(self, backbone_stru: str, dim_bottleneck: int, dim_s: int... method _get_bb (line 158) | def _get_bb(self, x): method _get_bn (line 164) | def _get_bn(self, x): method v1x (line 170) | def v1x(self, x): method std_v1x (line 174) | def std_v1x(self, x): method s1vx (line 181) | def s1vx(self, v, x): method std_s1vx (line 188) | def std_s1vx(self, v, x): method s1x (line 199) | def s1x(self, x): method std_s1x (line 201) | def std_s1x(self, x): method y1s (line 207) | def y1s(self, s): method ys1x (line 210) | def ys1x(self, x): method forward (line 214) | def forward(self, x): method parameter_groups (line 217) | def parameter_groups(self): method save (line 220) | def save(self, path): tc.save(self.state_dict(), path) method load (line 221) | def load(self, path): function weights_init (line 226) | def weights_init(m): class CNN_DCGANvar_224 (line 235) | class CNN_DCGANvar_224(nn.Module): method __init__ (line 237) | def __init__(self, dim_in, dim_feat, dim_chanl = 3): method forward (line 266) | def forward(self, val): class CNN_DCGANpretr_224 (line 270) | class CNN_DCGANpretr_224(nn.Module): method __init__ (line 271) | def __init__(self, dim_in, dim_feat = None, dim_chanl = None): method forward (line 298) | def forward(self, val): method parameter_groups (line 302) | def parameter_groups(self): class CNN_PGANpretr_224 (line 305) | class CNN_PGANpretr_224(nn.Module): method __init__ (line 306) | def __init__(self, dim_in, dim_feat = None, dim_chanl = None): method forward (line 326) | def forward(self, val): method parameter_groups (line 330) | def parameter_groups(self): class CNNx1sv (line 334) | class CNNx1sv(nn.Module): method __init__ (line 335) | def __init__(self, dim_xside: int, dim_s: int, dim_v: int, dim_feat: i... method x1sv (line 340) | def x1sv(self, s, v): method forward (line 342) | def forward(self, s, v): return self.x1sv(s, v) method parameter_groups (line 343) | def parameter_groups(self): method save (line 346) | def save(self, path): tc.save(self.state_dict(), path) method load (line 347) | def load(self, path): class CNNx1s (line 351) | class CNNx1s(nn.Module): method __init__ (line 352) | def __init__(self, dim_xside: int, dim_s: int, dim_feat: int, dectype:... method x1s (line 357) | def x1s(self, s): return self.net(s) method forward (line 358) | def forward(self, s): return self.x1s(s) method parameter_groups (line 359) | def parameter_groups(self): method save (line 362) | def save(self, path): tc.save(self.state_dict(), path) method load (line 363) | def load(self, path): FILE: code/deep/CSG/arch/mlp.py function init_linear (line 16) | def init_linear(nnseq, wmean, wstd, bval): function mlp_constructor (line 22) | def mlp_constructor(dims, actv = "Sigmoid", lastactv = True): # `Sequent... class MLPBase (line 30) | class MLPBase(nn.Module): method save (line 31) | def save(self, path): tc.save(self.state_dict(), path) method load (line 32) | def load(self, path): method load_or_save (line 35) | def load_or_save(self, filename): class MLP (line 42) | class MLP(MLPBase): method __init__ (line 43) | def __init__(self, dims, actv = "Sigmoid"): method forward (line 47) | def forward(self, x): return self.f_x2y(x).squeeze(-1) class MLPsvy1x (line 49) | class MLPsvy1x(MLPBase): method __init__ (line 50) | def __init__(self, dim_x, dims_postx2prev, dim_v, dim_parav, dims_post... method _get_prev (line 109) | def _get_prev(self, x): method v1x (line 115) | def v1x(self, x): method std_v1x (line 120) | def std_v1x(self, x): method _get_parav (line 126) | def _get_parav(self, x): method s1vx (line 132) | def s1vx(self, v, x): method std_s1vx (line 135) | def std_s1vx(self, v, x): method s1x (line 142) | def s1x(self, x): method std_s1x (line 144) | def std_s1x(self, x): method y1s (line 147) | def y1s(self, s): method ys1x (line 150) | def ys1x(self, x): method forward (line 154) | def forward(self, x): class MLPx1sv (line 157) | class MLPx1sv(MLPBase): method __init__ (line 158) | def __init__(self, dim_s = None, dims_pres2parav = None, dim_v = None,... method x1sv (line 173) | def x1sv(self, s, v): return self.f_vparav2x(tc.cat([v, self.f_s2parav... method forward (line 174) | def forward(self, s, v): return self.x1sv(s, v) class MLPx1s (line 176) | class MLPx1s(MLPBase): method __init__ (line 177) | def __init__(self, dim_s = None, dims_pres2postx = None, dim_x = None, method x1s (line 189) | def x1s(self, s): return self.f_s2x(s) method forward (line 190) | def forward(self, s): return self.x1s(s) class MLPv1s (line 192) | class MLPv1s(MLPBase): method __init__ (line 193) | def __init__(self, dim_s = None, dims_pres2postv = None, dim_v = None, method v1s (line 204) | def v1s(self, s): return self.f_s2v(s) method forward (line 205) | def forward(self, s): return self.v1s(s) function create_discr_from_json (line 207) | def create_discr_from_json(stru_name: str, dim_x: int, dim_y: int, actv:... function create_gen_from_json (line 214) | def create_gen_from_json(model_type: str="MLPx1sv", discr: MLPsvy1x=None... FILE: code/deep/CSG/distr/base.py class Distr (line 18) | class Distr: method all_names (line 27) | def all_names() -> set: return set(Distr._shapes_all_vars) method clear (line 29) | def clear(): Distr._shapes_all_vars.clear() method has_name (line 31) | def has_name(name: str) -> bool: return name in Distr._shapes_all_vars method has_names (line 33) | def has_names(names: set) -> bool: method shape_var (line 36) | def shape_var(name: str) -> tc.Size: return Distr._shapes_all_vars[name] method shapes_var (line 38) | def shapes_var(names: set) -> dict: method shape_bat (line 41) | def shape_bat(conds: edic) -> tc.Size: method shape_bat_broadcast (line 46) | def shape_bat_broadcast(conds: edic) -> tc.Size: method broadcast_vars (line 51) | def broadcast_vars(conds: edic) -> edic: method __init__ (line 56) | def __init__(self, *, names: set=set(), names_shapes: dict={}, parents... method names (line 71) | def names(self) -> set: return self._names method parents (line 73) | def parents(self) -> set: return self._parents method is_root (line 75) | def is_root(self) -> bool: return self._is_root method __repr__ (line 77) | def __repr__(self) -> str: method mean (line 80) | def mean(self, conds: edic=edic(), n_mc: int=10, repar: bool=True) -> ... method expect (line 84) | def expect(self, fn, conds: edic=edic(), n_mc: int=10, repar: bool=Tru... method rdraw (line 94) | def rdraw(self, shape_mc: tc.Size=tc.Size(), conds: edic=edic()) -> ed... method draw (line 98) | def draw(self, shape_mc: tc.Size=tc.Size(), conds: edic=edic(), repar:... method logp (line 102) | def logp(self, vals: edic, conds: edic=edic()) -> tc.Tensor: # log_probs method logp_cartes (line 106) | def logp_cartes(self, vals: edic, conds: edic=edic()) -> tc.Tensor: # ... method __mul__ (line 116) | def __mul__(self, other): # p(z|w1) * p(x|z,w2) -> p(z,x|w1,w2) method marg (line 169) | def marg(self, mnames: set, n_mc: int=10): class DistrElem (line 223) | class DistrElem(Distr): method __init__ (line 224) | def __init__(self, name: str, shape: tc.Size, device = None, **params): method name (line 256) | def name(self): return self._name method shape (line 258) | def shape(self): return self._shape method device (line 260) | def device(self): return self._device method mode (line 262) | def mode(self, conds: edic=edic(), repar: bool=True) -> edic: FILE: code/deep/CSG/distr/instances.py class Determ (line 24) | class Determ(DistrElem): method __init__ (line 25) | def __init__(self, name: str, val, shape = None, checkval: bool=False,... method mean (line 29) | def mean(self, conds: edic=edic(), n_mc: int=10, repar: bool=True) -> ... method mode (line 33) | def mode(self, conds: edic=edic(), repar: bool=True) -> edic: method draw (line 37) | def draw(self, shape_mc: tc.Size=tc.Size(), conds: edic=edic(), repar:... method logp (line 42) | def logp(self, vals: edic, conds: edic=edic()) -> tc.Tensor: # log_probs method entropy (line 53) | def entropy(self, conds: edic=edic()) -> tc.Tensor: class Normal (line 57) | class Normal(DistrElem): method __init__ (line 58) | def __init__(self, name: str, mean = 0., std = 1., shape = None, devic... method mean (line 62) | def mean(self, conds: edic=edic(), n_mc: int=10, repar: bool=True) -> ... method mode (line 66) | def mode(self, conds: edic=edic(), repar: bool=True) -> edic: method draw (line 70) | def draw(self, shape_mc: tc.Size=tc.Size(), conds: edic=edic(), repar:... method logp (line 76) | def logp(self, vals: edic, conds: edic=edic()) -> tc.Tensor: # log_probs method entropy (line 84) | def entropy(self, conds: edic=edic()) -> tc.Tensor: class MVNormal (line 90) | class MVNormal(DistrElem): method __init__ (line 91) | def __init__(self, name: str, mean = 0., cov = None, prec = None, std_... method mean (line 158) | def mean(self, conds: edic=edic(), n_mc: int=10, repar: bool=True) -> ... method mode (line 162) | def mode(self, conds: edic=edic(), repar: bool=True) -> edic: method draw (line 166) | def draw(self, shape_mc: tc.Size=tc.Size(), conds: edic=edic(), repar:... method logp (line 173) | def logp(self, vals: edic, conds: edic=edic()) -> tc.Tensor: # log_probs method entropy (line 182) | def entropy(self, conds: edic=edic()) -> tc.Tensor: class Catg (line 188) | class Catg(DistrElem): method __init__ (line 189) | def __init__(self, name: str, *, probs = None, logits = None, shape = ... method _probsfn (line 218) | def _probsfn(self): return lambda conds: tcdu.logits_to_probs(self._lo... method _logitsfn (line 220) | def _logitsfn(self): return lambda conds: tcdu.probs_to_logits(self._p... method mode (line 223) | def mode(self, conds: edic=edic(), repar: bool=True) -> edic: method draw (line 227) | def draw(self, shape_mc: tc.Size=tc.Size(), conds: edic=edic(), repar:... method logp (line 237) | def logp(self, vals: edic, conds: edic=edic()) -> tc.Tensor: # log_probs method entropy (line 245) | def entropy(self, conds: edic=edic()) -> tc.Tensor: class Bern (line 250) | class Bern(DistrElem): method __init__ (line 251) | def __init__(self, name: str, *, probs = None, logits = None, shape = ... method _probsfn (line 258) | def _probsfn(self): return lambda conds: tcdu.logits_to_probs(self._lo... method _logitsfn (line 260) | def _logitsfn(self): return lambda conds: tcdu.probs_to_logits(self._p... method mode (line 263) | def mode(self, conds: edic=edic(), repar: bool=True) -> edic: method draw (line 267) | def draw(self, shape_mc: tc.Size=tc.Size(), conds: edic=edic(), repar:... method logp (line 274) | def logp(self, vals: edic, conds: edic=edic()) -> tc.Tensor: # log_probs method entropy (line 281) | def entropy(self, conds: edic=edic()) -> tc.Tensor: FILE: code/deep/CSG/distr/tools.py function elbo (line 19) | def elbo(p_joint: Distr, q_cond: Distr, obs: edic, n_mc: int=10, repar: ... function elbo_z2xy (line 25) | def elbo_z2xy(p_zx: Distr, p_y1z: Distr, q_z1x: Distr, obs_xy: edic, n_m... function elbo_z2xy_twist (line 47) | def elbo_z2xy_twist(pt_zx: Distr, p_y1z: Distr, p_z: Distr, pt_z: Distr,... function elbo_zy2x (line 69) | def elbo_zy2x(p_zyx: Distr, q_y1x: Distr, q_z1xy: Distr, obs_x: edic, n_... FILE: code/deep/CSG/distr/utils.py class edic (line 19) | class edic(dict): method __and__ (line 20) | def __and__(self, other): return edic({k:other[k] for k in set(self) &... method __rand__ (line 21) | def __rand__(self, other): return edic({k:self[k] for k in set(other) ... method __or__ (line 22) | def __or__(self, other): return edic({**self, **other}) # | method __ror__ (line 23) | def __ror__(self, other): return edic({**other, **self}) # | method __sub__ (line 24) | def __sub__(self, other): return edic({k:v for k,v in self.items() if ... method __rsub__ (line 25) | def __rsub__(self, other): return edic({k:v for k,v in other.items() i... method isdisjoint (line 26) | def isdisjoint(self, other) -> bool: return set(self).isdisjoint(set(o... method sub (line 28) | def sub(self, it, fn = None): method sub_expand_front (line 30) | def sub_expand_front(self, it, shape: tc.Size): method subedic (line 32) | def subedic(self, it, fn = None, use_default = False, default = None): method sublist (line 39) | def sublist(self, it, fn = None, use_default = False, default = None): method key0 (line 47) | def key0(self): return next(iter(self)) method value0 (line 48) | def value0(self): return next(iter(self.values())) method item0 (line 49) | def item0(self): return next(iter(self.items())) method mean (line 51) | def mean(self, dim, keepdim: bool=False): method expand_front (line 53) | def expand_front(self, shape: tc.Size): method broadcast (line 55) | def broadcast(self): function edicify (line 58) | def edicify(*args) -> tuple: function fargnames (line 62) | def fargnames(fn) -> set: function fedic (line 66) | def fedic(fn): function wrap4_multi_batchdims (line 73) | def wrap4_multi_batchdims(fn, ndim_vars = 1): function append_attrs (line 115) | def append_attrs(obj, vardict, attrs): # obj = self, vardict = locals(),... function tensorify (line 119) | def tensorify(device=None, *args) -> tuple: function is_scalar (line 122) | def is_scalar(ten: tc.Tensor) -> bool: function is_same_tensor (line 125) | def is_same_tensor(ten1: tc.Tensor, ten2: tc.Tensor) -> bool: function expand_front (line 130) | def expand_front(ten: tc.Tensor, shape: tc.Size) -> tc.Tensor: function flatten_last (line 133) | def flatten_last(ten: tc.Tensor, ndims: int): function reduce_last (line 137) | def reduce_last(reducefn, ten: tc.Tensor, ndims: int): # tc.distribution... function swap_dim_ranges (line 142) | def swap_dim_ranges(ten: tc.Tensor, dims1: tuple, dims2: tuple) -> tc.Te... function expand_middle (line 157) | def expand_middle(ten: tc.Tensor, shape: tc.Size, pos: int) -> tc.Tensor: function tcsizeify (line 166) | def tcsizeify(*args) -> tuple: function tcsize_div (line 169) | def tcsize_div(sz1: tc.Size, sz2: tc.Size) -> tc.Size: function tcsize_broadcast (line 173) | def tcsize_broadcast(*sizes) -> tc.Size: function normalize_probs (line 185) | def normalize_probs(probs: tc.Tensor) -> tc.Tensor: function normalize_logits (line 188) | def normalize_logits(logits: tc.Tensor) -> tc.Tensor: function precision_to_scale_tril (line 191) | def precision_to_scale_tril(P: tc.Tensor) -> tc.Tensor: FILE: code/deep/CSG/methods/cnbb.py class CNBBLoss (line 13) | class CNBBLoss: method __init__ (line 14) | def __init__(self, f_feat, actv, f_logit, dim_y, reg_w, reg_s, lr, n_i... method __call__ (line 23) | def __call__(self, x, y): FILE: code/deep/CSG/methods/semvar.py class SemVar (line 16) | class SemVar: method _get_priors (line 18) | def _get_priors(mean_s, std_s, shape_s, mean_v, std_v, shape_v, corr_s... method __init__ (line 90) | def __init__(self, shape_s, shape_v, shape_x, dim_y, method parameters (line 153) | def parameters(self): method state_dict (line 156) | def state_dict(self): method load_state_dict (line 159) | def load_state_dict(self, state_dict: dict): method get_lossfn (line 163) | def get_lossfn(self, n_mc_q: int=0, reduction: str="mean", mode: str="... method llh (line 196) | def llh(self, x: tc.Tensor, y: tc.LongTensor=None, n_mc_marg: int=64, ... method logit_y1x_src (line 214) | def logit_y1x_src(self, x: tc.Tensor, n_mc_q: int=0, repar: bool=True): method generate (line 233) | def generate(self, shape_mc: tc.Size=tc.Size(), mode: str="src") -> tu... FILE: code/deep/CSG/methods/supvae.py class SupVAE (line 14) | class SupVAE: method _get_priors (line 16) | def _get_priors(mean_s, std_s, shape_s, mvn_prior: bool = False, devic... method __init__ (line 38) | def __init__(self, shape_s, shape_x, dim_y, method parameters (line 78) | def parameters(self): method state_dict (line 81) | def state_dict(self): method load_state_dict (line 84) | def load_state_dict(self, state_dict: dict): method get_lossfn (line 88) | def get_lossfn(self, n_mc_q: int=0, reduction: str="mean", mode: str="... method llh (line 119) | def llh(self, x: tc.Tensor, y: tc.LongTensor=None, n_mc_marg: int=64, ... method logit_y1x_src (line 137) | def logit_y1x_src(self, x: tc.Tensor, n_mc_q: int=0, repar: bool=True): method generate (line 156) | def generate(self, shape_mc: tc.Size=tc.Size(), mode: str="src") -> tu... FILE: code/deep/CSG/methods/xdistr.py function elbo_z2xy (line 14) | def elbo_z2xy(p_zx: Distr, p_y1z: Distr, q_z1x: Distr, obs_xy: edic, n_m... function elbo_z2xy_twist (line 36) | def elbo_z2xy_twist(pt_zx: Distr, p_y1z: Distr, p_z: Distr, pt_z: Distr,... function elbo_fixllh (line 58) | def elbo_fixllh(p_prior: Distr, p_llh: Distr, q_cond: Distr, obs: edic, ... function elbo_z2xy_twist_fixpt (line 68) | def elbo_z2xy_twist_fixpt(p_x1z: Distr, p_y1z: Distr, p_z: Distr, pt_z: ... FILE: code/deep/CSG/test/distr_test.py function test_fun (line 18) | def test_fun(title, p_z, p_x1z): FILE: code/deep/CSG/utils/preprocess/data_list.py function make_dataset (line 13) | def make_dataset(image_list, labels): function pil_loader (line 25) | def pil_loader(path): function accimage_loader (line 32) | def accimage_loader(path): function default_loader (line 41) | def default_loader(path): class ImageList (line 49) | class ImageList(object): method __init__ (line 70) | def __init__(self, image_list, labels=None, transform=None, target_tra... method __getitem__ (line 83) | def __getitem__(self, index): method __len__ (line 99) | def __len__(self): FILE: code/deep/CSG/utils/preprocess/data_loader.py class PlaceCrop (line 13) | class PlaceCrop(object): method __init__ (line 14) | def __init__(self, size, start_x, start_y): method __call__ (line 22) | def __call__(self, img): class ResizeImage (line 27) | class ResizeImage(): method __init__ (line 28) | def __init__(self, size): method __call__ (line 34) | def __call__(self, img): class myDataset (line 39) | class myDataset(data.Dataset): method __init__ (line 40) | def __init__(self, root, transform=None, train=True): method __getitem__ (line 66) | def __getitem__(self, index): method __len__ (line 78) | def __len__(self): function load_training (line 82) | def load_training(root_path, domain, batch_size, kwargs, train_val_split... function load_testing (line 106) | def load_testing(root_path, domain, batch_size, kwargs): function load_train_valid_split (line 124) | def load_train_valid_split(dataset, batch_size, kwargs, val_ratio=0.4, r... function load_data (line 142) | def load_data(root_path, source_dir, target_dir, batch_size): function load_all_test (line 152) | def load_all_test(root_path, dataset, batch_size, train, kwargs): FILE: code/deep/CSG/utils/preprocess/data_provider.py class ResizeImage (line 8) | class ResizeImage(): method __init__ (line 9) | def __init__(self, size): method __call__ (line 14) | def __call__(self, img): class PlaceCrop (line 19) | class PlaceCrop(object): method __init__ (line 21) | def __init__(self, size, start_x, start_y): method __call__ (line 29) | def __call__(self, img): function load_images (line 34) | def load_images(images_file_path, batch_size, resize_size=256, is_train=... FILE: code/deep/CSG/utils/utils.py function unique_filename (line 15) | def unique_filename(prefix: str="", suffix: str="", n_digits: int=2, cou... class Averager (line 23) | class Averager: method __init__ (line 25) | def __init__(self): method reset (line 28) | def reset(self): method update (line 34) | def update(self, val, nrep = 1): method val (line 41) | def val(self): return self._val method avg (line 43) | def avg(self): return self._avg method sum (line 45) | def sum(self): return self._sum method count (line 47) | def count(self): return self._count function repeat_iterator (line 49) | def repeat_iterator(itr, n_repeat): class RepeatIterator (line 53) | class RepeatIterator: method __init__ (line 54) | def __init__(self, itr, n_repeat): method __iter__ (line 59) | def __iter__(self): method __len__ (line 62) | def __len__(self): return self.len function zip_longer (line 64) | def zip_longer(itr1, itr2): function zip_longest (line 72) | def zip_longest(*itrs): class ZipLongest (line 79) | class ZipLongest: method __init__ (line 80) | def __init__(self, *itrs): method __iter__ (line 85) | def __iter__(self): method __len__ (line 90) | def __len__(self): return self.len class CyclicLoader (line 93) | class CyclicLoader: method __init__ (line 94) | def __init__(self, datalist: list, shuffle: bool=True, cycle: int=None): method iter (line 102) | def iter(self): method next (line 105) | def next(self, n: int) -> tuple: method back (line 109) | def back(self, n: int): function boolstr (line 113) | def boolstr(s: str) -> bool: function getlist (line 125) | def getlist(ls: list, ids: list) -> list: function interleave (line 128) | def interleave(*lists) -> list: function flatten (line 131) | def flatten(ls: list, depth: int=None) -> list: class SlicesAt (line 139) | class SlicesAt: method __init__ (line 140) | def __init__(self, axis: int, ndim: int): method __getitem__ (line 145) | def __getitem__(self, idx): function moving_average_slim (line 151) | def moving_average_slim(arr: np.ndarray, n_win: int=2, axis: int=-1) -> ... function moving_average_full (line 159) | def moving_average_full(arr: np.ndarray, n_win: int=2, axis: int=-1) -> ... function moving_average_full_checker (line 176) | def moving_average_full_checker(arr: np.ndarray, n_win: int=2, axis: int... class Plotter (line 187) | class Plotter: method __init__ (line 188) | def __init__(self, var_xlab: dict, metr_ylab: dict, tab_items: list=None, method _get_res (line 202) | def _get_res(self, dataholder): # does not change `self` method load (line 249) | def load(self, *triplets): method clear (line 256) | def clear(self): method plot (line 260) | def plot(self, variables: list=None, metrics: list=None, method inspect (line 303) | def inspect(self, metr: str, ids: list=None, var: str=None, vals: list... method tabulate (line 327) | def tabulate(self, **tbformat): FILE: code/deep/CSG/utils/utils_main.py function auto_load (line 39) | def auto_load(dc_vars, names, ckpt): function get_frame (line 47) | def get_frame(discr, gen, dc_vars, device = None, discr_src = None): function get_discr (line 86) | def get_discr(archtype, dc_vars): function get_gen (line 106) | def get_gen(archtype, dc_vars, discr): function get_models (line 123) | def get_models(archtype, dc_vars, ckpt = None, device = None): function load_ckpt (line 145) | def load_ckpt(filename: str, loadmodel: bool=False, device: tc.device=No... function get_ce_or_bce_loss (line 152) | def get_ce_or_bce_loss(discr, dim_y: int, reduction: str="mean"): function add_ce_loss (line 161) | def add_ce_loss(lossobj, celossfn, ag): function ood_methods (line 170) | def ood_methods(discr, frame, ag, dim_y, cnbb_actv): function da_methods (line 184) | def da_methods(discr, frame, ag, dim_x, dim_y, device, ckpt, discr_src =... class ParamGroupsCollector (line 268) | class ParamGroupsCollector: method __init__ (line 269) | def __init__(self, lr): method reset (line 272) | def reset(self, lr): method collect_params (line 276) | def collect_params(self, *models): class ShrinkRatio (line 290) | class ShrinkRatio: method __init__ (line 291) | def __init__(self, w_iter, decay_rate): method __call__ (line 295) | def __call__(self, n_iter): function acc_with_logits (line 299) | def acc_with_logits(model: tc.nn.Module, x: tc.Tensor, y: tc.LongTensor,... function evaluate_acc (line 304) | def evaluate_acc(discr, input_loader, is_binary, device): function evaluate_llhx (line 311) | def evaluate_llhx(frame, input_loader, n_marg_llh, use_q_llh, mode, devi... class ResultsContainer (line 318) | class ResultsContainer: method __init__ (line 319) | def __init__(self, len_ts, frame, ag, is_binary, device, ckpt = None): method update (line 334) | def update(self, *, epk, loss): method evaluate (line 338) | def evaluate(self, discr, dname, dpart, loader, llh_mode, i = None): method summary (line 351) | def summary(self, dname, dpart, i = None): function dc_state_dict (line 367) | def dc_state_dict(dc_vars, *name_list): function is_ood (line 372) | def is_ood(mode): function process_continue_run (line 375) | def process_continue_run(ag): function main_stem (line 387) | def main_stem(ag, ckpt, archtype, shape_x, dim_y, function get_parser (line 524) | def get_parser(): function print_infrstru_info (line 597) | def print_infrstru_info(): FILE: code/deep/DAAN/data_loader.py class ResizeImage (line 8) | class ResizeImage(): method __init__ (line 9) | def __init__(self, size): method __call__ (line 14) | def __call__(self, img): class PlaceCrop (line 18) | class PlaceCrop(object): method __init__ (line 20) | def __init__(self, size, start_x, start_y): method __call__ (line 28) | def __call__(self, img): function load_training (line 32) | def load_training(root_path, dir, batch_size, kwargs): function load_testing (line 43) | def load_testing(root_path, dir, batch_size, kwargs): FILE: code/deep/DAAN/functions.py class ReverseLayerF (line 3) | class ReverseLayerF(Function): method forward (line 6) | def forward(ctx, x, alpha): method backward (line 12) | def backward(ctx, grad_output): FILE: code/deep/DAAN/model/DAAN.py class DAANNet (line 9) | class DAANNet(nn.Module): method __init__ (line 11) | def __init__(self, num_classes=65, base_net='ResNet50'): method forward (line 42) | def forward(self, source, target, s_label, DEV, alpha=0.0): FILE: code/deep/DAAN/model/backbone.py class AlexNetFc (line 10) | class AlexNetFc(nn.Module): method __init__ (line 11) | def __init__(self): method forward (line 19) | def forward(self, x): class ResNet18Fc (line 26) | class ResNet18Fc(nn.Module): method __init__ (line 27) | def __init__(self): method forward (line 40) | def forward(self, x): class ResNet34Fc (line 53) | class ResNet34Fc(nn.Module): method __init__ (line 54) | def __init__(self): method forward (line 67) | def forward(self, x): class ResNet50Fc (line 80) | class ResNet50Fc(nn.Module): method __init__ (line 81) | def __init__(self): method forward (line 94) | def forward(self, x): class ResNet101Fc (line 107) | class ResNet101Fc(nn.Module): method __init__ (line 108) | def __init__(self): method forward (line 121) | def forward(self, x): class ResNet152Fc (line 134) | class ResNet152Fc(nn.Module): method __init__ (line 135) | def __init__(self): method forward (line 148) | def forward(self, x): FILE: code/deep/DAAN/train.py function load_data (line 56) | def load_data(): function print_learning_rate (line 62) | def print_learning_rate(optimizer): function train (line 73) | def train(epoch, model, source_loader, target_loader): function test (line 161) | def test(model, test_loader): FILE: code/deep/DANN(RevGrad)/adv_layer.py class ReverseLayerF (line 7) | class ReverseLayerF(Function): method forward (line 10) | def forward(ctx, x, alpha): method backward (line 15) | def backward(ctx, grad_output): class Discriminator (line 19) | class Discriminator(nn.Module): method __init__ (line 20) | def __init__(self, input_dim=256, hidden_dim=256): method forward (line 29) | def forward(self, x): FILE: code/deep/DaNN/DaNN.py class DaNN (line 4) | class DaNN(nn.Module): method __init__ (line 5) | def __init__(self, n_input=28 * 28, n_hidden=256, n_class=10): method forward (line 12) | def forward(self, src, tar): FILE: code/deep/DaNN/data_loader.py function load_data (line 5) | def load_data(root_dir,domain,batch_size): function load_test (line 21) | def load_test(root_dir,domain,batch_size): FILE: code/deep/DaNN/main.py function mmd_loss (line 26) | def mmd_loss(x_src, x_tar): function train (line 30) | def train(model, optimizer, epoch, data_src, data_tar): function test (line 69) | def test(model, data_tar, e): FILE: code/deep/DaNN/mmd.py function linear_mmd2 (line 17) | def linear_mmd2(f_of_X, f_of_Y): function poly_mmd2 (line 32) | def poly_mmd2(f_of_X, f_of_Y, d=1, alpha=1.0, c=2.0): function _mix_rbf_kernel (line 49) | def _mix_rbf_kernel(X, Y, sigma_list): function mix_rbf_mmd2 (line 67) | def mix_rbf_mmd2(X, Y, sigma_list, biased=True): function mix_rbf_mmd2_and_ratio (line 73) | def mix_rbf_mmd2_and_ratio(X, Y, sigma_list, biased=True): function _mmd2 (line 84) | def _mmd2(K_XX, K_XY, K_YY, const_diagonal=False, biased=False): function _mmd2_and_ratio (line 118) | def _mmd2_and_ratio(K_XX, K_XY, K_YY, const_diagonal=False, biased=False): function _mmd2_and_variance (line 124) | def _mmd2_and_variance(K_XX, K_XY, K_YY, const_diagonal=False, biased=Fa... FILE: code/deep/DeepMEDA/ResNet.py function conv3x3 (line 18) | def conv3x3(in_planes, out_planes, stride=1): class BasicBlock (line 24) | class BasicBlock(nn.Module): method __init__ (line 27) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 37) | def forward(self, x): class Bottleneck (line 56) | class Bottleneck(nn.Module): method __init__ (line 59) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 72) | def forward(self, x): class ResNet (line 95) | class ResNet(nn.Module): method __init__ (line 97) | def __init__(self, block, layers, num_classes=1000): method _make_layer (line 121) | def _make_layer(self, block, planes, blocks, stride=1): method forward (line 138) | def forward(self, x): function resnet50 (line 154) | def resnet50(pretrained=False, **kwargs): FILE: code/deep/DeepMEDA/Weight.py function convert_to_onehot (line 3) | def convert_to_onehot(sca_label, class_num=31): class Weight (line 6) | class Weight: method cal_weight (line 9) | def cal_weight(s_label, t_label, type='visual', batch_size=32, class_n... FILE: code/deep/DeepMEDA/data_loader.py function load_training (line 5) | def load_training(root_path, dir, batch_size, kwargs): function load_testing (line 15) | def load_testing(root_path, dir, batch_size, kwargs): FILE: code/deep/DeepMEDA/deep_meda.py class DeepMEDA (line 7) | class DeepMEDA(nn.Module): method __init__ (line 9) | def __init__(self, num_classes=31, bottle_neck=True): method forward (line 21) | def forward(self, source, target, s_label): method predict (line 35) | def predict(self, x): FILE: code/deep/DeepMEDA/dynamic_factor.py function proxy_a_distance (line 4) | def proxy_a_distance(source_X, target_X, verbose=False): function estimate_mu (line 42) | def estimate_mu(_X1, _Y1, _X2, _Y2): FILE: code/deep/DeepMEDA/main.py function load_data (line 12) | def load_data(root_path, src, tar, batch_size): function train_epoch (line 21) | def train_epoch(epoch, model, dataloaders): function test (line 66) | def test(model, dataloader): function get_args (line 85) | def get_args(): FILE: code/deep/DeepMEDA/mmd.py class MMD_loss (line 7) | class MMD_loss(nn.Module): method __init__ (line 8) | def __init__(self, kernel_type='rbf', kernel_mul=2.0, kernel_num=5): method guassian_kernel (line 15) | def guassian_kernel(self, source, target, kernel_mul=2.0, kernel_num=5... method linear_mmd2 (line 34) | def linear_mmd2(self, f_of_X, f_of_Y): method marginal (line 40) | def marginal(self, source, target): method conditional (line 54) | def conditional(self, source, target, s_label, t_label, kernel_mul=2.0... FILE: code/deep/MRAN/MRAN.py function load_data (line 55) | def load_data(): function train (line 62) | def train(epoch, model, source_loader, target_loader): function test (line 102) | def test(model, test_loader): FILE: code/deep/MRAN/ResNet.py function conv3x3 (line 18) | def conv3x3(in_planes, out_planes, stride=1): class BasicBlock (line 24) | class BasicBlock(nn.Module): method __init__ (line 27) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 37) | def forward(self, x): class Bottleneck (line 56) | class Bottleneck(nn.Module): method __init__ (line 59) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 72) | def forward(self, x): class ResNet (line 95) | class ResNet(nn.Module): method __init__ (line 97) | def __init__(self, block, layers, num_classes=1000): method _make_layer (line 121) | def _make_layer(self, block, planes, blocks, stride=1): method forward (line 138) | def forward(self, x): class MRANNet (line 151) | class MRANNet(nn.Module): method __init__ (line 153) | def __init__(self, num_classes=31): method forward (line 158) | def forward(self, source, target, s_label): class BasicConv2d (line 165) | class BasicConv2d(nn.Module): method __init__ (line 167) | def __init__(self, in_channels, out_channels, **kwargs): method forward (line 172) | def forward(self, x): class InceptionA (line 177) | class InceptionA(nn.Module): method __init__ (line 179) | def __init__(self, in_channels, pool_features, num_classes): method forward (line 196) | def forward(self, source, target, s_label): function resnet50 (line 257) | def resnet50(pretrained=False, **kwargs): FILE: code/deep/MRAN/data_loader.py function load_training (line 4) | def load_training(root_path, dir, batch_size, kwargs): function load_testing (line 14) | def load_testing(root_path, dir, batch_size, kwargs): FILE: code/deep/MRAN/mmd.py function guassian_kernel (line 10) | def guassian_kernel(source, target, kernel_mul=2.0, kernel_num=5, fix_si... function cmmd (line 25) | def cmmd(source, target, s_label, t_label, kernel_mul=2.0, kernel_num=5,... FILE: code/deep/ReMoS/CV_adv/DNNtest/coverage/my_neuron_coverage.py class MyNeuronCoverage (line 14) | class MyNeuronCoverage: method __init__ (line 28) | def __init__(self, threshold=0.5): method init_structure (line 40) | def init_structure(self, intermediate_layer_outputs, features_index): method update (line 55) | def update(self, intermediate_layer_outputs, features_index): method report (line 111) | def report(self, *args): method get (line 132) | def get(self, threshold): method _scale (line 157) | def _scale(intermediate_layer_output): method _calc_1 (line 182) | def _calc_1(intermediate_layer_output, features_index, threshold): method _calc_2 (line 224) | def _calc_2(intermediate_layer_output, features_index, threshold): FILE: code/deep/ReMoS/CV_adv/DNNtest/coverage/neuron_coverage.py class NeuronCoverage (line 13) | class NeuronCoverage: method __init__ (line 27) | def __init__(self, thresholds=(0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7,... method update (line 36) | def update(self, intermediate_layer_outputs, features_index): method report (line 102) | def report(self, *args): method get (line 117) | def get(self, threshold): method _scale (line 139) | def _scale(intermediate_layer_output): method _calc_1 (line 164) | def _calc_1(intermediate_layer_output, features_index): method _calc_2 (line 203) | def _calc_2(intermediate_layer_output, features_index): FILE: code/deep/ReMoS/CV_adv/DNNtest/coverage/pytorch_wrapper.py class PyTorchModel (line 14) | class PyTorchModel: method __init__ (line 33) | def __init__(self, model, intermedia_mode=""): method predict (line 41) | def predict(self, dataset, callbacks, batch_size=16): method one_sample_intermediate_layer_outputs (line 115) | def one_sample_intermediate_layer_outputs(self, sample, callbacks, ): method one_sample_intermediate_layer_outputs_with_grad (line 136) | def one_sample_intermediate_layer_outputs_with_grad(self, sample, call... method _intermediate_layers (line 172) | def _intermediate_layers(self, module, pre_name=""): FILE: code/deep/ReMoS/CV_adv/DNNtest/coverage/strong_neuron_activation_coverage.py class StrongNeuronActivationCoverage (line 14) | class StrongNeuronActivationCoverage(MyNeuronCoverage): method __init__ (line 15) | def __init__(self, k=5): method _calc_1 (line 24) | def _calc_1(intermediate_layer_output, features_index, k): method _calc_2 (line 73) | def _calc_2(intermediate_layer_output, features_index, threshold): FILE: code/deep/ReMoS/CV_adv/DNNtest/coverage/top_k_coverage.py class TopKNeuronCoverage (line 14) | class TopKNeuronCoverage(MyNeuronCoverage): method __init__ (line 15) | def __init__(self, k=5): method _calc_1 (line 24) | def _calc_1(intermediate_layer_output, features_index, threshold): method _calc_2 (line 72) | def _calc_2(intermediate_layer_output, features_index, threshold): FILE: code/deep/ReMoS/CV_adv/DNNtest/coverage/utils/common.py function readable_time_str (line 13) | def readable_time_str(): function user_home_dir (line 27) | def user_home_dir(): function to_numpy (line 39) | def to_numpy(data): FILE: code/deep/ReMoS/CV_adv/DNNtest/coverage/utils/keras.py class ImageNetValData (line 16) | class ImageNetValData(): class ImageNetValDataX (line 43) | class ImageNetValDataX(): method __init__ (line 45) | def __init__(self, dir, filenames, fashion, size, transform): method __len__ (line 52) | def __len__(self): method __getitem__ (line 55) | def __getitem__(self, index): method __init__ (line 91) | def __init__(self, fashion, size, transform=None, shuffle=False, seed=... method __len__ (line 112) | def __len__(self): method filenames (line 116) | def filenames(self): function imagenet_benchmark_zoo_model_names (line 120) | def imagenet_benchmark_zoo_model_names(): function imagenet_benchmark_zoo (line 137) | def imagenet_benchmark_zoo(model_name, data_original_shuffle=True, data_... function cifar10_data (line 343) | def cifar10_data(train=False, num_max=None): function mnist_data (line 374) | def mnist_data(train=False, num_max=None): FILE: code/deep/ReMoS/CV_adv/DNNtest/coverage/utils/mxnet.py class ImageNetValDataset (line 16) | class ImageNetValDataset(mxnet.gluon.data.Dataset): method __init__ (line 45) | def __init__(self, resize_size, center_crop_size, preprocess, shuffle=... method __len__ (line 67) | def __len__(self): method __getitem__ (line 70) | def __getitem__(self, index): method filenames (line 82) | def filenames(self): function imagenet_benchmark_zoo_model_names (line 86) | def imagenet_benchmark_zoo_model_names(): function imagenet_benchmark_zoo (line 104) | def imagenet_benchmark_zoo(model_name, data_original_shuffle=True, data_... function cifar10_dataset (line 228) | def cifar10_dataset(train=False, num_max=None): function mnist_dataset (line 251) | def mnist_dataset(train=False, num_max=None): FILE: code/deep/ReMoS/CV_adv/DNNtest/coverage/utils/pytorch.py class ImageNetValDataset (line 17) | class ImageNetValDataset(torch.utils.data.Dataset): method __init__ (line 46) | def __init__(self, resize_size, center_crop_size, preprocess, shuffle=... method __len__ (line 68) | def __len__(self): method __getitem__ (line 71) | def __getitem__(self, index): method filenames (line 82) | def filenames(self): function imagenet_benchmark_zoo_model_names (line 86) | def imagenet_benchmark_zoo_model_names(): function imagenet_benchmark_zoo (line 104) | def imagenet_benchmark_zoo(model_name, data_original_shuffle=True, data_... function cifar10_dataset (line 228) | def cifar10_dataset(train=False, num_max=None): function mnist_dataset (line 253) | def mnist_dataset(train=False, num_max=None): FILE: code/deep/ReMoS/CV_adv/DNNtest/coverage/utils/tensorflow.py class ImageNetValData (line 22) | class ImageNetValData(): class ImageNetValDataX (line 54) | class ImageNetValDataX(): method __init__ (line 56) | def __init__(self, dir, filenames, width, height, fashion, transform): method __len__ (line 64) | def __len__(self): method __getitem__ (line 67) | def __getitem__(self, index): method _smallest_size_at_least (line 98) | def _smallest_size_at_least(self, height, width, smallest_side): method _aspect_preserving_resize (line 108) | def _aspect_preserving_resize(self, image, smallest_side): method _central_crop (line 120) | def _central_crop(self, image_list, crop_height, crop_width): method _crop (line 130) | def _crop(self, image, offset_height, offset_width, crop_height, cro... method __init__ (line 142) | def __init__(self, width, height, fashion, transform=None, label_offse... method __len__ (line 163) | def __len__(self): method filenames (line 167) | def filenames(self): function imagenet_benchmark_zoo_model_names (line 171) | def imagenet_benchmark_zoo_model_names(): function imagenet_benchmark_zoo (line 191) | def imagenet_benchmark_zoo(model_name, data_original_shuffle=True, data_... function cifar10_test_data (line 535) | def cifar10_test_data(num_max=None): function mnist_test_data (line 557) | def mnist_test_data(num_max=None): FILE: code/deep/ReMoS/CV_adv/DNNtest/eval_nc.py function adv_whitebox (line 47) | def adv_whitebox(model, loader, args, bounds,): function adv_teacher_plain (line 111) | def adv_teacher_plain(model, loader, args, bounds, students): function get_strategy (line 192) | def get_strategy(args, model): function get_coverage (line 205) | def get_coverage(args,): function compute_selected_neuron_value (line 216) | def compute_selected_neuron_value( function adv_coverage (line 235) | def adv_coverage( function get_args (line 345) | def get_args(): function load_student (line 386) | def load_student(ckpt, args, num_classes): FILE: code/deep/ReMoS/CV_adv/DNNtest/strategy/adapt.py class FeatureMatrix (line 18) | class FeatureMatrix: method __init__ (line 38) | def __init__(self, network): method update (line 131) | def update(self, covered_count, objective_covered): method matrix (line 191) | def matrix(self): method dot (line 196) | def dot(self, vector): class ParameterizedStrategy (line 208) | class ParameterizedStrategy(Strategy): method __init__ (line 219) | def __init__(self, network, bound=5): method select (line 251) | def select(self, k): method init (line 268) | def init(self, covered, label, **kwargs): method update (line 303) | def update(self, covered, label, **kwargs): class AdaptiveParameterizedStrategy (line 328) | class AdaptiveParameterizedStrategy(ParameterizedStrategy): method __init__ (line 340) | def __init__(self, network, bound=5, size=100, history=300, remainder=... method init (line 386) | def init(self, covered, label, **kwargs): method update (line 407) | def update(self, covered, label, **kwargs): method next (line 427) | def next(self): FILE: code/deep/ReMoS/CV_adv/DNNtest/strategy/deepxplore.py class UncoveredRandomStrategy (line 6) | class UncoveredRandomStrategy(Strategy): method __init__ (line 17) | def __init__(self, network): method select (line 38) | def select(self, k): method init (line 66) | def init(self, covered, **kwargs): method update (line 89) | def update(self, covered, **kwargs): FILE: code/deep/ReMoS/CV_adv/DNNtest/strategy/dlfuzz.py class DLFuzzRoundRobin (line 7) | class DLFuzzRoundRobin(Strategy): method __init__ (line 23) | def __init__(self, network, weight_portion=0.1, order=None): method select (line 81) | def select(self, k): method init (line 126) | def init(self, covered, **kwargs): method update (line 149) | def update(self, covered, **kwargs): method next (line 166) | def next(self): class MostCoveredStrategy (line 178) | class MostCoveredStrategy(DLFuzzRoundRobin): method __init__ (line 191) | def __init__(self, model): method next (line 218) | def next(self): FILE: code/deep/ReMoS/CV_adv/DNNtest/strategy/random.py class RandomStrategy (line 6) | class RandomStrategy(Strategy): method init (line 13) | def init(self, covered): method select (line 17) | def select(self, k, ): FILE: code/deep/ReMoS/CV_adv/DNNtest/strategy/strategy.py class Strategy (line 4) | class Strategy(ABC): method __init__ (line 7) | def __init__(self, network): method __call__ (line 18) | def __call__(self, k): method select (line 27) | def select(self, k): method init (line 41) | def init(self, **kwargs): method update (line 60) | def update(self, covered, **kwargs): method next (line 79) | def next(self): FILE: code/deep/ReMoS/CV_adv/dataset/cub200.py class CUB200Data (line 8) | class CUB200Data(data.Dataset): method __init__ (line 9) | def __init__(self, root, is_train=True, transform=None, shots=-1, seed... method __getitem__ (line 71) | def __getitem__(self, index): method __len__ (line 85) | def __len__(self): FILE: code/deep/ReMoS/CV_adv/dataset/flower102.py class Flower102Data (line 10) | class Flower102Data(data.Dataset): method __init__ (line 11) | def __init__(self, root, is_train=True, transform=None, shots=-1, seed... method __getitem__ (line 62) | def __getitem__(self, index): method __len__ (line 73) | def __len__(self): FILE: code/deep/ReMoS/CV_adv/dataset/mit67.py class MIT67Data (line 11) | class MIT67Data(data.Dataset): method __init__ (line 12) | def __init__(self, root, is_train=False, transform=None, shots=-1, see... method __getitem__ (line 63) | def __getitem__(self, index): method __len__ (line 74) | def __len__(self): FILE: code/deep/ReMoS/CV_adv/dataset/stanford_40.py class Stanford40Data (line 10) | class Stanford40Data(data.Dataset): method __init__ (line 11) | def __init__(self, root, is_train=False, transform=None, shots=-1, see... method __getitem__ (line 63) | def __getitem__(self, index): method __len__ (line 74) | def __len__(self): FILE: code/deep/ReMoS/CV_adv/dataset/stanford_dog.py class SDog120Data (line 11) | class SDog120Data(data.Dataset): method __init__ (line 12) | def __init__(self, root, is_train=True, transform=None, shots=5, seed=... method __getitem__ (line 62) | def __getitem__(self, index): method __len__ (line 72) | def __len__(self): FILE: code/deep/ReMoS/CV_adv/distillation_training.py function linear_l2 (line 35) | def linear_l2(model): function l2sp (line 43) | def l2sp(model, reg): function test (line 64) | def test(model, teacher, loader, loss=False): function train (line 109) | def train( function get_args (line 348) | def get_args(): function record_act (line 389) | def record_act(self, input, output): FILE: code/deep/ReMoS/CV_adv/eval_robustness.py function advtest (line 8) | def advtest(model, loader, adversary, args): function record_act (line 45) | def record_act(self, input, output): function get_args (line 48) | def get_args(): function myloss (line 66) | def myloss(yhat, y): FILE: code/deep/ReMoS/CV_adv/finetune.py function get_args (line 28) | def get_args(): FILE: code/deep/ReMoS/CV_adv/finetuner.py class Finetuner (line 20) | class Finetuner(object): method __init__ (line 21) | def __init__( method init_models (line 37) | def init_models(self): method adv_eval (line 59) | def adv_eval(self): method compute_loss (line 67) | def compute_loss( method test (line 78) | def test(self, loader): method train (line 97) | def train(self): FILE: code/deep/ReMoS/CV_adv/model/fe_resnet.py function conv3x3 (line 24) | def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1): function conv1x1 (line 30) | def conv1x1(in_planes, out_planes, stride=1): class BasicBlock (line 35) | class BasicBlock(nn.Module): method __init__ (line 39) | def __init__(self, inplanes, planes, stride=1, downsample=None, groups=1, method forward (line 58) | def forward(self, x): class Bottleneck (line 78) | class Bottleneck(nn.Module): method __init__ (line 82) | def __init__(self, inplanes, planes, stride=1, downsample=None, groups=1, method forward (line 99) | def forward(self, x): class ResNet (line 122) | class ResNet(nn.Module): method __init__ (line 124) | def __init__(self, block, layers, num_classes=1000, zero_init_residual... method _make_layer (line 183) | def _make_layer(self, block, planes, blocks, stride=1, dilate=False): method _forward_impl (line 207) | def _forward_impl(self, x): method forward (line 233) | def forward(self, x): function _resnet (line 236) | def _resnet(arch, block, layers, pretrained, progress, **kwargs): function resnet18_dropout (line 250) | def resnet18_dropout(pretrained=False, progress=True, **kwargs): function resnet34_dropout (line 260) | def resnet34_dropout(pretrained=False, progress=True, **kwargs): function resnet50_dropout (line 270) | def resnet50_dropout(pretrained=False, progress=True, **kwargs): function resnet101_dropout (line 281) | def resnet101_dropout(pretrained=False, progress=True, **kwargs): function feresnet18 (line 291) | def feresnet18(pretrained=False, progress=True, **kwargs): function feresnet34 (line 302) | def feresnet34(pretrained=False, progress=True, **kwargs): function feresnet50 (line 313) | def feresnet50(pretrained=False, progress=True, **kwargs): function feresnet101 (line 324) | def feresnet101(pretrained=False, progress=True, **kwargs): function feresnet152 (line 335) | def feresnet152(pretrained=False, progress=True, **kwargs): function resnext50_32x4d (line 346) | def resnext50_32x4d(pretrained=False, progress=True, **kwargs): function resnext101_32x8d (line 359) | def resnext101_32x8d(pretrained=False, progress=True, **kwargs): function wide_resnet50_2 (line 372) | def wide_resnet50_2(pretrained=False, progress=True, **kwargs): function wide_resnet101_2 (line 388) | def wide_resnet101_2(pretrained=False, progress=True, **kwargs): FILE: code/deep/ReMoS/CV_adv/nc_prune/analyze_coverage.py function get_args (line 37) | def get_args(): FILE: code/deep/ReMoS/CV_adv/nc_prune/coverage/my_neuron_coverage.py class MyNeuronCoverage (line 14) | class MyNeuronCoverage: method __init__ (line 28) | def __init__(self, threshold=0.5): method init_structure (line 40) | def init_structure(self, intermediate_layer_outputs, features_index): method update (line 55) | def update( method report (line 140) | def report(self, *args): method get (line 161) | def get(self, ): method _scale (line 186) | def _scale(intermediate_layer_output): method _calc_1 (line 211) | def _calc_1(intermediate_layer_output, features_index, threshold): method _calc_2 (line 253) | def _calc_2(intermediate_layer_output, features_index, threshold): FILE: code/deep/ReMoS/CV_adv/nc_prune/coverage/pytorch_wrapper.py class PyTorchModel (line 15) | class PyTorchModel: method __init__ (line 34) | def __init__(self, model, intermedia_mode=""): method predict (line 44) | def predict(self, dataset, callbacks, batch_size=16): method one_sample_intermediate_layer_outputs (line 74) | def one_sample_intermediate_layer_outputs(self, sample, callbacks, ): method _intermediate_layers (line 101) | def _intermediate_layers(self, module, pre_name=""): FILE: code/deep/ReMoS/CV_adv/nc_prune/coverage/strong_neuron_activation_coverage.py class StrongNeuronActivationCoverage (line 14) | class StrongNeuronActivationCoverage(MyNeuronCoverage): method __init__ (line 15) | def __init__(self, k=5): method _calc_1 (line 24) | def _calc_1(intermediate_layer_output, features_index, k): method _calc_2 (line 73) | def _calc_2(intermediate_layer_output, features_index, threshold): FILE: code/deep/ReMoS/CV_adv/nc_prune/coverage/test_max.py function get_max_values (line 5) | def get_max_values(array, k): FILE: code/deep/ReMoS/CV_adv/nc_prune/coverage/top_k_coverage.py class TopKNeuronCoverage (line 14) | class TopKNeuronCoverage(MyNeuronCoverage): method __init__ (line 15) | def __init__(self, k=5): method _calc_1 (line 24) | def _calc_1(intermediate_layer_output, features_index, threshold): method _calc_2 (line 72) | def _calc_2(intermediate_layer_output, features_index, threshold): FILE: code/deep/ReMoS/CV_adv/nc_prune/coverage/utils/common.py function readable_time_str (line 13) | def readable_time_str(): function user_home_dir (line 27) | def user_home_dir(): function to_numpy (line 39) | def to_numpy(data): FILE: code/deep/ReMoS/CV_adv/nc_prune/coverage/utils/keras.py class ImageNetValData (line 16) | class ImageNetValData(): class ImageNetValDataX (line 43) | class ImageNetValDataX(): method __init__ (line 45) | def __init__(self, dir, filenames, fashion, size, transform): method __len__ (line 52) | def __len__(self): method __getitem__ (line 55) | def __getitem__(self, index): method __init__ (line 91) | def __init__(self, fashion, size, transform=None, shuffle=False, seed=... method __len__ (line 112) | def __len__(self): method filenames (line 116) | def filenames(self): function imagenet_benchmark_zoo_model_names (line 120) | def imagenet_benchmark_zoo_model_names(): function imagenet_benchmark_zoo (line 137) | def imagenet_benchmark_zoo(model_name, data_original_shuffle=True, data_... function cifar10_data (line 343) | def cifar10_data(train=False, num_max=None): function mnist_data (line 374) | def mnist_data(train=False, num_max=None): FILE: code/deep/ReMoS/CV_adv/nc_prune/coverage/utils/mxnet.py class ImageNetValDataset (line 16) | class ImageNetValDataset(mxnet.gluon.data.Dataset): method __init__ (line 45) | def __init__(self, resize_size, center_crop_size, preprocess, shuffle=... method __len__ (line 67) | def __len__(self): method __getitem__ (line 70) | def __getitem__(self, index): method filenames (line 82) | def filenames(self): function imagenet_benchmark_zoo_model_names (line 86) | def imagenet_benchmark_zoo_model_names(): function imagenet_benchmark_zoo (line 104) | def imagenet_benchmark_zoo(model_name, data_original_shuffle=True, data_... function cifar10_dataset (line 228) | def cifar10_dataset(train=False, num_max=None): function mnist_dataset (line 251) | def mnist_dataset(train=False, num_max=None): FILE: code/deep/ReMoS/CV_adv/nc_prune/coverage/utils/pytorch.py class ImageNetValDataset (line 17) | class ImageNetValDataset(torch.utils.data.Dataset): method __init__ (line 46) | def __init__(self, resize_size, center_crop_size, preprocess, shuffle=... method __len__ (line 68) | def __len__(self): method __getitem__ (line 71) | def __getitem__(self, index): method filenames (line 82) | def filenames(self): function imagenet_benchmark_zoo_model_names (line 86) | def imagenet_benchmark_zoo_model_names(): function imagenet_benchmark_zoo (line 104) | def imagenet_benchmark_zoo(model_name, data_original_shuffle=True, data_... function cifar10_dataset (line 228) | def cifar10_dataset(train=False, num_max=None): function mnist_dataset (line 253) | def mnist_dataset(train=False, num_max=None): FILE: code/deep/ReMoS/CV_adv/nc_prune/coverage/utils/tensorflow.py class ImageNetValData (line 22) | class ImageNetValData(): class ImageNetValDataX (line 54) | class ImageNetValDataX(): method __init__ (line 56) | def __init__(self, dir, filenames, width, height, fashion, transform): method __len__ (line 64) | def __len__(self): method __getitem__ (line 67) | def __getitem__(self, index): method _smallest_size_at_least (line 98) | def _smallest_size_at_least(self, height, width, smallest_side): method _aspect_preserving_resize (line 108) | def _aspect_preserving_resize(self, image, smallest_side): method _central_crop (line 120) | def _central_crop(self, image_list, crop_height, crop_width): method _crop (line 130) | def _crop(self, image, offset_height, offset_width, crop_height, cro... method __init__ (line 142) | def __init__(self, width, height, fashion, transform=None, label_offse... method __len__ (line 163) | def __len__(self): method filenames (line 167) | def filenames(self): function imagenet_benchmark_zoo_model_names (line 171) | def imagenet_benchmark_zoo_model_names(): function imagenet_benchmark_zoo (line 191) | def imagenet_benchmark_zoo(model_name, data_original_shuffle=True, data_... function cifar10_test_data (line 535) | def cifar10_test_data(num_max=None): function mnist_test_data (line 557) | def mnist_test_data(num_max=None): FILE: code/deep/ReMoS/CV_adv/nc_prune/my_profile.py function get_coverage (line 38) | def get_coverage(args,): function compute_selected_neuron_value (line 49) | def compute_selected_neuron_value( function log_coverage (line 68) | def log_coverage(model, loader, args, ): function record_act (line 107) | def record_act(self, input, output): function get_args (line 110) | def get_args(): FILE: code/deep/ReMoS/CV_adv/nc_prune/nc_pruner.py class NCPruner (line 33) | class NCPruner(WeightPruner): method __init__ (line 34) | def __init__( method prune_record (line 46) | def prune_record(self, log): method init_prune (line 50) | def init_prune(self): method check_param_num (line 57) | def check_param_num(self): method load_nc_info (line 68) | def load_nc_info(self,): method weight_prune (line 80) | def weight_prune( method final_check_param_num (line 157) | def final_check_param_num(self): FILE: code/deep/ReMoS/CV_adv/nc_prune/nc_weight_rank_pruner.py class NCWeightRankPruner (line 35) | class NCWeightRankPruner(NCPruner): method __init__ (line 36) | def __init__( method load_nc_info (line 48) | def load_nc_info(self,): method weight_prune (line 60) | def weight_prune( method final_check_param_num (line 170) | def final_check_param_num(self): FILE: code/deep/ReMoS/CV_adv/utils.py class MovingAverageMeter (line 6) | class MovingAverageMeter(object): method __init__ (line 9) | def __init__(self, name, fmt=':f', momentum=0.9): method reset (line 15) | def reset(self): method update (line 20) | def update(self, val, n=1): method __str__ (line 24) | def __str__(self): class ProgressMeter (line 29) | class ProgressMeter(object): method __init__ (line 30) | def __init__(self, num_batches, meters, prefix="", output_dir=None): method display (line 37) | def display(self, batch): method _get_batch_fmtstr (line 46) | def _get_batch_fmtstr(self, num_batches): class CrossEntropyLabelSmooth (line 52) | class CrossEntropyLabelSmooth(nn.Module): method __init__ (line 53) | def __init__(self, num_classes, epsilon=0.1): method forward (line 59) | def forward(self, inputs, targets): function linear_l2 (line 69) | def linear_l2(model, beta_lmda): function l2sp (line 78) | def l2sp(model, reg): function advtest_fast (line 99) | def advtest_fast(model, loader, adversary, args): FILE: code/deep/ReMoS/CV_adv/weight_pruner.py class WeightPruner (line 34) | class WeightPruner(Finetuner): method __init__ (line 35) | def __init__( method prune_record (line 58) | def prune_record(self, log): method init_prune (line 62) | def init_prune(self): method iterative_prune (line 69) | def iterative_prune(self, iteration): method check_param_num (line 89) | def check_param_num(self): method weight_prune (line 101) | def weight_prune( method final_check_param_num (line 166) | def final_check_param_num(self): FILE: code/deep/ReMoS/CV_backdoor/attack_finetuner.py class AttackFinetuner (line 29) | class AttackFinetuner(object): method __init__ (line 30) | def __init__( method init_models (line 46) | def init_models(self): method adv_eval (line 70) | def adv_eval(self): method compute_loss (line 92) | def compute_loss(self, batch, label, ce method test (line 106) | def test(self, ): method train (line 129) | def train(self, ): FILE: code/deep/ReMoS/CV_backdoor/backdoor_dataset/cub200.py function addtrigger (line 10) | def addtrigger(img, firefox, fixed_pic): function add4trig (line 21) | def add4trig(img, firefox): class CUB200Data (line 32) | class CUB200Data(data.Dataset): method __init__ (line 33) | def __init__(self, root, is_train=True, transform=None, shots=-1, seed... method __getitem__ (line 108) | def __getitem__(self, index): method __len__ (line 139) | def __len__(self): FILE: code/deep/ReMoS/CV_backdoor/backdoor_dataset/mit67.py function addtrigger (line 12) | def addtrigger(img, firefox, fixed_pic): function add4trig (line 23) | def add4trig(img, firefox): class MIT67Data (line 34) | class MIT67Data(data.Dataset): method __init__ (line 35) | def __init__(self, root, is_train=False, transform=None, shots=-1, see... method __getitem__ (line 98) | def __getitem__(self, index): method __len__ (line 128) | def __len__(self): FILE: code/deep/ReMoS/CV_backdoor/backdoor_dataset/stanford_40.py function addtrigger (line 11) | def addtrigger(img, firefox, fixed_pic): function add4trig (line 22) | def add4trig(img, firefox): class Stanford40Data (line 33) | class Stanford40Data(data.Dataset): method __init__ (line 34) | def __init__(self, root, is_train=False, transform=None, shots=-1, see... method __getitem__ (line 94) | def __getitem__(self, index): method __len__ (line 123) | def __len__(self): FILE: code/deep/ReMoS/CV_backdoor/clean_dataset/cub200.py class CUB200Data (line 8) | class CUB200Data(data.Dataset): method __init__ (line 9) | def __init__(self, root, is_train=True, transform=None, shots=-1, seed... method __getitem__ (line 71) | def __getitem__(self, index): method __len__ (line 85) | def __len__(self): FILE: code/deep/ReMoS/CV_backdoor/clean_dataset/mit67.py class MIT67Data (line 11) | class MIT67Data(data.Dataset): method __init__ (line 12) | def __init__(self, root, is_train=False, transform=None, shots=-1, see... method __getitem__ (line 63) | def __getitem__(self, index): method __len__ (line 74) | def __len__(self): FILE: code/deep/ReMoS/CV_backdoor/clean_dataset/stanford_40.py class Stanford40Data (line 10) | class Stanford40Data(data.Dataset): method __init__ (line 11) | def __init__(self, root, is_train=False, transform=None, shots=-1, see... method __getitem__ (line 63) | def __getitem__(self, index): method __len__ (line 74) | def __len__(self): FILE: code/deep/ReMoS/CV_backdoor/eval.py function get_args (line 47) | def get_args(): function target_test (line 71) | def target_test(model, loader): function clean_test (line 95) | def clean_test(model, loader): function untarget_test (line 116) | def untarget_test(model, loader): function testing (line 140) | def testing(model, test_loader): function generate_dataloader (line 180) | def generate_dataloader(args, normalize, seed): FILE: code/deep/ReMoS/CV_backdoor/eval_robustness.py function advtest (line 21) | def advtest(model, loader, adversary, args): function record_act (line 66) | def record_act(self, input, output): function get_args (line 69) | def get_args(): function myloss (line 87) | def myloss(yhat, y): FILE: code/deep/ReMoS/CV_backdoor/finetune.py function get_args (line 43) | def get_args(): function target_test (line 113) | def target_test(model, loader): function clean_test (line 137) | def clean_test(model, loader): function untarget_test (line 158) | def untarget_test(model, loader): function testing (line 182) | def testing(model, test_loader): function generate_dataloader (line 222) | def generate_dataloader(args, normalize, seed): FILE: code/deep/ReMoS/CV_backdoor/finetuner.py class Finetuner (line 26) | class Finetuner(object): method __init__ (line 27) | def __init__( method init_models (line 44) | def init_models(self): method adv_eval (line 68) | def adv_eval(self): method compute_loss (line 77) | def compute_loss( method test (line 92) | def test(self, ): method train (line 115) | def train(self, ): FILE: code/deep/ReMoS/CV_backdoor/model/fe_resnet.py function conv3x3 (line 24) | def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1): function conv1x1 (line 30) | def conv1x1(in_planes, out_planes, stride=1): class BasicBlock (line 35) | class BasicBlock(nn.Module): method __init__ (line 39) | def __init__(self, inplanes, planes, stride=1, downsample=None, groups=1, method forward (line 58) | def forward(self, x): class Bottleneck (line 78) | class Bottleneck(nn.Module): method __init__ (line 82) | def __init__(self, inplanes, planes, stride=1, downsample=None, groups=1, method forward (line 99) | def forward(self, x): class ResNet (line 122) | class ResNet(nn.Module): method __init__ (line 124) | def __init__(self, block, layers, num_classes=1000, zero_init_residual... method _make_layer (line 183) | def _make_layer(self, block, planes, blocks, stride=1, dilate=False): method _forward_impl (line 207) | def _forward_impl(self, x): method forward (line 233) | def forward(self, x): function _resnet (line 236) | def _resnet(arch, block, layers, pretrained, progress, **kwargs): function resnet18_dropout (line 250) | def resnet18_dropout(pretrained=False, progress=True, **kwargs): function resnet34_dropout (line 260) | def resnet34_dropout(pretrained=False, progress=True, **kwargs): function resnet50_dropout (line 270) | def resnet50_dropout(pretrained=False, progress=True, **kwargs): function resnet101_dropout (line 281) | def resnet101_dropout(pretrained=False, progress=True, **kwargs): function feresnet18 (line 291) | def feresnet18(pretrained=False, progress=True, **kwargs): function feresnet34 (line 302) | def feresnet34(pretrained=False, progress=True, **kwargs): function feresnet50 (line 313) | def feresnet50(pretrained=False, progress=True, **kwargs): function feresnet101 (line 324) | def feresnet101(pretrained=False, progress=True, **kwargs): function feresnet152 (line 335) | def feresnet152(pretrained=False, progress=True, **kwargs): function resnext50_32x4d (line 346) | def resnext50_32x4d(pretrained=False, progress=True, **kwargs): function resnext101_32x8d (line 359) | def resnext101_32x8d(pretrained=False, progress=True, **kwargs): function wide_resnet50_2 (line 372) | def wide_resnet50_2(pretrained=False, progress=True, **kwargs): function wide_resnet101_2 (line 388) | def wide_resnet101_2(pretrained=False, progress=True, **kwargs): FILE: code/deep/ReMoS/CV_backdoor/prune.py function weight_prune (line 19) | def weight_prune( FILE: code/deep/ReMoS/CV_backdoor/remos/analyze_coverage.py function get_args (line 45) | def get_args(): FILE: code/deep/ReMoS/CV_backdoor/remos/coverage/my_neuron_coverage.py class MyNeuronCoverage (line 14) | class MyNeuronCoverage: method __init__ (line 28) | def __init__(self, threshold=0.5): method init_structure (line 40) | def init_structure(self, intermediate_layer_outputs, features_index): method update (line 55) | def update( method report (line 139) | def report(self, *args): method get (line 160) | def get(self, ): method _scale (line 185) | def _scale(intermediate_layer_output): method _calc_1 (line 210) | def _calc_1(intermediate_layer_output, features_index, threshold): method _calc_2 (line 252) | def _calc_2(intermediate_layer_output, features_index, threshold): FILE: code/deep/ReMoS/CV_backdoor/remos/coverage/pytorch_wrapper.py class PyTorchModel (line 15) | class PyTorchModel: method __init__ (line 34) | def __init__(self, model, intermedia_mode=""): method predict (line 44) | def predict(self, dataset, callbacks, batch_size=16): method one_sample_intermediate_layer_outputs (line 74) | def one_sample_intermediate_layer_outputs(self, sample, callbacks, ): method _intermediate_layers (line 101) | def _intermediate_layers(self, module, pre_name=""): FILE: code/deep/ReMoS/CV_backdoor/remos/coverage/strong_neuron_activation_coverage.py class StrongNeuronActivationCoverage (line 14) | class StrongNeuronActivationCoverage(MyNeuronCoverage): method __init__ (line 15) | def __init__(self, k=5): method _calc_1 (line 24) | def _calc_1(intermediate_layer_output, features_index, k): method _calc_2 (line 73) | def _calc_2(intermediate_layer_output, features_index, threshold): FILE: code/deep/ReMoS/CV_backdoor/remos/coverage/test_max.py function get_max_values (line 5) | def get_max_values(array, k): FILE: code/deep/ReMoS/CV_backdoor/remos/coverage/top_k_coverage.py class TopKNeuronCoverage (line 14) | class TopKNeuronCoverage(MyNeuronCoverage): method __init__ (line 15) | def __init__(self, k=5): method _calc_1 (line 24) | def _calc_1(intermediate_layer_output, features_index, threshold): method _calc_2 (line 72) | def _calc_2(intermediate_layer_output, features_index, threshold): FILE: code/deep/ReMoS/CV_backdoor/remos/coverage/utils/common.py function readable_time_str (line 13) | def readable_time_str(): function user_home_dir (line 27) | def user_home_dir(): function to_numpy (line 39) | def to_numpy(data): FILE: code/deep/ReMoS/CV_backdoor/remos/coverage/utils/keras.py class ImageNetValData (line 16) | class ImageNetValData(): class ImageNetValDataX (line 43) | class ImageNetValDataX(): method __init__ (line 45) | def __init__(self, dir, filenames, fashion, size, transform): method __len__ (line 52) | def __len__(self): method __getitem__ (line 55) | def __getitem__(self, index): method __init__ (line 91) | def __init__(self, fashion, size, transform=None, shuffle=False, seed=... method __len__ (line 112) | def __len__(self): method filenames (line 116) | def filenames(self): function imagenet_benchmark_zoo_model_names (line 120) | def imagenet_benchmark_zoo_model_names(): function imagenet_benchmark_zoo (line 137) | def imagenet_benchmark_zoo(model_name, data_original_shuffle=True, data_... function cifar10_data (line 343) | def cifar10_data(train=False, num_max=None): function mnist_data (line 374) | def mnist_data(train=False, num_max=None): FILE: code/deep/ReMoS/CV_backdoor/remos/coverage/utils/mxnet.py class ImageNetValDataset (line 16) | class ImageNetValDataset(mxnet.gluon.data.Dataset): method __init__ (line 45) | def __init__(self, resize_size, center_crop_size, preprocess, shuffle=... method __len__ (line 67) | def __len__(self): method __getitem__ (line 70) | def __getitem__(self, index): method filenames (line 82) | def filenames(self): function imagenet_benchmark_zoo_model_names (line 86) | def imagenet_benchmark_zoo_model_names(): function imagenet_benchmark_zoo (line 104) | def imagenet_benchmark_zoo(model_name, data_original_shuffle=True, data_... function cifar10_dataset (line 228) | def cifar10_dataset(train=False, num_max=None): function mnist_dataset (line 251) | def mnist_dataset(train=False, num_max=None): FILE: code/deep/ReMoS/CV_backdoor/remos/coverage/utils/pytorch.py class ImageNetValDataset (line 17) | class ImageNetValDataset(torch.utils.data.Dataset): method __init__ (line 46) | def __init__(self, resize_size, center_crop_size, preprocess, shuffle=... method __len__ (line 68) | def __len__(self): method __getitem__ (line 71) | def __getitem__(self, index): method filenames (line 82) | def filenames(self): function imagenet_benchmark_zoo_model_names (line 86) | def imagenet_benchmark_zoo_model_names(): function imagenet_benchmark_zoo (line 104) | def imagenet_benchmark_zoo(model_name, data_original_shuffle=True, data_... function cifar10_dataset (line 228) | def cifar10_dataset(train=False, num_max=None): function mnist_dataset (line 253) | def mnist_dataset(train=False, num_max=None): FILE: code/deep/ReMoS/CV_backdoor/remos/coverage/utils/tensorflow.py class ImageNetValData (line 22) | class ImageNetValData(): class ImageNetValDataX (line 54) | class ImageNetValDataX(): method __init__ (line 56) | def __init__(self, dir, filenames, width, height, fashion, transform): method __len__ (line 64) | def __len__(self): method __getitem__ (line 67) | def __getitem__(self, index): method _smallest_size_at_least (line 98) | def _smallest_size_at_least(self, height, width, smallest_side): method _aspect_preserving_resize (line 108) | def _aspect_preserving_resize(self, image, smallest_side): method _central_crop (line 120) | def _central_crop(self, image_list, crop_height, crop_width): method _crop (line 130) | def _crop(self, image, offset_height, offset_width, crop_height, cro... method __init__ (line 142) | def __init__(self, width, height, fashion, transform=None, label_offse... method __len__ (line 163) | def __len__(self): method filenames (line 167) | def filenames(self): function imagenet_benchmark_zoo_model_names (line 171) | def imagenet_benchmark_zoo_model_names(): function imagenet_benchmark_zoo (line 191) | def imagenet_benchmark_zoo(model_name, data_original_shuffle=True, data_... function cifar10_test_data (line 535) | def cifar10_test_data(num_max=None): function mnist_test_data (line 557) | def mnist_test_data(num_max=None): FILE: code/deep/ReMoS/CV_backdoor/remos/my_profile.py function adv_whitebox (line 39) | def adv_whitebox(model, loader, args, bounds,): function get_coverage (line 103) | def get_coverage(args,): function compute_selected_neuron_value (line 114) | def compute_selected_neuron_value( function log_coverage (line 133) | def log_coverage(model, loader, args, ): function record_act (line 171) | def record_act(self, input, output): function get_args (line 174) | def get_args(): function load_student (line 210) | def load_student(ckpt, args, num_classes): FILE: code/deep/ReMoS/CV_backdoor/remos/nc_pruner.py class NCPruner (line 27) | class NCPruner(WeightPruner): method __init__ (line 28) | def __init__( method prune_record (line 40) | def prune_record(self, log): method init_prune (line 44) | def init_prune(self): method check_param_num (line 51) | def check_param_num(self): method load_nc_info (line 62) | def load_nc_info(self,): method weight_prune (line 74) | def weight_prune( method final_check_param_num (line 151) | def final_check_param_num(self): FILE: code/deep/ReMoS/CV_backdoor/remos/remos_pruner.py class ReMoSPruner (line 29) | class ReMoSPruner(NCPruner): method __init__ (line 30) | def __init__( method load_nc_info (line 42) | def load_nc_info(self,): method weight_prune (line 54) | def weight_prune( method final_check_param_num (line 168) | def final_check_param_num(self): FILE: code/deep/ReMoS/CV_backdoor/trigger.py function teacher_train (line 38) | def teacher_train(teacher, args): FILE: code/deep/ReMoS/CV_backdoor/utils.py class MovingAverageMeter (line 22) | class MovingAverageMeter(object): method __init__ (line 24) | def __init__(self, name, fmt=':f', momentum=0.9): method reset (line 30) | def reset(self): method update (line 35) | def update(self, val, n=1): method __str__ (line 39) | def __str__(self): class ProgressMeter (line 43) | class ProgressMeter(object): method __init__ (line 44) | def __init__(self, num_batches, meters, prefix="", output_dir=None): method display (line 53) | def display(self, batch): method _get_batch_fmtstr (line 62) | def _get_batch_fmtstr(self, num_batches): class CrossEntropyLabelSmooth (line 67) | class CrossEntropyLabelSmooth(nn.Module): method __init__ (line 68) | def __init__(self, num_classes, epsilon = 0.1): method forward (line 74) | def forward(self, inputs, targets): function linear_l2 (line 82) | def linear_l2(model, beta_lmda): function l2sp (line 90) | def l2sp(model, reg): function advtest_fast (line 110) | def advtest_fast(model, loader, adversary, args): FILE: code/deep/ReMoS/CV_backdoor/weight_pruner.py class WeightPruner (line 24) | class WeightPruner(Finetuner): method __init__ (line 25) | def __init__( method prune_record (line 48) | def prune_record(self, log): method init_prune (line 52) | def init_prune(self): method iterative_prune (line 59) | def iterative_prune(self, iteration): method check_param_num (line 79) | def check_param_num(self): method weight_prune (line 91) | def weight_prune( method final_check_param_num (line 157) | def final_check_param_num(self): FILE: code/deep/TCP/dataset.py function loader (line 15) | def loader(path, batch_size=16, num_workers=1, pin_memory=True): function test_loader (line 31) | def test_loader(path, batch_size=16, num_workers=1, pin_memory=True): FILE: code/deep/TCP/finetune.py class DANNet (line 27) | class DANNet(nn.Module): method __init__ (line 28) | def __init__(self): method forward (line 46) | def forward(self, source, target): class FilterPrunner (line 59) | class FilterPrunner: method __init__ (line 60) | def __init__(self, model): method reset (line 64) | def reset(self): method forward (line 72) | def forward(self, x, x_target): # NOTE: whether to add target data method compute_rank_1 (line 108) | def compute_rank_1(self, grad): method compute_rank_2 (line 121) | def compute_rank_2(self, grad): method lowest_ranking_filters (line 134) | def lowest_ranking_filters(self, num): method normalize_ranks_per_layer (line 163) | def normalize_ranks_per_layer(self): method get_prunning_plan (line 173) | def get_prunning_plan(self, num_filters_to_prune): class PrunningFineTuner_VGGnet (line 195) | class PrunningFineTuner_VGGnet: method __init__ (line 196) | def __init__(self, train_path, test_path, model): method test (line 212) | def test(self): method train (line 231) | def train(self, optimizer = None, epoches = 10, save_name=None): method train_epoch (line 250) | def train_epoch(self, optimizer = None, epoch = 0, epoches = 0, rank_f... method get_candidates_to_prune (line 294) | def get_candidates_to_prune(self, num_filters_to_prune): method total_num_filters (line 300) | def total_num_filters(self): method prune (line 307) | def prune(self, perc_ind, perchan): function total_num_channels (line 359) | def total_num_channels(model): function get_args (line 367) | def get_args(): FILE: code/deep/TCP/mmd.py function mmd_linear (line 13) | def mmd_linear(f_of_X, f_of_Y): function guassian_kernel (line 18) | def guassian_kernel(source, target, kernel_mul=2.0, kernel_num=5, fix_si... function mmd_rbf_accelerate (line 34) | def mmd_rbf_accelerate(source, target, kernel_mul=2.0, kernel_num=5, fix... function mmd_rbf_noaccelerate (line 46) | def mmd_rbf_noaccelerate(source, target, kernel_mul=2.0, kernel_num=5, f... function pairwise_distance (line 60) | def pairwise_distance(x, y): function gaussian_kernel_matrix (line 74) | def gaussian_kernel_matrix(x, y, sigmas): function maximum_mean_discrepancy (line 81) | def maximum_mean_discrepancy(x, y, kernel= gaussian_kernel_matrix): function mmd_loss (line 86) | def mmd_loss(source_features, target_features): FILE: code/deep/TCP/prune.py function replace_layers (line 9) | def replace_layers(model, i, indexes, layers): function prune_vgg16_conv_layer (line 14) | def prune_vgg16_conv_layer(model, layer_index, filter_index): FILE: code/deep/TCP/tools.py function print_layers_num (line 11) | def print_layers_num(): function print_model_parm_nums (line 27) | def print_model_parm_nums(model): function print_model_parm_flops (line 34) | def print_model_parm_flops(model): function total_num_channels (line 123) | def total_num_channels(model): FILE: code/deep/adarnn/base/AdaRNN.py class AdaRNN (line 7) | class AdaRNN(nn.Module): method __init__ (line 12) | def __init__(self, use_bottleneck=False, bottleneck_width=256, n_input... method init_layers (line 69) | def init_layers(self): method forward_pre_train (line 74) | def forward_pre_train(self, x, len_win=0): method gru_features (line 100) | def gru_features(self, x, predict=False): method process_gate_weight (line 115) | def process_gate_weight(self, out, index): method get_features (line 126) | def get_features(self, output_list): method forward_Boosting (line 134) | def forward_Boosting(self, x, weight_mat=None): method update_weight_Boosting (line 163) | def update_weight_Boosting(self, weight_mat, dist_old, dist_new): method predict (line 174) | def predict(self, x): FILE: code/deep/adarnn/base/loss/adv_loss.py class ReverseLayerF (line 8) | class ReverseLayerF(Function): method forward (line 11) | def forward(ctx, x, alpha): method backward (line 16) | def backward(ctx, grad_output): class Discriminator (line 21) | class Discriminator(nn.Module): method __init__ (line 22) | def __init__(self, input_dim=256, hidden_dim=256): method forward (line 29) | def forward(self, x): function adv (line 36) | def adv(source, target, input_dim=256, hidden_dim=512): FILE: code/deep/adarnn/base/loss/coral.py function CORAL (line 3) | def CORAL(source, target): FILE: code/deep/adarnn/base/loss/cos.py function cosine (line 3) | def cosine(source, target): FILE: code/deep/adarnn/base/loss/kl_js.py function kl_div (line 3) | def kl_div(source, target): function js (line 13) | def js(source, target): FILE: code/deep/adarnn/base/loss/mmd.py class MMD_loss (line 4) | class MMD_loss(nn.Module): method __init__ (line 5) | def __init__(self, kernel_type='linear', kernel_mul=2.0, kernel_num=5): method guassian_kernel (line 12) | def guassian_kernel(self, source, target, kernel_mul=2.0, kernel_num=5... method linear_mmd (line 31) | def linear_mmd(self, X, Y): method forward (line 36) | def forward(self, source, target): FILE: code/deep/adarnn/base/loss/mutual_info.py class Mine_estimator (line 5) | class Mine_estimator(nn.Module): method __init__ (line 6) | def __init__(self, input_dim=2048, hidden_dim=512): method forward (line 10) | def forward(self, X, Y): class Mine (line 20) | class Mine(nn.Module): method __init__ (line 21) | def __init__(self, input_dim=2048, hidden_dim=512): method forward (line 27) | def forward(self, x, y): FILE: code/deep/adarnn/base/loss/pair_dist.py function pairwise_dist (line 5) | def pairwise_dist(X, Y): function pairwise_dist_np (line 14) | def pairwise_dist_np(X, Y): function pa (line 24) | def pa(X, Y): FILE: code/deep/adarnn/base/loss_transfer.py class TransferLoss (line 4) | class TransferLoss(object): method __init__ (line 5) | def __init__(self, loss_type='cosine', input_dim=512): method compute (line 12) | def compute(self, X, Y): FILE: code/deep/adarnn/dataset/data_act.py function format_data_x (line 12) | def format_data_x(datafile): function format_data_y (line 33) | def format_data_y(datafile): function load_data (line 41) | def load_data(data_folder, domain): function onehot_to_label (line 82) | def onehot_to_label(y_onehot): class data_loader (line 87) | class data_loader(Dataset): method __init__ (line 88) | def __init__(self, samples, labels, t): method __getitem__ (line 93) | def __getitem__(self, index): method __len__ (line 100) | def __len__(self): function normalize (line 104) | def normalize(x): FILE: code/deep/adarnn/dataset/data_process.py function load_act_data (line 12) | def load_act_data(data_folder, batch_size=64, domain="1_20"): function load_weather_data (line 27) | def load_weather_data(file_path, batch_size=6, station='Changping'): function get_split_time (line 42) | def get_split_time(num_domain=2, mode='pre_process', data_file = None, s... function TDC (line 54) | def TDC(num_domain, data_file, station, dis_type = 'coral'): function load_weather_data_multi_domain (line 113) | def load_weather_data_multi_domain(file_path, batch_size=6, station='Cha... FILE: code/deep/adarnn/dataset/data_weather.py class data_loader (line 15) | class data_loader(Dataset): method __init__ (line 16) | def __init__(self, df_feature, df_label, df_label_reg, t=None): method __getitem__ (line 34) | def __getitem__(self, index): method __len__ (line 41) | def __len__(self): function create_dataset (line 45) | def create_dataset(df, station, start_date, end_date, mean=None, std=None): function create_dataset_shallow (line 69) | def create_dataset_shallow(df, station, start_date, end_date, mean=None,... function get_dataset_statistic (line 91) | def get_dataset_statistic(df, station, start_date, end_date): function get_weather_data (line 111) | def get_weather_data(data_file, station, start_time, end_time, batch_siz... function get_weather_data_shallow (line 121) | def get_weather_data_shallow(data_file, station, start_time, end_time, b... function get_weather_data_statistic (line 130) | def get_weather_data_statistic(data_file, station, start_time, end_time): FILE: code/deep/adarnn/train_weather.py function pprint (line 19) | def pprint(*text): function get_model (line 30) | def get_model(name='AdaRNN'): function train_AdaRNN (line 35) | def train_AdaRNN(args, model, optimizer, train_loader_list, epoch, dist_... function train_epoch_transfer_Boosting (line 108) | def train_epoch_transfer_Boosting(model, optimizer, train_loader_list, e... function get_index (line 174) | def get_index(num_domain=2): function train_epoch_transfer (line 182) | def train_epoch_transfer(args, model, optimizer, train_loader_list): function count_parameters (line 244) | def count_parameters(model): function test_epoch (line 248) | def test_epoch(model, test_loader, prefix='Test'): function test_epoch_inference (line 272) | def test_epoch_inference(model, test_loader, prefix='Test'): function inference (line 305) | def inference(model, data_loader): function inference_all (line 311) | def inference_all(output_path, model, model_path, loaders): function transform_type (line 330) | def transform_type(init_weight): function main_transfer (line 338) | def main_transfer(args): function get_args (line 415) | def get_args(): FILE: code/deep/adarnn/transformer_adapt.py function pprint (line 19) | def pprint(*text): function count_parameters (line 30) | def count_parameters(model): function train_epoch (line 34) | def train_epoch(args, model, optimizer, src_train_loader, trg_train_loa... function test_epoch (line 74) | def test_epoch(model, test_loader, prefix='Test'): function test_epoch_inference (line 99) | def test_epoch_inference(model, test_loader, prefix='Test'): function inference (line 133) | def inference(model, data_loader): function inference_all (line 139) | def inference_all(output_path, model, model_path, loaders): function main_transfer (line 159) | def main_transfer(args): function get_args (line 246) | def get_args(): FILE: code/deep/adarnn/tst/decoder.py class Decoder (line 10) | class Decoder(nn.Module): method __init__ (line 37) | def __init__(self, method forward (line 71) | def forward(self, x: torch.Tensor, memory: torch.Tensor) -> torch.Tensor: FILE: code/deep/adarnn/tst/encoder.py class Encoder (line 10) | class Encoder(nn.Module): method __init__ (line 37) | def __init__(self, method forward (line 69) | def forward(self, x: torch.Tensor) -> torch.Tensor: method attention_map (line 99) | def attention_map(self) -> torch.Tensor: FILE: code/deep/adarnn/tst/loss.py class OZELoss (line 5) | class OZELoss(nn.Module): method __init__ (line 24) | def __init__(self, reduction: str = 'mean', alpha: float = 0.3): method forward (line 32) | def forward(self, FILE: code/deep/adarnn/tst/multiHeadAttention.py class MultiHeadAttention (line 11) | class MultiHeadAttention(nn.Module): method __init__ (line 33) | def __init__(self, method forward (line 56) | def forward(self, method attention_map (line 118) | def attention_map(self) -> torch.Tensor: class MultiHeadAttentionChunk (line 128) | class MultiHeadAttentionChunk(MultiHeadAttention): method __init__ (line 154) | def __init__(self, method forward (line 175) | def forward(self, class MultiHeadAttentionWindow (line 236) | class MultiHeadAttentionWindow(MultiHeadAttention): method __init__ (line 265) | def __init__(self, method forward (line 293) | def forward(self, FILE: code/deep/adarnn/tst/positionwiseFeedForward.py class PositionwiseFeedForward (line 8) | class PositionwiseFeedForward(nn.Module): method __init__ (line 22) | def __init__(self, method forward (line 31) | def forward(self, x: torch.Tensor) -> torch.Tensor: FILE: code/deep/adarnn/tst/transformer.py class Transformer (line 9) | class Transformer(nn.Module): method __init__ (line 55) | def __init__(self, method forward (line 107) | def forward(self, x: torch.Tensor) -> torch.Tensor: method adapt_encoding_weight (line 177) | def adapt_encoding_weight(self, list_encoding, loss_type, train_type, ... method update_weight_Boosting (line 205) | def update_weight_Boosting(self, weight_mat, dist_old, dist_new): FILE: code/deep/adarnn/tst/utils.py function generate_original_PE (line 7) | def generate_original_PE(length: int, d_model: int) -> torch.Tensor: function generate_regular_PE (line 32) | def generate_regular_PE(length: int, d_model: int, period: Optional[int]... function generate_local_map_mask (line 58) | def generate_local_map_mask(chunk_size: int, FILE: code/deep/adarnn/utils/heat_map.py function draw_heatmap (line 8) | def draw_heatmap(data, filename): FILE: code/deep/adarnn/utils/metrics.py function robust_zscore_tensor (line 5) | def robust_zscore_tensor(x): function calc_ic (line 14) | def calc_ic(pred, label): function calc_r2 (line 20) | def calc_r2(pred, label): function metric_fn (line 24) | def metric_fn(pred, label, metric='IC'): function robust_zscore (line 34) | def robust_zscore(x): function calc_all_metrics (line 42) | def calc_all_metrics(pred): function logcosh (line 63) | def logcosh(pred, label): FILE: code/deep/adarnn/utils/utils.py class AverageMeter (line 11) | class AverageMeter(object): method __init__ (line 12) | def __init__(self): method reset (line 15) | def reset(self): method update (line 22) | def update(self, val, n=1): function average_params (line 30) | def average_params(params_list): function zscore (line 49) | def zscore(x): function calc_loss (line 53) | def calc_loss(pred, label): function calc_corr (line 57) | def calc_corr(pred, label): function test_ic (line 61) | def test_ic(model_list, data_list, device, verbose=True, ic_type='spearm... function test_ic_daily (line 97) | def test_ic_daily(model_list, data_list, device, verbose=True, ic_type='... function test_ic_uni (line 135) | def test_ic_uni(model, data_loader, model_path=None, ic_type='spearman',... function calc_ic (line 160) | def calc_ic(x, y, ic_type='pearson'): function create_dir (line 168) | def create_dir(path): function handle_nan (line 172) | def handle_nan(x): class Log_Loss (line 176) | class Log_Loss(nn.Module): method __init__ (line 177) | def __init__(self): method forward (line 180) | def forward(self, ytrue, ypred): function spearman_corr (line 184) | def spearman_corr(x, y): function spearman_corr2 (line 190) | def spearman_corr2(x, y): function pearson_corr (line 196) | def pearson_corr(x, y): function dir_exist (line 202) | def dir_exist(dirs): FILE: code/deep/adarnn/utils/visualize.py class Visualize (line 7) | class Visualize(object): method __init__ (line 8) | def __init__(self, port=8097, env='env'): method plot_line (line 13) | def plot_line(self, Y, global_step, title='title', legend=['legend']): method heat_map (line 33) | def heat_map(self, X, title='title'): method log (line 44) | def log(self, info, title='log_text'): function test (line 57) | def test(): FILE: code/deep/finetune_AlexNet_ResNet/data_loader.py function load_data (line 6) | def load_data(root_path, dir, batch_size, phase): function load_train (line 25) | def load_train(root_path, dir, batch_size, phase): FILE: code/deep/finetune_AlexNet_ResNet/finetune_office31.py function load_model (line 34) | def load_model(name='alexnet'): function get_optimizer (line 50) | def get_optimizer(model_name): function lr_schedule (line 72) | def lr_schedule(optimizer, epoch): function test (line 84) | def test(model, target_test_loader): function finetune (line 99) | def finetune(model, dataloaders, optimizer): FILE: code/deep/fixed/alg/alg.py function get_algorithm_class (line 9) | def get_algorithm_class(algorithm_name): FILE: code/deep/fixed/alg/algs/Fixed.py class Fixed (line 12) | class Fixed(Algorithm): method __init__ (line 14) | def __init__(self, args): method update (line 29) | def update(self, minibatches, opt, sch): method predict (line 59) | def predict(self, x): FILE: code/deep/fixed/alg/algs/base.py class Algorithm (line 5) | class Algorithm(torch.nn.Module): method __init__ (line 6) | def __init__(self, args): method update (line 9) | def update(self, minibatches): method predict (line 12) | def predict(self, x): FILE: code/deep/fixed/alg/modelopera.py function get_fea (line 6) | def get_fea(args): function accuracy (line 11) | def accuracy(network, loader, weights, usedpredict='p'): FILE: code/deep/fixed/alg/opt.py function get_params (line 5) | def get_params(alg, args): function get_optimizer (line 23) | def get_optimizer(alg, args): function get_scheduler (line 30) | def get_scheduler(optimizer, args): FILE: code/deep/fixed/datautil/actdata/cross_people.py class ActList (line 8) | class ActList(mydataset): method __init__ (line 9) | def __init__(self, args, dataset, root_dir, people_group, group_num, t... method comb_position (line 26) | def comb_position(self, x, cy, py, sy): method set_x (line 42) | def set_x(self, x): FILE: code/deep/fixed/datautil/actdata/util.py function act_train (line 6) | def act_train(): function act_test (line 12) | def act_test(): function loaddata_from_numpy (line 18) | def loaddata_from_numpy(dataset='dsads', root_dir='./data/act/'): FILE: code/deep/fixed/datautil/getdataloader.py function get_dataloader (line 11) | def get_dataloader(args, trdatalist, tedatalist): function get_act_dataloader (line 52) | def get_act_dataloader(args): FILE: code/deep/fixed/datautil/mydataloader.py class _InfiniteSampler (line 5) | class _InfiniteSampler(torch.utils.data.Sampler): method __init__ (line 6) | def __init__(self, sampler): method __iter__ (line 9) | def __iter__(self): class InfiniteDataLoader (line 15) | class InfiniteDataLoader: method __init__ (line 16) | def __init__(self, dataset, weights, batch_size, num_workers): method __iter__ (line 41) | def __iter__(self): method __len__ (line 45) | def __len__(self): FILE: code/deep/fixed/datautil/util.py function Nmax (line 7) | def Nmax(args, d): class mydataset (line 14) | class mydataset(object): method __init__ (line 15) | def __init__(self, args): method set_labels (line 25) | def set_labels(self, tlabels=None, label_type='domain_label'): method set_labels_by_index (line 32) | def set_labels_by_index(self, tlabels=None, tindex=None, label_type='d... method target_trans (line 38) | def target_trans(self, y): method input_trans (line 44) | def input_trans(self, x): method __getitem__ (line 50) | def __getitem__(self, index): method __len__ (line 56) | def __len__(self): class subdataset (line 60) | class subdataset(mydataset): method __init__ (line 61) | def __init__(self, args, dataset, indices): function split_trian_val_test (line 72) | def split_trian_val_test(args, da, rate=0.8): function make_weights_for_balanced_classes (line 84) | def make_weights_for_balanced_classes(dataset): function random_pairs_of_minibatches_by_domainperm (line 105) | def random_pairs_of_minibatches_by_domainperm(minibatches): FILE: code/deep/fixed/loss/margin_loss.py function _max_with_relu (line 8) | def _max_with_relu(a, b): function _get_grad (line 12) | def _get_grad(out_, in_): class LargeMarginLoss (line 20) | class LargeMarginLoss: method __init__ (line 21) | def __init__(self, method __call__ (line 43) | def __call__(self, logits, onehot_labels, feature_maps): FILE: code/deep/fixed/network/Adver_network.py class ReverseLayerF (line 6) | class ReverseLayerF(Function): method forward (line 8) | def forward(ctx, x, alpha): method backward (line 13) | def backward(ctx, grad_output): class Discriminator (line 18) | class Discriminator(nn.Module): method __init__ (line 19) | def __init__(self, input_dim=256, hidden_dim=256, num_domains=4): method forward (line 34) | def forward(self, x): FILE: code/deep/fixed/network/act_network.py class ActNetwork (line 13) | class ActNetwork(nn.Module): method __init__ (line 14) | def __init__(self, taskname): method forward (line 33) | def forward(self, x): method getfea (line 38) | def getfea(self, x): FILE: code/deep/fixed/network/common_network.py class feat_bottleneck (line 6) | class feat_bottleneck(nn.Module): method __init__ (line 7) | def __init__(self, feature_dim, bottleneck_dim=256, type="ori"): method forward (line 15) | def forward(self, x): class feat_classifier (line 22) | class feat_classifier(nn.Module): method __init__ (line 23) | def __init__(self, class_num, bottleneck_dim=256, type="linear"): method forward (line 32) | def forward(self, x): FILE: code/deep/fixed/utils/util.py function set_random_seed (line 10) | def set_random_seed(seed=0): function train_valid_target_eval_names (line 19) | def train_valid_target_eval_names(args): function print_row (line 30) | def print_row(row, colwidth=10, latex=False): class Tee (line 45) | class Tee: method __init__ (line 46) | def __init__(self, fname, mode="a"): method write (line 50) | def write(self, message): method flush (line 55) | def flush(self): function act_param_init (line 60) | def act_param_init(args): function get_args (line 69) | def get_args(): function init_args (line 124) | def init_args(args): FILE: code/distance/coral_pytorch.py function CORAL_loss (line 6) | def CORAL_loss(source, target): FILE: code/distance/mmd_numpy_sklearn.py function mmd_linear (line 7) | def mmd_linear(X, Y): function mmd_rbf (line 28) | def mmd_rbf(X, Y, gamma=1.0): function mmd_poly (line 47) | def mmd_poly(X, Y, degree=2, gamma=1, coef0=0): FILE: code/distance/mmd_pytorch.py class MMD_loss (line 7) | class MMD_loss(nn.Module): method __init__ (line 8) | def __init__(self, kernel_type='rbf', kernel_mul=2.0, kernel_num=5): method guassian_kernel (line 15) | def guassian_kernel(self, source, target, kernel_mul=2.0, kernel_num=5... method linear_mmd2 (line 34) | def linear_mmd2(self, f_of_X, f_of_Y): method forward (line 40) | def forward(self, source, target): FILE: code/distance/proxy_a_distance.py function proxy_a_distance (line 7) | def proxy_a_distance(source_X, target_X, verbose=False): FILE: code/feature_extractor/for_digit_data/digit_data_loader.py class GetDataset (line 20) | class GetDataset(data.Dataset): method __init__ (line 31) | def __init__(self, data, label, method __getitem__ (line 38) | def __getitem__(self, index): method __len__ (line 67) | def __len__(self): function dense_to_one_hot (line 71) | def dense_to_one_hot(labels_dense): function load_mnist (line 84) | def load_mnist(path, scale=True, usps=False, all_use=True): function load_svhn (line 116) | def load_svhn(path_train, path_test): function load_usps (line 129) | def load_usps(path, all_use=True): function load_dataset (line 151) | def load_dataset(domain, root_dir): function load_data (line 163) | def load_data(domain, root_dir, batch_size): FILE: code/feature_extractor/for_digit_data/digit_deep_feature.py function finetune (line 42) | def finetune(model, dataloaders, optimizer): function extract_feature (line 90) | def extract_feature(model, model_path, dataloader, source, data_name): function classify_1nn (line 109) | def classify_1nn(): FILE: code/feature_extractor/for_digit_data/digit_network.py class Network (line 10) | class Network(nn.Module): method __init__ (line 12) | def __init__(self): method forward (line 35) | def forward(self, input_data): method get_feature (line 45) | def get_feature(self, input_data): FILE: code/feature_extractor/for_image_data/backbone.py class AlexNetFc (line 9) | class AlexNetFc(nn.Module): method __init__ (line 10) | def __init__(self): method forward (line 20) | def forward(self, x): method output_num (line 26) | def output_num(self): class ResNet18Fc (line 30) | class ResNet18Fc(nn.Module): method __init__ (line 31) | def __init__(self): method forward (line 45) | def forward(self, x): method output_num (line 58) | def output_num(self): class ResNet34Fc (line 62) | class ResNet34Fc(nn.Module): method __init__ (line 63) | def __init__(self): method forward (line 77) | def forward(self, x): method output_num (line 90) | def output_num(self): class ResNet50Fc (line 94) | class ResNet50Fc(nn.Module): method __init__ (line 95) | def __init__(self): method forward (line 109) | def forward(self, x): method output_num (line 122) | def output_num(self): class ResNet101Fc (line 126) | class ResNet101Fc(nn.Module): method __init__ (line 127) | def __init__(self): method forward (line 141) | def forward(self, x): method output_num (line 154) | def output_num(self): class ResNet152Fc (line 158) | class ResNet152Fc(nn.Module): method __init__ (line 159) | def __init__(self): method forward (line 173) | def forward(self, x): method output_num (line 186) | def output_num(self): FILE: code/feature_extractor/for_image_data/data_load.py function load_data (line 7) | def load_data(data_folder, batch_size, phase='train', train_val_split=Tr... class ImageCLEF (line 46) | class ImageCLEF(torch.utils.data.Dataset): method __init__ (line 47) | def __init__(self, root_dir, domain, transform=None): method __getitem__ (line 59) | def __getitem__(self, index): method __len__ (line 67) | def __len__(self): function load_imageclef_train (line 70) | def load_imageclef_train(root_path, domain, batch_size, phase): function load_imageclef_test (line 96) | def load_imageclef_test(root_path, domain, batch_size, phase): FILE: code/feature_extractor/for_image_data/main.py function get_optimizer (line 49) | def get_optimizer(model): function lr_schedule (line 61) | def lr_schedule(optimizer, epoch): function finetune (line 74) | def finetune(model, dataloaders, optimizer, criterion, best_model_path, ... class FeatureExtractor (line 128) | class FeatureExtractor(nn.Module): method __init__ (line 129) | def __init__(self, model, extracted_layers): method forward (line 135) | def forward(self, x): function extract_feature (line 146) | def extract_feature(model, dataloader, save_path, load_from_disk=True, m... function classify_1nn (line 173) | def classify_1nn(data_train, data_test): FILE: code/feature_extractor/for_image_data/models.py class Network (line 6) | class Network(nn.Module): method __init__ (line 7) | def __init__(self, base_net='alexnet', n_class=31): method forward (line 16) | def forward(self, x): method get_features (line 21) | def get_features(self, x): FILE: code/traditional/BDA/BDA.py function kernel (line 16) | def kernel(ker, X1, X2, gamma): function proxy_a_distance (line 36) | def proxy_a_distance(source_X, target_X): function estimate_mu (line 55) | def estimate_mu(_X1, _Y1, _X2, _Y2): class BDA (line 75) | class BDA: method __init__ (line 76) | def __init__(self, kernel_type='primal', dim=30, lamb=1, mu=0.5, gamma... method fit_predict (line 97) | def fit_predict(self, Xs, Ys, Xt, Yt): FILE: code/traditional/CORAL/CORAL.py class CORAL (line 14) | class CORAL: method __init__ (line 15) | def __init__(self): method fit (line 18) | def fit(self, Xs, Xt): method fit_predict (line 33) | def fit_predict(self, Xs, Ys, Xt, Yt): FILE: code/traditional/GFK/GFK.py class GFK (line 15) | class GFK: method __init__ (line 16) | def __init__(self, dim=20): method fit (line 24) | def fit(self, Xs, Xt, norm_inputs=None): method fit_predict (line 97) | def fit_predict(self, Xs, Ys, Xt, Yt): method principal_angles (line 113) | def principal_angles(self, Ps, Pt): method train_pca (line 126) | def train_pca(self, data, mu_data, std_data, subspace_dim): method znorm (line 155) | def znorm(self, data): method subspace_disagreement_measure (line 164) | def subspace_disagreement_measure(self, Ps, Pt, Pst): FILE: code/traditional/JDA/JDA.py function kernel (line 13) | def kernel(ker, X1, X2, gamma): class JDA (line 30) | class JDA: method __init__ (line 31) | def __init__(self, kernel_type='primal', dim=30, lamb=1, gamma=1, T=10): method fit_predict (line 46) | def fit_predict(self, Xs, Ys, Xt, Yt): FILE: code/traditional/KMM.py function kernel (line 19) | def kernel(ker, X1, X2, gamma): class KMM (line 33) | class KMM: method __init__ (line 34) | def __init__(self, kernel_type='linear', gamma=1.0, B=1.0, eps=None): method fit (line 47) | def fit(self, Xs, Xt): function load_data (line 70) | def load_data(folder, domain): function knn_classify (line 76) | def knn_classify(Xs, Ys, Xt, Yt, k=1, norm=False): FILE: code/traditional/MEDA/MEDA.py function kernel (line 16) | def kernel(ker, X1, X2, gamma): function proxy_a_distance (line 33) | def proxy_a_distance(source_X, target_X): class MEDA (line 49) | class MEDA: method __init__ (line 50) | def __init__(self, kernel_type='primal', dim=30, lamb=1, rho=1.0, eta=... method estimate_mu (line 71) | def estimate_mu(self, _X1, _Y1, _X2, _Y2): method fit_predict (line 90) | def fit_predict(self, Xs, Ys, Xt, Yt): FILE: code/traditional/SCL.py class SCL (line 8) | class SCL(object): method __init__ (line 12) | def __init__(self, l2=1.0, num_pivots=10, base_classifer=LinearSVC()): method fit (line 19) | def fit(self, Xs, Xt): method transform (line 49) | def transform(self, X): method fit_predict (line 58) | def fit_predict(self, Xs, Xt, X_test, Ys, Y_test): FILE: code/traditional/SFA.py class SFA (line 11) | class SFA: method __init__ (line 16) | def __init__(self, l=500, K=100, base_classifer=svm.SVC()): method fit (line 27) | def fit(self, Xs, Xt): method transform (line 78) | def transform(self, X): method fit_predict (line 81) | def fit_predict(self, Xs, Xt, X_test, Ys, Y_test): FILE: code/traditional/TCA/TCA.py function kernel (line 14) | def kernel(ker, X1, X2, gamma): class TCA (line 34) | class TCA: method __init__ (line 35) | def __init__(self, kernel_type='primal', dim=30, lamb=1, gamma=1): method fit (line 48) | def fit(self, Xs, Xt): method fit_predict (line 75) | def fit_predict(self, Xs, Ys, Xt, Yt): method fit_new (line 94) | def fit_new(self, Xs, Xt, Xt2): method fit_predict_new (line 128) | def fit_predict_new(self, Xt, Xs, Ys, Xt2, Yt2): function train_valid (line 150) | def train_valid(): FILE: code/traditional/TrAdaBoost.py class TrAdaBoost (line 4) | class TrAdaBoost: method __init__ (line 5) | def __init__(self, iters=10): method fit_predict (line 13) | def fit_predict(self, trans_S, trans_A, label_S, label_A, test): method calculate_P (line 85) | def calculate_P(self, weights, label): method train_classify (line 90) | def train_classify(self, trans_data, trans_label, test_data, P): method calculate_error_rate (line 96) | def calculate_error_rate(self, label_R, label_H, weight): FILE: code/traditional/pyEasyTL/EasyTL.py function get_cosine_dist (line 6) | def get_cosine_dist(A, B): function get_ma_dist (line 25) | def get_ma_dist(A, B): function get_class_center (line 42) | def get_class_center(Xs,Ys,Xt,dist): function EasyTL (line 74) | def EasyTL(Xs,Ys,Xt,Yt,intra_align="coral",dist="euclidean",lp="linear"): FILE: code/traditional/pyEasyTL/intra_alignment.py function GFK_map (line 6) | def GFK_map(Xs, Xt): function gsvd (line 9) | def gsvd(A, B): function getAngle (line 12) | def getAngle(Ps, Pt, DD): function getGFKDim (line 25) | def getGFKDim(Xs, Xt): function PCA_map (line 45) | def PCA_map(Xs, Xt): function CORAL_map (line 53) | def CORAL_map(Xs,Xt): FILE: code/traditional/pyEasyTL/label_prop.py function label_prop (line 5) | def label_prop(C, nt, Dct, lp="linear"): FILE: code/traditional/pyEasyTL/label_prop_v2.py function label_prop (line 4) | def label_prop(C, nt, Dct, lp="linear"): FILE: code/traditional/sot/SOT.py function norm_max (line 16) | def norm_max(x): function load_from_file (line 22) | def load_from_file(root_dir,filename,ss,ts): class MyEncoder (line 37) | class MyEncoder(json.JSONEncoder): method default (line 38) | def default(self, obj): function gmm_target (line 48) | def gmm_target(X,w,c,rootdir,filepath,modelpath,targetname,covtype='diag'): function gmm_source_class (line 72) | def gmm_source_class(X,w,slist,covtype='diag'): function gmm_source (line 94) | def gmm_source(xs,ys,filepath,sourcename,slist=[],covtype='diag'): function entropic_partial_wasserstein (line 120) | def entropic_partial_wasserstein(a, b, M, reg, m=1, numItermax=500, class SOT (line 143) | class SOT: method __init__ (line 144) | def __init__(self,taskname='ACT',root_dir='./clustertemp/',d=200, method get_target (line 154) | def get_target(self,filepath,modelpath,targetname): method get_source (line 161) | def get_source(self,filepath,sourcename): method partot_DA (line 167) | def partot_DA(self,Sx,Sy,Tx,b,xt1,ttt=1): method fit_predict (line 191) | def fit_predict(self, Sx, Sy, Tx, Ty,sfilepath,sourcename,tfilepath,tm... FILE: code/utils/feature_vis.py class FeatureVisualize (line 7) | class FeatureVisualize(object): method __init__ (line 12) | def __init__(self, features, labels): method plot_tsne (line 20) | def plot_tsne(self, save_eps=False): FILE: code/utils/grl.py class GradReverse (line 12) | class GradReverse(torch.autograd.Function): method forward (line 15) | def forward(ctx, x, lambd, **kwargs: None): method backward (line 20) | def backward(ctx, *grad_output): class GradientReverseLayer (line 27) | class GradientReverseLayer(torch.autograd.Function): method __init__ (line 28) | def __init__(self, lambd=1): method forward (line 31) | def forward(self, input): method backward (line 35) | def backward(self, grad_output):