hqde 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
hqde-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 HQDE Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
hqde-0.1.0/MANIFEST.in ADDED
@@ -0,0 +1,6 @@
1
+ include README.md
2
+ include LICENSE
3
+ include hqde/py.typed
4
+ recursive-include hqde *.py
5
+ recursive-exclude * __pycache__
6
+ recursive-exclude * *.py[co]
hqde-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,237 @@
1
+ Metadata-Version: 2.4
2
+ Name: hqde
3
+ Version: 0.1.0
4
+ Summary: Hierarchical Quantum-Distributed Ensemble Learning Framework
5
+ Author-email: HQDE Team <hqde@example.com>
6
+ Maintainer-email: HQDE Team <hqde@example.com>
7
+ License: MIT
8
+ Project-URL: Homepage, https://github.com/Prathmesh333/Hierarchical-Quantum-Distributed-Ensemble-Learning
9
+ Project-URL: Repository, https://github.com/Prathmesh333/Hierarchical-Quantum-Distributed-Ensemble-Learning
10
+ Project-URL: Documentation, https://github.com/Prathmesh333/Hierarchical-Quantum-Distributed-Ensemble-Learning/blob/main/HOW_TO_RUN.md
11
+ Project-URL: Bug Reports, https://github.com/Prathmesh333/Hierarchical-Quantum-Distributed-Ensemble-Learning/issues
12
+ Keywords: machine-learning,quantum,distributed,ensemble,deep-learning,pytorch,ray
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
24
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
25
+ Requires-Python: >=3.9
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: numpy>=2.0.2
29
+ Requires-Dist: torch>=2.8.0
30
+ Requires-Dist: torchvision>=0.23.0
31
+ Requires-Dist: ray[default]>=2.49.2
32
+ Requires-Dist: scikit-learn>=1.6.1
33
+ Requires-Dist: psutil>=7.1.0
34
+ Provides-Extra: dev
35
+ Requires-Dist: pytest>=8.4.2; extra == "dev"
36
+ Requires-Dist: ipython>=8.18.1; extra == "dev"
37
+ Requires-Dist: matplotlib>=3.9.4; extra == "dev"
38
+ Requires-Dist: pandas>=2.3.2; extra == "dev"
39
+ Requires-Dist: seaborn>=0.13.2; extra == "dev"
40
+ Requires-Dist: tqdm>=4.67.1; extra == "dev"
41
+ Dynamic: license-file
42
+
43
+ # HQDE - Hierarchical Quantum-Distributed Ensemble Learning
44
+
45
+ [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
46
+ [![PyTorch](https://img.shields.io/badge/PyTorch-2.8+-red.svg)](https://pytorch.org/)
47
+ [![Ray](https://img.shields.io/badge/Ray-2.49+-green.svg)](https://ray.io/)
48
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
49
+
50
+ > **A production-ready framework for distributed ensemble learning with quantum-inspired algorithms and adaptive quantization.**
51
+
52
+ HQDE combines cutting-edge quantum-inspired algorithms with distributed computing to deliver superior machine learning performance with significantly reduced memory usage and training time.
53
+
54
+ ## ✨ Why HQDE?
55
+
56
+ - **🚀 4x faster training** with quantum-optimized algorithms
57
+ - **💾 4x memory reduction** through adaptive quantization
58
+ - **🔧 Production-ready** with fault tolerance and load balancing
59
+ - **🧠 Quantum-inspired** ensemble aggregation methods
60
+ - **🌐 Distributed** processing with automatic scaling
61
+
62
+ ## 📦 Installation
63
+
64
+ ### Option 1: Install from PyPI (Recommended)
65
+ ```bash
66
+ pip install hqde
67
+ ```
68
+
69
+ ### Option 2: Install from Source
70
+ ```bash
71
+ git clone https://github.com/Prathmesh333/HQDE-PyPI.git
72
+ cd HQDE-PyPI
73
+ pip install -e .
74
+ ```
75
+
76
+ ## 🚀 Quick Start
77
+
78
+ ```python
79
+ from hqde import create_hqde_system
80
+ import torch.nn as nn
81
+
82
+ # Define your PyTorch model
83
+ class MyModel(nn.Module):
84
+ def __init__(self, num_classes=10):
85
+ super().__init__()
86
+ self.layers = nn.Sequential(
87
+ nn.Conv2d(3, 32, 3, padding=1),
88
+ nn.ReLU(),
89
+ nn.MaxPool2d(2),
90
+ nn.Conv2d(32, 64, 3, padding=1),
91
+ nn.ReLU(),
92
+ nn.AdaptiveAvgPool2d(1),
93
+ nn.Flatten(),
94
+ nn.Linear(64, num_classes)
95
+ )
96
+
97
+ def forward(self, x):
98
+ return self.layers(x)
99
+
100
+ # Create HQDE system (it's that simple!)
101
+ hqde_system = create_hqde_system(
102
+ model_class=MyModel,
103
+ model_kwargs={'num_classes': 10},
104
+ num_workers=4 # Use 4 distributed workers
105
+ )
106
+
107
+ # Train your ensemble
108
+ metrics = hqde_system.train(train_loader, num_epochs=10)
109
+
110
+ # Make predictions
111
+ predictions = hqde_system.predict(test_loader)
112
+ ```
113
+
114
+ ## 🧪 Try the Examples
115
+
116
+ ```bash
117
+ # Quick demo (30 seconds)
118
+ python examples/quick_start.py
119
+
120
+ # CIFAR-10 benchmark test
121
+ python examples/cifar10_synthetic_test.py
122
+
123
+ # Real CIFAR-10 dataset
124
+ python examples/cifar10_test.py
125
+ ```
126
+
127
+ ### Expected Results
128
+ ```
129
+ === HQDE CIFAR-10 Test Results ===
130
+ Training Time: 18.29 seconds
131
+ Test Accuracy: 86.10%
132
+ Memory Usage: 0.094 MB
133
+ Ensemble Diversity: 96.8%
134
+ ```
135
+
136
+ ## ⚙️ Key Features
137
+
138
+ ### 🧠 Quantum-Inspired Algorithms
139
+ - **Quantum Superposition Aggregation**: Advanced ensemble combination
140
+ - **Entanglement-Based Correlation**: Sophisticated member coordination
141
+ - **Quantum Noise Injection**: Enhanced exploration and generalization
142
+
143
+ ### 📊 Adaptive Quantization
144
+ - **Dynamic Bit Allocation**: 4-16 bit precision based on importance
145
+ - **Real-time Optimization**: Automatic compression without accuracy loss
146
+ - **Memory Efficiency**: Up to 20x reduction vs traditional methods
147
+
148
+ ### 🌐 Distributed Processing
149
+ - **MapReduce Architecture**: Scalable with Ray framework
150
+ - **Byzantine Fault Tolerance**: Robust against node failures
151
+ - **Hierarchical Aggregation**: O(log n) communication complexity
152
+
153
+ ## 📈 Performance Benchmarks
154
+
155
+ | Metric | Traditional Ensemble | HQDE | Improvement |
156
+ |--------|---------------------|------|-------------|
157
+ | Memory Usage | 2.4 GB | 0.6 GB | **4x reduction** |
158
+ | Training Time | 45 min | 12 min | **3.75x faster** |
159
+ | Communication | 800 MB | 100 MB | **8x less data** |
160
+ | Test Accuracy | 91.2% | 93.7% | **+2.5% better** |
161
+
162
+ ## 🔧 Configuration
163
+
164
+ Customize HQDE for your needs:
165
+
166
+ ```python
167
+ # Fine-tune quantization
168
+ quantization_config = {
169
+ 'base_bits': 8, # Default precision
170
+ 'min_bits': 4, # High compression
171
+ 'max_bits': 16 # High precision
172
+ }
173
+
174
+ # Adjust quantum parameters
175
+ aggregation_config = {
176
+ 'noise_scale': 0.005, # Quantum noise level
177
+ 'exploration_factor': 0.1, # Exploration strength
178
+ 'entanglement_strength': 0.1 # Ensemble correlation
179
+ }
180
+
181
+ # Scale distributed processing
182
+ hqde_system = create_hqde_system(
183
+ model_class=YourModel,
184
+ num_workers=8, # Scale up for larger datasets
185
+ quantization_config=quantization_config,
186
+ aggregation_config=aggregation_config
187
+ )
188
+ ```
189
+
190
+ ## 📚 Documentation
191
+
192
+ - **[HOW_TO_RUN.md](HOW_TO_RUN.md)** - Detailed setup and usage guide
193
+ - **[Examples](examples/)** - Working code examples and demos
194
+ - **[API Reference](hqde/)** - Complete module documentation
195
+
196
+ ## 🤝 Contributing
197
+
198
+ We welcome contributions! Please:
199
+
200
+ 1. Fork the repository
201
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
202
+ 3. Commit your changes (`git commit -m 'Add amazing feature'`)
203
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
204
+ 5. Open a Pull Request
205
+
206
+ ## 📄 License
207
+
208
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
209
+
210
+ ## 🔗 Citation
211
+
212
+ If you use HQDE in your research, please cite:
213
+
214
+ ```bibtex
215
+ @software{hqde2025,
216
+ title={HQDE: Hierarchical Quantum-Distributed Ensemble Learning},
217
+ author={Prathamesh Nikam},
218
+ year={2025},
219
+ url={https://github.com/Prathmesh333/HQDE-PyPI}
220
+ }
221
+ ```
222
+
223
+ ## 🆘 Support
224
+
225
+ - **🐛 Bug Reports**: [Create an issue](https://github.com/Prathmesh333/HQDE-PyPI/issues)
226
+ - **💡 Feature Requests**: [Create an issue](https://github.com/Prathmesh333/HQDE-PyPI/issues)
227
+ - **💬 Questions**: [Start a discussion](https://github.com/Prathmesh333/HQDE-PyPI/issues)
228
+
229
+ ---
230
+
231
+ <div align="center">
232
+
233
+ **Built with ❤️ for the machine learning community**
234
+
235
+ [⭐ Star](https://github.com/Prathmesh333/HQDE-PyPI/stargazers) • [🍴 Fork](https://github.com/Prathmesh333/HQDE-PyPI/fork) • [📝 Issues](https://github.com/Prathmesh333/HQDE-PyPI/issues)
236
+
237
+ </div>
hqde-0.1.0/README.md ADDED
@@ -0,0 +1,195 @@
1
+ # HQDE - Hierarchical Quantum-Distributed Ensemble Learning
2
+
3
+ [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/)
4
+ [![PyTorch](https://img.shields.io/badge/PyTorch-2.8+-red.svg)](https://pytorch.org/)
5
+ [![Ray](https://img.shields.io/badge/Ray-2.49+-green.svg)](https://ray.io/)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
7
+
8
+ > **A production-ready framework for distributed ensemble learning with quantum-inspired algorithms and adaptive quantization.**
9
+
10
+ HQDE combines cutting-edge quantum-inspired algorithms with distributed computing to deliver superior machine learning performance with significantly reduced memory usage and training time.
11
+
12
+ ## ✨ Why HQDE?
13
+
14
+ - **🚀 4x faster training** with quantum-optimized algorithms
15
+ - **💾 4x memory reduction** through adaptive quantization
16
+ - **🔧 Production-ready** with fault tolerance and load balancing
17
+ - **🧠 Quantum-inspired** ensemble aggregation methods
18
+ - **🌐 Distributed** processing with automatic scaling
19
+
20
+ ## 📦 Installation
21
+
22
+ ### Option 1: Install from PyPI (Recommended)
23
+ ```bash
24
+ pip install hqde
25
+ ```
26
+
27
+ ### Option 2: Install from Source
28
+ ```bash
29
+ git clone https://github.com/Prathmesh333/HQDE-PyPI.git
30
+ cd HQDE-PyPI
31
+ pip install -e .
32
+ ```
33
+
34
+ ## 🚀 Quick Start
35
+
36
+ ```python
37
+ from hqde import create_hqde_system
38
+ import torch.nn as nn
39
+
40
+ # Define your PyTorch model
41
+ class MyModel(nn.Module):
42
+ def __init__(self, num_classes=10):
43
+ super().__init__()
44
+ self.layers = nn.Sequential(
45
+ nn.Conv2d(3, 32, 3, padding=1),
46
+ nn.ReLU(),
47
+ nn.MaxPool2d(2),
48
+ nn.Conv2d(32, 64, 3, padding=1),
49
+ nn.ReLU(),
50
+ nn.AdaptiveAvgPool2d(1),
51
+ nn.Flatten(),
52
+ nn.Linear(64, num_classes)
53
+ )
54
+
55
+ def forward(self, x):
56
+ return self.layers(x)
57
+
58
+ # Create HQDE system (it's that simple!)
59
+ hqde_system = create_hqde_system(
60
+ model_class=MyModel,
61
+ model_kwargs={'num_classes': 10},
62
+ num_workers=4 # Use 4 distributed workers
63
+ )
64
+
65
+ # Train your ensemble
66
+ metrics = hqde_system.train(train_loader, num_epochs=10)
67
+
68
+ # Make predictions
69
+ predictions = hqde_system.predict(test_loader)
70
+ ```
71
+
72
+ ## 🧪 Try the Examples
73
+
74
+ ```bash
75
+ # Quick demo (30 seconds)
76
+ python examples/quick_start.py
77
+
78
+ # CIFAR-10 benchmark test
79
+ python examples/cifar10_synthetic_test.py
80
+
81
+ # Real CIFAR-10 dataset
82
+ python examples/cifar10_test.py
83
+ ```
84
+
85
+ ### Expected Results
86
+ ```
87
+ === HQDE CIFAR-10 Test Results ===
88
+ Training Time: 18.29 seconds
89
+ Test Accuracy: 86.10%
90
+ Memory Usage: 0.094 MB
91
+ Ensemble Diversity: 96.8%
92
+ ```
93
+
94
+ ## ⚙️ Key Features
95
+
96
+ ### 🧠 Quantum-Inspired Algorithms
97
+ - **Quantum Superposition Aggregation**: Advanced ensemble combination
98
+ - **Entanglement-Based Correlation**: Sophisticated member coordination
99
+ - **Quantum Noise Injection**: Enhanced exploration and generalization
100
+
101
+ ### 📊 Adaptive Quantization
102
+ - **Dynamic Bit Allocation**: 4-16 bit precision based on importance
103
+ - **Real-time Optimization**: Automatic compression without accuracy loss
104
+ - **Memory Efficiency**: Up to 20x reduction vs traditional methods
105
+
106
+ ### 🌐 Distributed Processing
107
+ - **MapReduce Architecture**: Scalable with Ray framework
108
+ - **Byzantine Fault Tolerance**: Robust against node failures
109
+ - **Hierarchical Aggregation**: O(log n) communication complexity
110
+
111
+ ## 📈 Performance Benchmarks
112
+
113
+ | Metric | Traditional Ensemble | HQDE | Improvement |
114
+ |--------|---------------------|------|-------------|
115
+ | Memory Usage | 2.4 GB | 0.6 GB | **4x reduction** |
116
+ | Training Time | 45 min | 12 min | **3.75x faster** |
117
+ | Communication | 800 MB | 100 MB | **8x less data** |
118
+ | Test Accuracy | 91.2% | 93.7% | **+2.5% better** |
119
+
120
+ ## 🔧 Configuration
121
+
122
+ Customize HQDE for your needs:
123
+
124
+ ```python
125
+ # Fine-tune quantization
126
+ quantization_config = {
127
+ 'base_bits': 8, # Default precision
128
+ 'min_bits': 4, # High compression
129
+ 'max_bits': 16 # High precision
130
+ }
131
+
132
+ # Adjust quantum parameters
133
+ aggregation_config = {
134
+ 'noise_scale': 0.005, # Quantum noise level
135
+ 'exploration_factor': 0.1, # Exploration strength
136
+ 'entanglement_strength': 0.1 # Ensemble correlation
137
+ }
138
+
139
+ # Scale distributed processing
140
+ hqde_system = create_hqde_system(
141
+ model_class=YourModel,
142
+ num_workers=8, # Scale up for larger datasets
143
+ quantization_config=quantization_config,
144
+ aggregation_config=aggregation_config
145
+ )
146
+ ```
147
+
148
+ ## 📚 Documentation
149
+
150
+ - **[HOW_TO_RUN.md](HOW_TO_RUN.md)** - Detailed setup and usage guide
151
+ - **[Examples](examples/)** - Working code examples and demos
152
+ - **[API Reference](hqde/)** - Complete module documentation
153
+
154
+ ## 🤝 Contributing
155
+
156
+ We welcome contributions! Please:
157
+
158
+ 1. Fork the repository
159
+ 2. Create a feature branch (`git checkout -b feature/amazing-feature`)
160
+ 3. Commit your changes (`git commit -m 'Add amazing feature'`)
161
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
162
+ 5. Open a Pull Request
163
+
164
+ ## 📄 License
165
+
166
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
167
+
168
+ ## 🔗 Citation
169
+
170
+ If you use HQDE in your research, please cite:
171
+
172
+ ```bibtex
173
+ @software{hqde2025,
174
+ title={HQDE: Hierarchical Quantum-Distributed Ensemble Learning},
175
+ author={Prathamesh Nikam},
176
+ year={2025},
177
+ url={https://github.com/Prathmesh333/HQDE-PyPI}
178
+ }
179
+ ```
180
+
181
+ ## 🆘 Support
182
+
183
+ - **🐛 Bug Reports**: [Create an issue](https://github.com/Prathmesh333/HQDE-PyPI/issues)
184
+ - **💡 Feature Requests**: [Create an issue](https://github.com/Prathmesh333/HQDE-PyPI/issues)
185
+ - **💬 Questions**: [Start a discussion](https://github.com/Prathmesh333/HQDE-PyPI/issues)
186
+
187
+ ---
188
+
189
+ <div align="center">
190
+
191
+ **Built with ❤️ for the machine learning community**
192
+
193
+ [⭐ Star](https://github.com/Prathmesh333/HQDE-PyPI/stargazers) • [🍴 Fork](https://github.com/Prathmesh333/HQDE-PyPI/fork) • [📝 Issues](https://github.com/Prathmesh333/HQDE-PyPI/issues)
194
+
195
+ </div>
@@ -0,0 +1,62 @@
1
+ """
2
+ HQDE: Hierarchical Quantum-Distributed Ensemble Learning Framework
3
+
4
+ A comprehensive framework for distributed ensemble learning with quantum-inspired
5
+ algorithms, adaptive quantization, and efficient hierarchical aggregation.
6
+ """
7
+
8
+ __version__ = "0.1.0"
9
+ __author__ = "HQDE Team"
10
+
11
+ # Core components
12
+ from .core.hqde_system import HQDESystem, create_hqde_system
13
+ from .core.hqde_system import (
14
+ AdaptiveQuantizer,
15
+ QuantumInspiredAggregator,
16
+ DistributedEnsembleManager
17
+ )
18
+
19
+ # Quantum-inspired components
20
+ from .quantum import (
21
+ QuantumEnsembleAggregator,
22
+ QuantumNoiseGenerator,
23
+ QuantumEnsembleOptimizer
24
+ )
25
+
26
+ # Distributed components
27
+ from .distributed import (
28
+ MapReduceEnsembleManager,
29
+ HierarchicalAggregator,
30
+ ByzantineFaultTolerantAggregator,
31
+ DynamicLoadBalancer
32
+ )
33
+
34
+ # Utilities
35
+ from .utils import (
36
+ PerformanceMonitor,
37
+ SystemMetrics
38
+ )
39
+
40
+ __all__ = [
41
+ # Core
42
+ 'HQDESystem',
43
+ 'create_hqde_system',
44
+ 'AdaptiveQuantizer',
45
+ 'QuantumInspiredAggregator',
46
+ 'DistributedEnsembleManager',
47
+
48
+ # Quantum
49
+ 'QuantumEnsembleAggregator',
50
+ 'QuantumNoiseGenerator',
51
+ 'QuantumEnsembleOptimizer',
52
+
53
+ # Distributed
54
+ 'MapReduceEnsembleManager',
55
+ 'HierarchicalAggregator',
56
+ 'ByzantineFaultTolerantAggregator',
57
+ 'DynamicLoadBalancer',
58
+
59
+ # Utils
60
+ 'PerformanceMonitor',
61
+ 'SystemMetrics'
62
+ ]
File without changes
@@ -0,0 +1,23 @@
1
+ """
2
+ Core HQDE system components.
3
+
4
+ This module contains the main HQDE system implementation including
5
+ adaptive quantization, quantum-inspired aggregation, and distributed
6
+ ensemble management.
7
+ """
8
+
9
+ from .hqde_system import (
10
+ HQDESystem,
11
+ AdaptiveQuantizer,
12
+ QuantumInspiredAggregator,
13
+ DistributedEnsembleManager,
14
+ create_hqde_system
15
+ )
16
+
17
+ __all__ = [
18
+ 'HQDESystem',
19
+ 'AdaptiveQuantizer',
20
+ 'QuantumInspiredAggregator',
21
+ 'DistributedEnsembleManager',
22
+ 'create_hqde_system'
23
+ ]