All Projects → strutive07 → transformer-tensorflow2.0

strutive07 / transformer-tensorflow2.0

Licence: other
transformer in tensorflow 2.0

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language
perl
6916 projects
shell
77523 projects

Projects that are alternatives of or similar to transformer-tensorflow2.0

pcdarts-tf2
PC-DARTS (PC-DARTS: Partial Channel Connections for Memory-Efficient Differentiable Architecture Search, published in ICLR 2020) implemented in Tensorflow 2.0+. This is an unofficial implementation.
Stars: ✭ 25 (-52.83%)
Mutual labels:  tf2, tensorflow2
Swin-Transformer-Tensorflow
Unofficial implementation of "Swin Transformer: Hierarchical Vision Transformer using Shifted Windows" (https://arxiv.org/abs/2103.14030)
Stars: ✭ 45 (-15.09%)
Mutual labels:  tf2, transformer
CRNN.tf2
Convolutional Recurrent Neural Network(CRNN) for End-to-End Text Recognition - TensorFlow 2
Stars: ✭ 131 (+147.17%)
Mutual labels:  tf2, tensorflow2
spectral normalization-tf2
🌈 Spectral Normalization implemented as Tensorflow 2
Stars: ✭ 36 (-32.08%)
Mutual labels:  tf2, tensorflow2
muzero
A clean implementation of MuZero and AlphaZero following the AlphaZero General framework. Train and Pit both algorithms against each other, and investigate reliability of learned MuZero MDP models.
Stars: ✭ 126 (+137.74%)
Mutual labels:  tf2, tensorflow2
tf-faster-rcnn
Tensorflow 2 Faster-RCNN implementation from scratch supporting to the batch processing with MobileNetV2 and VGG16 backbones
Stars: ✭ 88 (+66.04%)
Mutual labels:  tf2, tensorflow2
keras efficientnet v2
self defined efficientnetV2 according to official version. Including converted ImageNet/21K/21k-ft1k weights.
Stars: ✭ 56 (+5.66%)
Mutual labels:  tf2, tensorflow2
transformer
Build English-Vietnamese machine translation with ProtonX Transformer. :D
Stars: ✭ 41 (-22.64%)
Mutual labels:  transformer, tensorflow2
TF2-GAN
🐳 GAN implemented as Tensorflow 2.X
Stars: ✭ 61 (+15.09%)
Mutual labels:  tf2, tensorflow2
manning tf2 in action
The official code repository for "TensorFlow in Action" by Manning.
Stars: ✭ 61 (+15.09%)
Mutual labels:  tf2, tensorflow2
tensorflow-ml-nlp-tf2
텐서플로2와 머신러닝으로 시작하는 자연어처리 (로지스틱회귀부터 BERT와 GPT3까지) 실습자료
Stars: ✭ 245 (+362.26%)
Mutual labels:  tf2, transformer
DolboNet
Русскоязычный чат-бот для Discord на архитектуре Transformer
Stars: ✭ 53 (+0%)
Mutual labels:  transformer, tensorflow2
Awesome-Tensorflow2
基于Tensorflow2开发的优秀扩展包及项目
Stars: ✭ 45 (-15.09%)
Mutual labels:  tf2, tensorflow2
node-ssq
A Node.JS library for sending Source Server Queries (SSQ) to source engine powered game servers (TF2, L4D, etc.).
Stars: ✭ 20 (-62.26%)
Mutual labels:  tf2
MusicTransformer-Pytorch
MusicTransformer written for MaestroV2 using the Pytorch framework for music generation
Stars: ✭ 106 (+100%)
Mutual labels:  transformer
datascienv
datascienv is package that helps you to setup your environment in single line of code with all dependency and it is also include pyforest that provide single line of import all required ml libraries
Stars: ✭ 53 (+0%)
Mutual labels:  tensorflow2
sourcepawn-navmesh
SourcePawn .NAV file reader.
Stars: ✭ 25 (-52.83%)
Mutual labels:  tf2
dodrio
Exploring attention weights in transformer-based models with linguistic knowledge.
Stars: ✭ 233 (+339.62%)
Mutual labels:  transformer
Context-Transformer
Context-Transformer: Tackling Object Confusion for Few-Shot Detection, AAAI 2020
Stars: ✭ 89 (+67.92%)
Mutual labels:  transformer
wxml-transformer
将微信小程序的wxml代码转换成js object或html片段
Stars: ✭ 18 (-66.04%)
Mutual labels:  transformer

Transformer-tensorflow2.0

attention is all you need (transformer) in tensorflow 2.0

paper review(pdf)

colab guide

Download pre-trained model(checkpoint)

Download pre-trained bpe data

DeepSource

How to train

  1. Install enviornments

    bash ubuntu16_04_cuda10_cudnn7_tensorflow2.0_install.sh

  2. Training

  • Single GPU training

    1. Change hyper parameter in train.py
    2. Run training script
    python train.py
  • Multi GPU training

    1. Change hyper parameter in distributed_train.py
    2. Run training script
    python distributed_train.py
  1. Test
  • if you did not train bpe, train bpe model or download pre-trained bpe model. LINK: Download pre-trained bpe data. You should save it in top dataset directory. example: ./dataset/train.en.segmented.vocab and so on.

How to add dataset

Add data config to data_loader.py

CONFIG = {
        'wmt14/en-de': {
            'source_lang': 'en',
            'target_lang': 'de',
            'base_url': 'https://nlp.stanford.edu/projects/nmt/data/wmt14.en-de/',
            'train_files': ['train.en', 'train.de'],
            'vocab_files': ['vocab.50K.en', 'vocab.50K.de'],
            'dictionary_files': ['dict.en-de'],
            'test_files': [
                'newstest2012.en', 'newstest2012.de',
                'newstest2013.en', 'newstest2013.de',
                'newstest2014.en', 'newstest2014.de',
                'newstest2015.en', 'newstest2015.de',
            ]
        }
    }

If you want to add custom dataset, add data config like below and add custom_dataset parameter to DataLoader.load

CONFIG = {
        'wmt14/en-de': {
            'source_lang': 'en',
            'target_lang': 'de',
            'train_files': ['train.en', 'train.de'],
            'vocab_files': ['vocab.50K.en', 'vocab.50K.de'],
            'dictionary_files': ['dict.en-de'],
            'test_files': [
                'newstest2012.en', 'newstest2012.de',
                'newstest2013.en', 'newstest2013.de',
                'newstest2014.en', 'newstest2014.de',
                'newstest2015.en', 'newstest2015.de',
            ]
        }
    }

data_loader = DataLoader(
    dataset_name='wmt14/en-de',
    data_dir='./datasets',
    batch_size=GLOBAL_BATCH_SIZE,
    bpe_vocab_size=BPE_VOCAB_SIZE,
    seq_max_len_source=SEQ_MAX_LEN_SOURCE,
    seq_max_len_target=SEQ_MAX_LEN_TARGET,
    data_limit=DATA_LIMIT,
    train_ratio=TRAIN_RATIO
)

dataset, val_dataset = data_loader.load(custom_dataset=True)

BLEU Score

Test Dataset BLEU Score
newstest2013 23.3
newstest2014 22.85
newstest2015 25.33
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].