README.md

Fri, 06 Dec 2024 22:36:50 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Fri, 06 Dec 2024 22:36:50 -0500
changeset 51
e9ce0256d0aa
parent 50
8c7fb7f3d7e5
child 52
1d8e5731a4d3
permissions
-rw-r--r--

README improvements

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
51
e9ce0256d0aa README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 50
diff changeset
19 only need to manually install the “stable” Rust system itself. At the time
e9ce0256d0aa README improvements
Tuomo Valkonen <tuomov@iki.fi>
parents: 50
diff changeset
20 of writing this README, [alg_tools] also needs to be downloaded separately.
26
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
21
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
22 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
23 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
24 the previous step, this can be done with
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
25 ```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
26 rustup toolchain install stable
26
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
27 ```
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
28 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
29 package.
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
30
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
31 [rustup]: https://rustup.rs
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
32 [alg_tools]: https://tuomov.iki.fi/software/alg_tools/
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
33 [Rust]: https://www.rust-lang.org/
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
34 [GNU Scientific Library]: https://www.gnu.org/software/gsl/
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
35 [Homebrew]: https://brew.sh
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
36 [arXiv:????]: https://arxiv.org/abs/????
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
37
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
38 ### Building and running the experiments
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 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
41 ```console
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
42 cargo run
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
43 ```
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
44 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
45
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
46 Alternatively, you may build the executable with
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
47 ```console
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
48 cargo build --release
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
49 ```
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
50 and then run it with
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 target/release/non-riemannian-opt
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
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
55 ## Internals
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 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
58 documentation may be built and opened with
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
59 ```console
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
60 cargo doc # build dependency docs
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
61 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
62 ```
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
63 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
64 generated documentation through an ugly workaround. Unfortunately,
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
65 `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
66 world, and does not support modern markdown features, such as mathematics.
be0f9185b075 README, LICENSE, doc-building.
Tuomo Valkonen <tuomov@iki.fi>
parents:
diff changeset
67

mercurial