Git Product home page Git Product logo

cifar-10's Introduction

cifar-10

实验内容

step 1: 检查初始Loss

initial_loss

正常初始Loss为2.4左右,该模型初始Loss为2.32,处于正常范围。

step 2: 在小样本上拟合

small_sample 取batch_size为256的10个mini_batch, 在该数据上拟合,567次迭代后准确率达到0.954,说明该模型对于cifar-10数据集是有效的。

step 3: 找到使梯度下降得最快的学习率

选取learning_rate为1e-1, 1e-2, 1e-3, 1e-4, 对所有batch迭代一个epoch,结果如下: learning_rate 可以看到,当lr为0.1时,Loss下降的最快,但是波动比较大,而lr为0.01时,Loss稳定下降。当lr为1e-3和1e-4时,Loss下降的十分缓慢。

step 4: 根据不同参数,训练1-5个epoch

由上一步我们可以看到,比较合适的学习率为0.1或0.01,因此我们设置学习率为这两个参数,再组合weight_decay为1e-4, 1e-5, 0训练5个epoch,结果如下:

learning_rate weight_decay acc
1e-1 1e-4 70.4
1e-1 1e-5 71.1
1e-1 0 71.5
1e-2 1e-4 44.3
1e-2 1e-5 42.7
1e-2 0 45.3

可以看到,当lr为0.1,weight_decay为0时,模型的准确率最高。

step 5: 根据选定的参数,训练20个epoch,画出Loss曲线和Acc曲线。

image image image image

可见,训练集的准确率曲线与验证集的准确率曲线较为拟合。

cifar-10's People

Contributors

cocoaxx 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.