Registry / Framework

framework · v0.1.2
Early Plateau
Track consecutive unimproved evaluations against a caller-selected patience budget.
Use Early Plateau
use vendor::early_plateau::early_plateau;
Run the example
nest demo early_plateau@0.1.2
blyxc native-run early_plateau-demo/main.blyx
Example source and expected output
use std::cli;
use std::text;
use vendor::early_plateau::early_plateau;
fn main() {
let arguments = cli_args();
if args_len(arguments) > 0 {
if args_len(arguments) % 2 != 0 {
stderr_line("Expected event and value pairs");
process_exit(2);
}
let mut live = early_plateau_start();
let mut i = 0;
while i < args_len(arguments) {
let input = args_at(arguments, i + 1);
if !text_is_number(input) {
stderr_line("Expected a whole numeric event value");
process_exit(2);
}
live = early_plateau_step(live, args_at(arguments, i), text_number(input));
let command = early_plateau_command(live);
println!(command);
if command == "reject" { process_exit(1); }
i += 2;
}
return;
}
let mut state = early_plateau_start();
state = early_plateau_step(state, "patience", 2.0);
println!(early_plateau_command(state));
state = early_plateau_step(state, "flat", 0.0);
println!(early_plateau_command(state));
state = early_plateau_step(state, "improved", 2.0);
println!(early_plateau_command(state));
state = early_plateau_step(state, "flat", 0.0);
println!(early_plateau_command(state));
state = early_plateau_step(state, "flat", 0.0);
println!(early_plateau_command(state));
}
Expected output
start_monitor
consume_patience
reset_patience
consume_patience
stop_training
Published versions
| Version | Package | Source commit | SHA-256 |
|---|---|---|---|
| 0.1.2 | Download ZIP · Browse files | 9c3e70c9c7 | 099e9a392e999382b76e496902490270796007d74d654b3847a59eb9b9b91d25 |
| 0.1.1 | Download ZIP · Browse files | ae10ac7ab4 | b7b67936cb61906a475b6afaa54bb09f92aba522ca0d97d24672fc8870c98590 |
| 0.1.0 | Download ZIP · Browse files | 6349f23784 | 0cecbce0dd2c6dd4194811687f226891d572ad50872df020c9b7af849bd99916 |