/
copy_run.qmd
61 lines (38 loc) · 1.59 KB
/
copy_run.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
execute:
freeze: true
---
[R/copy.R](https://github.com/rstudio/tfruns//blob/main/R/copy.R#L41)
# copy_run
## Copy run directories
## Description
Functions for exporting/copying run directories and run artifact files.
## Usage
```r
copy_run(run_dir, to = ".", rename = NULL)
copy_run_files(run_dir, to = ".", rename = NULL)
```
## Arguments
|Arguments|Description|
|---|---|
| run_dir | Training run directory or data frame returned from `ls_runs()`. |
| to | Name of parent directory to copy run(s) into. Defaults to the current working directory. |
| rename | Rename run directory after copying. If not specified this defaults to the basename of the run directory (e.g. "2017-09-24T10-54-00Z"). |
## Details
Use `copy_run` to copy one or more run directories. Use `copy_run_files` to copy only files saved/generated by training run scripts (e.g. saved models, checkpoints, etc.).
## Value
Logical vector indicating which operation succeeded for each of the run directories specified.
## Examples
```{r, eval=ecodown::examples_not_run()}
library(tfruns)
# export a run directory to the current working directory
copy_run("runs/2017-09-24T10-54-00Z")
# export to the current working directory then rename
copy_run("runs/2017-09-24T10-54-00Z", rename = "best-run")
# export artifact files only to the current working directory then rename
copy_run_files("runs/2017-09-24T10-54-00Z", rename = "best-model")
# export 3 best eval_acc to a "best-runs" directory
copy_run(ls_runs(order = eval_acc)[1:3,], to = "best-runs")
```
## See Also
Other run management: `clean_runs()`