Documentation
Search…
WandbRun
WandbRun object represents an instance of a run in Java.

Overview

A run can be created by using the WandbRun Builder. This object is used to track runs
  • run.log(JSONObject data) — logs data for a run, equivalent to wand.log()
  • run.log(int step, JSONObject data) — logs data for a run, equivalent to wand.log() at a specific step
  • run.finish(int exitCode) — finishes a run with an exit code (default: 0)

Examples

Plotting a sin wave with the Java client
1
// Initalize a run
2
WandbRun run = new WandbRun.Builder().build();
3
4
// Compute and log each sin value
5
for (double i = 0.0; i < 2 * Math.PI; i += 0.1) {
6
JSONObject data = new JSONObject();
7
data.put("value", Math.sin(i));
8
run.log(data);
9
}
10
11
// Exit run when finished.
12
run.done();
Copied!
Copy link