Giter VIP home page Giter VIP logo

dml's Introduction

DML_pytorch

This repository is the unofficial implementation of :
Deep Mutual Learning (Ying Zhang, Tao Xiang, Timothy M. Hospedales, Huchuan Lu)

To do

  • more student networks (now 2 networks)
  • implement other model not only Resnet_32,WRN_28_10
  • experimental environment setting and comparison of paper results
  • visualization

Experimental setting

  1. CIFAR 100
    • epochs : 200
    • batch size : 64
    • optimizer :
      • SGD with Nesterov momentum
      • initial learning rate = 0.1
      • momentum = 0.9
      • The learning rate dropped by 0.1 every 60 epochs (step=60, gamma=0.1)
    • augmentation
      • horizontal flips
      • random crops : padding=4, padding_mode='reflect'

Loss

Deep Mutual Learning (DML) schematic

스크린샷 2021-08-24 오후 2 08 39

스크린샷 2021-08-24 오후 2 38 45

 In pytorch : L_c1=nn.CrossEntropyLoss(z1,label)

스크린샷 2021-08-24 오후 2 48 50

스크린샷 2021-08-24 오후 2 04 38

스크린샷 2021-08-24 오후 2 03 16

 In pytorch : D_kd(p2||p1)=nn.KLDivLoss(F.log_softmax(z1),F.softmax(z2))

Result

Network Types Network Types Ind. Ind. DML DML DML-Ind. DML-Ind.
Net1 Net2 Net1 Net2 Net1 Net2 Net1 Net2
Resnet-32 Resnet-32 70.97 70.97 72.97 72.85 2.00 1.88
Resnet-32 WRN_28_10 70.97 79.93 72.55 80.09 1.58 0.16
Top-1 accuracy (%) on the CIFAR-100 dataset

It seems that this implementation doesn't properly yet
2021.8.25) I didn't completely separate the graphs of the two networks, And I'm experimenting again with modifications.

Usage

  1. clone repository git clone 'https://github.com/pilsHan/DML.git'
  2. requirements : pytorch and torchvision (can be run with colab)
  3. run main.py python main.py --num_workers 2

Reference

https://github.com/chxy95/Deep-Mutual-Learning
https://github.com/meliketoy/wide-resnet.pytorch
https://arxiv.org/pdf/1706.00384.pdf

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.