Download inference.py from At1uri/flow-matching-generative-engine: direct link, hf CLI and curl.
- Browser
- Download file 1.33 kB
-
https://huggingface.co/At1uri/flow-matching-generative-engine/resolve/main/inference.py
- Command line
-
hf download hf://At1uri/flow-matching-generative-engine/inference.py
-
curl -L -o inference.py https://huggingface.co/At1uri/flow-matching-generative-engine/resolve/main/inference.py
1.33 kB
| """ | |
| Inference Script for Flow Matching Generative Market Engine | |
| ============================================================ | |
| Author: Ramprasad Atluri (At1uri) | |
| Repository: At1uri/flow-matching-generative-engine | |
| """ | |
| from flow_engine import ContinuousNormalizingFlowEngine | |
| def run_flow_inference(): | |
| engine = ContinuousNormalizingFlowEngine() | |
| regimes = [ | |
| "steady_drift_regime", | |
| "heavy_tailed_volatility_clustering", | |
| "liquidity_crisis_flash_crash" | |
| ] | |
| print("=" * 70) | |
| print("CONTINUOUS NORMALIZING FLOW GENERATIVE INFERENCE (RK4 NEURAL ODE)") | |
| print("=" * 70) | |
| for reg in regimes: | |
| res = engine.sample(num_samples=1000, nfe_steps=8, regime=reg) | |
| print(f"\n[Regime: {reg.upper()}]") | |
| print(f" NFEs (Function Evaluations): {res['nfe_steps']}") | |
| print(f" Empirical Mean: {res['mean']}") | |
| print(f" Empirical Volatility (Std): {res['std']}") | |
| print(f" Generated Skewness: {res['skewness']}") | |
| print(f" Generated Kurtosis: {res['kurtosis']} (Target: {'Heavy-Tailed' if res['kurtosis'] > 3.0 else 'Normal'})") | |
| print(f" Absolute Autocorr (Lag 1): {res['autocorr_lag1']}") | |
| print(f" Sample Output Head: {res['sample_head']}") | |
| if __name__ == "__main__": | |
| run_flow_inference() | |