Code Monkey home page Code Monkey logo

easycnn's Introduction

EasyCNN

Easy convolution neural network framework.

small, clean, easy to understand!

QQ群:603891505

blog about EasyCNN in Chinese.

port tensorflow model to easycnn model

Features

  • All in one: without any dependency, pure c++ implemented.
  • Basic layer: data layer, convolution layer, pooling layer, full connect layer, softmax layer, activation layers(sigmod, tanh, RELU)
  • Loss function: Cross Entropy, MSE.
  • Optimize method: SGD, SGDWithMomentum.
  • Multi-thread parallel optimized.
  • Tensorflow model support (traditional CNN only now).(link)

Examples

Todo List

  • fix train error when batch > 1 issue.
  • add load & save model function.
  • add more layer, such as batch normalization layer, dropout layer, etc.
  • add weight regular.
  • port to other platforms, such as linux, mac, android, iOS, etc.
  • optimize network train/test speed, use cuBLAS/OpenBLAS etc.
  • add more optimize method.
  • add unit test.
  • add license.

Bug Report

Use github issues please.

Pull Request

Pull request is welcome.

License

This project is released under the WTFPL LICENSE.

easycnn's People

Contributors

bajiaoyezi avatar xylcbd 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

easycnn's Issues

Clean up the git commit history

首先感谢分享这样一个CNN前向推理的开源代码,对于上手熟悉CNN推理框架、熟悉C++/C++11来说还是有帮助的。

不过在研读代码的过程中(我用的是source tree),发现其中存在历史分支以及合并,并且历史分支之间有重复的内容。例如"initialize repo"出现了两次,"update msvc project"出现了3次,整个commit tree看起来也变得不够清晰。

实际上,一共116次commit记录,没弄错的话只有37次commit是有效的。在Ubuntu/MacOS下,结合tig工具查看对比,git rebase -i bf22931后,把tig输出里的第24行(6ba7)到第80行(b796)的内容都drop掉(包括24和80行)即可得清爽的提交记录。我修改后,git log --oneline输出为:

(base) 1080Ti% git log --oneline
20b1571 fix decrypt bug
5b7d2f1 Update README.md
f2800ad Update README.md
8bb5cf3 fix padding bug of conv/pool layer.
5b89c5e add tensorflow model converter. fix bug of multi-thread parallel. fix bug of preprocess of input image(mnist).
f4a3327 add padding type of convolution layer. modify model archive type. disable encrypt model by default.
29bbcad fix bug.
db59a07 add xavier_init, moving_average
25d6dbd fix bug [max pooling].
6e64621 fix train loss calc wrong issue.
d545f7b add namespace.
d9acfa0 optimize performance.
175fd99 refactor code; optimized for multi-core platform;
28ed53e disable dropout in example mnist.
39b1c83 add NOMINMAX macro for windows.
98f76bc remove digit recognize example; add dropout layer; fix loss calculate wrong issue.
2a3ae2c fix bug.
648cd62 refactor some code. add more optimizer.
ad9e936 Update README.md
b82779a Update README.md
d958d05 update digit_data_sample.
a8f862a add android log support.
ccb5dbd add model crypt.
75613d4 add android makefile.
c914b60 Update README.md
2a2d9e2 Update README.md
34347da Update README.md
c5e0c27 add digit recognize example. fix bug.
8ab1500 Update README.md
f417f61 refactor example.
1563cd6 add mnist accuracy image.
bcb7fdf fix train error when batch > 1 issue.
f8a51ee add mnist data shuffle. modified weight algorithm.
c57d820 update README.md.
be51f5e add WTFPL license.
f9e1fbf Update README.md
ff36704 add model save & load.
edcfaea update msvc project.
7b311ea Update README.md
d065024 refactoring framework. add MSE loss function.
c97fd5a fix max pooling crash issue when batch is changed. add conv_net,mlp_net.
fe5e05f fix forward/backward bug.
3542395 finished backward phase.
a2dc1d9 add forward to label layer/SoftmaxLayer layer/activation layer.
9bdaf36 refactor framework. fix forward bug.
d380c92 fix forward bug.
63b39fb add assert function. finished forward.
0a53596 cnn framework improve. add log.
3e92c02 cnn framework improve.
5f99b8b init cnn framework.
bf22931 initialize repo.

验证集精确有96%,测试的时候标签全是错的?

_int main(int argc, char* argv[])
{
EasyCNN::set_thread_num(4);

const std::string model_file = "../res/model/mnist.modelx";

#if 0
const std::string mnist_train_images_file = "../res/mnist_data/train-images.idx3-ubyte";
const std::string mnist_train_labels_file = "../res/mnist_data/train-labels.idx1-ubyte";
train(mnist_train_images_file, mnist_train_labels_file, model_file);

//NOTE : NEVER NEVER fine tune network for the test accuracy!!!
const std::string mnist_test_images_file = "../res/mnist_data/t10k-images.idx3-ubyte";
const std::string mnist_test_labels_file = "../res/mnist_data/t10k-labels.idx1-ubyte";
test(mnist_test_images_file, mnist_test_labels_file, model_file);

#else
const std::string mnist_test_images_file = "../res/mnist_data/t10k-images.idx3-ubyte";
const std::string mnist_test_labels_file = "../res/mnist_data/t10k-labels.idx1-ubyte";
std::vector<std::pair<int, cv::Mat>> samples = export_random_mnist_image(mnist_test_images_file, mnist_test_labels_file, 10);
test_single(samples, model_file);
#endif
return 0;
}_
我在训练的时候,验证集精度能达到96%以上,训练好模型后,用test_single函数测出的结果全是错的,这是为什么?

Which opencv version?

Hi!

I am using VS2015 and opencv-3.4.6 to build the project. But I got an link error: LINK : fatal error LNK1104: cannot open file“opencv_world300d.lib”.

Could you tell me which opencv version did you use when write the project?

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.