file_path stringlengths 3 280 | file_language stringclasses 66
values | content stringlengths 1 1.04M | repo_name stringlengths 5 92 | repo_stars int64 0 154k | repo_description stringlengths 0 402 | repo_primary_language stringclasses 108
values | developer_username stringlengths 1 25 | developer_name stringlengths 0 30 | developer_company stringlengths 0 82 |
|---|---|---|---|---|---|---|---|---|---|
bert/interactive.py | Python | #!/usr/bin/env python3 -u
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
"""
Trans... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/bert/WikiExtractor.py | Python | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
# Version: 2.75 (March 4, 2017)
# Author: Giuseppe Attardi (attardi@di.unipi.it), University of Pisa
#
# Contributors:
# Antonio Fuschetto (fuschett@aol.com)
# Leonardo Souza (lsouza@amt... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/bert/concat_short_sentences.py | Python | import sys
def score(line1, line2): # the smaller the more likely to be concat
s = len(line1) + len(line2)
if s > 250:
return 9999999
if line1[-1] in ['.', '"', '!', '?']:
s += 5
return s
def main():
buf = []
for line in sys.stdin:
words = line.strip().split()
... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/bert/filter_and_cleanup_lines.py | Python | import re
import string
import sys
from collections import Counter
def is_valid(line):
l = len(line)
if l > 1000000 or l < 50:
return False
count = Counter(line)
alpha_cnt = sum(count[ch] for ch in string.ascii_letters)
if alpha_cnt < 50 or alpha_cnt / l < 0.7:
return False
if ... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/bert/process_bert.sh | Shell | #!/usr/bin/env bash
git clone https://github.com/kevinboone/epub2txt
cd epub2txt
make
cd ..
# Crawl your own book_corpus data and put them at book_corpus/
echo 'BookCorpus(epub)'
rm book_corpus/data/English/instructors-manual-identifeye-worskhop.epub
find book_corpus/data/American book_corpus/data/British book_corpus... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/bert/segment_sentence.py | Python | import re
import sys
from multiprocessing import Pool
import spacy
spacy.require_gpu()
nlp = None
def init():
global nlp
nlp = spacy.load('en', disable=['tagger', 'ner', 'textcat'])
def segment(line):
global nlp
return ''.join([str(sent) + '\n'
for sent in nlp(line).sents
... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/bert/split.py | Python | import sys
def main():
cnt = 0
f_cnt = 0
input_file = sys.argv[1]
output_prefix = sys.argv[2]
chunk_size = int(sys.argv[3])
f_ov = open(f'{output_prefix}.valid.txt', 'w', encoding='utf-8')
f_ot = None
with open(input_file, 'r', encoding='utf-8') as f_in:
for line in f_in:
... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/common/clone-repos.sh | Shell | #!/usr/bin/env bash
echo ' - Cloning Moses github repository (for tokenization scripts)...'
git clone https://github.com/moses-smt/mosesdecoder.git
echo ' - Cloning Subword NMT repository (for BPE pre-processing)...'
git clone https://github.com/rsennrich/subword-nmt.git
echo ' - Cloning FastBPE repository (for fast... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/common/length_filter_by_char.py | Python | import sys
for line in sys.stdin:
l = len(line)
if int(sys.argv[1]) <= l <= int(sys.argv[2]):
sys.stdout.write(line)
else:
sys.stdout.write('\n')
| zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/common/length_filter_by_token.py | Python | import sys
for line in sys.stdin:
l = len(line.strip().split(' '))
if int(sys.argv[1]) <= l <= int(sys.argv[2]):
sys.stdout.write(line)
else:
sys.stdout.write('\n')
| zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/common/precleanup_english.py | Python | import re
import sys
def pre_cleanup(line):
line = line.replace('\t', ' ') # replace tab with spaces
line = ' '.join(line.strip().split()) # remove redundant spaces
line = re.sub(r'\.{4,}', '...', line) # remove extra dots
line = line.replace('<<', '«').replace('>>', '»') # group << together
l... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/common/remove_non_utf8_chars.py | Python | import io
import sys
for line in io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8', errors='ignore'):
sys.stdout.write(line)
| zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/common/truncate_by_token.py | Python | import sys
max_len = int(sys.argv[1])
for line in sys.stdin:
lst = line.strip().split(' ')
if len(lst) <= max_len:
sys.stdout.write(line)
else:
sys.stdout.write(" ".join(lst[:max_len]) + '\n')
| zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/glue/align_text.py | Python | import sys
import re
for line in sys.stdin:
re.sub(r" n't\b", "n't", line)
re.sub(r" 's\b", "'s", line)
sys.stdout.write(line)
| zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/glue/download_glue_data.py | Python | ''' Script for downloading all GLUE data.
Note: for legal reasons, we are unable to host MRPC.
You can either use the version hosted by the SentEval team, which is already tokenized,
or you can download the original data from (https://download.microsoft.com/download/D/4/6/D46FF87A-F6B9-4252-AA8B-3604ED519838/MSRParaph... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/glue/generate_cola.py | Python | import argparse
import csv
import os
import torch
def main():
parser = argparse.ArgumentParser()
parser.add_argument("data", type=str,
help="path of data")
parser.add_argument("--output", type=str, required=True,
help="path of output")
args = parser.par... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/glue/generate_diagnostic.py | Python | import argparse
import csv
import os
_label_to_id = {
'neutral': 0,
'entailment': 1,
'contradiction': 2
}
def main():
parser = argparse.ArgumentParser()
parser.add_argument("data", type=str,
help="path of data")
parser.add_argument("--output", type=str, required=True,
... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/glue/generate_mnli.py | Python | import argparse
import csv
import os
import torch
_label_to_id = {
'neutral': 0,
'entailment': 1,
'contradiction': 2
}
def main():
parser = argparse.ArgumentParser()
parser.add_argument("data", type=str,
help="path of data")
parser.add_argument("--output", type=str, r... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/glue/generate_mnli_mm.py | Python | import argparse
import csv
import os
import torch
_label_to_id = {
'neutral': 0,
'entailment': 1,
'contradiction': 2
}
def main():
parser = argparse.ArgumentParser()
parser.add_argument("data", type=str,
help="path of data")
parser.add_argument("--output", type=str, r... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/glue/generate_mrpc.py | Python | import argparse
import csv
import os
import torch
def main():
parser = argparse.ArgumentParser()
parser.add_argument("data", type=str,
help="path of data")
parser.add_argument("--output", type=str, required=True,
help="path of output")
args = parser.par... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/glue/generate_qnli.py | Python | import argparse
import csv
import os
import torch
_label_to_id = {
'not_entailment': 0,
'entailment': 1
}
def main():
parser = argparse.ArgumentParser()
parser.add_argument("data", type=str,
help="path of data")
parser.add_argument("--output", type=str, required=True,
... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/glue/generate_qqp.py | Python | import argparse
import csv
import os
import torch
def main():
parser = argparse.ArgumentParser()
parser.add_argument("data", type=str,
help="path of data")
parser.add_argument("--output", type=str, required=True,
help="path of output")
args = parser.pars... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/glue/generate_rte.py | Python | import argparse
import csv
import os
import torch
_label_to_id = {
'not_entailment': 0,
'entailment': 1
}
def main():
parser = argparse.ArgumentParser()
parser.add_argument("data", type=str,
help="path of data")
parser.add_argument("--output", type=str, required=True,
... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/glue/generate_sts.py | Python | import argparse
import csv
import os
import torch
def main():
parser = argparse.ArgumentParser()
parser.add_argument("data", type=str,
help="path of data")
parser.add_argument("--output", type=str, required=True,
help="path of output")
args = parser.pars... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/glue/generate_wnli.py | Python | import argparse
import csv
import os
import torch
def main():
parser = argparse.ArgumentParser()
parser.add_argument("data", type=str,
help="path of data")
parser.add_argument("--output", type=str, required=True,
help="path of output")
args = parser.par... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/glue/process_glue.sh | Shell | #!/usr/bin/env bash
BPE_CODE_PATH=$1
DICT_PATH=$2
python download_glue_data.py --data_dir glue --tasks CoLA,SST,MRPC,QQP,STS,MNLI,QNLI,RTE,WNLI,diagnostic
python generate_cola.py glue/CoLA --output glue/CoLA
python single_sentence.py glue/SST-2 --output glue/SST-2
python generate_mrpc.py glue/MRPC --output glue/MRPC... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/glue/process_predictions.py | Python | import argparse
import os
rte_labels = ['not_entailment', 'entailment']
mnli_labels = ['neutral', 'entailment', 'contradiction']
qnli_labels = ['not_entailment', 'entailment']
def main():
parser = argparse.ArgumentParser()
parser.add_argument('input', type=str,
help='input path of pre... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/glue/single_sentence.py | Python | import argparse
import csv
import os
import torch
def main():
parser = argparse.ArgumentParser()
parser.add_argument("data", type=str,
help="path of data")
parser.add_argument("--output", type=str, required=True,
help="path of output")
args = parser.par... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/test/generate_test_scripts.py | Python | import os
import sys
import copy
import itertools
import inspect
def task(name, n_sentences, task, criterion, symmetric, n_classes, data_path):
return locals()
def params(*args):
keys = ["seed_list", "n_epoch_list", "batch_sz_list", "lr_list", "weight_decay_list"]
assert len(args) == len(keys)
values ... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/test/test-our-best-setting.sh | Shell | #!/usr/bin/env bash
BERT_DIR=log/bert/transformer_bert_base_macaron
CKPT=$1
CKPT_ID=$(echo $CKPT | sed 's/checkpoint//g' | sed 's/\.pt//g' | sed 's/^_//g')
BERT_PATH=${BERT_DIR}/$CKPT
DATA_PATH=glue
function run_exp {
TASK_NAME=$1
TASK_TYPE=$2
SYMMETRIC_FLAG=$3
TASK_CRITERION=$4
N_CLASSES=$5
N... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/train/train-distributed.sh | Shell | #!/usr/bin/env bash
CODE_PATH=.
cd $CODE_PATH
export PYTHONPATH=$CODE_PATH:$PYTHONPATH
model=transformer
PROBLEM=bert
ARCH=transformer_bert_base_macaron
# Because of copyright, we cannot provide our binarized data.
# Please process your own training data.
DATA_PATH=data-bin/bert_corpus/
OUTPUT_PATH=log/$PROBLEM/ARCH
... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/macaron-scripts/train/train.sh | Shell | #!/usr/bin/env bash
CODE_PATH=.
cd $CODE_PATH
export PYTHONPATH=$CODE_PATH:$PYTHONPATH
model=transformer
PROBLEM=bert
ARCH=transformer_bert_base_macaron
# Because of copyright, we cannot provide our binarized data.
# Please process your own training data.
DATA_PATH=data-bin/bert_corpus/
OUTPUT_PATH=log/$PROBLEM/ARCH
... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/multiprocessing_train.py | Python | #!/usr/bin/env python3 -u
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import o... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/preprocess.py | Python | #!/usr/bin/env python3
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
"""
Data pre... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/preprocess_bert.py | Python | #!/usr/bin/env python3
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
"""
Data pre... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/score.py | Python | #!/usr/bin/env python3
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
"""
BLEU sco... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/scripts/average_checkpoints.py | Python | #!/usr/bin/env python3
import argparse
import collections
import torch
import os
import re
def average_checkpoints(inputs):
"""Loads checkpoints from inputs and returns a model with averaged weights.
Args:
inputs: An iterable of string paths of checkpoints to load from.
Returns:
A dict of s... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/scripts/build_sym_alignment.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
#
"""
Use this script in order to ... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/scripts/convert_dictionary.lua | Lua | -- Copyright (c) 2017-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the license found in the LICENSE file in
-- the root directory of this source tree. An additional grant of patent rights
-- can be found in the PATENTS file in the same directory.
--
-- Usage: convert_dictiona... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/scripts/convert_model.lua | Lua | -- Copyright (c) 2017-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the license found in the LICENSE file in
-- the root directory of this source tree. An additional grant of patent rights
-- can be found in the PATENTS file in the same directory.
--
-- Usage: convert_model.lu... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/scripts/read_binarized.py | Python | #!/usr/bin/env python3
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
#
import ar... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/setup.py | Python | #!/usr/bin/env python3
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
from setupt... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/tests/test_average_checkpoints.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import collections
import os
impor... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/tests/test_backtranslation_dataset.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import argparse
import unittest
i... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/tests/test_binaries.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import contextlib
from io import S... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/tests/test_character_token_embedder.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import torch
import unittest
from... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/tests/test_convtbc.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import torch
import unittest
from ... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/tests/test_dictionary.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import tempfile
import unittest
i... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/tests/test_iterators.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import unittest
from fairseq.data... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/tests/test_label_smoothing.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import argparse
import copy
import... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/tests/test_reproducibility.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import contextlib
from io import S... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/tests/test_sequence_generator.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import argparse
import unittest
i... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/tests/test_sequence_scorer.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import argparse
import unittest
i... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/tests/test_train.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import contextlib
from io import S... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/tests/test_utils.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import unittest
import torch
fro... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/tests/utils.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import argparse
import torch
from... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
bert/train.py | Python | #!/usr/bin/env python3 -u
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
"""
Train... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/distributed_train.py | Python | #!/usr/bin/env python3 -u
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import o... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/eval_lm.py | Python | #!/usr/bin/env python3 -u
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
"""
Evalu... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/__init__.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
from .multiprocessing_pdb import p... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/bleu.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import ctypes
import math
import t... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/clib/libbleu/libbleu.cpp | C++ | /**
* Copyright 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <map>
#include <array>
#include <cstring>
#include <cstdio>
typedef struct
{
size_t reflen;
size_t pre... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/clib/libbleu/module.cpp | C++ | /**
* Copyright 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <Python.h>
static PyMethodDef method_def[] = {
{NULL, NULL, 0, NULL}
};
static struct PyModuleDef module_d... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/criterions/__init__.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import importlib
import os
from .... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/criterions/adaptive_loss.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import math
import torch.nn.funct... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/criterions/cross_entropy.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import math
import torch.nn.functi... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/criterions/fairseq_criterion.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
from torch.nn.modules.loss import ... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/criterions/label_smoothed_cross_entropy.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import math
from fairseq import u... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/data/__init__.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
from .dictionary import Dictionary... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/data/backtranslation_dataset.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
from fairseq import sequence_gene... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/data/data_utils.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import contextlib
import os
impor... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/data/dictionary.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
from collections import Counter
im... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/data/fairseq_dataset.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import torch.utils.data
from fair... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/data/indexed_dataset.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import os
import struct
import nu... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/data/iterators.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import itertools
import math
impo... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/data/language_pair_dataset.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import numpy as np
import torch
f... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/data/monolingual_dataset.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import numpy as np
import torch
f... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/data/token_block_dataset.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import math
import numpy as np
im... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/distributed_utils.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
from collections import namedtuple... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/meters.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import time
class AverageMeter(o... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/models/__init__.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import argparse
import importlib
i... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/models/composite_encoder.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
from . import FairseqEncoder
cla... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/models/distributed_fairseq_model.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
from torch.nn import parallel
fro... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/models/fairseq_decoder.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import torch.nn as nn
import torch... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/models/fairseq_encoder.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import torch.nn as nn
class Fair... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/models/fairseq_incremental_decoder.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
from . import FairseqDecoder
cla... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/models/fairseq_model.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import torch
import torch.nn as nn... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/models/fconv.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import math
import torch
import to... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/models/fconv_self_att.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
#
import math
import torch
import... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/models/lstm.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import torch
import torch.nn as nn... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/models/transformer.py | Python | # Modified by Zhuohan Li in May 2019 for macaron-net
#
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in ... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/modules/__init__.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
from .adaptive_softmax import Adap... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/modules/adaptive_softmax.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import torch
import torch.nn.func... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/modules/beamable_mm.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import torch
import torch.nn as nn... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/modules/character_token_embedder.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import numpy as np
import torch
im... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/modules/conv_tbc.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import torch
from torch.nn.modules... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/modules/downsampled_multihead_attention.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
#
import math
import torch
import... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/modules/grad_multiply.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import torch
class GradMultiply(... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/modules/highway.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import torch
import torch.nn.funct... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
translation/fairseq/modules/learned_positional_embedding.py | Python | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import torch.nn as nn
from fairse... | zhuohan123/macaron-net | 147 | Codes for "Understanding and Improving Transformer From a Multi-Particle Dynamic System Point of View" | Python | zhuohan123 | Zhuohan Li | vLLM / Meta |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.