README.md

Fri, 06 Dec 2024 22:34:48 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Fri, 06 Dec 2024 22:34:48 -0500
changeset 50
8c7fb7f3d7e5
parent 48
854e914f99c5
child 51
e9ce0256d0aa
permissions
-rw-r--r--

typofix

26
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
1
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
2 # Non-Riemannian optimisation
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
3
50
8c7fb7f3d7e5 typofix
Tuomo Valkonen <tuomov@iki.fi>
parents: 48
diff changeset
4 This package contains [Rust] codes for the manuscript “_Forward-backward methods in bilaterally bounded Alexandov spaces_” ([arXiv:????]) by Heikki von Koch and Tuomo Valkonen
26
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
5 ⟨tuomov@iki.fi⟩. It concerns the solution of problems of the type
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
6 $$
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
7 \min_{x ∈ M} F(x) + G(x)
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
8 $$
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
9 where $F$ is a smooth function and $G$ a possibly nonsmooth convex function
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
10 on a manifold $M$, which we do not assume to be Riemannian.
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
11 It may, for example, be an embedded manifold in $ℝ^3$, which sharp corners.
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
12 We have implemented the cube, as well as squared and non-squared distance functions.
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
13
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
14 ## Installation and usage
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
15
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
16 ### Installing dependencies
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
17
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
18 Most dependencies are managed by the Cargo build system of [Rust]. You will
48
854e914f99c5 alg_tools now support stable, so return to edition 2021 now to allow stable rust.
Tuomo Valkonen <tuomov@iki.fi>
parents: 26
diff changeset
19 only need to install the “stable” Rust compiler and the
26
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
20 [GNU Scientific Library] manually. At the time of writing this README,
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
21 [alg_tools] also needs to be downloaded separately.
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
22
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
23 1. Install the [Rust] infrastructure (including Cargo) with [rustup].
48
854e914f99c5 alg_tools now support stable, so return to edition 2021 now to allow stable rust.
Tuomo Valkonen <tuomov@iki.fi>
parents: 26
diff changeset
24 2. Install a “stable” release of the Rust compiler. With rustup, installed in
26
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
25 the previous step, this can be done with
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
26 ```console
48
854e914f99c5 alg_tools now support stable, so return to edition 2021 now to allow stable rust.
Tuomo Valkonen <tuomov@iki.fi>
parents: 26
diff changeset
27 rustup toolchain install stable
26
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
28 ```
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
29 3. Download [alg_tools] and unpack it under the same directory as this
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
30 package.
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
31
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
32 [rustup]: https://rustup.rs
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
33 [alg_tools]: https://tuomov.iki.fi/software/alg_tools/
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
34 [Rust]: https://www.rust-lang.org/
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
35 [GNU Scientific Library]: https://www.gnu.org/software/gsl/
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
36 [rust-GSL]: https://docs.rs/GSL/6.0.0/rgsl/
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
37 [Homebrew]: https://brew.sh
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
38 [arXiv:????]: https://arxiv.org/abs/????
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
39
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
40 ### Building and running the experiments
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
41
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
42 To compile the code and run the experiments in the manuscript, use
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
43 ```console
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
44 cargo run
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
45 ```
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
46 When doing this for the first time, several dependencies will be downloaded.
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
47
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
48 Alternatively, you may build the executable with
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
49 ```console
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
50 cargo build --release
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
51 ```
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
52 and then run it with
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
53 ```
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
54 target/release/non-riemannian-opt
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
55 ```
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
56
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
57 ## Internals
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
58
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
59 If you are interested in the program internals, the integrated source code
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
60 documentation may be built and opened with
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
61 ```console
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
62 cargo doc # build dependency docs
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
63 misc/cargo-d --open # build and open KaTeX-aware docs for this crate
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
64 ```
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
65 The `cargo-d` script ensures that KaTeX mathematics is rendered in the
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
66 generated documentation through an ugly workaround. Unfortunately,
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
67 `rustdoc`, akin to Rust largely itself, is stuck in 80's 7-bit gringo ASCII
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
68 world, and does not support modern markdown features, such as mathematics.
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
69

mercurial