Notebooks¶
You can run Jacobi interactively cell by cell in VS Code, JupyterLab, or Google Colab using the Rust Jupyter kernel (evcxr_jupyter).
Starter notebooks live in notebooks/.
01_quickstart.ipynbcovers tensors, autodiff, compiled MLP training, inline SVG plots, and.safetensorssaving.02_vision_cnn.ipynbtrains a 2D CNN withimshowimage previews and loss curves.03_transformers_and_export.ipynbtrains a Mini GPT, runs compiled generation, saves.safetensors, and exports.onnx.
Running in VS Code¶
- Install the Rust Jupyter kernel once in your terminal, then restart VS Code. The latest
evcxr_jupyterrequires a recent Rust toolchain, so update stable first.
rustup update stable
rustup component add rust-src
cargo install --locked evcxr_jupyter
evcxr_jupyter --install
- Install the official Jupyter extension in VS Code.
- Open any file in
notebooks/(such asnotebooks/01_quickstart.ipynb). - Click Select Kernel in the top-right corner of the notebook, pick Jupyter Kernel, and choose Rust.
- Run the cells top to bottom. The first cell compiles
jacobionce for the session (roughly 20 to 40 seconds). Subsequent cells compile in a second or two and run on XLA at native speed.
Running in JupyterLab¶
With evcxr_jupyter installed, launch JupyterLab as usual and open any .ipynb file.
Inline Plots and Tensor Previews¶
Jacobi implements evcxr_display natively on both Tensor and io::plot::Figure with no extra dependencies.
- Ending a cell with a
Tensorexpression displays a compact HTML preview with its shape, dtype, and values. - Ending a cell with a
Figure(.plot(...),.scatter(...), or.imshow(...)) renders the SVG chart directly inside the cell output.