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
CorgiPile-PyTorch
CorgiPile-PyTorch-main/cifar_dl_bench/models/dpn.py
'''Dual Path Networks in PyTorch.''' import torch import torch.nn as nn import torch.nn.functional as F class Bottleneck(nn.Module): def __init__(self, last_planes, in_planes, out_planes, dense_depth, stride, first_layer): super(Bottleneck, self).__init__() self.out_planes = out_planes sel...
3,562
34.989899
116
py
SBM-Transformer
SBM-Transformer-main/code/model_wrapper.py
import torch import torch.nn as nn import math from model import Model def pooling(inp, mode): if mode == "CLS": pooled = inp[:, 0, :] elif mode == "MEAN": pooled = inp.mean(dim = 1) else: raise Exception() return pooled def append_cls(inp, mask, vocab_size): batch_size = i...
4,761
35.630769
119
py
SBM-Transformer
SBM-Transformer-main/code/attention_sbm.py
import torch import torch.nn as nn import math import json import torch.nn.functional as F from torch.utils.checkpoint import checkpoint from fastRG import fastRG from STE import * import time from dgl.nn.functional import edge_softmax import dgl.function as fn import dgl.ops as DF import dgl @torch.no_grad() def blo...
4,000
33.791304
139
py
SBM-Transformer
SBM-Transformer-main/code/attention_linformer.py
import torch import torch.nn as nn import math class LinformerAttention(nn.Module): projection_matrix = None def __init__(self, config): super().__init__() self.num_head = config["num_head"] self.head_dim = config["head_dim"] self.linformer_k = config["linformer_k"] se...
1,203
30.684211
124
py
SBM-Transformer
SBM-Transformer-main/code/attention_nystrom.py
import torch import torch.nn as nn import math class NystromAttention(nn.Module): def __init__(self, config): super().__init__() self.head_dim = config["head_dim"] self.num_head = config["num_head"] self.num_landmarks = config["num_landmarks"] self.seq_len = config["max_se...
2,845
42.784615
145
py
SBM-Transformer
SBM-Transformer-main/code/model.py
import torch import torch.nn as nn import numpy as np import math from torch.utils.checkpoint import checkpoint from attention import Attention class Embeddings(nn.Module): def __init__(self, config): super().__init__() assert config["embedding_dim"] == config["transformer_dim"] self.dim ...
4,326
33.070866
122
py
SBM-Transformer
SBM-Transformer-main/code/dataset.py
import torch import torch.nn as nn import math from torch.utils.data.dataset import Dataset import sys import os import random import json import pickle import numpy as np class LRADataset(Dataset): def __init__(self, file_path, endless): self.endless = endless with open(file_path, "rb") as f: ...
1,513
29.28
89
py
SBM-Transformer
SBM-Transformer-main/code/attention_performer.py
import torch import torch.nn as nn import math from performer_pytorch import FastAttention class PerformerAttention(nn.Module): def __init__(self, config): super().__init__() self.head_dim = config["head_dim"] self.rp_dim = config["rp_dim"] self.kernel_type = config["kernel_type"] ...
1,003
39.16
133
py
SBM-Transformer
SBM-Transformer-main/code/fastRG.py
import torch import numpy as np import time import torch.nn.functional as F from torch import LongTensor, Tensor from typing import Generator, Iterable, List, Optional, Tuple @torch.no_grad() def batched_bincount(inp: Tensor, max_num: int): batch_shape, num_samples = inp.shape[:-1], inp.shape[-1] num_batc...
5,974
34.147059
145
py
SBM-Transformer
SBM-Transformer-main/code/attention_linear.py
import torch import torch.nn as nn import math class LinearAttention(nn.Module): def __init__(self, config): super().__init__() def forward(self, Q, K, V, mask): Q = (nn.functional.elu(Q) + 1) / math.sqrt(math.sqrt(Q.size(2))) K = (nn.functional.elu(K) + 1) * mask[:, None, :, None] / ...
483
25.888889
97
py
SBM-Transformer
SBM-Transformer-main/code/STE.py
import torch import torch.nn as nn import torch.nn.functional as F class SampleGraphSparseGraph(torch.autograd.Function): @staticmethod def forward(ctx, input): A = torch.bernoulli(torch.clamp(input+0.01, min=0, max=1)).requires_grad_(True) ctx.save_for_backward(A) return A ...
424
29.357143
87
py
SBM-Transformer
SBM-Transformer-main/code/attention_reformer.py
import torch import torch.nn as nn from reformer_pytorch import LSHSelfAttention class LSHAttention(LSHSelfAttention): def __init__(self, config, query, key, value): self.num_hash = config["num_hash"] self.attention_head_size = config["head_dim"] self.num_attention_heads = config["num_head"...
730
33.809524
58
py
SBM-Transformer
SBM-Transformer-main/code/attention.py
import torch import torch.nn as nn import math import json from torch.utils.checkpoint import checkpoint class SoftmaxAttention(nn.Module): def __init__(self, config): super().__init__() self.drop_attn = torch.nn.Dropout(p = config["attention_dropout"]) self.head_dim = config["head_dim"] ...
4,387
35.87395
109
py
SBM-Transformer
SBM-Transformer-main/code/run_tasks.py
from model_wrapper import ModelForSC, ModelForSCDual from dataset import LRADataset from torch.utils.data import DataLoader import torch import torch.nn as nn import torch.nn.functional as F import datetime import time import os import json import requests import pickle import numpy as np import argparse import math im...
9,630
35.900383
212
py
cymetric
cymetric-main/tests/test_tfmodels.py
""" Pytest for some tensorflow models. Requires that `test_pointgen.py` has been run before. """ import pytest import numpy as np import os as os #import pickle as pickle import itertools as it import tensorflow as tf tfk = tf.keras #TODO: Import all metrics and Measures and callbacks and ... then run them. from cyme...
3,581
33.442308
80
py
cymetric
cymetric-main/cymetric/models/tfmodels.py
""" A selection of custom tensorflow models for learning Calabi-Yau metrics using neural networks. """ import tensorflow as tf from cymetric.models.losses import sigma_loss from cymetric.models.fubinistudy import FSModel from cymetric.pointgen.nphelper import get_all_patch_degrees, compute_all_w_of_x, get_levicivita_...
50,954
41.783375
236
py
cymetric
cymetric-main/cymetric/models/callbacks.py
""" A collection of tensorflow callbacks. """ import tensorflow as tf import numpy as np from cymetric.models.measures import ricci_measure, sigma_measure, \ kaehler_measure_loss, transition_measure_loss, ricci_scalar_fn tfk = tf.keras sigma_measure_tf = tf.function(func=sigma_measure) kaehler_measure_tf = tf.fun...
14,605
38.158177
94
py
cymetric
cymetric-main/cymetric/models/fubinistudy.py
""" Pullbacked fubini study metric implemented as a tfk.model. """ import tensorflow as tf import itertools as it from cymetric.pointgen.nphelper import generate_monomials, get_levicivita_tensor import numpy as np tfk = tf.keras class FSModel(tfk.Model): r"""FSModel implements all underlying tensorflow routines ...
37,282
44.027778
175
py
cymetric
cymetric-main/cymetric/models/tfhelper.py
""" A collection of various helper functions. """ import tensorflow as tf def prepare_tf_basis(basis, dtype=tf.complex64): r"""Casts each entry in Basis to dtype. Args: basis (dict): dictionary containing geometric information dtype (_type_, optional): type to cast to. Defaults to tf.complex...
4,556
40.807339
82
py
cymetric
cymetric-main/cymetric/models/metrics.py
""" A bunch of custom metrics for the custom model. Need to be declared separately otherwise .fit throws an error, since they only take the loss values and not y_pred, y_true as arguments. """ import tensorflow as tf tfk = tf.keras class SigmaLoss(tfk.metrics.Metric): def __init__(self, name='sigma_loss', **kwa...
6,649
32.585859
89
py
cymetric
cymetric-main/cymetric/potential/donaldson.py
""" Implementation of the Donaldson algorithm using numpy. """ import numpy as np from joblib import Parallel, delayed from cymetric.pointgen.nphelper import generate_monomials from cymetric.models.fubinistudy import FSModel import os as os from scipy.special import factorial import sympy as sp from sympy.geometry.uti...
29,386
44.702955
149
py
cymetric
cymetric-main/cymetric/wolfram/mathematicalib.py
import numpy as np import sys import os import re import logging import pickle logging.basicConfig(stream=sys.stdout) mcy_logger = logging.getLogger('mathematica') from cymetric.pointgen.pointgen_mathematica import PointGeneratorMathematica, ToricPointGeneratorMathematica from cymetric.pointgen.nphelper import prepare...
15,916
38.7925
267
py
cymetric
cymetric-main/docs/source/conf.py
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
2,791
34.794872
84
py
PnP-CASSI
PnP-CASSI-main/dvp_linear_inv_cassi.py
import time import math import numpy as np from skimage.restoration import (denoise_tv_chambolle, denoise_bilateral, denoise_wavelet, estimate_sigma) from skimage.measure import (compare_psnr, compare_ssim) from utils import (A, At, psnr, shift, shift_back,calculate_ssim,TV_denoiser) # ...
22,862
48.702174
261
py
PnP-CASSI
PnP-CASSI-main/hsi.py
import numpy as np import torch.nn as nn import torch import torch.utils.data as data from torch.optim import Adam from torch.optim import lr_scheduler from collections import OrderedDict import os import math from torch.utils.data import DataLoader import random from torch.optim import Adam def pixel_unshuffle(input,...
2,852
31.793103
138
py
multihop_dense_retrieval
multihop_dense_retrieval-main/scripts/train_momentum.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import logging import os import random from datetime import date from functools import partial import numpy as np import t...
10,671
44.220339
236
py
multihop_dense_retrieval
multihop_dense_retrieval-main/scripts/encode_corpus.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. """ Description: encode text corpus into a store of dense vectors. Usage (adjust the batch size according to your GPU me...
3,707
30.423729
127
py
multihop_dense_retrieval
multihop_dense_retrieval-main/scripts/end2end.py
#!/usr/bin/env python # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. """ Efficient end2end QA with HNSW index taskset --cpu-list 0-15 python end2end.py ../data/hotpot/ho...
8,165
44.116022
251
py
multihop_dense_retrieval
multihop_dense_retrieval-main/scripts/train_mhop.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. """ Description: train a multi-hop dense retrieval from pretrained BERT/RoBERTa encoder Usage: CUDA_VISIBLE_DEVICES=0,1...
10,731
41.086275
269
py
multihop_dense_retrieval
multihop_dense_retrieval-main/scripts/demo.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import streamlit as st import torch import os import numpy as np from apex import amp import faiss import json import argpa...
7,262
40.741379
192
py
multihop_dense_retrieval
multihop_dense_retrieval-main/scripts/train_qa.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import collections import json import logging import os import random from datetime import date from functools import parti...
21,946
44.251546
242
py
multihop_dense_retrieval
multihop_dense_retrieval-main/scripts/eval/eval_mhop_retrieval.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. """ Evaluating trained retrieval model. Usage: python eval_mhop_retrieval.py ${EVAL_DATA} ${CORPUS_VECTOR_PATH} ${CORPUS_D...
12,631
43.322807
159
py
multihop_dense_retrieval
multihop_dense_retrieval-main/scripts/eval/eval_mhop_fever.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. """ python eval_mhop_fever.py /private/home/xwhan/data/fever/retrieval/dev_multi_evidence.txt index/fever.npy index/fever_c...
8,812
49.073864
402
py
multihop_dense_retrieval
multihop_dense_retrieval-main/scripts/eval/eval_retrieval.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. """ Single-hop retrieval evaluation ## Use the unified model (trained with both hotpotQA and NQ) python eval_retrieval.p...
9,540
44.650718
401
py
multihop_dense_retrieval
multihop_dense_retrieval-main/scripts/eval/eval_single_fever.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. """ python eval_single_fever.py /private/home/xwhan/data/fever/retrieval/dev_single_evidence.txt index/fever_single.npy ind...
5,252
41.707317
378
py
multihop_dense_retrieval
multihop_dense_retrieval-main/mdr/qa/train_ranker.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import collections import json import logging import os import random from datetime import date from functools import parti...
10,232
41.995798
170
py
multihop_dense_retrieval
multihop_dense_retrieval-main/mdr/qa/utils.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import torch import sqlite3 import unicodedata import collections import logging import re def set_global_logging_level(le...
13,636
33.350126
129
py
multihop_dense_retrieval
multihop_dense_retrieval-main/mdr/qa/config.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import argparse from ast import parse from typing import NamedTuple from torch.nn import parallel class ClusterConfig(Nam...
4,948
54.606742
115
py
multihop_dense_retrieval
multihop_dense_retrieval-main/mdr/qa/qa_dataset.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import collections import json import random import torch from torch.utils.data import Dataset, Sampler from tqdm import t...
18,839
39.603448
179
py
multihop_dense_retrieval
multihop_dense_retrieval-main/mdr/qa/qa_model.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from transformers import AutoModel, BertModel import torch.nn as nn from torch.nn import CrossEntropyLoss import torch imp...
4,377
38.8
139
py
multihop_dense_retrieval
multihop_dense_retrieval-main/mdr/qa/qa_trainer.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import argparse import json import os import os.path as osp import random from functools import partial from pathlib import...
19,844
46.589928
193
py
multihop_dense_retrieval
multihop_dense_retrieval-main/mdr/retrieval/interactive_retrieval.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from models.mhop_retriever import MhopRetriever import faiss import numpy as np import torch from tqdm import tqdm from t...
2,527
36.731343
155
py
multihop_dense_retrieval
multihop_dense_retrieval-main/mdr/retrieval/mhop_trainer.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. """ submitit trainer for hyperparameter tuning """ import os import os.path as osp from typing import Optional, NamedTupl...
12,533
41.778157
190
py
multihop_dense_retrieval
multihop_dense_retrieval-main/mdr/retrieval/criterions.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import torch from torch.nn import CrossEntropyLoss import torch.nn.functional as F # def loss_single(model, batch, momentu...
11,894
46.390438
185
py
multihop_dense_retrieval
multihop_dense_retrieval-main/mdr/retrieval/train_single.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. """ # DPR baseline shared encoder CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python train_single.py \ --do_train \ --pre...
13,227
38.369048
182
py
multihop_dense_retrieval
multihop_dense_retrieval-main/mdr/retrieval/single_trainer.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. """ trainer defined for submitit hyperparameter tuning """ import os import os.path as osp from typing import Optional, ...
13,371
41.050314
150
py
multihop_dense_retrieval
multihop_dense_retrieval-main/mdr/retrieval/models/retriever.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. """ single hop retrieval models """ from transformers import AutoModel import torch.nn as nn import torch class BertRetri...
7,436
38.142105
178
py
multihop_dense_retrieval
multihop_dense_retrieval-main/mdr/retrieval/models/unified_retriever.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from transformers import AutoModel import torch.nn as nn import torch class UnifiedRetriever(nn.Module): def __init__...
8,004
41.807487
152
py
multihop_dense_retrieval
multihop_dense_retrieval-main/mdr/retrieval/models/hop1_retriever.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from transformers import BertModel, BertConfig, BertPreTrainedModel import torch.nn as nn import torch from torch.nn.parame...
1,496
35.512195
109
py
multihop_dense_retrieval
multihop_dense_retrieval-main/mdr/retrieval/models/mhop_retriever.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from torch import embedding from transformers import AutoModel import torch.nn as nn import torch class RobertaRetriever(...
4,975
36.69697
148
py
multihop_dense_retrieval
multihop_dense_retrieval-main/mdr/retrieval/utils/utils.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import torch import sqlite3 import unicodedata def load_saved(model, path, exact=True): try: state_dict = torc...
5,278
29.871345
137
py
multihop_dense_retrieval
multihop_dense_retrieval-main/mdr/retrieval/data/unified_dataset.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from torch.utils.data import Dataset, Sampler import torch import json import random from .data_utils import collate_token...
16,160
41.528947
184
py
multihop_dense_retrieval
multihop_dense_retrieval-main/mdr/retrieval/data/encode_datasets.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import csv import json import pdb import numpy as np from torch.utils.data import Dataset from tqdm import tqdm import code...
3,991
33.713043
163
py
multihop_dense_retrieval
multihop_dense_retrieval-main/mdr/retrieval/data/mhop_dataset.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from torch.utils.data import Dataset import json import random from .data_utils import collate_tokens class MhopDataset(D...
5,278
42.270492
146
py
multihop_dense_retrieval
multihop_dense_retrieval-main/mdr/retrieval/data/fever_dataset.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from torch import normal from torch.utils.data import Dataset import torch import json import random import unicodedata imp...
2,992
33.802326
146
py
multihop_dense_retrieval
multihop_dense_retrieval-main/mdr/retrieval/data/sp_datasets.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. """ Dataset classes for NQ expeirments """ from torch.utils.data import Dataset import json import random from .data_utils...
13,614
37.678977
157
py
flaxformer
flaxformer-main/setup.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
1,963
29.215385
74
py
flaxformer
flaxformer-main/flaxformer/activation_partitioning_test.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
2,816
35.115385
80
py
flaxformer
flaxformer-main/flaxformer/param_conversion_util.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
2,812
35.064103
80
py
flaxformer
flaxformer-main/flaxformer/testing_utils_test.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
2,132
26.346154
79
py
flaxformer
flaxformer-main/flaxformer/testing_utils.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
7,432
33.253456
111
py
flaxformer
flaxformer-main/flaxformer/activation_partitioning.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
7,241
43.158537
129
py
flaxformer
flaxformer-main/flaxformer/transformer_common.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
5,500
40.674242
103
py
flaxformer
flaxformer-main/flaxformer/types.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
986
30.83871
74
py
flaxformer
flaxformer-main/flaxformer/sharding.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
4,440
30.94964
80
py
flaxformer
flaxformer-main/flaxformer/sharding_test.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
3,844
28.351145
78
py
flaxformer
flaxformer-main/flaxformer/transformer_common_test.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
5,809
35.540881
80
py
flaxformer
flaxformer-main/flaxformer/architectures/dual_encoder/components_test.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
1,429
31.5
76
py
flaxformer
flaxformer-main/flaxformer/architectures/dual_encoder/dual_encoder_architecture_test.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
13,011
32.278772
105
py
flaxformer
flaxformer-main/flaxformer/architectures/dual_encoder/l2_norm_test.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
1,333
31.536585
74
py
flaxformer
flaxformer-main/flaxformer/architectures/dual_encoder/poolings_test.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
4,504
30.725352
80
py
flaxformer
flaxformer-main/flaxformer/architectures/dual_encoder/dual_encoder_architecture.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
10,154
35.397849
93
py
flaxformer
flaxformer-main/flaxformer/architectures/dual_encoder/similarity_functions.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
18,034
37.618844
105
py
flaxformer
flaxformer-main/flaxformer/architectures/dual_encoder/components.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
1,925
32.206897
78
py
flaxformer
flaxformer-main/flaxformer/architectures/dual_encoder/single_tower_logit_functions_test.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
1,483
34.333333
78
py
flaxformer
flaxformer-main/flaxformer/architectures/dual_encoder/similarity_functions_test.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
7,770
33.847534
80
py
flaxformer
flaxformer-main/flaxformer/architectures/dual_encoder/poolings.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
12,448
33.969101
105
py
flaxformer
flaxformer-main/flaxformer/architectures/dual_encoder/single_tower_logit_functions.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
2,595
37.176471
80
py
flaxformer
flaxformer-main/flaxformer/architectures/dual_encoder/l2_norm.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
1,468
27.803922
74
py
flaxformer
flaxformer-main/flaxformer/architectures/h_transformer/hierarchical_relative_position_bias_test.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
2,070
31.873016
95
py
flaxformer
flaxformer-main/flaxformer/architectures/h_transformer/token_hierarchy.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
34,032
34.525052
89
py
flaxformer
flaxformer-main/flaxformer/architectures/h_transformer/h_attention.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
40,618
39.700401
126
py
flaxformer
flaxformer-main/flaxformer/architectures/h_transformer/h_transformer_1d_architecture_test_utils.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
11,786
38.159468
102
py
flaxformer
flaxformer-main/flaxformer/architectures/h_transformer/hierarchical_relative_position_bias.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
5,722
41.392593
127
py
flaxformer
flaxformer-main/flaxformer/architectures/h_transformer/h_transformer_1d_architecture.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
34,420
38.609896
106
py
flaxformer
flaxformer-main/flaxformer/architectures/h_transformer/h_transformer_utils.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
2,591
31
80
py
flaxformer
flaxformer-main/flaxformer/architectures/h_transformer/h_transformer_1d_architecture_test.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
14,614
35.5375
119
py
flaxformer
flaxformer-main/flaxformer/architectures/h_transformer/partitioning.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
6,712
29.103139
79
py
flaxformer
flaxformer-main/flaxformer/architectures/h_transformer/h_attention_test.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
11,252
37.145763
80
py
flaxformer
flaxformer-main/flaxformer/architectures/h_transformer/token_hierarchy_test.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
13,102
41.267742
80
py
flaxformer
flaxformer-main/flaxformer/architectures/perceiver_ar/rotary_embedding_test.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
4,786
31.344595
85
py
flaxformer
flaxformer-main/flaxformer/architectures/perceiver_ar/attention_test.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
6,168
40.682432
79
py
flaxformer
flaxformer-main/flaxformer/architectures/perceiver_ar/slicing.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
4,025
34.946429
79
py
flaxformer
flaxformer-main/flaxformer/architectures/perceiver_ar/perceiver_ar_architecture_test_utils.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
6,286
36.646707
105
py
flaxformer
flaxformer-main/flaxformer/architectures/perceiver_ar/dense_attention.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
57,763
44.41195
122
py
flaxformer
flaxformer-main/flaxformer/architectures/perceiver_ar/t5_models.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
31,087
40.176159
86
py
flaxformer
flaxformer-main/flaxformer/architectures/perceiver_ar/perceiver_ar_architecture_test.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
4,857
34.720588
113
py
flaxformer
flaxformer-main/flaxformer/architectures/perceiver_ar/attention.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
4,788
34.474074
80
py
flaxformer
flaxformer-main/flaxformer/architectures/perceiver_ar/decoder_layer.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
15,474
39.4047
104
py
flaxformer
flaxformer-main/flaxformer/architectures/perceiver_ar/parallel_fused_decoder.py
# Copyright 2023 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
17,040
40.563415
104
py