Code Monkey home page Code Monkey logo

pure_transformer's Introduction

pure_transformer

pure_transformer is just a repo about transformer, derived from SamLynnEvans/Transformer and The Annotated Transformer

  1. reconstructe the project structure
  2. update code with new pytorch api

Usage

first, you would like to train your model, as follow

python train.py -src_data pathto/lang1.txt -trg_data pathto/lang2.txt -src_lang lang1 -trg_lang lang2

after train model, you can get a vocab and a model in folder weights/.

we set deafult args in code. download this repo, and just click you run button. Then take a meal, whatever

torchtext.data have no attribute 'Iterator' in the latest release

torchtext.data and torchtext.legacy will be complete removed. In this issue link, you can find a migration tutorial.

if you want to customize your data input, you can follow the tutorial, or you can like me, debug code, find what kind of data we put in model.

torch.autograd.Variable() deprecated

Variables are no longer necessary to use autograd with tensors. 
Autograd automatically supports Tensors with requires_grad set to True

here's my naive solution, substiting Variable() with torch.tensor()

pure_transformer's People

Contributors

eleveyuan avatar

Stargazers

 avatar

Watchers

 avatar

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.