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 |
|---|---|---|---|---|---|---|
NEDMP | NEDMP-main/src/DMP/SIS.py | # -*- encoding: utf-8 -*-
'''
@File : SIS.py
@Time : 2021/05/21 15:57:18
@Author : Fei gao
@Contact : feig@mail.bnu.edu.cn
BNU, Beijing, China
'''
import torch
from torch_scatter import scatter
from copy import deepcopy
from src.DMP.utils import edgeList
class DMP_SIS():
def __init__(self, weight... | 3,989 | 34.309735 | 105 | py |
NEDMP | NEDMP-main/src/DMP/SIR.py | # -*- encoding: utf-8 -*-
'''
@File : dmp_ic.py
@Time : 2021/04/02 13:26:45
@Author : Fei gao
@Contact : feig@mail.bnu.edu.cn
BNU, Beijing, China
'''
from functools import reduce
import networkx as nx
import torch as T
from torch_scatter import scatter
from torch_geometric.utils import degree
from sr... | 3,995 | 33.747826 | 103 | py |
PoSFeat | PoSFeat-main/networks/PoSFeat_model.py | '''
WSFModel without global header
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
from abc import ABC, abstractmethod
from path import Path
import os
import networks
class PoSFeat(ABC):
def __init__(self, configs, device, no_cuda=None):
self.config = configs
self.device =... | 5,799 | 37.926174 | 108 | py |
PoSFeat | PoSFeat-main/networks/DescNet.py | import torch
import torch.nn as nn
import torch.nn.functional as F
import importlib
def class_for_name(module_name, class_name):
# load the module, will raise ImportError if module cannot be loaded
m = importlib.import_module(module_name)
return getattr(m, class_name)
class ResUNet(nn.Module):
def __i... | 6,504 | 33.236842 | 133 | py |
PoSFeat | PoSFeat-main/networks/DeteNet.py | import torch
import torch.nn as nn
import torch.nn.functional as F
class KeypointDet(nn.Module):
"""
spatical attention header
"""
def __init__(self, in_channels, out_channels=1, prior='SSIM', act='Sigmoid'):
super(KeypointDet, self).__init__()
self.conv1 = nn.Conv2d(in_channels, in_ch... | 3,955 | 31.694215 | 111 | py |
PoSFeat | PoSFeat-main/managers/extractor.py | import os
import cv2
import datetime
import shutil
import logging
import yaml
import importlib
import numpy as np
import time
import h5py
from path import Path
from abc import ABC, abstractmethod
import torch
import torch.nn.functional as F
import torch.distributed as dist
from torch.utils.data.distributed import Dis... | 15,845 | 40.373368 | 136 | py |
PoSFeat | PoSFeat-main/managers/trainer.py | import os
import datetime
import shutil
import logging
import yaml
import importlib
import time
from path import Path
from abc import ABC, abstractmethod
from PIL import Image as Im
import numpy as np
import torch.nn.functional as F
import torch
from torch.utils.tensorboard import SummaryWriter
import torch.distribut... | 27,149 | 48.908088 | 159 | py |
PoSFeat | PoSFeat-main/evaluations/aachen/reconstruct_pipeline_v1_1.py | import argparse
import numpy as np
import os
import shutil
import subprocess
import sqlite3
import torch
import types
from tqdm import tqdm
from matchers import mutual_nn_matcher
from camera import Camera
from utils import quaternion_to_rotation_matrix, camera_center_to_translation
from path import Path
im... | 12,821 | 35.844828 | 141 | py |
PoSFeat | PoSFeat-main/evaluations/aachen/reconstruct_pipeline.py | import argparse
import numpy as np
from path import Path
import os
import shutil
import subprocess
import sqlite3
import torch
import types
from tqdm import tqdm
from matchers import mutual_nn_matcher
from camera import Camera
from utils import quaternion_to_rotation_matrix, camera_center_to_translation
i... | 13,096 | 35.686275 | 135 | py |
PoSFeat | PoSFeat-main/evaluations/aachen/matchers.py | import torch
# Mutual nearest neighbors matcher for L2 normalized descriptors.
def mutual_nn_matcher(descriptors1, descriptors2):
device = descriptors1.device
sim = descriptors1 @ descriptors2.t()
nn12 = torch.max(sim, dim=1)[1]
nn21 = torch.max(sim, dim=0)[1]
ids1 = torch.arange(0, sim.shape[0], ... | 2,562 | 32.285714 | 95 | py |
PoSFeat | PoSFeat-main/evaluations/hpatches/evaluation.py | import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import os
import torch
from scipy.io import loadmat
from tqdm import tqdm
from path import Path
use_cuda = torch.cuda.is_available()
device = torch.device('cuda:0' if use_cuda else 'cpu')
methods = ['hesaff', 'hesaffnet', 'contextdesc', 'd2-net', 'r... | 9,402 | 35.587549 | 166 | py |
PoSFeat | PoSFeat-main/evaluations/ETH_local_feature/reconstruction_pipeline.py | # Import the features and matches into a COLMAP database.
#
# Copyright 2017: Johannes L. Schoenberger <jsch at inf.ethz.ch>
from __future__ import print_function, division
import os
import sys
import glob
import yaml
import types
import torch
import shutil
import sqlite3
import argparse
import subprocess
import mult... | 14,280 | 38.233516 | 102 | py |
PoSFeat | PoSFeat-main/evaluations/ETH_local_feature/custom_matcher.py | import torch
# Mutual nearest neighbors matcher for L2 normalized descriptors.
def mutual_nn_matcher(descriptors1, descriptors2, **args):
device = descriptors1.device
sim = descriptors1 @ descriptors2.t()
nn12 = torch.max(sim, dim=1)[1]
nn21 = torch.max(sim, dim=0)[1]
ids1 = torch.arange(0, sim.sh... | 2,567 | 33.702703 | 95 | py |
PoSFeat | PoSFeat-main/datasets/aachen.py | import torch
import numpy as np
from torch.utils.data import Dataset
import torchvision.transforms as transforms
import skimage.io as io
from path import Path
import cv2
import torch.nn.functional as F
class Aachen_Day_Night(Dataset):
def __init__(self, configs):
super(Aachen_Day_Night, self).__init__()
... | 2,354 | 35.230769 | 93 | py |
PoSFeat | PoSFeat-main/datasets/data_utils.py | import numpy as np
import cv2
import torch
from matplotlib import cm
from matplotlib.colors import ListedColormap, LinearSegmentedColormap
def skew(x):
return np.array([[0, -x[2], x[1]],
[x[2], 0, -x[0]],
[-x[1], x[0], 0]])
def rotateImage(image, angle):
h, w = imag... | 7,228 | 41.274854 | 112 | py |
PoSFeat | PoSFeat-main/datasets/ETH_local_feature.py | import torch
import numpy as np
from torch.utils.data import Dataset
import torchvision.transforms as transforms
import skimage.io as io
from path import Path
import cv2
import torch.nn.functional as F
class ETH_LFB(Dataset):
def __init__(self, configs):
"""
dataset for eth local feature benchmark
... | 2,147 | 34.8 | 93 | py |
PoSFeat | PoSFeat-main/datasets/hpatches.py | import torch
import numpy as np
from torch.utils.data import Dataset
import torchvision.transforms as transforms
import skimage.io as io
from path import Path
import cv2
import torch.nn.functional as F
class HPatch_SIFT(Dataset):
def __init__(self, configs):
super(HPatch_SIFT, self).__init__()
self... | 1,618 | 33.446809 | 93 | py |
PoSFeat | PoSFeat-main/datasets/megadepth.py | import torch
from torch.utils.data import Dataset
import os
import numpy as np
import cv2
import skimage.io as io
import torchvision.transforms as transforms
# import utils
import collections
from tqdm import tqdm
from path import Path
import datasets.data_utils as data_utils
rand = np.random.RandomState(234)
class M... | 34,226 | 41.837297 | 129 | py |
PoSFeat | PoSFeat-main/losses/epipolarloss.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from .preprocess_utils import *
class EpipolarLoss_full(nn.Module):
def __init__(self, configs, device=None):
super(EpipolarLoss_full, self).__init__()
self.__lossname__ = 'EpipolarLoss_fullinfo'
self.config = configs
... | 4,185 | 40.445545 | 126 | py |
PoSFeat | PoSFeat-main/losses/kploss.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from .preprocess_utils import *
from torch.distributions import Categorical, Bernoulli
class DiskLoss(nn.Module):
def __init__(self, configs, device=None):
super(DiskLoss, self).__init__()
self.__lossname__ = 'DiskLoss'
sel... | 9,442 | 46.93401 | 145 | py |
PoSFeat | PoSFeat-main/losses/preprocess_utils.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Categorical, Bernoulli
import math
import numpy as np
def homogenize(coord):
# coord = torch.cat((coord, torch.ones_like(coord[:, :, [0]])), -1)
coord = torch.cat((coord, torch.ones_like(coord[..., [0]])), -1)
... | 34,450 | 41.637376 | 159 | py |
PoSFeat | PoSFeat-main/losses/preprocess.py | import torch
import torch.nn as nn
import torch.nn.functional as F
from . import preprocess_utils as putils
from .preprocess_utils import *
class Preprocess_Line2Window(nn.Module):
'''
the preprocess class for grid-with-line pipeline
'''
def __init__(self, configs, device=None, vis=False):
supe... | 6,528 | 49.223077 | 144 | py |
Inductive-representation-learning-on-temporal-graphs | Inductive-representation-learning-on-temporal-graphs-master/module.py | import logging
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class MergeLayer(torch.nn.Module):
def __init__(self, dim1, dim2, dim3, dim4):
super().__init__()
#self.layer_norm = torch.nn.LayerNorm(dim1 + dim2)
self.fc1 = torch.nn.Linear(dim1 + dim2,... | 20,815 | 39.030769 | 151 | py |
Inductive-representation-learning-on-temporal-graphs | Inductive-representation-learning-on-temporal-graphs-master/graph.py | import numpy as np
import torch
class NeighborFinder:
def __init__(self, adj_list, uniform=False):
"""
Params
------
node_idx_l: List[int]
node_ts_l: List[int]
off_set_l: List[int], such that node_idx_l[off_set_l[i]:off_set_l[i + 1]] = adjacent_list[i]
"""
... | 6,042 | 37.246835 | 136 | py |
Inductive-representation-learning-on-temporal-graphs | Inductive-representation-learning-on-temporal-graphs-master/learn_edge.py | """Unified interface to all dynamic graph model experiments"""
import math
import logging
import time
import random
import sys
import argparse
import torch
import pandas as pd
import numpy as np
#import numba
from sklearn.metrics import average_precision_score
from sklearn.metrics import f1_score
from sklearn.metrics... | 13,549 | 40.820988 | 136 | py |
Inductive-representation-learning-on-temporal-graphs | Inductive-representation-learning-on-temporal-graphs-master/learn_node.py | """Unified interface to all dynamic graph model experiments"""
import math
import logging
import time
import sys
import random
import argparse
from tqdm import tqdm
import torch
import pandas as pd
import numpy as np
from sklearn.metrics import roc_auc_score
from module import TGAN
from graph import NeighborFinder
... | 10,050 | 35.549091 | 128 | py |
MoRig | MoRig-master/training/train_skin.py | import sys
sys.path.append("./")
import torch
import torch.backends.cudnn as cudnn
from torch_geometric.loader import DataLoader
from torch.utils.tensorboard import SummaryWriter
import os, shutil, argparse, numpy as np
import models
from models.customized_losses import cross_entropy_with_probs, skin_difference_loss,... | 15,989 | 54.714286 | 155 | py |
MoRig | MoRig-master/training/train_deform_shape.py | import sys
sys.path.append("./")
import os, shutil, argparse, numpy as np, glob
import torch
import torch.backends.cudnn as cudnn
from torch_geometric.loader import DataLoader
from torch.utils.tensorboard import SummaryWriter
from utils.log_utils import AverageMeter
from utils.os_utils import isdir, mkdir_p, isfile
f... | 11,351 | 57.515464 | 135 | py |
MoRig | MoRig-master/training/train_corr_shape.py | import sys
sys.path.append("./")
import os, glob, shutil, argparse, numpy as np
import torch
import torch.backends.cudnn as cudnn
from torch.utils.tensorboard import SummaryWriter
from torch_geometric.loader import DataLoader
from utils.log_utils import AverageMeter
from utils.os_utils import isdir, mkdir_p, isfile
f... | 11,073 | 55.213198 | 137 | py |
MoRig | MoRig-master/training/train_rig.py | import sys
sys.path.append("./")
import os, shutil, argparse, numpy as np
from utils.log_utils import AverageMeter
from utils.os_utils import isdir, mkdir_p, isfile
from utils.io_utils import output_point_cloud_ply
import torch
import torch.backends.cudnn as cudnn
from torch_geometric.loader import DataLoader
from tor... | 15,151 | 50.362712 | 145 | py |
MoRig | MoRig-master/training/train_corr_pose.py | import sys
sys.path.append("./")
import os, glob, shutil, argparse, numpy as np
import torch
import torch.backends.cudnn as cudnn
from torch.utils.tensorboard import SummaryWriter
from torch_geometric.loader import DataLoader
from utils.log_utils import AverageMeter
from utils.os_utils import isdir, mkdir_p, isfile
f... | 17,016 | 58.919014 | 137 | py |
MoRig | MoRig-master/training/train_deform_pose.py | import sys
sys.path.append("./")
import os, shutil, argparse, numpy as np, glob
import torch
import torch.backends.cudnn as cudnn
from torch_geometric.loader import DataLoader
from torch.utils.tensorboard import SummaryWriter
from utils.log_utils import AverageMeter
from utils.os_utils import isdir, mkdir_p, isfile
f... | 17,600 | 60.757895 | 135 | py |
MoRig | MoRig-master/models/rootnet.py | #-------------------------------------------------------------------------------
# Name: Root_GCN.py
# Purpose: definition of root prediction module.
# RigNet Copyright 2020 University of Massachusetts
# RigNet is made available under General Public License Version 3 (GPLv3), or under a Commercial License.
#... | 4,353 | 45.319149 | 130 | py |
MoRig | MoRig-master/models/deformnet.py | import numpy as np
import torch
import torch.nn.functional as F
from torch.nn import Sequential, Linear
from torch_scatter import scatter_max, scatter_add
from models.corrnet import CorrNet
from models.basic_modules import MLP, GCUMotion
from torch_geometric.nn import knn
__all__ = ['deformnet']
class GCNDeform(torc... | 6,050 | 56.628571 | 161 | py |
MoRig | MoRig-master/models/basic_modules.py | import numpy as np
import torch
from torch.nn import Sequential as Seq, Linear as Lin, ReLU, BatchNorm1d as BN
from torch_geometric.nn.conv import MessagePassing
from torch_geometric.utils import remove_self_loops, add_self_loops
from torch_geometric.nn import knn_interpolate, fps, radius, global_max_pool, PointConv
... | 9,567 | 42.490909 | 133 | py |
MoRig | MoRig-master/models/bonenet.py | #-------------------------------------------------------------------------------
# Name: PairCls_GCN.py
# Purpose: definition of connectivity prediction module.
# RigNet Copyright 2020 University of Massachusetts
# RigNet is made available under General Public License Version 3 (GPLv3), or under a Commercial... | 6,046 | 46.992063 | 143 | py |
MoRig | MoRig-master/models/rignet.py | import torch
from torch.nn import Sequential, Linear
from torch_scatter import scatter_max
from models.basic_modules import MLP, GCUMotion
import numpy as np
__all__ = ['jointnet_motion', 'masknet_motion', 'skinnet_motion']
class TemporalAttn(torch.nn.Module):
def __init__(self, input_size, num_heads, hidden_siz... | 11,560 | 51.55 | 135 | py |
MoRig | MoRig-master/models/nn_util.py | """
This file belongs to the MultiBodySync code repository and is distributed for free.
Author: Jiahui Huang <huang-jh18@mails.tsinghua.edu.cn>
"""
import numpy as np
import torch
import torch.nn as nn
class GroupNorm(nn.Sequential):
def __init__(self, in_size, num_groups, name=""):
super(GroupNorm, sel... | 9,112 | 32.627306 | 125 | py |
MoRig | MoRig-master/models/corrnet.py | import torch
from torch.nn import Sequential as Seq, Linear as Lin, Parameter
from torch_geometric.nn import knn
from torch_scatter import scatter_max
from models.basic_modules import MLP, SAModule, GlobalSAModule, FPModule, GCU
__all__ = ['corrnet']
class CorrNet(torch.nn.Module):
def __init__(self, input_featu... | 4,690 | 56.207317 | 179 | py |
MoRig | MoRig-master/models/customized_losses.py | import numpy as np
from sympy import im
import torch
import torch.nn.functional as F
from scipy.optimize import linear_sum_assignment
from torch_scatter import scatter_max
from torch_cluster import fps
from itertools import combinations
def log_ratio_loss(pred_feature, gt_skin, batch):
num_sample = 50
epsilon... | 12,523 | 42.037801 | 132 | py |
MoRig | MoRig-master/datasets/dataset_shape.py | import os
import torch
import numpy as np
import glob
import open3d as o3d
from tqdm import tqdm
from torch_geometric.data import Data, InMemoryDataset
from torch_geometric.utils import add_self_loops
class GraphData(Data):
def __init__(self, vtx=None, pts=None, corr_v2p=None, corr_p2v=None, vismask=None, flow=No... | 3,400 | 39.975904 | 113 | py |
MoRig | MoRig-master/datasets/dataset_rig.py | import os
import torch
import numpy as np
import glob
from tqdm import tqdm
from torch_geometric.data import Data, InMemoryDataset
from torch_geometric.utils import add_self_loops
from utils.rig_parser import Rig
class RigDataset(InMemoryDataset):
def __init__(self, root):
super(RigDataset, self).__init__... | 6,470 | 44.893617 | 135 | py |
MoRig | MoRig-master/datasets/dataset_pose.py | import os, glob, numpy as np
from tqdm import tqdm
import torch
from torch_geometric.data import Data, Dataset, InMemoryDataset
from torch_geometric.utils import add_self_loops
class GraphData(Data):
def __init__(self, vtx_traj=None, pts_traj=None, corr_v2p_all=None, corr_p2v_all=None,
vismask_al... | 15,087 | 46.297806 | 111 | py |
MoRig | MoRig-master/evaluate/eval_tracking.py | import sys
sys.path.append("./")
import argparse, os, cv2, glob, copy, numpy as np, open3d as o3d, matplotlib.pyplot as plt, time
from scipy.spatial.transform import Rotation
from tqdm import tqdm
from sklearn.cluster import KMeans
import torch
from torch_geometric.utils import add_self_loops
import models
from dataset... | 12,890 | 53.622881 | 1,271 | py |
MoRig | MoRig-master/evaluate/joint2rig.py | import sys
sys.path.append("./")
import glob, os, open3d as o3d, numpy as np, itertools as it, cv2, copy, sys, time, trimesh
from tqdm import tqdm
from scipy.sparse import lil_matrix
from scipy.sparse.csgraph import dijkstra
import torch
from torch_geometric.data import Data
from torch_geometric.utils import add_self_... | 23,841 | 45.116054 | 121 | py |
MoRig | MoRig-master/evaluate/eval_rigging.py | import sys
sys.path.append("./")
import glob, os, numpy as np, cv2, sys, math, scipy
import open3d as o3d
from tqdm import tqdm
from scipy.optimize import linear_sum_assignment
from sklearn.cluster import estimate_bandwidth
from utils import binvox_rw
from utils.os_utils import mkdir_p
from utils.io_utils import readPl... | 6,230 | 44.481752 | 121 | py |
MoRig | MoRig-master/utils/deform_ik.py | import numpy as np
import torch
import torch.nn as nn
import math
class Deform_IK:
def __init__(self, vismask_thrd=0.35):
self.vismask_thrd = vismask_thrd
self.crit = nn.MSELoss(reduction='none')
@staticmethod
def transform_from_euler(rotation, order='xyz'):
#rotation = rotation /... | 4,992 | 40.957983 | 136 | py |
MoRig | MoRig-master/utils/rot_utils.py | import numpy as np
import math
import torch
def isRotationMatrix(R):
Rt = np.transpose(R, axes=(0, 2, 1))
shouldBeIdentity = np.matmul(Rt, R)
I = np.identity(3, dtype=R.dtype)[None, ...]
n = (np.linalg.norm((I - shouldBeIdentity).reshape(-1, 9), axis=-1)) < 1e-6
return n.sum() == len(n)
def norma... | 3,572 | 28.04878 | 106 | py |
MoRig | MoRig-master/utils/io_utils.py | #-------------------------------------------------------------------------------
# Name: io_utils.py
# Purpose: utilize functions for file IO
# RigNet Copyright 2020 University of Massachusetts
# RigNet is made available under General Public License Version 3 (GPLv3), or under a Commercial License.
# Please ... | 8,949 | 37.913043 | 151 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/con_training_sts.py | from torch.utils.data import DataLoader
import math
from sentence_transformers import SentenceTransformer, SentencesDataset, LoggingHandler, losses, util, InputExample
from sentence_transformers.evaluation import EmbeddingSimilarityEvaluator
import logging
from datetime import datetime
import os
import gzip
import csv... | 3,065 | 35.5 | 127 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/SemanticSearch.py | from sentence_transformers import SentenceTransformer, util
import numpy as np
model_path = './output/training_sts'
embedder = SentenceTransformer(model_path)
# Corpus with example sentences
corpus = ['한 남자가 음식을 먹는다.',
'한 남자가 빵 한 조각을 먹는다.',
'그 여자가 아이를 돌본다.',
'한 남자가 말을 탄다.',
'한... | 1,372 | 30.204545 | 95 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/training_nli.py | from torch.utils.data import DataLoader
import math
from sentence_transformers import models, losses
from sentence_transformers import SentencesDataset, LoggingHandler, SentenceTransformer, util, InputExample
from sentence_transformers.evaluation import EmbeddingSimilarityEvaluator
import logging
from datetime import d... | 3,595 | 35.323232 | 142 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/training_sts.py | from torch.utils.data import DataLoader
import math
from sentence_transformers import SentenceTransformer, SentencesDataset, LoggingHandler, losses, models, util
from sentence_transformers.evaluation import EmbeddingSimilarityEvaluator
from sentence_transformers.readers import STSBenchmarkDataReader, InputExample
impo... | 3,565 | 36.536842 | 127 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_encoder_decoder.py | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# 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... | 13,316 | 55.189873 | 472 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/filep.py | from transformers import GPT2LMHeadModel, GPT2Tokenizer
import torch
tokenizer = GPT2Tokenizer.from_pretrained("gpt2")
model = GPT2LMHeadModel.from_pretrained('gpt2')
generated = tokenizer.encode("The Manhattan bridge")
context = torch.tensor([generated])
past = None
for i in range(15):
output, past = model(cont... | 1,009 | 27.857143 | 76 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_tf_albert.py | # coding=utf-8
# Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# 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... | 39,034 | 46.14372 | 159 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/optimization.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
#
# 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/LICEN... | 7,667 | 41.837989 | 130 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_mmbt.py | # coding=utf-8
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) HuggingFace Inc. team.
#
# 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... | 21,362 | 49.864286 | 138 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/__main__.py | # coding: utf8
def main():
import sys
if (len(sys.argv) < 4 or len(sys.argv) > 6) or sys.argv[1] not in ["bert", "gpt", "transfo_xl", "gpt2", "xlnet", "xlm"]:
print(
"This command line utility let you convert original (author released) model checkpoint to pytorch.\n"
"It should be used a... | 7,085 | 53.507692 | 135 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/configuration_utils.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# 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 cop... | 18,955 | 46.989873 | 193 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/optimization_tf.py | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# 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 applica... | 9,893 | 38.895161 | 115 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_tf_pytorch_utils.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# 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 cop... | 12,952 | 38.01506 | 155 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_distilbert.py | # coding=utf-8
# Copyright 2019-present, the HuggingFace Inc. team, The Google AI Language Team and Facebook, Inc.
#
# 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.or... | 39,945 | 47.069795 | 175 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_tf_xlm_roberta.py | # coding=utf-8
# Copyright 2019 Facebook AI Research and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# 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 Licens... | 4,827 | 39.571429 | 127 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_tf_gpt2.py | # coding=utf-8
# Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# 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... | 33,342 | 46.161245 | 169 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_tf_transfo_xl.py | # coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | 35,811 | 40.545244 | 159 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_tf_t5.py | # coding=utf-8
# Copyright 2018 T5 Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# 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
#
# ... | 42,692 | 46.331486 | 207 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_tf_auto.py | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# 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... | 68,490 | 61.663312 | 472 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_utils.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors, Facebook AI Research authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the L... | 97,902 | 48.34627 | 472 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/benchmark_utils.py | """
Utilities for working with the local dataset cache.
This file is adapted from the AllenNLP library at https://github.com/allenai/allennlp
Copyright by the AllenNLP authors.
"""
import linecache
import logging
import os
import sys
from collections import defaultdict
from typing import Iterable, List, NamedTuple, Op... | 15,354 | 43.897661 | 160 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_tf_openai.py | # coding=utf-8
# Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# 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... | 30,602 | 45.228097 | 169 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_tf_flaubert.py | # coding=utf-8
# Copyright 2019-present, Facebook, Inc and the HuggingFace Inc. team.
#
# 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
#
# Un... | 15,824 | 46.954545 | 159 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_bert.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# 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 cop... | 71,014 | 46.060968 | 187 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_gpt2.py | # coding=utf-8
# Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# 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... | 35,231 | 46.227882 | 177 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_flaubert.py | # coding=utf-8
# Copyright 2019-present CNRS, Facebook Inc. and the HuggingFace Inc. team.
#
# 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
#... | 17,805 | 44.773779 | 150 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/tokenization_utils_base.py | # coding=utf-8
# Copyright 2020 The HuggingFace Inc. team.
#
# 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... | 134,034 | 47.405562 | 252 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/convert_albert_original_tf_checkpoint_to_pytorch.py | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# 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... | 2,157 | 33.806452 | 117 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_openai.py | # coding=utf-8
# Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# 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... | 32,497 | 45.827089 | 177 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/convert_t5_original_tf_checkpoint_to_pytorch.py | # coding=utf-8
# Copyright 2018 The T5 authors and HuggingFace Inc. team.
#
# 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 require... | 2,100 | 32.887097 | 117 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/pipelines.py | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# 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... | 71,183 | 42.75169 | 211 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/convert_gpt2_original_tf_checkpoint_to_pytorch.py | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# 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... | 2,507 | 35.882353 | 119 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_tf_roberta.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# 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 cop... | 21,910 | 48.238202 | 161 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/convert_electra_original_tf_checkpoint_to_pytorch.py | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# 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... | 2,853 | 34.675 | 117 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_electra.py | import logging
import os
import torch
import torch.nn as nn
from transformers import ElectraConfig, add_start_docstrings
from transformers.activations import get_activation
from .file_utils import add_start_docstrings_to_callable
from .modeling_bert import BertEmbeddings, BertEncoder, BertLayerNorm, BertPreTrainedMo... | 31,884 | 46.447917 | 154 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/convert_roberta_original_pytorch_checkpoint_to_pytorch.py | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# 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... | 7,932 | 43.072222 | 117 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/tokenization_bert.py | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
#
# 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/LICEN... | 27,042 | 41.320814 | 183 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/convert_transfo_xl_original_tf_checkpoint_to_pytorch.py | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# 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... | 4,913 | 38 | 121 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/configuration_ctrl.py | # coding=utf-8
# Copyright 2018 Salesforce and HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
# 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
#
# htt... | 5,769 | 39.069444 | 120 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_tf_transfo_xl_utilities.py | # coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | 7,702 | 42.03352 | 118 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/convert_bart_original_pytorch_checkpoint_to_pytorch.py | # coding=utf-8
# Copyright 2020 The HuggingFace Inc. team.
#
# 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... | 5,400 | 38.137681 | 119 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_t5.py | # coding=utf-8
# Copyright 2018 Mesh TensorFlow authors, T5 Authors and HuggingFace Inc. team.
#
# 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... | 47,057 | 46.294472 | 207 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_tf_electra.py | import logging
import tensorflow as tf
from transformers import ElectraConfig
from .file_utils import add_start_docstrings, add_start_docstrings_to_callable
from .modeling_tf_bert import ACT2FN, TFBertEncoder, TFBertPreTrainedModel
from .modeling_tf_utils import get_initializer, shape_list
logger = logging.getLogg... | 28,786 | 45.732143 | 161 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_tf_xlnet.py | # coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | 60,495 | 48.024311 | 171 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/convert_openai_original_tf_checkpoint_to_pytorch.py | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# 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... | 2,641 | 34.702703 | 118 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_xlm_roberta.py | # coding=utf-8
# Copyright 2019 Facebook AI Research and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# 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 Licens... | 5,431 | 41.771654 | 167 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_camembert.py | # coding=utf-8
# Copyright 2019 Inria, Facebook AI Research and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# 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... | 5,589 | 39.215827 | 148 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/convert_xlm_original_pytorch_checkpoint_to_pytorch.py | # coding=utf-8
# Copyright 2018 The HuggingFace Inc. team.
#
# 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... | 2,970 | 36.1375 | 117 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/convert_dialogpt_original_pytorch_checkpoint_to_pytorch.py | import argparse
import os
import torch
from transformers.file_utils import WEIGHTS_NAME
DIALOGPT_MODELS = ["small", "medium", "large"]
OLD_KEY = "lm_head.decoder.weight"
NEW_KEY = "lm_head.weight"
def convert_dialogpt_checkpoint(checkpoint_path: str, pytorch_dump_folder_path: str):
d = torch.load(checkpoint_... | 923 | 27.875 | 85 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_tf_xlm.py | # coding=utf-8
# Copyright 2019-present, Facebook, Inc and the HuggingFace Inc. team.
#
# 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
#
# Un... | 39,576 | 46.798309 | 159 | py |
KoSentenceBERT-SKT | KoSentenceBERT-SKT-main/transformers/modeling_bart.py | # coding=utf-8
# Copyright 2020 The Facebook AI Research Team Authors and The HuggingFace Inc. team.
#
# 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/LIC... | 44,150 | 41.657971 | 207 | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.