Kala-NuroNetwork


NameKala-NuroNetwork JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/Kalasaikamesh944/Kala_NuroNetwork
SummaryA hybrid quantum-classical neural network framework using Kala_Quantum and Kala_Torch
upload_time2024-12-21 11:30:32
maintainerNone
docs_urlNone
authorN V R K SAI KAMESH YADAVALLI
requires_python>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# Kala_NuroNetwork

Kala_NuroNetwork is a hybrid quantum-classical neural network framework that integrates Kala_Quantum and Kala_Torch for advanced machine learning tasks.

## Features

- **Quantum Layer**: Leverage quantum circuits with Hadamard and CNOT gates for preprocessing.
- **Classical Neural Network**: Includes fully connected layers for classical computation.
- **Trainer Class**: Train and evaluate models with ease.
- **Large Dataset Support**: Handle big data with efficient batching and parallelism.

## Installation

```bash
pip install Kala_Quantum Kala_Torch torch
```

## Usage

```python
from KalaNeroNetwork import KalaNuroNetwork, KalaNuroTrainer
import torch
import torch.nn as nn
import torch.optim as optim

# Define hyperparameters
input_size = 2
n_qubits = 2
hidden_size = 128
output_size = 2
batch_size = 128
epochs = 10

# Generate synthetic dataset
def generate_large_data(num_samples, input_size):
    data = torch.rand(num_samples, input_size)
    labels = (data.sum(axis=1) > 1.0).long()  # Binary classification based on sum threshold
    return data, labels

num_samples = 10000
data, labels = generate_large_data(num_samples, input_size)
dataset = torch.utils.data.TensorDataset(data, labels)
data_loader = torch.utils.data.DataLoader(dataset, batch_size=batch_size, shuffle=True)

# Initialize model, optimizer, and criterion
model = KalaNuroNetwork(input_size, n_qubits, hidden_size, output_size)
optimizer = optim.Adam(model.parameters(), lr=0.001)
criterion = nn.CrossEntropyLoss()

# Train and evaluate
trainer = KalaNuroTrainer(model, optimizer, criterion, device="cpu")

print("Starting training...")
trainer.train(data_loader, epochs)

print("Evaluating model...")
trainer.evaluate(data_loader)
```

## License

This project is licensed under the MIT License. See the LICENSE file for details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Kalasaikamesh944/Kala_NuroNetwork",
    "name": "Kala-NuroNetwork",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "N V R K SAI KAMESH YADAVALLI",
    "author_email": "saikamesh.y@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/6d/6d/1bd5f5955811233a199ce21914a5959494db190e0c80adeea1a8be1ebaaf/kala_nuronetwork-0.1.0.tar.gz",
    "platform": null,
    "description": "\r\n# Kala_NuroNetwork\r\n\r\nKala_NuroNetwork is a hybrid quantum-classical neural network framework that integrates Kala_Quantum and Kala_Torch for advanced machine learning tasks.\r\n\r\n## Features\r\n\r\n- **Quantum Layer**: Leverage quantum circuits with Hadamard and CNOT gates for preprocessing.\r\n- **Classical Neural Network**: Includes fully connected layers for classical computation.\r\n- **Trainer Class**: Train and evaluate models with ease.\r\n- **Large Dataset Support**: Handle big data with efficient batching and parallelism.\r\n\r\n## Installation\r\n\r\n```bash\r\npip install Kala_Quantum Kala_Torch torch\r\n```\r\n\r\n## Usage\r\n\r\n```python\r\nfrom KalaNeroNetwork import KalaNuroNetwork, KalaNuroTrainer\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.optim as optim\r\n\r\n# Define hyperparameters\r\ninput_size = 2\r\nn_qubits = 2\r\nhidden_size = 128\r\noutput_size = 2\r\nbatch_size = 128\r\nepochs = 10\r\n\r\n# Generate synthetic dataset\r\ndef generate_large_data(num_samples, input_size):\r\n    data = torch.rand(num_samples, input_size)\r\n    labels = (data.sum(axis=1) > 1.0).long()  # Binary classification based on sum threshold\r\n    return data, labels\r\n\r\nnum_samples = 10000\r\ndata, labels = generate_large_data(num_samples, input_size)\r\ndataset = torch.utils.data.TensorDataset(data, labels)\r\ndata_loader = torch.utils.data.DataLoader(dataset, batch_size=batch_size, shuffle=True)\r\n\r\n# Initialize model, optimizer, and criterion\r\nmodel = KalaNuroNetwork(input_size, n_qubits, hidden_size, output_size)\r\noptimizer = optim.Adam(model.parameters(), lr=0.001)\r\ncriterion = nn.CrossEntropyLoss()\r\n\r\n# Train and evaluate\r\ntrainer = KalaNuroTrainer(model, optimizer, criterion, device=\"cpu\")\r\n\r\nprint(\"Starting training...\")\r\ntrainer.train(data_loader, epochs)\r\n\r\nprint(\"Evaluating model...\")\r\ntrainer.evaluate(data_loader)\r\n```\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License. See the LICENSE file for details.\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A hybrid quantum-classical neural network framework using Kala_Quantum and Kala_Torch",
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/Kalasaikamesh944/Kala_NuroNetwork"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fd0668a992250b21c95b8d4de2122975219ad62391e76cf64a1620e943ac0d44",
                "md5": "525a1035cddebfe0f13dc17e6868927e",
                "sha256": "49028c2deb67a202e37e6a248b384c1a201324ca2785b26793ef7e277d902f19"
            },
            "downloads": -1,
            "filename": "Kala_NuroNetwork-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "525a1035cddebfe0f13dc17e6868927e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 3954,
            "upload_time": "2024-12-21T11:30:29",
            "upload_time_iso_8601": "2024-12-21T11:30:29.858602Z",
            "url": "https://files.pythonhosted.org/packages/fd/06/68a992250b21c95b8d4de2122975219ad62391e76cf64a1620e943ac0d44/Kala_NuroNetwork-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6d6d1bd5f5955811233a199ce21914a5959494db190e0c80adeea1a8be1ebaaf",
                "md5": "f3fac5d7d0a953d43c4c5dab0a446eb3",
                "sha256": "13f303b214a69bc71708a70bf7dd4185c5133311969556c13c67fe4b8baa7dea"
            },
            "downloads": -1,
            "filename": "kala_nuronetwork-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f3fac5d7d0a953d43c4c5dab0a446eb3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 3566,
            "upload_time": "2024-12-21T11:30:32",
            "upload_time_iso_8601": "2024-12-21T11:30:32.647450Z",
            "url": "https://files.pythonhosted.org/packages/6d/6d/1bd5f5955811233a199ce21914a5959494db190e0c80adeea1a8be1ebaaf/kala_nuronetwork-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-21 11:30:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Kalasaikamesh944",
    "github_project": "Kala_NuroNetwork",
    "github_not_found": true,
    "lcname": "kala-nuronetwork"
}
        
Elapsed time: 0.44446s