GithubHelp home page GithubHelp logo

heng-yuwen / dynamic-backward-attention-transformer Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 690 KB

"Enhancing Material Features Using Dynamic Backward Attention on Cross-Resolution Patches"

Python 99.86% Dockerfile 0.14%

dynamic-backward-attention-transformer's Introduction

Dynamic-Backward-Attention-Transformer

This is the official repository of the paper "Enhancing Material Features Using Dynamic Backward Attention on Cross-Resolution Patches".

To avoid leaking information, the code is hosted on anonymous.4open.science, which does not support clone nor download the whole project. Please view the code online. The main code is at torchtools/models/dpglt/dpglt_single_branch.py

If you want to try the code, please read the following guidance.

Environment

To install the dependencies, please refer to the conda env file (modify the name and prefix first).

conda env create -f environment.yml

Or, if you prefer using docker, you can build the environment with the Dockerfile in this project:

sudo DOCKER_BUILDKIT=1 docker build -t dbat:1.0.0 -f Dockerfile . 

Local Material Dataset

Please download the original dataset from https://vision.ist.i.kyoto-u.ac.jp/codeanddata/localmatdb/, into the folder datasets/localmatdb. Then you can zip the folder localmatdb since our dataloader assumes the images are zipped.

Pre-trained DBAT checkpoint

Please download the pre-trained checkpoints into the folder "checkpoints"

mkdir -p checkpoints/dpglt_mode95/accuracy

Train DBAT

To train our DBAT, you can use the code below:

python train_sota.py --data-root "./datasets" --batch-size 4 --tag dpglt --gpus 1 --num-nodes 1 --epochs 200 --mode 95 --seed 42

To test the trained model, you can specify the checkpoint path with the --test option

python train_sota.py --data-root "./datasets" --batch-size 4 --tag dpglt --gpus 1 --num-nodes 1 --epochs 200 --mode 95 --seed 42 --test accuracy/epoch\=126-valid_acc_epoch\=0.87.ckpt

dynamic-backward-attention-transformer's People

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.