You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: paper/README.md
+26-19Lines changed: 26 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,27 +5,27 @@ Note that there is also a brief section on reproducibility in the appendix of th
5
5
## Computational Environment
6
6
7
7
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:
10
10
11
11
```r
12
12
renv::restore()
13
13
```
14
14
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:
16
17
17
-
18
-
```{r}
18
+
```r
19
19
torch::install_torch()
20
20
```
21
21
22
22
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:
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
49
49
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).
50
50
51
51
```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
53
53
cd /mnt/data/paper
54
54
```
55
55
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.
57
57
58
58
## Running the Benchmark
59
59
@@ -88,7 +88,8 @@ There are three scripts:
88
88
**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.
89
89
This is to ensure that the benchmark results are not accidentally overwritten.
90
90
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.
92
93
93
94
```bash
94
95
Rscript benchmark/linux-gpu.R
@@ -168,8 +169,6 @@ It was extracted from the tex manuscript almost fully programmatically but adjus
168
169
169
170
We also added some additional comments to make it easier to associate the code with the paper.
170
171
171
-
The results we obtained via `knitr::spin()` are stored in `paper/paper_results/`
172
-
173
172
### Possible Data Unavailability
174
173
175
174
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
180
179
181
180
in the Zenodo data.
182
181
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):
184
183
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`).
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.
186
191
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:
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
+
195
202
### Other errors
196
203
197
204
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