growingnn


Namegrowingnn JSON
Version 0.0.6 PyPI version JSON
download
home_page
Summarygrowingnn is a cutting-edge Python package that introduces a dynamic neural network architecture learning algorithm. This innovative approach allows the neural network to adapt its structure during training, optimizing both weights and architecture. Leveraging a Stochastic Gradient Descent-based optimizer and guided Monte Carlo tree search, the package provides a powerful tool for enhancing model performance.
upload_time2024-02-09 16:34:12
maintainer
docs_urlNone
authorSzymon Świderski
requires_python
licenseMIT License Copyright (c) 2024 PjuralSzymon Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords python neural network growing neural network growing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # growingnn - Dynamic Neural Network Architecture Learning

The growingnn project introduces an innovative algorithm for data-driven neural network model construction. This algorithm comprises two fundamental components: the first component focuses on weight adjustment, while the second component acts as an orchestrator, launching a guided procedure to dynamically change the network architecture. This architectural modification occurs at regular intervals, specifically every $K$ epochs, and is driven by the outcome of a Monte Carlo tree search. The algorithm's core, outlined in the accompanying research paper, leverages the principles of Stochastic Gradient Descent (SGD) without relying on advanced tools commonly used in neural network training.

### [Repozytorium GitHub](https://github.com/PjuralSzymon/growingnn)
Click the link above to navigate to the GitHub repository, where you can find the source code, issues, and other project details.

### [Dokumentacja](https://pjuralszymon.github.io/growingnn)
This link will take you to the project documentation. Here you'll find instructions, usage information, and other resources helpful for using the project.


## Algorithm Overview

### Weight Adjustment Component

The first component of the algorithm is dedicated to weight adjustment. It operates within the framework of Stochastic Gradient Descent (SGD), a foundational optimization algorithm for training neural networks. The simplicity of this approach makes it suitable for educational settings, emphasizing fundamental machine learning principles.

### Orchestrator and Network Architecture Modification

The second component, the orchestrator, plays a crucial role in initiating a procedure to dynamically change the network architecture. This change occurs systematically at predefined intervals, specifically every $K$ epochs. The decision-making process for architectural changes is facilitated by a guided Monte Carlo tree search. This sophisticated mechanism ensures that architectural modifications are well-informed and contribute to the overall improvement of the neural network model.

## Implementation Details

### Model Structure
The model is the main structure that stores layers as nodes in a directed graph. It operates based on layer identifiers, treating each layer as an independent structure that contains information about incoming and outgoing connections. The default starting structure is a simple graph with an input and output layer connected by a single connection. In each generation, the algorithm has the flexibility to add new layers or remove existing ones. As the structure grows, each layer gains more incoming and outgoing connections.

### Propagation Phase

During the propagation phase, each layer waits until it receives signals from all input layers. Once these signals are received, they are averaged, processed, and propagated through all outgoing connections. This iterative process allows the neural network to dynamically adapt its architecture based on the evolving data and training requirements.

## Results and Testing

The proposed algorithm has undergone rigorous testing, particularly in visual pattern classification problems. The results have consistently demonstrated high levels of satisfaction, showcasing the efficacy of the dynamic architecture learning approach in enhancing model performance.


```python
x_train, x_test, y_train, y_test, labels = data_reader.read_mnist_data(mnist_path, 0.9)
gnn.trainer.train(
    x_train = x_train, 
    y_train = y_train, 
    x_test = x_test,
    y_test = y_test,
    labels = labels,
    input_paths = 1,
    path = "./result", 
    model_name = "GNN_model",
    epochs = 10, 
    generations = 10,
    input_size = 28 * 28, 
    hidden_size = 28 * 28, 
    output_size = 10, 
    input_shape = (28, 28, 1), 
    kernel_size = 3, 
    depth = 2
)
```
This code trains a simple network on the MNIST dataset

## Structure
History of resulting optimal structure created for MNIST dataset:

1. ![Screenshot](./docs/model_arch_1.png)

