Skip to content

Instantly share code, notes, and snippets.

View kurtlawrence's full-sized avatar

Kurt Lawrence kurtlawrence

View GitHub Profile
@kurtlawrence
kurtlawrence / chart-metrics.rs
Last active May 17, 2023 03:14
Construct HTML document with Plotly charts of burn-rs training progression
//! A small utility to construct a HTML document with Plotly charts of the training metrics
//! by reading the log entries in burn's artifact directory.
//!
//! The file can be compiled and executed with `rustc` (`-O` for optimised)
//! ```sh
//! rustc chart-metrics.rs && ./chart-metrics <ARTIFACT-DIR>
//! ```
//!
//! Source code: https://gist.github.com/kurtlawrence/7921fca8751ce2ea4826f8ab0a90ee32
use std::collections::BTreeMap;
@kurtlawrence
kurtlawrence / fit_macro.rs
Created May 16, 2022 06:39
`fit_kserd!` macro implementation used in daedalus
// # Fitting kserd macro.
//
// The macro logic is hidden from users to avoid having the long list of pattern matching exposed.
// It also helps control the pattern state.
//
// Fitting is split into four aspects:
// 1. Parsing
// 2. Flattening
// 3. Documentation
// 4. Code generation