Skip to content

Commit

Permalink
Fixed a couple of things in the book for the v0.10.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-k committed Feb 27, 2024
1 parent b7c7905 commit 4a5dda1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions media/book/src/checkpointing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Checkpointing is a useful mechanism for mitigating the effects of crashes when s
Checkpoints are snapshots of the current state of the optimization which can be resumed from in case of a crash.
These checkpoints are saved regularly at a user-chosen frequency.

Currently only saving checkpoints to disk with [`FileCheckpoint`](https://docs.rs/argmin/latest/argmin/core/checkpointing/struct.FileCheckpoint.html) is provided.
Currently only saving checkpoints to disk with [`FileCheckpoint`](https://docs.rs/argmin-checkpointing-file/latest/argmin_checkpointing_file/struct.FileCheckpoint.html) is provided
in the [`argmin-checkpointing-file`](https://crates.io/crates/argmin-checkpointing-file) crate.
Via the [`Checkpoint`](https://docs.rs/argmin/latest/argmin/core/checkpointing/trait.Checkpoint.html) trait other checkpointing approaches can be implemented (see the chapter on [implementing a checkpointing method](./implementing_checkpointing.md) for details).

The [`CheckpointingFrequency`](https://docs.rs/argmin/latest/argmin/core/checkpointing/enum.CheckpointingFrequency.html) defines how often checkpoints are saved and can be chosen to be either `Always` (every iteration), `Every(u64)` (every Nth iteration) or `Never`.
Expand All @@ -20,7 +21,8 @@ If the run crashes and a checkpoint is found on disk, then it will resume from t
# extern crate argmin_testfunctions;
# use argmin::core::{CostFunction, Error, Executor, Gradient, observers::ObserverMode};
# #[cfg(feature = "serde1")]
# use argmin::core::checkpointing::{FileCheckpoint, CheckpointingFrequency};
use argmin::core::checkpointing::CheckpointingFrequency;
use argmin_checkpointing_file::FileCheckpoint;
# use argmin_observer_slog::SlogLogger;
# use argmin::solver::landweber::Landweber;
# use argmin_testfunctions::{rosenbrock, rosenbrock_derivative};
Expand Down
2 changes: 2 additions & 0 deletions media/book/src/observing.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ let res = Executor::new(cost, solver)
# }
```

<!--
## Using Spectator
[Spectator](https://crates.io/crates/spectator) is a graphical visualization tool for showing the progress of optimization runs.
Expand Down Expand Up @@ -209,3 +210,4 @@ let res = Executor::new(cost, solver)
# }
# }
```
-->
1 change: 1 addition & 0 deletions media/book/tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ doc-comment = "0.3.3"
argmin = { path = "../../../crates/argmin", features = ["serde1", "ctrlc", "wasm-bindgen", "rayon"] }
argmin-math = { path = "../../../crates/argmin-math", features = ["latest_all"] }
argmin-observer-slog = { path = "../../../crates/argmin-observer-slog", features = ["serde1"] }
argmin-checkpointing-file = { path = "../../../crates/argmin-checkpointing-file", features = ["serde1"] }
argmin-observer-spectator = { path = "../../../crates/argmin-observer-spectator" }
argmin_testfunctions = { version = "*", path = "../../../crates/argmin-testfunctions" }
serde = "1"

0 comments on commit 4a5dda1

Please sign in to comment.