Giter Club home page Giter Club logo

crcd's Introduction

Complementary Relation Contrastive Distillation (CRCD)

Introduction

  • This repo is the incomplete implementation of the following paper:

    "Complementary Relation Contrastive Distillation" (CRCD). arxiv

  • I am sorry that the source code in this repository is not an official implementation, which is relies on some internal code of the company's self-developed deep learning library. However, I reimplented the most critical parts in the work with torch, thus it should be very easy to be pluged into the CRD repo.

  • I provide a example to use CRCD loss in CRD repo (train_student.py). Note that this training code is not checked and may have some bugs.

Key components

  • Relation contrastive loss

the crd-style implementation is here

  • Computation of gradient element

gradient element is computed in the def get_grad_loss() in the loops.py by using torch API torch.autograd.grad(). Then, the gradient relation can be estimated and the crcd loss utilizeing gradient elements can be obtained easily.

  • The very effective trick which is used in CRCD

It is very effective to adjust the distillation loss weight dynamically during the training procedures. We supply some strategy examples in the funtion def adjust_mimic_loss_weight() in the loops.py. In these strategy, the reregulatization term in the total loss from distillaltion loss is reduced according to a certain rule as the training progresses.

In our cifar100 experiments with 250 epochs training, we adopted the stepwise one: before the 240-th epoch, the loss weight maintains 1; after the 240-th, the loss weight is adjusted to 0 for the last 10 epochs. This means the students are finetuned for another 10 epochs with the minimun learning rate

crcd's People

Contributors

lechatelia avatar

Watchers

James Cloos 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.