{"id":25019661,"url":"https://github.com/djeada/neuracommand","last_synced_at":"2025-03-30T10:11:43.552Z","repository":{"id":230214802,"uuid":"231277045","full_name":"djeada/NeuraCommand","owner":"djeada","description":"NeuraCommand is a Python package and CLI tool designed for streamlined creation, training, and deployment of neural networks. It offers a clear-cut interface for managing complex neural architectures, including multi-layer perceptrons. The tool facilitates efficient data loading, model training, and application of models for predictive tasks. ","archived":false,"fork":false,"pushed_at":"2024-04-03T10:38:25.000Z","size":162,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T11:51:52.060Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/djeada.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-01T23:49:47.000Z","updated_at":"2024-03-28T21:32:51.000Z","dependencies_parsed_at":"2025-02-05T11:51:28.121Z","dependency_job_id":"9dd963fd-81e4-48f1-a838-7fdf120a78af","html_url":"https://github.com/djeada/NeuraCommand","commit_stats":null,"previous_names":["djeada/neuracommand"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/djeada%2FNeuraCommand","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/djeada%2FNeuraCommand/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/djeada%2FNeuraCommand/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/djeada%2FNeuraCommand/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/djeada","download_url":"https://codeload.github.com/djeada/NeuraCommand/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246301997,"owners_count":20755514,"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":[],"created_at":"2025-02-05T11:51:22.317Z","updated_at":"2025-03-30T10:11:43.531Z","avatar_url":"https://github.com/djeada.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NeuraCommand\n\n![neura_command](https://github.com/djeada/NeuraCommand/assets/37275728/bf778c51-e05f-4db4-9b36-1461462113dc)\n\nNeuraCommand is a Python package and CLI tool designed for streamlined creation, training, and deployment of neural networks. It offers a clear-cut interface for managing complex neural architectures, including multi-layer perceptrons. The tool facilitates efficient data loading, model training, and application of models for predictive tasks. Aimed at providing practical functionality, NeuraCommand caters to both quick deployment needs and in-depth neural network experimentation.\n\n## Features\n\n- **Flexible Network Creation Library**: A library built on top of numpy, providing the flexibility to create various network configurations easily.\n\n- **Intuitive Command-Line Interface (CLI)**: A user-friendly CLI that simplifies neural network operations, enhancing accessibility for usage in different programming languages or embedded systems.\n\n- **Customizable Network Architectures**: Tailor your neural networks with a range of layers and structures. Create unique networks either through an interactive CLI experience or by populating a JSON template.\n\n- **Matrix Input Support**: Offers compatibility with multiple matrix data formats, facilitating versatile network training. Once your network is set up, train it repeatedly using a variety of inputs.\n\n- **Persistent Model Management**: Efficiently save and reload your neural network models for continuous training or future utilization. Once trained, models can be stored as blobs on disk and reloaded as needed.\n\n- **Immediate Predictions**: Implement your trained networks for real-time prediction tasks. Input data can be manually entered or read from a disk, with the option to display predictions on-screen or save them to a file.\n\n- **Layer Output Visualization**: Gain insights into your network's processing by displaying outputs from all layers. Choose between numerical printouts, CSV files, or other formats to keep track of your network's functionality—nothing remains hidden.\n\n## Installation\n\n*Note*: It's important to run these commands in the root directory of the repository for the installation to work correctly.\n\nTo install NeuraCommand, open your terminal or command prompt and run the following command:\n\n```shell\npip install neura_command\n```\n\nAfter installing, you can verify the installation and check the installed version of NeuraCommand by running:\n\n```shell\nneura_command --version\n```\n\nThis command should return the version number of NeuraCommand, indicating that it has been installed successfully.\n\n## Usage of NeuraCommand CLI\n\nThe NeuraCommand CLI offers three main actions: `create`, `train`, and `predict`. Each action is equipped with specific options to tailor its functionality.\n\n```\npython main.py --action {create,train,predict}\n```\n\nOptions:\n\n- `-h`, `--help`: Show the help message and exit.\n- `--action {create,train,predict}`: Choose the action to perform.\n\n### Create\n\nUse the `create` action to create a new neural network. You need to provide a JSON file describing the network architecture and specify the output path for the created model.\n\n```\npython main.py --action create --network-architecture-json path/to/architecture.json --model-pkl path/to/output_model.pkl\n```\n\nOptions:\n\n- `--network-architecture-json`: Path to the JSON file that describes the neural network's architecture. This file should detail the layers, nodes, activation functions, etc.\n- `--model-pkl`: [Optional] Destination path for saving the serialized neural network model (.pkl format). Defaults to 'network.pkl' if not specified.\n\n### Train\nUse the `train` action to train an existing network. You must provide the path to the network's `.pkl` file, input features, target values, number of epochs, and output model path (if not overwriting).\n\nExample:\n\n```\npython main.py --action train --model-pkl path/to/network.pkl --features-csv path/to/features.csv --targets-csv path/to/targets.csv --epochs 100 --output-model-pkl path/to/output_model.pkl\n```\n\nOptions:\n\n- `--model-pkl`: Path to the neural network file (.pkl) to be trained.\n- `--features-csv`: Path to the CSV file containing the input features for the training.\n- `--targets-csv`: Path to the CSV file containing the target values for the training.\n- `--epochs`: [Optional] Number of training epochs. Defaults to 100.\n- `--overwrite`: [Optional] Flag to indicate if the existing .pkl file should be overwritten after training.\n- `--output-model-pkl`: [Optional] Custom path to save the trained network model file (.pkl). Required if --overwrite is not set.\n\n### Predict\nUse the predict action to make predictions using a trained model. You need to provide the model `.pkl` file and input data. Additionally, specify how you want to output the predictions.\n\nExample:\n\n```\npython main.py --action predict --model-pkl path/to/model.pkl --input-csv path/to/input.csv --output-mode display\n```\n\nTo save predictions to a CSV file:\n\n```\npython main.py --action predict --model-pkl path/to/model.pkl --input-csv path/to/input.csv --output-mode save --output-csv path/to/output.csv\n```\n\nOptions:\n\n- `--model-pkl`: Path to the neural network file (.pkl) used for making predictions.\n- `--input-csv`: Path to the input CSV file. The format of this file should match the input requirements of the model.\n- `--output-mode`: Choose 'display' to show predictions on stdout or 'save' to save them to a CSV file.\n- `--output-csv`: [Required if output-mode is 'save'] Path to save the prediction results as a CSV file.\n\n## Quickstart for NeuraCommand package\n\nExample code for using NeuraCommand in Python:\n\n```python\nimport numpy as np\n\nfrom neura_command.network.network_builder.string_network_builder import (\n    StringNetworkBuilder,\n)\n\n# Example usage\nbuilder = StringNetworkBuilder()\nbuilder.add_layer(3, 5, \"relu\")  # First hidden layer\nbuilder.add_layer(5, 3, \"relu\")  # Second hidden layer (output layer)\n\n# Initialize the network using the builder\nnet = builder.build()\n\n# Prepare the dataset for training\ndata_samples = [([0.1, 0.2, 0.3], [0, 1, 0])]  # Example: [(input_data, target_data)]\nX = np.array([sample[0] for sample in data_samples])\nY = np.array([sample[1] for sample in data_samples])\n\n# Train the network\nnet.train(X, Y, epochs=10, batch_size=1)\n\n# Make predictions\ntest_input = np.array([[0.1, 0.2, 0.3]])\npredicted_output = net.predict(test_input)\nprint(f\"Predicted Output: {predicted_output}\")\n\n# Using the evaluate function\npredicted_outputs = net.predict(X)\nmse = np.mean((predicted_outputs - Y) ** 2)\nprint(f\"Mean Squared Error: {mse}%\")\n```\n\n## References\n\n1. Nielsen, M. (2015). *Neural Networks and Deep Learning*. Determination Press.\n   - [Online Book](http://neuralnetworksanddeeplearning.com/)\n\n2. Goodfellow, I., Bengio, Y., \u0026 Courville, A. (2016). *Deep Learning*. MIT Press.\n   - [MIT Press](https://www.deeplearningbook.org/)\n\n3. Bishop, C. M. (2006). *Pattern Recognition and Machine Learning*. Springer.\n   - [Springer](http://www.springer.com/gp/book/9780387310732)\n\n4. Shalev-Shwartz, S., \u0026 Ben-David, S. (2014). *Understanding Machine Learning: From Theory to Algorithms*. Cambridge University Press.\n   - [Cambridge Core](https://www.cambridge.org/core/books/understanding-machine-learning/3059709FEBB4176FC37311D0AD8B2B8E)\n\n5. Hertz, J., Krogh, A., \u0026 Palmer, R. G. (1991). *Introduction to the Theory of Neural Computation*. Addison-Wesley.\n   - [Amazon](https://www.amazon.com/Introduction-Theory-Neural-Computation-Computational/dp/0201515601)\n\n6. Fausett, L. (1994). *Fundamentals of Neural Networks: Architectures, Algorithms, and Applications*. Prentice-Hall.\n   - [Pearson](https://www.pearson.com/us/higher-education/program/Fausett-Fundamentals-of-Neural-Networks-Architectures-Algorithms-and-Applications/PGM80736.html)\n\n7. Bishop, C. M. (1995). *Neural Networks for Pattern Recognition*. Oxford University Press.\n   - [Amazon](https://www.amazon.com/Neural-Networks-Pattern-Recognition-Christopher/dp/0198538642)\n\n8. Géron, A. (2019). *Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow*. O'Reilly Media.\n   - [O'Reilly](https://www.oreilly.com/library/view/hands-on-machine-learning/9781492032632/)\n\n9. Vasilev, I., \u0026 Slater, D. (2019). *Python Deep Learning*. Packt Publishing.\n   - [Packt](https://www.packtpub.com/product/python-deep-learning-second-edition/9781789348460)\n\n10. Iyengar, R. S. (2017). *Convolutional Neural Networks in Visual Computing: A Concise Guide*. CRC Press.\n    - [Amazon](https://www.amazon.com/Convolutional-Networks-Visual-Computing-Concise/dp/1498749936)\n\n## Contributing\n\nWe warmly welcome contributions to NeuraCommand! Whether you're fixing bugs, adding new features, improving documentation, or spreading the word, your help is invaluable.\n\n### How to Contribute\n\n1. **Fork the Repository**: Start by forking the NeuraCommand repository to your GitHub account.\n2. **Create a Branch**: For each new feature or fix, create a new branch in your forked repository.\n3. **Develop and Test**: Implement your changes and ensure they are thoroughly tested.\n4. **Submit a Pull Request**: Once you're satisfied with your changes, submit a pull request to the main repository. Include a clear description of your changes and any relevant issue numbers.\n5. **Code Review**: Your pull request will be reviewed by the maintainers. They may suggest changes or improvements.\n6. **Merge**: Once your pull request is approved, it will be merged into the main codebase.\n\n### Contribution Guidelines\n\n- Ensure your code adheres to the project's coding standards and style.\n- Update the documentation to reflect your changes, if necessary.\n- Keep your commits clean and understandable.\n- Stay respectful and open to feedback during the review process.\n\nWe're excited to see what you bring to NeuraCommand!\n\n## License\n\nNeuraCommand is licensed under the MIT License. This allows for a wide range of uses, providing flexibility and freedom for both personal and commercial applications while requiring only the retention of copyright and license notices. For more detailed information, please refer to the [LICENSE](LICENSE) file included in the repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjeada%2Fneuracommand","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdjeada%2Fneuracommand","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdjeada%2Fneuracommand/lists"}