kkthn.native_projection

class kkthn.native_projection.NativeProjection(shared_path: str | Path, *, n_x: int, n_y: int)[source]

Bases: object

project(x: ndarray, y_hat: ndarray) ndarray[source]
kkthn.native_projection.compile_native_projection(run_dir: str | Path, *, problem: dict[str, Any], settings: dict[str, Any], cc: str | None = None, force: bool = False) dict[str, Any][source]

Compile and store the native projection library in a platform-specific run artifact dir.

kkthn.native_projection.load_native_projection(run_dir: str | Path, manifest: dict[str, Any] | None = None) NativeProjection | None[source]
kkthn.native_projection.load_or_compile_native_projection(run_dir: str | Path, *, problem: dict[str, Any], settings: dict[str, Any]) tuple[NativeProjection | None, dict[str, Any]][source]

Load a usable native projection library or try to compile one for this system.