Spaces:
Runtime error
Runtime error
Download rust_lenia/src/lib.rs from Executor-Tyrant-Framework/NuWave: direct link, hf CLI and curl.
- Browser
- Download file 782 Bytes
-
https://huggingface.co/spaces/Executor-Tyrant-Framework/NuWave/resolve/main/rust_lenia/src/lib.rs
- Command line
-
hf download hf://spaces/Executor-Tyrant-Framework/NuWave/rust_lenia/src/lib.rs
-
curl -L -o lib.rs https://huggingface.co/spaces/Executor-Tyrant-Framework/NuWave/resolve/main/rust_lenia/src/lib.rs
782 Bytes
| //! NuWave Lenia Engine — Rust Core | |
| //! | |
| //! Applies Lenia dynamics to transformer weight matrices. | |
| //! The hot path: 196 weight matrices × (conv2d + growth + conservation) per step. | |
| //! Python/PyTorch: ~65s. Rust target: <5s. | |
| //! | |
| //! The growth function IS the learning rule. No backprop. No loss function. | |
| //! Each weight neighborhood evolves based on its neighbors' states | |
| //! and the activation flow through it. | |
| //! | |
| //! PyO3 bindings: Python calls step() with flat f32 arrays. | |
| //! Rust does the math. Returns delta arrays Python applies to tensors. | |
| mod engine; | |
| mod kernel; | |
| use pyo3::prelude::*; | |
| fn nuwave_lenia(m: &Bound<'_, PyModule>) -> PyResult<()> { | |
| m.add_class::<engine::RustLeniaEngine>()?; | |
| m.add_class::<engine::LeniaStepResult>()?; | |
| Ok(()) | |
| } | |