{"id":22997753,"url":"https://github.com/willayy/snnpy","last_synced_at":"2026-05-01T15:31:14.082Z","repository":{"id":221180983,"uuid":"712113443","full_name":"willayy/SNNPy","owner":"willayy","description":"Simple neural network modeling framework implemented in C with a Python api","archived":false,"fork":false,"pushed_at":"2025-02-23T12:14:59.000Z","size":675,"stargazers_count":1,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T13:24:18.219Z","etag":null,"topics":["c","cmake","neural-networks","python"],"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/willayy.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-30T20:19:18.000Z","updated_at":"2024-11-26T16:17:27.000Z","dependencies_parsed_at":"2024-03-27T23:22:10.867Z","dependency_job_id":"1b62db5a-863b-4456-9012-5903f9a06f06","html_url":"https://github.com/willayy/SNNPy","commit_stats":null,"previous_names":["willayy/snnpy"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willayy%2FSNNPy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willayy%2FSNNPy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willayy%2FSNNPy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willayy%2FSNNPy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willayy","download_url":"https://codeload.github.com/willayy/SNNPy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246820177,"owners_count":20839194,"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":["c","cmake","neural-networks","python"],"created_at":"2024-12-15T06:08:46.612Z","updated_at":"2026-05-01T15:31:08.766Z","avatar_url":"https://github.com/willayy.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SNNPy\nThis is a Python module with api's to a C implemented configurable FFN neural network model. \n\nThis NeuralNetwork modeling software was made for learnings-sake and is not made for performance in the first hand. It does not feature parallelism, hardware accelaration, its memory ineffective and its a naive implementation.\n\nFor more info about features check release.\n  \n#### Dependencies\nCMake is recommended as the build tool for this source code.\nNo other external dependencies.\n\n#### Installation/Building\n- Download source code.\n- Build the shared libraries for the python module using CMake.\n- Start using python module!\n\n#### This project was developed and tested using:\n- Tested OS: Microsoft Windows 11 version 23H2, MacOs Sonoma version 14\n- Tested compilers: GCC 13.10.0, Clang 15.0.0\n- Build System: CMake 3.28.1\n\n#### Usage\nPython example of a neural network that classifies binary numbers into integers\n```Python\n  from snnpy import snn_py\n  \n  # Define the dataset inputs\n  inputs: list[list[float]] = [[0,0,0,0],\n                               [0,0,0,1],\n                               [0,0,1,0],\n                               [0,0,1,1],\n                               [0,1,0,0],\n                               [0,1,0,1],\n                               [0,1,1,0],\n                               [0,1,1,1],\n                               [1,0,0,0],\n                               [1,0,0,1],\n                               [1,0,1,0],\n                               [1,0,1,1],\n                               [1,1,0,0],\n                               [1,1,0,1],\n                               [1,1,1,0],\n                               [1,1,1,1]]\n  \n  # Define the dataset labels\n  outputs: list[list[float]] = [[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\n                                [0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\n                                [0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0],\n                                [0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0],\n                                [0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0],\n                                [0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0],\n                                [0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0],\n                                [0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0],\n                                [0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0],\n                                [0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0],\n                                [0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0],\n                                [0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0],\n                                [0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0],\n                                [0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0],\n                                [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0],\n                                [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]]\n  \n  snn_py.set_rng_seed(0) # Set the seed for the random number generator\n  \n  neural_network = snn_py.create_neural_network(4,1,4,16) # Create a neural network model\n  \n  snn_py.set_activation_functions(neural_network, 'linear', 'relu', 'sigmoid') # Set the activation functions for each layer (layers* in the case of hidden layers)\n  snn_py.set_cost_function(neural_network, 'cross_entropy') # Set the cost function for the model\n  snn_py.set_regularization(neural_network, 'no_reg') # Set the regularization for the model\n  snn_py.init_weights_xavier_normal(neural_network) # Initialize the weights of the model\n  snn_py.init_biases_constant(neural_network, 0.1) # Initialize the biases of the model\n  \n  # Train the model on a batch from the dataset\n  snn_py.train_neural_network(neural_network, inputs, outputs, 16, 250000, 0.08, 0.01)\n  \n  # Test the model on a batch from the dataset\n  result = snn_py.predict(neural_network, inputs[5])\n  result = [int(num) for num in result]\n  print(f\"Input: {inputs[5]} Prediction: {result} Expected: {outputs[5]}\")\n  input(\"Press Enter to continue...\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillayy%2Fsnnpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillayy%2Fsnnpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillayy%2Fsnnpy/lists"}