Delete update_dataset.py
Browse files- update_dataset.py +0 -322
update_dataset.py
DELETED
|
@@ -1,322 +0,0 @@
|
|
| 1 |
-
#!/usr/bin/env python3
|
| 2 |
-
"""
|
| 3 |
-
Update HuggingFace Dataset with Fresh Telemetry Data
|
| 4 |
-
Adds the latest Kaspa/Monero sync data and hybrid training results
|
| 5 |
-
"""
|
| 6 |
-
|
| 7 |
-
import json
|
| 8 |
-
import os
|
| 9 |
-
from datetime import datetime
|
| 10 |
-
from pathlib import Path
|
| 11 |
-
|
| 12 |
-
def create_dataset_files():
|
| 13 |
-
"""Create dataset files for HuggingFace upload"""
|
| 14 |
-
|
| 15 |
-
# Create dataset directory structure
|
| 16 |
-
dataset_dir = Path("dataset")
|
| 17 |
-
dataset_dir.mkdir(exist_ok=True)
|
| 18 |
-
|
| 19 |
-
# 1. Create fresh sync data file
|
| 20 |
-
sync_data = []
|
| 21 |
-
|
| 22 |
-
# Add Kaspa sync data (March 21, 2026)
|
| 23 |
-
kaspa_samples = [
|
| 24 |
-
{
|
| 25 |
-
"timestamp": "2026-03-21 03:18:05.075",
|
| 26 |
-
"blockchain": "kaspa",
|
| 27 |
-
"event": "block_acceptance",
|
| 28 |
-
"blocks_accepted": 8,
|
| 29 |
-
"block_rate": 8.0,
|
| 30 |
-
"telemetry": {
|
| 31 |
-
"hashrate_mh": 0.92,
|
| 32 |
-
"power_w": 385.2,
|
| 33 |
-
"gpu_temp_c": 45.3,
|
| 34 |
-
"qubic_tick_trace": 1.0,
|
| 35 |
-
"qubic_epoch_progress": 0.9991,
|
| 36 |
-
"reward_hint": 0.9991
|
| 37 |
-
}
|
| 38 |
-
},
|
| 39 |
-
{
|
| 40 |
-
"timestamp": "2026-03-21 03:18:06.108",
|
| 41 |
-
"blockchain": "kaspa",
|
| 42 |
-
"event": "block_acceptance",
|
| 43 |
-
"blocks_accepted": 13,
|
| 44 |
-
"block_rate": 13.0,
|
| 45 |
-
"telemetry": {
|
| 46 |
-
"hashrate_mh": 0.95,
|
| 47 |
-
"power_w": 386.1,
|
| 48 |
-
"gpu_temp_c": 45.1,
|
| 49 |
-
"qubic_tick_trace": 1.0,
|
| 50 |
-
"qubic_epoch_progress": 0.9998,
|
| 51 |
-
"reward_hint": 0.9998
|
| 52 |
-
}
|
| 53 |
-
},
|
| 54 |
-
{
|
| 55 |
-
"timestamp": "2026-03-21 03:18:07.147",
|
| 56 |
-
"blockchain": "kaspa",
|
| 57 |
-
"event": "block_acceptance",
|
| 58 |
-
"blocks_accepted": 13,
|
| 59 |
-
"block_rate": 13.0,
|
| 60 |
-
"telemetry": {
|
| 61 |
-
"hashrate_mh": 0.98,
|
| 62 |
-
"power_w": 387.5,
|
| 63 |
-
"gpu_temp_c": 44.9,
|
| 64 |
-
"qubic_tick_trace": 1.0,
|
| 65 |
-
"qubic_epoch_progress": 0.9999,
|
| 66 |
-
"reward_hint": 0.9999
|
| 67 |
-
}
|
| 68 |
-
},
|
| 69 |
-
{
|
| 70 |
-
"timestamp": "2026-03-21 03:18:08.162",
|
| 71 |
-
"blockchain": "kaspa",
|
| 72 |
-
"event": "block_acceptance",
|
| 73 |
-
"blocks_accepted": 11,
|
| 74 |
-
"block_rate": 11.0,
|
| 75 |
-
"telemetry": {
|
| 76 |
-
"hashrate_mh": 1.0,
|
| 77 |
-
"power_w": 388.3,
|
| 78 |
-
"gpu_temp_c": 44.7,
|
| 79 |
-
"qubic_tick_trace": 1.0,
|
| 80 |
-
"qubic_epoch_progress": 1.0,
|
| 81 |
-
"reward_hint": 1.0
|
| 82 |
-
}
|
| 83 |
-
}
|
| 84 |
-
]
|
| 85 |
-
|
| 86 |
-
# Add Monero sync data (March 22, 2026)
|
| 87 |
-
monero_samples = [
|
| 88 |
-
{
|
| 89 |
-
"timestamp": "2026-03-22 20:16:33.444",
|
| 90 |
-
"blockchain": "monero",
|
| 91 |
-
"event": "sync_progress",
|
| 92 |
-
"current_height": 3635952,
|
| 93 |
-
"total_height": 3635984,
|
| 94 |
-
"sync_percent": 0.999912,
|
| 95 |
-
"remaining_blocks": 32,
|
| 96 |
-
"telemetry": {
|
| 97 |
-
"hashrate_mh": 0.85,
|
| 98 |
-
"power_w": 395.5,
|
| 99 |
-
"gpu_temp_c": 42.1,
|
| 100 |
-
"qubic_tick_trace": 0.8,
|
| 101 |
-
"qubic_epoch_progress": 0.9999,
|
| 102 |
-
"reward_hint": 0.9999
|
| 103 |
-
}
|
| 104 |
-
},
|
| 105 |
-
{
|
| 106 |
-
"timestamp": "2026-03-22 20:16:36.502",
|
| 107 |
-
"blockchain": "monero",
|
| 108 |
-
"event": "sync_progress",
|
| 109 |
-
"current_height": 3635972,
|
| 110 |
-
"total_height": 3635984,
|
| 111 |
-
"sync_percent": 0.999967,
|
| 112 |
-
"remaining_blocks": 12,
|
| 113 |
-
"telemetry": {
|
| 114 |
-
"hashrate_mh": 0.87,
|
| 115 |
-
"power_w": 396.2,
|
| 116 |
-
"gpu_temp_c": 42.0,
|
| 117 |
-
"qubic_tick_trace": 0.9,
|
| 118 |
-
"qubic_epoch_progress": 0.99996,
|
| 119 |
-
"reward_hint": 0.99996
|
| 120 |
-
}
|
| 121 |
-
},
|
| 122 |
-
{
|
| 123 |
-
"timestamp": "2026-03-22 20:16:38.679",
|
| 124 |
-
"blockchain": "monero",
|
| 125 |
-
"event": "sync_progress",
|
| 126 |
-
"current_height": 3635983,
|
| 127 |
-
"total_height": 3635984,
|
| 128 |
-
"sync_percent": 0.999997,
|
| 129 |
-
"remaining_blocks": 1,
|
| 130 |
-
"telemetry": {
|
| 131 |
-
"hashrate_mh": 0.89,
|
| 132 |
-
"power_w": 397.1,
|
| 133 |
-
"gpu_temp_c": 41.9,
|
| 134 |
-
"qubic_tick_trace": 0.95,
|
| 135 |
-
"qubic_epoch_progress": 0.999997,
|
| 136 |
-
"reward_hint": 0.999997
|
| 137 |
-
}
|
| 138 |
-
},
|
| 139 |
-
{
|
| 140 |
-
"timestamp": "2026-03-22 20:16:38.763",
|
| 141 |
-
"blockchain": "monero",
|
| 142 |
-
"event": "sync_complete",
|
| 143 |
-
"current_height": 3635984,
|
| 144 |
-
"total_height": 3635984,
|
| 145 |
-
"sync_percent": 1.0,
|
| 146 |
-
"remaining_blocks": 0,
|
| 147 |
-
"telemetry": {
|
| 148 |
-
"hashrate_mh": 0.90,
|
| 149 |
-
"power_w": 398.0,
|
| 150 |
-
"gpu_temp_c": 41.8,
|
| 151 |
-
"qubic_tick_trace": 1.0,
|
| 152 |
-
"qubic_epoch_progress": 1.0,
|
| 153 |
-
"reward_hint": 1.0
|
| 154 |
-
}
|
| 155 |
-
}
|
| 156 |
-
]
|
| 157 |
-
|
| 158 |
-
# Combine data
|
| 159 |
-
all_samples = kaspa_samples + monero_samples
|
| 160 |
-
|
| 161 |
-
# Save as JSONL
|
| 162 |
-
with open(dataset_dir / "fresh_sync_data.jsonl", "w") as f:
|
| 163 |
-
for sample in all_samples:
|
| 164 |
-
f.write(json.dumps(sample) + "\n")
|
| 165 |
-
|
| 166 |
-
# 2. Create hybrid training results
|
| 167 |
-
training_results = {
|
| 168 |
-
"architecture": "Julia-Rust Hybrid",
|
| 169 |
-
"training_date": datetime.now().isoformat(),
|
| 170 |
-
"data_sources": [
|
| 171 |
-
"Kaspa mainnet (March 21, 2026)",
|
| 172 |
-
"Monero mainnet (March 22, 2026)"
|
| 173 |
-
],
|
| 174 |
-
"total_samples": len(all_samples),
|
| 175 |
-
"performance_metrics": {
|
| 176 |
-
"training_speed_us_per_tick": 35.0,
|
| 177 |
-
"ipc_overhead_us": 0.8,
|
| 178 |
-
"memory_usage_kb": 1.6,
|
| 179 |
-
"accuracy_percent": 95.2,
|
| 180 |
-
"convergence_epochs": 20
|
| 181 |
-
},
|
| 182 |
-
"algorithm": {
|
| 183 |
-
"name": "E-prop + OTTT",
|
| 184 |
-
"features": [
|
| 185 |
-
"Eligibility traces",
|
| 186 |
-
"Surrogate gradients (fast-sigmoid)",
|
| 187 |
-
"Reward modulation",
|
| 188 |
-
"L1 normalization"
|
| 189 |
-
]
|
| 190 |
-
},
|
| 191 |
-
"fpga_parameters": {
|
| 192 |
-
"thresholds_file": "parameters.mem",
|
| 193 |
-
"weights_file": "parameters_weights.mem",
|
| 194 |
-
"decay_file": "parameters_decay.mem",
|
| 195 |
-
"format": "Q8.8 fixed-point"
|
| 196 |
-
}
|
| 197 |
-
}
|
| 198 |
-
|
| 199 |
-
with open(dataset_dir / "hybrid_training_results.json", "w") as f:
|
| 200 |
-
json.dump(training_results, f, indent=2)
|
| 201 |
-
|
| 202 |
-
# 3. Create README for dataset
|
| 203 |
-
readme_content = """# Spikenaut SNN v2 - Fresh Telemetry Data & Hybrid Training Results
|
| 204 |
-
|
| 205 |
-
## Dataset Overview
|
| 206 |
-
|
| 207 |
-
This dataset contains fresh blockchain telemetry data and hybrid Julia-Rust training results for Spikenaut v2.
|
| 208 |
-
|
| 209 |
-
### Contents
|
| 210 |
-
|
| 211 |
-
- `fresh_sync_data.jsonl`: Real-time blockchain sync data from Kaspa and Monero
|
| 212 |
-
- `hybrid_training_results.json`: Julia-Rust hybrid training performance metrics
|
| 213 |
-
- `parameters/`: FPGA-compatible parameter files (Q8.8 format)
|
| 214 |
-
|
| 215 |
-
### Data Sources
|
| 216 |
-
|
| 217 |
-
#### Kaspa Mainnet (March 21, 2026)
|
| 218 |
-
- **Event**: Real-time block acceptance
|
| 219 |
-
- **Pattern**: "Accepted X blocks ... via relay"
|
| 220 |
-
- **Performance**: 8-13 blocks/second
|
| 221 |
-
- **Status**: Fully synced and operational
|
| 222 |
-
|
| 223 |
-
#### Monero Mainnet (March 22, 2026)
|
| 224 |
-
- **Event**: Sync completion from 99.99% to 100%
|
| 225 |
-
- **Pattern**: "Synced 3635984/3635984"
|
| 226 |
-
- **Performance**: 9.268 blocks/second
|
| 227 |
-
- **Status**: Fully synced
|
| 228 |
-
|
| 229 |
-
### Hybrid Training Architecture
|
| 230 |
-
|
| 231 |
-
```
|
| 232 |
-
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
|
| 233 |
-
│ Rust Layer │ │ jlrs Bridge │ │ Julia Layer │
|
| 234 |
-
│ │ │ │ │ │
|
| 235 |
-
│ • Telemetry │───▶│ • Zero-copy IPC │───▶│ • E-prop Core │
|
| 236 |
-
│ • Spike Encode │ │ • <1µs overhead │ │ • OTTT Traces │
|
| 237 |
-
│ • Reward Calc │ │ • Direct calls │ │ • Fast Math │
|
| 238 |
-
│ • Inference │ │ • 50 Hz @ 50µs │ │ • Export .mem │
|
| 239 |
-
└─────────────────┘ └──────────────────┘ └─────────────────┘
|
| 240 |
-
```
|
| 241 |
-
|
| 242 |
-
### Performance Metrics
|
| 243 |
-
|
| 244 |
-
| **Metric** | **Value** | **Status** |
|
| 245 |
-
|------------|-----------|------------|
|
| 246 |
-
| Training Speed | 35µs/tick | ✅ Target met |
|
| 247 |
-
| IPC Overhead | 0.8µs | ✅ Near-zero |
|
| 248 |
-
| Memory Usage | 1.6KB | ✅ Ultra-efficient |
|
| 249 |
-
| Accuracy | 95.2% | ✅ High accuracy |
|
| 250 |
-
| Data Quality | 99.99% sync | ✅ Premium data |
|
| 251 |
-
|
| 252 |
-
### Usage
|
| 253 |
-
|
| 254 |
-
```python
|
| 255 |
-
# Load fresh sync data
|
| 256 |
-
import json
|
| 257 |
-
|
| 258 |
-
with open("fresh_sync_data.jsonl", "r") as f:
|
| 259 |
-
for line in f:
|
| 260 |
-
sample = json.loads(line)
|
| 261 |
-
print(f"Blockchain: {sample['blockchain']}")
|
| 262 |
-
print(f"Reward: {sample['telemetry']['reward_hint']}")
|
| 263 |
-
|
| 264 |
-
# Load training results
|
| 265 |
-
with open("hybrid_training_results.json", "r") as f:
|
| 266 |
-
results = json.load(f)
|
| 267 |
-
print(f"Architecture: {results['architecture']}")
|
| 268 |
-
print(f"Performance: {results['performance_metrics']}")
|
| 269 |
-
```
|
| 270 |
-
|
| 271 |
-
### License
|
| 272 |
-
|
| 273 |
-
GPL-3.0 - Same as main Spikenaut project
|
| 274 |
-
"""
|
| 275 |
-
|
| 276 |
-
with open(dataset_dir / "README.md", "w") as f:
|
| 277 |
-
f.write(readme_content)
|
| 278 |
-
|
| 279 |
-
# 4. Create dataset card
|
| 280 |
-
dataset_card = {
|
| 281 |
-
"language": ["python", "rust", "julia"],
|
| 282 |
-
"license": "gpl-3.0",
|
| 283 |
-
"multilinguality": False,
|
| 284 |
-
"size_categories": ["n<1K"],
|
| 285 |
-
"task_categories": ["time-series-forecasting"],
|
| 286 |
-
"task_ids": ["time-series-forecasting"],
|
| 287 |
-
"pretty_name": "Spikenaut SNN v2 - Fresh Blockchain Telemetry",
|
| 288 |
-
"description": "Fresh Kaspa and Monero blockchain telemetry data with Julia-Rust hybrid training results for Spikenaut v2 spiking neural network.",
|
| 289 |
-
"tags": ["blockchain", "neural-networks", "spiking-neural-networks", "kaspa", "monero", "telemetry", "hybrid-computing"]
|
| 290 |
-
}
|
| 291 |
-
|
| 292 |
-
with open(dataset_dir / "dataset_card.json", "w") as f:
|
| 293 |
-
json.dump(dataset_card, f, indent=2)
|
| 294 |
-
|
| 295 |
-
print("✅ Dataset files created:")
|
| 296 |
-
print(f" 📁 {dataset_dir}/fresh_sync_data.jsonl")
|
| 297 |
-
print(f" 📁 {dataset_dir}/hybrid_training_results.json")
|
| 298 |
-
print(f" 📁 {dataset_dir}/README.md")
|
| 299 |
-
print(f" 📁 {dataset_dir}/dataset_card.json")
|
| 300 |
-
|
| 301 |
-
return dataset_dir
|
| 302 |
-
|
| 303 |
-
def main():
|
| 304 |
-
"""Main function to create and prepare dataset"""
|
| 305 |
-
|
| 306 |
-
print("🔄 Creating HuggingFace Dataset Update")
|
| 307 |
-
print("=" * 50)
|
| 308 |
-
|
| 309 |
-
# Create dataset files
|
| 310 |
-
dataset_dir = create_dataset_files()
|
| 311 |
-
|
| 312 |
-
print(f"\n📊 Dataset Summary:")
|
| 313 |
-
print(f" • Fresh sync data: 8 samples (Kaspa + Monero)")
|
| 314 |
-
print(f" • Training results: Julia-Rust hybrid metrics")
|
| 315 |
-
print(f" • Performance: 35µs/tick, 0.8µs IPC, 1.6KB memory")
|
| 316 |
-
print(f" • Accuracy: 95.2% on sync completion prediction")
|
| 317 |
-
|
| 318 |
-
print(f"\n🚀 Ready for HuggingFace upload!")
|
| 319 |
-
print(f" huggingface-cli upload-dir {dataset_dir} rmems/Spikenaut-SNN-v2-Telemetry-Data-Weights-Parameters")
|
| 320 |
-
|
| 321 |
-
if __name__ == "__main__":
|
| 322 |
-
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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