Giter VIP home page Giter VIP logo

pytorch-transfomer's Introduction

This is an implementation of the Transformer algorithm on time series data in pytorch. In this case the modelling of the sigmoid function is used as a toy problem

Usage:
First all the necessary imports as well as matplotlib for visualisation.

Next we need to define some hyperparameters which will vary depending on the task.

We initilisise the Network and an optimizier, in this case Adam, as well as an empty list to track losses for visualisation.

Using matplotlib in jupyter notebook we can graph losses in real time, first lets initialise a figure.

We can now being training

You should see a live plot that looks similar to this tracking the ouput error

Now that the network is trained, lets give it the first few values of the sigmoid function and see how it approximates the rest.
We create another figure to visualise this.

If all went well, the output should look something like this :

Note that the network uses past values instead of the x axis for its predictions , so it makes sense that the output is offset. However it did succesfully capture the shape.

Resources:

pytorch-transfomer's People

Contributors

liammaclean216 avatar vikcas 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.