diff --git a/README.md b/README.md index 5624b4f..33cb56d 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,13 @@

Code for the paper: "Learning with 3D rotations, a hitchhiker’s guide to SO(3)"

+
A. René Geist, Jonas Frey, Mikel Zhobro, Anna Levina, and Georg Martius

OverviewInstallationExperiments • - Development • - Credits + Development

@@ -53,6 +53,12 @@ pip3 install torch torchvision torchaudio ``` # Experiments + +

+ + +

+ All experiments are implemented in PyTorch. Most experiments simply use [train.py](scripts/train.py). Depending on which command line arguments are passed (see below), @@ -72,7 +78,7 @@ learning results that have been stored using [logger.py](hitchhiking_rotations/u To reproduce the paper's experiments, download the data, and save it in the `assets/datasets` folder. > [!NOTE] -> The data is available here: [link](PUT-LINK-HERE) +> The data is available here: [link](https://drive.google.com/drive/folders/1D1FNeKBuFYC2BHxFWgzfm-cj2K3rVhnr?usp=sharing) ### Experiment 1, 2.1, and 2.2 @@ -100,16 +106,19 @@ for nb in {1..5}; do for seed in {1..20}; do python scripts/train.py --seed $see To reproduce the paper's figures, run the following commands: -| **Figures** | **Console command** | -|------------------------------------|--------------------------------------| -| Experiment 1 | TBD | -| Experiment 2.1 | `python visu/figure12a.py` | -| Experiment 2.2 | `python visu/figure12b.py` | -| Experiment 3 | TBD | -| Experiment 4 | `python visu/figure14.py` | -| Figure 6 & 18: Lipschitz constants | `python visu/lipschitz_constants.py` | -| Figure 16: MoCap data analysis | TBD | -| Figure 17: Loss gradients | `python visu/loss_gradients.py` | +| **Figures** | **Console command** | +|------------------------------------|---------------------------------------| +| Experiment 1 | `python visu/figure_pointcloud.py` | +| Experiment 2.1 | `python visu/figure_exp2a.py` | +| Experiment 2.2 | `python visu/figure_exp2b.py` | +| Experiment 3 | `python visu/figure_posenet.py` | +| Experiment 4 | `python visu/figure_fourier.py` | +| Figure 6 & 20: Lipschitz constants | `python visu/lipschitz_constants.py` | +| Figure 10: Training GSO & SVD | `python visu/gso_vs_svd_animation.py` | +| Figure 11: Gradient ratios of SVD | `python visu/gso_vs_svd.py` | +| Figure 18: Loss gradients | `python visu/loss_gradients.py` | +| Figure 19: MoCap data analysis | `python visu/figure_mocap.py` | + # Development ### Code Formatting @@ -130,5 +139,3 @@ pip3 install addheader addheader hitchhiking_rotations -t .header.txt -p \*.py --sep-len 79 --comment='#' --sep=' ' ``` -# Credits -TBD diff --git a/assets/docs/gso_vs_svd1.gif b/assets/docs/gso_vs_svd1.gif new file mode 100644 index 0000000..cfa16df Binary files /dev/null and b/assets/docs/gso_vs_svd1.gif differ diff --git a/assets/docs/gso_vs_svd2.gif b/assets/docs/gso_vs_svd2.gif new file mode 100644 index 0000000..fcdf786 Binary files /dev/null and b/assets/docs/gso_vs_svd2.gif differ diff --git a/assets/docs/gso_vs_svd3.gif b/assets/docs/gso_vs_svd3.gif new file mode 100644 index 0000000..99655d3 Binary files /dev/null and b/assets/docs/gso_vs_svd3.gif differ diff --git a/hitchhiking_rotations/cfgs/cfg_cube_image_to_pose.py b/hitchhiking_rotations/cfgs/cfg_cube_image_to_pose.py index b38b094..a8535b8 100644 --- a/hitchhiking_rotations/cfgs/cfg_cube_image_to_pose.py +++ b/hitchhiking_rotations/cfgs/cfg_cube_image_to_pose.py @@ -7,6 +7,7 @@ def get_cfg_cube_image_to_pose(device): shared_trainer_cfg = { "_target_": "hitchhiking_rotations.utils.Trainer", "lr": 0.001, + "patience": 10, "optimizer": "Adam", "logger": "${logger}", "verbose": "${verbose}", diff --git a/hitchhiking_rotations/cfgs/cfg_pcd_to_pose.py b/hitchhiking_rotations/cfgs/cfg_pcd_to_pose.py index 3681334..aec37e2 100644 --- a/hitchhiking_rotations/cfgs/cfg_pcd_to_pose.py +++ b/hitchhiking_rotations/cfgs/cfg_pcd_to_pose.py @@ -7,6 +7,7 @@ def get_cfg_pcd_to_pose(device): shared_trainer_cfg = { "_target_": "hitchhiking_rotations.utils.Trainer", "lr": 0.001, + "patience": 10, "optimizer": "Adam", "logger": "${logger}", "verbose": "${verbose}", diff --git a/scripts/run_all.py b/scripts/run_all.py index 0ded183..5f59b37 100644 --- a/scripts/run_all.py +++ b/scripts/run_all.py @@ -12,7 +12,7 @@ for seed in range(10): os.system(f"python3 {p} --experiment {exp} --seed {seed}") if exp in exps[:2]: - os.system("python3 " + str(os.path.join(HITCHHIKING_ROOT_DIR, "visu", "figure_19.py ") + exp)) - os.system("python3 " + str(os.path.join(HITCHHIKING_ROOT_DIR, "visu", "figure_12a.py ") + exp)) + os.system("python3 " + str(os.path.join(HITCHHIKING_ROOT_DIR, "visu", "figure_pointcloud.py ") + exp)) + os.system("python3 " + str(os.path.join(HITCHHIKING_ROOT_DIR, "visu", "figure_exp2a.py ") + exp)) else: - os.system("python3 " + str(os.path.join(HITCHHIKING_ROOT_DIR, "visu", "figure_12b.py"))) + os.system("python3 " + str(os.path.join(HITCHHIKING_ROOT_DIR, "visu", "figure_exp2b.py"))) diff --git a/visu/figure_12a.py b/visu/figure_exp2a.py similarity index 99% rename from visu/figure_12a.py rename to visu/figure_exp2a.py index f93cbab..e7051d8 100644 --- a/visu/figure_12a.py +++ b/visu/figure_exp2a.py @@ -83,7 +83,7 @@ plt.xticks([0.3, 0.4, 0.5, 0.6], ["0.3", "0.4", "0.5", "0.6"]) plt.tight_layout() -out_p = os.path.join(HITCHHIKING_ROOT_DIR, "results", exp, "figure_12a.pdf") +out_p = os.path.join(HITCHHIKING_ROOT_DIR, "results", exp, "figure_exp2a.pdf") plt.savefig(out_p) plt.show() diff --git a/visu/figure_12b.py b/visu/figure_exp2b.py similarity index 98% rename from visu/figure_12b.py rename to visu/figure_exp2b.py index 6c3912f..fdd82bc 100644 --- a/visu/figure_12b.py +++ b/visu/figure_exp2b.py @@ -73,6 +73,6 @@ plt.xticks([0.0005, 0.001, 0.002, 0.004], [r"$5\cdot10^{-4}$", r"$10^{-3}$", r"$2\cdot10^{-3}$", r"$4\cdot10^{-3}$"]) plt.tight_layout() -out_p = os.path.join(HITCHHIKING_ROOT_DIR, "results", "pose_to_cube_image", "figure_12b.pdf") +out_p = os.path.join(HITCHHIKING_ROOT_DIR, "results", "pose_to_cube_image", "figure_exp2b.pdf") plt.savefig(out_p) plt.show() diff --git a/visu/figure_14.py b/visu/figure_fourier.py similarity index 97% rename from visu/figure_14.py rename to visu/figure_fourier.py index 0782f6e..6b0370f 100644 --- a/visu/figure_14.py +++ b/visu/figure_fourier.py @@ -102,6 +102,6 @@ plt.yscale("log") plt.tight_layout() -out_p = os.path.join(HITCHHIKING_ROOT_DIR, "results", "figure_14.pdf") +out_p = os.path.join(HITCHHIKING_ROOT_DIR, "results", "figure_fourier.pdf") plt.savefig(out_p) plt.show() diff --git a/visu/figure_16.py b/visu/figure_mocap.py similarity index 100% rename from visu/figure_16.py rename to visu/figure_mocap.py diff --git a/visu/figure_19.py b/visu/figure_pointcloud.py similarity index 99% rename from visu/figure_19.py rename to visu/figure_pointcloud.py index ce8a1f8..3469e44 100644 --- a/visu/figure_19.py +++ b/visu/figure_pointcloud.py @@ -120,7 +120,7 @@ # plt.xscale("log") plt.tight_layout() -out_p = os.path.join(HITCHHIKING_ROOT_DIR, "results", exp, f"figure_19_combined.pdf") +out_p = os.path.join(HITCHHIKING_ROOT_DIR, "results", exp, f"figure_pointcloud_combined.pdf") plt.savefig(out_p) diff --git a/visu/figure_13.py b/visu/figure_posenet.py similarity index 99% rename from visu/figure_13.py rename to visu/figure_posenet.py index 88cb00a..4a1ce5e 100644 --- a/visu/figure_13.py +++ b/visu/figure_posenet.py @@ -113,5 +113,5 @@ def generate_colormap(base_color, lvl=0.2, alpha=0.5): plt.grid(True, linestyle="--", color="gray", alpha=0.5) plt.tight_layout() -plt.savefig(os.path.join(HITCHHIKING_ROOT_DIR, "results", "dense_fusion", "figure_13.pdf")) +plt.savefig(os.path.join(HITCHHIKING_ROOT_DIR, "results", "dense_fusion", "figure_posenet.pdf")) plt.show()