Giter Site home page Giter Site logo

Attention Mechanism (as implemented in Vision Transformer) for Image compression

The encoder takes the original image (in this case we used 3x224x224 images), divides it into fixed size patches, adds positional information to each patch, applies dropout and then passes the image through a cascade of 6 blocks of a Transformer module followed by layer normalization and the linear mapping. We use a patch size of 16 x 16 and each patch is flattened into a vector of size 1x768 (3x16x16). As a result, each 224x224 image is divided into 196 patches and reshaped into a 196x768 matrix. The embedding size (768) and the number of patches are maintained throughout the encoder module until the final linear layer. This linear layer is the one that does the compression, converting each image’s representation to a 1x1176 vector. Thus, the encoder compresses the image from 3x224x224x8 bits to 1176x64 bits which is 0.5 bits per pixel.

For the decoder, we use one linear layer to expand the compressed representation from a vector of size 1176 to a vector of size 150528 which is then reshaped into a tensor of shape (3x224x224).

neliphaz45's Projects

ab-testing-ads icon ab-testing-ads

This is a Machine Learning project on using A/B Hypothesis Testing technique to evaluate Ad campaign performance

d2l-en icon d2l-en

Interactive deep learning book with multi-framework code, math, and discussions. Adopted at 400 universities from 60 countries including Stanford, MIT, Harvard, and Cambridge.

demo-repo icon demo-repo

Demo for Github intro video. https://www.youtube.com/watch?v=RGOj5yH7evk

gfpgan icon gfpgan

GFPGAN aims at developing Practical Algorithms for Real-world Face Restoration.

git_studies icon git_studies

Introduction to Github from https://www.youtube.com/watch?v=RGOj5yH7evk

machine_learning_projects icon machine_learning_projects

This repository consists of various case studies using Regression, Classification and Clustering algorithms.

machinelearninglibraries icon machinelearninglibraries

This is a project that will contain different Machine Learning codes and libraries used in different model optimization. These are from different resources and researches that I did for implementation and guide fellow Machine Learning enthusiasts

opencv-course icon opencv-course

Learn OpenCV in 4 Hours - Code used in my Python and OpenCV course on freeCodeCamp.

prediction-of-store-sales icon prediction-of-store-sales

Using Machine Learning techniques to forecast sales in different stores across several cities six weeks ahead of time.

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.