Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- safetensors
|
| 5 |
+
- zkaedi-prime
|
| 6 |
+
- hamiltonian-dynamics
|
| 7 |
+
- vulnerability-detection
|
| 8 |
+
- two-field
|
| 9 |
+
- custom-architecture
|
| 10 |
+
- security
|
| 11 |
+
- smart-contracts
|
| 12 |
+
pipeline_tag: other
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# π± Leviathan v2 β Two-Field Hamiltonian Classifier
|
| 16 |
+
|
| 17 |
+
**Session-trained CNN operating on ZKAEDI PRIME two-field (H, V) energy landscapes.**
|
| 18 |
+
|
| 19 |
+
## Architecture
|
| 20 |
+
|
| 21 |
+
```
|
| 22 |
+
Input: 2-channel tensor (H_field, V_field)
|
| 23 |
+
β
|
| 24 |
+
Conv2d(2, 16, 3Γ3) β ReLU
|
| 25 |
+
Conv2d(16, 16, 3Γ3) β ReLU
|
| 26 |
+
β
|
| 27 |
+
Flatten β 4096
|
| 28 |
+
β
|
| 29 |
+
Linear(4096, 64) β ReLU
|
| 30 |
+
Linear(64, 1) β Output
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
| Component | Shape | Parameters |
|
| 34 |
+
|-----------|-------|------------|
|
| 35 |
+
| conv_net.0 | (16, 2, 3, 3) + bias | 304 |
|
| 36 |
+
| conv_net.2 | (16, 16, 3, 3) + bias | 2,320 |
|
| 37 |
+
| fc.1 | (64, 4096) + bias | 262,208 |
|
| 38 |
+
| fc.3 | (1, 64) + bias | 65 |
|
| 39 |
+
| **Total** | | **264,897** |
|
| 40 |
+
|
| 41 |
+
## Usage
|
| 42 |
+
|
| 43 |
+
```python
|
| 44 |
+
from safetensors.numpy import load_file
|
| 45 |
+
import numpy as np
|
| 46 |
+
|
| 47 |
+
# Load weights
|
| 48 |
+
weights = load_file("leviathan_v2_session_trained.safetensors")
|
| 49 |
+
|
| 50 |
+
# Or use the inference module
|
| 51 |
+
from leviathan import Leviathan
|
| 52 |
+
|
| 53 |
+
model = Leviathan.from_safetensors("leviathan_v2_session_trained.safetensors")
|
| 54 |
+
|
| 55 |
+
# Input: two-field Hamiltonian snapshot (H, V) as 2-channel image
|
| 56 |
+
H_field = np.random.randn(1, 16, 16) # Activator field
|
| 57 |
+
V_field = np.random.randn(1, 16, 16) # Inhibitor field
|
| 58 |
+
input_tensor = np.stack([H_field[0], V_field[0]])[None] # (1, 2, 16, 16)
|
| 59 |
+
|
| 60 |
+
output = model.forward(input_tensor)
|
| 61 |
+
print(f"Score: {output}")
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
## Integration with PRIME Swarm
|
| 65 |
+
|
| 66 |
+
```python
|
| 67 |
+
from gradio_client import Client
|
| 68 |
+
import json
|
| 69 |
+
|
| 70 |
+
# 1. Run swarm analysis
|
| 71 |
+
swarm = Client("zkaedi/prime-swarm-hunter")
|
| 72 |
+
result = json.loads(swarm.predict("defi_lending_pool", 300, 150, 42, api_name="/api_preset"))
|
| 73 |
+
|
| 74 |
+
# 2. Feed energy landscape snapshot to Leviathan for classification
|
| 75 |
+
# Leviathan scores the field state for vulnerability presence
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
## Part of the ZKAEDI Security Pipeline
|
| 79 |
+
|
| 80 |
+
```
|
| 81 |
+
Solidity Code
|
| 82 |
+
β gemma-2-9b-solidity-merged (vulnerability signatures)
|
| 83 |
+
β prime-swarm-hunter (12-agent temporal detection)
|
| 84 |
+
β Leviathan v2 (two-field classification)
|
| 85 |
+
β solidity-vuln-auditor-7b (final audit report)
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
## Author
|
| 89 |
+
|
| 90 |
+
**ZKAEDI** β Offensive Healer
|