SYMBOL INDEX (2960 symbols across 378 files) FILE: batchformer-v2/deformable-detr/benchmark.py function get_benckmark_arg_parser (line 22) | def get_benckmark_arg_parser(): function measure_average_inference_time (line 32) | def measure_average_inference_time(model, inputs, num_iters=100, warm_it... function benchmark (line 46) | def benchmark(): FILE: batchformer-v2/deformable-detr/datasets/__init__.py function get_coco_api_from_dataset (line 16) | def get_coco_api_from_dataset(dataset): function build_dataset (line 26) | def build_dataset(image_set, args): FILE: batchformer-v2/deformable-detr/datasets/coco.py class CocoDetection (line 26) | class CocoDetection(TvCocoDetection): method __init__ (line 27) | def __init__(self, img_folder, ann_file, transforms, return_masks, cac... method __getitem__ (line 33) | def __getitem__(self, idx): function convert_coco_poly_to_mask (line 43) | def convert_coco_poly_to_mask(segmentations, height, width): class ConvertCocoPolysToMask (line 60) | class ConvertCocoPolysToMask(object): method __init__ (line 61) | def __init__(self, return_masks=False): method __call__ (line 64) | def __call__(self, image, target): function make_coco_transforms (line 125) | def make_coco_transforms(image_set): function build (line 157) | def build(image_set, args): FILE: batchformer-v2/deformable-detr/datasets/coco_eval.py class CocoEvaluator (line 30) | class CocoEvaluator(object): method __init__ (line 31) | def __init__(self, coco_gt, iou_types): method update (line 44) | def update(self, predictions): method synchronize_between_processes (line 63) | def synchronize_between_processes(self): method accumulate (line 68) | def accumulate(self): method summarize (line 72) | def summarize(self): method prepare (line 77) | def prepare(self, predictions, iou_type): method prepare_for_coco_detection (line 87) | def prepare_for_coco_detection(self, predictions): method prepare_for_coco_segmentation (line 111) | def prepare_for_coco_segmentation(self, predictions): method prepare_for_coco_keypoint (line 146) | def prepare_for_coco_keypoint(self, predictions): function convert_to_xywh (line 173) | def convert_to_xywh(boxes): function merge (line 178) | def merge(img_ids, eval_imgs): function create_common_coco_eval (line 200) | def create_common_coco_eval(coco_eval, img_ids, eval_imgs): function evaluate (line 216) | def evaluate(self): FILE: batchformer-v2/deformable-detr/datasets/coco_panoptic.py class CocoPanoptic (line 23) | class CocoPanoptic: method __init__ (line 24) | def __init__(self, img_folder, ann_folder, ann_file, transforms=None, ... method __getitem__ (line 42) | def __getitem__(self, idx): method __len__ (line 78) | def __len__(self): method get_height_and_width (line 81) | def get_height_and_width(self, idx): function build (line 88) | def build(image_set, args): FILE: batchformer-v2/deformable-detr/datasets/data_prefetcher.py function to_cuda (line 9) | def to_cuda(samples, targets, device): class data_prefetcher (line 14) | class data_prefetcher(): method __init__ (line 15) | def __init__(self, loader, device, prefetch=True): method preload (line 23) | def preload(self): method next (line 51) | def next(self): FILE: batchformer-v2/deformable-detr/datasets/panoptic_eval.py class PanopticEvaluator (line 21) | class PanopticEvaluator(object): method __init__ (line 22) | def __init__(self, ann_file, ann_folder, output_dir="panoptic_eval"): method update (line 31) | def update(self, predictions): method synchronize_between_processes (line 38) | def synchronize_between_processes(self): method summarize (line 45) | def summarize(self): FILE: batchformer-v2/deformable-detr/datasets/samplers.py class DistributedSampler (line 16) | class DistributedSampler(Sampler): method __init__ (line 31) | def __init__(self, dataset, num_replicas=None, rank=None, local_rank=N... method __iter__ (line 48) | def __iter__(self): method __len__ (line 68) | def __len__(self): method set_epoch (line 71) | def set_epoch(self, epoch): class NodeDistributedSampler (line 75) | class NodeDistributedSampler(Sampler): method __init__ (line 90) | def __init__(self, dataset, num_replicas=None, rank=None, local_rank=N... method __iter__ (line 115) | def __iter__(self): method __len__ (line 135) | def __len__(self): method set_epoch (line 138) | def set_epoch(self, epoch): FILE: batchformer-v2/deformable-detr/datasets/torchvision_datasets/coco.py class CocoDetection (line 20) | class CocoDetection(VisionDataset): method __init__ (line 33) | def __init__(self, root, annFile, transform=None, target_transform=Non... method cache_images (line 46) | def cache_images(self): method get_image (line 55) | def get_image(self, path): method __getitem__ (line 63) | def __getitem__(self, index): method __len__ (line 83) | def __len__(self): FILE: batchformer-v2/deformable-detr/datasets/transforms.py function crop (line 24) | def crop(image, target, region): function hflip (line 67) | def hflip(image, target): function resize (line 84) | def resize(image, target, size, max_size=None): function pad (line 143) | def pad(image, target, padding): class RandomCrop (line 156) | class RandomCrop(object): method __init__ (line 157) | def __init__(self, size): method __call__ (line 160) | def __call__(self, img, target): class RandomSizeCrop (line 165) | class RandomSizeCrop(object): method __init__ (line 166) | def __init__(self, min_size: int, max_size: int): method __call__ (line 170) | def __call__(self, img: PIL.Image.Image, target: dict): class CenterCrop (line 177) | class CenterCrop(object): method __init__ (line 178) | def __init__(self, size): method __call__ (line 181) | def __call__(self, img, target): class RandomHorizontalFlip (line 189) | class RandomHorizontalFlip(object): method __init__ (line 190) | def __init__(self, p=0.5): method __call__ (line 193) | def __call__(self, img, target): class RandomResize (line 199) | class RandomResize(object): method __init__ (line 200) | def __init__(self, sizes, max_size=None): method __call__ (line 205) | def __call__(self, img, target=None): class RandomPad (line 210) | class RandomPad(object): method __init__ (line 211) | def __init__(self, max_pad): method __call__ (line 214) | def __call__(self, img, target): class RandomSelect (line 220) | class RandomSelect(object): method __init__ (line 225) | def __init__(self, transforms1, transforms2, p=0.5): method __call__ (line 230) | def __call__(self, img, target): class ToTensor (line 236) | class ToTensor(object): method __call__ (line 237) | def __call__(self, img, target): class RandomErasing (line 241) | class RandomErasing(object): method __init__ (line 243) | def __init__(self, *args, **kwargs): method __call__ (line 246) | def __call__(self, img, target): class Normalize (line 250) | class Normalize(object): method __init__ (line 251) | def __init__(self, mean, std): method __call__ (line 255) | def __call__(self, image, target=None): class Compose (line 269) | class Compose(object): method __init__ (line 270) | def __init__(self, transforms): method __call__ (line 273) | def __call__(self, image, target): method __repr__ (line 278) | def __repr__(self): FILE: batchformer-v2/deformable-detr/engine.py function train_one_epoch (line 25) | def train_one_epoch(model: torch.nn.Module, criterion: torch.nn.Module, function evaluate (line 85) | def evaluate(model, criterion, postprocessors, data_loader, base_ds, dev... FILE: batchformer-v2/deformable-detr/main.py function get_args_parser (line 29) | def get_args_parser(): function main (line 136) | def main(args): FILE: batchformer-v2/deformable-detr/models/__init__.py function build_model (line 13) | def build_model(args): FILE: batchformer-v2/deformable-detr/models/backbone.py class FrozenBatchNorm2d (line 27) | class FrozenBatchNorm2d(torch.nn.Module): method __init__ (line 36) | def __init__(self, n, eps=1e-5): method _load_from_state_dict (line 44) | def _load_from_state_dict(self, state_dict, prefix, local_metadata, st... method forward (line 54) | def forward(self, x): class BackboneBase (line 67) | class BackboneBase(nn.Module): method __init__ (line 69) | def __init__(self, backbone: nn.Module, train_backbone: bool, return_i... method forward (line 85) | def forward(self, tensor_list: NestedTensor): class Backbone (line 96) | class Backbone(BackboneBase): method __init__ (line 98) | def __init__(self, name: str, class Joiner (line 112) | class Joiner(nn.Sequential): method __init__ (line 113) | def __init__(self, backbone, position_embedding): method forward (line 118) | def forward(self, tensor_list: NestedTensor): function build_backbone (line 132) | def build_backbone(args): FILE: batchformer-v2/deformable-detr/models/deformable_detr.py function _get_clones (line 31) | def _get_clones(module, N): class DeformableDETR (line 35) | class DeformableDETR(nn.Module): method __init__ (line 37) | def __init__(self, backbone, transformer, num_classes, num_queries, nu... method forward (line 114) | def forward(self, samples: NestedTensor): method _set_aux_loss (line 190) | def _set_aux_loss(self, outputs_class, outputs_coord): class SetCriterion (line 198) | class SetCriterion(nn.Module): method __init__ (line 204) | def __init__(self, num_classes, matcher, weight_dict, losses, focal_al... method loss_labels (line 220) | def loss_labels(self, outputs, targets, indices, num_boxes, log=True): method loss_cardinality (line 247) | def loss_cardinality(self, outputs, targets, indices, num_boxes): method loss_boxes (line 260) | def loss_boxes(self, outputs, targets, indices, num_boxes): method loss_masks (line 281) | def loss_masks(self, outputs, targets, indices, num_boxes): method _get_src_permutation_idx (line 310) | def _get_src_permutation_idx(self, indices): method _get_tgt_permutation_idx (line 316) | def _get_tgt_permutation_idx(self, indices): method get_loss (line 322) | def get_loss(self, loss, outputs, targets, indices, num_boxes, **kwargs): method forward (line 332) | def forward(self, outputs, targets): class PostProcess (line 394) | class PostProcess(nn.Module): method forward (line 398) | def forward(self, outputs, target_sizes): class MLP (line 429) | class MLP(nn.Module): method __init__ (line 432) | def __init__(self, input_dim, hidden_dim, output_dim, num_layers): method forward (line 438) | def forward(self, x): function build (line 444) | def build(args): FILE: batchformer-v2/deformable-detr/models/deformable_transformer.py class DeformableTransformer (line 15) | class DeformableTransformer(nn.Module): method __init__ (line 16) | def __init__(self, d_model=256, nhead=8, method _reset_parameters (line 67) | def _reset_parameters(self): method get_proposal_pos_embed (line 79) | def get_proposal_pos_embed(self, proposals): method gen_encoder_output_proposals (line 94) | def gen_encoder_output_proposals(self, memory, memory_padding_mask, sp... method get_valid_ratio (line 126) | def get_valid_ratio(self, mask): method forward (line 135) | def forward(self, srcs, masks, pos_embeds, query_embed=None): class DeformableTransformerEncoderLayer (line 200) | class DeformableTransformerEncoderLayer(nn.Module): method __init__ (line 201) | def __init__(self, method with_pos_embed (line 221) | def with_pos_embed(tensor, pos): method forward_ffn (line 224) | def forward_ffn(self, src): method forward (line 230) | def forward(self, src, pos, reference_points, spatial_shapes, level_st... class DeformableTransformerEncoder (line 242) | class DeformableTransformerEncoder(nn.Module): method __init__ (line 243) | def __init__(self, encoder_layer, num_layers, bf=None, bf_idx = 0, ins... method get_reference_points (line 256) | def get_reference_points(spatial_shapes, valid_ratios, device): method forward (line 270) | def forward(self, src, spatial_shapes, level_start_index, valid_ratios... class DeformableTransformerDecoderLayer (line 295) | class DeformableTransformerDecoderLayer(nn.Module): method __init__ (line 296) | def __init__(self, d_model=256, d_ffn=1024, method with_pos_embed (line 320) | def with_pos_embed(tensor, pos): method forward_ffn (line 323) | def forward_ffn(self, tgt): method forward (line 329) | def forward(self, tgt, query_pos, reference_points, src, src_spatial_s... class DeformableTransformerDecoder (line 349) | class DeformableTransformerDecoder(nn.Module): method __init__ (line 350) | def __init__(self, decoder_layer, num_layers, return_intermediate=False): method forward (line 359) | def forward(self, tgt, reference_points, src, src_spatial_shapes, src_... function _get_clones (line 396) | def _get_clones(module, N): function _get_activation_fn (line 400) | def _get_activation_fn(activation): function build_deforamble_transformer (line 411) | def build_deforamble_transformer(args): FILE: batchformer-v2/deformable-detr/models/matcher.py class HungarianMatcher (line 20) | class HungarianMatcher(nn.Module): method __init__ (line 28) | def __init__(self, method forward (line 45) | def forward(self, outputs, targets): function build_matcher (line 99) | def build_matcher(args): FILE: batchformer-v2/deformable-detr/models/ops/functions/ms_deform_attn_func.py class MSDeformAttnFunction (line 21) | class MSDeformAttnFunction(Function): method forward (line 23) | def forward(ctx, value, value_spatial_shapes, value_level_start_index,... method backward (line 32) | def backward(ctx, grad_output): function ms_deform_attn_core_pytorch (line 41) | def ms_deform_attn_core_pytorch(value, value_spatial_shapes, sampling_lo... FILE: batchformer-v2/deformable-detr/models/ops/modules/ms_deform_attn.py function _is_power_of_2 (line 24) | def _is_power_of_2(n): class MSDeformAttn (line 30) | class MSDeformAttn(nn.Module): method __init__ (line 31) | def __init__(self, d_model=256, n_levels=4, n_heads=8, n_points=4): method _reset_parameters (line 62) | def _reset_parameters(self): method forward (line 78) | def forward(self, query, reference_points, input_flatten, input_spatia... FILE: batchformer-v2/deformable-detr/models/ops/setup.py function get_extensions (line 23) | def get_extensions(): FILE: batchformer-v2/deformable-detr/models/ops/src/cpu/ms_deform_attn_cpu.cpp function ms_deform_attn_cpu_forward (line 17) | at::Tensor function ms_deform_attn_cpu_backward (line 29) | std::vector FILE: batchformer-v2/deformable-detr/models/ops/src/ms_deform_attn.h function im2col_step (line 27) | int im2col_step) FILE: batchformer-v2/deformable-detr/models/ops/src/vision.cpp function PYBIND11_MODULE (line 13) | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { FILE: batchformer-v2/deformable-detr/models/ops/test.py function check_forward_equal_with_pytorch_double (line 32) | def check_forward_equal_with_pytorch_double(): function check_forward_equal_with_pytorch_float (line 48) | def check_forward_equal_with_pytorch_float(): function check_gradient_numerical (line 63) | def check_gradient_numerical(channels=4, grad_value=True, grad_sampling_... FILE: batchformer-v2/deformable-detr/models/position_encoding.py class PositionEmbeddingSine (line 20) | class PositionEmbeddingSine(nn.Module): method __init__ (line 25) | def __init__(self, num_pos_feats=64, temperature=10000, normalize=Fals... method forward (line 36) | def forward(self, tensor_list: NestedTensor): class PositionEmbeddingLearned (line 59) | class PositionEmbeddingLearned(nn.Module): method __init__ (line 63) | def __init__(self, num_pos_feats=256): method reset_parameters (line 69) | def reset_parameters(self): method forward (line 73) | def forward(self, tensor_list: NestedTensor): function build_position_encoding (line 87) | def build_position_encoding(args): FILE: batchformer-v2/deformable-detr/models/segmentation.py class DETRsegm (line 30) | class DETRsegm(nn.Module): method __init__ (line 31) | def __init__(self, detr, freeze_detr=False): method forward (line 43) | def forward(self, samples: NestedTensor): class MaskHeadSmallConv (line 72) | class MaskHeadSmallConv(nn.Module): method __init__ (line 78) | def __init__(self, dim, fpn_dims, context_dim): method forward (line 105) | def forward(self, x, bbox_mask, fpns): class MHAttentionMap (line 146) | class MHAttentionMap(nn.Module): method __init__ (line 149) | def __init__(self, query_dim, hidden_dim, num_heads, dropout=0, bias=T... method forward (line 164) | def forward(self, q, k, mask=None): function dice_loss (line 178) | def dice_loss(inputs, targets, num_boxes): function sigmoid_focal_loss (line 196) | def sigmoid_focal_loss(inputs, targets, num_boxes, alpha: float = 0.25, ... class PostProcessSegm (line 224) | class PostProcessSegm(nn.Module): method __init__ (line 225) | def __init__(self, threshold=0.5): method forward (line 230) | def forward(self, results, outputs, orig_target_sizes, max_target_sizes): class PostProcessPanoptic (line 247) | class PostProcessPanoptic(nn.Module): method __init__ (line 251) | def __init__(self, is_thing_map, threshold=0.85): method forward (line 262) | def forward(self, outputs, processed_sizes, target_sizes=None): FILE: batchformer-v2/deformable-detr/tools/launch.py function parse_args (line 116) | def parse_args(): function main (line 159) | def main(): FILE: batchformer-v2/deformable-detr/util/box_ops.py function box_cxcywh_to_xyxy (line 17) | def box_cxcywh_to_xyxy(x): function box_xyxy_to_cxcywh (line 24) | def box_xyxy_to_cxcywh(x): function box_iou (line 32) | def box_iou(boxes1, boxes2): function generalized_box_iou (line 48) | def generalized_box_iou(boxes1, boxes2): function masks_to_boxes (line 72) | def masks_to_boxes(masks): FILE: batchformer-v2/deformable-detr/util/misc.py function _check_size_scale_factor (line 33) | def _check_size_scale_factor(dim, size, scale_factor): function _output_size (line 44) | def _output_size(dim, input, size, scale_factor): class SmoothedValue (line 62) | class SmoothedValue(object): method __init__ (line 67) | def __init__(self, window_size=20, fmt=None): method update (line 75) | def update(self, value, n=1): method synchronize_between_processes (line 80) | def synchronize_between_processes(self): method median (line 94) | def median(self): method avg (line 99) | def avg(self): method global_avg (line 104) | def global_avg(self): method max (line 108) | def max(self): method value (line 112) | def value(self): method __str__ (line 115) | def __str__(self): function all_gather (line 124) | def all_gather(data): function reduce_dict (line 167) | def reduce_dict(input_dict, average=True): class MetricLogger (line 194) | class MetricLogger(object): method __init__ (line 195) | def __init__(self, delimiter="\t"): method update (line 199) | def update(self, **kwargs): method __getattr__ (line 206) | def __getattr__(self, attr): method __str__ (line 214) | def __str__(self): method synchronize_between_processes (line 222) | def synchronize_between_processes(self): method add_meter (line 226) | def add_meter(self, name, meter): method log_every (line 229) | def log_every(self, iterable, print_freq, header=None): function get_sha (line 284) | def get_sha(): function collate_fn (line 304) | def collate_fn(batch): function _max_by_axis (line 310) | def _max_by_axis(the_list): function nested_tensor_from_tensor_list (line 319) | def nested_tensor_from_tensor_list(tensor_list: List[Tensor]): class NestedTensor (line 339) | class NestedTensor(object): method __init__ (line 340) | def __init__(self, tensors, mask: Optional[Tensor]): method to (line 344) | def to(self, device, non_blocking=False): method record_stream (line 355) | def record_stream(self, *args, **kwargs): method decompose (line 360) | def decompose(self): method __repr__ (line 363) | def __repr__(self): function setup_for_distributed (line 367) | def setup_for_distributed(is_master): function is_dist_avail_and_initialized (line 382) | def is_dist_avail_and_initialized(): function get_world_size (line 390) | def get_world_size(): function get_rank (line 396) | def get_rank(): function get_local_size (line 402) | def get_local_size(): function get_local_rank (line 408) | def get_local_rank(): function is_main_process (line 414) | def is_main_process(): function save_on_master (line 418) | def save_on_master(*args, **kwargs): function init_distributed_mode (line 423) | def init_distributed_mode(args): function accuracy (line 465) | def accuracy(output, target, topk=(1,)): function interpolate (line 483) | def interpolate(input, size=None, scale_factor=None, mode="nearest", ali... function get_total_grad_norm (line 505) | def get_total_grad_norm(parameters, norm_type=2): function inverse_sigmoid (line 513) | def inverse_sigmoid(x, eps=1e-5): FILE: batchformer-v2/deformable-detr/util/plot_utils.py function plot_logs (line 21) | def plot_logs(logs, fields=('class_error', 'loss_bbox_unscaled', 'mAP'),... function plot_precision_recall (line 77) | def plot_precision_recall(files, naming_scheme='iter'): FILE: batchformer-v2/deit_share/bt.py class BlockBF (line 5) | class BlockBF(torch.nn.Module): method __init__ (line 7) | def __init__(self, block: Block, fp16_type=0): method forward (line 12) | def forward(self, x): class BlockWrap32 (line 34) | class BlockWrap32(torch.nn.Module): method __init__ (line 36) | def __init__(self, block: Block, fp16_type: int): method forward (line 41) | def forward(self, x): class BlockWrapDebug (line 57) | class BlockWrapDebug(torch.nn.Module): method __init__ (line 59) | def __init__(self, block: Block): method forward (line 63) | def forward(self, x): class AttentionOnly (line 74) | class AttentionOnly(torch.nn.Module): method __init__ (line 76) | def __init__(self, block: Block, drop_path = 0. , add_bt=70): method forward (line 85) | def forward(self, x): class MLPDecorder (line 93) | class MLPDecorder(torch.nn.Module): method __init__ (line 95) | def __init__(self, dim, mlp_dim, skip_mlp=False): method forward (line 101) | def forward(self, x): class MLPEncoder (line 109) | class MLPEncoder(torch.nn.Module): method __init__ (line 111) | def __init__(self, d_model, batch_size, dim_feedforward=2048, dropout=... method __setstate__ (line 122) | def __setstate__(self, state): method forward (line 128) | def forward(self, src): class TransformerDecorator1 (line 147) | class TransformerDecorator1(torch.nn.Module): method __init__ (line 148) | def __init__(self, add_bt=3, dim=2048, eval_global=0, args=None, first... method forward (line 186) | def forward(self, feature): FILE: batchformer-v2/deit_share/cait_models.py class Class_Attention (line 21) | class Class_Attention(nn.Module): method __init__ (line 24) | def __init__(self, dim, num_heads=8, qkv_bias=False, qk_scale=None, at... method forward (line 38) | def forward(self, x ): class LayerScale_Block_CA (line 57) | class LayerScale_Block_CA(nn.Module): method __init__ (line 60) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, qk_sc... method forward (line 75) | def forward(self, x, x_cls): class Attention_talking_head (line 87) | class Attention_talking_head(nn.Module): method __init__ (line 90) | def __init__(self, dim, num_heads=8, qkv_bias=False, qk_scale=None, at... method forward (line 111) | def forward(self, x): class LayerScale_Block (line 130) | class LayerScale_Block(nn.Module): method __init__ (line 133) | def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, qk_sc... method forward (line 147) | def forward(self, x): class cait_models (line 155) | class cait_models(nn.Module): method __init__ (line 158) | def __init__(self, img_size=224, patch_size=16, in_chans=3, num_classe... method _init_weights (line 213) | def _init_weights(self, m): method no_weight_decay (line 223) | def no_weight_decay(self): method forward_features (line 227) | def forward_features(self, x): method forward (line 248) | def forward(self, x): function cait_XXS24_224 (line 256) | def cait_XXS24_224(pretrained=False, **kwargs): function cait_XXS24 (line 278) | def cait_XXS24(pretrained=False, **kwargs): function cait_XXS36_224 (line 299) | def cait_XXS36_224(pretrained=False, **kwargs): function cait_XXS36 (line 321) | def cait_XXS36(pretrained=False, **kwargs): function cait_XS24 (line 343) | def cait_XS24(pretrained=False, **kwargs): function cait_S24_224 (line 368) | def cait_S24_224(pretrained=False, **kwargs): function cait_S24 (line 390) | def cait_S24(pretrained=False, **kwargs): function cait_S36 (line 412) | def cait_S36(pretrained=False, **kwargs): function cait_M36 (line 438) | def cait_M36(pretrained=False, **kwargs): function cait_M48 (line 461) | def cait_M48(pretrained=False, **kwargs): FILE: batchformer-v2/deit_share/datasets.py class INatDataset (line 13) | class INatDataset(ImageFolder): method __init__ (line 14) | def __init__(self, root, train=True, year=2018, transform=None, target... function build_dataset (line 56) | def build_dataset(is_train, args): function build_transform (line 78) | def build_transform(is_train, args): FILE: batchformer-v2/deit_share/engine.py function train_one_epoch (line 20) | def train_one_epoch(model: torch.nn.Module, criterion: DistillationLoss, function evaluate (line 92) | def evaluate(data_loader, model, device): function reduce_tensor (line 127) | def reduce_tensor(acc1, args): function validate (line 134) | def validate(val_loader, training_labels, model, device, num_classes, ra... function shot_acc (line 164) | def shot_acc(preds, labels, train_data, many_shot_thr=100, low_shot_thr=... FILE: batchformer-v2/deit_share/losses.py class DistillationLoss (line 13) | class DistillationLoss(torch.nn.Module): method __init__ (line 18) | def __init__(self, base_criterion: torch.nn.Module, teacher_model: tor... method forward (line 28) | def forward(self, inputs, outputs, labels): class BalancedSoftmax (line 76) | class BalancedSoftmax(_Loss): method __init__ (line 80) | def __init__(self, freq_path): method forward (line 87) | def forward(self, inputs, outputs, labels, reduction='mean'): function balanced_softmax_loss (line 91) | def balanced_softmax_loss(labels, logits, sample_per_class, reduction): function create_loss (line 108) | def create_loss(freq_path): FILE: batchformer-v2/deit_share/main.py function get_args_parser (line 29) | def get_args_parser(): function main (line 217) | def main(args): FILE: batchformer-v2/deit_share/models.py class DistilledVisionTransformer (line 22) | class DistilledVisionTransformer(VisionTransformer): method __init__ (line 23) | def __init__(self, *args, **kwargs): method forward_features (line 34) | def forward_features(self, x): method forward (line 53) | def forward(self, x): function deit_tiny_patch16_224 (line 65) | def deit_tiny_patch16_224(pretrained=False, **kwargs): function deit_small_patch16_224 (line 80) | def deit_small_patch16_224(pretrained=False, **kwargs): function deit_small_patch16_224_12 (line 101) | def deit_small_patch16_224_12(pretrained=False, **kwargs): function deit_base_patch16_224 (line 119) | def deit_base_patch16_224(pretrained=False, **kwargs): function deit_tiny_distilled_patch16_224 (line 145) | def deit_tiny_distilled_patch16_224(pretrained=False, **kwargs): function deit_small_distilled_patch16_224 (line 160) | def deit_small_distilled_patch16_224(pretrained=False, **kwargs): function deit_base_distilled_patch16_224 (line 175) | def deit_base_distilled_patch16_224(pretrained=False, **kwargs): function deit_base_patch16_384 (line 190) | def deit_base_patch16_384(pretrained=False, **kwargs): function deit_base_distilled_patch16_384 (line 205) | def deit_base_distilled_patch16_384(pretrained=False, **kwargs): FILE: batchformer-v2/deit_share/optimizer.py function add_bt_weight_decay (line 26) | def add_bt_weight_decay(model, weight_decay=1e-5, skip_list=(), second_g... function create_bt_optimizer (line 49) | def create_bt_optimizer(args, model, bt_decay, filter_bias_and_bn=True): function create_optimizer_v2 (line 62) | def create_optimizer_v2( FILE: batchformer-v2/deit_share/resmlp_models.py class Affine (line 16) | class Affine(nn.Module): method __init__ (line 17) | def __init__(self, dim): method forward (line 22) | def forward(self, x): class layers_scale_mlp_blocks (line 25) | class layers_scale_mlp_blocks(nn.Module): method __init__ (line 27) | def __init__(self, dim, drop=0., drop_path=0., act_layer=nn.GELU,init_... method forward (line 37) | def forward(self, x): class resmlp_models (line 43) | class resmlp_models(nn.Module): method __init__ (line 45) | def __init__(self, img_size=224, patch_size=16, in_chans=3, num_classe... method _init_weights (line 76) | def _init_weights(self, m): method get_classifier (line 87) | def get_classifier(self): method reset_classifier (line 90) | def reset_classifier(self, num_classes, global_pool=''): method forward_features (line 94) | def forward_features(self, x): method forward (line 107) | def forward(self, x): function resmlp_12 (line 113) | def resmlp_12(pretrained=False,dist=False, **kwargs): function resmlp_24 (line 134) | def resmlp_24(pretrained=False,dist=False,dino=False, **kwargs): function resmlp_36 (line 156) | def resmlp_36(pretrained=False,dist=False, **kwargs): function resmlpB_24 (line 176) | def resmlpB_24(pretrained=False,dist=False, in_22k = False, **kwargs): FILE: batchformer-v2/deit_share/run_with_submitit.py function parse_args (line 15) | def parse_args(): function get_shared_folder (line 30) | def get_shared_folder() -> Path: function get_init_file (line 39) | def get_init_file(): class Trainer (line 48) | class Trainer(object): method __init__ (line 49) | def __init__(self, args): method __call__ (line 52) | def __call__(self): method checkpoint (line 58) | def checkpoint(self): method _setup_gpu_args (line 70) | def _setup_gpu_args(self): function main (line 82) | def main(): FILE: batchformer-v2/deit_share/samplers.py class RASampler (line 8) | class RASampler(torch.utils.data.Sampler): method __init__ (line 16) | def __init__(self, dataset, num_replicas=None, rank=None, shuffle=True): method __iter__ (line 35) | def __iter__(self): method __len__ (line 55) | def __len__(self): method set_epoch (line 58) | def set_epoch(self, epoch): FILE: batchformer-v2/deit_share/utils.py class SmoothedValue (line 18) | class SmoothedValue(object): method __init__ (line 23) | def __init__(self, window_size=20, fmt=None): method update (line 31) | def update(self, value, n=1): method synchronize_between_processes (line 36) | def synchronize_between_processes(self): method median (line 50) | def median(self): method avg (line 55) | def avg(self): method global_avg (line 60) | def global_avg(self): method max (line 64) | def max(self): method value (line 68) | def value(self): method __str__ (line 71) | def __str__(self): class MetricLogger (line 80) | class MetricLogger(object): method __init__ (line 81) | def __init__(self, delimiter="\t"): method update (line 85) | def update(self, **kwargs): method __getattr__ (line 92) | def __getattr__(self, attr): method __str__ (line 100) | def __str__(self): method synchronize_between_processes (line 108) | def synchronize_between_processes(self): method add_meter (line 112) | def add_meter(self, name, meter): method log_every (line 115) | def log_every(self, iterable, print_freq, header=None): function _load_checkpoint_for_ema (line 162) | def _load_checkpoint_for_ema(model_ema, checkpoint): function setup_for_distributed (line 172) | def setup_for_distributed(is_master): function is_dist_avail_and_initialized (line 187) | def is_dist_avail_and_initialized(): function get_world_size (line 195) | def get_world_size(): function get_rank (line 201) | def get_rank(): function is_main_process (line 207) | def is_main_process(): function save_on_master (line 211) | def save_on_master(*args, **kwargs): function init_distributed_mode (line 216) | def init_distributed_mode(args): FILE: batchformer-v2/detr/d2/converter.py function parse_args (line 12) | def parse_args(): function main (line 20) | def main(): FILE: batchformer-v2/detr/d2/detr/config.py function add_detr_config (line 6) | def add_detr_config(cfg): FILE: batchformer-v2/detr/d2/detr/dataset_mapper.py function build_transform_gen (line 15) | def build_transform_gen(cfg, is_train): class DetrDatasetMapper (line 42) | class DetrDatasetMapper: method __init__ (line 55) | def __init__(self, cfg, is_train=True): method __call__ (line 73) | def __call__(self, dataset_dict): FILE: batchformer-v2/detr/d2/detr/detr.py class MaskedBackbone (line 31) | class MaskedBackbone(nn.Module): method __init__ (line 34) | def __init__(self, cfg): method forward (line 41) | def forward(self, images): method mask_out_padding (line 53) | def mask_out_padding(self, feature_shapes, image_sizes, device): class Detr (line 70) | class Detr(nn.Module): method __init__ (line 75) | def __init__(self, cfg): method forward (line 158) | def forward(self, batched_inputs): method prepare_targets (line 202) | def prepare_targets(self, targets): method inference (line 217) | def inference(self, box_cls, box_pred, mask_pred, image_sizes): method preprocess_image (line 255) | def preprocess_image(self, batched_inputs): FILE: batchformer-v2/detr/d2/train_net.py class Trainer (line 31) | class Trainer(DefaultTrainer): method build_evaluator (line 37) | def build_evaluator(cls, cfg, dataset_name, output_folder=None): method build_train_loader (line 49) | def build_train_loader(cls, cfg): method build_optimizer (line 57) | def build_optimizer(cls, cfg, model): function setup (line 106) | def setup(args): function main (line 119) | def main(args): FILE: batchformer-v2/detr/datasets/__init__.py function get_coco_api_from_dataset (line 8) | def get_coco_api_from_dataset(dataset): function build_dataset (line 18) | def build_dataset(image_set, args): FILE: batchformer-v2/detr/datasets/coco.py class CocoDetection (line 17) | class CocoDetection(torchvision.datasets.CocoDetection): method __init__ (line 18) | def __init__(self, img_folder, ann_file, transforms, return_masks): method __getitem__ (line 23) | def __getitem__(self, idx): function convert_coco_poly_to_mask (line 33) | def convert_coco_poly_to_mask(segmentations, height, width): class ConvertCocoPolysToMask (line 50) | class ConvertCocoPolysToMask(object): method __init__ (line 51) | def __init__(self, return_masks=False): method __call__ (line 54) | def __call__(self, image, target): function make_coco_transforms (line 115) | def make_coco_transforms(image_set): function build (line 147) | def build(image_set, args): function build_coco2014 (line 160) | def build_coco2014(image_set, args): function build_hico (line 173) | def build_hico(image_set, args): FILE: batchformer-v2/detr/datasets/coco_eval.py class CocoEvaluator (line 22) | class CocoEvaluator(object): method __init__ (line 23) | def __init__(self, coco_gt, iou_types): method update (line 36) | def update(self, predictions): method synchronize_between_processes (line 55) | def synchronize_between_processes(self): method accumulate (line 60) | def accumulate(self): method summarize (line 64) | def summarize(self): method prepare (line 69) | def prepare(self, predictions, iou_type): method prepare_for_coco_detection (line 79) | def prepare_for_coco_detection(self, predictions): method prepare_for_coco_segmentation (line 103) | def prepare_for_coco_segmentation(self, predictions): method prepare_for_coco_keypoint (line 138) | def prepare_for_coco_keypoint(self, predictions): function convert_to_xywh (line 165) | def convert_to_xywh(boxes): function merge (line 170) | def merge(img_ids, eval_imgs): function create_common_coco_eval (line 192) | def create_common_coco_eval(coco_eval, img_ids, eval_imgs): function evaluate (line 208) | def evaluate(self): FILE: batchformer-v2/detr/datasets/coco_panoptic.py class CocoPanoptic (line 15) | class CocoPanoptic: method __init__ (line 16) | def __init__(self, img_folder, ann_folder, ann_file, transforms=None, ... method __getitem__ (line 34) | def __getitem__(self, idx): method __len__ (line 70) | def __len__(self): method get_height_and_width (line 73) | def get_height_and_width(self, idx): function build (line 80) | def build(image_set, args): FILE: batchformer-v2/detr/datasets/panoptic_eval.py class PanopticEvaluator (line 13) | class PanopticEvaluator(object): method __init__ (line 14) | def __init__(self, ann_file, ann_folder, output_dir="panoptic_eval"): method update (line 23) | def update(self, predictions): method synchronize_between_processes (line 30) | def synchronize_between_processes(self): method summarize (line 37) | def summarize(self): FILE: batchformer-v2/detr/datasets/transforms.py function crop (line 16) | def crop(image, target, region): function hflip (line 59) | def hflip(image, target): function resize (line 76) | def resize(image, target, size, max_size=None): function pad (line 135) | def pad(image, target, padding): class RandomCrop (line 148) | class RandomCrop(object): method __init__ (line 149) | def __init__(self, size): method __call__ (line 152) | def __call__(self, img, target): class RandomSizeCrop (line 157) | class RandomSizeCrop(object): method __init__ (line 158) | def __init__(self, min_size: int, max_size: int): method __call__ (line 162) | def __call__(self, img: PIL.Image.Image, target: dict): class CenterCrop (line 169) | class CenterCrop(object): method __init__ (line 170) | def __init__(self, size): method __call__ (line 173) | def __call__(self, img, target): class RandomHorizontalFlip (line 181) | class RandomHorizontalFlip(object): method __init__ (line 182) | def __init__(self, p=0.5): method __call__ (line 185) | def __call__(self, img, target): class RandomResize (line 191) | class RandomResize(object): method __init__ (line 192) | def __init__(self, sizes, max_size=None): method __call__ (line 197) | def __call__(self, img, target=None): class RandomPad (line 202) | class RandomPad(object): method __init__ (line 203) | def __init__(self, max_pad): method __call__ (line 206) | def __call__(self, img, target): class RandomSelect (line 212) | class RandomSelect(object): method __init__ (line 217) | def __init__(self, transforms1, transforms2, p=0.5): method __call__ (line 222) | def __call__(self, img, target): class ToTensor (line 228) | class ToTensor(object): method __call__ (line 229) | def __call__(self, img, target): class RandomErasing (line 233) | class RandomErasing(object): method __init__ (line 235) | def __init__(self, *args, **kwargs): method __call__ (line 238) | def __call__(self, img, target): class Normalize (line 242) | class Normalize(object): method __init__ (line 243) | def __init__(self, mean, std): method __call__ (line 247) | def __call__(self, image, target=None): class Compose (line 261) | class Compose(object): method __init__ (line 262) | def __init__(self, transforms): method __call__ (line 265) | def __call__(self, image, target): method __repr__ (line 270) | def __repr__(self): FILE: batchformer-v2/detr/engine.py function train_one_epoch (line 17) | def train_one_epoch(model: torch.nn.Module, criterion: torch.nn.Module, function evaluate (line 70) | def evaluate(model, criterion, postprocessors, data_loader, base_ds, dev... FILE: batchformer-v2/detr/hubconf.py function _make_detr (line 13) | def _make_detr(backbone_name: str, dilation=False, num_classes=91, mask=... function detr_resnet50 (line 26) | def detr_resnet50(pretrained=False, num_classes=91, return_postprocessor... function detr_resnet50_dc5 (line 43) | def detr_resnet50_dc5(pretrained=False, num_classes=91, return_postproce... function detr_resnet101 (line 62) | def detr_resnet101(pretrained=False, num_classes=91, return_postprocesso... function detr_resnet101_dc5 (line 79) | def detr_resnet101_dc5(pretrained=False, num_classes=91, return_postproc... function detr_resnet50_panoptic (line 98) | def detr_resnet50_panoptic( function detr_resnet50_dc5_panoptic (line 121) | def detr_resnet50_dc5_panoptic( function detr_resnet101_panoptic (line 147) | def detr_resnet101_panoptic( FILE: batchformer-v2/detr/main.py function get_args_parser (line 20) | def get_args_parser(): function main (line 118) | def main(args): FILE: batchformer-v2/detr/models/__init__.py function build_model (line 5) | def build_model(args): FILE: batchformer-v2/detr/models/backbone.py class FrozenBatchNorm2d (line 19) | class FrozenBatchNorm2d(torch.nn.Module): method __init__ (line 28) | def __init__(self, n): method _load_from_state_dict (line 35) | def _load_from_state_dict(self, state_dict, prefix, local_metadata, st... method forward (line 45) | def forward(self, x): class BackboneBase (line 58) | class BackboneBase(nn.Module): method __init__ (line 60) | def __init__(self, backbone: nn.Module, train_backbone: bool, num_chan... method forward (line 74) | def forward(self, tensor_list: NestedTensor): class Backbone (line 85) | class Backbone(BackboneBase): method __init__ (line 87) | def __init__(self, name: str, class Joiner (line 99) | class Joiner(nn.Sequential): method __init__ (line 100) | def __init__(self, backbone, position_embedding): method forward (line 103) | def forward(self, tensor_list: NestedTensor): function build_backbone (line 115) | def build_backbone(args): class SwinBackbone (line 124) | class SwinBackbone(nn.Module): method __init__ (line 125) | def __init__(self, name: str, method forward (line 157) | def forward(self, tensor_list: NestedTensor): function build_swin_backbone (line 168) | def build_swin_backbone(args): FILE: batchformer-v2/detr/models/detr.py class DETR (line 21) | class DETR(nn.Module): method __init__ (line 23) | def __init__(self, backbone, transformer, num_classes, num_queries, au... method forward (line 45) | def forward(self, samples: NestedTensor): method _set_aux_loss (line 76) | def _set_aux_loss(self, outputs_class, outputs_coord): class SetCriterion (line 84) | class SetCriterion(nn.Module): method __init__ (line 90) | def __init__(self, num_classes, matcher, weight_dict, eos_coef, losses... method loss_labels (line 111) | def loss_labels(self, outputs, targets, indices, num_boxes, log=True): method loss_cardinality (line 141) | def loss_cardinality(self, outputs, targets, indices, num_boxes): method loss_boxes (line 154) | def loss_boxes(self, outputs, targets, indices, num_boxes): method loss_masks (line 175) | def loss_masks(self, outputs, targets, indices, num_boxes): method _get_src_permutation_idx (line 204) | def _get_src_permutation_idx(self, indices): method _get_tgt_permutation_idx (line 210) | def _get_tgt_permutation_idx(self, indices): method get_loss (line 216) | def get_loss(self, loss, outputs, targets, indices, num_boxes, **kwargs): method forward (line 226) | def forward(self, outputs, targets): class PostProcess (line 269) | class PostProcess(nn.Module): method forward (line 272) | def forward(self, outputs, target_sizes): class MLP (line 300) | class MLP(nn.Module): method __init__ (line 303) | def __init__(self, input_dim, hidden_dim, output_dim, num_layers): method forward (line 309) | def forward(self, x): function build (line 315) | def build(args): FILE: batchformer-v2/detr/models/matcher.py class HungarianMatcher (line 12) | class HungarianMatcher(nn.Module): method __init__ (line 20) | def __init__(self, cost_class: float = 1, cost_bbox: float = 1, cost_g... method forward (line 35) | def forward(self, outputs, targets): function build_matcher (line 85) | def build_matcher(args): FILE: batchformer-v2/detr/models/position_encoding.py class PositionEmbeddingSine (line 12) | class PositionEmbeddingSine(nn.Module): method __init__ (line 17) | def __init__(self, num_pos_feats=64, temperature=10000, normalize=Fals... method forward (line 28) | def forward(self, tensor_list: NestedTensor): class PositionEmbeddingLearned (line 51) | class PositionEmbeddingLearned(nn.Module): method __init__ (line 55) | def __init__(self, num_pos_feats=256): method reset_parameters (line 61) | def reset_parameters(self): method forward (line 65) | def forward(self, tensor_list: NestedTensor): function build_position_encoding (line 79) | def build_position_encoding(args): FILE: batchformer-v2/detr/models/segmentation.py class DETRsegm (line 24) | class DETRsegm(nn.Module): method __init__ (line 25) | def __init__(self, detr, freeze_detr=False): method forward (line 37) | def forward(self, samples: NestedTensor): function _expand (line 75) | def _expand(tensor, length: int): class MaskHeadSmallConv (line 79) | class MaskHeadSmallConv(nn.Module): method __init__ (line 85) | def __init__(self, dim, fpn_dims, context_dim): method forward (line 112) | def forward(self, x: Tensor, bbox_mask: Tensor, fpns: List[Tensor]): class MHAttentionMap (line 150) | class MHAttentionMap(nn.Module): method __init__ (line 153) | def __init__(self, query_dim, hidden_dim, num_heads, dropout=0.0, bias... method forward (line 168) | def forward(self, q, k, mask: Optional[Tensor] = None): function dice_loss (line 182) | def dice_loss(inputs, targets, num_boxes): function sigmoid_focal_loss (line 200) | def sigmoid_focal_loss(inputs, targets, num_boxes, alpha: float = 0.25, ... class PostProcessSegm (line 228) | class PostProcessSegm(nn.Module): method __init__ (line 229) | def __init__(self, threshold=0.5): method forward (line 234) | def forward(self, results, outputs, orig_target_sizes, max_target_sizes): class PostProcessPanoptic (line 251) | class PostProcessPanoptic(nn.Module): method __init__ (line 255) | def __init__(self, is_thing_map, threshold=0.85): method forward (line 266) | def forward(self, outputs, processed_sizes, target_sizes=None): FILE: batchformer-v2/detr/models/transformer.py class Transformer (line 18) | class Transformer(nn.Module): method __init__ (line 20) | def __init__(self, d_model=512, nhead=8, num_encoder_layers=6, method _reset_parameters (line 57) | def _reset_parameters(self): method forward (line 62) | def forward(self, src, mask, query_embed, pos_embed): class TransformerEncoder (line 97) | class TransformerEncoder(nn.Module): method __init__ (line 99) | def __init__(self, encoder_layer, num_layers, norm=None, bf=None, bf_i... method forward (line 112) | def forward(self, src, class TransformerDecoder (line 160) | class TransformerDecoder(nn.Module): method __init__ (line 162) | def __init__(self, decoder_layer, num_layers, norm=None, return_interm... method forward (line 170) | def forward(self, tgt, memory, class TransformerEncoderLayer (line 210) | class TransformerEncoderLayer(nn.Module): method __init__ (line 212) | def __init__(self, d_model, nhead, dim_feedforward=2048, dropout=0.1, method with_pos_embed (line 229) | def with_pos_embed(self, tensor, pos: Optional[Tensor]): method forward_post (line 232) | def forward_post(self, method forward_pre (line 247) | def forward_pre(self, src, method forward (line 261) | def forward(self, src, class TransformerDecoderLayer (line 270) | class TransformerDecoderLayer(nn.Module): method __init__ (line 272) | def __init__(self, d_model, nhead, dim_feedforward=2048, dropout=0.1, method with_pos_embed (line 292) | def with_pos_embed(self, tensor, pos: Optional[Tensor]): method forward_post (line 295) | def forward_post(self, tgt, memory, method forward_pre (line 318) | def forward_pre(self, tgt, memory, method forward (line 341) | def forward(self, tgt, memory, function _get_clones (line 355) | def _get_clones(module, N): function build_transformer (line 359) | def build_transformer(args): function _get_activation_fn (line 373) | def _get_activation_fn(activation): FILE: batchformer-v2/detr/run.py function parse_args (line 43) | def parse_args(): FILE: batchformer-v2/detr/run_with_submitit.py function parse_args (line 14) | def parse_args(): function get_shared_folder (line 24) | def get_shared_folder() -> Path: function get_init_file (line 33) | def get_init_file(): class Trainer (line 42) | class Trainer(object): method __init__ (line 43) | def __init__(self, args): method __call__ (line 46) | def __call__(self): method checkpoint (line 52) | def checkpoint(self): method _setup_gpu_args (line 65) | def _setup_gpu_args(self): function main (line 77) | def main(): FILE: batchformer-v2/detr/test_all.py class Tester (line 23) | class Tester(unittest.TestCase): method test_box_cxcywh_to_xyxy (line 25) | def test_box_cxcywh_to_xyxy(self): method indices_torch2python (line 31) | def indices_torch2python(indices): method test_hungarian (line 34) | def test_hungarian(self): method test_position_encoding_script (line 63) | def test_position_encoding_script(self): method test_backbone_script (line 67) | def test_backbone_script(self): method test_model_script_detection (line 71) | def test_model_script_detection(self): method test_model_script_panoptic (line 80) | def test_model_script_panoptic(self): method test_model_detection_different_inputs (line 90) | def test_model_detection_different_inputs(self): method test_warpped_model_script_detection (line 105) | def test_warpped_model_script_detection(self): class ONNXExporterTester (line 127) | class ONNXExporterTester(unittest.TestCase): method setUpClass (line 129) | def setUpClass(cls): method run_model (line 132) | def run_model(self, model, inputs_list, tolerate_small_mismatch=False,... method ort_validate (line 151) | def ort_validate(self, onnx_io, inputs, outputs, tolerate_small_mismat... method test_model_onnx_detection (line 178) | def test_model_onnx_detection(self): method test_model_onnx_detection_panoptic (line 193) | def test_model_onnx_detection_panoptic(self): FILE: batchformer-v2/detr/tools/launch.py function parse_args (line 116) | def parse_args(): function main (line 162) | def main(): FILE: batchformer-v2/detr/util/box_ops.py function box_cxcywh_to_xyxy (line 9) | def box_cxcywh_to_xyxy(x): function box_xyxy_to_cxcywh (line 16) | def box_xyxy_to_cxcywh(x): function box_iou (line 24) | def box_iou(boxes1, boxes2): function generalized_box_iou (line 40) | def generalized_box_iou(boxes1, boxes2): function masks_to_boxes (line 64) | def masks_to_boxes(masks): FILE: batchformer-v2/detr/util/misc.py function _check_size_scale_factor (line 26) | def _check_size_scale_factor(dim, size, scale_factor): function _output_size (line 37) | def _output_size(dim, input, size, scale_factor): class SmoothedValue (line 55) | class SmoothedValue(object): method __init__ (line 60) | def __init__(self, window_size=20, fmt=None): method update (line 68) | def update(self, value, n=1): method synchronize_between_processes (line 73) | def synchronize_between_processes(self): method median (line 87) | def median(self): method avg (line 92) | def avg(self): method global_avg (line 97) | def global_avg(self): method max (line 101) | def max(self): method value (line 105) | def value(self): method __str__ (line 108) | def __str__(self): function all_gather (line 117) | def all_gather(data): function reduce_dict (line 160) | def reduce_dict(input_dict, average=True): class MetricLogger (line 187) | class MetricLogger(object): method __init__ (line 188) | def __init__(self, delimiter="\t"): method update (line 192) | def update(self, **kwargs): method __getattr__ (line 199) | def __getattr__(self, attr): method __str__ (line 207) | def __str__(self): method synchronize_between_processes (line 215) | def synchronize_between_processes(self): method add_meter (line 219) | def add_meter(self, name, meter): method log_every (line 222) | def log_every(self, iterable, print_freq, header=None): function get_sha (line 277) | def get_sha(): function collate_fn (line 297) | def collate_fn(batch): function _max_by_axis (line 303) | def _max_by_axis(the_list): class NestedTensor (line 312) | class NestedTensor(object): method __init__ (line 313) | def __init__(self, tensors, mask: Optional[Tensor]): method to (line 317) | def to(self, device): method decompose (line 328) | def decompose(self): method __repr__ (line 331) | def __repr__(self): function nested_tensor_from_tensor_list (line 335) | def nested_tensor_from_tensor_list(tensor_list: List[Tensor]): function _onnx_nested_tensor_from_tensor_list (line 363) | def _onnx_nested_tensor_from_tensor_list(tensor_list: List[Tensor]) -> N... function setup_for_distributed (line 391) | def setup_for_distributed(is_master): function is_dist_avail_and_initialized (line 406) | def is_dist_avail_and_initialized(): function get_world_size (line 414) | def get_world_size(): function get_rank (line 420) | def get_rank(): function is_main_process (line 426) | def is_main_process(): function save_on_master (line 430) | def save_on_master(*args, **kwargs): function init_distributed_mode (line 435) | def init_distributed_mode(args): function accuracy (line 461) | def accuracy(output, target, topk=(1,)): function interpolate (line 479) | def interpolate(input, size=None, scale_factor=None, mode="nearest", ali... FILE: batchformer-v2/detr/util/plot_utils.py function plot_logs (line 13) | def plot_logs(logs, fields=('class_error', 'loss_bbox_unscaled', 'mAP'),... function plot_precision_recall (line 76) | def plot_precision_recall(files, naming_scheme='iter'): FILE: czsl/data/dataset.py class ImageLoader (line 20) | class ImageLoader: method __init__ (line 21) | def __init__(self, root): method __call__ (line 24) | def __call__(self, img): function dataset_transform (line 29) | def dataset_transform(phase, norm_family = 'imagenet'): function filter_data (line 67) | def filter_data(all_data, pairs_gt, topk = 5): class CompositionDataset (line 94) | class CompositionDataset(Dataset): method __init__ (line 104) | def __init__( method parse_split (line 205) | def parse_split(self): method get_split_info (line 248) | def get_split_info(self): method get_dict_data (line 277) | def get_dict_data(self, data, pairs): method reset_dropout (line 289) | def reset_dropout(self): method sample_negative (line 310) | def sample_negative(self, attr, obj): method sample_affordance (line 327) | def sample_affordance(self, attr, obj): method sample_train_affordance (line 342) | def sample_train_affordance(self, attr, obj): method generate_features (line 357) | def generate_features(self, out_file, model): method __getitem__ (line 393) | def __getitem__(self, index): method __len__ (line 438) | def __len__(self): FILE: czsl/models/common.py class MLP (line 10) | class MLP(nn.Module): method __init__ (line 20) | def __init__(self, inp_dim, out_dim, num_layers = 1, relu = True, bias... method forward (line 47) | def forward(self, x): class Reshape (line 50) | class Reshape(nn.Module): method __init__ (line 51) | def __init__(self, *args): method forward (line 55) | def forward(self, x): function calculate_margines (line 58) | def calculate_margines(domain_embedding, gt, margin_range = 5): function l2_all_batched (line 73) | def l2_all_batched(image_embedding, domain_embedding): function same_domain_triplet_loss (line 85) | def same_domain_triplet_loss(image_embedding, trip_images, gt, hard_k = ... function cross_domain_triplet_loss (line 123) | def cross_domain_triplet_loss(image_embedding, domain_embedding, gt, har... function same_domain_triplet_loss_old (line 167) | def same_domain_triplet_loss_old(image_embedding, positive_anchor, negat... function pairwise_distances (line 190) | def pairwise_distances(x, y=None): class Evaluator (line 212) | class Evaluator: method __init__ (line 214) | def __init__(self, dset, model): method generate_predictions (line 269) | def generate_predictions(self, scores, obj_truth, bias = 0.0, topk = 5... method score_clf_model (line 319) | def score_clf_model(self, scores, obj_truth, topk = 5): method score_manifold_model (line 339) | def score_manifold_model(self, scores, obj_truth, bias = 0.0, topk = 5): method score_fast_model (line 356) | def score_fast_model(self, scores, obj_truth, bias = 0.0, topk = 5): method evaluate_predictions (line 377) | def evaluate_predictions(self, predictions, attr_truth, obj_truth, pai... FILE: czsl/models/compcos.py function compute_cosine_similarity (line 11) | def compute_cosine_similarity(names, weights, return_dict=True): class CompCos (line 23) | class CompCos(nn.Module): method __init__ (line 25) | def __init__(self, dset, args): method freeze_representations (line 130) | def freeze_representations(self): method compose (line 140) | def compose(self, attrs, objs): method compute_feasibility (line 148) | def compute_feasibility(self): method get_pair_scores_objs (line 171) | def get_pair_scores_objs(self, attr, obj, obj_embedding_sim): method get_pair_scores_attrs (line 180) | def get_pair_scores_attrs(self, attr, obj, attr_embedding_sim): method update_feasibility (line 189) | def update_feasibility(self,epoch): method val_forward (line 196) | def val_forward(self, x): method val_forward_with_threshold (line 210) | def val_forward_with_threshold(self, x, th=0.): method train_forward_open (line 228) | def train_forward_open(self, x): method train_forward_closed (line 249) | def train_forward_closed(self, x): method forward (line 263) | def forward(self, x): FILE: czsl/models/gcn.py function normt_spm (line 12) | def normt_spm(mx, method='in'): function spm_to_tensor (line 30) | def spm_to_tensor(sparse_mx): class GraphConv (line 38) | class GraphConv(nn.Module): method __init__ (line 40) | def __init__(self, in_channels, out_channels, dropout=False, relu=True): method forward (line 56) | def forward(self, inputs, adj): class GCN (line 67) | class GCN(nn.Module): method __init__ (line 69) | def __init__(self, adj, in_channels, out_channels, hidden_layers): method forward (line 109) | def forward(self, x): class GraphConvolution (line 119) | class GraphConvolution(nn.Module): method __init__ (line 121) | def __init__(self, in_features, out_features, dropout=False, relu=True... method reset_parameters (line 143) | def reset_parameters(self): method forward (line 147) | def forward(self, input, adj , h0 , lamda, alpha, l): class GCNII (line 171) | class GCNII(nn.Module): method __init__ (line 172) | def __init__(self, adj, in_channels , out_channels, hidden_dim, hidden... method forward (line 195) | def forward(self, x): FILE: czsl/models/graph_method.py class GraphFull (line 10) | class GraphFull(nn.Module): method __init__ (line 11) | def __init__(self, dset, args): method train_forward_normal (line 56) | def train_forward_normal(self, x): method val_forward_dotpr (line 79) | def val_forward_dotpr(self, x): method val_forward_distance_fast (line 99) | def val_forward_distance_fast(self, x): method forward (line 118) | def forward(self, x): FILE: czsl/models/image_extractor.py class ResNet18_conv (line 7) | class ResNet18_conv(ResNet): method __init__ (line 8) | def __init__(self): method forward (line 11) | def forward(self, x): function get_image_extractor (line 26) | def get_image_extractor(arch = 'resnet18', pretrained = True, feature_di... FILE: czsl/models/manifold_methods.py class ManifoldModel (line 11) | class ManifoldModel(nn.Module): method __init__ (line 13) | def __init__(self, dset, args): method train_forward_bce (line 46) | def train_forward_bce(self, x): method train_forward_triplet (line 65) | def train_forward_triplet(self, x): method val_forward_distance (line 84) | def val_forward_distance(self, x): method val_forward_distance_fast (line 99) | def val_forward_distance_fast(self, x): method val_forward_direct (line 118) | def val_forward_direct(self, x): method forward (line 132) | def forward(self, x): class RedWine (line 141) | class RedWine(ManifoldModel): method __init__ (line 143) | def __init__(self, dset, args): method compose (line 187) | def compose(self, attrs, objs): class LabelEmbedPlus (line 194) | class LabelEmbedPlus(ManifoldModel): method __init__ (line 195) | def __init__(self, dset, args): method compose (line 239) | def compose(self, attrs, objs): class AttributeOperator (line 245) | class AttributeOperator(ManifoldModel): method __init__ (line 246) | def __init__(self, dset, args): method apply_ops (line 274) | def apply_ops(self, ops, rep): method compose (line 279) | def compose(self, attrs, objs): method apply_inverse (line 285) | def apply_inverse(self, img_rep, attrs): method train_forward (line 296) | def train_forward(self, x): method forward (line 364) | def forward(self, x): FILE: czsl/models/modular_methods.py class Flatten (line 21) | class Flatten(nn.Module): method forward (line 22) | def forward(self, input): class GatingSampler (line 26) | class GatingSampler(nn.Module): method __init__ (line 29) | def __init__(self, gater, stoch_sample=True, temperature=1.0): method disable_stochastic_sampling (line 38) | def disable_stochastic_sampling(self): method enable_stochastic_sampling (line 41) | def enable_stochastic_sampling(self): method forward (line 44) | def forward(self, tdesc=None, return_additional=False, gating_wt=None): class GatedModularNet (line 70) | class GatedModularNet(nn.Module): method __init__ (line 75) | def __init__(self, method forward (line 107) | def forward(self, x, sampled_g=None, t=None, return_feat=False): class CompositionalModel (line 218) | class CompositionalModel(nn.Module): method __init__ (line 219) | def __init__(self, dset, args): method train_forward_softmax (line 231) | def train_forward_softmax(self, x): method val_forward (line 276) | def val_forward(self, x): method forward (line 319) | def forward(self, x, with_grad=False): class GatedGeneralNN (line 334) | class GatedGeneralNN(CompositionalModel): method __init__ (line 337) | def __init__(self, method compose (line 440) | def compose(self, attrs, objs): class GeneralNormalizedNN (line 453) | class GeneralNormalizedNN(nn.Module): method __init__ (line 456) | def __init__(self, num_layers, num_modules_per_layer, in_dim, inter_dim): class GeneralGatingNN (line 478) | class GeneralGatingNN(nn.Module): method __init__ (line 479) | def __init__( method forward (line 545) | def forward(self, tdesc=None): function modularize_network (line 570) | def modularize_network( function modular_general (line 619) | def modular_general( FILE: czsl/models/svm.py function train_svm (line 32) | def train_svm(Y_train, sample_weight=None): function generate_svms (line 45) | def generate_svms(): function make_svm_tensor (line 91) | def make_svm_tensor(): function evaluate_svms (line 116) | def evaluate_svms(): function evaluate_tensorcompletion (line 158) | def evaluate_tensorcompletion(): FILE: czsl/models/symnet.py class Symnet (line 12) | class Symnet(nn.Module): method __init__ (line 13) | def __init__(self, dset, args): method CoN (line 43) | def CoN(self, img_embedding, attr_embedding): method DeCoN (line 51) | def DeCoN(self, img_embedding, attr_embedding): method distance_metric (line 60) | def distance_metric(self, a, b): method RMD_prob (line 63) | def RMD_prob(self, feat_plus, feat_minus, repeat_img_feat): method train_forward (line 73) | def train_forward(self, x): method val_forward (line 180) | def val_forward(self, x): method forward (line 208) | def forward(self, x): FILE: czsl/models/visual_product.py class VisualProductNN (line 8) | class VisualProductNN(nn.Module): method __init__ (line 9) | def __init__(self, dset, args): method train_forward (line 15) | def train_forward(self, x): method val_forward (line 28) | def val_forward(self, x): method forward (line 41) | def forward(self, x): FILE: czsl/models/word_embedding.py function load_word_embeddings (line 4) | def load_word_embeddings(emb_type, vocab): function load_fasttext_embeddings (line 40) | def load_fasttext_embeddings(vocab): function load_word2vec_embeddings (line 86) | def load_word2vec_embeddings(vocab): function load_glove_embeddings (line 130) | def load_glove_embeddings(vocab): FILE: czsl/test.py function main (line 27) | def main(): function test (line 138) | def test(image_extractor, model, testloader, evaluator, args, threshold... FILE: czsl/train.py function main (line 28) | def main(): function train_normal (line 111) | def train_normal(epoch, image_extractor, model, trainloader, optimizer, ... function test (line 140) | def test(epoch, image_extractor, model, testloader, evaluator, writer, a... FILE: czsl/utils/config_model.py class TransformerDecorator (line 14) | class TransformerDecorator(torch.nn.Module): method __init__ (line 15) | def __init__(self, model, model_name, add_bt=0, eval_bt=0): method is_open (line 26) | def is_open(self): method is_open (line 30) | def is_open(self, value): method update_feasibility (line 33) | def update_feasibility(self, value): method forward_feats (line 36) | def forward_feats(self, feature): method forward (line 48) | def forward(self, feature): function configure_model (line 55) | def configure_model(args, dataset): FILE: czsl/utils/utils.py function chunks (line 11) | def chunks(l, n): function get_norm_values (line 16) | def get_norm_values(norm_family = 'imagenet'): function save_args (line 29) | def save_args(args, log_path, argfile): class UnNormalizer (line 45) | class UnNormalizer: method __init__ (line 54) | def __init__(self, norm_family = 'imagenet'): method __call__ (line 58) | def __call__(self, tensor): function load_args (line 61) | def load_args(filename, args): FILE: domain_generalization/Transfer-Learning-Library/common/loss/__init__.py class KnowledgeDistillationLoss (line 5) | class KnowledgeDistillationLoss(nn.Module): method __init__ (line 24) | def __init__(self, T=1., reduction='batchmean'): method forward (line 29) | def forward(self, y_student, y_teacher): FILE: domain_generalization/Transfer-Learning-Library/common/modules/classifier.py class Classifier (line 12) | class Classifier(nn.Module): method __init__ (line 47) | def __init__(self, backbone: nn.Module, num_classes: int, bottleneck: ... method features_dim (line 74) | def features_dim(self) -> int: method forward (line 78) | def forward(self, x: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]: method get_parameters (line 88) | def get_parameters(self, base_lr=1.0) -> List[Dict]: class ImageClassifier (line 101) | class ImageClassifier(Classifier): FILE: domain_generalization/Transfer-Learning-Library/common/modules/regressor.py class Regressor (line 12) | class Regressor(nn.Module): method __init__ (line 41) | def __init__(self, backbone: nn.Module, num_factors: int, bottleneck: ... method features_dim (line 71) | def features_dim(self) -> int: method forward (line 75) | def forward(self, x: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]: method get_parameters (line 85) | def get_parameters(self, base_lr=1.0) -> List[Dict]: FILE: domain_generalization/Transfer-Learning-Library/common/utils/analysis/__init__.py function collect_feature (line 7) | def collect_feature(data_loader: DataLoader, feature_extractor: nn.Module, FILE: domain_generalization/Transfer-Learning-Library/common/utils/analysis/a_distance.py class ANet (line 15) | class ANet(nn.Module): method __init__ (line 16) | def __init__(self, in_feature): method forward (line 21) | def forward(self, x): function calculate (line 27) | def calculate(source_feature: torch.Tensor, target_feature: torch.Tensor, FILE: domain_generalization/Transfer-Learning-Library/common/utils/analysis/tsne.py function visualize (line 15) | def visualize(source_feature: torch.Tensor, target_feature: torch.Tensor, FILE: domain_generalization/Transfer-Learning-Library/common/utils/data.py function send_to_device (line 18) | def send_to_device(tensor, device): class ForeverDataIterator (line 40) | class ForeverDataIterator: method __init__ (line 43) | def __init__(self, data_loader: DataLoader, device=None): method __next__ (line 48) | def __next__(self): method __len__ (line 60) | def __len__(self): class RandomMultipleGallerySampler (line 64) | class RandomMultipleGallerySampler(Sampler): method __init__ (line 76) | def __init__(self, dataset, num_instances=4): method __len__ (line 97) | def __len__(self): method __iter__ (line 100) | def __iter__(self): class CombineDataset (line 141) | class CombineDataset(Dataset[T_co]): method __init__ (line 151) | def __init__(self, datasets: Iterable[Dataset]) -> None: method __len__ (line 157) | def __len__(self): method __getitem__ (line 160) | def __getitem__(self, idx): function concatenate (line 164) | def concatenate(tensors): FILE: domain_generalization/Transfer-Learning-Library/common/utils/logger.py class TextLogger (line 9) | class TextLogger(object): method __init__ (line 16) | def __init__(self, filename, stream=sys.stdout): method write (line 20) | def write(self, message): method flush (line 25) | def flush(self): method close (line 29) | def close(self): class CompleteLogger (line 34) | class CompleteLogger: method __init__ (line 47) | def __init__(self, root, phase='train'): method set_epoch (line 69) | def set_epoch(self, epoch): method _get_phase_or_epoch (line 74) | def _get_phase_or_epoch(self): method get_image_path (line 80) | def get_image_path(self, filename: str): method get_checkpoint_path (line 86) | def get_checkpoint_path(self, name=None): method close (line 101) | def close(self): FILE: domain_generalization/Transfer-Learning-Library/common/utils/meter.py class AverageMeter (line 8) | class AverageMeter(object): method __init__ (line 18) | def __init__(self, name: str, fmt: Optional[str] = ':f'): method reset (line 23) | def reset(self): method update (line 29) | def update(self, val, n=1): method __str__ (line 36) | def __str__(self): class AverageMeterDict (line 41) | class AverageMeterDict(object): method __init__ (line 42) | def __init__(self, names: List, fmt: Optional[str] = ':f'): method reset (line 47) | def reset(self): method update (line 51) | def update(self, accuracies, n=1): method average (line 55) | def average(self): method __getitem__ (line 60) | def __getitem__(self, item): class Meter (line 64) | class Meter(object): method __init__ (line 66) | def __init__(self, name: str, fmt: Optional[str] = ':f'): method reset (line 71) | def reset(self): method update (line 74) | def update(self, val): method __str__ (line 77) | def __str__(self): class ProgressMeter (line 82) | class ProgressMeter(object): method __init__ (line 83) | def __init__(self, num_batches, meters, prefix=""): method display (line 88) | def display(self, batch): method _get_batch_fmtstr (line 93) | def _get_batch_fmtstr(self, num_batches): FILE: domain_generalization/Transfer-Learning-Library/common/utils/metric/__init__.py function binary_accuracy (line 6) | def binary_accuracy(output: torch.Tensor, target: torch.Tensor) -> float: function accuracy (line 16) | def accuracy(output, target, topk=(1,)): class ConfusionMatrix (line 43) | class ConfusionMatrix(object): method __init__ (line 44) | def __init__(self, num_classes): method update (line 48) | def update(self, target, output): method reset (line 68) | def reset(self): method compute (line 71) | def compute(self): method __str__ (line 87) | def __str__(self): method format (line 99) | def format(self, classes: list): FILE: domain_generalization/Transfer-Learning-Library/common/utils/metric/keypoint_detection.py function get_max_preds (line 9) | def get_max_preds(batch_heatmaps): function calc_dists (line 40) | def calc_dists(preds, target, normalize): function dist_acc (line 55) | def dist_acc(dists, thr=0.5): function accuracy (line 65) | def accuracy(output, target, hm_type='gaussian', thr=0.5): FILE: domain_generalization/Transfer-Learning-Library/common/utils/metric/reid.py function unique_sample (line 18) | def unique_sample(ids_dict, num): function cmc (line 27) | def cmc(dist_mat, query_ids, gallery_ids, query_cams, gallery_cams, topk... function mean_ap (line 79) | def mean_ap(dist_mat, query_ids, gallery_ids, query_cams, gallery_cams): function re_ranking (line 105) | def re_ranking(q_g_dist, q_q_dist, g_g_dist, k1=20, k2=6, lambda_value=0... function extract_reid_feature (line 178) | def extract_reid_feature(data_loader, model, device, normalize, print_fr... function pairwise_distance (line 214) | def pairwise_distance(feature_dict, query, gallery): function evaluate_all (line 233) | def evaluate_all(dist_mat, query, gallery, cmc_topk=(1, 5, 10), cmc_flag... function validate (line 259) | def validate(val_loader, model, query, gallery, device, criterion='cosin... function visualize_ranked_results (line 286) | def visualize_ranked_results(data_loader, model, query, gallery, device,... FILE: domain_generalization/Transfer-Learning-Library/common/utils/scheduler.py class WarmupMultiStepLR (line 10) | class WarmupMultiStepLR(torch.optim.lr_scheduler._LRScheduler): method __init__ (line 27) | def __init__( method get_lr (line 55) | def get_lr(self): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/_util.py function download (line 10) | def download(root: str, file_name: str, archive_name: str, url_link: str): function check_exits (line 37) | def check_exits(root: str, file_name: str): function read_list_from_file (line 44) | def read_list_from_file(file_name: str) -> List[str]: FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/aircrafts.py class Aircraft (line 11) | class Aircraft(ImageList): method __init__ (line 64) | def __init__(self, root: str, split: str, sample_rate: Optional[int]=1... FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/coco70.py class COCO70 (line 11) | class COCO70(ImageList): method __init__ (line 61) | def __init__(self, root: str, split: str, sample_rate: Optional[int] =... FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/cub200.py class CUB200 (line 11) | class CUB200(ImageList): method __init__ (line 57) | def __init__(self, root: str, split: str, sample_rate: Optional[int] =... FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/digits.py class MNIST (line 11) | class MNIST(ImageList): method __init__ (line 38) | def __init__(self, root, mode="L", split='train', download: Optional[b... method __getitem__ (line 51) | def __getitem__(self, index: int) -> Tuple[Any, int]: method get_classes (line 67) | def get_classes(self): class USPS (line 71) | class USPS(ImageList): method __init__ (line 101) | def __init__(self, root, mode="L", split='train', download: Optional[b... method __getitem__ (line 114) | def __getitem__(self, index: int) -> Tuple[Any, int]: class SVHN (line 130) | class SVHN(ImageList): method __init__ (line 162) | def __init__(self, root, mode="L", download: Optional[bool] = True, **... method __getitem__ (line 174) | def __getitem__(self, index: int) -> Tuple[Any, int]: class MNISTRGB (line 190) | class MNISTRGB(MNIST): method __init__ (line 191) | def __init__(self, root, **kwargs): class USPSRGB (line 195) | class USPSRGB(USPS): method __init__ (line 196) | def __init__(self, root, **kwargs): class SVHNRGB (line 200) | class SVHNRGB(SVHN): method __init__ (line 201) | def __init__(self, root, **kwargs): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/domainnet.py class DomainNet (line 11) | class DomainNet(ImageList): method __init__ (line 95) | def __init__(self, root: str, task: str, split: Optional[str] = 'train... method domains (line 109) | def domains(cls): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/dtd.py class DTD (line 10) | class DTD(ImageList): method __init__ (line 35) | def __init__(self, root, split, download=False, **kwargs): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/eurosat.py class EuroSAT (line 10) | class EuroSAT(ImageList): method __init__ (line 30) | def __init__(self, root, split='train', download=False, **kwargs): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/imagelist.py class ImageList (line 11) | class ImageList(datasets.VisionDataset): method __init__ (line 33) | def __init__(self, root: str, classes: List[str], data_list_file: str, method __getitem__ (line 43) | def __getitem__(self, index: int) -> Tuple[Any, int]: method __len__ (line 57) | def __len__(self) -> int: method parse_data_file (line 60) | def parse_data_file(self, file_name: str) -> List[Tuple[str, int]]: method num_classes (line 80) | def num_classes(self) -> int: method domains (line 85) | def domains(cls): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/imagenet_r.py class ImageNetR (line 11) | class ImageNetR(ImageList): method __init__ (line 68) | def __init__(self, root: str, task: str, split: Optional[str] = 'all',... method domains (line 84) | def domains(cls): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/imagenet_sketch.py class ImageNetSketch (line 12) | class ImageNetSketch(ImageList): method __init__ (line 53) | def __init__(self, root: str, task: str, split: Optional[str] = 'all',... method domains (line 69) | def domains(cls): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/keypoint_detection/freihand.py function _assert_exist (line 18) | def _assert_exist(p): function json_load (line 23) | def json_load(p): function load_db_annotation (line 30) | def load_db_annotation(base_path, set_name=None): function projectPoints (line 56) | def projectPoints(xyz, K): function db_size (line 65) | def db_size(set_name): class sample_version (line 75) | class sample_version: method valid_options (line 84) | def valid_options(cls): method check_valid (line 89) | def check_valid(cls, version): method map_id (line 94) | def map_id(cls, id, version): class FreiHand (line 99) | class FreiHand(Hand21KeypointDataset): method __init__ (line 123) | def __init__(self, root, split='train', task='all', download=True, **k... method __getitem__ (line 150) | def __getitem__(self, index): method get_samples (line 201) | def get_samples(self, root, version='gs'): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/keypoint_detection/hand_3d_studio.py class Hand3DStudio (line 19) | class Hand3DStudio(Hand21KeypointDataset): method __init__ (line 49) | def __init__(self, root, split='train', task='noobject', download=True... method __getitem__ (line 82) | def __getitem__(self, index): class Hand3DStudioAll (line 119) | class Hand3DStudioAll(Hand3DStudio): method __init__ (line 124) | def __init__(self, root, task='all', **kwargs): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/keypoint_detection/human36m.py class Human36M (line 17) | class Human36M(Body16KeypointDataset): method __init__ (line 50) | def __init__(self, root, split='train', task='all', download=True, **k... method __getitem__ (line 75) | def __getitem__(self, index): method preprocess (line 111) | def preprocess(self, part, root): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/keypoint_detection/keypoint_dataset.py class KeypointDataset (line 12) | class KeypointDataset(Dataset, ABC): method __init__ (line 27) | def __init__(self, root, num_keypoints, samples, transforms=None, imag... method __len__ (line 39) | def __len__(self): method visualize (line 42) | def visualize(self, image, keypoints, filename): method group_accuracy (line 62) | def group_accuracy(self, accuracies): class Body16KeypointDataset (line 78) | class Body16KeypointDataset(KeypointDataset, ABC): method __init__ (line 97) | def __init__(self, root, samples, **kwargs): class Hand21KeypointDataset (line 119) | class Hand21KeypointDataset(KeypointDataset, ABC): method __init__ (line 135) | def __init__(self, root, samples, **kwargs): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/keypoint_detection/lsp.py class LSP (line 19) | class LSP(Body16KeypointDataset): method __init__ (line 42) | def __init__(self, root, split='train', task='all', download=True, ima... method __getitem__ (line 69) | def __getitem__(self, index): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/keypoint_detection/rendered_hand_pose.py class RenderedHandPose (line 15) | class RenderedHandPose(Hand21KeypointDataset): method __init__ (line 36) | def __init__(self, root, split='train', task='all', download=True, **k... method __getitem__ (line 54) | def __getitem__(self, index): method get_samples (line 106) | def get_samples(self, root, task, min_size=64): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/keypoint_detection/surreal.py class SURREAL (line 17) | class SURREAL(Body16KeypointDataset): method __init__ (line 43) | def __init__(self, root, split='train', task='all', download=True, **k... method __getitem__ (line 82) | def __getitem__(self, index): method __len__ (line 120) | def __len__(self): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/keypoint_detection/util.py function generate_target (line 9) | def generate_target(joints, joints_vis, heatmap_size, sigma, image_size): function keypoint2d_to_3d (line 71) | def keypoint2d_to_3d(keypoint2d: np.ndarray, intrinsic_matrix: np.ndarra... function keypoint3d_to_2d (line 78) | def keypoint3d_to_2d(keypoint3d: np.ndarray, intrinsic_matrix: np.ndarray): function scale_box (line 85) | def scale_box(box, image_width, image_height, scale): function get_bounding_box (line 114) | def get_bounding_box(keypoint2d: np.array): function visualize_heatmap (line 123) | def visualize_heatmap(image, heatmaps, filename): function area (line 135) | def area(left, upper, right, lower): function intersection (line 139) | def intersection(box_a, box_b): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/office31.py class Office31 (line 11) | class Office31(ImageList): method __init__ (line 54) | def __init__(self, root: str, task: str, download: Optional[bool] = Tr... method domains (line 66) | def domains(cls): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/officecaltech.py class OfficeCaltech (line 12) | class OfficeCaltech(DatasetFolder): method __init__ (line 50) | def __init__(self, root: str, task: str, download: Optional[bool] = Fa... method num_classes (line 69) | def num_classes(self): method domains (line 74) | def domains(cls): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/officehome.py class OfficeHome (line 11) | class OfficeHome(ImageList): method __init__ (line 59) | def __init__(self, root: str, task: str, download: Optional[bool] = Fa... method domains (line 71) | def domains(cls): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/openset/__init__.py function open_set (line 17) | def open_set(dataset_class: ClassVar, public_classes: Sequence[str], function default_open_set (line 67) | def default_open_set(dataset_class: ClassVar, source: bool) -> ClassVar: FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/oxfordflowers.py class OxfordFlowers102 (line 10) | class OxfordFlowers102(ImageList): method __init__ (line 48) | def __init__(self, root, split='train', download=False, **kwargs): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/oxfordpet.py class OxfordIIITPet (line 11) | class OxfordIIITPet(ImageList): method __init__ (line 58) | def __init__(self, root: str, split: str, sample_rate: Optional[int] =... FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/pacs.py class PACS (line 7) | class PACS(ImageList): method __init__ (line 50) | def __init__(self, root: str, task: str, split='all', download: Option... method domains (line 66) | def domains(cls): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/partial/__init__.py function partial (line 19) | def partial(dataset_class: ClassVar, partial_classes: Sequence[str]) -> ... function default_partial (line 59) | def default_partial(dataset_class: ClassVar) -> ClassVar: FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/partial/caltech_imagenet.py class CaltechImageNet (line 48) | class CaltechImageNet(ImageList): method __init__ (line 87) | def __init__(self, root: str, task: str, download: Optional[bool] = Tr... class CaltechImageNetUniversal (line 104) | class CaltechImageNetUniversal(ImageList): method __init__ (line 143) | def __init__(self, root: str, task: str, download: Optional[bool] = Tr... FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/partial/imagenet_caltech.py class ImageNetCaltech (line 391) | class ImageNetCaltech(ImageList): method __init__ (line 430) | def __init__(self, root: str, task: str, download: Optional[bool] = Tr... class ImageNetCaltechUniversal (line 447) | class ImageNetCaltechUniversal(ImageList): method __init__ (line 487) | def __init__(self, root: str, task: str, download: Optional[bool] = Tr... FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/patchcamelyon.py class PatchCamelyon (line 10) | class PatchCamelyon(ImageList): method __init__ (line 28) | def __init__(self, root, split, download=False, **kwargs): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/regression/dsprites.py class DSprites (line 11) | class DSprites(ImageRegression): method __init__ (line 53) | def __init__(self, root: str, task: str, split: Optional[str] = 'train', FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/regression/image_regression.py class ImageRegression (line 12) | class ImageRegression(datasets.VisionDataset): method __init__ (line 34) | def __init__(self, root: str, factors: Sequence[str], data_list_file: ... method __getitem__ (line 42) | def __getitem__(self, index: int) -> Tuple[Any, Tuple[float]]: method __len__ (line 58) | def __len__(self) -> int: method parse_data_file (line 61) | def parse_data_file(self, file_name: str) -> List[Tuple[str, Any]]: method num_factors (line 82) | def num_factors(self) -> int: FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/regression/mpi3d.py class MPI3D (line 11) | class MPI3D(ImageRegression): method __init__ (line 53) | def __init__(self, root: str, task: str, split: Optional[str] = 'train', FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/reid/basedataset.py class BaseDataset (line 10) | class BaseDataset(object): method get_imagedata_info (line 15) | def get_imagedata_info(self, data): method get_videodata_info (line 27) | def get_videodata_info(self, data, return_tracklet_stats=False): method print_dataset_statistics (line 42) | def print_dataset_statistics(self, train, query, galler): method check_before_run (line 45) | def check_before_run(self, required_files): method images_dir (line 58) | def images_dir(self): class BaseImageDataset (line 62) | class BaseImageDataset(BaseDataset): method print_dataset_statistics (line 67) | def print_dataset_statistics(self, train, query, gallery): class BaseVideoDataset (line 82) | class BaseVideoDataset(BaseDataset): method print_dataset_statistics (line 87) | def print_dataset_statistics(self, train, query, gallery): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/reid/convert.py function convert_to_pytorch_dataset (line 10) | def convert_to_pytorch_dataset(dataset, root=None, transform=None, retur... FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/reid/dukemtmc.py class DukeMTMC (line 15) | class DukeMTMC(BaseImageDataset): method __init__ (line 32) | def __init__(self, root, verbose=True): method process_dir (line 60) | def process_dir(self, dir_path, relabel=False): method translate (line 81) | def translate(self, transform: Callable, target_root: str): method translate_dir (line 102) | def translate_dir(self, transform, origin_dir: str, target_dir: str): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/reid/market1501.py class Market1501 (line 15) | class Market1501(BaseImageDataset): method __init__ (line 32) | def __init__(self, root, verbose=True): method process_dir (line 60) | def process_dir(self, dir_path, relabel=False): method translate (line 86) | def translate(self, transform: Callable, target_root: str): method translate_dir (line 107) | def translate_dir(self, transform, origin_dir: str, target_dir: str): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/reid/msmt17.py class MSMT17 (line 13) | class MSMT17(BaseImageDataset): method __init__ (line 30) | def __init__(self, root, verbose=True): method process_dir (line 53) | def process_dir(self, dir_path): method translate (line 71) | def translate(self, transform: Callable, target_root: str): method translate_dir (line 92) | def translate_dir(self, transform, origin_dir: str, target_dir: str): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/reid/personx.py class PersonX (line 16) | class PersonX(BaseImageDataset): method __init__ (line 33) | def __init__(self, root, verbose=True): method process_dir (line 61) | def process_dir(self, dir_path, relabel=False): method translate (line 84) | def translate(self, transform: Callable, target_root: str): method translate_dir (line 105) | def translate_dir(self, transform, origin_dir: str, target_dir: str): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/reid/unreal.py class UnrealPerson (line 12) | class UnrealPerson(BaseImageDataset): method __init__ (line 42) | def __init__(self, root, verbose=True): method process_dir (line 66) | def process_dir(self, list_file): method translate (line 86) | def translate(self, transform: Callable, target_root: str): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/resisc45.py class Resisc45 (line 10) | class Resisc45(ImageFolder): method __init__ (line 27) | def __init__(self, root, split='train', download=False, **kwargs): method num_classes (line 37) | def num_classes(self) -> int: FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/retinopathy.py class Retinopathy (line 9) | class Retinopathy(ImageList): method __init__ (line 27) | def __init__(self, root, split, download=False, **kwargs): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/segmentation/cityscapes.py class Cityscapes (line 10) | class Cityscapes(SegmentationList): method __init__ (line 55) | def __init__(self, root, split='train', data_folder='leftImg8bit', lab... method parse_label_file (line 67) | def parse_label_file(self, label_list_file): class FoggyCityscapes (line 73) | class FoggyCityscapes(Cityscapes): method __init__ (line 99) | def __init__(self, root, split='train', data_folder='leftImg8bit_foggy... method parse_data_file (line 104) | def parse_data_file(self, file_name): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/segmentation/gta5.py class GTA5 (line 11) | class GTA5(SegmentationList): method __init__ (line 33) | def __init__(self, root, split='train', data_folder='images', label_fo... FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/segmentation/segmentation_list.py class SegmentationList (line 14) | class SegmentationList(data.Dataset): method __init__ (line 42) | def __init__(self, root: str, classes: Sequence[str], data_list_file: ... method parse_data_file (line 59) | def parse_data_file(self, file_name): method parse_label_file (line 72) | def parse_label_file(self, file_name): method __len__ (line 85) | def __len__(self): method __getitem__ (line 88) | def __getitem__(self, index): method num_classes (line 107) | def num_classes(self) -> int: method decode_target (line 111) | def decode_target(self, target): method collect_image_paths (line 125) | def collect_image_paths(self): method _save_pil_image (line 130) | def _save_pil_image(image, path): method translate (line 134) | def translate(self, transform: Callable, target_root: str, color=False): method evaluate_classes (line 161) | def evaluate_classes(self): method ignore_classes (line 166) | def ignore_classes(self): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/segmentation/synthia.py class Synthia (line 11) | class Synthia(SegmentationList): method __init__ (line 38) | def __init__(self, root, split='train', data_folder='RGB', label_folde... method evaluate_classes (line 48) | def evaluate_classes(self): FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/stanford_cars.py class StanfordCars (line 11) | class StanfordCars(ImageList): method __init__ (line 64) | def __init__(self, root: str, split: str, sample_rate: Optional[int] =... FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/stanford_dogs.py class StanfordDogs (line 11) | class StanfordDogs(ImageList): method __init__ (line 75) | def __init__(self, root: str, split: str, sample_rate: Optional[int] =... FILE: domain_generalization/Transfer-Learning-Library/common/vision/datasets/visda2017.py class VisDA2017 (line 11) | class VisDA2017(ImageList): method __init__ (line 47) | def __init__(self, root: str, task: str, download: Optional[bool] = Fa... method domains (line 59) | def domains(cls): FILE: domain_generalization/Transfer-Learning-Library/common/vision/models/digits.py class LeNet (line 8) | class LeNet(nn.Sequential): method __init__ (line 9) | def __init__(self, num_classes=10): method copy_head (line 26) | def copy_head(self): class DTN (line 30) | class DTN(nn.Sequential): method __init__ (line 31) | def __init__(self, num_classes=10): method copy_head (line 54) | def copy_head(self): function lenet (line 59) | def lenet(pretrained=False, **kwargs): function dtn (line 73) | def dtn(pretrained=False, **kwargs): FILE: domain_generalization/Transfer-Learning-Library/common/vision/models/ibn.py class IBN (line 25) | class IBN(nn.Module): method __init__ (line 41) | def __init__(self, planes, ratio=0.5): method forward (line 47) | def forward(self, x): class BasicBlock_IBN (line 55) | class BasicBlock_IBN(nn.Module): method __init__ (line 58) | def __init__(self, inplanes, planes, ibn=None, stride=1, downsample=No... method forward (line 73) | def forward(self, x): class Bottleneck_IBN (line 94) | class Bottleneck_IBN(nn.Module): method __init__ (line 97) | def __init__(self, inplanes, planes, ibn=None, stride=1, downsample=No... method forward (line 114) | def forward(self, x): class ResNet_IBN (line 139) | class ResNet_IBN(nn.Module): method __init__ (line 144) | def __init__(self, block, layers, ibn_cfg=('a', 'a', 'a', None)): method _make_layer (line 169) | def _make_layer(self, block, planes, blocks, stride=1, ibn=None): method forward (line 189) | def forward(self, x): method out_features (line 204) | def out_features(self) -> int: function resnet18_ibn_a (line 209) | def resnet18_ibn_a(pretrained=False): function resnet34_ibn_a (line 223) | def resnet34_ibn_a(pretrained=False): function resnet50_ibn_a (line 237) | def resnet50_ibn_a(pretrained=False): function resnet101_ibn_a (line 251) | def resnet101_ibn_a(pretrained=False): function resnet18_ibn_b (line 265) | def resnet18_ibn_b(pretrained=False): function resnet34_ibn_b (line 279) | def resnet34_ibn_b(pretrained=False): function resnet50_ibn_b (line 293) | def resnet50_ibn_b(pretrained=False): function resnet101_ibn_b (line 307) | def resnet101_ibn_b(pretrained=False): FILE: domain_generalization/Transfer-Learning-Library/common/vision/models/keypoint_detection/loss.py class JointsMSELoss (line 10) | class JointsMSELoss(nn.Module): method __init__ (line 33) | def __init__(self, reduction='mean'): method forward (line 38) | def forward(self, output, target, target_weight=None): class JointsKLLoss (line 51) | class JointsKLLoss(nn.Module): method __init__ (line 75) | def __init__(self, reduction='mean', epsilon=0.): method forward (line 81) | def forward(self, output, target, target_weight=None): FILE: domain_generalization/Transfer-Learning-Library/common/vision/models/keypoint_detection/pose_resnet.py class Upsampling (line 10) | class Upsampling(nn.Sequential): method __init__ (line 14) | def __init__(self, in_channel=2048, hidden_dims=(256, 256, 256), kerne... class PoseResNet (line 58) | class PoseResNet(nn.Module): method __init__ (line 69) | def __init__(self, backbone, upsampling, feature_dim, num_keypoints, f... method forward (line 79) | def forward(self, x): method get_parameters (line 85) | def get_parameters(self, lr=1.): function _pose_resnet (line 93) | def _pose_resnet(arch, num_keypoints, block, layers, pretrained_backbone... function pose_resnet101 (line 100) | def pose_resnet101(num_keypoints, pretrained_backbone=True, deconv_with_... FILE: domain_generalization/Transfer-Learning-Library/common/vision/models/reid/identifier.py class ReIdentifier (line 11) | class ReIdentifier(nn.Module): method __init__ (line 20) | def __init__(self, backbone: nn.Module, num_classes: int, bottleneck: ... method features_dim (line 54) | def features_dim(self) -> int: method forward (line 58) | def forward(self, x: torch.Tensor): method get_parameters (line 67) | def get_parameters(self, base_lr=1.0, rate=0.1) -> List[Dict]: FILE: domain_generalization/Transfer-Learning-Library/common/vision/models/reid/loss.py function pairwise_euclidean_distance (line 11) | def pairwise_euclidean_distance(x, y): function hard_examples_mining (line 22) | def hard_examples_mining(dist_mat, identity_mat, return_idxes=False): class CrossEntropyLossWithLabelSmooth (line 52) | class CrossEntropyLossWithLabelSmooth(nn.Module): method __init__ (line 77) | def __init__(self, num_classes, epsilon=0.1): method forward (line 83) | def forward(self, y, labels): class TripletLoss (line 91) | class TripletLoss(nn.Module): method __init__ (line 101) | def __init__(self, margin, normalize_feature=False): method forward (line 107) | def forward(self, f, labels): class TripletLossXBM (line 122) | class TripletLossXBM(nn.Module): method __init__ (line 145) | def __init__(self, margin=0.3, normalize_feature=False): method forward (line 151) | def forward(self, f, labels, xbm_f, xbm_labels): class SoftTripletLoss (line 171) | class SoftTripletLoss(nn.Module): method __init__ (line 196) | def __init__(self, margin=None, normalize_feature=False): method forward (line 201) | def forward(self, features_1, features_2, labels): class CrossEntropyLoss (line 231) | class CrossEntropyLoss(nn.Module): method __init__ (line 248) | def __init__(self): method forward (line 252) | def forward(self, y, labels): FILE: domain_generalization/Transfer-Learning-Library/common/vision/models/reid/resnet.py class ReidResNet (line 10) | class ReidResNet(ResNet): method __init__ (line 17) | def __init__(self, *args, **kwargs): method forward (line 22) | def forward(self, x): function _reid_resnet (line 36) | def _reid_resnet(arch, block, layers, pretrained, progress, **kwargs): function reid_resnet18 (line 48) | def reid_resnet18(pretrained=False, progress=True, **kwargs): function reid_resnet34 (line 59) | def reid_resnet34(pretrained=False, progress=True, **kwargs): function reid_resnet50 (line 70) | def reid_resnet50(pretrained=False, progress=True, **kwargs): function reid_resnet101 (line 81) | def reid_resnet101(pretrained=False, progress=True, **kwargs): FILE: domain_generalization/Transfer-Learning-Library/common/vision/models/resnet.py class ResNet (line 18) | class ResNet(models.ResNet): method __init__ (line 21) | def __init__(self, *args, **kwargs): method forward (line 25) | def forward(self, x): method out_features (line 43) | def out_features(self) -> int: method copy_head (line 47) | def copy_head(self) -> nn.Module: function _resnet (line 52) | def _resnet(arch, block, layers, pretrained, progress, **kwargs): function resnet18 (line 64) | def resnet18(pretrained=False, progress=True, **kwargs): function resnet34 (line 76) | def resnet34(pretrained=False, progress=True, **kwargs): function resnet50 (line 88) | def resnet50(pretrained=False, progress=True, **kwargs): function resnet101 (line 100) | def resnet101(pretrained=False, progress=True, **kwargs): function resnet152 (line 112) | def resnet152(pretrained=False, progress=True, **kwargs): function resnext50_32x4d (line 124) | def resnext50_32x4d(pretrained=False, progress=True, **kwargs): function resnext101_32x8d (line 138) | def resnext101_32x8d(pretrained=False, progress=True, **kwargs): function wide_resnet50_2 (line 152) | def wide_resnet50_2(pretrained=False, progress=True, **kwargs): function wide_resnet101_2 (line 170) | def wide_resnet101_2(pretrained=False, progress=True, **kwargs): FILE: domain_generalization/Transfer-Learning-Library/common/vision/models/segmentation/deeplabv2.py class Bottleneck (line 16) | class Bottleneck(nn.Module): method __init__ (line 19) | def __init__(self, inplanes, planes, stride=1, dilation=1, downsample=... method forward (line 43) | def forward(self, x): class ASPP_V2 (line 66) | class ASPP_V2(nn.Module): method __init__ (line 67) | def __init__(self, inplanes, dilation_series, padding_series, num_clas... method forward (line 77) | def forward(self, x): class ResNet (line 85) | class ResNet(nn.Module): method __init__ (line 86) | def __init__(self, block, layers): method _make_layer (line 109) | def _make_layer(self, block, planes, blocks, stride=1, dilation=1): method forward (line 125) | def forward(self, x): class Deeplab (line 137) | class Deeplab(nn.Module): method __init__ (line 138) | def __init__(self, backbone, classifier, num_classes): method forward (line 144) | def forward(self, x): method get_1x_lr_params_NOscale (line 149) | def get_1x_lr_params_NOscale(self): method get_10x_lr_params (line 164) | def get_10x_lr_params(self): method get_parameters (line 172) | def get_parameters(self, lr=1.): function deeplabv2_resnet101 (line 179) | def deeplabv2_resnet101(num_classes=19, pretrained_backbone=True): FILE: domain_generalization/Transfer-Learning-Library/common/vision/transforms/__init__.py class ResizeImage (line 9) | class ResizeImage(object): method __init__ (line 18) | def __init__(self, size): method __call__ (line 24) | def __call__(self, img): method __repr__ (line 28) | def __repr__(self): class MultipleApply (line 32) | class MultipleApply: method __init__ (line 51) | def __init__(self, transforms): method __call__ (line 54) | def __call__(self, image): method __repr__ (line 57) | def __repr__(self): class Denormalize (line 66) | class Denormalize(Normalize): method __init__ (line 82) | def __init__(self, mean, std): class NormalizeAndTranspose (line 88) | class NormalizeAndTranspose: method __init__ (line 94) | def __init__(self, mean=(104.00698793, 116.66876762, 122.67891434)): method __call__ (line 97) | def __call__(self, image): class DeNormalizeAndTranspose (line 116) | class DeNormalizeAndTranspose: method __init__ (line 122) | def __init__(self, mean=(104.00698793, 116.66876762, 122.67891434)): method __call__ (line 125) | def __call__(self, image): class RandomErasing (line 134) | class RandomErasing(object): method __init__ (line 147) | def __init__(self, probability=0.5, sl=0.02, sh=0.4, r1=0.3, mean=(0.4... method __call__ (line 154) | def __call__(self, img): method __repr__ (line 181) | def __repr__(self): FILE: domain_generalization/Transfer-Learning-Library/common/vision/transforms/keypoint_detection.py function wrapper (line 17) | def wrapper(transform: ClassVar): function resize (line 39) | def resize(image: Image.Image, size: int, interpolation=Image.BILINEAR, function crop (line 55) | def crop(image: Image.Image, top, left, height, width, keypoint2d: np.nd... function resized_crop (line 63) | def resized_crop(img, top, left, height, width, size, interpolation=Imag... function center_crop (line 87) | def center_crop(image, output_size, keypoint2d: np.ndarray): function hflip (line 105) | def hflip(image: Image.Image, keypoint2d: np.ndarray): function rotate (line 113) | def rotate(image: Image.Image, angle, keypoint2d: np.ndarray): function resize_pad (line 131) | def resize_pad(img, keypoint2d, size, interpolation=Image.BILINEAR): class Compose (line 158) | class Compose(object): method __init__ (line 165) | def __init__(self, transforms): method __call__ (line 168) | def __call__(self, image, **kwargs): class GaussianBlur (line 174) | class GaussianBlur(object): method __init__ (line 175) | def __init__(self, low=0, high=0.8): method __call__ (line 179) | def __call__(self, image: Image, **kwargs): class Resize (line 185) | class Resize(object): method __init__ (line 189) | def __init__(self, size, interpolation=Image.BILINEAR): method __call__ (line 194) | def __call__(self, image, keypoint2d: np.ndarray, intrinsic_matrix: np... class ResizePad (line 202) | class ResizePad(object): method __init__ (line 205) | def __init__(self, size, interpolation=Image.BILINEAR): method __call__ (line 209) | def __call__(self, img, keypoint2d, **kwargs): class CenterCrop (line 215) | class CenterCrop(object): method __init__ (line 219) | def __init__(self, size): method __call__ (line 225) | def __call__(self, image, keypoint2d, **kwargs): class RandomRotation (line 240) | class RandomRotation(object): method __init__ (line 249) | def __init__(self, degrees): method get_params (line 261) | def get_params(degrees): method __call__ (line 271) | def __call__(self, image, keypoint2d, **kwargs): class RandomResizedCrop (line 289) | class RandomResizedCrop(object): method __init__ (line 304) | def __init__(self, size, scale=(0.6, 1.3), interpolation=Image.BILINEAR): method get_params (line 313) | def get_params(img, scale): method __call__ (line 342) | def __call__(self, image, keypoint2d: np.ndarray, intrinsic_matrix: np... class RandomApply (line 358) | class RandomApply(T.RandomTransforms): method __init__ (line 366) | def __init__(self, transforms, p=0.5): method __call__ (line 370) | def __call__(self, image, **kwargs): FILE: domain_generalization/Transfer-Learning-Library/common/vision/transforms/segmentation.py function wrapper (line 17) | def wrapper(transform: ClassVar): class Compose (line 42) | class Compose: method __init__ (line 54) | def __init__(self, transforms): method __call__ (line 58) | def __call__(self, image, target): class Resize (line 64) | class Resize(nn.Module): method __init__ (line 75) | def __init__(self, image_size, label_size=None): method forward (line 83) | def forward(self, image, label): class RandomCrop (line 98) | class RandomCrop(nn.Module): method __init__ (line 105) | def __init__(self, size): method forward (line 109) | def forward(self, image, label): class RandomHorizontalFlip (line 132) | class RandomHorizontalFlip(nn.Module): method __init__ (line 139) | def __init__(self, p=0.5): method forward (line 143) | def forward(self, image, label): class RandomResizedCrop (line 157) | class RandomResizedCrop(T.RandomResizedCrop): method __init__ (line 174) | def __init__(self, size, scale=(0.5, 1.0), ratio=(3. / 4., 4. / 3.), i... method get_params (line 178) | def get_params( method forward (line 222) | def forward(self, image, label): class RandomChoice (line 239) | class RandomChoice(T.RandomTransforms): method __call__ (line 242) | def __call__(self, image, label): class RandomApply (line 247) | class RandomApply(T.RandomTransforms): method __init__ (line 255) | def __init__(self, transforms, p=0.5): method __call__ (line 259) | def __call__(self, image, label): FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/adda.py class DomainAdversarialLoss (line 12) | class DomainAdversarialLoss(nn.Module): method __init__ (line 31) | def __init__(self): method forward (line 34) | def forward(self, domain_pred, domain_label='source'): class ImageClassifier (line 42) | class ImageClassifier(ClassifierBase): method __init__ (line 43) | def __init__(self, backbone: nn.Module, num_classes: int, bottleneck_d... method freeze_bn (line 53) | def freeze_bn(self): method get_parameters (line 58) | def get_parameters(self, base_lr=1.0, optimize_head=True) -> List[Dict]: FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/advent.py class Discriminator (line 11) | class Discriminator(nn.Sequential): method __init__ (line 27) | def __init__(self, num_classes, ndf=64): function prob_2_entropy (line 41) | def prob_2_entropy(prob): function bce_loss (line 48) | def bce_loss(y_pred, y_label): class DomainAdversarialEntropyLoss (line 55) | class DomainAdversarialEntropyLoss(nn.Module): method __init__ (line 82) | def __init__(self, discriminator: nn.Module): method forward (line 86) | def forward(self, logits, domain_label='source'): method train (line 98) | def train(self, mode=True): method eval (line 110) | def eval(self): FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/afn.py class AdaptiveFeatureNorm (line 14) | class AdaptiveFeatureNorm(nn.Module): method __init__ (line 49) | def __init__(self, delta): method forward (line 53) | def forward(self, f: torch.Tensor) -> torch.Tensor: class Block (line 61) | class Block(nn.Module): method __init__ (line 82) | def __init__(self, in_features: int, bottleneck_dim: Optional[int] = 1... method forward (line 90) | def forward(self, x: torch.Tensor) -> torch.Tensor: class ImageClassifier (line 100) | class ImageClassifier(ClassfierBase): method __init__ (line 112) | def __init__(self, backbone: nn.Module, num_classes: int, num_blocks: ... method get_parameters (line 135) | def get_parameters(self, base_lr=1.0) -> List[Dict]: FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/bsp.py class BatchSpectralPenalizationLoss (line 11) | class BatchSpectralPenalizationLoss(nn.Module): method __init__ (line 43) | def __init__(self): method forward (line 46) | def forward(self, f_s, f_t): class ImageClassifier (line 53) | class ImageClassifier(ClassifierBase): method __init__ (line 54) | def __init__(self, backbone: nn.Module, num_classes: int, bottleneck_d... FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/cdan.py class ConditionalDomainAdversarialLoss (line 20) | class ConditionalDomainAdversarialLoss(nn.Module): method __init__ (line 80) | def __init__(self, domain_discriminator: nn.Module, entropy_conditioni... method forward (line 100) | def forward(self, g_s: torch.Tensor, f_s: torch.Tensor, g_t: torch.Ten... class RandomizedMultiLinearMap (line 117) | class RandomizedMultiLinearMap(nn.Module): method __init__ (line 139) | def __init__(self, features_dim: int, num_classes: int, output_dim: Op... method forward (line 145) | def forward(self, f: torch.Tensor, g: torch.Tensor) -> torch.Tensor: class MultiLinearMap (line 152) | class MultiLinearMap(nn.Module): method __init__ (line 161) | def __init__(self): method forward (line 164) | def forward(self, f: torch.Tensor, g: torch.Tensor) -> torch.Tensor: class ImageClassifier (line 170) | class ImageClassifier(ClassifierBase): method __init__ (line 171) | def __init__(self, backbone: nn.Module, num_classes: int, bottleneck_d... FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/dan.py class MultipleKernelMaximumMeanDiscrepancy (line 15) | class MultipleKernelMaximumMeanDiscrepancy(nn.Module): method __init__ (line 72) | def __init__(self, kernels: Sequence[nn.Module], linear: Optional[bool... method forward (line 78) | def forward(self, z_s: torch.Tensor, z_t: torch.Tensor) -> torch.Tensor: function _update_index_matrix (line 92) | def _update_index_matrix(batch_size: int, index_matrix: Optional[torch.T... class ImageClassifier (line 122) | class ImageClassifier(ClassifierBase): method __init__ (line 123) | def __init__(self, backbone: nn.Module, num_classes: int, bottleneck_d... FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/dann.py class DomainAdversarialLoss (line 17) | class DomainAdversarialLoss(nn.Module): method __init__ (line 59) | def __init__(self, domain_discriminator: nn.Module, reduction: Optiona... method forward (line 68) | def forward(self, f_s: torch.Tensor, f_t: torch.Tensor, class ImageClassifier (line 84) | class ImageClassifier(ClassifierBase): method __init__ (line 85) | def __init__(self, backbone: nn.Module, num_classes: int, bottleneck_d... FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/fda.py function robust_entropy (line 9) | def robust_entropy(y, ita=1.5, num_classes=19, reduction='mean'): FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/idm/loss.py class DivLoss (line 10) | class DivLoss(nn.Module): method __init__ (line 13) | def __init__(self, ): method forward (line 16) | def forward(self, lam): class BridgeFeatLoss (line 23) | class BridgeFeatLoss(nn.Module): method __init__ (line 26) | def __init__(self): method forward (line 29) | def forward(self, f_s, f_t, f_mixed, lam): class BridgeProbLoss (line 43) | class BridgeProbLoss(nn.Module): method __init__ (line 46) | def __init__(self, num_classes, epsilon=0.1): method forward (line 52) | def forward(self, y, labels, lam, device_num=4): FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/idm/models/dsbn.py class DSBN2d (line 10) | class DSBN2d(nn.Module): method __init__ (line 14) | def __init__(self, planes): method forward (line 20) | def forward(self, x): class DSBN1d (line 33) | class DSBN1d(nn.Module): method __init__ (line 37) | def __init__(self, planes): method forward (line 43) | def forward(self, x): class DSBN2d_idm (line 56) | class DSBN2d_idm(nn.Module): method __init__ (line 61) | def __init__(self, planes): method forward (line 68) | def forward(self, x): class DSBN1d_idm (line 82) | class DSBN1d_idm(nn.Module): method __init__ (line 87) | def __init__(self, planes): method forward (line 94) | def forward(self, x): FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/idm/models/identifier.py class ReIdentifier (line 9) | class ReIdentifier(ReIdentifierBase): method __init__ (line 14) | def __init__(self, *args, **kwargs): method forward (line 17) | def forward(self, x, stage=0): FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/idm/models/idm.py class IDM (line 10) | class IDM(nn.Module): method __init__ (line 15) | def __init__(self, channel=64): method forward (line 25) | def forward(self, x): FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/idm/models/resnet.py class ReidResNet (line 17) | class ReidResNet(ResNetBase): method __init__ (line 23) | def __init__(self, *args, **kwargs): method forward (line 40) | def forward(self, x, stage=0): function _reid_resnet (line 65) | def _reid_resnet(arch, block, layers, pretrained, progress, **kwargs): function reid_resnet18 (line 77) | def reid_resnet18(pretrained=False, progress=True, **kwargs): function reid_resnet34 (line 88) | def reid_resnet34(pretrained=False, progress=True, **kwargs): function reid_resnet50 (line 99) | def reid_resnet50(pretrained=False, progress=True, **kwargs): function reid_resnet101 (line 110) | def reid_resnet101(pretrained=False, progress=True, **kwargs): FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/idm/utils.py function filter_layers (line 10) | def filter_layers(stage): function convert_dsbn_idm (line 19) | def convert_dsbn_idm(model, mixup_bn_names, idm=False): function convert_bn_idm (line 52) | def convert_bn_idm(model, use_target=True): FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/idm/xbm.py class XBM (line 9) | class XBM(object): method __init__ (line 12) | def __init__(self, memory_size, feature_size): method is_full (line 20) | def is_full(self): method get (line 23) | def get(self): method enqueue_dequeue (line 29) | def enqueue_dequeue(self, feats, targets): method clean_target_domain (line 40) | def clean_target_domain(self, source_classes, target_classes): FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/iwan.py class ImportanceWeightModule (line 12) | class ImportanceWeightModule(object): method __init__ (line 36) | def __init__(self, discriminator: nn.Module, partial_classes_index: Op... method get_importance_weight (line 40) | def get_importance_weight(self, feature): method get_partial_classes_weight (line 55) | def get_partial_classes_weight(self, weights: torch.Tensor, labels: to... class ImageClassifier (line 84) | class ImageClassifier(ClassifierBase): method __init__ (line 88) | def __init__(self, backbone: nn.Module, num_classes: int, bottleneck_d... FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/jan.py class JointMultipleKernelMaximumMeanDiscrepancy (line 19) | class JointMultipleKernelMaximumMeanDiscrepancy(nn.Module): method __init__ (line 69) | def __init__(self, kernels: Sequence[Sequence[nn.Module]], linear: Opt... method forward (line 79) | def forward(self, z_s: torch.Tensor, z_t: torch.Tensor) -> torch.Tensor: class Theta (line 96) | class Theta(nn.Module): method __init__ (line 101) | def __init__(self, dim: int): method forward (line 109) | def forward(self, features: torch.Tensor) -> torch.Tensor: class ImageClassifier (line 114) | class ImageClassifier(ClassifierBase): method __init__ (line 115) | def __init__(self, backbone: nn.Module, num_classes: int, bottleneck_d... FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/mcc.py class MinimumClassConfusionLoss (line 17) | class MinimumClassConfusionLoss(nn.Module): method __init__ (line 61) | def __init__(self, temperature: float): method forward (line 65) | def forward(self, logits: torch.Tensor) -> torch.Tensor: class ImageClassifier (line 77) | class ImageClassifier(ClassifierBase): method __init__ (line 78) | def __init__(self, backbone: nn.Module, num_classes: int, bottleneck_d... FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/mcd.py function classifier_discrepancy (line 10) | def classifier_discrepancy(predictions1: torch.Tensor, predictions2: tor... function entropy (line 28) | def entropy(predictions: torch.Tensor) -> torch.Tensor: class ImageClassifierHead (line 46) | class ImageClassifierHead(nn.Module): method __init__ (line 59) | def __init__(self, in_features: int, num_classes: int, bottleneck_dim:... method forward (line 81) | def forward(self, inputs: torch.Tensor) -> torch.Tensor: FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/mdd.py class MarginDisparityDiscrepancy (line 13) | class MarginDisparityDiscrepancy(nn.Module): method __init__ (line 60) | def __init__(self, source_disparity: Callable, target_disparity: Calla... method forward (line 68) | def forward(self, y_s: torch.Tensor, y_s_adv: torch.Tensor, y_t: torch... class ClassificationMarginDisparityDiscrepancy (line 88) | class ClassificationMarginDisparityDiscrepancy(MarginDisparityDiscrepancy): method __init__ (line 142) | def __init__(self, margin: Optional[float] = 4, **kwargs): class RegressionMarginDisparityDiscrepancy (line 155) | class RegressionMarginDisparityDiscrepancy(MarginDisparityDiscrepancy): method __init__ (line 209) | def __init__(self, margin: Optional[float] = 1, loss_function=F.l1_los... function shift_log (line 220) | def shift_log(x: torch.Tensor, offset: Optional[float] = 1e-6) -> torch.... class GeneralModule (line 239) | class GeneralModule(nn.Module): method __init__ (line 240) | def __init__(self, backbone: nn.Module, num_classes: int, bottleneck: ... method forward (line 253) | def forward(self, x: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]: method step (line 265) | def step(self): method get_parameters (line 271) | def get_parameters(self, base_lr=1.0) -> List[Dict]: class ImageClassifier (line 285) | class ImageClassifier(GeneralModule): method __init__ (line 321) | def __init__(self, backbone: nn.Module, num_classes: int, class ImageRegressor (line 365) | class ImageRegressor(GeneralModule): method __init__ (line 400) | def __init__(self, backbone: nn.Module, num_factors: int, bottleneck =... FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/osbp.py class UnknownClassBinaryCrossEntropy (line 14) | class UnknownClassBinaryCrossEntropy(nn.Module): method __init__ (line 38) | def __init__(self, t: Optional[float]=0.5): method forward (line 42) | def forward(self, y): class ImageClassifier (line 54) | class ImageClassifier(ClassifierBase): method __init__ (line 55) | def __init__(self, backbone: nn.Module, num_classes: int, bottleneck_d... method forward (line 71) | def forward(self, x: torch.Tensor, grad_reverse: Optional[bool] = False): FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/pada.py class AutomaticUpdateClassWeightModule (line 13) | class AutomaticUpdateClassWeightModule(object): method __init__ (line 41) | def __init__(self, update_steps: int, data_loader: DataLoader, method step (line 56) | def step(self): method get_class_weight_for_cross_entropy_loss (line 62) | def get_class_weight_for_cross_entropy_loss(self): method get_class_weight_for_adversarial_loss (line 70) | def get_class_weight_for_adversarial_loss(self, source_labels: torch.T... method get_partial_classes_weight (line 84) | def get_partial_classes_weight(self): class ClassWeightModule (line 98) | class ClassWeightModule(nn.Module): method __init__ (line 124) | def __init__(self, temperature: Optional[float] = 0.1): method forward (line 128) | def forward(self, outputs: torch.Tensor): function collect_classification_results (line 137) | def collect_classification_results(data_loader: DataLoader, classifier: ... FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/regda.py class FastPseudoLabelGenerator2d (line 15) | class FastPseudoLabelGenerator2d(nn.Module): method __init__ (line 16) | def __init__(self, sigma=2): method forward (line 20) | def forward(self, heatmap: torch.Tensor): class PseudoLabelGenerator2d (line 34) | class PseudoLabelGenerator2d(nn.Module): method __init__ (line 57) | def __init__(self, num_keypoints, height=64, width=64, sigma=2): method forward (line 93) | def forward(self, y): class RegressionDisparity (line 105) | class RegressionDisparity(nn.Module): method __init__ (line 145) | def __init__(self, pseudo_label_generator: PseudoLabelGenerator2d, cri... method forward (line 150) | def forward(self, y, y_adv, weight=None, mode='min'): class PoseResNet2d (line 161) | class PoseResNet2d(nn.Module): method __init__ (line 192) | def __init__(self, backbone, upsampling, feature_dim, num_keypoints, method _make_head (line 203) | def _make_head(num_layers, channel_dim, num_keypoints): method forward (line 227) | def forward(self, x): method get_parameters (line 239) | def get_parameters(self, lr=1.): method step (line 247) | def step(self): FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/rsd.py class RepresentationSubspaceDistance (line 9) | class RepresentationSubspaceDistance(nn.Module): method __init__ (line 22) | def __init__(self, trade_off=0.1): method forward (line 26) | def forward(self, f_s, f_t): FILE: domain_generalization/Transfer-Learning-Library/dalib/adaptation/self_ensemble.py class ConsistencyLoss (line 15) | class ConsistencyLoss(nn.Module): method __init__ (line 41) | def __init__(self, distance_measure: Callable, reduction: Optional[str... method forward (line 46) | def forward(self, y: torch.Tensor, y_teacher: torch.Tensor, mask: torc... class L2ConsistencyLoss (line 55) | class L2ConsistencyLoss(ConsistencyLoss): method __init__ (line 65) | def __init__(self, reduction: Optional[str] = 'mean'): class ClassBalanceLoss (line 72) | class ClassBalanceLoss(nn.Module): method __init__ (line 97) | def __init__(self, num_classes): method forward (line 101) | def forward(self, y: torch.Tensor): class EmaTeacher (line 105) | class EmaTeacher(object): method __init__ (line 137) | def __init__(self, model, alpha): method set_alpha (line 143) | def set_alpha(self, alpha: float): method update (line 147) | def update(self): method __call__ (line 151) | def __call__(self, x: torch.Tensor): method train (line 154) | def train(self, mode: Optional[bool] = True): method eval (line 157) | def eval(self): method state_dict (line 160) | def state_dict(self): method load_state_dict (line 163) | def load_state_dict(self, state_dict): method module (line 167) | def module(self): class ImageClassifier (line 171) | class ImageClassifier(ClassifierBase): method __init__ (line 172) | def __init__(self, backbone: nn.Module, num_classes: int, bottleneck_d... FILE: domain_generalization/Transfer-Learning-Library/dalib/modules/domain_discriminator.py class DomainDiscriminator (line 11) | class DomainDiscriminator(nn.Sequential): method __init__ (line 29) | def __init__(self, in_feature: int, hidden_size: int, batch_norm=True): method get_parameters (line 53) | def get_parameters(self) -> List[Dict]: FILE: domain_generalization/Transfer-Learning-Library/dalib/modules/entropy.py function entropy (line 8) | def entropy(predictions: torch.Tensor, reduction='none') -> torch.Tensor: FILE: domain_generalization/Transfer-Learning-Library/dalib/modules/gl.py class GradientFunction (line 12) | class GradientFunction(Function): method forward (line 15) | def forward(ctx: Any, input: torch.Tensor, coeff: Optional[float] = 1.... method backward (line 21) | def backward(ctx: Any, grad_output: torch.Tensor) -> Tuple[torch.Tenso... class WarmStartGradientLayer (line 25) | class WarmStartGradientLayer(nn.Module): method __init__ (line 51) | def __init__(self, alpha: Optional[float] = 1.0, lo: Optional[float] =... method forward (line 61) | def forward(self, input: torch.Tensor) -> torch.Tensor: method step (line 71) | def step(self): FILE: domain_generalization/Transfer-Learning-Library/dalib/modules/grl.py class GradientReverseFunction (line 12) | class GradientReverseFunction(Function): method forward (line 15) | def forward(ctx: Any, input: torch.Tensor, coeff: Optional[float] = 1.... method backward (line 21) | def backward(ctx: Any, grad_output: torch.Tensor) -> Tuple[torch.Tenso... class GradientReverseLayer (line 25) | class GradientReverseLayer(nn.Module): method __init__ (line 26) | def __init__(self): method forward (line 29) | def forward(self, *input): class WarmStartGradientReverseLayer (line 33) | class WarmStartGradientReverseLayer(nn.Module): method __init__ (line 59) | def __init__(self, alpha: Optional[float] = 1.0, lo: Optional[float] =... method forward (line 69) | def forward(self, input: torch.Tensor) -> torch.Tensor: method step (line 79) | def step(self): FILE: domain_generalization/Transfer-Learning-Library/dalib/modules/kernels.py class GaussianKernel (line 13) | class GaussianKernel(nn.Module): method __init__ (line 48) | def __init__(self, sigma: Optional[float] = None, track_running_stats:... method forward (line 56) | def forward(self, X: torch.Tensor) -> torch.Tensor: FILE: domain_generalization/Transfer-Learning-Library/dalib/translation/cycada.py class SemanticConsistency (line 9) | class SemanticConsistency(nn.Module): method __init__ (line 49) | def __init__(self, ignore_index=(), reduction='mean'): method forward (line 54) | def forward(self, input: Tensor, target: Tensor) -> Tensor: FILE: domain_generalization/Transfer-Learning-Library/dalib/translation/cyclegan/discriminator.py class NLayerDiscriminator (line 12) | class NLayerDiscriminator(nn.Module): method __init__ (line 22) | def __init__(self, input_nc, ndf=64, n_layers=3, norm_layer=nn.BatchNo... method forward (line 54) | def forward(self, input): class PixelDiscriminator (line 58) | class PixelDiscriminator(nn.Module): method __init__ (line 67) | def __init__(self, input_nc, ndf=64, norm_layer=nn.BatchNorm2d): method forward (line 84) | def forward(self, input): function patch (line 88) | def patch(ndf, input_nc=3, norm='batch', n_layers=3, init_type='normal',... function pixel (line 111) | def pixel(ndf, input_nc=3, norm='batch', init_type='normal', init_gain=0... FILE: domain_generalization/Transfer-Learning-Library/dalib/translation/cyclegan/generator.py class ResnetBlock (line 12) | class ResnetBlock(nn.Module): method __init__ (line 15) | def __init__(self, dim, padding_type, norm_layer, use_dropout, use_bias): method build_conv_block (line 26) | def build_conv_block(self, dim, padding_type, norm_layer, use_dropout,... method forward (line 66) | def forward(self, x): class ResnetGenerator (line 72) | class ResnetGenerator(nn.Module): method __init__ (line 79) | def __init__(self, input_nc, output_nc, ngf=64, norm_layer=nn.BatchNor... method forward (line 129) | def forward(self, input): class UnetGenerator (line 134) | class UnetGenerator(nn.Module): method __init__ (line 137) | def __init__(self, input_nc, output_nc, num_downs, ngf=64, norm_layer=... method forward (line 161) | def forward(self, input): class UnetSkipConnectionBlock (line 166) | class UnetSkipConnectionBlock(nn.Module): method __init__ (line 172) | def __init__(self, outer_nc, inner_nc, input_nc=None, method forward (line 229) | def forward(self, x): function resnet_9 (line 236) | def resnet_9(ngf, input_nc=3, output_nc=3, norm='batch', use_dropout=False, function resnet_6 (line 257) | def resnet_6(ngf, input_nc=3, output_nc=3, norm='batch', use_dropout=False, function unet_256 (line 278) | def unet_256(ngf, input_nc=3, output_nc=3, norm='batch', use_dropout=False, function unet_128 (line 301) | def unet_128(ngf, input_nc=3, output_nc=3, norm='batch', use_dropout=False, function unet_32 (line 324) | def unet_32(ngf, input_nc=3, output_nc=3, norm='batch', use_dropout=False, FILE: domain_generalization/Transfer-Learning-Library/dalib/translation/cyclegan/loss.py class LeastSquaresGenerativeAdversarialLoss (line 10) | class LeastSquaresGenerativeAdversarialLoss(nn.Module): method __init__ (line 28) | def __init__(self, reduction='mean'): method forward (line 32) | def forward(self, prediction, real=True): class VanillaGenerativeAdversarialLoss (line 40) | class VanillaGenerativeAdversarialLoss(nn.Module): method __init__ (line 58) | def __init__(self, reduction='mean'): method forward (line 62) | def forward(self, prediction, real=True): class WassersteinGenerativeAdversarialLoss (line 70) | class WassersteinGenerativeAdversarialLoss(nn.Module): method __init__ (line 88) | def __init__(self, reduction='mean'): method forward (line 92) | def forward(self, prediction, real=True): FILE: domain_generalization/Transfer-Learning-Library/dalib/translation/cyclegan/transform.py class Translation (line 12) | class Translation(nn.Module): method __init__ (line 28) | def __init__(self, generator, device=torch.device("cpu"), mean=(0.5, 0... method forward (line 41) | def forward(self, image): FILE: domain_generalization/Transfer-Learning-Library/dalib/translation/cyclegan/util.py class Identity (line 12) | class Identity(nn.Module): method forward (line 13) | def forward(self, x): function get_norm_layer (line 17) | def get_norm_layer(norm_type='instance'): function init_weights (line 37) | def init_weights(net, init_type='normal', init_gain=0.02): class ImagePool (line 72) | class ImagePool: method __init__ (line 83) | def __init__(self, pool_size): method query (line 89) | def query(self, images): function set_requires_grad (line 123) | def set_requires_grad(net, requires_grad=False): FILE: domain_generalization/Transfer-Learning-Library/dalib/translation/fourier_transform.py function low_freq_mutate (line 14) | def low_freq_mutate(amp_src: np.ndarray, amp_trg: np.ndarray, beta: Opti... class FourierTransform (line 47) | class FourierTransform(nn.Module): method __init__ (line 116) | def __init__(self, image_list: Sequence[str], amplitude_dir: str, method build_amplitude (line 127) | def build_amplitude(image_list, amplitude_dir): method forward (line 137) | def forward(self, image): FILE: domain_generalization/Transfer-Learning-Library/dalib/translation/spgan/loss.py class ContrastiveLoss (line 10) | class ContrastiveLoss(torch.nn.Module): method __init__ (line 33) | def __init__(self, margin=2.0): method forward (line 37) | def forward(self, output1, output2, label): FILE: domain_generalization/Transfer-Learning-Library/dalib/translation/spgan/siamese.py class ConvBlock (line 10) | class ConvBlock(nn.Module): method __init__ (line 12) | def __init__(self, in_dim, out_dim): method forward (line 20) | def forward(self, x): class SiameseNetwork (line 24) | class SiameseNetwork(nn.Module): method __init__ (line 30) | def __init__(self, nsf=64): method forward (line 45) | def forward(self, x): FILE: domain_generalization/Transfer-Learning-Library/dglib/generalization/coral.py class CorrelationAlignmentLoss (line 9) | class CorrelationAlignmentLoss(nn.Module): method __init__ (line 37) | def __init__(self): method forward (line 40) | def forward(self, f_s: torch.Tensor, f_t: torch.Tensor) -> torch.Tensor: FILE: domain_generalization/Transfer-Learning-Library/dglib/generalization/groupdro.py class AutomaticUpdateDomainWeightModule (line 9) | class AutomaticUpdateDomainWeightModule(object): method __init__ (line 34) | def __init__(self, num_domains: int, eta: float, device): method get_domain_weight (line 38) | def get_domain_weight(self, sampled_domain_idxes): method update (line 52) | def update(self, sampled_domain_losses: torch.Tensor, sampled_domain_i... FILE: domain_generalization/Transfer-Learning-Library/dglib/generalization/irm.py class InvariancePenaltyLoss (line 12) | class InvariancePenaltyLoss(nn.Module): method __init__ (line 28) | def __init__(self): method forward (line 32) | def forward(self, y: torch.Tensor, labels: torch.Tensor) -> torch.Tensor: FILE: domain_generalization/Transfer-Learning-Library/dglib/generalization/mixstyle/models/mixstyle.py class MixStyle (line 11) | class MixStyle(nn.Module): method __init__ (line 34) | def __init__(self, p=0.5, alpha=0.1, eps=1e-6): method forward (line 41) | def forward(self, x): FILE: domain_generalization/Transfer-Learning-Library/dglib/generalization/mixstyle/models/resnet.py function _resnet_with_mix_style (line 12) | def _resnet_with_mix_style(arch, block, layers, pretrained, progress, mi... function resnet18 (line 79) | def resnet18(pretrained=False, progress=True, **kwargs): function resnet34 (line 90) | def resnet34(pretrained=False, progress=True, **kwargs): function resnet50 (line 101) | def resnet50(pretrained=False, progress=True, **kwargs): function resnet101 (line 112) | def resnet101(pretrained=False, progress=True, **kwargs): FILE: domain_generalization/Transfer-Learning-Library/dglib/generalization/mixstyle/sampler.py class RandomDomainMultiInstanceSampler (line 11) | class RandomDomainMultiInstanceSampler(Sampler): method __init__ (line 22) | def __init__(self, dataset, batch_size, n_domains_per_batch, num_insta... method __iter__ (line 42) | def __iter__(self): method sample_multi_instances (line 64) | def sample_multi_instances(self, sample_idxes): method __len__ (line 82) | def __len__(self): FILE: domain_generalization/Transfer-Learning-Library/dglib/modules/classifier.py class ImageClassifier (line 11) | class ImageClassifier(ClassifierBase): method __init__ (line 23) | def __init__(self, backbone: nn.Module, num_classes: int, freeze_bn: O... method forward (line 30) | def forward(self, x: torch.Tensor) -> Tuple[torch.Tensor, torch.Tensor]: method train (line 41) | def train(self, mode=True): FILE: domain_generalization/Transfer-Learning-Library/dglib/modules/sampler.py class DefaultSampler (line 12) | class DefaultSampler(Sampler): method __init__ (line 21) | def __init__(self, data_source: ConcatDataset, batch_size: int): method __iter__ (line 36) | def __iter__(self): method __len__ (line 55) | def __len__(self): class RandomDomainSampler (line 59) | class RandomDomainSampler(Sampler): method __init__ (line 69) | def __init__(self, data_source: ConcatDataset, batch_size: int, n_doma... method __iter__ (line 86) | def __iter__(self): method __len__ (line 112) | def __len__(self): FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/image_classification/adda.py function main (line 42) | def main(args: argparse.Namespace): function train (line 152) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/image_classification/addagrl.py function main (line 39) | def main(args: argparse.Namespace): function train (line 179) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/image_classification/afn.py function main (line 35) | def main(args: argparse.Namespace): function train (line 135) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/image_classification/bsp.py function main (line 37) | def main(args: argparse.Namespace): function train (line 169) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/image_classification/cdan.py function main (line 36) | def main(args: argparse.Namespace): function train (line 150) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/image_classification/dan.py class TransformerDecorator (line 35) | class TransformerDecorator(torch.nn.Module): method __init__ (line 36) | def __init__(self, backbone=None, add_bt=3, dim=2048, eval_global=0): method forward_feats (line 43) | def forward_feats(self, feature): method forward (line 55) | def forward(self, feature): function main (line 60) | def main(args: argparse.Namespace): function train (line 170) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/image_classification/dann.py class TransformerDecorator (line 35) | class TransformerDecorator(torch.nn.Module): method __init__ (line 36) | def __init__(self, backbone=None, add_bt=3, dim=2048, eval_global=0): method forward_feats (line 43) | def forward_feats(self, feature): method forward (line 55) | def forward(self, feature): function main (line 60) | def main(args: argparse.Namespace): function train (line 170) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/image_classification/jan.py function main (line 36) | def main(args: argparse.Namespace): function train (line 152) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/image_classification/mcc.py class TransformerDecorator (line 34) | class TransformerDecorator(torch.nn.Module): method __init__ (line 35) | def __init__(self, backbone=None, add_bt=3, dim=2048, eval_global=0): method forward_feats (line 42) | def forward_feats(self, feature): method forward (line 54) | def forward(self, feature): function main (line 59) | def main(args: argparse.Namespace): function train (line 167) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/image_classification/mcd.py function main (line 36) | def main(args: argparse.Namespace): function train (line 150) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... function validate (line 247) | def validate(val_loader: DataLoader, G: nn.Module, F1: ImageClassifierHead, FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/image_classification/mdd.py class TransformerDecorator (line 35) | class TransformerDecorator(torch.nn.Module): method __init__ (line 36) | def __init__(self, backbone=None, add_bt=3, dim=2048, eval_global=0): method forward_feats (line 43) | def forward_feats(self, feature): method forward (line 55) | def forward(self, feature): function main (line 60) | def main(args: argparse.Namespace): function train (line 167) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/image_classification/self_ensemble.py function main (line 37) | def main(args: argparse.Namespace): function train (line 175) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/image_classification/source_only.py class TransformerDecorator (line 34) | class TransformerDecorator(torch.nn.Module): method __init__ (line 35) | def __init__(self, backbone=None, add_bt=3, dim=2048, eval_global=0): method forward_feats (line 42) | def forward_feats(self, feature): method forward (line 54) | def forward(self, feature): function main (line 59) | def main(args: argparse.Namespace): FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/image_classification/utils.py function get_model_names (line 24) | def get_model_names(): function get_model (line 32) | def get_model(model_name, pretrain=True): function convert_from_wilds_dataset (line 48) | def convert_from_wilds_dataset(wild_dataset): function get_dataset_names (line 63) | def get_dataset_names(): function get_dataset (line 70) | def get_dataset(dataset_name, root, source, target, train_source_transfo... function validate (line 109) | def validate(val_loader, model, args, device) -> float: function get_train_transform (line 156) | def get_train_transform(resizing='default', random_horizontal_flip=True,... function get_val_transform (line 195) | def get_val_transform(resizing='default', resize_size=224, function pretrain (line 218) | def pretrain(train_source_iter, model, optimizer, lr_scheduler, epoch, a... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/image_regression/dann.py function main (line 39) | def main(args: argparse.Namespace): function train (line 156) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/image_regression/dd.py function main (line 37) | def main(args: argparse.Namespace): function train (line 189) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/image_regression/rsd.py function main (line 38) | def main(args: argparse.Namespace): function train (line 154) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/image_regression/source_only.py function main (line 37) | def main(args: argparse.Namespace): function train (line 143) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/image_regression/utils.py function convert_model (line 16) | def convert_model(module): function validate (line 31) | def validate(val_loader, model, args, factors, device): FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/keypoint_detection/regda.py function main (line 36) | def main(args: argparse.Namespace): function pretrain (line 227) | def pretrain(train_source_iter, model, criterion, optimizer, function train (line 277) | def train(train_source_iter, train_target_iter, model, criterion,regress... function validate (line 379) | def validate(val_loader, model, criterion, visualize, args: argparse.Nam... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/keypoint_detection/regda_fast.py function main (line 36) | def main(args: argparse.Namespace): function pretrain (line 227) | def pretrain(train_source_iter, model, criterion, optimizer, function train (line 277) | def train(train_source_iter, train_target_iter, model, criterion,regress... function validate (line 379) | def validate(val_loader, model, criterion, visualize, args: argparse.Nam... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/keypoint_detection/source_only.py function main (line 34) | def main(args: argparse.Namespace): function train (line 169) | def train(train_source_iter, train_target_iter, model, criterion, function validate (line 222) | def validate(val_loader, model, criterion, visualize, args: argparse.Nam... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/openset_domain_adaptation/dann.py function main (line 37) | def main(args: argparse.Namespace): function train (line 133) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... function validate (line 197) | def validate(val_loader: DataLoader, model: Classifier, args: argparse.N... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/openset_domain_adaptation/osbp.py function main (line 35) | def main(args: argparse.Namespace): function train (line 128) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... function validate (line 188) | def validate(val_loader: DataLoader, model: Classifier, args: argparse.N... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/openset_domain_adaptation/source_only.py function main (line 35) | def main(args: argparse.Namespace): function train (line 125) | def train(train_source_iter: ForeverDataIterator, model: Classifier, opt... function validate (line 174) | def validate(val_loader: DataLoader, model: Classifier, args: argparse.N... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/openset_domain_adaptation/utils.py function get_model_names (line 18) | def get_model_names(): function get_model (line 26) | def get_model(model_name): function get_dataset_names (line 44) | def get_dataset_names(): function get_dataset (line 51) | def get_dataset(dataset_name, root, source, target, train_source_transfo... function get_train_transform (line 71) | def get_train_transform(resizing='default', random_horizontal_flip=True,... function get_val_transform (line 132) | def get_val_transform(resizing='default'): FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/partial_domain_adaptation/afn.py function main (line 36) | def main(args: argparse.Namespace): function train (line 134) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/partial_domain_adaptation/dann.py function main (line 37) | def main(args: argparse.Namespace): function train (line 142) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/partial_domain_adaptation/iwan.py function main (line 39) | def main(args: argparse.Namespace): function train (line 149) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/partial_domain_adaptation/pada.py function main (line 38) | def main(args: argparse.Namespace): function train (line 144) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/partial_domain_adaptation/source_only.py function main (line 35) | def main(args: argparse.Namespace): function train (line 130) | def train(train_source_iter: ForeverDataIterator, model: Classifier, opt... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/partial_domain_adaptation/utils.py function get_model_names (line 18) | def get_model_names(): function get_model (line 26) | def get_model(model_name): function get_dataset_names (line 44) | def get_dataset_names(): function get_dataset (line 51) | def get_dataset(dataset_name, root, source, target, train_source_transfo... function validate (line 70) | def validate(val_loader, model, args, device) -> float: function get_train_transform (line 117) | def get_train_transform(resizing='default', random_horizontal_flip=True,... function get_val_transform (line 173) | def get_val_transform(resizing='default'): FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/re_identification/baseline.py function main (line 39) | def main(args: argparse.Namespace): function train (line 177) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/re_identification/baseline_cluster.py function main (line 40) | def main(args: argparse.Namespace): function run_kmeans (line 172) | def run_kmeans(cluster_loader: DataLoader, model: DataParallel, target_d... function run_dbscan (line 203) | def run_dbscan(cluster_loader: DataLoader, model: DataParallel, target_d... function train (line 247) | def train(train_target_iter: ForeverDataIterator, model, optimizer, crit... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/re_identification/idm.py function main (line 41) | def main(args: argparse.Namespace): function run_dbscan (line 201) | def run_dbscan(cluster_loader: DataLoader, model: DataParallel, target_d... function train (line 244) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/re_identification/mmt.py function main (line 41) | def main(args: argparse.Namespace): function create_model (line 183) | def create_model(args: argparse.Namespace, pretrained_model_path: str): function run_kmeans (line 199) | def run_kmeans(cluster_loader: DataLoader, model_1: DataParallel, model_... function run_dbscan (line 241) | def run_dbscan(cluster_loader: DataLoader, model_1: DataParallel, model_... function train (line 301) | def train(train_target_iter: ForeverDataIterator, model_1: DataParallel,... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/re_identification/spgan.py function main (line 36) | def main(args): function train (line 192) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/re_identification/utils.py function copy_state_dict (line 20) | def copy_state_dict(model, state_dict, strip=None): function get_model_names (line 46) | def get_model_names(): function get_model (line 54) | def get_model(model_name): function get_train_transform (line 70) | def get_train_transform(height, width, resizing='default', random_horizo... function get_val_transform (line 104) | def get_val_transform(height, width): function visualize_tsne (line 112) | def visualize_tsne(source_loader, target_loader, model, filename, device... function k_reciprocal_neigh (line 130) | def k_reciprocal_neigh(initial_rank, i, k1): function compute_rerank_dist (line 140) | def compute_rerank_dist(target_features, k1=30, k2=6): FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/semantic_segmentation/advent.py function main (line 36) | def main(args: argparse.Namespace): function train (line 184) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... function validate (line 276) | def validate(val_loader: DataLoader, model, interp, criterion, visualize... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/semantic_segmentation/cycada.py function main (line 36) | def main(args): function train (line 198) | def train(train_source_iter, train_target_iter, netG_S2T, netG_T2S, netD... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/semantic_segmentation/cycle_gan.py function main (line 34) | def main(args): function train (line 168) | def train(train_source_iter, train_target_iter, netG_S2T, netG_T2S, netD... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/semantic_segmentation/fda.py function main (line 38) | def main(args: argparse.Namespace): function train (line 182) | def train(train_source_iter: ForeverDataIterator, train_target_iter: For... function validate (line 263) | def validate(val_loader: DataLoader, model, interp, criterion, visualize... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_adaptation/semantic_segmentation/source_only.py function main (line 34) | def main(args: argparse.Namespace): function train (line 161) | def train(train_source_iter: ForeverDataIterator, model, interp, criteri... function validate (line 217) | def validate(val_loader: DataLoader, model, interp, criterion, visualize... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_generalization/image_classification/baseline.py class TransformerDecorator (line 34) | class TransformerDecorator(torch.nn.Module): method __init__ (line 35) | def __init__(self, backbone=None, add_bt=3, dim=2048, eval_global=0): method forward_feats (line 42) | def forward_feats(self, feature): method forward (line 54) | def forward(self, feature): function main (line 59) | def main(args: argparse.Namespace): function train (line 172) | def train(train_iter: ForeverDataIterator, model: Classifier, optimizer, FILE: domain_generalization/Transfer-Learning-Library/examples/domain_generalization/image_classification/coral.py class TransformerDecorator (line 36) | class TransformerDecorator(torch.nn.Module): method __init__ (line 37) | def __init__(self, backbone=None, add_bt=3, dim=2048, eval_global=0): method forward_feats (line 44) | def forward_feats(self, feature): method forward (line 56) | def forward(self, feature): function main (line 61) | def main(args: argparse.Namespace): function train (line 179) | def train(train_iter: ForeverDataIterator, model: Classifier, optimizer,... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_generalization/image_classification/groupdro.py function main (line 37) | def main(args: argparse.Namespace): function train (line 148) | def train(train_iter: ForeverDataIterator, model: Classifier, optimizer,... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_generalization/image_classification/irm.py class TransformerDecorator (line 36) | class TransformerDecorator(torch.nn.Module): method __init__ (line 37) | def __init__(self, backbone=None, add_bt=3, dim=2048, eval_global=0): method forward (line 45) | def forward(self, feature): function main (line 58) | def main(args: argparse.Namespace): function train (line 184) | def train(train_iter: ForeverDataIterator, model: Classifier, optimizer,... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_generalization/image_classification/mixstyle.py class TransformerDecorator (line 36) | class TransformerDecorator(torch.nn.Module): method __init__ (line 37) | def __init__(self, backbone=None, add_bt=3, dim=2048, eval_global=0): method forward (line 44) | def forward(self, feature): function main (line 57) | def main(args: argparse.Namespace): function train (line 172) | def train(train_iter: ForeverDataIterator, model: Classifier, optimizer, FILE: domain_generalization/Transfer-Learning-Library/examples/domain_generalization/image_classification/mldg.py function main (line 37) | def main(args: argparse.Namespace): function random_split (line 146) | def random_split(x_list, labels_list, n_domains_per_batch, n_support_dom... function train (line 158) | def train(train_iter: ForeverDataIterator, model: Classifier, optimizer,... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_generalization/image_classification/utils.py function get_model_names (line 25) | def get_model_names(): function get_model (line 33) | def get_model(model_name): function get_dataset_names (line 49) | def get_dataset_names(): class ConcatDatasetWithDomainLabel (line 56) | class ConcatDatasetWithDomainLabel(ConcatDataset): method __init__ (line 59) | def __init__(self, *args, **kwargs): method __getitem__ (line 70) | def __getitem__(self, index): function convert_from_wilds_dataset (line 76) | def convert_from_wilds_dataset(dataset_name, wild_dataset): function get_dataset (line 111) | def get_dataset(dataset_name, root, task_list, split='train', download=T... function split_dataset (line 171) | def split_dataset(dataset, n, seed=0): function validate (line 185) | def validate(val_loader, model, args, device) -> float: function get_train_transform (line 224) | def get_train_transform(resizing='default', random_horizontal_flip=True,... function get_val_transform (line 286) | def get_val_transform(resizing='default'): function collect_feature (line 311) | def collect_feature(data_loader, feature_extractor: nn.Module, device: t... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_generalization/image_classification/vrex.py class TransformerDecorator (line 35) | class TransformerDecorator(torch.nn.Module): method __init__ (line 36) | def __init__(self, backbone=None, add_bt=3, dim=2048, eval_global=0): method forward (line 44) | def forward(self, feature): function main (line 57) | def main(args: argparse.Namespace): function train (line 179) | def train(train_iter: ForeverDataIterator, model: Classifier, optimizer,... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_generalization/re_identification/baseline.py function main (line 39) | def main(args: argparse.Namespace): function train (line 173) | def train(train_iter: ForeverDataIterator, model, criterion_ce: CrossEnt... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_generalization/re_identification/mixstyle.py function main (line 41) | def main(args: argparse.Namespace): function train (line 176) | def train(train_iter: ForeverDataIterator, model, criterion_ce: CrossEnt... FILE: domain_generalization/Transfer-Learning-Library/examples/domain_generalization/re_identification/utils.py function get_model_names (line 17) | def get_model_names(): function get_model (line 25) | def get_model(model_name): function get_train_transform (line 41) | def get_train_transform(height, width, resizing='default', random_horizo... function get_val_transform (line 73) | def get_val_transform(height, width): function visualize_tsne (line 81) | def visualize_tsne(source_loader, target_loader, model, filename, device... FILE: domain_generalization/Transfer-Learning-Library/examples/task_adaptation/image_classification/baseline.py function main (line 32) | def main(args: argparse.Namespace): function train (line 101) | def train(train_iter: ForeverDataIterator, model: Classifier, optimizer:... FILE: domain_generalization/Transfer-Learning-Library/examples/task_adaptation/image_classification/bi_tuning.py function main (line 32) | def main(args: argparse.Namespace): function train (line 114) | def train(train_iter: ForeverDataIterator, bituning: BiTuning, optimizer... FILE: domain_generalization/Transfer-Learning-Library/examples/task_adaptation/image_classification/bss.py function main (line 33) | def main(args: argparse.Namespace): function train (line 102) | def train(train_iter: ForeverDataIterator, model: Classifier, bss_module... FILE: domain_generalization/Transfer-Learning-Library/examples/task_adaptation/image_classification/co_tuning.py function get_dataset (line 35) | def get_dataset(dataset_name, root, train_transform, val_transform, samp... function main (line 56) | def main(args: argparse.Namespace): function train (line 131) | def train(train_iter: ForeverDataIterator, model: Classifier, optimizer:... FILE: domain_generalization/Transfer-Learning-Library/examples/task_adaptation/image_classification/delta.py function main (line 35) | def main(args: argparse.Namespace): function calculate_channel_attention (line 141) | def calculate_channel_attention(dataset, return_layers, num_classes, args): function train (line 231) | def train(train_iter: ForeverDataIterator, model: Classifier, backbone_r... FILE: domain_generalization/Transfer-Learning-Library/examples/task_adaptation/image_classification/lwf.py function main (line 34) | def main(args: argparse.Namespace): function train (line 109) | def train(train_iter: ForeverDataIterator, model: Classifier, kd, optimi... FILE: domain_generalization/Transfer-Learning-Library/examples/task_adaptation/image_classification/stochnorm.py function main (line 33) | def main(args: argparse.Namespace): function train (line 103) | def train(train_iter: ForeverDataIterator, model: Classifier, optimizer:... FILE: domain_generalization/Transfer-Learning-Library/examples/task_adaptation/image_classification/utils.py function get_model_names (line 25) | def get_model_names(): function get_model (line 33) | def get_model(model_name, pretrained_checkpoint=None): function get_dataset (line 55) | def get_dataset(dataset_name, root, train_transform, val_transform, samp... function validate (line 80) | def validate(val_loader, model, args, device, visualize=None) -> float: function get_train_transform (line 121) | def get_train_transform(resizing='default', random_horizontal_flip=True,... function get_val_transform (line 168) | def get_val_transform(resizing='default'): function get_optimizer (line 197) | def get_optimizer(optimizer_name, params, lr, wd, momentum): function visualize (line 217) | def visualize(image, filename): FILE: domain_generalization/Transfer-Learning-Library/talib/finetune/bi_tuning.py class Classifier (line 11) | class Classifier(ClassifierBase): method __init__ (line 43) | def __init__(self, backbone: nn.Module, num_classes: int, projection_d... method forward (line 52) | def forward(self, x: torch.Tensor): method get_parameters (line 66) | def get_parameters(self, base_lr=1.0): class BiTuning (line 80) | class BiTuning(nn.Module): method __init__ (line 112) | def __init__(self, encoder_q: Classifier, encoder_k: Classifier, num_c... method _momentum_update_key_encoder (line 137) | def _momentum_update_key_encoder(self): method _dequeue_and_enqueue (line 145) | def _dequeue_and_enqueue(self, h, z, label): method forward (line 157) | def forward(self, im_q, im_k, labels): FILE: domain_generalization/Transfer-Learning-Library/talib/finetune/bss.py class BatchSpectralShrinkage (line 11) | class BatchSpectralShrinkage(nn.Module): method __init__ (line 40) | def __init__(self, k=1): method forward (line 44) | def forward(self, feature): FILE: domain_generalization/Transfer-Learning-Library/talib/finetune/co_tuning.py class CoTuningLoss (line 17) | class CoTuningLoss(nn.Module): method __init__ (line 32) | def __init__(self): method forward (line 35) | def forward(self, input: torch.Tensor, target: torch.Tensor) -> torch.... class Relationship (line 41) | class Relationship(object): method __init__ (line 51) | def __init__(self, data_loader, classifier, device, cache=None): method __getitem__ (line 64) | def __getitem__(self, category): method collect_labels (line 67) | def collect_labels(self): method get_category_relationship (line 91) | def get_category_relationship(self, source_probabilities, target_labels): class Classifier (line 111) | class Classifier(ClassifierBase): method __init__ (line 136) | def __init__(self, backbone: nn.Module, num_classes: int, head_source... method get_parameters (line 139) | def get_parameters(self, base_lr=1.0) -> List[Dict]: FILE: domain_generalization/Transfer-Learning-Library/talib/finetune/delta.py class L2Regularization (line 12) | class L2Regularization(nn.Module): method __init__ (line 24) | def __init__(self, model: nn.Module): method forward (line 28) | def forward(self): class SPRegularization (line 35) | class SPRegularization(nn.Module): method __init__ (line 55) | def __init__(self, source_model: nn.Module, target_model: nn.Module): method forward (line 62) | def forward(self): class BehavioralRegularization (line 69) | class BehavioralRegularization(nn.Module): method __init__ (line 92) | def __init__(self): method forward (line 95) | def forward(self, layer_outputs_source, layer_outputs_target): class AttentionBehavioralRegularization (line 102) | class AttentionBehavioralRegularization(nn.Module): method __init__ (line 129) | def __init__(self, channel_attention): method forward (line 133) | def forward(self, layer_outputs_source, layer_outputs_target): function get_attribute (line 147) | def get_attribute(obj, attr, *args): class IntermediateLayerGetter (line 153) | class IntermediateLayerGetter: method __init__ (line 167) | def __init__(self, model, return_layers, keep_output=True): method __call__ (line 172) | def __call__(self, *args, **kwargs): FILE: domain_generalization/Transfer-Learning-Library/talib/finetune/lwf.py function collect_pretrain_labels (line 11) | def collect_pretrain_labels(data_loader, classifier, device): class Classifier (line 23) | class Classifier(nn.Module): method __init__ (line 48) | def __init__(self, backbone: nn.Module, num_classes: int, head_source, method features_dim (line 77) | def features_dim(self) -> int: method forward (line 81) | def forward(self, x: torch.Tensor): method get_parameters (line 92) | def get_parameters(self, base_lr=1.0) -> List[Dict]: FILE: domain_generalization/Transfer-Learning-Library/talib/finetune/stochnorm.py class _StochNorm (line 15) | class _StochNorm(nn.Module): method __init__ (line 17) | def __init__(self, num_features, eps=1e-5, momentum=0.1, affine=True, ... method reset_parameters (line 40) | def reset_parameters(self): method _check_input_dim (line 48) | def _check_input_dim(self, input): method forward (line 51) | def forward(self, input): class StochNorm1d (line 87) | class StochNorm1d(_StochNorm): method _check_input_dim (line 136) | def _check_input_dim(self, input): class StochNorm2d (line 142) | class StochNorm2d(_StochNorm): method _check_input_dim (line 192) | def _check_input_dim(self, input): class StochNorm3d (line 198) | class StochNorm3d(_StochNorm): method _check_input_dim (line 248) | def _check_input_dim(self, input): function convert_model (line 254) | def convert_model(module, p): FILE: domain_generalization/baseline.py class TransformerDecorator (line 34) | class TransformerDecorator(torch.nn.Module): method __init__ (line 35) | def __init__(self, backbone=None, add_bt=3, dim=2048, eval_global=0): method forward_feats (line 42) | def forward_feats(self, feature): method forward (line 54) | def forward(self, feature): function main (line 59) | def main(args: argparse.Namespace): function train (line 172) | def train(train_iter: ForeverDataIterator, model: Classifier, optimizer, FILE: domain_generalization/coral.py class TransformerDecorator (line 36) | class TransformerDecorator(torch.nn.Module): method __init__ (line 37) | def __init__(self, backbone=None, add_bt=3, dim=2048, eval_global=0): method forward_feats (line 44) | def forward_feats(self, feature): method forward (line 56) | def forward(self, feature): function main (line 61) | def main(args: argparse.Namespace): function train (line 179) | def train(train_iter: ForeverDataIterator, model: Classifier, optimizer,... FILE: domain_generalization/irm.py class TransformerDecorator (line 36) | class TransformerDecorator(torch.nn.Module): method __init__ (line 37) | def __init__(self, backbone=None, add_bt=3, dim=2048, eval_global=0): method forward (line 45) | def forward(self, feature): function main (line 58) | def main(args: argparse.Namespace): function train (line 184) | def train(train_iter: ForeverDataIterator, model: Classifier, optimizer,... FILE: domain_generalization/mixstyle.py class TransformerDecorator (line 36) | class TransformerDecorator(torch.nn.Module): method __init__ (line 37) | def __init__(self, backbone=None, add_bt=3, dim=2048, eval_global=0): method forward (line 44) | def forward(self, feature): function main (line 57) | def main(args: argparse.Namespace): function train (line 172) | def train(train_iter: ForeverDataIterator, model: Classifier, optimizer, FILE: domain_generalization/swad/domainbed/algorithms/__init__.py function get_algorithm_class (line 4) | def get_algorithm_class(algorithm_name): FILE: domain_generalization/swad/domainbed/algorithms/algorithms.py function to_minibatch (line 28) | def to_minibatch(x, y): class Algorithm (line 33) | class Algorithm(torch.nn.Module): method __init__ (line 43) | def __init__(self, input_shape, num_classes, num_domains, hparams): method update (line 50) | def update(self, x, y, **kwargs): method predict (line 57) | def predict(self, x): method forward (line 60) | def forward(self, x): method new_optimizer (line 63) | def new_optimizer(self, parameters): method clone (line 72) | def clone(self): class ERM (line 80) | class ERM(Algorithm): method __init__ (line 85) | def __init__(self, input_shape, num_classes, num_domains, hparams): method update (line 97) | def update(self, x, y, **kwargs): method predict (line 111) | def predict(self, x): class Mixstyle (line 115) | class Mixstyle(Algorithm): method __init__ (line 118) | def __init__(self, input_shape, num_classes, num_domains, hparams): method update (line 131) | def update(self, x, y, **kwargs): method predict (line 145) | def predict(self, x): class Mixstyle2 (line 149) | class Mixstyle2(Algorithm): method __init__ (line 152) | def __init__(self, input_shape, num_classes, num_domains, hparams): method pair_batches (line 165) | def pair_batches(self, xs, ys): method update (line 179) | def update(self, x, y, **kwargs): method predict (line 202) | def predict(self, x): class ARM (line 206) | class ARM(ERM): method __init__ (line 209) | def __init__(self, input_shape, num_classes, num_domains, hparams): method predict (line 216) | def predict(self, x): class SAM (line 231) | class SAM(ERM): method norm (line 235) | def norm(tensor_list: List[torch.tensor], p=2): method update (line 239) | def update(self, x, y, **kwargs): class AbstractDANN (line 269) | class AbstractDANN(Algorithm): method __init__ (line 272) | def __init__(self, input_shape, num_classes, num_domains, hparams, con... method update (line 303) | def update(self, x, y, **kwargs): method predict (line 357) | def predict(self, x): class DANN (line 361) | class DANN(AbstractDANN): method __init__ (line 364) | def __init__(self, input_shape, num_classes, num_domains, hparams): class CDANN (line 375) | class CDANN(AbstractDANN): method __init__ (line 378) | def __init__(self, input_shape, num_classes, num_domains, hparams): class IRM (line 389) | class IRM(ERM): method __init__ (line 392) | def __init__(self, input_shape, num_classes, num_domains, hparams): method _irm_penalty (line 397) | def _irm_penalty(logits, y): method update (line 406) | def update(self, x, y, **kwargs): class VREx (line 446) | class VREx(ERM): method __init__ (line 449) | def __init__(self, input_shape, num_classes, num_domains, hparams): method update (line 453) | def update(self, x, y, **kwargs): class Mixup (line 494) | class Mixup(ERM): method __init__ (line 501) | def __init__(self, input_shape, num_classes, num_domains, hparams): method update (line 504) | def update(self, x, y, **kwargs): class OrgMixup (line 526) | class OrgMixup(ERM): method update (line 531) | def update(self, x, y, **kwargs): class CutMix (line 554) | class CutMix(ERM): method rand_bbox (line 556) | def rand_bbox(size, lam): method update (line 574) | def update(self, x, y, **kwargs): class GroupDRO (line 607) | class GroupDRO(ERM): method __init__ (line 613) | def __init__(self, input_shape, num_classes, num_domains, hparams): method update (line 617) | def update(self, x, y, **kwargs): class MLDG (line 642) | class MLDG(ERM): method __init__ (line 650) | def __init__(self, input_shape, num_classes, num_domains, hparams): method update (line 653) | def update(self, x, y, **kwargs): class AbstractMMD (line 763) | class AbstractMMD(ERM): method __init__ (line 769) | def __init__(self, input_shape, num_classes, num_domains, hparams, gau... method my_cdist (line 776) | def my_cdist(self, x1, x2): method gaussian_kernel (line 784) | def gaussian_kernel(self, x, y, gamma=(0.001, 0.01, 0.1, 1, 10, 100, 1... method mmd (line 793) | def mmd(self, x, y): method update (line 812) | def update(self, x, y, **kwargs): class MMD (line 841) | class MMD(AbstractMMD): method __init__ (line 846) | def __init__(self, input_shape, num_classes, num_domains, hparams): class CORAL (line 850) | class CORAL(AbstractMMD): method __init__ (line 855) | def __init__(self, input_shape, num_classes, num_domains, hparams): class MTL (line 859) | class MTL(Algorithm): method __init__ (line 866) | def __init__(self, input_shape, num_classes, num_domains, hparams): method update (line 881) | def update(self, x, y, **kwargs): method update_embeddings_ (line 893) | def update_embeddings_(self, features, env=None): method predict (line 903) | def predict(self, x, env=None): class SagNet (line 909) | class SagNet(Algorithm): method __init__ (line 915) | def __init__(self, input_shape, num_classes, num_domains, hparams): method forward_c (line 961) | def forward_c(self, x): method forward_s (line 965) | def forward_s(self, x): method randomize (line 969) | def randomize(self, x, what="style", eps=1e-5): method update (line 992) | def update(self, x, y, **kwargs): method predict (line 1023) | def predict(self, x): class RSC (line 1027) | class RSC(ERM): method __init__ (line 1028) | def __init__(self, input_shape, num_classes, num_domains, hparams): method update (line 1034) | def update(self, x, y, **kwargs): FILE: domain_generalization/swad/domainbed/datasets/__init__.py function set_transfroms (line 9) | def set_transfroms(dset, data_type, hparams, algorithm_class=None): function get_dataset (line 41) | def get_dataset(test_envs, args, hparams, algorithm_class=None): class _SplitDataset (line 84) | class _SplitDataset(torch.utils.data.Dataset): method __init__ (line 87) | def __init__(self, underlying_dataset, keys): method __getitem__ (line 95) | def __getitem__(self, key): method __len__ (line 107) | def __len__(self): function split_dataset (line 111) | def split_dataset(dataset, n, seed=0): FILE: domain_generalization/swad/domainbed/datasets/datasets.py function get_dataset_class (line 29) | def get_dataset_class(dataset_name): function num_environments (line 36) | def num_environments(dataset_name): class MultipleDomainDataset (line 40) | class MultipleDomainDataset: method __getitem__ (line 47) | def __getitem__(self, index): method __len__ (line 53) | def __len__(self): class Debug (line 60) | class Debug(MultipleDomainDataset): method __init__ (line 61) | def __init__(self, root): class Debug28 (line 75) | class Debug28(Debug): class Debug224 (line 80) | class Debug224(Debug): class MultipleEnvironmentMNIST (line 85) | class MultipleEnvironmentMNIST(MultipleDomainDataset): method __init__ (line 86) | def __init__(self, root, environments, dataset_transform, input_shape,... class ColoredMNIST (line 121) | class ColoredMNIST(MultipleEnvironmentMNIST): method __init__ (line 124) | def __init__(self, root): method color_dataset (line 133) | def color_dataset(self, images, labels, environment): method torch_bernoulli_ (line 152) | def torch_bernoulli_(self, p, size): method torch_xor_ (line 155) | def torch_xor_(self, a, b): class RotatedMNIST (line 159) | class RotatedMNIST(MultipleEnvironmentMNIST): method __init__ (line 162) | def __init__(self, root): method rotate_dataset (line 171) | def rotate_dataset(self, images, labels, angle): class MultipleEnvironmentImageFolder (line 189) | class MultipleEnvironmentImageFolder(MultipleDomainDataset): method __init__ (line 190) | def __init__(self, root): class VLCS (line 207) | class VLCS(MultipleEnvironmentImageFolder): method __init__ (line 211) | def __init__(self, root): class PACS (line 216) | class PACS(MultipleEnvironmentImageFolder): method __init__ (line 220) | def __init__(self, root): class DomainNet (line 225) | class DomainNet(MultipleEnvironmentImageFolder): method __init__ (line 230) | def __init__(self, root): class OfficeHome (line 235) | class OfficeHome(MultipleEnvironmentImageFolder): method __init__ (line 239) | def __init__(self, root): class TerraIncognita (line 244) | class TerraIncognita(MultipleEnvironmentImageFolder): method __init__ (line 248) | def __init__(self, root): FILE: domain_generalization/swad/domainbed/evaluator.py function accuracy_from_loader (line 13) | def accuracy_from_loader(algorithm, loader, weights, debug=False): function accuracy (line 54) | def accuracy(algorithm, loader_kwargs, weights, **kwargs): class Evaluator (line 64) | class Evaluator: method __init__ (line 65) | def __init__( method set_target_env (line 81) | def set_target_env(self, target_env): method evaluate (line 85) | def evaluate(self, algorithm, ret_losses=False): FILE: domain_generalization/swad/domainbed/hparams_registry.py function _hparams (line 6) | def _hparams(algorithm, dataset, random_state): function default_hparams (line 101) | def default_hparams(algorithm, dataset): function random_hparams (line 106) | def random_hparams(algorithm, dataset, seed): FILE: domain_generalization/swad/domainbed/lib/fast_data_loader.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 41) | def __iter__(self): method __len__ (line 45) | def __len__(self): class FastDataLoader (line 49) | class FastDataLoader: method __init__ (line 55) | def __init__(self, dataset, batch_size, num_workers, shuffle=False): method __iter__ (line 79) | def __iter__(self): method __len__ (line 83) | def __len__(self): FILE: domain_generalization/swad/domainbed/lib/logger.py function levelize (line 6) | def levelize(levelname): class ColorFormatter (line 14) | class ColorFormatter(logging.Formatter): method format (line 23) | def format(self, record): class Logger (line 29) | class Logger(logging.Logger): method get (line 33) | def get(cls, file_path=None, level="INFO", colorize=True, track_code=F... method nofmt (line 77) | def nofmt(self, msg, *args, level="INFO", **kwargs): method remove_formats (line 83) | def remove_formats(self): method set_formats (line 92) | def set_formats(self, formatters): method set_file_handler (line 97) | def set_file_handler(self, file_path): FILE: domain_generalization/swad/domainbed/lib/misc.py function make_weights_for_balanced_classes (line 19) | def make_weights_for_balanced_classes(dataset): function seed_hash (line 40) | def seed_hash(*args): function to_row (line 48) | def to_row(row, colwidth=10, latex=False): function random_pairs_of_minibatches (line 65) | def random_pairs_of_minibatches(minibatches): function index_conditional_iterate (line 89) | def index_conditional_iterate(skip_condition, iterable, index): class SplitIterator (line 100) | class SplitIterator: method __init__ (line 101) | def __init__(self, test_envs): method train (line 104) | def train(self, iterable, index=False): method test (line 107) | def test(self, iterable, index=False): class AverageMeter (line 111) | class AverageMeter: method __init__ (line 114) | def __init__(self): method reset (line 117) | def reset(self): method update (line 124) | def update(self, val, n=1): method __repr__ (line 131) | def __repr__(self): class AverageMeters (line 135) | class AverageMeters: method __init__ (line 136) | def __init__(self, *keys): method resets (line 141) | def resets(self): method updates (line 145) | def updates(self, dic, n=1): method __repr__ (line 149) | def __repr__(self): method get_averages (line 152) | def get_averages(self): function timestamp (line 157) | def timestamp(fmt="%y%m%d_%H-%M-%S"): function makedirs (line 161) | def makedirs(path): function rm (line 170) | def rm(path): function cp (line 178) | def cp(src, dst): function get_lr (line 182) | def get_lr(optimizer): function hash_bn (line 190) | def hash_bn(module): function merge_dictlist (line 204) | def merge_dictlist(dictlist): FILE: domain_generalization/swad/domainbed/lib/query.py function make_selector_fn (line 13) | def make_selector_fn(selector): function hashable (line 46) | def hashable(obj): class Q (line 54) | class Q(object): method __init__ (line 55) | def __init__(self, list_): method __len__ (line 59) | def __len__(self): method __getitem__ (line 62) | def __getitem__(self, key): method __eq__ (line 65) | def __eq__(self, other): method __str__ (line 71) | def __str__(self): method __repr__ (line 74) | def __repr__(self): method _append (line 77) | def _append(self, item): method group (line 81) | def group(self, selector): method group_map (line 97) | def group_map(self, selector, fn): method map (line 104) | def map(self, fn): method select (line 114) | def select(self, selector): method min (line 118) | def min(self): method max (line 121) | def max(self): method sum (line 124) | def sum(self): method len (line 127) | def len(self): method mean (line 130) | def mean(self): method std (line 135) | def std(self): method mean_std (line 140) | def mean_std(self): method argmax (line 143) | def argmax(self, selector): method filter (line 147) | def filter(self, fn): method filter_equals (line 150) | def filter_equals(self, selector, value): method filter_not_none (line 155) | def filter_not_none(self): method filter_not_nan (line 158) | def filter_not_nan(self): method flatten (line 161) | def flatten(self): method unique (line 164) | def unique(self): method sorted (line 174) | def sorted(self, key=None, reverse=False): FILE: domain_generalization/swad/domainbed/lib/swa_utils.py class AveragedModel (line 9) | class AveragedModel(Module): method __init__ (line 10) | def __init__(self, model, device=None, avg_fn=None, rm_optimizer=False): method forward (line 36) | def forward(self, *args, **kwargs): method predict (line 40) | def predict(self, *args, **kwargs): method network (line 44) | def network(self): method update_parameters (line 47) | def update_parameters(self, model, step=None, start_step=None, end_ste... method clone (line 82) | def clone(self): function cvt_dbiterator_to_loader (line 88) | def cvt_dbiterator_to_loader(dbiterator, n_iter): function update_bn (line 99) | def update_bn(iterator, model, n_steps, device="cuda"): FILE: domain_generalization/swad/domainbed/lib/wide_resnet.py function conv3x3 (line 17) | def conv3x3(in_planes, out_planes, stride=1): function conv_init (line 21) | def conv_init(m): class wide_basic (line 31) | class wide_basic(nn.Module): method __init__ (line 32) | def __init__(self, in_planes, planes, dropout_rate, stride=1): method forward (line 46) | def forward(self, x): class Wide_ResNet (line 54) | class Wide_ResNet(nn.Module): method __init__ (line 57) | def __init__(self, input_shape, depth, widen_factor, dropout_rate): method _wide_layer (line 76) | def _wide_layer(self, block, planes, num_blocks, dropout_rate, stride): method forward (line 86) | def forward(self, x): FILE: domain_generalization/swad/domainbed/lib/writers.py class Writer (line 1) | class Writer: method add_scalars (line 2) | def add_scalars(self, tag_scalar_dic, global_step): method add_scalars_with_prefix (line 5) | def add_scalars_with_prefix(self, tag_scalar_dic, global_step, prefix): class TBWriter (line 10) | class TBWriter(Writer): method __init__ (line 11) | def __init__(self, dir_path): method add_scalars (line 16) | def add_scalars(self, tag_scalar_dic, global_step): function get_writer (line 21) | def get_writer(dir_path): FILE: domain_generalization/swad/domainbed/lr_scheduler/lr_scheduler.py function get_scheduler (line 4) | def get_scheduler(name, optimizer, lr, total_steps, final_div_factor=1e4): FILE: domain_generalization/swad/domainbed/models/mixstyle.py class MixStyle (line 9) | class MixStyle(nn.Module): method __init__ (line 15) | def __init__(self, p=0.5, alpha=0.3, eps=1e-6): method __repr__ (line 32) | def __repr__(self): method forward (line 35) | def forward(self, x): class MixStyle2 (line 61) | class MixStyle2(nn.Module): method __init__ (line 68) | def __init__(self, p=0.5, alpha=0.3, eps=1e-6): method __repr__ (line 85) | def __repr__(self): method forward (line 88) | def forward(self, x): FILE: domain_generalization/swad/domainbed/models/resnet_mixstyle.py function conv3x3 (line 19) | 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 71) | def forward(self, x): class ResNet (line 94) | class ResNet(nn.Module): method __init__ (line 95) | def __init__( method _make_layer (line 125) | def _make_layer(self, block, planes, blocks, stride=1): method _init_params (line 147) | def _init_params(self): method compute_style (line 164) | def compute_style(self, x): method featuremaps (line 169) | def featuremaps(self, x): method forward (line 193) | def forward(self, x): function init_pretrained_weights (line 199) | def init_pretrained_weights(model, model_url): function resnet18_mixstyle_L234_p0d5_a0d1 (line 204) | def resnet18_mixstyle_L234_p0d5_a0d1(pretrained=True, **kwargs): function resnet50_mixstyle_L234_p0d5_a0d1 (line 219) | def resnet50_mixstyle_L234_p0d5_a0d1(pretrained=True, **kwargs): FILE: domain_generalization/swad/domainbed/models/resnet_mixstyle2.py function conv3x3 (line 20) | def conv3x3(in_planes, out_planes, stride=1): class BasicBlock (line 25) | class BasicBlock(nn.Module): method __init__ (line 28) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 38) | def forward(self, x): class Bottleneck (line 57) | class Bottleneck(nn.Module): method __init__ (line 60) | 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 96) | def __init__( method _make_layer (line 126) | def _make_layer(self, block, planes, blocks, stride=1): method _init_params (line 148) | def _init_params(self): method compute_style (line 165) | def compute_style(self, x): method featuremaps (line 170) | def featuremaps(self, x): method forward (line 194) | def forward(self, x): function init_pretrained_weights (line 200) | def init_pretrained_weights(model, model_url): function resnet18_mixstyle2_L234_p0d5_a0d1 (line 216) | def resnet18_mixstyle2_L234_p0d5_a0d1(pretrained=True, **kwargs): function resnet50_mixstyle2_L234_p0d5_a0d1 (line 231) | def resnet50_mixstyle2_L234_p0d5_a0d1(pretrained=True, **kwargs): FILE: domain_generalization/swad/domainbed/networks.py class Identity (line 11) | class Identity(nn.Module): method __init__ (line 14) | def __init__(self): method forward (line 17) | def forward(self, x): class SqueezeLastTwo (line 21) | class SqueezeLastTwo(nn.Module): method __init__ (line 27) | def __init__(self): method forward (line 30) | def forward(self, x): class MLP (line 34) | class MLP(nn.Module): method __init__ (line 37) | def __init__(self, n_inputs, n_outputs, hparams): method forward (line 50) | def forward(self, x): class ResNet (line 62) | class ResNet(torch.nn.Module): method __init__ (line 65) | def __init__(self, input_shape, hparams, network=None): method forward (line 98) | def forward(self, x): method train (line 102) | def train(self, mode=True): method freeze_bn (line 109) | def freeze_bn(self): class MNIST_CNN (line 118) | class MNIST_CNN(nn.Module): method __init__ (line 128) | def __init__(self, input_shape): method forward (line 143) | def forward(self, x): class ContextNet (line 165) | class ContextNet(nn.Module): method __init__ (line 166) | def __init__(self, input_shape): method forward (line 181) | def forward(self, x): function Featurizer (line 185) | def Featurizer(input_shape, hparams): FILE: domain_generalization/swad/domainbed/optimizers.py function get_optimizer (line 4) | def get_optimizer(name, params, **kwargs): FILE: domain_generalization/swad/domainbed/scripts/download.py function stage_path (line 18) | def stage_path(data_dir, name): function download_and_extract (line 27) | def download_and_extract(url, dst, remove=True): function download_vlcs (line 95) | def download_vlcs(data_dir): function download_mnist (line 108) | def download_mnist(data_dir): function download_pacs (line 117) | def download_pacs(data_dir): function download_office_home (line 132) | def download_office_home(data_dir): function download_domain_net (line 147) | def download_domain_net(data_dir): function download_terra_incognita (line 174) | def download_terra_incognita(data_dir): FILE: domain_generalization/swad/domainbed/swad.py class SWADBase (line 7) | class SWADBase: method update_and_evaluate (line 8) | def update_and_evaluate(self, segment_swa, val_acc, val_loss, prt_fn): method get_final_model (line 11) | def get_final_model(self): class IIDMax (line 15) | class IIDMax(SWADBase): method __init__ (line 18) | def __init__(self, evaluator, **kwargs): method update_and_evaluate (line 25) | def update_and_evaluate(self, segment_swa, val_acc, val_loss, prt_fn): method get_final_model (line 44) | def get_final_model(self): class LossValley (line 48) | class LossValley(SWADBase): method __init__ (line 53) | def __init__(self, evaluator, n_converge, n_tolerance, tolerance_ratio... method get_smooth_loss (line 75) | def get_smooth_loss(self, idx): method is_converged (line 80) | def is_converged(self): method update_and_evaluate (line 83) | def update_and_evaluate(self, segment_swa, val_acc, val_loss, prt_fn): method get_final_model (line 146) | def get_final_model(self): FILE: domain_generalization/swad/domainbed/trainer.py function json_handler (line 27) | def json_handler(v): class TransformerDecorator (line 33) | class TransformerDecorator(torch.nn.Module): method __init__ (line 34) | def __init__(self, classifier, add_bt = 0, eval_batch=0): method forward (line 46) | def forward(self, x): function train (line 57) | def train(test_envs, args, hparams, n_steps, checkpoint_freq, logger, wr... FILE: domain_generalization/swad/train_all.py function main (line 22) | def main(): FILE: long-tailed_recognition/BalancedSoftmax/data/ClassAwareSampler.py class RandomCycleIter (line 24) | class RandomCycleIter: method __init__ (line 26) | def __init__ (self, data, test_mode=False): method __iter__ (line 32) | def __iter__ (self): method __next__ (line 35) | def __next__ (self): function class_aware_sample_generator (line 45) | def class_aware_sample_generator (cls_iter, data_iter_list, n, num_sampl... class ClassAwareSampler (line 65) | class ClassAwareSampler (Sampler): method __init__ (line 67) | def __init__(self, data_source, num_samples_cls=1, is_infinite=False): method __iter__ (line 79) | def __iter__ (self): method __len__ (line 83) | def __len__ (self): function get_sampler (line 86) | def get_sampler(): FILE: long-tailed_recognition/BalancedSoftmax/data/ClassPrioritySampler.py class RandomCycleIter (line 14) | class RandomCycleIter: method __init__ (line 16) | def __init__ (self, data, test_mode=False): method __iter__ (line 22) | def __iter__ (self): method __next__ (line 25) | def __next__ (self): class PriorityTree (line 36) | class PriorityTree(object): method __init__ (line 37) | def __init__(self, capacity, init_weights, fixed_weights=None, fixed_s... method initialize (line 54) | def initialize(self, init_weights): method reset_adaptive_weights (line 68) | def reset_adaptive_weights(self, adaptive_weights): method reset_fixed_weights (line 71) | def reset_fixed_weights(self, fixed_weights, rescale=False): method update_whole (line 90) | def update_whole(self, total_weights): method get_adaptive_weights (line 107) | def get_adaptive_weights(self): method get_total_weights (line 114) | def get_total_weights(self): method get_raw_total_weights (line 122) | def get_raw_total_weights(self): method size (line 131) | def size(self): method capacity (line 135) | def capacity(self): method __len__ (line 138) | def __len__(self): method pointer_to_treeidx (line 141) | def pointer_to_treeidx(self, pointer): method update (line 145) | def update(self, pointer, priority): method update_delta (line 157) | def update_delta(self, pointer, delta): method get_leaf (line 175) | def get_leaf(self, value): method total (line 194) | def total(self): method max (line 199) | def max(self): method min (line 203) | def min(self): method get_weights (line 207) | def get_weights(self): class ClassPrioritySampler (line 216) | class ClassPrioritySampler(Sampler): method __init__ (line 264) | def __init__(self, dataset, balance_scale=1.0, fixed_scale=1.0, method get_cls_ratios (line 374) | def get_cls_ratios(self, tgt_weights): method get_cls_weights (line 381) | def get_cls_weights(self): method broadcast (line 385) | def broadcast(self, per_cls_info): method debroadcast_sum (line 392) | def debroadcast_sum(self, per_example_info): method get_manual_weights (line 399) | def get_manual_weights(self, lam): method get_uniform_weights (line 409) | def get_uniform_weights(self): method get_balanced_weights (line 412) | def get_balanced_weights(self, nroot): method __iter__ (line 437) | def __iter__(self): method __len__ (line 443) | def __len__(self): method reset_weights (line 446) | def reset_weights(self, epoch): method update_backend_distribution (line 474) | def update_backend_distribution(self, tgt_weights): method update_weights (line 484) | def update_weights(self, inds, weights, labels): method reset_priority (line 517) | def reset_priority(self, weights, labels): method get_weights (line 528) | def get_weights(self): function get_sampler (line 532) | def get_sampler(): FILE: long-tailed_recognition/BalancedSoftmax/data/ImageNet/gen_txt.py function convert (line 19) | def convert(split, txt_file): FILE: long-tailed_recognition/BalancedSoftmax/data/ImbalanceCIFAR.py class IMBALANCECIFAR10 (line 13) | class IMBALANCECIFAR10(torchvision.datasets.CIFAR10): method __init__ (line 17) | def __init__(self, phase, imbalance_ratio, root, imb_type='exp'): method _get_class_dict (line 44) | def _get_class_dict(self): method get_img_num_per_cls (line 53) | def get_img_num_per_cls(self, cls_num, imb_type, imb_factor): method gen_imbalanced_data (line 78) | def gen_imbalanced_data(self, img_num_per_cls): method __getitem__ (line 96) | def __getitem__(self, index): method __len__ (line 111) | def __len__(self): method get_num_classes (line 114) | def get_num_classes(self): method get_annotations (line 117) | def get_annotations(self): method get_cls_num_list (line 123) | def get_cls_num_list(self): class IMBALANCECIFAR100 (line 130) | class IMBALANCECIFAR100(IMBALANCECIFAR10): FILE: long-tailed_recognition/BalancedSoftmax/data/MetaSampler.py function invert_sigmoid (line 9) | def invert_sigmoid(x): class SampleLearner (line 13) | class SampleLearner(nn.Module): method __init__ (line 18) | def __init__(self, num_classes, init_pow=0., freq_path=None): method init_learner (line 32) | def init_learner(self, img_num_per_cls): method init_weights_sampler (line 37) | def init_weights_sampler(self, m): method forward (line 46) | def forward(self, onehot_targets, batch_size): method forward_loss (line 56) | def forward_loss(self, x): class MetaSampler (line 67) | class MetaSampler(Sampler): method __init__ (line 68) | def __init__(self, data_source, batch_size, meta_learner): method __iter__ (line 89) | def __iter__(self): method __len__ (line 95) | def __len__(self): function get_sampler (line 99) | def get_sampler(): function get_learner (line 103) | def get_learner(): FILE: long-tailed_recognition/BalancedSoftmax/data/MixedPrioritizedSampler.py class PriorityTree (line 14) | class PriorityTree(object): method __init__ (line 15) | def __init__(self, capacity, fixed_weights=None, fixed_scale=1.0, method initialize (line 30) | def initialize(self, init_weight): method reset_fixed_weights (line 42) | def reset_fixed_weights(self, fixed_weights, rescale=False): method update_whole (line 59) | def update_whole(self, total_weights): method get_adaptive_weights (line 74) | def get_adaptive_weights(self): method get_total_weights (line 78) | def get_total_weights(self): method size (line 87) | def size(self): method capacity (line 91) | def capacity(self): method __len__ (line 94) | def __len__(self): method pointer_to_treeidx (line 97) | def pointer_to_treeidx(self, pointer): method update (line 101) | def update(self, pointer, priority): method get_leaf (line 111) | def get_leaf(self, value): method total (line 130) | def total(self): method max (line 135) | def max(self): method min (line 139) | def min(self): method get_weights (line 143) | def get_weights(self): class MixedPrioritizedSampler (line 148) | class MixedPrioritizedSampler(Sampler): method __init__ (line 194) | def __init__(self, dataset, balance_scale=1.0, fixed_scale=1.0, method get_manual_weights (line 279) | def get_manual_weights(self, lam): method get_balanced_weights (line 289) | def get_balanced_weights(self, nroot): method __iter__ (line 314) | def __iter__(self): method __len__ (line 320) | def __len__(self): method reset_weights (line 323) | def reset_weights(self, epoch): method update_weights (line 346) | def update_weights(self, inds, weights): method get_weights (line 354) | def get_weights(self): function get_sampler (line 358) | def get_sampler(): FILE: long-tailed_recognition/BalancedSoftmax/data/autoaugment.py class Cutout (line 7) | class Cutout(object): method __init__ (line 8) | def __init__(self, n_holes, length): method __call__ (line 12) | def __call__(self, img): class ImageNetPolicy (line 35) | class ImageNetPolicy(object): method __init__ (line 48) | def __init__(self, fillcolor=(128, 128, 128)): method __call__ (line 82) | def __call__(self, img): method __repr__ (line 86) | def __repr__(self): class CIFAR10Policy (line 90) | class CIFAR10Policy(object): method __init__ (line 103) | def __init__(self, fillcolor=(128, 128, 128)): method __call__ (line 137) | def __call__(self, img): method __repr__ (line 141) | def __repr__(self): class SVHNPolicy (line 145) | class SVHNPolicy(object): method __init__ (line 158) | def __init__(self, fillcolor=(128, 128, 128)): method __call__ (line 192) | def __call__(self, img): method __repr__ (line 196) | def __repr__(self): class SubPolicy (line 200) | class SubPolicy(object): method __init__ (line 201) | def __init__(self, p1, operation1, magnitude_idx1, p2, operation2, mag... method __call__ (line 260) | def __call__(self, img): FILE: long-tailed_recognition/BalancedSoftmax/data/dataloader.py function get_data_transform (line 36) | def get_data_transform(split, rgb_mean, rbg_std, key='default'): class LT_Dataset (line 67) | class LT_Dataset(Dataset): method __init__ (line 69) | def __init__(self, root, txt, dataset, transform=None, meta=False): method __len__ (line 90) | def __len__(self): method __getitem__ (line 93) | def __getitem__(self, index): function load_data (line 108) | def load_data(data_root, dataset, phase, batch_size, sampler_dic=None, n... FILE: long-tailed_recognition/BalancedSoftmax/data/iNaturalist18/gen_lists.py function convert (line 22) | def convert(json_file, txt_file): FILE: long-tailed_recognition/BalancedSoftmax/encoder_network.py class TransformerEncoderLayer (line 5) | class TransformerEncoderLayer(Module): method __init__ (line 24) | def __init__(self, d_model, nhead, dim_feedforward=2048, dropout=0.1, ... method __setstate__ (line 39) | def __setstate__(self, state): method forward (line 45) | def forward(self, src): function obtain_sample_relation_models (line 68) | def obtain_sample_relation_models(add_bt, output_dim, debug=0): FILE: long-tailed_recognition/BalancedSoftmax/layers/ModulatedAttLayer.py class ModulatedAttLayer (line 21) | class ModulatedAttLayer(nn.Module): method __init__ (line 23) | def __init__(self, in_channels, reduction = 2, mode='embedded_gaussian'): method init_weights (line 42) | def init_weights(self): method embedded_gaussian (line 49) | def embedded_gaussian(self, x): method forward (line 79) | def forward(self, x): FILE: long-tailed_recognition/BalancedSoftmax/logger.py class Logger (line 14) | class Logger(object): method __init__ (line 15) | def __init__(self, logdir): method log_cfg (line 27) | def log_cfg(self, cfg): method log_acc (line 32) | def log_acc(self, accs): method log_loss (line 44) | def log_loss(self, losses): method log_ws (line 58) | def log_ws(self, e, ws): FILE: long-tailed_recognition/BalancedSoftmax/loss/BalancedSoftmaxLoss.py class BalancedSoftmax (line 22) | class BalancedSoftmax(_Loss): method __init__ (line 26) | def __init__(self, freq_path): method forward (line 33) | def forward(self, input, label, reduction='mean'): function balanced_softmax_loss (line 37) | def balanced_softmax_loss(labels, logits, sample_per_class, reduction): function create_loss (line 54) | def create_loss(freq_path): FILE: long-tailed_recognition/BalancedSoftmax/loss/DiscCentroidsLoss.py class DiscCentroidsLoss (line 22) | class DiscCentroidsLoss(nn.Module): method __init__ (line 23) | def __init__(self, num_classes, feat_dim, size_average=True): method forward (line 31) | def forward(self, feat, label): class DiscCentroidsLossFunc (line 66) | class DiscCentroidsLossFunc(Function): method forward (line 68) | def forward(ctx, feature, label, centroids, batch_size): method backward (line 74) | def backward(ctx, grad_output): function create_loss (line 90) | def create_loss (feat_dim=512, num_classes=1000): FILE: long-tailed_recognition/BalancedSoftmax/loss/SoftmaxLoss.py function create_loss (line 18) | def create_loss (): FILE: long-tailed_recognition/BalancedSoftmax/main.py function update (line 54) | def update(config, args): function split2phase (line 108) | def split2phase(split): FILE: long-tailed_recognition/BalancedSoftmax/models/CosNormClassifier.py class CosNorm_Classifier (line 22) | class CosNorm_Classifier(nn.Module): method __init__ (line 23) | def __init__(self, in_dims, out_dims, scale=16, margin=0.5, init_std=0... method reset_parameters (line 32) | def reset_parameters(self): method forward (line 36) | def forward(self, input, *args): function create_model (line 42) | def create_model(in_dims=512, out_dims=1000): FILE: long-tailed_recognition/BalancedSoftmax/models/DotProductClassifier.py class DotProduct_Classifier (line 20) | class DotProduct_Classifier(nn.Module): method __init__ (line 22) | def __init__(self, num_classes=1000, feat_dim=2048, *args): method forward (line 27) | def forward(self, x, *args): function create_model (line 31) | def create_model(feat_dim, num_classes=1000, stage1_weights=False, datas... FILE: long-tailed_recognition/BalancedSoftmax/models/KNNClassifier.py class KNNClassifier (line 15) | class KNNClassifier(nn.Module): method __init__ (line 16) | def __init__(self, feat_dim=512, num_classes=1000, feat_type='cl2n', d... method update (line 28) | def update(self, cfeats): method forward (line 41) | def forward(self, inputs, *args): method l2_similarity (line 65) | def l2_similarity(self, A, B): method cos_similarity (line 77) | def cos_similarity(self, A, B): function create_model (line 84) | def create_model(feat_dim, num_classes=1000, feat_type='cl2n', dist_type... FILE: long-tailed_recognition/BalancedSoftmax/models/MetaEmbeddingClassifier.py class MetaEmbedding_Classifier (line 23) | class MetaEmbedding_Classifier(nn.Module): method __init__ (line 25) | def __init__(self, feat_dim=2048, num_classes=1000): method forward (line 32) | def forward(self, x, centroids, *args): function create_model (line 68) | def create_model(feat_dim=2048, num_classes=1000, stage1_weights=False, ... FILE: long-tailed_recognition/BalancedSoftmax/models/ResNet101Feature.py function create_model (line 13) | def create_model(use_selfatt=False, use_fc=False, dropout=None, stage1_w... FILE: long-tailed_recognition/BalancedSoftmax/models/ResNet10Feature.py function create_model (line 20) | def create_model(use_selfatt=False, use_fc=False, dropout=None, stage1_w... FILE: long-tailed_recognition/BalancedSoftmax/models/ResNet152Feature.py function create_model (line 12) | def create_model(use_selfatt=False, use_fc=False, dropout=None, stage1_w... FILE: long-tailed_recognition/BalancedSoftmax/models/ResNet152FeatureCaffe.py function create_model (line 20) | def create_model(use_selfatt=False, use_fc=False, dropout=None, stage1_w... FILE: long-tailed_recognition/BalancedSoftmax/models/ResNet32Feature.py function _weights_init (line 44) | def _weights_init(m): class LambdaLayer (line 50) | class LambdaLayer(nn.Module): method __init__ (line 51) | def __init__(self, lambd): method forward (line 55) | def forward(self, x): class BasicBlock (line 59) | class BasicBlock(nn.Module): method __init__ (line 62) | def __init__(self, in_planes, planes, stride=1, option="A"): method forward (line 99) | def forward(self, x): class ResNet_Cifar (line 107) | class ResNet_Cifar(nn.Module): method __init__ (line 108) | def __init__(self, block, num_blocks): method _make_layer (line 121) | def _make_layer(self, block, planes, num_blocks, stride): method load_model (line 130) | def load_model(self, pretrain): method forward (line 149) | def forward(self, x, **kwargs): function create_model (line 161) | def create_model(use_fc=False, pretrain=False, dropout=None, stage1_weig... FILE: long-tailed_recognition/BalancedSoftmax/models/ResNet50Feature.py function create_model (line 13) | def create_model(use_selfatt=False, use_fc=False, dropout=None, stage1_w... FILE: long-tailed_recognition/BalancedSoftmax/models/ResNetFeature.py function conv3x3 (line 21) | def conv3x3(in_planes, out_planes, stride=1): class BasicBlock (line 26) | class BasicBlock(nn.Module): method __init__ (line 29) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 39) | def forward(self, x): class Bottleneck (line 57) | class Bottleneck(nn.Module): method __init__ (line 60) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 73) | def forward(self, x): class ResNet (line 95) | class ResNet(nn.Module): method __init__ (line 97) | def __init__(self, block, layers, use_modulatedatt=False, use_fc=False... method _make_layer (line 135) | def _make_layer(self, block, planes, blocks, stride=1): method forward (line 152) | def forward(self, x, *args): FILE: long-tailed_recognition/BalancedSoftmax/models/ResNext101Feature.py function create_model (line 13) | def create_model(use_selfatt=False, use_fc=False, dropout=None, stage1_w... FILE: long-tailed_recognition/BalancedSoftmax/models/ResNext152Feature.py function create_model (line 13) | def create_model(use_selfatt=False, use_fc=False, dropout=None, stage1_w... FILE: long-tailed_recognition/BalancedSoftmax/models/ResNext50Feature.py function create_model (line 12) | def create_model(use_selfatt=False, use_fc=False, dropout=None, stage1_w... FILE: long-tailed_recognition/BalancedSoftmax/models/ResNextFeature.py function conv3x3 (line 14) | 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 69) | def forward(self, x): class ResNext (line 91) | class ResNext(nn.Module): method __init__ (line 93) | def __init__(self, block, layers, groups=1, width_per_group=64, method _make_layer (line 137) | def _make_layer(self, block, planes, blocks, stride=1, is_last=False): method forward (line 157) | def forward(self, x, *args): FILE: long-tailed_recognition/BalancedSoftmax/models/TauNormClassifier.py class DotProduct_Classifier (line 16) | class DotProduct_Classifier(nn.Module): method __init__ (line 18) | def __init__(self, num_classes=1000, feat_dim=2048, *args): method forward (line 26) | def forward(self, x, *args): function create_model (line 31) | def create_model(feat_dim, num_classes=1000, stage1_weights=False, datas... FILE: long-tailed_recognition/BalancedSoftmax/run_networks.py class CamModule (line 19) | class CamModule(Module): method __init__ (line 20) | def __init__(self, feat_model, classifier): method forward (line 25) | def forward(self, inputs): class model (line 29) | class model (): method __init__ (line 31) | def __init__(self, config, data, test=False, meta_sample=False, learne... method init_models (line 123) | def init_models(self, optimizer=True): method init_criterions (line 201) | def init_criterions(self): method init_optimizers (line 240) | def init_optimizers(self, optim_params): method batch_forward (line 264) | def batch_forward (self, inputs, labels=None, centroids=False, feature... method batch_backward (line 323) | def batch_backward(self, labels=None): method batch_loss (line 380) | def batch_loss(self, labels): method shuffle_batch (line 410) | def shuffle_batch(self, x, y): method meta_forward (line 416) | def meta_forward(self, inputs, labels, verbose=False): method train (line 460) | def train(self): method eval_with_preds (line 633) | def eval_with_preds(self, preds, labels): method eval (line 687) | def eval(self, phase='val', openset=False, save_feat=False): method centroids_cal (line 888) | def centroids_cal(self, data, save_all=False): method get_knncentroids (line 930) | def get_knncentroids(self): method reset_model (line 984) | def reset_model(self, model_state): method load_model (line 990) | def load_model(self, model_dir=None): method save_latest (line 1021) | def save_latest(self, epoch): method save_model (line 1037) | def save_model(self, epoch, best_epoch, best_model_weights, best_acc, ... method output_logits (line 1050) | def output_logits(self, openset=False): FILE: long-tailed_recognition/BalancedSoftmax/utils.py class CosineAnnealingLRWarmup (line 26) | class CosineAnnealingLRWarmup(_LRScheduler): method __init__ (line 30) | def __init__(self, optimizer, T_max, eta_min=0, last_epoch=-1, warmup_... method get_cos_lr (line 38) | def get_cos_lr(self): method get_warmup_lr (line 44) | def get_warmup_lr(self): method get_lr (line 49) | def get_lr(self): function source_import (line 57) | def source_import(file_path): function batch_show (line 64) | def batch_show(inp, title=None): function print_write (line 76) | def print_write(print_str, log_file): function init_weights (line 83) | def init_weights(model, weights_path, caffe=False, classifier=False): function shot_acc (line 103) | def shot_acc (preds, labels, train_data, many_shot_thr=100, low_shot_thr... function weighted_shot_acc (line 149) | def weighted_shot_acc (preds, labels, ws, train_data, many_shot_thr=100,... function F_measure (line 180) | def F_measure(preds, labels, openset=False, theta=None): function mic_acc_cal (line 200) | def mic_acc_cal(preds, labels): function weighted_mic_acc_cal (line 211) | def weighted_mic_acc_cal(preds, labels, ws): function class_count (line 215) | def class_count (data): function torch2numpy (line 237) | def torch2numpy(x): function logits2score (line 245) | def logits2score(logits, labels): function logits2entropy (line 252) | def logits2entropy(logits): function logits2CE (line 260) | def logits2CE(logits, labels): function get_priority (line 268) | def get_priority(ptype, logits, labels): function get_value (line 278) | def get_value(oldv, newv): FILE: long-tailed_recognition/RIDE-LongTailRecognition/base/base_data_loader.py class BaseDataLoader (line 7) | class BaseDataLoader(DataLoader): method __init__ (line 11) | def __init__(self, dataset, batch_size, shuffle, validation_split, num... method _split_sampler (line 29) | def _split_sampler(self, split): method split_validation (line 57) | def split_validation(self): FILE: long-tailed_recognition/RIDE-LongTailRecognition/base/base_model.py class BaseModel (line 6) | class BaseModel(nn.Module): method forward (line 11) | def forward(self, *inputs): FILE: long-tailed_recognition/RIDE-LongTailRecognition/base/base_trainer.py class BaseTrainer (line 8) | class BaseTrainer: method __init__ (line 12) | def __init__(self, model, criterion, metric_ftns, optimizer, config, d... method _train_epoch (line 70) | def _train_epoch(self, epoch): method train (line 78) | def train(self): method train_dist (line 124) | def train_dist(self, args, ngpus_per_node): method _prepare_device (line 171) | def _prepare_device(self, n_gpu_use): method _save_checkpoint (line 188) | def _save_checkpoint(self, epoch, save_best=False, best_only=False, ch... method _load_crt (line 219) | def _load_crt(self, cRT_pretrain): method _resume_checkpoint (line 242) | def _resume_checkpoint(self, resume_path, state_dict_only=False): FILE: long-tailed_recognition/RIDE-LongTailRecognition/data_loader/cifar_data_loaders.py class CIFAR100DataLoader (line 11) | class CIFAR100DataLoader(DataLoader): method __init__ (line 15) | def __init__(self, data_dir, batch_size, shuffle=True, num_workers=1, ... method split_validation (line 54) | def split_validation(self): class BalancedSampler (line 60) | class BalancedSampler(Sampler): method __init__ (line 61) | def __init__(self, buckets, retain_epoch_size=False): method __iter__ (line 70) | def __iter__(self): method _next_item (line 76) | def _next_item(self): method __len__ (line 86) | def __len__(self): class ImbalanceCIFAR100DataLoader (line 92) | class ImbalanceCIFAR100DataLoader(DataLoader): method __init__ (line 96) | def __init__(self, data_dir, batch_size, shuffle=True, num_workers=1, ... method split_validation (line 152) | def split_validation(self): class ImbalanceCIFAR10DataLoader (line 158) | class ImbalanceCIFAR10DataLoader(DataLoader): method __init__ (line 162) | def __init__(self, data_dir, batch_size, shuffle=True, num_workers=1, ... method split_validation (line 217) | def split_validation(self): FILE: long-tailed_recognition/RIDE-LongTailRecognition/data_loader/imagenet_lt_data_loaders.py class BalancedSampler (line 10) | class BalancedSampler(Sampler): method __init__ (line 11) | def __init__(self, buckets, retain_epoch_size=False): method __iter__ (line 20) | def __iter__(self): method _next_item (line 26) | def _next_item(self): method __len__ (line 36) | def __len__(self): class LT_Dataset (line 42) | class LT_Dataset(Dataset): method __init__ (line 44) | def __init__(self, root, txt, transform=None): method __len__ (line 54) | def __len__(self): method __getitem__ (line 57) | def __getitem__(self, index): class ImageNetLTDataLoader (line 71) | class ImageNetLTDataLoader(DataLoader): method __init__ (line 75) | def __init__(self, data_dir, batch_size, shuffle=True, num_workers=1, ... method split_validation (line 136) | def split_validation(self): FILE: long-tailed_recognition/RIDE-LongTailRecognition/data_loader/imbalance_cifar.py class IMBALANCECIFAR10 (line 7) | class IMBALANCECIFAR10(torchvision.datasets.CIFAR10): method __init__ (line 10) | def __init__(self, root, imb_type='exp', imb_factor=0.01, rand_number=... method get_img_num_per_cls (line 18) | def get_img_num_per_cls(self, cls_num, imb_type, imb_factor): method gen_imbalanced_data (line 34) | def gen_imbalanced_data(self, img_num_per_cls): method get_cls_num_list (line 52) | def get_cls_num_list(self): class IMBALANCECIFAR100 (line 58) | class IMBALANCECIFAR100(IMBALANCECIFAR10): FILE: long-tailed_recognition/RIDE-LongTailRecognition/data_loader/inaturalist_data_loaders.py class BalancedSampler (line 10) | class BalancedSampler(Sampler): method __init__ (line 11) | def __init__(self, buckets, retain_epoch_size=False): method __iter__ (line 20) | def __iter__(self): method _next_item (line 26) | def _next_item(self): method __len__ (line 36) | def __len__(self): class LT_Dataset (line 42) | class LT_Dataset(Dataset): method __init__ (line 44) | def __init__(self, root, txt, transform=None): method __len__ (line 54) | def __len__(self): method __getitem__ (line 57) | def __getitem__(self, index): class iNaturalistDataLoader (line 71) | class iNaturalistDataLoader(DataLoader): method __init__ (line 75) | def __init__(self, data_dir, batch_size, shuffle=True, num_workers=1, ... method split_validation (line 135) | def split_validation(self): FILE: long-tailed_recognition/RIDE-LongTailRecognition/logger/logger.py function setup_logging (line 7) | def setup_logging(save_dir, log_config='logger/logger_config.json', defa... FILE: long-tailed_recognition/RIDE-LongTailRecognition/logger/visualization.py class TensorboardWriter (line 5) | class TensorboardWriter(): method __init__ (line 6) | def __init__(self, log_dir, logger, enabled): method set_step (line 40) | def set_step(self, step, mode='train'): method __getattr__ (line 50) | def __getattr__(self, name): FILE: long-tailed_recognition/RIDE-LongTailRecognition/model/fb_resnets/EAResNeXt.py function conv3x3 (line 21) | def conv3x3(in_planes, out_planes, stride=1): class NormedLinear (line 26) | class NormedLinear(nn.Module): method __init__ (line 28) | def __init__(self, in_features, out_features): method forward (line 33) | def forward(self, x): class BasicBlock (line 37) | class BasicBlock(nn.Module): method __init__ (line 40) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 50) | def forward(self, x): class Bottleneck (line 68) | class Bottleneck(nn.Module): method __init__ (line 71) | def __init__(self, inplanes, planes, stride=1, downsample=None, method forward (line 87) | def forward(self, x): class ResNext (line 109) | class ResNext(nn.Module): method __init__ (line 111) | def __init__(self, block, layers, num_experts, groups=1, width_per_gro... method _hook_before_iter (line 194) | def _hook_before_iter(self): method _make_layer (line 206) | def _make_layer(self, block, planes, blocks, stride=1, is_last=False): method _separate_part (line 226) | def _separate_part(self, x, ind): method pred_expert_help (line 245) | def pred_expert_help(self, input_part, i): method forward (line 260) | def forward(self, x, target=None): FILE: long-tailed_recognition/RIDE-LongTailRecognition/model/fb_resnets/EAResNet.py function conv3x3 (line 21) | def conv3x3(in_planes, out_planes, stride=1): class NormedLinear (line 26) | class NormedLinear(nn.Module): method __init__ (line 28) | def __init__(self, in_features, out_features): method forward (line 33) | def forward(self, x): class BasicBlock (line 37) | class BasicBlock(nn.Module): method __init__ (line 40) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 50) | def forward(self, x): class Bottleneck (line 68) | class Bottleneck(nn.Module): method __init__ (line 71) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 84) | def forward(self, x): class ResNet (line 106) | class ResNet(nn.Module): method __init__ (line 108) | def __init__(self, block, layers, num_experts, dropout=None, num_class... method _hook_before_iter (line 196) | def _hook_before_iter(self): method _make_layer (line 208) | def _make_layer(self, block, planes, blocks, stride=1): method _separate_part (line 225) | def _separate_part(self, x, ind): method pred_expert_help (line 248) | def pred_expert_help(self, input_part, i): method forward (line 263) | def forward(self, x, target=None): FILE: long-tailed_recognition/RIDE-LongTailRecognition/model/fb_resnets/RIDEResNeXt.py function conv3x3 (line 16) | def conv3x3(in_planes, out_planes, stride=1): class NormedLinear (line 21) | class NormedLinear(nn.Module): method __init__ (line 23) | def __init__(self, in_features, out_features): method forward (line 28) | def forward(self, x): class BasicBlock (line 32) | class BasicBlock(nn.Module): method __init__ (line 35) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 45) | def forward(self, x): class Bottleneck (line 63) | class Bottleneck(nn.Module): method __init__ (line 66) | def __init__(self, inplanes, planes, stride=1, downsample=None, method forward (line 82) | def forward(self, x): class ResNext (line 104) | class ResNext(nn.Module): method __init__ (line 106) | def __init__(self, block, layers, num_experts, groups=1, width_per_gro... method _hook_before_iter (line 170) | def _hook_before_iter(self): method _make_layer (line 182) | def _make_layer(self, block, planes, blocks, stride=1, is_last=False): method _separate_part (line 202) | def _separate_part(self, x, ind, target=None): method forward (line 222) | def forward(self, x, target=None): FILE: long-tailed_recognition/RIDE-LongTailRecognition/model/fb_resnets/RIDEResNet.py function conv3x3 (line 23) | def conv3x3(in_planes, out_planes, stride=1): class NormedLinear (line 28) | class NormedLinear(nn.Module): method __init__ (line 30) | def __init__(self, in_features, out_features): method forward (line 35) | def forward(self, x): class BasicBlock (line 39) | class BasicBlock(nn.Module): method __init__ (line 42) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 52) | def forward(self, x): class Bottleneck (line 70) | class Bottleneck(nn.Module): method __init__ (line 73) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 86) | def forward(self, x): class ResNet (line 108) | class ResNet(nn.Module): method __init__ (line 110) | def __init__(self, block, layers, num_experts, dropout=None, num_class... method _hook_before_iter (line 186) | def _hook_before_iter(self): method _make_layer (line 198) | def _make_layer(self, block, planes, blocks, stride=1): method _separate_part (line 215) | def _separate_part(self, x, ind, target=None): method forward (line 259) | def forward(self, x, target=None): FILE: long-tailed_recognition/RIDE-LongTailRecognition/model/fb_resnets/ResNeXt.py function conv3x3 (line 15) | def conv3x3(in_planes, out_planes, stride=1): class BasicBlock (line 20) | class BasicBlock(nn.Module): method __init__ (line 23) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 33) | def forward(self, x): class Bottleneck (line 51) | class Bottleneck(nn.Module): method __init__ (line 54) | def __init__(self, inplanes, planes, stride=1, downsample=None, method forward (line 70) | def forward(self, x): class ResNext (line 92) | class ResNext(nn.Module): method __init__ (line 94) | def __init__(self, block, layers, groups=1, width_per_group=64, dropou... method _hook_before_iter (line 146) | def _hook_before_iter(self): method _make_layer (line 158) | def _make_layer(self, block, planes, blocks, stride=1, is_last=False): method forward (line 178) | def forward(self, x, target=None): FILE: long-tailed_recognition/RIDE-LongTailRecognition/model/fb_resnets/ResNet.py function conv3x3 (line 24) | def conv3x3(in_planes, out_planes, stride=1): class NormedLinear (line 30) | class NormedLinear(nn.Module): method __init__ (line 32) | def __init__(self, in_features, out_features): method forward (line 37) | def forward(self, x): class BasicBlock (line 41) | class BasicBlock(nn.Module): method __init__ (line 44) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 54) | def forward(self, x): class Bottleneck (line 72) | class Bottleneck(nn.Module): method __init__ (line 75) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 88) | def forward(self, x): class ResNet (line 110) | class ResNet(nn.Module): method __init__ (line 112) | def __init__(self, block, layers, dropout=None, num_classes=1000, use_... method _hook_before_iter (line 196) | def _hook_before_iter(self): method _make_layer (line 208) | def _make_layer(self, block, planes, blocks, stride=1): method forward (line 225) | def forward(self, x, target=None): FILE: long-tailed_recognition/RIDE-LongTailRecognition/model/fb_resnets/__init__.py function obtain_global_models (line 3) | def obtain_global_models(add_bt, output_dim): FILE: long-tailed_recognition/RIDE-LongTailRecognition/model/ldam_drw_resnets/ea_resnet_cifar.py function _weights_init (line 33) | def _weights_init(m): class NormedLinear (line 38) | class NormedLinear(nn.Module): method __init__ (line 40) | def __init__(self, in_features, out_features): method forward (line 45) | def forward(self, x): class LambdaLayer (line 49) | class LambdaLayer(nn.Module): method __init__ (line 51) | def __init__(self, lambd): method forward (line 55) | def forward(self, x): class BasicBlock (line 59) | class BasicBlock(nn.Module): method __init__ (line 62) | def __init__(self, in_planes, planes, stride=1, option='A'): method forward (line 87) | def forward(self, x): class ResNet_s (line 95) | class ResNet_s(nn.Module): method __init__ (line 97) | def __init__(self, block, num_blocks, num_experts, num_classes=10, red... method _make_layer (line 160) | def _make_layer(self, block, planes, num_blocks, stride): method _hook_before_iter (line 170) | def _hook_before_iter(self): method _separate_part (line 182) | def _separate_part(self, x, ind): method pred_expert_help (line 194) | def pred_expert_help(self, input_part, i): method forward (line 209) | def forward(self, x, target=None): function resnet20 (line 252) | def resnet20(): function resnet32 (line 256) | def resnet32(num_classes=10, use_norm=False): function resnet44 (line 260) | def resnet44(): function resnet56 (line 264) | def resnet56(): function resnet110 (line 268) | def resnet110(): function resnet1202 (line 272) | def resnet1202(): function test (line 276) | def test(net): FILE: long-tailed_recognition/RIDE-LongTailRecognition/model/ldam_drw_resnets/resnet_cifar.py function _weights_init (line 33) | def _weights_init(m): class NormedLinear (line 38) | class NormedLinear(nn.Module): method __init__ (line 40) | def __init__(self, in_features, out_features): method forward (line 45) | def forward(self, x): class LambdaLayer (line 49) | class LambdaLayer(nn.Module): method __init__ (line 51) | def __init__(self, lambd): method forward (line 55) | def forward(self, x): class BasicBlock (line 59) | class BasicBlock(nn.Module): method __init__ (line 62) | def __init__(self, in_planes, planes, stride=1, option='A'): method forward (line 87) | def forward(self, x): class ResNet_s (line 95) | class ResNet_s(nn.Module): method __init__ (line 97) | def __init__(self, block, num_blocks, num_classes=10, reduce_dimension... method _make_layer (line 134) | def _make_layer(self, block, planes, num_blocks, stride): method _hook_before_iter (line 143) | def _hook_before_iter(self): method forward (line 155) | def forward(self, x): function resnet20 (line 173) | def resnet20(): function resnet32 (line 177) | def resnet32(num_classes=10, use_norm=False): function resnet44 (line 181) | def resnet44(): function resnet56 (line 185) | def resnet56(): function resnet110 (line 189) | def resnet110(): function resnet1202 (line 193) | def resnet1202(): function test (line 197) | def test(net): FILE: long-tailed_recognition/RIDE-LongTailRecognition/model/ldam_drw_resnets/ride_resnet_cifar.py function _weights_init (line 35) | def _weights_init(m): class NormedLinear (line 40) | class NormedLinear(nn.Module): method __init__ (line 42) | def __init__(self, in_features, out_features): method forward (line 47) | def forward(self, x): class LambdaLayer (line 51) | class LambdaLayer(nn.Module): method __init__ (line 53) | def __init__(self, lambd): method forward (line 57) | def forward(self, x): class BasicBlock (line 61) | class BasicBlock(nn.Module): method __init__ (line 64) | def __init__(self, in_planes, planes, stride=1, option='A'): method forward (line 89) | def forward(self, x): class ResNet_s (line 97) | class ResNet_s(nn.Module): method __init__ (line 99) | def __init__(self, block, num_blocks, num_experts, num_classes=10, red... method _make_layer (line 153) | def _make_layer(self, block, planes, num_blocks, stride): method _hook_before_iter (line 163) | def _hook_before_iter(self): method _separate_part (line 175) | def _separate_part(self, x, ind, target=None): method forward (line 199) | def forward(self, x, target=None): function resnet20 (line 238) | def resnet20(): function resnet32 (line 242) | def resnet32(num_classes=10, use_norm=False): function resnet44 (line 246) | def resnet44(): function resnet56 (line 250) | def resnet56(): function resnet110 (line 254) | def resnet110(): function resnet1202 (line 258) | def resnet1202(): function test (line 262) | def test(net): FILE: long-tailed_recognition/RIDE-LongTailRecognition/model/loss.py function focal_loss (line 16) | def focal_loss(input_values, gamma): class FocalLoss (line 22) | class FocalLoss(nn.Module): method __init__ (line 23) | def __init__(self, cls_num_list=None, weight=None, gamma=0.): method _hook_before_epoch (line 29) | def _hook_before_epoch(self, epoch): method forward (line 32) | def forward(self, output_logits, target): class CrossEntropyLoss (line 35) | class CrossEntropyLoss(nn.Module): method __init__ (line 36) | def __init__(self, cls_num_list=None, reweight_CE=False): method to (line 48) | def to(self, device): method forward (line 55) | def forward(self, output_logits, target): # output is logits class LDAMLoss (line 58) | class LDAMLoss(nn.Module): method __init__ (line 59) | def __init__(self, cls_num_list=None, max_m=0.5, s=30, reweight_epoch=... method to (line 83) | def to(self, device): method _hook_before_epoch (line 93) | def _hook_before_epoch(self, epoch): method get_final_output (line 102) | def get_final_output(self, output_logits, target): method forward (line 117) | def forward(self, output_logits, target): function soft_label_loss (line 124) | def soft_label_loss(outputs, targets, weight=None): class RIDELoss (line 133) | class RIDELoss(nn.Module): method __init__ (line 134) | def __init__(self, cls_num_list=None, base_diversity_temperature=1.0, ... method to (line 186) | def to(self, device): method _hook_before_epoch (line 199) | def _hook_before_epoch(self, epoch): method get_final_output (line 210) | def get_final_output(self, output_logits, target): method forward (line 225) | def forward(self, output_logits, target, extra_info=None): class RIDELossWithDistill (line 264) | class RIDELossWithDistill(nn.Module): method __init__ (line 265) | def __init__(self, cls_num_list=None, additional_distill_loss_factor=1... method to (line 273) | def to(self, device): method _hook_before_epoch (line 278) | def _hook_before_epoch(self, epoch): method forward (line 281) | def forward(self, student, target=None, teacher=None, extra_info=None): FILE: long-tailed_recognition/RIDE-LongTailRecognition/model/metric.py function accuracy (line 3) | def accuracy(output, target, return_length=False): function top_k_acc (line 14) | def top_k_acc(output, target, k=5, return_length=False): FILE: long-tailed_recognition/RIDE-LongTailRecognition/model/model.py class Model (line 15) | class Model(BaseModel): method __init__ (line 18) | def __init__(self, num_classes, backbone_class=None): method _hook_before_iter (line 23) | def _hook_before_iter(self): method forward (line 26) | def forward(self, x, mode=None, target=None): class EAModel (line 32) | class EAModel(BaseModel): method __init__ (line 36) | def __init__(self, num_classes, backbone_class=None): method _hook_before_iter (line 41) | def _hook_before_iter(self): method forward (line 44) | def forward(self, x, mode=None, target=None): class ResNet10Model (line 52) | class ResNet10Model(Model): method __init__ (line 53) | def __init__(self, num_classes, reduce_dimension=False, layer3_output_... class ResNet10EAModel (line 60) | class ResNet10EAModel(EAModel): method __init__ (line 61) | def __init__(self, num_classes, reduce_dimension=False, layer3_output_... class ResNet32Model (line 65) | class ResNet32Model(Model): # From LDAM_DRW method __init__ (line 66) | def __init__(self, num_classes, reduce_dimension=False, layer2_output_... class ResNet32EAModel (line 73) | class ResNet32EAModel(EAModel): # From LDAM_DRW method __init__ (line 74) | def __init__(self, num_classes, reduce_dimension=False, layer2_output_... class ResNet50Model (line 78) | class ResNet50Model(Model): method __init__ (line 79) | def __init__(self, num_classes, reduce_dimension=False, layer3_output_... class ResNet50EAModel (line 86) | class ResNet50EAModel(EAModel): method __init__ (line 87) | def __init__(self, num_classes, reduce_dimension=False, layer3_output_... class ResNeXt50EAModel (line 92) | class ResNeXt50EAModel(EAModel): method __init__ (line 93) | def __init__(self, num_classes, reduce_dimension=False, layer3_output_... class ResNeXt50Model (line 98) | class ResNeXt50Model(Model): method __init__ (line 99) | def __init__(self, num_classes, reduce_dimension=False, layer3_output_... class ResNet101Model (line 106) | class ResNet101Model(Model): method __init__ (line 107) | def __init__(self, num_classes, reduce_dimension=False, layer3_output_... class ResNet152Model (line 114) | class ResNet152Model(Model): method __init__ (line 115) | def __init__(self, num_classes, reduce_dimension=False, layer3_output_... class ResNet152EAModel (line 122) | class ResNet152EAModel(EAModel): method __init__ (line 123) | def __init__(self, num_classes, reduce_dimension=False, layer3_output_... class ResNeXt152Model (line 128) | class ResNeXt152Model(Model): method __init__ (line 129) | def __init__(self, num_classes, reduce_dimension=False, layer3_output_... FILE: long-tailed_recognition/RIDE-LongTailRecognition/parse_config.py class ConfigParser (line 11) | class ConfigParser: method __init__ (line 12) | def __init__(self, config, resume=None, modification=None, load_crt=No... method from_args (line 54) | def from_args(cls, args, options=''): method init_obj (line 89) | def init_obj(self, name, module, *args, allow_override=False, **kwargs): method init_ftn (line 105) | def init_ftn(self, name, module, *args, **kwargs): method __getitem__ (line 120) | def __getitem__(self, name): method get_logger (line 124) | def get_logger(self, name, verbosity=2): method config (line 133) | def config(self): method save_dir (line 137) | def save_dir(self): method log_dir (line 141) | def log_dir(self): function _update_config (line 145) | def _update_config(config, modification): function _get_opt_name (line 154) | def _get_opt_name(flags): function _set_by_path (line 160) | def _set_by_path(tree, keys, value): function _get_by_path (line 165) | def _get_by_path(tree, keys): FILE: long-tailed_recognition/RIDE-LongTailRecognition/run.py function parse_args (line 27) | def parse_args(): FILE: long-tailed_recognition/RIDE-LongTailRecognition/run_imagenet.py function parse_args (line 24) | def parse_args(): FILE: long-tailed_recognition/RIDE-LongTailRecognition/t-normalization.py function pnorm (line 22) | def pnorm(weights, p): function parallel (line 31) | def parallel(key): FILE: long-tailed_recognition/RIDE-LongTailRecognition/test.py function main (line 14) | def main(config): FILE: long-tailed_recognition/RIDE-LongTailRecognition/train.py function main (line 26) | def main(config, args): FILE: long-tailed_recognition/RIDE-LongTailRecognition/train_dist.py function main (line 26) | def main(config, args): FILE: long-tailed_recognition/RIDE-LongTailRecognition/trainer/trainer.py class Trainer (line 8) | class Trainer(BaseTrainer): method __init__ (line 12) | def __init__(self, model, criterion, metric_ftns, optimizer, config, d... method _train_epoch (line 76) | def _train_epoch(self, epoch): method cal_loss (line 187) | def cal_loss(self, extra_info, loss, output, target, teacher): method _valid_epoch (line 213) | def _valid_epoch(self, epoch): method _progress (line 257) | def _progress(self, batch_idx): FILE: long-tailed_recognition/RIDE-LongTailRecognition/utils/gflops.py function gflops_normed_linear (line 53) | def gflops_normed_linear(m, x, y): FILE: long-tailed_recognition/RIDE-LongTailRecognition/utils/util.py class Autocast (line 15) | class Autocast(): # This is a dummy autocast class method __init__ (line 16) | def __init__(self): method __enter__ (line 18) | def __enter__(self, *args, **kwargs): method __call__ (line 20) | def __call__(self, arg=None): method __exit__ (line 24) | def __exit__(self, *args, **kwargs): function rename_parallel_state_dict (line 29) | def rename_parallel_state_dict(state_dict): function load_state_dict (line 41) | def load_state_dict(model, state_dict, no_ignore=False): function ensure_dir (line 68) | def ensure_dir(dirname): function read_json (line 73) | def read_json(fname): function write_json (line 78) | def write_json(content, fname): function inf_loop (line 83) | def inf_loop(data_loader): class MetricTracker (line 88) | class MetricTracker: method __init__ (line 89) | def __init__(self, *keys, writer=None): method reset (line 94) | def reset(self): method update (line 98) | def update(self, key, value, n=1): method avg (line 107) | def avg(self, key): method result (line 110) | def result(self): FILE: moco-v3/main_lincls.py function main (line 96) | def main(): function main_worker (line 131) | def main_worker(gpu, ngpus_per_node, args): function train (line 331) | def train(train_loader, model, criterion, optimizer, epoch, args): function validate (line 384) | def validate(val_loader, model, criterion, args): function save_checkpoint (line 429) | def save_checkpoint(state, is_best, filename='checkpoint.pth.tar'): function sanity_check (line 435) | def sanity_check(state_dict, pretrained_weights, linear_keyword): class AverageMeter (line 459) | class AverageMeter(object): method __init__ (line 461) | def __init__(self, name, fmt=':f'): method reset (line 466) | def reset(self): method update (line 472) | def update(self, val, n=1): method __str__ (line 478) | def __str__(self): class ProgressMeter (line 483) | class ProgressMeter(object): method __init__ (line 484) | def __init__(self, num_batches, meters, prefix=""): method display (line 489) | def display(self, batch): method _get_batch_fmtstr (line 494) | def _get_batch_fmtstr(self, num_batches): function adjust_learning_rate (line 500) | def adjust_learning_rate(optimizer, init_lr, epoch, args): function accuracy (line 507) | def accuracy(output, target, topk=(1,)): FILE: moco-v3/main_moco.py function main (line 122) | def main(): function main_worker (line 157) | def main_worker(gpu, ngpus_per_node, args): function train (line 322) | def train(train_loader, model, optimizer, scaler, summary_writer, epoch,... function save_checkpoint (line 374) | def save_checkpoint(state, is_best, filename='checkpoint.pth.tar'): class AverageMeter (line 380) | class AverageMeter(object): method __init__ (line 382) | def __init__(self, name, fmt=':f'): method reset (line 387) | def reset(self): method update (line 393) | def update(self, val, n=1): method __str__ (line 399) | def __str__(self): class ProgressMeter (line 404) | class ProgressMeter(object): method __init__ (line 405) | def __init__(self, num_batches, meters, prefix=""): method display (line 410) | def display(self, batch): method _get_batch_fmtstr (line 415) | def _get_batch_fmtstr(self, num_batches): function adjust_learning_rate (line 421) | def adjust_learning_rate(optimizer, epoch, args): function adjust_moco_momentum (line 432) | def adjust_moco_momentum(epoch, args): FILE: moco-v3/moco/builder.py class TransformerDecorator (line 10) | class TransformerDecorator(torch.nn.Module): method __init__ (line 11) | def __init__(self, add_bf=3, dim=2048, eval_global=0): method forward (line 17) | def forward(self, feature): class MoCo (line 36) | class MoCo(nn.Module): method __init__ (line 41) | def __init__(self, base_encoder, dim=256, mlp_dim=4096, T=1.0, arch='r... method _build_mlp (line 66) | def _build_mlp(self, num_layers, input_dim, mlp_dim, output_dim, last_... method _build_projector_and_predictor_mlps (line 86) | def _build_projector_and_predictor_mlps(self, dim, mlp_dim, encoder_gl... method _update_momentum_encoder (line 91) | def _update_momentum_encoder(self, m): method contrastive_loss (line 98) | def contrastive_loss(self, q, k): method forward (line 110) | def forward(self, x1, x2, m): class MoCo_ResNet (line 154) | class MoCo_ResNet(MoCo): method _build_projector_and_predictor_mlps (line 155) | def _build_projector_and_predictor_mlps(self, dim, mlp_dim, encoder_gl... method _get_dim (line 166) | def _get_dim(self): class MoCo_ViT (line 169) | class MoCo_ViT(MoCo): method _build_projector_and_predictor_mlps (line 170) | def _build_projector_and_predictor_mlps(self, dim, mlp_dim, encoder_gl... method _get_dim (line 181) | def _get_dim(self): function concat_all_gather (line 186) | def concat_all_gather(tensor): FILE: moco-v3/moco/builder_v2.py class TransformerDecorator (line 5) | class TransformerDecorator(torch.nn.Module): method __init__ (line 6) | def __init__(self, add_bf=0, dim=2048): method forward (line 11) | def forward(self, feature): class MoCo (line 27) | class MoCo(nn.Module): method __init__ (line 32) | def __init__(self, base_encoder, dim=128, K=65536, m=0.999, T=0.07, ml... method _momentum_update_key_encoder (line 84) | def _momentum_update_key_encoder(self): method _dequeue_and_enqueue (line 99) | def _dequeue_and_enqueue(self, keys): method _batch_shuffle_ddp (line 115) | def _batch_shuffle_ddp(self, x): method _batch_unshuffle_ddp (line 143) | def _batch_unshuffle_ddp(self, x, idx_unshuffle): method forward (line 161) | def forward(self, im_q, im_k): function concat_all_gather (line 224) | def concat_all_gather(tensor): FILE: moco-v3/moco/loader.py class TwoCropsTransform (line 12) | class TwoCropsTransform: method __init__ (line 15) | def __init__(self, base_transform1, base_transform2): method __call__ (line 19) | def __call__(self, x): class GaussianBlur (line 25) | class GaussianBlur(object): method __init__ (line 28) | def __init__(self, sigma=[.1, 2.]): method __call__ (line 31) | def __call__(self, x): class Solarize (line 37) | class Solarize(object): method __call__ (line 40) | def __call__(self, x): FILE: moco-v3/moco/optimizer.py class LARS (line 9) | class LARS(torch.optim.Optimizer): method __init__ (line 13) | def __init__(self, params, lr=0, weight_decay=0, momentum=0.9, trust_c... method step (line 18) | def step(self): FILE: moco-v3/transfer/datasets.py function build_transform (line 18) | def build_transform(is_train, args): function build_dataset (line 34) | def build_dataset(is_train, args): FILE: moco-v3/transfer/oxford_flowers_dataset.py class Flowers (line 20) | class Flowers(VisionDataset): method __init__ (line 22) | def __init__( method __getitem__ (line 53) | def __getitem__(self, index): method __len__ (line 66) | def __len__(self): FILE: moco-v3/transfer/oxford_pets_dataset.py class Pets (line 19) | class Pets(VisionDataset): method __init__ (line 21) | def __init__( method __getitem__ (line 48) | def __getitem__(self, index: int) -> Tuple[Any, Any]: method __len__ (line 66) | def __len__(self) -> int: FILE: moco-v3/vits.py class VisionTransformerMoCo (line 25) | class VisionTransformerMoCo(VisionTransformer): method __init__ (line 26) | def __init__(self, stop_grad_conv1=False, **kwargs): method build_2d_sincos_position_embedding (line 53) | def build_2d_sincos_position_embedding(self, temperature=10000.): class ConvStem (line 72) | class ConvStem(nn.Module): method __init__ (line 76) | def __init__(self, img_size=224, patch_size=16, in_chans=3, embed_dim=... method forward (line 104) | def forward(self, x): function vit_small (line 115) | def vit_small(**kwargs): function vit_base (line 122) | def vit_base(**kwargs): function vit_conv_small (line 129) | def vit_conv_small(**kwargs): function vit_conv_base (line 137) | def vit_conv_base(**kwargs):