repo stringlengths 1 99 | file stringlengths 13 215 | code stringlengths 12 59.2M | file_length int64 12 59.2M | avg_line_length float64 3.82 1.48M | max_line_length int64 12 2.51M | extension_type stringclasses 1
value |
|---|---|---|---|---|---|---|
spurious_feature_learning | spurious_feature_learning-main/group_DRO/gdro_data/data.py | import os
import torch
import numpy as np
from torch.utils.data import Subset
from gdro_data.label_shift_utils import prepare_label_shift_data
from gdro_data.confounder_utils import prepare_confounder_data
root_dir = '/data/users/polina_k/datasets/'
dataset_attributes = {
'CelebA': {
'root_dir': 'celebA'
... | 1,885 | 35.980392 | 130 | py |
spurious_feature_learning | spurious_feature_learning-main/group_DRO/gdro_data/cub_dataset.py | import os
import torch
import pandas as pd
from PIL import Image
import numpy as np
import torchvision.transforms as transforms
from gdro_models import model_attributes
from torch.utils.data import Dataset, Subset
from gdro_data.confounder_dataset import ConfounderDataset
class CUBDataset(ConfounderDataset):
"""
... | 3,749 | 35.057692 | 115 | py |
spurious_feature_learning | spurious_feature_learning-main/group_DRO/gdro_data/label_shift_utils.py | import os
import torch
import pandas as pd
from PIL import Image
import numpy as np
import torchvision
import torchvision.transforms as transforms
from gdro_models import model_attributes
from torch.utils.data import Dataset, Subset
from gdro_data.dro_dataset import DRODataset
from gdro_data.utils import *
from gdro_da... | 3,103 | 30.673469 | 124 | py |
spurious_feature_learning | spurious_feature_learning-main/group_DRO/gdro_data/torchvision_datasets.py | import torch
from torch.utils.data import Subset
import torchvision
import torchvision.transforms as transforms
from gdro_models import model_attributes
from gdro_data.utils import *
### CIFAR10 ###
def load_CIFAR10(args, train):
transform = get_transform_CIFAR10(args, train)
dataset = torchvision.datasets.CIF... | 1,018 | 35.392857 | 100 | py |
spurious_feature_learning | spurious_feature_learning-main/group_DRO/gdro_data/dfr_datasets.py | from collections import namedtuple
import sys
sys.path.append("../")
import data as dfr_data
from torch.utils.data import DataLoader
import types
DatasetArgs = namedtuple("DatasetArgs", "data_transform dataset")
DFR_DATA_ARGS = {
"CelebA": DatasetArgs(
"AugWaterbirdsCelebATransform", "SpuriousCorrelation... | 3,184 | 30.534653 | 90 | py |
spurious_feature_learning | spurious_feature_learning-main/group_DRO/gdro_data/dro_dataset.py | import torch
import numpy as np
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.sampler import WeightedRandomSampler
class DRODataset(Dataset):
def __init__(self, dataset, process_item_fn, n_groups, n_classes, group_str_fn):
self.dataset = dataset
self.process_item = process_... | 2,608 | 36.271429 | 105 | py |
spurious_feature_learning | spurious_feature_learning-main/group_DRO/gdro_data/celebA_dataset.py | import os
import torch
import pandas as pd
from PIL import Image
import numpy as np
import torchvision.transforms as transforms
from gdro_models import model_attributes
from torch.utils.data import Dataset, Subset
from gdro_data.confounder_dataset import ConfounderDataset
class CelebADataset(ConfounderDataset):
""... | 4,316 | 38.605505 | 115 | py |
spurious_feature_learning | spurious_feature_learning-main/group_DRO/gdro_data/multinli_dataset.py | import os
import torch
import pandas as pd
from PIL import Image
import numpy as np
import torchvision.transforms as transforms
from gdro_models import model_attributes
from torch.utils.data import Dataset, Subset
from gdro_data.confounder_dataset import ConfounderDataset
class MultiNLIDataset(ConfounderDataset):
... | 4,278 | 33.232 | 110 | py |
spurious_feature_learning | spurious_feature_learning-main/models/vissl_models.py | """Load models from the VISSL package.
Code adapted from
https://github.com/facebookresearch/vissl/blob/main/extra_scripts/convert_vissl_to_torchvision.py
"""
import torch
import torchvision
from torch.hub import load_state_dict_from_url
from .model_utils import _replace_fc
SIMCLR_RN50_URL = "https://dl.fbaipublic... | 1,655 | 33.5 | 160 | py |
spurious_feature_learning | spurious_feature_learning-main/models/preresnet.py | """
PreResNet model definition
ported from https://github.com/bearpaw/pytorch-classification/blob/master/models/cifar/preresnet.py
"""
import torch.nn as nn
import torch.nn.functional as F
import math
def freeze_batchnorm(net):
for m in net.modules():
if isinstance(m, nn.BatchNorm2d):
... | 5,685 | 30.071038 | 104 | py |
spurious_feature_learning | spurious_feature_learning-main/models/model_utils.py | import torch
def _replace_fc(model, output_dim):
d = model.fc.in_features
model.fc = torch.nn.Linear(d, output_dim)
return model
class MultiTaskHead(torch.nn.Module):
def __init__(self, n_features, n_classes_list):
super(MultiTaskHead, self).__init__()
self.fc_list = [
tor... | 579 | 25.363636 | 57 | py |
spurious_feature_learning | spurious_feature_learning-main/models/text_models.py | from transformers import AlbertForSequenceClassification
from transformers import BertForSequenceClassification
from transformers import DebertaV2ForSequenceClassification
import types
import torch
def _bert_replace_fc(model):
model.fc = model.classifier
delattr(model, "classifier")
def classifier(self, ... | 2,020 | 30.578125 | 79 | py |
spurious_feature_learning | spurious_feature_learning-main/models/__init__.py | import sys
import torch
import torch.nn as nn
import torchvision
import types
import timm
#import mae.models_vit as mae
from .preresnet import PreResNet
from .text_models import albert_pretrained
from .text_models import bert_pretrained
from .text_models import bert_pretrained_multilingual
from .text_models import ber... | 15,225 | 35.252381 | 123 | py |
spurious_feature_learning | spurious_feature_learning-main/optimizers/__init__.py | import torch
import transformers
def sgd_optimizer_fromparams(params, lr, momentum, weight_decay):
optimizer = torch.optim.SGD(
params, lr=lr, momentum=momentum,
weight_decay=weight_decay)
return optimizer
def sgd_optimizer(model, lr, momentum, weight_decay):
return sgd_optimizer_frompa... | 1,777 | 25.147059 | 90 | py |
spurious_feature_learning | spurious_feature_learning-main/utils/logging_utils.py | import os
import torch
import numpy as np
import tqdm
import sys
import json
import torchvision
from torch.utils.tensorboard import SummaryWriter
try:
import wandb
has_wandb = True
except ImportError:
has_wandb = False
import utils
class Logger(object):
def __init__(self, fpath=None, mode='w'):
... | 3,540 | 28.508333 | 77 | py |
spurious_feature_learning | spurious_feature_learning-main/utils/contrastive_utils.py | """SimCLR implementation.
Adapted from https://github.com/p3i0t/SimCLR-CIFAR10/blob/master/simclr_lin.py
"""
import tqdm
import torch
import torch.nn.functional as F
import utils
def train_epoch(model, loader, optimizer, temp):
# TODO(izmailovpavel): add temperature
n_groups = loader.dataset.n_groups
cr... | 6,854 | 34.153846 | 80 | py |
spurious_feature_learning | spurious_feature_learning-main/utils/common_utils.py | import torch
import numpy as np
import tqdm
from . import logging_utils
import data
import argparse
from functools import partial
from torch.utils.data import DataLoader
class AverageMeter(object):
"""Computes and stores the average and current value"""
def __init__(self):
self.reset()
def reset... | 11,198 | 37.35274 | 97 | py |
spurious_feature_learning | spurious_feature_learning-main/utils/supervised_utils.py | import utils
from utils import AverageMeter
import tqdm
import torch
def train_epoch(model, loader, optimizer, criterion):
model.train()
loss_meter = AverageMeter()
n_groups = loader.dataset.n_groups
acc_groups = {g_idx: AverageMeter() for g_idx in range(n_groups)}
for batch in (pbar := tqdm... | 1,588 | 28.981132 | 97 | py |
spurious_feature_learning | spurious_feature_learning-main/data/dataloaders.py | import numpy as np
import torch
from torch.utils.data.sampler import WeightedRandomSampler
from torch.utils.data.dataloader import default_collate
from functools import partial
def mixup_batch(batch, num_classes, alpha=0.2):
x, y, g, s = batch
y = torch.nn.functional.one_hot(y, num_classes)
batch_size = x... | 1,683 | 31.384615 | 79 | py |
spurious_feature_learning | spurious_feature_learning-main/data/datasets.py | import os
import numpy as np
import pandas as pd
import torch
from PIL import Image
from torch.utils.data import Dataset
from torchvision.datasets import CIFAR10
try:
import wilds
from wilds.datasets.wilds_dataset import WILDSSubset
has_wilds = True
except:
has_wilds = False
def _get_split(split):
... | 14,013 | 36.571046 | 96 | py |
spurious_feature_learning | spurious_feature_learning-main/data/data_transforms.py | import torchvision.transforms as transforms
import einops
import torch
import math
from transformers import BertTokenizer
from transformers import DebertaV2Tokenizer
from transformers import AlbertTokenizer
from timm.data.random_erasing import RandomErasing
IMAGENET_STATS = ([0.485, 0.456, 0.406], [0.229, 0.224, 0.225... | 7,556 | 33.19457 | 92 | py |
spurious_feature_learning | spurious_feature_learning-main/data/augmix_transforms.py | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 7,065 | 32.971154 | 90 | py |
PowerGridworld | PowerGridworld-main/examples/marl/rllib/heterogeneous/args.py | import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--env-name", default="buildings", type=str)
parser.add_argument("--system-load-rescale-factor", default=0.6, type=float)
parser.add_argument("--max-episode-steps", default=250, type=int)
parser.add_argument("--local-dir", default="~/ray_result", ... | 971 | 47.6 | 87 | py |
PowerGridworld | PowerGridworld-main/examples/marl/rllib/heterogeneous/train.py | """Script for running single-machine training. If you want to run rllib on a
cluster see, e.g., https://docs.ray.io/en/latest/cluster/deploy.html."""
import ray
from ray import tune
from ray.tune.registry import register_env
from gridworld.log import logger
from gridworld.scenarios.heterogeneous import make_env_con... | 4,015 | 30.375 | 91 | py |
PowerGridworld | PowerGridworld-main/paper/fig3/args.py | import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--env-name", default="power-gridworld", type=str)
parser.add_argument("--system-load-rescale-factor", default=0.6, type=float)
parser.add_argument("--max-episode-steps", default=250, type=int)
parser.add_argument("--local-dir", default="~/ray_res... | 1,041 | 48.619048 | 87 | py |
PowerGridworld | PowerGridworld-main/paper/fig3/train.py | import os
import ray
from ray import tune
from ray.tune.registry import register_env
from gridworld.scenarios.heterogeneous import make_env_config
def env_creator(config: dict):
"""Simple wrapper that takes a config dict and returns an env instance."""
from gridworld import MultiAgentEnv
return Mu... | 3,761 | 28.390625 | 91 | py |
EARL | EARL-master/earl_trainer.py | import os
import torch
import pickle as pkl
from dataset import OneShotIterator, KGETrainDataset
from torch.utils.data import DataLoader
from torch import optim
from trainer import Trainer
import torch.nn as nn
from model import MLP, ConRelEncoder, MulHopEncoder
class EARLTrainer(Trainer):
def __init__(self, args... | 5,550 | 28.215789 | 110 | py |
EARL | EARL-master/utils.py | import dgl
import os
import logging
import torch
import numpy as np
import random
import pickle
# def get_g_dir(triples):
# triples = torch.LongTensor(triples)
# num_tri = triples.shape[0]
# g = dgl.graph((triples[:, 0].T, triples[:, 2].T))
# g.edata['rel'] = triples[:, 1].T
# g.edata['inv'] = tor... | 3,689 | 25.546763 | 125 | py |
EARL | EARL-master/model.py | import torch.nn as nn
import torch
from gnn import GNN
import dgl
import torch.nn.functional as F
class MLP(nn.Module):
def __init__(self, in_dim, hid_dim, out_dim):
super(MLP, self).__init__()
self.linear1 = nn.Linear(in_dim, hid_dim)
self.linear2 = nn.Linear(hid_dim, out_dim)
def fo... | 2,670 | 36.619718 | 98 | py |
EARL | EARL-master/dataset.py | import os
import numpy as np
import torch
from torch.utils.data import Dataset
from collections import defaultdict as ddict
import dgl
class Data(object):
def __init__(self, args):
self.data_path = args.data_path
self.entity2id, self.relation2id = self.get_ent_rel_map()
args.num_rel = le... | 8,104 | 34.862832 | 150 | py |
EARL | EARL-master/kge_model.py | import torch.nn as nn
import torch
class KGEModel(nn.Module):
def __init__(self, args):
super(KGEModel, self).__init__()
self.args = args
self.emb_dim = args.dim
self.epsilon = 2.0
self.gamma = torch.Tensor([args.gamma])
self.embedding_range = torch.Tensor([(self... | 5,686 | 32.25731 | 92 | py |
EARL | EARL-master/gnn.py | import torch.nn as nn
import torch
import dgl.function as fn
import torch.nn.functional as F
import dgl
class GNNLayer(nn.Module):
def __init__(self, args, node_dim, edge_dim, act=None, feat_drop=0, self_update=True):
super(GNNLayer, self).__init__()
self.args = args
self.act = act
... | 4,785 | 34.716418 | 113 | py |
EARL | EARL-master/trainer.py | from torch.utils.tensorboard import SummaryWriter
from utils import Log
import json
import os
import csv
import torch
from dataset import KGEEvalDataset, get_dataset_and_g
from torch.utils.data import DataLoader
from kge_model import KGEModel
import torch.nn.functional as F
from collections import defaultdict as ddict
... | 11,019 | 37.666667 | 120 | py |
NNFEM.jl | NNFEM.jl-master/research/Torch/CustomOp.py | """
Demo for Torch custom operators
Mat:
sigma = NN(eps) * eps
here NN outputs a 3 by 3 matrix
The result is not unique, W[3k + i,j] + W[3k + j,i] = Const. k,i,j=0,1,2
OrthMat:
sigma = NN(eps) * eps
here NN outputs a 3 by 3 orthotropic matrix with pattern
H0 H1 0
H1 H2 0
0 0 L3
CholOrthMat:
sigma = (NN(eps)*NN... | 5,836 | 25.292793 | 107 | py |
deeplab2 | deeplab2-main/trainer/evaluator.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 18,570 | 44.184915 | 80 | py |
deeplab2 | deeplab2-main/trainer/train_lib.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 9,869 | 42.672566 | 80 | py |
deeplab2 | deeplab2-main/trainer/runner_utils.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 8,493 | 38.506977 | 80 | py |
deeplab2 | deeplab2-main/trainer/trainer_utils.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 7,199 | 38.779006 | 127 | py |
deeplab2 | deeplab2-main/trainer/trainer.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 10,088 | 36.505576 | 80 | py |
deeplab2 | deeplab2-main/video/motion_deeplab.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 8,829 | 39.319635 | 80 | py |
deeplab2 | deeplab2-main/video/vip_deeplab.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 14,664 | 43.984663 | 80 | py |
deeplab2 | deeplab2-main/evaluation/panoptic_quality.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 11,565 | 40.905797 | 80 | py |
deeplab2 | deeplab2-main/evaluation/coco_instance_ap.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 13,276 | 37.821637 | 80 | py |
deeplab2 | deeplab2-main/evaluation/depth_metrics.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 4,225 | 38.867925 | 80 | py |
deeplab2 | deeplab2-main/utils/net_surgery_convert_last_layer.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 7,823 | 34.243243 | 115 | py |
deeplab2 | deeplab2-main/utils/test_utils.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 2,052 | 30.584615 | 74 | py |
deeplab2 | deeplab2-main/data/sample_generator_test.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 10,749 | 38.090909 | 80 | py |
deeplab2 | deeplab2-main/model/builder_test.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 3,005 | 36.111111 | 79 | py |
deeplab2 | deeplab2-main/model/utils.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 18,171 | 34.285437 | 95 | py |
deeplab2 | deeplab2-main/model/kmax_deeplab.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 10,096 | 41.42437 | 80 | py |
deeplab2 | deeplab2-main/model/deeplab.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 12,138 | 41.296167 | 143 | py |
deeplab2 | deeplab2-main/model/utils_test.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 8,186 | 39.529703 | 80 | py |
deeplab2 | deeplab2-main/model/builder.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 11,922 | 38.220395 | 80 | py |
deeplab2 | deeplab2-main/model/layers/positional_encodings.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 10,925 | 44.3361 | 138 | py |
deeplab2 | deeplab2-main/model/layers/axial_layers.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 22,470 | 42.130518 | 80 | py |
deeplab2 | deeplab2-main/model/layers/convolutions_test.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 10,022 | 33.443299 | 77 | py |
deeplab2 | deeplab2-main/model/layers/recompute_grad_test.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 9,695 | 37.023529 | 135 | py |
deeplab2 | deeplab2-main/model/layers/resized_fuse.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 7,240 | 42.620482 | 80 | py |
deeplab2 | deeplab2-main/model/layers/stems.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 3,810 | 32.429825 | 88 | py |
deeplab2 | deeplab2-main/model/layers/moat_blocks.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 20,707 | 36.788321 | 80 | py |
deeplab2 | deeplab2-main/model/layers/axial_block_groups.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 23,554 | 49.223881 | 80 | py |
deeplab2 | deeplab2-main/model/layers/convolutions.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 24,835 | 36.291291 | 107 | py |
deeplab2 | deeplab2-main/model/layers/axial_blocks.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 13,432 | 42.472492 | 80 | py |
deeplab2 | deeplab2-main/model/layers/dual_path_transformer.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 30,635 | 45.98773 | 80 | py |
deeplab2 | deeplab2-main/model/layers/recompute_grad.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 10,948 | 36.755172 | 119 | py |
deeplab2 | deeplab2-main/model/layers/squeeze_and_excite.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 6,769 | 35.203209 | 80 | py |
deeplab2 | deeplab2-main/model/layers/activations.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 3,425 | 24.759398 | 79 | py |
deeplab2 | deeplab2-main/model/layers/dual_path_transformer_test.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 4,527 | 41.716981 | 77 | py |
deeplab2 | deeplab2-main/model/layers/moat_attention.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 15,740 | 39.885714 | 80 | py |
deeplab2 | deeplab2-main/model/layers/drop_path.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 5,108 | 36.291971 | 80 | py |
deeplab2 | deeplab2-main/model/layers/blocks.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 7,947 | 36.140187 | 102 | py |
deeplab2 | deeplab2-main/model/encoder/axial_resnet.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 37,207 | 46.702564 | 80 | py |
deeplab2 | deeplab2-main/model/encoder/model_export_test.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 1,924 | 30.048387 | 74 | py |
deeplab2 | deeplab2-main/model/encoder/axial_resnet_instances_test.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 6,702 | 44.290541 | 115 | py |
deeplab2 | deeplab2-main/model/encoder/mobilenet_test.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 5,570 | 34.711538 | 80 | py |
deeplab2 | deeplab2-main/model/encoder/atrous_consistency_test.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 3,481 | 37.263736 | 80 | py |
deeplab2 | deeplab2-main/model/encoder/mobilenet.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 17,117 | 37.641084 | 80 | py |
deeplab2 | deeplab2-main/model/encoder/axial_resnet_instances.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 17,925 | 35.287449 | 111 | py |
deeplab2 | deeplab2-main/model/pixel_encoder/convnext_test.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 3,557 | 36.851064 | 77 | py |
deeplab2 | deeplab2-main/model/pixel_encoder/moat_test.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 6,522 | 36.924419 | 89 | py |
deeplab2 | deeplab2-main/model/pixel_encoder/moat.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 20,657 | 38.125 | 80 | py |
deeplab2 | deeplab2-main/model/pixel_encoder/axial_resnet.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 2,552 | 31.316456 | 74 | py |
deeplab2 | deeplab2-main/model/pixel_encoder/axial_resnet_test.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 2,236 | 35.080645 | 76 | py |
deeplab2 | deeplab2-main/model/pixel_encoder/convnext.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 7,339 | 33.78673 | 80 | py |
deeplab2 | deeplab2-main/model/transformer_decoder/kmax.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 8,090 | 40.706186 | 80 | py |
deeplab2 | deeplab2-main/model/transformer_decoder/kmax_test.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 3,054 | 37.670886 | 77 | py |
deeplab2 | deeplab2-main/model/loss/max_deeplab_loss.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 57,621 | 49.67898 | 80 | py |
deeplab2 | deeplab2-main/model/loss/loss_builder.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 11,380 | 42.273764 | 127 | py |
deeplab2 | deeplab2-main/model/loss/base_loss.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 27,773 | 38.677143 | 80 | py |
deeplab2 | deeplab2-main/model/post_processor/panoptic_deeplab.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 20,195 | 42.153846 | 99 | py |
deeplab2 | deeplab2-main/model/post_processor/max_deeplab.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 45,003 | 48.618523 | 80 | py |
deeplab2 | deeplab2-main/model/post_processor/vip_deeplab.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 14,766 | 43.613293 | 80 | py |
deeplab2 | deeplab2-main/model/post_processor/post_processor_builder.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 1,716 | 36.326087 | 76 | py |
deeplab2 | deeplab2-main/model/pixel_decoder/kmax.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 7,821 | 38.505051 | 80 | py |
deeplab2 | deeplab2-main/model/pixel_decoder/kmax_test.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 1,690 | 34.978723 | 74 | py |
deeplab2 | deeplab2-main/model/decoder/aspp.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 10,812 | 35.16388 | 80 | py |
deeplab2 | deeplab2-main/model/decoder/panoptic_deeplab.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 18,986 | 40.186551 | 80 | py |
deeplab2 | deeplab2-main/model/decoder/max_deeplab.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 15,656 | 40.975871 | 80 | py |
deeplab2 | deeplab2-main/model/decoder/motion_deeplab_decoder.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 9,007 | 40.511521 | 80 | py |
deeplab2 | deeplab2-main/model/decoder/deeplabv3plus.py | # coding=utf-8
# Copyright 2023 The Deeplab2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 5,185 | 34.520548 | 80 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.