photon is a fast and modern experiment tracker written in Rust.
fn main() {
let mut run = photon::Run::builder()
.start()
.expect("failed to start run");
println!("Run: {}", run.id());
// Simulate a training loop
for step in 0..100_000_000 {
let loss = 1.0 / (1.0 + step as f64 * 0.05);
let accuracy = 1.0 - loss;
run.log("train/loss", loss, step).unwrap();
run.log("train/accuracy", accuracy, step).unwrap();
if step % 10 == 0 {
let lr = 0.001 * 0.95_f64.powi(step as i32 / 10);
run.log("train/lr", lr, step).unwrap();
}
}
println!("Logged: {} points", run.points_logged());
let stats = run.finish().expect("finish failed");
// etc
}Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.