SYMBOL INDEX (1092 symbols across 78 files) FILE: LEO/config.py function get_data_config (line 121) | def get_data_config(): function get_inner_model_config (line 131) | def get_inner_model_config(): function get_outer_model_config (line 149) | def get_outer_model_config(): function load_ifsl_config (line 165) | def load_ifsl_config(config): FILE: LEO/data.py class StrEnum (line 39) | class StrEnum(enum.Enum): method __str__ (line 42) | def __str__(self): method __repr__ (line 45) | def __repr__(self): class MetaDataset (line 49) | class MetaDataset(StrEnum): class EmbeddingCrop (line 55) | class EmbeddingCrop(StrEnum): class MetaSplit (line 61) | class MetaSplit(StrEnum): class DataProvider (line 68) | class DataProvider(object): method __init__ (line 71) | def __init__(self, dataset_split, config, verbose=False, feat_dim=640,... method _check_config (line 80) | def _check_config(self): method _load_data (line 91) | def _load_data(self): method _load (line 112) | def _load(self, opened_file): method _index_data (line 119) | def _index_data(self, raw_data): method _check_data_index (line 143) | def _check_data_index(self, raw_data): method _get_full_pickle_path (line 161) | def _get_full_pickle_path(self, split_name): method get_instance (line 179) | def get_instance(self, num_classes, tr_size, val_size): method get_batch (line 269) | def get_batch(self, batch_size, num_classes, tr_size, val_size, method _check_labels (line 320) | def _check_labels(self, num_classes, tr_size, val_size, FILE: LEO/ifsl_configs/baseline_config.py class Config (line 1) | class Config(): method __init__ (line 2) | def __init__(self): function mini_5_resnet_baseline (line 6) | def mini_5_resnet_baseline(): function mini_1_resnet_baseline (line 18) | def mini_1_resnet_baseline(): function mini_5_wrn_baseline (line 30) | def mini_5_wrn_baseline(): function mini_1_wrn_baseline (line 42) | def mini_1_wrn_baseline(): function tiered_5_resnet_baseline (line 54) | def tiered_5_resnet_baseline(): function tiered_1_resnet_baseline (line 67) | def tiered_1_resnet_baseline(): function tiered_5_wrn_baseline (line 79) | def tiered_5_wrn_baseline(): function tiered_1_wrn_baseline (line 92) | def tiered_1_wrn_baseline(): FILE: LEO/ifsl_configs/ifsl_config.py class Config (line 1) | class Config(): method __init__ (line 2) | def __init__(self): function mini_5_resnet_ifsl (line 5) | def mini_5_resnet_ifsl(): function mini_1_resnet_ifsl (line 31) | def mini_1_resnet_ifsl(): function mini_5_wrn_ifsl (line 56) | def mini_5_wrn_ifsl(): function mini_1_wrn_ifsl (line 82) | def mini_1_wrn_ifsl(): function tiered_5_resnet_ifsl (line 108) | def tiered_5_resnet_ifsl(): function tiered_1_resnet_ifsl (line 134) | def tiered_1_resnet_ifsl(): function tiered_5_wrn_ifsl (line 160) | def tiered_5_wrn_ifsl(): function tiered_1_wrn_ifsl (line 185) | def tiered_1_wrn_ifsl(): FILE: LEO/model.py function get_orthogonality_regularizer (line 36) | def get_orthogonality_regularizer(orthogonality_penalty_weight): function run_leo (line 60) | def run_leo(model, inputs, is_meta_training): class FeatureProcessor (line 74) | class FeatureProcessor(): method __init__ (line 75) | def __init__(self, n_splits, pretrain_mean_filename, feat_dim, is_cosi... method get_d_features (line 96) | def get_d_features(self, logit): method preprocess (line 101) | def preprocess(self, data, center=None, method="none"): method get_split_features (line 111) | def get_split_features(self, data, center, method="none"): method get_features (line 126) | def get_features(self, data): class IFSL (line 158) | class IFSL(snt.AbstractModule): method __init__ (line 159) | def __init__(self, config=None, use_64bits_dtype=True, n_splits=4, is_... method build_input_data (line 191) | def build_input_data(self, support_features, query_features, data): method get_debug_data (line 203) | def get_debug_data(self, data): method fuse_features (line 210) | def fuse_features(self, x1, x2): method _build (line 219) | def _build(self, data, is_meta_training=True, debug=False, break_down=... method calculate_dacc (line 291) | def calculate_dacc(self, data, model_prediction, break_down=False): method grads_and_vars (line 330) | def grads_and_vars(self, metatrain_loss): class LEO (line 339) | class LEO(snt.AbstractModule): method __init__ (line 342) | def __init__(self, config=None, use_64bits_dtype=True, name="leo", dec... method _build (line 364) | def _build(self, data, is_meta_training=True): method leo_inner_loop (line 419) | def leo_inner_loop(self, data, latents): method finetuning_inner_loop (line 442) | def finetuning_inner_loop(self, data, leo_loss, classifier_weights): method forward_encoder (line 460) | def forward_encoder(self, data): method forward_decoder (line 468) | def forward_decoder(self, data, latents): method encoder (line 483) | def encoder(self, inputs): method relation_network (line 498) | def relation_network(self, inputs): method decoder (line 524) | def decoder(self, inputs): method average_codes_per_class (line 541) | def average_codes_per_class(self, codes): method possibly_sample (line 547) | def possibly_sample(self, distribution_params, stddev_offset=0.): method kl_divergence (line 562) | def kl_divergence(self, samples, normal_distribution): method predict (line 569) | def predict(self, inputs, weights): method calculate_inner_loss (line 580) | def calculate_inner_loss(self, inputs, true_outputs, classifier_weights): method save_problem_instance_stats (line 589) | def save_problem_instance_stats(self, instance): method dropout_rate (line 607) | def dropout_rate(self): method loss_fn (line 610) | def loss_fn(self, model_outputs, original_classes): method grads_and_vars (line 617) | def grads_and_vars(self, metatrain_loss): method _l2_regularization (line 656) | def _l2_regularization(self): method _decoder_orthogonality_reg (line 662) | def _decoder_orthogonality_reg(self): FILE: LEO/model_test.py function get_test_config (line 36) | def get_test_config(): function mockify_everything (line 53) | def mockify_everything(test_function=None, function _random_problem_instance (line 126) | def _random_problem_instance(num_classes=7, class LEOTest (line 149) | class LEOTest(tf.test.TestCase, parameterized.TestCase): method setUp (line 151) | def setUp(self): method test_instantiate_leo (line 160) | def test_instantiate_leo(self): method test_inner_loop_adaptation (line 168) | def test_inner_loop_adaptation(self): method test_map_input (line 193) | def test_map_input(self): method test_setting_is_meta_training (line 230) | def test_setting_is_meta_training(self): method test_finetuning_improves_loss (line 237) | def test_finetuning_improves_loss(self): method test_gradients_dont_flow_through_input (line 254) | def test_gradients_dont_flow_through_input(self): method test_inferring_embedding_dim (line 262) | def test_inferring_embedding_dim(self): method test_variable_creation (line 267) | def test_variable_creation(self): method test_graph_construction (line 284) | def test_graph_construction(self): method test_possibly_sample (line 287) | def test_possibly_sample(self): method test_different_shapes (line 308) | def test_different_shapes(self): method test_encoder_penalty (line 315) | def test_encoder_penalty(self): method test_construct_float32_leo_graph (line 332) | def test_construct_float32_leo_graph(self): FILE: LEO/runner.py function _clip_gradients (line 49) | def _clip_gradients(gradients, gradient_threshold, gradient_norm_thresho... function _construct_validation_summaries (line 63) | def _construct_validation_summaries(metavalid_loss, metavalid_accuracy): function _construct_training_summaries (line 69) | def _construct_training_summaries(metatrain_loss, metatrain_accuracy, function _construct_examples_batch (line 80) | def _construct_examples_batch(batch_size, split, num_classes, function _construct_loss_and_accuracy (line 92) | def _construct_loss_and_accuracy(inner_model, inputs, is_meta_training): function construct_debug_graph (line 107) | def construct_debug_graph(outer_model_config): function construct_graph (line 126) | def construct_graph(outer_model_config): function run_debug_loop (line 208) | def run_debug_loop(checkpoint_path): function write_output_message (line 227) | def write_output_message(message, file_name=None): function run_training_loop (line 235) | def run_training_loop(checkpoint_path): function main (line 309) | def main(argv): FILE: LEO/utils.py function unpack_data (line 31) | def unpack_data(problem_instance): function copy_checkpoint (line 38) | def copy_checkpoint(checkpoint_path, global_step, accuracy): function _save_files_in_tmp_directory (line 69) | def _save_files_in_tmp_directory(tmp_checkpoint_path, checkpoint_files, function _is_previous_accuracy_better (line 95) | def _is_previous_accuracy_better(best_checkpoint_path, accuracy): function evaluate_and_average (line 106) | def evaluate_and_average(session, tensor, num_estimates): function evaluate_and_average_acc_dacc (line 111) | def evaluate_and_average_acc_dacc(session, acc, dacc, num_estimates): FILE: MAML_MN_FT/backbone.py function init_layer (line 18) | def init_layer(L): class NNClassifier (line 28) | class NNClassifier(): method __init__ (line 29) | def __init__(self, n_way): method normalize (line 32) | def normalize(self, x): method preprocess (line 37) | def preprocess(self, data): method dist (line 46) | def dist(self, x1, x2): method kl_divergence (line 49) | def kl_divergence(self, k1, k2): method fit (line 55) | def fit(self, support, support_labels, support_weights=None): method predict (line 73) | def predict(self, query): method predict_alt (line 85) | def predict_alt(self, query, measure="euclidean", norm_scores=False, t... class MultiNNBiClassifier (line 114) | class MultiNNBiClassifier(): method __init__ (line 115) | def __init__(self, n_way, n_classifiers, measure="linear", fusion="lin... method fit (line 124) | def fit(self, support_x, support_d, support_labels, support_weights=No... method fuse_proba (line 133) | def fuse_proba(self, p1, p2): method predict (line 145) | def predict(self, query_x, query_d, weights=None, counterfactual=False): class MultiNNClassifier (line 167) | class MultiNNClassifier(): method __init__ (line 168) | def __init__(self, n_way, n_classifiers, measure="euclidean", temp=1.0): method fit (line 178) | def fit(self, support, support_labels, support_weights=None): method predict (line 189) | def predict(self, query, weights=None): class BidrectionalLSTM (line 209) | class BidrectionalLSTM(nn.Module): method __init__ (line 210) | def __init__(self, size: int, layers: int): method forward (line 229) | def forward(self, inputs): class AttentionLSTM (line 242) | class AttentionLSTM(nn.Module): method __init__ (line 243) | def __init__(self, size: int, unrolling_steps: int): method forward (line 258) | def forward(self, support, queries): class MultiLinearClassifier (line 288) | class MultiLinearClassifier(nn.Module): method __init__ (line 289) | def __init__(self, n_clf, feat_dim, n_way, sum_log=True, permute=False... method create_clf (line 303) | def create_clf(self, loss_type, in_dim, out_dim): method forward (line 309) | def forward(self, X): class MultiBiLinearClassifier (line 330) | class MultiBiLinearClassifier(nn.Module): method __init__ (line 331) | def __init__(self, n_clf, x_feat_dim, d_feat_dim, n_way, sum_log=True,... method fuse_logits (line 343) | def fuse_logits(self, p1, p2): method create_clf (line 355) | def create_clf(self, loss_type, in_dim, out_dim): method forward (line 361) | def forward(self, X, D, counterfactual=False): class ResNetKernelClusterAgent (line 384) | class ResNetKernelClusterAgent(): method __init__ (line 385) | def __init__(self, pretrain, n_clusters, pca_dim, cluster_method="kmea... method fit (line 391) | def fit(self): class ResNetParamClusterModel (line 407) | class ResNetParamClusterModel(): method __init__ (line 408) | def __init__(self, pretrain, n_clusters, cluster_method="kmeans"): method cluster (line 413) | def cluster(self, features, n_clusters): method get_weight_features (line 418) | def get_weight_features(self, weights): method fit (line 424) | def fit(self): method conv_forward (line 432) | def conv_forward(self, inputs, labels, n_clusters, original_conv): method forward (line 452) | def forward(self, imgs): method forward2 (line 491) | def forward2(self, imgs): method forward3 (line 517) | def forward3(self, imgs): class BasisTransformer (line 524) | class BasisTransformer(): method __init__ (line 525) | def __init__(self, pretrain, recluster=False, cluster_method="kmeans",... method fit (line 532) | def fit(self, n_clusters, feat_dim, pca_dim=50): method transform (line 573) | def transform(self, X): class KernelTransformer (line 582) | class KernelTransformer(): method __init__ (line 583) | def __init__(self, feat_dim, kernel): method fit (line 587) | def fit(self, features): method transform (line 594) | def transform(self, X): method kernel_f (line 602) | def kernel_f(self, x1, x2): class ChannelwiseClassifier (line 613) | class ChannelwiseClassifier(nn.Module): method __init__ (line 614) | def __init__(self, feat_dim, n_way, weight, bias=False): method reset_parameters (line 626) | def reset_parameters(self): method forward (line 635) | def forward(self, X): class UnbiasedClassifier (line 660) | class UnbiasedClassifier(nn.Module): method __init__ (line 673) | def __init__(self, n_way, x_feature_dim, z_feature_dim, d_feature_dim=0, method create_clf (line 694) | def create_clf(self, feat_dim): method create_logit_fusion_fn (line 701) | def create_logit_fusion_fn(self): method get_fused_feature (line 710) | def get_fused_feature(self, feature_array): method forward (line 714) | def forward(self, X, Z, D=None): class XDBiClassifier (line 733) | class XDBiClassifier(nn.Module): method __init__ (line 734) | def __init__(self, n_way, x_feature_dim, d_feature_dim, architecture="... method create_clf (line 751) | def create_clf(self, feat_dim): method create_logit_fusion_fn (line 758) | def create_logit_fusion_fn(self): method cat_for_logit_fusion (line 769) | def cat_for_logit_fusion(self, A, B): method forward (line 774) | def forward(self, X, D): class XDClassifier (line 791) | class XDClassifier(nn.Module): method __init__ (line 804) | def __init__(self, n_way, x_feature_dim, d_feature_dim, architecture="... method get_feature_dim (line 826) | def get_feature_dim(self): method create_clf (line 840) | def create_clf(self, feat_dim): method get_fused_feature (line 847) | def get_fused_feature(self, feature_array): method forward (line 855) | def forward(self, X, D): class ProductGate (line 870) | class ProductGate(nn.Module): method __init__ (line 871) | def __init__(self): method forward (line 874) | def forward(self, x): class HarmonicGate (line 882) | class HarmonicGate(nn.Module): method __init__ (line 883) | def __init__(self): method forward (line 886) | def forward(self, x): class SumGate (line 895) | class SumGate(nn.Module): method __init__ (line 896) | def __init__(self): method forward (line 899) | def forward(self, x): class distLinear (line 906) | class distLinear(nn.Module): method __init__ (line 907) | def __init__(self, indim, outdim, class_wise_learnable_norm=True): method forward (line 919) | def forward(self, x): class Flatten (line 930) | class Flatten(nn.Module): method __init__ (line 931) | def __init__(self): method forward (line 934) | def forward(self, x): class Linear_fw (line 938) | class Linear_fw(nn.Linear): #used in MAML to forward input with fast weight method __init__ (line 939) | def __init__(self, in_features, out_features): method forward (line 944) | def forward(self, x): class Conv2d_fw (line 951) | class Conv2d_fw(nn.Conv2d): #used in MAML to forward input with fast weight method __init__ (line 952) | def __init__(self, in_channels, out_channels, kernel_size, stride=1,pa... method forward (line 958) | def forward(self, x): class BatchNorm2d_fw (line 972) | class BatchNorm2d_fw(nn.BatchNorm2d): #used in MAML to forward input wit... method __init__ (line 973) | def __init__(self, num_features): method forward (line 978) | def forward(self, x): class ConvBlock (line 989) | class ConvBlock(nn.Module): method __init__ (line 991) | def __init__(self, indim, outdim, pool = True, padding = 1): method forward (line 1014) | def forward(self,x): class SimpleBlock (line 1019) | class SimpleBlock(nn.Module): method __init__ (line 1021) | def __init__(self, indim, outdim, half_res): method forward (line 1060) | def forward(self, x): class BottleneckBlock (line 1074) | class BottleneckBlock(nn.Module): method __init__ (line 1076) | def __init__(self, indim, outdim, half_res): method forward (line 1117) | def forward(self, x): class ConvNet (line 1134) | class ConvNet(nn.Module): method __init__ (line 1135) | def __init__(self, depth, flatten = True): method forward (line 1150) | def forward(self,x): class ConvNetNopool (line 1154) | class ConvNetNopool(nn.Module): #Relation net use a 4 layer conv with po... method __init__ (line 1155) | def __init__(self, depth): method forward (line 1167) | def forward(self,x): class ConvNetS (line 1171) | class ConvNetS(nn.Module): #For omniglot, only 1 input channel, output d... method __init__ (line 1172) | def __init__(self, depth, flatten = True): method forward (line 1187) | def forward(self,x): class ConvNetSNopool (line 1192) | class ConvNetSNopool(nn.Module): #Relation net use a 4 layer conv with p... method __init__ (line 1193) | def __init__(self, depth): method forward (line 1205) | def forward(self,x): class ResNet (line 1210) | class ResNet(nn.Module): method __init__ (line 1212) | def __init__(self,block,list_of_num_layers, list_of_out_dims, flatten ... method forward (line 1254) | def forward(self,x): function Conv4 (line 1258) | def Conv4(): function Conv6 (line 1261) | def Conv6(): function Conv4NP (line 1264) | def Conv4NP(): function Conv6NP (line 1267) | def Conv6NP(): function Conv4S (line 1270) | def Conv4S(): function Conv4SNP (line 1273) | def Conv4SNP(): function ResNet10 (line 1276) | def ResNet10( flatten = True): function ResNet18 (line 1279) | def ResNet18( flatten = True): function ResNet34 (line 1282) | def ResNet34( flatten = True): function ResNet50 (line 1285) | def ResNet50( flatten = True): function ResNet101 (line 1288) | def ResNet101( flatten = True): FILE: MAML_MN_FT/data/additional_transforms.py class ImageJitter (line 15) | class ImageJitter(object): method __init__ (line 16) | def __init__(self, transformdict): method __call__ (line 20) | def __call__(self, img): FILE: MAML_MN_FT/data/datamgr.py class TransformLoader (line 12) | class TransformLoader: method __init__ (line 13) | def __init__(self, image_size, method parse_transform (line 20) | def parse_transform(self, transform_type): method get_composed_transform (line 36) | def get_composed_transform(self, aug=False): class DataManager (line 47) | class DataManager: method get_data_loader (line 49) | def get_data_loader(self, data_file, aug): class SimpleDataManager (line 53) | class SimpleDataManager(DataManager): method __init__ (line 54) | def __init__(self, image_size, batch_size): method get_data_loader (line 59) | def get_data_loader(self, data_file, aug, num_workers=12, tiered_mini=... class SetDataManager (line 70) | class SetDataManager(DataManager): method __init__ (line 71) | def __init__(self, image_size, n_way, n_support, n_query, n_eposide=100): method get_data_loader (line 80) | def get_data_loader(self, data_file, aug, debug=False): # parameters ... FILE: MAML_MN_FT/data/dataset.py class SimpleDataset (line 14) | class SimpleDataset: method __init__ (line 15) | def __init__(self, data_file, transform, target_transform=identity): method __getitem__ (line 21) | def __getitem__(self, i): method __len__ (line 28) | def __len__(self): class SimpleTieredDataset (line 32) | class SimpleTieredDataset: method __init__ (line 33) | def __init__(self, setname, transform): method __len__ (line 66) | def __len__(self): method __getitem__ (line 69) | def __getitem__(self, i): class SetDataset (line 75) | class SetDataset: method __init__ (line 76) | def __init__(self, data_file, batch_size, transform): method __getitem__ (line 98) | def __getitem__(self, i): method __len__ (line 101) | def __len__(self): class SubDataset (line 105) | class SubDataset: method __init__ (line 106) | def __init__(self, sub_meta, cl, transform=transforms.ToTensor(), targ... method __getitem__ (line 112) | def __getitem__(self, i): method __len__ (line 120) | def __len__(self): class EpisodicBatchSampler (line 124) | class EpisodicBatchSampler(object): method __init__ (line 125) | def __init__(self, n_classes, n_way, n_episodes): method __len__ (line 130) | def __len__(self): method __iter__ (line 133) | def __iter__(self): FILE: MAML_MN_FT/data/feature_loader.py class SimpleHDF5Dataset (line 5) | class SimpleHDF5Dataset: method __init__ (line 6) | def __init__(self, file_handle = None): method __getitem__ (line 18) | def __getitem__(self, i): method __len__ (line 21) | def __len__(self): function init_loader (line 24) | def init_loader(filename, get_path=False, path_file=None): FILE: MAML_MN_FT/io_utils.py function parse_args (line 20) | def parse_args(script): function get_assigned_file (line 53) | def get_assigned_file(checkpoint_dir,num): function get_resume_file (line 57) | def get_resume_file(checkpoint_dir): function get_best_file (line 68) | def get_best_file(checkpoint_dir): function print_accuracy (line 75) | def print_accuracy(acc): function print_with_carriage_return (line 79) | def print_with_carriage_return(line): function end_carriage_return_print (line 83) | def end_carriage_return_print(): function append_to_file (line 86) | def append_to_file(file, line): function get_result_file (line 91) | def get_result_file(test_name, method_name): function calc_recall_precision (line 101) | def calc_recall_precision(y, pred): FILE: MAML_MN_FT/main.py function func_not_found (line 4) | def func_not_found(): # just in case we dont have the function function main (line 8) | def main(): FILE: MAML_MN_FT/methods/DMAML.py class DMAML (line 14) | class DMAML(MetaTemplate): method __init__ (line 15) | def __init__(self, model_func, n_way, n_support, pretrain, n_splits, i... method get_feat_dim (line 65) | def get_feat_dim(self): method fuse_features (line 75) | def fuse_features(self, x1, x2): method normalize (line 83) | def normalize(self, x, dim=1): method fuse_proba (line 88) | def fuse_proba(self, p1, p2): method set_forward (line 100) | def set_forward(self, x, is_feature=False): method set_forward_adaptation (line 148) | def set_forward_adaptation(self, x, is_feature=False): method set_forward_loss (line 151) | def set_forward_loss(self, x): method train_loop (line 158) | def train_loop(self, epoch, train_loader, optimizer): method test_loop (line 183) | def test_loop(self, test_loader, return_std=False, metric="acc"): FILE: MAML_MN_FT/methods/DMatchingNet.py class DMatchingNet (line 12) | class DMatchingNet(MetaTemplate): method __init__ (line 13) | def __init__(self, model_func, n_way, n_support, pretrain, n_splits, i... method get_feat_dim (line 58) | def get_feat_dim(self): method fuse_features (line 68) | def fuse_features(self, x1, x2): method normalize (line 76) | def normalize(self, x, dim=1): method fuse_proba (line 81) | def fuse_proba(self, p1, p2): method set_forward (line 93) | def set_forward(self, x, is_feature=False): method predict (line 143) | def predict(self, support, query): method set_forward_loss (line 158) | def set_forward_loss(self, x): FILE: MAML_MN_FT/methods/MethodTester.py class MethodTester (line 21) | class MethodTester(): method __init__ (line 22) | def __init__(self, params): method get_backbone (line 29) | def get_backbone(self): method baseline_s2m2_initialize (line 44) | def baseline_s2m2_initialize(self, params, provide_original_image): method simpleshot_initialize (line 82) | def simpleshot_initialize(self, params, provide_original_image): method feat_initialize (line 92) | def feat_initialize(self, params, provide_original_image): method sib_initialize (line 102) | def sib_initialize(self, params, provide_original_image): method initialize (line 111) | def initialize(self, params, provide_original_image=False): method get_task (line 126) | def get_task(self, all_from_same_class=False, provide_original_image=F... method get_task_special (line 149) | def get_task_special(self, sampling="sim"): method set_experiment_config (line 241) | def set_experiment_config(self, config): method set_conditional_config (line 244) | def set_conditional_config(self, config_func): method set_experiment_method (line 247) | def set_experiment_method(self, method): method add_early_stop_criteria (line 250) | def add_early_stop_criteria(self, iter, acc): method _should_reinitialize (line 257) | def _should_reinitialize(self, config): method start_experiment (line 260) | def start_experiment(self, method, config, test_name="No name", condit... method _get_config_list (line 341) | def _get_config_list(self, config_dict): method _increment_config_counter (line 356) | def _increment_config_counter(self, config_dict, config_key_counter): method _generate_test_case_name (line 364) | def _generate_test_case_name(self, config): method _run_model (line 371) | def _run_model(self, model, show_current_accuracy=True, provide_origin... method _feature_evaluation (line 403) | def _feature_evaluation(self, model, provide_original_image, sampling=... method cosine_similarity (line 432) | def cosine_similarity(self, a, b): method _evaluate_hardness (line 435) | def _evaluate_hardness(self, z_all): method normalize (line 468) | def normalize(self, x): method _evaluate_hardness_logodd (line 473) | def _evaluate_hardness_logodd(self, z_all): method _should_early_stop (line 510) | def _should_early_stop(self, iter, acc): method meta_train (line 517) | def meta_train(self, config, method, descriptor_str, debug=True, use_t... method meta_test (line 610) | def meta_test(self, config, method, descriptor_str, debug=True, requir... FILE: MAML_MN_FT/methods/NNEDSplitNew.py class NNEDSplitNew (line 9) | class NNEDSplitNew(MetaTemplate): method __init__ (line 10) | def __init__(self, model_func, n_way, n_support, n_query, pretrain, n_... method set_forward (line 46) | def set_forward(self, x, is_feature=True): method calc_pd (line 49) | def calc_pd(self, x, clf_idx): method calc_ed (line 61) | def calc_ed(self, x): method temp (line 72) | def temp(self, x): method normalize (line 81) | def normalize(self, x, dim=1): method fuse_proba (line 86) | def fuse_proba(self, p1, p2): method fuse_features (line 98) | def fuse_features(self, x1, x2): method nn_preprocess (line 106) | def nn_preprocess(self, data, center=None, preprocessing="l2n"): method get_split_features (line 117) | def get_split_features(self, x, preprocess=False, center=None, preproc... method set_forward_adaptation (line 136) | def set_forward_adaptation(self, x, image_paths=None, is_feature=True): method set_forward_loss (line 222) | def set_forward_loss(self, x): FILE: MAML_MN_FT/methods/PretrainedModel.py class PretrainedModel (line 17) | class PretrainedModel(): method __init__ (line 18) | def __init__(self, params): method baseline_s2m2_init (line 40) | def baseline_s2m2_init(self, params): method simpleshot_init (line 87) | def simpleshot_init(self, params): method feat_init (line 133) | def feat_init(self, params): method sib_init (line 152) | def sib_init(self, params): method get_features (line 177) | def get_features(self, x): method classify (line 191) | def classify(self, x, normalize_prob=True): method load_d_specific_classifiers (line 212) | def load_d_specific_classifiers(self, n_clf): method train_d_specific_classifiers (line 227) | def train_d_specific_classifiers(self, n_clf): method test_d_specific_classifiers (line 268) | def test_d_specific_classifiers(self, n_clf): method save_pretrain_dataset (line 295) | def save_pretrain_dataset(self, split): method get_pretrain_dataset (line 339) | def get_pretrain_dataset(self, split): method normalize (line 350) | def normalize(self, x): method _calc_pretrained_class_mean (line 355) | def _calc_pretrained_class_mean(self, normalize=False): method get_kmeans_pca_model (line 399) | def get_kmeans_pca_model(self, k=8, n_clusters=10, normalize=False): method get_pretrained_class_mean (line 451) | def get_pretrained_class_mean(self, normalize=False): FILE: MAML_MN_FT/methods/VanillaMAML.py class VanillaMAML (line 13) | class VanillaMAML(MetaTemplate): method __init__ (line 14) | def __init__(self, model_func, n_way, n_support, approx=False, update_... method set_forward (line 25) | def set_forward(self, x, is_feature=False): method set_forward_adaptation (line 33) | def set_forward_adaptation(self, x, is_feature=False): method set_forward_loss (line 36) | def set_forward_loss(self, x): method train_loop (line 42) | def train_loop(self, epoch, train_loader, optimizer): method test_loop (line 67) | def test_loop(self, test_loader, return_std=False, metric="acc"): FILE: MAML_MN_FT/methods/VanillaMatchingNet.py class VanillaMatchingNet (line 11) | class VanillaMatchingNet(MetaTemplate): method __init__ (line 12) | def __init__(self, model_func, n_way, n_support): method normalize (line 19) | def normalize(self, x, dim=1): method set_forward (line 24) | def set_forward(self, x, is_feature=False): method set_forward_loss (line 39) | def set_forward_loss(self, x): FILE: MAML_MN_FT/methods/meta_template.py class MetaTemplate (line 12) | class MetaTemplate(nn.Module): method __init__ (line 13) | def __init__(self, model_func, n_way, n_support, change_way = True, im... method set_forward (line 27) | def set_forward(self,x,is_feature): method set_forward_loss (line 31) | def set_forward_loss(self, x): method forward (line 34) | def forward(self,x): method parse_feature (line 38) | def parse_feature(self,x,is_feature): method parse_images (line 55) | def parse_images(self, image_paths): method correct (line 75) | def correct(self, x, metric="acc"): method normalize (line 88) | def normalize(self, x): method _evaluate_hardness_logodd (line 93) | def _evaluate_hardness_logodd(self, z_all): method calc_correct (line 130) | def calc_correct(self, scores): method train_loop (line 137) | def train_loop(self, epoch, train_loader, optimizer ): method test_loop (line 158) | def test_loop(self, test_loader, record = None, metric="acc"): method set_forward_adaptation (line 182) | def set_forward_adaptation(self, x, is_feature = True): #further adapt... FILE: MAML_MN_FT/methods/meta_toolkits.py class MatchingNetModule (line 9) | class MatchingNetModule(nn.Module): method __init__ (line 10) | def __init__(self, feat_dim): method forward (line 16) | def forward(self, support, query): method cuda (line 25) | def cuda(self): class FullyContextualEmbedding (line 32) | class FullyContextualEmbedding(nn.Module): method __init__ (line 33) | def __init__(self, feat_dim): method forward (line 40) | def forward(self, f, G): method cuda (line 54) | def cuda(self): class FeatureProcessor (line 61) | class FeatureProcessor(): method __init__ (line 62) | def __init__(self, pretrain, n_splits, is_cosine_feature=False, d_feat... method get_split_features (line 88) | def get_split_features(self, x, preprocess=False, center=None, preproc... method nn_preprocess (line 106) | def nn_preprocess(self, data, center=None, preprocessing="l2n"): method calc_pd (line 117) | def calc_pd(self, x, clf_idx): method normalize (line 122) | def normalize(self, x, dim=1): method get_d_feature (line 127) | def get_d_feature(self, x): method get_features (line 144) | def get_features(self, support, query): class MAMLBlock (line 163) | class MAMLBlock(nn.Module): method __init__ (line 164) | def __init__(self, feat_dim, n_way, update_step, approx=True, lr=0.01): method forward (line 183) | def forward(self, x): method fit (line 188) | def fit(self, support, labels): method predict (line 215) | def predict(self, query): class LEOBlock (line 219) | class LEOBlock(nn.Module): method __init__ (line 220) | def __init__(self, feat_dim, latent_dim, n_way, drop_rate): method prepare_for_rel_net (line 243) | def prepare_for_rel_net(self, embeddings): method get_sampled_weights (line 250) | def get_sampled_weights(self, weight_stats): method finetune_z (line 259) | def finetune_z(self, support, initial_z, initial_w, labels): method finetune_w (line 277) | def finetune_w(self, support, initial_w, labels): method forward_relation_net (line 293) | def forward_relation_net(self, embeddings): method average_codes_per_class (line 301) | def average_codes_per_class(self, relation_net_outputs): method possibly_sample (line 307) | def possibly_sample(self, distribution_params, stddev_offset=0.): method forward_decoder (line 322) | def forward_decoder(self, latents): method calc_kl_penalty (line 332) | def calc_kl_penalty(self, latent_samples, latent_distributions): method calc_encoder_penalty (line 339) | def calc_encoder_penalty(self, z_f, z): method calc_l2_penalty (line 342) | def calc_l2_penalty(self): method calc_orthogonality_penalty (line 351) | def calc_orthogonality_penalty(self): method fit (line 361) | def fit(self, support, labels): method predict (line 377) | def predict(self, query, w): FILE: MAML_MN_FT/models/FeatWRN.py function conv3x3 (line 10) | def conv3x3(in_planes, out_planes, stride=1): function conv_init (line 13) | def conv_init(m): class wide_basic (line 22) | class wide_basic(nn.Module): method __init__ (line 23) | def __init__(self, in_planes, planes, dropout_rate, stride=1): method forward (line 37) | def forward(self, x): class Wide_ResNet (line 44) | class Wide_ResNet(nn.Module): method __init__ (line 45) | def __init__(self, depth, widen_factor, dropout_rate): method _wide_layer (line 62) | def _wide_layer(self, block, planes, num_blocks, dropout_rate, stride): method forward (line 72) | def forward(self, x): class FEATWRN (line 84) | class FEATWRN(nn.Module): method __init__ (line 85) | def __init__(self, num_classes=64): method forward (line 92) | def forward(self, x): method forward_feature (line 96) | def forward_feature(self, x): FILE: MAML_MN_FT/models/SimpleShotResNet.py function conv3x3 (line 7) | def conv3x3(in_planes, out_planes, stride=1): function conv1x1 (line 13) | def conv1x1(in_planes, out_planes, stride=1): class BasicBlock (line 18) | class BasicBlock(nn.Module): method __init__ (line 21) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 31) | def forward(self, x): class Bottleneck (line 50) | class Bottleneck(nn.Module): method __init__ (line 53) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 65) | def forward(self, x): class ResNet (line 88) | class ResNet(nn.Module): method __init__ (line 90) | def __init__(self, block, layers, num_classes=1000, zero_init_residual... method _make_layer (line 125) | def _make_layer(self, block, planes, blocks, stride=1): method forward (line 141) | def forward(self, x, feature=False): function resnet10 (line 165) | def resnet10(**kwargs): function resnet18 (line 172) | def resnet18(**kwargs): function resnet34 (line 179) | def resnet34(**kwargs): function resnet50 (line 186) | def resnet50(**kwargs): function resnet101 (line 193) | def resnet101(**kwargs): function resnet152 (line 200) | def resnet152(**kwargs): FILE: MAML_MN_FT/models/SimpleShotWideResNet.py function conv3x3 (line 9) | def conv3x3(in_planes, out_planes, stride=1): function conv_init (line 13) | def conv_init(m): class wide_basic (line 23) | class wide_basic(nn.Module): method __init__ (line 24) | def __init__(self, in_planes, planes, dropout_rate, stride=1): method forward (line 38) | def forward(self, x): class Wide_ResNet (line 46) | class Wide_ResNet(nn.Module): method __init__ (line 47) | def __init__(self, depth, widen_factor, dropout_rate, num_classes, rem... method _wide_layer (line 75) | def _wide_layer(self, block, planes, num_blocks, dropout_rate, stride): method forward (line 85) | def forward(self, x, feature=False): function wideres (line 105) | def wideres(num_classes=64, remove_linear=False): FILE: MAML_MN_FT/save_features.py function save_features (line 25) | def save_features(model, data_loader, outfile, params): function baseline_s2m2_init (line 57) | def baseline_s2m2_init(params): function remove_module_from_param_name (line 173) | def remove_module_from_param_name(params_name_str): function simple_shot_init (line 179) | def simple_shot_init(params, split): function feat_init (line 218) | def feat_init(params, split): function sib_init (line 246) | def sib_init(params, split): function cosine_init (line 273) | def cosine_init(params, split): function initialize_and_save (line 307) | def initialize_and_save(params, split): FILE: MAML_MN_FT/tests/MetaTrain.py class MetaTrain (line 8) | class MetaTrain(MethodTester): method __init__ (line 9) | def __init__(self, params): method maml5_resnet (line 16) | def maml5_resnet(self): method maml5_wrn (line 37) | def maml5_wrn(self): method maml1_resnet (line 58) | def maml1_resnet(self): method maml1_wrn (line 79) | def maml1_wrn(self): method maml5_resnet_tiered (line 100) | def maml5_resnet_tiered(self): method maml5_wrn_tiered (line 121) | def maml5_wrn_tiered(self): method maml1_resnet_tiered (line 142) | def maml1_resnet_tiered(self): method maml1_wrn_tiered (line 163) | def maml1_wrn_tiered(self): method maml5_ifsl_resnet (line 186) | def maml5_ifsl_resnet(self): method maml5_ifsl_wrn (line 224) | def maml5_ifsl_wrn(self): method maml1_ifsl_resnet (line 262) | def maml1_ifsl_resnet(self): method maml1_ifsl_wrn (line 300) | def maml1_ifsl_wrn(self): method maml5_ifsl_resnet_tiered (line 338) | def maml5_ifsl_resnet_tiered(self): method maml5_ifsl_wrn_tiered (line 376) | def maml5_ifsl_wrn_tiered(self): method maml1_ifsl_resnet_tiered (line 414) | def maml1_ifsl_resnet_tiered(self): method maml1_ifsl_wrn_tiered (line 452) | def maml1_ifsl_wrn_tiered(self): method mn5_resnet (line 492) | def mn5_resnet(self): method mn5_wrn (line 507) | def mn5_wrn(self): method mn1_resnet (line 522) | def mn1_resnet(self): method mn1_wrn (line 537) | def mn1_wrn(self): method mn5_resnet_tiered (line 552) | def mn5_resnet_tiered(self): method mn5_wrn_tiered (line 567) | def mn5_wrn_tiered(self): method mn1_resnet_tiered (line 582) | def mn1_resnet_tiered(self): method mn1_wrn_tiered (line 597) | def mn1_wrn_tiered(self): method mn5_ifsl_resnet (line 613) | def mn5_ifsl_resnet(self): method mn5_ifsl_wrn (line 646) | def mn5_ifsl_wrn(self): method mn1_ifsl_resnet (line 679) | def mn1_ifsl_resnet(self): method mn1_ifsl_wrn (line 712) | def mn1_ifsl_wrn(self): method mn5_ifsl_resnet_tiered (line 745) | def mn5_ifsl_resnet_tiered(self): method mn5_ifsl_wrn_tiered (line 779) | def mn5_ifsl_wrn_tiered(self): method mn1_ifsl_resnet_tiered (line 813) | def mn1_ifsl_resnet_tiered(self): method mn1_ifsl_wrn_tiered (line 847) | def mn1_ifsl_wrn_tiered(self): FILE: MAML_MN_FT/utils.py function one_hot (line 4) | def one_hot(y, num_class): function DBindex (line 7) | def DBindex(cl_data_file): function sparsity (line 25) | def sparsity(cl_data_file): FILE: MTL/configs/baseline_config.py class Params (line 1) | class Params(): method __init__ (line 2) | def __init__(self): function mini_5_resnet_baseline (line 6) | def mini_5_resnet_baseline(): function mini_1_resnet_baseline (line 21) | def mini_1_resnet_baseline(): function tiered_5_resnet_baseline (line 36) | def tiered_5_resnet_baseline(): function tiered_1_resnet_baseline (line 51) | def tiered_1_resnet_baseline(): function mini_5_wrn_baseline (line 66) | def mini_5_wrn_baseline(): function mini_1_wrn_baseline (line 81) | def mini_1_wrn_baseline(): function tiered_5_wrn_baseline (line 96) | def tiered_5_wrn_baseline(): function tiered_1_wrn_baseline (line 111) | def tiered_1_wrn_baseline(): FILE: MTL/configs/ifsl_resnet_config.py class Params (line 1) | class Params(): method __init__ (line 2) | def __init__(self): function mini_5_resnet_d (line 6) | def mini_5_resnet_d(): function mini_1_resnet_d (line 44) | def mini_1_resnet_d(): function tiered_5_resnet_d (line 82) | def tiered_5_resnet_d(): function tiered_1_resnet_d (line 120) | def tiered_1_resnet_d(): FILE: MTL/configs/ifsl_wrn_config.py class Params (line 1) | class Params(): method __init__ (line 2) | def __init__(self): function mini_5_wrn_d (line 6) | def mini_5_wrn_d(): function mini_1_wrn_d (line 44) | def mini_1_wrn_d(): function tiered_5_wrn_d (line 82) | def tiered_5_wrn_d(): function tiered_1_wrn_d (line 120) | def tiered_1_wrn_d(): FILE: MTL/dataloader/dataset_loader.py class DatasetLoader (line 20) | class DatasetLoader(Dataset): method __init__ (line 22) | def __init__(self, setname, args, dataset="miniImagenet", train_aug=Fa... method __len__ (line 99) | def __len__(self): method __getitem__ (line 102) | def __getitem__(self, i): FILE: MTL/dataloader/samplers.py class CategoriesSampler (line 15) | class CategoriesSampler(): method __init__ (line 17) | def __init__(self, label, n_batch, n_cls, n_per): method __len__ (line 29) | def __len__(self): method __iter__ (line 31) | def __iter__(self): FILE: MTL/models/IFSL.py class PretrainNet (line 14) | class PretrainNet(): method __init__ (line 15) | def __init__(self, args): method load_classifier (line 36) | def load_classifier(self, n_splits, epoch=22, num_classes=64): method train_classifier (line 50) | def train_classifier(self, n_splits, num_classes=64): method normalize (line 94) | def normalize(self, x): method get_base_means (line 99) | def get_base_means(self, num_classes=64, is_cosine_feature=False): method save_base_means (line 107) | def save_base_means(self, num_classes=64, is_cosine_feature=False): class distLinear (line 137) | class distLinear(nn.Module): method __init__ (line 138) | def __init__(self, indim, outdim, class_wise_learnable_norm=True): method forward (line 150) | def forward(self, x): class MultiLinearClassifier (line 162) | class MultiLinearClassifier(nn.Module): method __init__ (line 163) | def __init__(self, n_clf, feat_dim, n_way, sum_log=True, permute=False... method create_clf (line 177) | def create_clf(self, loss_type, in_dim, out_dim): method forward (line 183) | def forward(self, X): class MultiBiLinearClassifier (line 204) | class MultiBiLinearClassifier(nn.Module): method __init__ (line 205) | def __init__(self, n_clf, x_feat_dim, d_feat_dim, n_way, sum_log=True,... method fuse_logits (line 217) | def fuse_logits(self, p1, p2): method create_clf (line 229) | def create_clf(self, loss_type, in_dim, out_dim): method forward (line 235) | def forward(self, X, D, counterfactual=False): class BaseLearner (line 258) | class BaseLearner(nn.Module): method __init__ (line 260) | def __init__(self, args, z_dim): method forward (line 271) | def forward(self, input_x, the_vars=None): method parameters (line 279) | def parameters(self): method initialize (line 282) | def initialize(self): class DeconfoundedLearner (line 287) | class DeconfoundedLearner(): method __init__ (line 288) | def __init__(self, pretrain, classifier="bi", logit_fusion="product", ... method calc_pd (line 355) | def calc_pd(self, x, clf_idx): method get_pd_features (line 359) | def get_pd_features(self, x): method get_ed_features (line 369) | def get_ed_features(self, x): method get_split_features (line 379) | def get_split_features(self, x): method fuse_feature (line 389) | def fuse_feature(self, a, b, dim=2): method fuse_logits (line 397) | def fuse_logits(self, p1, p2): method backward_loss_and_step (line 409) | def backward_loss_and_step(self, loss, optimizer): method fit (line 421) | def fit(self, support, query, support_labels, support_embedding, query... method fit_no_split (line 427) | def fit_no_split(self, support, query, support_labels, support_embeddi... method no_split_update (line 451) | def no_split_update(self, x, d, label): method calc_no_split_logit (line 471) | def calc_no_split_logit(self, x, d, fast_weight_x=None, fast_weight_d=... method fit_multi_splits (line 481) | def fit_multi_splits(self, support, query, support_labels, support_emb... method predict (line 549) | def predict(self, support_labels, support_embedding, query_embedding): FILE: MTL/models/IFSL_modules.py class Linear_fw (line 7) | class Linear_fw(nn.Linear): #used in MAML to forward input with fast weight method __init__ (line 8) | def __init__(self, in_features, out_features): method forward (line 13) | def forward(self, x): class IFSLBaseLearner (line 21) | class IFSLBaseLearner(nn.Module): method __init__ (line 22) | def __init__(self, feat_dim, n_way, update_step, approx=True, lr=0.01): method forward (line 33) | def forward(self, x): method fit (line 37) | def fit(self, support, labels): method predict (line 64) | def predict(self, query): class FeatureProcessor (line 68) | class FeatureProcessor(): method __init__ (line 69) | def __init__(self, pretrain, n_splits, is_cosine_feature=False, d_feat... method get_split_features (line 95) | def get_split_features(self, x, preprocess=False, center=None, preproc... method nn_preprocess (line 120) | def nn_preprocess(self, data, center=None, preprocessing="l2n"): method calc_pd (line 131) | def calc_pd(self, x, clf_idx): method normalize (line 135) | def normalize(self, x, dim=1): method get_d_feature (line 140) | def get_d_feature(self, x, x_ori): method get_features (line 160) | def get_features(self, support, query, support_ori, query_ori): FILE: MTL/models/IFSL_pretrain.py class Pretrain (line 11) | class Pretrain(): method __init__ (line 12) | def __init__(self, dataset, method, model, init_model=True): method simpleshot_init (line 22) | def simpleshot_init(self): method classify (line 69) | def classify(self, x, normalize_prob=True): method get_features (line 89) | def get_features(self, x): method get_pretrained_class_mean (line 103) | def get_pretrained_class_mean(self, normalize=False): method normalize (line 117) | def normalize(self, x): method get_base_means (line 122) | def get_base_means(self, normalize=False): FILE: MTL/models/ResNet10.py class ResNet (line 7) | class ResNet(nn.Module): method __init__ (line 8) | def __init__(self, block, conv, layers, num_classes=1000, zero_init_re... method _make_layer (line 46) | def _make_layer(self, block, planes, blocks, stride=1): method forward (line 63) | def forward(self, x, feature=False): function ResNet10MTL (line 95) | def ResNet10MTL(**kwargs): function ResNet10 (line 100) | def ResNet10(**kwargs): FILE: MTL/models/WRN28.py class wide_basic (line 6) | class wide_basic(nn.Module): method __init__ (line 7) | def __init__(self, in_planes, planes, dropout_rate, stride=1): method forward (line 21) | def forward(self, x): class wide_basic_mtl (line 28) | class wide_basic_mtl(nn.Module): method __init__ (line 29) | def __init__(self, in_planes, planes, dropout_rate, stride=1): method forward (line 43) | def forward(self, x): function conv3x3 (line 50) | def conv3x3(in_planes, out_planes, stride=1): function conv3x3mtl (line 54) | def conv3x3mtl(in_planes, out_planes, stride=1): class Wide_ResNet (line 58) | class Wide_ResNet(nn.Module): method __init__ (line 59) | def __init__(self, block, conv3x3proto, depth, widen_factor, dropout_r... method _wide_layer (line 87) | def _wide_layer(self, block, planes, num_blocks, dropout_rate, stride): method forward (line 97) | def forward(self, x, feature=False): function WideRes28 (line 117) | def WideRes28(num_classes=64, remove_linear=False): function WideRes28Mtl (line 123) | def WideRes28Mtl(num_classes=64, remove_linear=False): FILE: MTL/models/conv2d_mtl.py class _ConvNdMtl (line 19) | class _ConvNdMtl(Module): method __init__ (line 21) | def __init__(self, in_channels, out_channels, kernel_size, stride, method reset_parameters (line 55) | def reset_parameters(self): method extra_repr (line 66) | def extra_repr(self): class Conv2dMtl (line 81) | class Conv2dMtl(_ConvNdMtl): method __init__ (line 83) | def __init__(self, in_channels, out_channels, kernel_size, stride=1, method forward (line 93) | def forward(self, inp): FILE: MTL/models/mtl.py class BaseLearner (line 24) | class BaseLearner(nn.Module): method __init__ (line 26) | def __init__(self, args, z_dim): method forward (line 37) | def forward(self, input_x, the_vars=None): method parameters (line 45) | def parameters(self): method initialize (line 48) | def initialize(self): class MtlLearner (line 53) | class MtlLearner(nn.Module): method __init__ (line 55) | def __init__(self, args, mode='meta', num_cls=64): method load_pretrain_weight (line 85) | def load_pretrain_weight(self, model_dir): method encode (line 101) | def encode(self, x): method forward (line 105) | def forward(self, inp): method pretrain_forward (line 123) | def pretrain_forward(self, inp): method meta_forward (line 132) | def meta_forward(self, data_shot, label_shot, data_query, val=False): method predict (line 174) | def predict(self, embedding_shot, label_shot, embedding_query): method backward_loss_and_step (line 180) | def backward_loss_and_step(self, loss, optimizer=None): method preval_forward (line 187) | def preval_forward(self, data_shot, label_shot, data_query): FILE: MTL/models/resnet_mtl.py function conv3x3 (line 15) | def conv3x3(in_planes, out_planes, stride=1): class BasicBlock (line 19) | class BasicBlock(nn.Module): method __init__ (line 22) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 32) | def forward(self, x): class Bottleneck (line 50) | class Bottleneck(nn.Module): method __init__ (line 53) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 66) | def forward(self, x): function conv3x3mtl (line 88) | def conv3x3mtl(in_planes, out_planes, stride=1): class BasicBlockMtl (line 93) | class BasicBlockMtl(nn.Module): method __init__ (line 96) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 106) | def forward(self, x): class BottleneckMtl (line 125) | class BottleneckMtl(nn.Module): method __init__ (line 128) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 141) | def forward(self, x): class ResNetMtl (line 164) | class ResNetMtl(nn.Module): method __init__ (line 165) | def __init__(self, layers=[4, 4, 4], mtl=True): method _make_layer (line 190) | def _make_layer(self, block, planes, blocks, stride=1): method forward (line 206) | def forward(self, x): FILE: MTL/run_meta.py function run_exp (line 13) | def run_exp(num_batch=1000, shot=1, query=15, lr1=0.0001, lr2=0.001, bas... FILE: MTL/run_pre.py function run_exp (line 13) | def run_exp(lr=0.1, gamma=0.2, step_size=30): FILE: MTL/run_pre_clfs.py function run_exp (line 13) | def run_exp(lr=0.1, gamma=0.2, step_size=30, n_clfs=10): FILE: MTL/run_test.py function run_exp (line 13) | def run_exp(num_batch=1000, shot=1, query=15, lr1=0.0001, lr2=0.001, bas... FILE: MTL/trainer/meta.py class MetaTrainer (line 31) | class MetaTrainer(object): method __init__ (line 33) | def __init__(self, args): method write_output_message (line 123) | def write_output_message(self, message, file_name=None): method save_model (line 131) | def save_model(self, name): method train (line 138) | def train(self): method eval (line 301) | def eval(self): FILE: MTL/trainer/pre.py class PreTrainer (line 23) | class PreTrainer(object): method __init__ (line 25) | def __init__(self, args): method save_model (line 70) | def save_model(self, name): method train (line 77) | def train(self): FILE: MTL/utils/gpu_tools.py function set_gpu (line 14) | def set_gpu(cuda_device): FILE: MTL/utils/hacc.py class Hacc (line 4) | class Hacc(): method __init__ (line 5) | def __init__(self, splits=10, topk=10): method add_data (line 11) | def add_data(self, hardness, correct_prediction): method get_splits_hacc (line 15) | def get_splits_hacc(self): method get_topk_hacc (line 31) | def get_topk_hacc(self): method get_topk_hard_acc (line 42) | def get_topk_hard_acc(self): method get_acc_in_range (line 50) | def get_acc_in_range(self, start, end): method get_plot (line 60) | def get_plot(self, splits): FILE: MTL/utils/misc.py function ensure_path (line 22) | def ensure_path(path): class Averager (line 32) | class Averager(): method __init__ (line 34) | def __init__(self): method add (line 38) | def add(self, x): method item (line 42) | def item(self): function count_acc (line 45) | def count_acc(logits, label): function normalize (line 58) | def normalize(x): function count_dacc (line 63) | def count_dacc(pred_logits, support_labels, query_labels, support_imgs, ... function get_hardness_correct (line 93) | def get_hardness_correct(pred_logits, support_labels, query_labels, supp... class Timer (line 121) | class Timer(): method __init__ (line 123) | def __init__(self): method measure (line 126) | def measure(self, p=1): function pprint (line 137) | def pprint(x): function format_time (line 141) | def format_time(seconds): function compute_confidence_interval (line 174) | def compute_confidence_interval(data): function progress_bar (line 197) | def progress_bar(current, total, msg=None): FILE: SIB/PretrainedModel.py class PretrainedModel (line 18) | class PretrainedModel(): method __init__ (line 19) | def __init__(self, params): method simpleshot_init (line 40) | def simpleshot_init(self, params): method sib_init (line 78) | def sib_init(self, params): method get_features (line 84) | def get_features(self, x): method classify (line 100) | def classify(self, x, normalize_prob=True): method load_d_specific_classifiers (line 122) | def load_d_specific_classifiers(self, n_clf): method load_classifier_weights (line 139) | def load_classifier_weights(self, n_clf, idx): method train_d_specific_classifiers (line 148) | def train_d_specific_classifiers(self, n_clf): method test_d_specific_classifiers (line 188) | def test_d_specific_classifiers(self, n_clf): method save_pretrain_dataset (line 215) | def save_pretrain_dataset(self, split): method get_pretrain_dataset (line 258) | def get_pretrain_dataset(self, split): method normalize (line 269) | def normalize(self, x): method _calc_pretrained_class_mean (line 274) | def _calc_pretrained_class_mean(self, normalize=False): method get_kmeans_pca_model (line 305) | def get_kmeans_pca_model(self, k=8, n_clusters=10, normalize=False): method get_pretrained_class_mean (line 357) | def get_pretrained_class_mean(self, normalize=False): FILE: SIB/algorithm.py class Params (line 26) | class Params: method __init__ (line 27) | def __init__(self): class Algorithm (line 30) | class Algorithm: method __init__ (line 46) | def __init__(self, args, logger, netFeat, netSIB, optimizer, criterion... method load_ckpt (line 84) | def load_ckpt(self, ckptPth): method compute_grad_loss (line 104) | def compute_grad_loss(self, clsScore, QueryLabel): method cosine_similarity (line 127) | def cosine_similarity(self, a, b): method calc_diff_scores (line 130) | def calc_diff_scores(self, pretrain, support, query, support_labels, q... method normalize (line 145) | def normalize(self, x): method _evaluate_hardness_logodd (line 150) | def _evaluate_hardness_logodd(self, pretrain, support, query, support_... method validate (line 181) | def validate(self, valLoader, lr=None, mode='val'): method write_output_message (line 255) | def write_output_message(self, message): method train (line 260) | def train(self, trainLoader, valLoader, lr=None, coeffGrad=0.0) : FILE: SIB/backbone.py function init_layer (line 18) | def init_layer(L): class NNClassifier (line 28) | class NNClassifier(): method __init__ (line 29) | def __init__(self, n_way): method normalize (line 32) | def normalize(self, x): method preprocess (line 37) | def preprocess(self, data): method dist (line 46) | def dist(self, x1, x2): method kl_divergence (line 49) | def kl_divergence(self, k1, k2): method fit (line 55) | def fit(self, support, support_labels, support_weights=None): method predict (line 73) | def predict(self, query): method predict_alt (line 85) | def predict_alt(self, query, measure="euclidean", norm_scores=False, t... class MultiNNBiClassifier (line 114) | class MultiNNBiClassifier(): method __init__ (line 115) | def __init__(self, n_way, n_classifiers, measure="linear", fusion="lin... method fit (line 124) | def fit(self, support_x, support_d, support_labels, support_weights=No... method fuse_proba (line 133) | def fuse_proba(self, p1, p2): method predict (line 145) | def predict(self, query_x, query_d, weights=None, counterfactual=False): class MultiNNClassifier (line 167) | class MultiNNClassifier(): method __init__ (line 168) | def __init__(self, n_way, n_classifiers, measure="euclidean", temp=1.0): method fit (line 178) | def fit(self, support, support_labels, support_weights=None): method predict (line 189) | def predict(self, query, weights=None): class BidrectionalLSTM (line 209) | class BidrectionalLSTM(nn.Module): method __init__ (line 210) | def __init__(self, size: int, layers: int): method forward (line 229) | def forward(self, inputs): class AttentionLSTM (line 242) | class AttentionLSTM(nn.Module): method __init__ (line 243) | def __init__(self, size: int, unrolling_steps: int): method forward (line 258) | def forward(self, support, queries): class MultiLinearClassifier (line 288) | class MultiLinearClassifier(nn.Module): method __init__ (line 289) | def __init__(self, n_clf, feat_dim, n_way, sum_log=True, permute=False... method create_clf (line 303) | def create_clf(self, loss_type, in_dim, out_dim): method forward (line 309) | def forward(self, X): class MultiBiLinearClassifier (line 330) | class MultiBiLinearClassifier(nn.Module): method __init__ (line 331) | def __init__(self, n_clf, x_feat_dim, d_feat_dim, n_way, sum_log=True,... method fuse_logits (line 343) | def fuse_logits(self, p1, p2): method create_clf (line 355) | def create_clf(self, loss_type, in_dim, out_dim): method forward (line 361) | def forward(self, X, D, counterfactual=False): class ResNetKernelClusterAgent (line 384) | class ResNetKernelClusterAgent(): method __init__ (line 385) | def __init__(self, pretrain, n_clusters, pca_dim, cluster_method="kmea... method fit (line 391) | def fit(self): class ResNetParamClusterModel (line 407) | class ResNetParamClusterModel(): method __init__ (line 408) | def __init__(self, pretrain, n_clusters, cluster_method="kmeans"): method cluster (line 413) | def cluster(self, features, n_clusters): method get_weight_features (line 418) | def get_weight_features(self, weights): method fit (line 424) | def fit(self): method conv_forward (line 432) | def conv_forward(self, inputs, labels, n_clusters, original_conv): method forward (line 452) | def forward(self, imgs): method forward2 (line 491) | def forward2(self, imgs): method forward3 (line 517) | def forward3(self, imgs): class BasisTransformer (line 524) | class BasisTransformer(): method __init__ (line 525) | def __init__(self, pretrain, recluster=False, cluster_method="kmeans",... method fit (line 532) | def fit(self, n_clusters, feat_dim, pca_dim=50): method transform (line 573) | def transform(self, X): class KernelTransformer (line 582) | class KernelTransformer(): method __init__ (line 583) | def __init__(self, feat_dim, kernel): method fit (line 587) | def fit(self, features): method transform (line 594) | def transform(self, X): method kernel_f (line 602) | def kernel_f(self, x1, x2): class ChannelwiseClassifier (line 613) | class ChannelwiseClassifier(nn.Module): method __init__ (line 614) | def __init__(self, feat_dim, n_way, weight, bias=False): method reset_parameters (line 626) | def reset_parameters(self): method forward (line 635) | def forward(self, X): class UnbiasedClassifier (line 660) | class UnbiasedClassifier(nn.Module): method __init__ (line 673) | def __init__(self, n_way, x_feature_dim, z_feature_dim, d_feature_dim=0, method create_clf (line 694) | def create_clf(self, feat_dim): method create_logit_fusion_fn (line 701) | def create_logit_fusion_fn(self): method get_fused_feature (line 710) | def get_fused_feature(self, feature_array): method forward (line 714) | def forward(self, X, Z, D=None): class XDBiClassifier (line 733) | class XDBiClassifier(nn.Module): method __init__ (line 734) | def __init__(self, n_way, x_feature_dim, d_feature_dim, architecture="... method create_clf (line 751) | def create_clf(self, feat_dim): method create_logit_fusion_fn (line 758) | def create_logit_fusion_fn(self): method cat_for_logit_fusion (line 769) | def cat_for_logit_fusion(self, A, B): method forward (line 774) | def forward(self, X, D): class XDClassifier (line 791) | class XDClassifier(nn.Module): method __init__ (line 804) | def __init__(self, n_way, x_feature_dim, d_feature_dim, architecture="... method get_feature_dim (line 826) | def get_feature_dim(self): method create_clf (line 840) | def create_clf(self, feat_dim): method get_fused_feature (line 847) | def get_fused_feature(self, feature_array): method forward (line 855) | def forward(self, X, D): class ProductGate (line 870) | class ProductGate(nn.Module): method __init__ (line 871) | def __init__(self): method forward (line 874) | def forward(self, x): class HarmonicGate (line 882) | class HarmonicGate(nn.Module): method __init__ (line 883) | def __init__(self): method forward (line 886) | def forward(self, x): class SumGate (line 895) | class SumGate(nn.Module): method __init__ (line 896) | def __init__(self): method forward (line 899) | def forward(self, x): class distLinear (line 906) | class distLinear(nn.Module): method __init__ (line 907) | def __init__(self, indim, outdim, class_wise_learnable_norm=True): method forward (line 919) | def forward(self, x): class Flatten (line 930) | class Flatten(nn.Module): method __init__ (line 931) | def __init__(self): method forward (line 934) | def forward(self, x): class Linear_fw (line 938) | class Linear_fw(nn.Linear): #used in MAML to forward input with fast weight method __init__ (line 939) | def __init__(self, in_features, out_features): method forward (line 944) | def forward(self, x): class Conv2d_fw (line 951) | class Conv2d_fw(nn.Conv2d): #used in MAML to forward input with fast weight method __init__ (line 952) | def __init__(self, in_channels, out_channels, kernel_size, stride=1,pa... method forward (line 958) | def forward(self, x): class BatchNorm2d_fw (line 972) | class BatchNorm2d_fw(nn.BatchNorm2d): #used in MAML to forward input wit... method __init__ (line 973) | def __init__(self, num_features): method forward (line 978) | def forward(self, x): class ConvBlock (line 989) | class ConvBlock(nn.Module): method __init__ (line 991) | def __init__(self, indim, outdim, pool = True, padding = 1): method forward (line 1014) | def forward(self,x): class SimpleBlock (line 1019) | class SimpleBlock(nn.Module): method __init__ (line 1021) | def __init__(self, indim, outdim, half_res): method forward (line 1060) | def forward(self, x): class BottleneckBlock (line 1074) | class BottleneckBlock(nn.Module): method __init__ (line 1076) | def __init__(self, indim, outdim, half_res): method forward (line 1117) | def forward(self, x): class ConvNet (line 1134) | class ConvNet(nn.Module): method __init__ (line 1135) | def __init__(self, depth, flatten = True): method forward (line 1150) | def forward(self,x): class ConvNetNopool (line 1154) | class ConvNetNopool(nn.Module): #Relation net use a 4 layer conv with po... method __init__ (line 1155) | def __init__(self, depth): method forward (line 1167) | def forward(self,x): class ConvNetS (line 1171) | class ConvNetS(nn.Module): #For omniglot, only 1 input channel, output d... method __init__ (line 1172) | def __init__(self, depth, flatten = True): method forward (line 1187) | def forward(self,x): class ConvNetSNopool (line 1192) | class ConvNetSNopool(nn.Module): #Relation net use a 4 layer conv with p... method __init__ (line 1193) | def __init__(self, depth): method forward (line 1205) | def forward(self,x): class ResNet (line 1210) | class ResNet(nn.Module): method __init__ (line 1212) | def __init__(self,block,list_of_num_layers, list_of_out_dims, flatten ... method forward (line 1254) | def forward(self,x): function Conv4 (line 1258) | def Conv4(): function Conv6 (line 1261) | def Conv6(): function Conv4NP (line 1264) | def Conv4NP(): function Conv6NP (line 1267) | def Conv6NP(): function Conv4S (line 1270) | def Conv4S(): function Conv4SNP (line 1273) | def Conv4SNP(): function ResNet10 (line 1276) | def ResNet10( flatten = True): function ResNet18 (line 1279) | def ResNet18( flatten = True): function ResNet34 (line 1282) | def ResNet34( flatten = True): function ResNet50 (line 1285) | def ResNet50( flatten = True): function ResNet101 (line 1288) | def ResNet101( flatten = True): FILE: SIB/data/additional_transforms.py class ImageJitter (line 15) | class ImageJitter(object): method __init__ (line 16) | def __init__(self, transformdict): method __call__ (line 20) | def __call__(self, img): FILE: SIB/data/datamgr.py class TransformLoader (line 12) | class TransformLoader: method __init__ (line 13) | def __init__(self, image_size, method parse_transform (line 20) | def parse_transform(self, transform_type): method get_composed_transform (line 36) | def get_composed_transform(self, aug=False): class DataManager (line 47) | class DataManager: method get_data_loader (line 49) | def get_data_loader(self, data_file, aug): class SimpleDataManager (line 53) | class SimpleDataManager(DataManager): method __init__ (line 54) | def __init__(self, image_size, batch_size): method get_data_loader (line 59) | def get_data_loader(self, data_file, aug, num_workers=12, tiered_mini=... class SetDataManager (line 70) | class SetDataManager(DataManager): method __init__ (line 71) | def __init__(self, image_size, n_way, n_support, n_query, n_eposide=100): method get_data_loader (line 80) | def get_data_loader(self, data_file, aug, debug=False): # parameters ... FILE: SIB/data/dataset.py class SimpleDataset (line 14) | class SimpleDataset: method __init__ (line 15) | def __init__(self, data_file, transform, target_transform=identity): method __getitem__ (line 21) | def __getitem__(self, i): method __len__ (line 28) | def __len__(self): class SimpleTieredDataset (line 32) | class SimpleTieredDataset: method __init__ (line 33) | def __init__(self, setname, transform): method __len__ (line 66) | def __len__(self): method __getitem__ (line 69) | def __getitem__(self, i): class SetDataset (line 75) | class SetDataset: method __init__ (line 76) | def __init__(self, data_file, batch_size, transform): method __getitem__ (line 98) | def __getitem__(self, i): method __len__ (line 101) | def __len__(self): class SubDataset (line 105) | class SubDataset: method __init__ (line 106) | def __init__(self, sub_meta, cl, transform=transforms.ToTensor(), targ... method __getitem__ (line 112) | def __getitem__(self, i): method __len__ (line 120) | def __len__(self): class EpisodicBatchSampler (line 124) | class EpisodicBatchSampler(object): method __init__ (line 125) | def __init__(self, n_classes, n_way, n_episodes): method __len__ (line 130) | def __len__(self): method __iter__ (line 133) | def __iter__(self): FILE: SIB/data/feature_loader.py class SimpleHDF5Dataset (line 5) | class SimpleHDF5Dataset: method __init__ (line 6) | def __init__(self, file_handle = None): method __getitem__ (line 18) | def __getitem__(self, i): method __len__ (line 21) | def __len__(self): function init_loader (line 24) | def init_loader(filename, get_path=False, path_file=None): FILE: SIB/data/get_cifarfs.py function download_file (line 24) | def download_file(url, filename): FILE: SIB/dataloader.py function PilLoaderRGB (line 26) | def PilLoaderRGB(imgPath) : class EpisodeSampler (line 30) | class EpisodeSampler(): method __init__ (line 44) | def __init__(self, imgDir, nClsEpisode, nSupport, nQuery, transform, u... method getEpisode (line 61) | def getEpisode(self): class BatchSampler (line 107) | class BatchSampler(): method __init__ (line 122) | def __init__(self, imgDir, nClsEpisode, nSupport, nQuery, transform, u... method getBatch (line 136) | def getBatch(self): class ValImageFolder (line 159) | class ValImageFolder(data.Dataset): method __init__ (line 170) | def __init__(self, episodeJson, imgDir, inputW, inputH, valTransform, ... method __getitem__ (line 194) | def __getitem__(self, index): method __len__ (line 221) | def __len__(self): function ValLoader (line 228) | def ValLoader(episodeJson, imgDir, inputW, inputH, valTransform, useGPU) : function TrainLoader (line 235) | def TrainLoader(batchSize, imgDir, trainTransform) : FILE: SIB/dataset.py function dataset_setting (line 19) | def dataset_setting(dataset, nSupport, image_size=80): FILE: SIB/deconfound/DSIB.py class DeconfoundedSIB (line 13) | class DeconfoundedSIB(nn.Module): method __init__ (line 14) | def __init__(self, n_way, pretrain, n_splits, is_cosine_feature, d_fea... method get_feat_dim (line 62) | def get_feat_dim(self): method fuse_features (line 72) | def fuse_features(self, x1, x2): method normalize (line 80) | def normalize(self, x, dim=1): method fuse_proba (line 85) | def fuse_proba(self, p1, p2): method forward (line 97) | def forward(self, support, labels, query, _): FILE: SIB/deconfound/meta_toolkits.py class FeatureProcessor (line 9) | class FeatureProcessor(): method __init__ (line 10) | def __init__(self, pretrain, n_splits, is_cosine_feature=False, d_feat... method get_split_features (line 36) | def get_split_features(self, x, preprocess=False, center=None, preproc... method nn_preprocess (line 54) | def nn_preprocess(self, data, center=None, preprocessing="l2n"): method calc_pd (line 65) | def calc_pd(self, x, clf_idx): method normalize (line 70) | def normalize(self, x, dim=1): method get_d_feature (line 75) | def get_d_feature(self, x): method get_features (line 93) | def get_features(self, support, query): FILE: SIB/io_utils.py function parse_args (line 20) | def parse_args(script): function get_assigned_file (line 53) | def get_assigned_file(checkpoint_dir,num): function get_resume_file (line 57) | def get_resume_file(checkpoint_dir): function get_best_file (line 68) | def get_best_file(checkpoint_dir): function print_accuracy (line 75) | def print_accuracy(acc): function print_with_carriage_return (line 79) | def print_with_carriage_return(line): function end_carriage_return_print (line 83) | def end_carriage_return_print(): function append_to_file (line 86) | def append_to_file(file, line): function get_result_file (line 91) | def get_result_file(test_name, method_name): function calc_recall_precision (line 101) | def calc_recall_precision(y, pred): FILE: SIB/main.py class Params (line 35) | class Params: method __init__ (line 36) | def __init__(self): FILE: SIB/main_feat.py class ClassifierEval (line 42) | class ClassifierEval(nn.Module): method __init__ (line 47) | def __init__(self, nKnovel, nFeat): method apply_classification_weights (line 57) | def apply_classification_weights(self, features, cls_weights): method forward (line 67) | def forward(self, features_supp, features_query): class ClassifierTrain (line 80) | class ClassifierTrain(nn.Module): method __init__ (line 81) | def __init__(self, nCls, nFeat=640, scaleCls = 10.): method getWeight (line 101) | def getWeight(self): method applyWeightCosine (line 104) | def applyWeightCosine(self, feature, weight, bias, scaleCls): method forward (line 113) | def forward(self, feature): class BaseTrainer (line 119) | class BaseTrainer: method __init__ (line 120) | def __init__(self, trainLoader, valLoader, nbCls, nClsEpisode, nFeat, method LrWarmUp (line 145) | def LrWarmUp(self, totalIter, lr): method train (line 209) | def train(self, epoch): method test (line 242) | def test(self, epoch): FILE: SIB/networks.py class ConvBlock (line 21) | class ConvBlock(nn.Module): method __init__ (line 22) | def __init__(self, in_planes, out_planes): method forward (line 34) | def forward(self, x): class ConvNet_4_64 (line 38) | class ConvNet_4_64(nn.Module): method __init__ (line 39) | def __init__(self, inputW=80, inputH=80): method forward (line 58) | def forward(self, x): class BasicBlock (line 64) | class BasicBlock(nn.Module): method __init__ (line 65) | def __init__(self, in_planes, out_planes, stride, dropRate=0.0): method forward (line 82) | def forward(self, x): class NetworkBlock (line 101) | class NetworkBlock(nn.Module): method __init__ (line 102) | def __init__(self, nb_layers, in_planes, out_planes, block, stride, dr... method _make_layer (line 106) | def _make_layer(self, block, in_planes, out_planes, nb_layers, stride,... method forward (line 114) | def forward(self, x): class WideResNet (line 118) | class WideResNet(nn.Module): method __init__ (line 119) | def __init__(self, depth=28, widen_factor=10, dropRate=0.0, userelu=Tr... method forward (line 150) | def forward(self, x): function label_to_1hot (line 166) | def label_to_1hot(label, K): class dni_linear (line 174) | class dni_linear(nn.Module): method __init__ (line 175) | def __init__(self, input_dims, dni_hidden_size=1024): method forward (line 192) | def forward(self, x): class LinearDiag (line 199) | class LinearDiag(nn.Module): method __init__ (line 200) | def __init__(self, num_features, bias=False): method forward (line 211) | def forward(self, X): class FeatExemplarAvgBlock (line 219) | class FeatExemplarAvgBlock(nn.Module): method __init__ (line 220) | def __init__(self, nFeat): method forward (line 223) | def forward(self, features_train, labels_train): function get_featnet (line 232) | def get_featnet(architecture, inputW=80, inputH=80): FILE: SIB/sib.py class ClassifierSIB (line 21) | class ClassifierSIB(nn.Module): method __init__ (line 36) | def __init__(self, nKnovel, nFeat, q_steps): method apply_classification_weights (line 54) | def apply_classification_weights(self, features, cls_weights): method init_theta (line 73) | def init_theta(self, features_supp, labels_supp_1hot): method refine_theta (line 89) | def refine_theta(self, theta, features_query, lr=1e-3): method get_classification_weights (line 118) | def get_classification_weights(self, features_supp, labels_supp_1hot, ... method forward (line 142) | def forward(self, features_supp, labels_supp, features_query, lr): FILE: SIB/simple_shot_models/Conv4.py function conv_block (line 6) | def conv_block(in_channels: int, out_channels: int) -> nn.Module: class Conv4 (line 15) | class Conv4(nn.Module): method __init__ (line 16) | def __init__(self, num_classes, remove_linear=False): method forward (line 27) | def forward(self, x, feature=False): FILE: SIB/simple_shot_models/DenseNet.py class _DenseLayer (line 10) | class _DenseLayer(nn.Sequential): method __init__ (line 11) | def __init__(self, num_input_features, growth_rate, bn_size, drop_rate): method forward (line 23) | def forward(self, x): class _DenseBlock (line 30) | class _DenseBlock(nn.Sequential): method __init__ (line 31) | def __init__(self, num_layers, num_input_features, bn_size, growth_rat... class _Transition (line 38) | class _Transition(nn.Sequential): method __init__ (line 39) | def __init__(self, num_input_features, num_output_features): class DenseNet (line 48) | class DenseNet(nn.Module): method __init__ (line 62) | def __init__(self, growth_rate=32, block_config=(6, 12, 24, 16), method forward (line 103) | def forward(self, x, feature=False): function densenet121 (line 120) | def densenet121(**kwargs): function densenet169 (line 129) | def densenet169(**kwargs): function densenet201 (line 138) | def densenet201(**kwargs): function densenet161 (line 147) | def densenet161(**kwargs): FILE: SIB/simple_shot_models/MobileNet.py class Block (line 12) | class Block(nn.Module): method __init__ (line 15) | def __init__(self, in_planes, out_planes, stride=1): method forward (line 23) | def forward(self, x): class MobileNet (line 29) | class MobileNet(nn.Module): method __init__ (line 33) | def __init__(self, num_classes=10, remove_linear=False): method _make_layers (line 44) | def _make_layers(self, in_planes): method forward (line 53) | def forward(self, x, feature=False): FILE: SIB/simple_shot_models/ProtoNet.py function get_metric (line 6) | def get_metric(metric_type): class ProtoNet (line 16) | class ProtoNet(nn.Module): method __init__ (line 18) | def __init__(self, feature_net, args=None): method forward (line 28) | def forward(self, data, _=False): FILE: SIB/simple_shot_models/ResNet.py function conv3x3 (line 7) | def conv3x3(in_planes, out_planes, stride=1): function conv1x1 (line 13) | def conv1x1(in_planes, out_planes, stride=1): class BasicBlock (line 18) | class BasicBlock(nn.Module): method __init__ (line 21) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 31) | def forward(self, x): class Bottleneck (line 50) | class Bottleneck(nn.Module): method __init__ (line 53) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 65) | def forward(self, x): class ResNet (line 88) | class ResNet(nn.Module): method __init__ (line 90) | def __init__(self, block, layers, num_classes=1000, zero_init_residual... method _make_layer (line 125) | def _make_layer(self, block, planes, blocks, stride=1): method forward (line 141) | def forward(self, x, feature=False): function resnet10 (line 165) | def resnet10(**kwargs): function resnet18 (line 172) | def resnet18(**kwargs): function resnet34 (line 179) | def resnet34(**kwargs): function resnet50 (line 186) | def resnet50(**kwargs): function resnet101 (line 193) | def resnet101(**kwargs): function resnet152 (line 200) | def resnet152(**kwargs): FILE: SIB/simple_shot_models/WideResNet.py function conv3x3 (line 9) | def conv3x3(in_planes, out_planes, stride=1): function conv_init (line 13) | def conv_init(m): class wide_basic (line 23) | class wide_basic(nn.Module): method __init__ (line 24) | def __init__(self, in_planes, planes, dropout_rate, stride=1): method forward (line 38) | def forward(self, x): class Wide_ResNet (line 46) | class Wide_ResNet(nn.Module): method __init__ (line 47) | def __init__(self, depth, widen_factor, dropout_rate, num_classes, rem... method _wide_layer (line 75) | def _wide_layer(self, block, planes, num_blocks, dropout_rate, stride): method forward (line 85) | def forward(self, x, feature=False): function wideres (line 105) | def wideres(num_classes=64, remove_linear=False): FILE: SIB/utils/config.py function create_dirs (line 21) | def create_dirs(dirs): function get_config_from_json (line 38) | def get_config_from_json(json_file): function get_config_from_yaml (line 54) | def get_config_from_yaml(yaml_file): function get_args (line 69) | def get_args(): function get_config (line 104) | def get_config(): FILE: SIB/utils/outils.py class AverageMeter (line 30) | class AverageMeter(object): method __init__ (line 32) | def __init__(self): method reset (line 35) | def reset(self): method update (line 41) | def update(self, val, n=1): function getCi (line 48) | def getCi(accLog): function accuracy (line 57) | def accuracy(output, target, topk=(1,), diff_scores=None): function get_mean_and_std (line 79) | def get_mean_and_std(dataset): function init_params (line 94) | def init_params(net): function progress_bar (line 118) | def progress_bar(current, total, msg=None): function format_time (line 162) | def format_time(seconds): FILE: SIB/utils/utils.py function set_random_seed (line 26) | def set_random_seed(seed=3): function to_device (line 33) | def to_device(input, device): function fast_hist (line 46) | def fast_hist(label_pred, label_true, n_class): function convert_state_dict (line 53) | def convert_state_dict(state_dict): function get_logger (line 67) | def get_logger(logdir, name):