{"id":13413359,"url":"https://github.com/surenderthakran/gomind","last_synced_at":"2025-03-14T19:31:59.590Z","repository":{"id":32508690,"uuid":"107495533","full_name":"surenderthakran/gomind","owner":"surenderthakran","description":"A simplistic Neural Network Library in Go","archived":false,"fork":false,"pushed_at":"2022-05-08T21:10:38.000Z","size":75,"stargazers_count":81,"open_issues_count":7,"forks_count":8,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-07-31T20:52:15.965Z","etag":null,"topics":["go","golang","machine-learning","neural-network"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/surenderthakran.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":"2017-10-19T03:48:51.000Z","updated_at":"2024-06-14T17:39:21.000Z","dependencies_parsed_at":"2022-08-08T16:30:18.634Z","dependency_job_id":null,"html_url":"https://github.com/surenderthakran/gomind","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surenderthakran%2Fgomind","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surenderthakran%2Fgomind/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surenderthakran%2Fgomind/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/surenderthakran%2Fgomind/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/surenderthakran","download_url":"https://codeload.github.com/surenderthakran/gomind/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243635369,"owners_count":20322927,"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":["go","golang","machine-learning","neural-network"],"created_at":"2024-07-30T20:01:38.556Z","updated_at":"2025-03-14T19:31:59.307Z","avatar_url":"https://github.com/surenderthakran.png","language":"Go","readme":"\u003cimg src=\"https://golang.org/doc/gopher/fiveyears.jpg\" width=800\u003e\u003cbr\u003e\n\n# GoMind\n\n[![Build Status](https://travis-ci.com/surenderthakran/gomind.svg?branch=master)](https://travis-ci.com/surenderthakran/gomind)\n[![GoDoc](https://godoc.org/github.com/surenderthakran/gomind?status.png)](https://godoc.org/github.com/surenderthakran/gomind)\n[![codecov](https://codecov.io/gh/surenderthakran/gomind/branch/master/graph/badge.svg)](https://codecov.io/gh/surenderthakran/gomind)\n[![Go Report Card](https://goreportcard.com/badge/github.com/surenderthakran/gomind)](https://goreportcard.com/report/github.com/surenderthakran/gomind)\n[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://github.com/singhsurender/gomind/blob/master/LICENSE)\n\n## Installation\n```\ngo get github.com/surenderthakran/gomind\n```\n\n## About\nGoMind is a neural network library written entirely in Go.\nIt only supports a single hidden layer (for now).\nThe network learns from a training set using back-propagation algorithm.\n\nSome of the salient features of GoMind are:\n- Supports following activation functions:\n  - Linear (Default)\n  - [Sigmoid](https://en.wikipedia.org/wiki/Sigmoid_function)\n  - [ReLU](https://en.wikipedia.org/wiki/Rectifier_(neural_networks))\n  - [Leaky ReLU](https://en.wikipedia.org/wiki/Rectifier_%28neural_networks%29#Leaky_ReLUs)\n- Smartly estimates ideal number of hidden layer neurons (if a count is not given during model configuration) for given input and output sizes.\n- Uses [Mean Squared Error function](https://en.wikipedia.org/wiki/Mean_squared_error) to calculate error while back propagating.\n\nNote: To understand the basic functioning of back-propagation in neural networks, one can refer to my blog [here](https://www.surenderthakran.com/articles/tech/implement-back-propagation-neural-network).\n\n## Usage\n```\npackage main\n\nimport (\n\t\"github.com/singhsurender/gomind\"\n)\n\nfunc main() {\n\ttrainingSet := [][][]float64{\n\t\t[][]float64{[]float64{0, 0}, []float64{0}},\n\t\t[][]float64{[]float64{0, 1}, []float64{1}},\n\t\t[][]float64{[]float64{1, 0}, []float64{1}},\n\t\t[][]float64{[]float64{1, 1}, []float64{0}},\n\t}\n\n\tmind, err := gomind.New(\u0026gomind.ModelConfiguration{\n\t\tNumberOfInputs:                    2,\n\t\tNumberOfOutputs:                   1,\n\t\tNumberOfHiddenLayerNeurons:        16,\n\t\tHiddenLayerActivationFunctionName: \"relu\",\n\t\tOutputLayerActivationFunctionName: \"sigmoid\",\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to create neural network. %v\", err)\n\t}\n\n\tfor i := 0; i \u003c 500; i++ {\n\t\trand := rand.Intn(4)\n\t\tinput := trainingSet[rand][0]\n\t\toutput := trainingSet[rand][1]\n\n\t\tif err := mind.LearnSample(input, output); err != nil {\n\t\t\tmind.Describe(true)\n\t\t\treturn nil, fmt.Errorf(\"error while learning from sample input: %v, target: %v. %v\", input, output, err)\n\t\t}\n\n\t\tactual := mind.LastOutput()\n\t\toutputError, err := mind.CalculateError(output)\n\t\tif err != nil {\n\t\t\tmind.Describe(true)\n\t\t\treturn nil, fmt.Errorf(\"error while calculating error for input: %v, target: %v and actual: %v. %v\", input, output, actual, err)\n\t\t}\n\n\t\toutputAccuracy, err := mind.CalculateAccuracy(output)\n\t\tif err != nil {\n\t\t\tmind.Describe(true)\n\t\t\treturn nil, fmt.Errorf(\"error while calculating error for input: %v, target: %v and actual: %v. %v\", input, output, actual, err)\n\t\t}\n\n\t\tfmt.Println(\"Index: %v, Input: %v, Target: %v, Actual: %v, Error: %v, Accuracy: %v\\n\", i, input, output, actual, outputError, outputAccuracy)\n\t}\n}\n```\n\n## API Documentation\nThe documentation for various methods exposed by the library can be found at: [https://godoc.org/github.com/surenderthakran/gomind](https://godoc.org/github.com/surenderthakran/gomind)\n","funding_links":[],"categories":["Neural Networks","Machine Learning","机器学习","Relational Databases"],"sub_categories":["Vector Database","Search and Analytic Databases","Advanced Console UIs","SQL 查询语句构建库","检索及分析资料库","交流"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsurenderthakran%2Fgomind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsurenderthakran%2Fgomind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsurenderthakran%2Fgomind/lists"}