{"id":13470643,"url":"https://github.com/glouw/tinn","last_synced_at":"2025-04-08T01:36:05.020Z","repository":{"id":41432490,"uuid":"126944933","full_name":"glouw/tinn","owner":"glouw","description":"A tiny neural network library","archived":false,"fork":false,"pushed_at":"2021-01-17T23:06:12.000Z","size":70,"stargazers_count":2116,"open_issues_count":13,"forks_count":189,"subscribers_count":90,"default_branch":"master","last_synced_at":"2025-04-01T00:34:01.149Z","etag":null,"topics":["ansi","back","c","feed","forward","network","neural","propagation","tiny"],"latest_commit_sha":null,"homepage":"","language":"C","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/glouw.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":"2018-03-27T07:16:59.000Z","updated_at":"2025-03-21T18:01:53.000Z","dependencies_parsed_at":"2022-08-10T02:23:30.277Z","dependency_job_id":null,"html_url":"https://github.com/glouw/tinn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glouw%2Ftinn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glouw%2Ftinn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glouw%2Ftinn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glouw%2Ftinn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/glouw","download_url":"https://codeload.github.com/glouw/tinn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247761051,"owners_count":20991531,"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":["ansi","back","c","feed","forward","network","neural","propagation","tiny"],"created_at":"2024-07-31T16:00:33.057Z","updated_at":"2025-04-08T01:36:04.998Z","avatar_url":"https://github.com/glouw.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"![](img/logo.PNG)\n\nTinn (Tiny Neural Network) is a 200 line dependency free neural network library written in C99.\n\nFor a demo on how to learn hand written digits, get some training data:\n\n    wget http://archive.ics.uci.edu/ml/machine-learning-databases/semeion/semeion.data\n\n    make; ./test\n\nThe training data consists of hand written digits written both slowly and quickly.\nEach line in the data set corresponds to one handwritten digit. Each digit is 16x16 pixels in size\ngiving 256 inputs to the neural network.\n\nAt the end of the line 10 digits signify the hand written digit:\n\n    0: 1 0 0 0 0 0 0 0 0 0\n    1: 0 1 0 0 0 0 0 0 0 0\n    2: 0 0 1 0 0 0 0 0 0 0\n    3: 0 0 0 1 0 0 0 0 0 0\n    4: 0 0 0 0 1 0 0 0 0 0\n    ...\n    9: 0 0 0 0 0 0 0 0 0 1\n\nThis gives 10 outputs to the neural network. The test program will output the\naccuracy for each digit. Expect above 99% accuracy for the correct digit, and\nless that 0.1% accuracy for the other digits.\n\n## Features\n\n* Portable - Runs where a C99 or C++98 compiler is present.\n\n* Sigmoidal activation.\n\n* One hidden layer.\n\n## Tips\n\n* Tinn will never use more than the C standard library.\n\n* Tinn is great for embedded systems. Train a model on your powerful desktop and load\nit onto a microcontroller and use the analog to digital converter to predict real time events.\n\n* The Tinn source code will always be less than 200 lines. Functions externed in the Tinn header\nare protected with the _xt_ namespace standing for _externed tinn_.\n\n* Tinn can easily be multi-threaded with a bit of ingenuity but the master branch will remain\nsingle threaded to aid development for embedded systems.\n\n* Tinn does not seed the random number generator. Do not forget to do so yourself.\n\n* Always shuffle your input data. Shuffle again after every training iteration.\n\n* Get greater training accuracy by annealing your learning rate. For instance, multiply\nyour learning rate by 0.99 every training iteration. This will zero in on a good learning minima.\n\n## Disclaimer\n\nTinn is a practice in minimalism.\n\nTinn is not a fully featured neural network C library like Kann, or Genann:\n\n    https://github.com/attractivechaos/kann\n\n    https://github.com/codeplea/genann\n\n## Ports\n\n    Rust: https://github.com/dvdplm/rustinn\n\n## Other\n\n [A Tutorial using Tinn NN and CTypes](https://medium.com/@cknorow/creating-a-python-interface-to-a-c-library-a-tutorial-using-tinn-nn-d935707dd225)\n\n [Tiny Neural Network Library in 200 Lines of Code](https://hackaday.com/2018/04/08/tiny-neural-network-library-in-200-lines-of-code/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglouw%2Ftinn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglouw%2Ftinn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglouw%2Ftinn/lists"}