{"id":24811227,"url":"https://github.com/lukks/neural-go","last_synced_at":"2025-07-12T03:34:33.250Z","repository":{"id":57504322,"uuid":"224750690","full_name":"LuKks/neural-go","owner":"LuKks","description":"Genetic Neural Networks","archived":false,"fork":false,"pushed_at":"2020-03-24T02:36:29.000Z","size":74,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-23T23:29:57.117Z","etag":null,"topics":["genetic","go","golang","networks","neural"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LuKks.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-11-29T00:49:19.000Z","updated_at":"2023-06-16T16:16:28.000Z","dependencies_parsed_at":"2022-08-29T20:21:31.312Z","dependency_job_id":null,"html_url":"https://github.com/LuKks/neural-go","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuKks%2Fneural-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuKks%2Fneural-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuKks%2Fneural-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuKks%2Fneural-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LuKks","download_url":"https://codeload.github.com/LuKks/neural-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236345999,"owners_count":19134376,"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":["genetic","go","golang","networks","neural"],"created_at":"2025-01-30T12:19:41.037Z","updated_at":"2025-01-30T12:19:41.603Z","avatar_url":"https://github.com/LuKks.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# neural-go\n\nGenetic Neural Networks\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/LuKks/neural-go?t=0)](https://goreportcard.com/report/github.com/LuKks/neural-go) ![](https://img.shields.io/github/v/release/LuKks/neural-go) [![GoDoc](https://godoc.org/github.com/LuKks/neural-go?status.svg)](https://godoc.org/github.com/LuKks/neural-go) ![](https://img.shields.io/github/license/LuKks/neural-go.svg)\n\n```golang\npackage main\n\nimport (\n  \"fmt\"\n  \"github.com/lukks/neural-go/v3\"\n)\n\nfunc main() {\n  xor := neural.NewNeural([]*neural.Layer{\n    {Inputs: 2, Units: 16},\n    {Units: 16},\n    {Units: 1},\n  })\n\n  for i := 0; i \u003c= 5000; i++ {\n    loss := xor.Learns([][][]float64{\n      {{0, 0}, {0}},\n      {{1, 0}, {1}},\n      {{0, 1}, {1}},\n      {{1, 1}, {0}},\n    })\n\n    if i%1000 == 0 {\n      fmt.Printf(\"iter %v, loss %f\\n\", i, loss)\n    }\n  }\n\n  fmt.Printf(\"think some values:\\n\")\n  fmt.Printf(\"0, 0 [0] -\u003e %f\\n\", xor.Think([]float64{0, 0}))\n  fmt.Printf(\"1, 0 [1] -\u003e %f\\n\", xor.Think([]float64{1, 0}))\n  fmt.Printf(\"0, 1 [1] -\u003e %f\\n\", xor.Think([]float64{0, 1}))\n  fmt.Printf(\"1, 1 [0] -\u003e %f\\n\", xor.Think([]float64{1, 1}))\n}\n```\n\n## Install latest version\n```\ngo get github.com/lukks/neural-go/v3\n```\n\nAlso find versions on [releases](https://github.com/LuKks/neural-go/releases).\nThe changes from v2 to v3 were just for go mod versioning.\n\n## Features\n#### Range\nSet a range of values for every input and output.\\\nSo you use your values as you know but the neural get it in raw activation.\\\nCheck [examples/rgb.go](https://github.com/LuKks/neural-go/blob/master/examples/rgb.go) for usage example.\n\n#### Customizable\nSet different activations, rates, momentums, etc at layer level.\n- Activation: `linear`, `sigmoid` (default), `tanh` and `relu`\n- Learning Rate\n- Optimizer by Momentum\n- Loss: for output layer, only `mse` for now\n- Range: for input and output layer\n\nCheck [examples/layers.go](https://github.com/LuKks/neural-go/blob/master/examples/layers.go) for complete example.\n\n#### Genetics\nClone, mutate and crossover neurons, layers and neurals.\\\nThe `Evolve` method internally uses these methods to put this very easy.\\\nCheck [examples/evolve.go](https://github.com/LuKks/neural-go/blob/master/examples/evolve.go) but it's optional, not always need to use genetics.\n\n#### Utils\nThere are several useful methods: Export, Import, Reset, ToFile, FromFile, etc.\\\nCheck the [documentation here](https://godoc.org/github.com/LuKks/neural-go).\n\n#### Description\nFrom my previous [neural-amxx](https://github.com/LuKks/neural-amxx).\n\n## Examples\nBasic XOR [examples/xor.go](https://github.com/LuKks/neural-go/blob/master/examples/xor.go)\\\nRGB brightness [examples/rgb.go](https://github.com/LuKks/neural-go/blob/master/examples/rgb.go)\\\nGenetics [examples/evolve.go](https://github.com/LuKks/neural-go/blob/master/examples/evolve.go)\\\nLayer configs [examples/layers.go](https://github.com/LuKks/neural-go/blob/master/examples/layers.go)\\\nPersist [examples/persist.go](https://github.com/LuKks/neural-go/blob/master/examples/persist.go)\n\n```\ngo run examples/rgb.go\n```\n\n## Tests\n```\nThere are no tests yet\n```\n\n## Issues\nFeedback, ideas, etc are very welcome so feel free to open an issue.\n\n## License\nCode released under the [MIT License](https://github.com/LuKks/neural-go/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukks%2Fneural-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukks%2Fneural-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukks%2Fneural-go/lists"}