2. ![Screenshot](./docs/model_arch_2.png)

3. ![Screenshot](./docs/model_arch_3.png)

4. ![Screenshot](./docs/model_arch_4.png)

History of training for mnist and fmnist dataset:
![Screenshot](./docs/montecarlo_alg.png)




# Credits

Szymon Swiderski
Agnieszka Jastrzebska

# Disclosure

This is the first beta version of the growingnn package. We are not liable for the accuracy of the program’s output nor actions performed based upon it.

For more in-depth information on the algorithm, its implementation, and testing results, refer to the accompanying research paper. The provided Python source code is a valuable resource for understanding and implementing the presented method. Feel free to explore, contribute, and adapt it for your specific needs.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "growingnn",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "python,neural network,growing neural network,growing",
    "author": "Szymon \u015awiderski",
    "author_email": "<pjuralszymqn@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/03/97/095b1cf6870ce126fd369e421b221c4e7413ad44c8aa4ef2c190f53bc119/growingnn-0.0.6.tar.gz",
    "platform": null,
    "description": "# growingnn - Dynamic Neural Network Architecture Learning\r\n\r\nThe growingnn project introduces an innovative algorithm for data-driven neural network model construction. This algorithm comprises two fundamental components: the first component focuses on weight adjustment, while the second component acts as an orchestrator, launching a guided procedure to dynamically change the network architecture. This architectural modification occurs at regular intervals, specifically every $K$ epochs, and is driven by the outcome of a Monte Carlo tree search. The algorithm's core, outlined in the accompanying research paper, leverages the principles of Stochastic Gradient Descent (SGD) without relying on advanced tools commonly used in neural network training.\r\n\r\n### [Repozytorium GitHub](https://github.com/PjuralSzymon/growingnn)\r\nClick the link above to navigate to the GitHub repository, where you can find the source code, issues, and other project details.\r\n\r\n### [Dokumentacja](https://pjuralszymon.github.io/growingnn)\r\nThis link will take you to the project documentation. Here you'll find instructions, usage information, and other resources helpful for using the project.\r\n\r\n\r\n## Algorithm Overview\r\n\r\n### Weight Adjustment Component\r\n\r\nThe first component of the algorithm is dedicated to weight adjustment. It operates within the framework of Stochastic Gradient Descent (SGD), a foundational optimization algorithm for training neural networks. The simplicity of this approach makes it suitable for educational settings, emphasizing fundamental machine learning principles.\r\n\r\n### Orchestrator and Network Architecture Modification\r\n\r\nThe second component, the orchestrator, plays a crucial role in initiating a procedure to dynamically change the network architecture. This change occurs systematically at predefined intervals, specifically every $K$ epochs. The decision-making process for architectural changes is facilitated by a guided Monte Carlo tree search. This sophisticated mechanism ensures that architectural modifications are well-informed and contribute to the overall improvement of the neural network model.\r\n\r\n## Implementation Details\r\n\r\n### Model Structure\r\nThe model is the main structure that stores layers as nodes in a directed graph. It operates based on layer identifiers, treating each layer as an independent structure that contains information about incoming and outgoing connections. The default starting structure is a simple graph with an input and output layer connected by a single connection. In each generation, the algorithm has the flexibility to add new layers or remove existing ones. As the structure grows, each layer gains more incoming and outgoing connections.\r\n\r\n### Propagation Phase\r\n\r\nDuring the propagation phase, each layer waits until it receives signals from all input layers. Once these signals are received, they are averaged, processed, and propagated through all outgoing connections. This iterative process allows the neural network to dynamically adapt its architecture based on the evolving data and training requirements.\r\n\r\n## Results and Testing\r\n\r\nThe proposed algorithm has undergone rigorous testing, particularly in visual pattern classification problems. The results have consistently demonstrated high levels of satisfaction, showcasing the efficacy of the dynamic architecture learning approach in enhancing model performance.\r\n\r\n\r\n```python\r\nx_train, x_test, y_train, y_test, labels = data_reader.read_mnist_data(mnist_path, 0.9)\r\ngnn.trainer.train(\r\n    x_train = x_train, \r\n    y_train = y_train, \r\n    x_test = x_test,\r\n    y_test = y_test,\r\n    labels = labels,\r\n    input_paths = 1,\r\n    path = \"./result\", \r\n    model_name = \"GNN_model\",\r\n    epochs = 10, \r\n    generations = 10,\r\n    input_size = 28 * 28, \r\n    hidden_size = 28 * 28, \r\n    output_size = 10, \r\n    input_shape = (28, 28, 1), \r\n    kernel_size = 3, \r\n    depth = 2\r\n)\r\n```\r\nThis code trains a simple network on the MNIST dataset\r\n\r\n## Structure\r\nHistory of resulting optimal structure created for MNIST dataset:\r\n\r\n1. ![Screenshot](./docs/model_arch_1.png)\r\n\r\n2. ![Screenshot](./docs/model_arch_2.png)\r\n\r\n3. ![Screenshot](./docs/model_arch_3.png)\r\n\r\n4. ![Screenshot](./docs/model_arch_4.png)\r\n\r\nHistory of training for mnist and fmnist dataset:\r\n![Screenshot](./docs/montecarlo_alg.png)\r\n\r\n\r\n\r\n\r\n# Credits\r\n\r\nSzymon Swiderski\r\nAgnieszka Jastrzebska\r\n\r\n# Disclosure\r\n\r\nThis is the first beta version of the growingnn package. We are not liable for the accuracy of the program\u00e2\u20ac\u2122s output nor actions performed based upon it.\r\n\r\nFor more in-depth information on the algorithm, its implementation, and testing results, refer to the accompanying research paper. The provided Python source code is a valuable resource for understanding and implementing the presented method. Feel free to explore, contribute, and adapt it for your specific needs.\r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 PjuralSzymon  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "growingnn is a cutting-edge Python package that introduces a dynamic neural network architecture learning algorithm. This innovative approach allows the neural network to adapt its structure during training, optimizing both weights and architecture. Leveraging a Stochastic Gradient Descent-based optimizer and guided Monte Carlo tree search, the package provides a powerful tool for enhancing model performance.",
    "version": "0.0.6",
    "project_urls": null,
    "split_keywords": [
        "python",
        "neural network",
        "growing neural network",
        "growing"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fb6c9f64124045b82bc6ee68919f9d85af400146490a6338c5f1e37bf9ec62b7",
                "md5": "962b3e3aaf92a4853a89da716d001eaf",
                "sha256": "4000d6e3eded10106585662cdac44738f1befa708465f1af42f5f477ae55f9d5"
            },
            "downloads": -1,
            "filename": "growingnn-0.0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "962b3e3aaf92a4853a89da716d001eaf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 25673,
            "upload_time": "2024-02-09T16:34:01",
            "upload_time_iso_8601": "2024-02-09T16:34:01.533618Z",
            "url": "https://files.pythonhosted.org/packages/fb/6c/9f64124045b82bc6ee68919f9d85af400146490a6338c5f1e37bf9ec62b7/growingnn-0.0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0397095b1cf6870ce126fd369e421b221c4e7413ad44c8aa4ef2c190f53bc119",
                "md5": "1e670d8ab54ba638ba212db5663a0d14",
                "sha256": "112c3e754d403a806c1aecaa4fd7a1cd5ac59d040f09d6398276a5f5b70a5a55"
            },
            "downloads": -1,
            "filename": "growingnn-0.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "1e670d8ab54ba638ba212db5663a0d14",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 24345,
            "upload_time": "2024-02-09T16:34:12",
            "upload_time_iso_8601": "2024-02-09T16:34:12.216229Z",
            "url": "https://files.pythonhosted.org/packages/03/97/095b1cf6870ce126fd369e421b221c4e7413ad44c8aa4ef2c190f53bc119/growingnn-0.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-09 16:34:12",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "growingnn"
}
        
Elapsed time: 0.39323s