Git Product home page Git Product logo

vision_transformer_keras's Introduction

Vision Transformer

Vision Transformer teaser

Content

Getting Started

  • Clone the repository

Prerequisites

  • Tensorflow 2.2.0+
  • Tensorflow_addons
  • Python 3.6+
  • Keras 2.3.0
  • PIL
  • numpy
pip install -r requirements.txt

Running

Training

```
python train.py
```

Usage

Training

usage: train.py [-h] [--logdir LOGDIR] [--image-size IMAGE_SIZE]
                [--patch-size PATCH_SIZE] [--num-layers NUM_LAYERS]
                [--d-model D_MODEL] [--num-heads NUM_HEADS]
                [--mlp-dim MLP_DIM] [--lr LR] [--weight-decay WEIGHT_DECAY]
                [--batch-size BATCH_SIZE] [--epochs EPOCHS]
optional arguments: -h, --help                show this help message and exit
                    --log_dir                 folder to save weights
                    --image_size              size of input image
                    --patch_size              size of patch to encode
                    --num-layers              number of transformer
                    --d-model                 embedding dimension
                    --mlp-dim                 hidden layer dimension
                    --lr                      learning rate
                    --weight-decay            weight decay
                    --batch-size              batch size
                    --epochs                  epochs

License

This project is licensed under the MIT License - see the LICENSE file for details

References

[1] AN IMAGE IS WORTH 16X16 WORDS: TRANSFORMERS FOR IMAGE RECOGNITION AT SCALE - link

[2] Text classification with Transformer - link

Acknowledgments

  • This work is heavily based on Keras version of Transformer.
  • Any ideas on updating or misunderstanding, please send me an email: [email protected]
  • If you find this repo helpful, kindly give me a star.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.