Code Monkey home page Code Monkey logo

lenet-5's Introduction

LeNet-5

This implements a slightly modified LeNet-5 [LeCun et al., 1998a] and achieves an accuracy of ~99% on the MNIST dataset.

Epoch Train Loss visualization

Setup

Install all dependencies using the following command

$ pip install -r requirements.txt

Usage

Start the visdom server for visualization

$ python -m visdom.server

Start the training procedure

$ python run.py

See epoch train loss live graph at http://localhost:8097.

The trained model will be exported as ONNX to lenet.onnx. The lenet.onnx file can be viewed with Neutron

References

[1] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. "Gradient-based learning applied to document recognition." Proceedings of the IEEE, 86(11):2278-2324, November 1998.

lenet-5's People

Contributors

activatedgeek avatar dependabot[bot] avatar k0nze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

lenet-5's Issues

CrossEntropyLoss with LogSoftmax?

('sig7', nn.LogSoftmax(dim=-1))

I think there is no need to put LogSoftmax layer at the end of network if you are going to use CrossEntropyLoss ? Because CrossEntropyLoss combines nn.LogSoftmax() and nn.NLLLoss() in one single class.

请问一下,这个什么意思

F:\Git\LeNet-5>python run.py
Train - Epoch 1, Batch: 0, Loss: 2.312821
Traceback (most recent call last):
File "run.py", line 93, in
main()
File "run.py", line 89, in main
train_and_test(e)
File "run.py", line 83, in train_and_test
train(epoch)
File "run.py", line 58, in train
if viz.check_connection():
AttributeError: 'Visdom' object has no attribute 'check_connection'

依赖项设置

numpy==1.17.0
torch==1.4.0
torchvision==0.4.0
visdom==0.1.6
Pillow==6.2.0
onnx==1.6.0
我这样设置对吗

why need add this layer?

hi!
First of all, thank you very much for your open source code. Then, when I was looking at the code, I found that I didn't understand one sentence. Could you please help me explain it?

output += x ?

Is it okay if I get rid of this line ?

thanks!

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.