Skip to content

Commit 85d740f

Browse files
committed
update
1 parent eaf2aaa commit 85d740f

File tree

1 file changed

+26
-19
lines changed

1 file changed

+26
-19
lines changed

paper/README.md

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@ Note that there is also a brief section on reproducibility in the appendix of th
55
## Computational Environment
66

77
In order to reproduce the results, you can either use the provided docker images or recreate the `renv` environment that is described in `paper/renv.lock`.
8-
To work with the renv environment, go into the `paper` directory and start an interactive R session, which will bootstrap the environment.
9-
Then, run:
8+
To work with the renv environment, go into the `paper` directory and start an interactive R session, which will bootstrap the `renv` package.
9+
Then, restore the environment by running:
1010

1111
```r
1212
renv::restore()
1313
```
1414

15-
which will ask you whether you want to proceed installing the missing packages, which you have to confirm.
15+
It will prompt ask you whether you want to proceed installing the missing packages, which you have to confirm.
16+
Afterwards, you need to install torch via:
1617

17-
18-
```{r}
18+
```r
1919
torch::install_torch()
2020
```
2121

2222
We are providing two docker images, one for CPU and one for CUDA GPU that have the same packages from the `renv.lock` file installed.
23-
The images can be downloaded from Zenodo: https://doi.org/10.5281/zenodo.17130368, either via the web interface, or, for example, using wget:
23+
The images can be downloaded from Zenodo: https://doi.org/10.5281/zenodo.17130368, either via the web interface, or, for example, using `wget` or a similar tool:
2424

2525
```bash
2626
# Docker images
27-
wget https://zenodo.org/records/17864153/files/IMAGE_CPU.tar.gz
28-
wget https://zenodo.org/records/17864153/files/IMAGE_GPU.tar.gz
27+
wget https://zenodo.org/records/18456360/files/IMAGE_CPU.tar.gz
28+
wget https://zenodo.org/records/18456360/files/IMAGE_GPU.tar.gz
2929
```
3030

3131
At the time of writing, the images are also hosted on dockerhub, but this is not a permanent storage:
@@ -49,11 +49,11 @@ cd /mnt/data/paper
4949
The CUDA image can be started with the command below, which requires the [nvidia extension](https://docs.nvidia.com/ai-enterprise/deployment/vmware/latest/docker.html).
5050

5151
```bash
52-
docker run -it --gpus all --rm -v ../:/mnt/data sebffischer/mlr3torch-jss:gpu
52+
docker run -it --gpus all --rm -v <parent-dir-to-paper>:/mnt/data sebffischer/mlr3torch-jss:gpu
5353
cd /mnt/data/paper
5454
```
5555

56-
Note that the `.Rprofile` file ensures that when running R programs from the `paper` directory, the renv environment will be used unless the code is run in the docker container, where we are not relying on renv directly.
56+
Note that the `.Rprofile` file in `paper` ensures that when running R programs from the `paper` directory, the renv environment will be used unless the code is run in the docker container, where we are not relying on renv directly.
5757

5858
## Running the Benchmark
5959

@@ -88,7 +88,8 @@ There are three scripts:
8888
**Important**:If one of the folders already exists and you want to re-run the benchmarks, you need to delete or move the folder, otherwise you will get an error.
8989
This is to ensure that the benchmark results are not accidentally overwritten.
9090

91-
To run the GPU benchmarks (using the CUDA docker image) on linux, run:
91+
To run the GPU benchmarks (using the CUDA docker image) on linux, either start it via Rscript or source it interactively:
92+
If you source it interactively and the folder already exists, it will ask you whether you want to delete it, which you have to confirm.
9293

9394
```bash
9495
Rscript benchmark/linux-gpu.R
@@ -168,8 +169,6 @@ It was extracted from the tex manuscript almost fully programmatically but adjus
168169

169170
We also added some additional comments to make it easier to associate the code with the paper.
170171

171-
The results we obtained via `knitr::spin()` are stored in `paper/paper_results/`
172-
173172
### Possible Data Unavailability
174173

175174
The code shown in the paper downloads various datasets from standard resources.
@@ -180,18 +179,26 @@ In the unlikely but possible event that these datasets are not available anymore
180179

181180
in the Zenodo data.
182181

183-
If one of the downloads (1) fails, download the `cache.tar.gz` file from zenodo, untar it and put it in the location where the cache is (put the `R` folder of the cache into `/root/.cache/R` and the `torch` folder into `/root/.cache/torch` when using the docker images).
182+
If one of the downloads (1) fails, do the following (before starting the docker container):
184183

185-
If (2) fails, download `dogs-vs-cats.tar.gz` from Zenodo, untar it and put it into the `paper/data` subdirectory where you are running the `paper_code.R` (so the directory structure is `paper/data/dogs-vs-cats`).
184+
1. Download the `cache.tar.gz` file, e.g. via:
185+
```bash
186+
wget https://zenodo.org/records/18456360/files/cache.tar.gz
187+
```
188+
2. Create a `cache` folder in the parent directory of `paper` (name `cache` is arbitrary) and move the `cache.tar.gz` file there
189+
3. Untar the `cache.tar.gz` folder using `tar -xzf cache.tar.gz`
190+
4. There should now be a `.cache` sub-directory in the `cache` folder.
186191

187-
To do this in the Docker image you can, e.g., put the files into the parent directory of the `paper` directory (which will be mounted) and then after starting the container, copy the files into the correct location.
188-
Assuming the unpacked cache files are in `/mnt/data/cache`, you can copy them into the correct location with:
192+
After starting the docker container with the correct mount instructions, (like shown earlier), run:
189193

190194
```bash
191-
cp -r /mnt/data/cache/R/mlr3torch /root/.cache/R
192-
cp -r /mnt/data/cache/torch /root/.cache/torch
195+
cp -r /mnt/data/cache/.cache/R/mlr3torch /root/.cache/R
196+
cp -r /mnt/data/cache/.cache/torch /root/.cache/torch
193197
```
194198

199+
If (2) fails, download `dogs-vs-cats.tar.gz` from Zenodo, untar it and put it into the `paper/data` subdirectory where you are running the `paper_code.R` (so the directory structure is `paper/data/dogs-vs-cats/`).
200+
201+
195202
### Other errors
196203

197204
When reproducing the results with `knitr` in the docker container, we sometimes encountered issues with the weight downloads for the ResNet-18 model.

0 commit comments

Comments
 (0)