{"id":32954997,"url":"https://github.com/sudachen/go-dnn","last_synced_at":"2025-11-13T03:00:56.351Z","repository":{"id":57496312,"uuid":"202492512","full_name":"sudachen/go-dnn","owner":"sudachen","description":"Deep Neural Networks for Golang (powered by MXNet). The new updated version - https://github.com/go-ml-dev/nn ","archived":true,"fork":false,"pushed_at":"2020-04-26T07:02:26.000Z","size":172,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-15T05:55:40.677Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sudachen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-15T07:12:09.000Z","updated_at":"2025-04-14T08:09:30.000Z","dependencies_parsed_at":"2022-09-03T02:30:31.823Z","dependency_job_id":null,"html_url":"https://github.com/sudachen/go-dnn","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sudachen/go-dnn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudachen%2Fgo-dnn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudachen%2Fgo-dnn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudachen%2Fgo-dnn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudachen%2Fgo-dnn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sudachen","download_url":"https://codeload.github.com/sudachen/go-dnn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudachen%2Fgo-dnn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284145006,"owners_count":26954846,"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","status":"online","status_checked_at":"2025-11-13T02:00:06.582Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-11-12T22:00:41.097Z","updated_at":"2025-11-13T03:00:56.343Z","avatar_url":"https://github.com/sudachen.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":["Tools","[Tools](#tools-1)"],"readme":"\n[![Go Report Card](https://goreportcard.com/badge/github.com/sudachen/go-dnn)](https://goreportcard.com/report/github.com/sudachen/go-dnn)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\nIt's an old version of dnn fo golang. Please see new updated version https://github.com/go-ml-dev/nn\n\n```golang\nimport (\n\t\"github.com/sudachen/go-dnn/data/mnist\"\n\t\"github.com/sudachen/go-dnn/fu\"\n\t\"github.com/sudachen/go-dnn/mx\"\n\t\"github.com/sudachen/go-dnn/ng\"\n\t\"github.com/sudachen/go-dnn/nn\"\n\t\"gotest.tools/assert\"\n\t\"testing\"\n\t\"time\"\n)\n\nvar mnistConv0 = nn.Connect(\n\t\u0026nn.Convolution{Channels: 24, Kernel: mx.Dim(3, 3), Activation: nn.ReLU},\n\t\u0026nn.MaxPool{Kernel: mx.Dim(2, 2), Stride: mx.Dim(2, 2)},\n\t\u0026nn.Convolution{Channels: 32, Kernel: mx.Dim(5, 5), Activation: nn.ReLU, BatchNorm: true},\n\t\u0026nn.MaxPool{Kernel: mx.Dim(2, 2), Stride: mx.Dim(2, 2)},\n\t\u0026nn.FullyConnected{Size: 32, Activation: nn.Swish, BatchNorm: true},\n\t\u0026nn.FullyConnected{Size: 10, Activation: nn.Softmax})\n\nfunc Test_mnistConv0(t *testing.T) {\n\n\tgym := \u0026ng.Gym{\n\t\tOptimizer: \u0026nn.Adam{Lr: .001},\n\t\tLoss:      \u0026nn.LabelCrossEntropyLoss{},\n\t\tInput:     mx.Dim(32, 1, 28, 28),\n\t\tEpochs:    5,\n\t\tVerbose:   ng.Printing,\n\t\tEvery:     1 * time.Second,\n\t\tDataset:   \u0026mnist.Dataset{},\n\t\tMetric:    \u0026ng.Classification{Accuracy: 0.98},\n\t\tSeed:      42,\n\t}\n\n\tacc, params, err := gym.Train(mx.CPU, mnistConv0)\n\tassert.NilError(t, err)\n\tassert.Assert(t, acc \u003e= 0.98)\n\terr = params.Save(fu.CacheFile(\"tests/mnistConv0.params\"))\n\tassert.NilError(t, err)\n\n\tnet, err := nn.Bind(mx.CPU, mnistConv0, mx.Dim(10, 1, 28, 28), nil)\n\tassert.NilError(t, err)\n\terr = net.LoadParamsFile(fu.CacheFile(\"tests/mnistConv0.params\"), false)\n\tassert.NilError(t, err)\n\t_ = net.PrintSummary(false)\n\n\tok, err := ng.Measure(net, \u0026mnist.Dataset{}, \u0026ng.Classification{Accuracy: 0.98}, ng.Printing)\n\tassert.Assert(t, ok)\n}\n```\n```text\nNetwork Identity: 158cf5bd604e12e7bd438084e135703bd89dc10f\nSymbol              | Operation            | Output        |  Params #\n----------------------------------------------------------------------\n_input              | null                 | (32,1,28,28)  |         0\nConvolution01       | Convolution((3,3)//) | (32,24,26,26) |       240\nConvolution01$A     | Activation(relu)     | (32,24,26,26) |         0\nMaxPool02           | Pooling(max)         | (32,24,13,13) |         0\nConvolution03       | Convolution((5,5)//) | (32,32,9,9)   |     19232\nConvolution03$BN    | BatchNorm            | (32,32,9,9)   |       128\nConvolution03$A     | Activation(relu)     | (32,32,9,9)   |         0\nMaxPool04           | Pooling(max)         | (32,32,4,4)   |         0\nFullyConnected05    | FullyConnected       | (32,32)       |     16416\nFullyConnected05$BN | BatchNorm            | (32,32)       |       128\nsigmoid@sym07       | sigmoid              | (32,32)       |         0\nFullyConnected05$A  | elemwise_mul         | (32,32)       |         0\nFullyConnected06    | FullyConnected       | (32,10)       |       330\nFullyConnected06$A  | SoftmaxActivation()  | (32,10)       |         0\nBlockGrad@sym08     | BlockGrad            | (32,10)       |         0\nmake_loss@sym09     | make_loss            | (32,10)       |         0\npick@sym10          | pick                 | (32,1)        |         0\nlog@sym11           | log                  | (32,1)        |         0\n_mul_scalar@sym12   | _mul_scalar          | (32,1)        |         0\nmean@sym13          | mean                 | (1)           |         0\nmake_loss@sym14     | make_loss            | (1)           |         0\n----------------------------------------------------------------------\nTotal params: 36474\n[000] batch: 389, loss: 0.09991227\n[000] batch: 1074, loss: 0.055281825\n[000] batch: 1855, loss: 0.0760978\n[000] metric: 0.988, final loss: 0.0515\nAchieved reqired metric\nSymbol              | Operation            | Output        |  Params #\n----------------------------------------------------------------------\n_input              | null                 | (10,1,28,28)  |         0\nConvolution01       | Convolution((3,3)//) | (10,24,26,26) |       240\nConvolution01$A     | Activation(relu)     | (10,24,26,26) |         0\nMaxPool02           | Pooling(max)         | (10,24,13,13) |         0\nConvolution03       | Convolution((5,5)//) | (10,32,9,9)   |     19232\nConvolution03$BN    | BatchNorm            | (10,32,9,9)   |       128\nConvolution03$A     | Activation(relu)     | (10,32,9,9)   |         0\nMaxPool04           | Pooling(max)         | (10,32,4,4)   |         0\nFullyConnected05    | FullyConnected       | (10,32)       |     16416\nFullyConnected05$BN | BatchNorm            | (10,32)       |       128\nsigmoid@sym07       | sigmoid              | (10,32)       |         0\nFullyConnected05$A  | elemwise_mul         | (10,32)       |         0\nFullyConnected06    | FullyConnected       | (10,10)       |       330\nFullyConnected06$A  | SoftmaxActivation()  | (10,10)       |         0\n----------------------------------------------------------------------\nTotal params: 36474\nAccuracy over 1000*10 batchs: 0.988\n--- PASS: Test_mnistConv0 (6.51s)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudachen%2Fgo-dnn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsudachen%2Fgo-dnn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudachen%2Fgo-dnn/lists"}