From f39f6d5b0a907d519377e70876b32daad1a676f2 Mon Sep 17 00:00:00 2001 From: jvech Date: Tue, 3 Sep 2024 20:08:25 -0500 Subject: feat: shuffle dataset on each epoch done The CLI option to disable it was also added. --- src/util.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/util.c') diff --git a/src/util.c b/src/util.c index 71cbf8f..81950f1 100644 --- a/src/util.c +++ b/src/util.c @@ -105,6 +105,7 @@ void usage(int exit_code) " -o, --output=FILE Output file (only works with predict)\n" " -p, --precision=INT Decimals output precision (only works with predict)\n" " [default=auto]\n" + " -S, --no-shuffle Don't shuffle data each epoch (only works with train)\n" "\n" ); exit(exit_code); @@ -120,6 +121,7 @@ void util_load_cli(struct Configs *ml, int argc, char *argv[]) {"epochs", required_argument, 0, 'e'}, {"batch", required_argument, 0, 'b'}, {"alpha", required_argument, 0, 'a'}, + {"no-shuffle", no_argument, 0, 'S'}, {"output", required_argument, 0, 'o'}, {"config", required_argument, 0, 'c'}, {"only-out", no_argument, 0, 'O'}, @@ -129,7 +131,7 @@ void util_load_cli(struct Configs *ml, int argc, char *argv[]) int c; while (1) { - c = getopt_long(argc, argv, "hvOc:e:a:o:i:f:p:b:", long_opts, NULL); + c = getopt_long(argc, argv, "hvOSc:e:a:o:i:f:p:b:", long_opts, NULL); if (c == -1) { break; @@ -160,6 +162,9 @@ void util_load_cli(struct Configs *ml, int argc, char *argv[]) if (atoi(optarg) <= 0) die("util_load_cli() Error: batch size must be greater than 0"); ml->batch_size = (size_t)atol(optarg); break; + case 'S': + ml->shuffle = false; + break; case 'h': usage(0); break; -- cgit v1.2.3-70-g09d2