{"id":19834979,"url":"https://github.com/hijkzzz/cuda-neural-network","last_synced_at":"2025-07-14T10:34:16.707Z","repository":{"id":138638333,"uuid":"180278107","full_name":"hijkzzz/cuda-neural-network","owner":"hijkzzz","description":" Convolutional Neural Network with CUDA (MNIST 99.23%)","archived":false,"fork":false,"pushed_at":"2022-04-04T06:31:52.000Z","size":1873,"stargazers_count":190,"open_issues_count":2,"forks_count":40,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-01T17:32:06.245Z","etag":null,"topics":["cnn","cpp","cuda","mnist","neural-network"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hijkzzz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-04-09T03:31:11.000Z","updated_at":"2025-04-10T10:12:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"eab3ff76-b818-45e0-b09a-2466385b4e9e","html_url":"https://github.com/hijkzzz/cuda-neural-network","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/hijkzzz/cuda-neural-network","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hijkzzz%2Fcuda-neural-network","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hijkzzz%2Fcuda-neural-network/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hijkzzz%2Fcuda-neural-network/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hijkzzz%2Fcuda-neural-network/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hijkzzz","download_url":"https://codeload.github.com/hijkzzz/cuda-neural-network/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hijkzzz%2Fcuda-neural-network/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265281024,"owners_count":23739859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cnn","cpp","cuda","mnist","neural-network"],"created_at":"2024-11-12T12:06:06.881Z","updated_at":"2025-07-14T10:34:16.661Z","avatar_url":"https://github.com/hijkzzz.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# neural-network\nConvolutional Neural Network with CUDA\n\n## Layers\n* Linear\n* Conv2D\n* MaxPool2D\n* ReLU\n* Softmax\n* Sigmoid\n* NLLLoss\n\n## Optimizer\n* RMSProp\n\n## Prerequisites\n* CMake 3.8+\n* MSVC14.00/GCC6+\n* **CUDA 10.x [Not compatible with CUDA 11.x]**\n\n## Run\n```\nmkdir build \u0026\u0026 cd build\ncmake .. -DCMAKE_BUILD_TYPE=Release\nmake -j10\nmkdir mnist_data \u0026\u0026 cd mnist_data\nwget -c http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz\nwget -c http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz\nwget -c http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz\nwget -c http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz\ngunzip train-images-idx3-ubyte.gz \ngunzip train-labels-idx1-ubyte.gz \ngunzip t10k-labels-idx1-ubyte.gz \ngunzip t10k-images-idx3-ubyte.gz \ncd .. \u0026\u0026 ./mnist\n```\n\n## Performance\n```\nconv 1 32 5 relu\nmaxpool 2\nconv 32 64 5 relu\nmaxpool 2\nconv 64 128 3 relu\nfc 4 * 128 128 relu\nfc 128 10 relu\nsoftmax\n\nshuffle = true\nbatch_size = 128\nlearning_rate = 0.003\nL2 = 0.0001\nbeta = 0.99\n```\n\n* 1 epoch 93%\n* 10 epochs 99.12%\n* 30 epochs 99.23%\n* 10s / epoch(GTX1070)\n\n## TODO\n* Faster matmul kernel function\n* CUDA Streams\n\n## References\n* [High Performance Convolutional Neural Networks for Document Processing](https://hal.inria.fr/file/index/docid/112631/filename/p1038112283956.pdf)\n* [卷积神经网络(CNN)反向传播算法](https://www.cnblogs.com/pinard/p/6494810.html)\n* [矩阵求导术](https://zhuanlan.zhihu.com/p/24709748)\n* Caffe\n* CUDA Toolkit Documents\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhijkzzz%2Fcuda-neural-network","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhijkzzz%2Fcuda-neural-network","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhijkzzz%2Fcuda-neural-network/lists"}