{"id":26666475,"url":"https://github.com/ilikepizza2/perceptron","last_synced_at":"2025-03-25T18:35:14.499Z","repository":{"id":213273935,"uuid":"733452116","full_name":"Ilikepizza2/Perceptron","owner":"Ilikepizza2","description":"A neat, lightweight and single neuron perceptron written in C++ from scratch without any external library, trained using the perceptron trick and loss function","archived":false,"fork":false,"pushed_at":"2023-12-20T11:05:46.000Z","size":27,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-12-20T17:03:06.254Z","etag":null,"topics":["deep-learning","loss-function","perceptron","perceptron-trick"],"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/Ilikepizza2.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}},"created_at":"2023-12-19T11:07:00.000Z","updated_at":"2023-12-20T11:00:57.000Z","dependencies_parsed_at":"2023-12-19T14:28:37.531Z","dependency_job_id":"583e8fe7-2de0-41cf-8d57-80ed1d08cd1d","html_url":"https://github.com/Ilikepizza2/Perceptron","commit_stats":null,"previous_names":["ilikepizza2/perceptron"],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ilikepizza2%2FPerceptron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ilikepizza2%2FPerceptron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ilikepizza2%2FPerceptron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ilikepizza2%2FPerceptron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ilikepizza2","download_url":"https://codeload.github.com/Ilikepizza2/Perceptron/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245521291,"owners_count":20629054,"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":["deep-learning","loss-function","perceptron","perceptron-trick"],"created_at":"2025-03-25T18:35:14.061Z","updated_at":"2025-03-25T18:35:14.489Z","avatar_url":"https://github.com/Ilikepizza2.png","language":"C++","readme":"# Perceptron Implementation in C++\n\nThis C++ program demonstrates a basic implementation of a perceptron trained using the loss function and the perceptron trick. The perceptron is a fundamental building block of neural networks and is capable of binary classification.\n\n## Getting Started\n\n### Prerequisites\n\n- C++ Compiler\n\n### Usage\n\n1. Clone the repository:\n\n    ```bash\n    git clone https://github.com/your-username/perceptron-cpp.git\n    ```\n\n2. Compile the C++ program:\n\n    ```bash\n    g++ perceptron.cpp -o perceptron\n    ```\n\n3. Run the executable:\n\n    ```bash\n    ./perceptron\n    ```\n\n### Input Data\n\nThe program expects two CSV files:\n\n1. `train.csv` - Training data containing input features and corresponding binary labels.\n2. `test.csv` - Testing data for evaluating the trained perceptron.\n\n## Code Overview\n\n- `split_nums`: Function to split a string into a vector of doubles.\n- `printCols`: Function to print input features and labels.\n- `sum`: Function to calculate the sum of two vectors, including a bias term.\n- `classifier`: Function to classify input using the trained perceptron.\n\nThe program performs training using the perceptron trick and then tests the perceptron on a separate dataset.\n\n## Parameters\n\n- Learning Rate: 0.1\n- Epochs: 1000\n\n## Considerations\n- This is a very basic single neuron perceptron with random weights. The sample data given is also very small (~100 rows). So the current outputs may vary `a lot`. Thus, it is for learning purposes only.\n\n## Contributing\n\nFeel free to contribute by opening issues or submitting pull requests.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.\n\n## Acknowledgments\n\n- Inspired by the concept of perceptrons and neural networks.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filikepizza2%2Fperceptron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filikepizza2%2Fperceptron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filikepizza2%2Fperceptron/lists"}