Learn R Programming

tfruns (version 0.9)

run_dir: Run Directory

Description

Timestamped directory for storing training/logging data in a separate location for each training run.

Usage

use_run_dir(run_dir = NULL, runs_dir = "runs", quiet = FALSE)

run_dir()

latest_run(runs_dir = "runs")

latest_runs(runs_dir = "runs", n)

clean_runs(runs_dir = "runs", keep = NULL)

Arguments

run_dir

Path to run directory (NULL to automatically create a timestamped directory within the runs_dir)

runs_dir

Parent directory for runs

quiet

FALSE to prevent printing the path to the run dir

n

Number of recent runs

keep

Number of most recent runs to keep when cleaning runs.

Details

The use_run_dir() function establishes a unique run directory (by default in a sub-directory named "runs") and stores it's value for saving various artifacts of training (e.g. model checkpoints, tensorflow logs, etc.).

The run_dir() function returns the current run directory (NULL if none yet established).

If you utilize the automatic creation of run directories within the "runs" directory then you can use the latest_run() and latest_runs() functions to get the path(s) to the most recently created run directories and the clean_runs() function to remove previously created run directories.

Examples

Run this code
# NOT RUN {
library(tfruns)

run_dir <- use_run_dir()

latest_run()
latest_runs(n = 2)

clean_runs(keep = 10)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab