From 8ce26c1a46891af320d6b0e8798743a9331c4785 Mon Sep 17 00:00:00 2001 From: jirigav Date: Sat, 25 Nov 2023 21:04:40 +0100 Subject: [PATCH] rename parameters --- src/bottomup.rs | 6 +++--- src/common.rs | 22 +++++++++++----------- src/main.rs | 6 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/bottomup.rs b/src/bottomup.rs index b670b63..056921a 100644 --- a/src/bottomup.rs +++ b/src/bottomup.rs @@ -260,8 +260,8 @@ pub(crate) fn bottomup( let top_k = phase_one( data, args.k, - args.block_size * args.block_size_multiple, - args.base_pattern_size, + args.block * args.block_size_multiple, + args.deg, ); println!("phase one {:.2?}", start.elapsed()); start = Instant::now(); @@ -271,7 +271,7 @@ pub(crate) fn bottomup( data, validation_data_option, args.min_difference, - args.block_size * args.block_size_multiple, + args.block * args.block_size_multiple, args.max_bits, ); println!("phase two {:.2?}", start.elapsed()); diff --git a/src/common.rs b/src/common.rs index dd43d31..d4922d3 100644 --- a/src/common.rs +++ b/src/common.rs @@ -10,18 +10,18 @@ pub(crate) fn z_score(sample_size: usize, positive: usize, p: f64) -> f64 { #[derive(Parser, Debug)] #[command(version)] pub(crate) struct Args { - /// Path of file with input data. + /// Path to file with input data. pub(crate) data_source: String, - /// Length of block of data. + /// Block size in bits. #[arg(short, long, default_value_t = 128)] - pub(crate) block_size: usize, + pub(crate) block: usize, - /// If the value is greater than 1, CoolTest looks for distinguisher on block size that is a multiple of block_size and utilizes all such consecutive tuples. + /// If the value is greater than 1, CoolTest looks for distinguisher on block size that is a multiple of 'block' and utilizes all such tuples of consecutive blocks. #[arg(long, default_value_t = 1)] pub(crate) block_size_multiple: usize, - /// Number of explored pattern branches. + /// Number of explored branches of distinguishers in greedy search. #[arg(short, long, default_value_t = 100)] pub(crate) k: usize, @@ -29,11 +29,11 @@ pub(crate) struct Args { #[arg(short, long, default_value_t = 100)] pub(crate) min_difference: usize, - /// Number of patterns tested in combinations for multipattern. + /// Number of distinguishers tested in combinations for a multipattern. #[arg(long, default_value_t = 50)] pub(crate) top_n: usize, - /// Maximal number of bits (variables) used in distinguishers. + /// Maximal number of bits (variables) used in a distinguishers. #[arg(long)] pub(crate) max_bits: Option, @@ -41,19 +41,19 @@ pub(crate) struct Args { #[arg(short, long, default_value_t = 2)] pub(crate) patterns_combined: usize, - /// Length of patterns evaluated in the first phase. + /// Degree of distinguishers evaluated in the first phase. #[arg(short, long, default_value_t = 2)] - pub(crate) base_pattern_size: usize, + pub(crate) deg: usize, /// Option whether the input data should be divided into training, validation and testing data. #[arg(long, short)] pub(crate) validation_and_testing_split: bool, - /// Option whether histogram should be used as an alternative evaluation method. + /// Option whether histogram should be used as a strengthening method. #[arg(long)] pub(crate) hist: bool, - /// Option whether histogram should be used as an alternative evaluation method. + /// Config file with list of CoolTest configurations to run. #[arg(long, short)] pub(crate) config: bool, } diff --git a/src/main.rs b/src/main.rs index 60db614..fdd86ef 100644 --- a/src/main.rs +++ b/src/main.rs @@ -93,7 +93,7 @@ fn run_bottomup(args: Args) -> (f64, f64) { let s = Instant::now(); let (training_data, validation_data_option, testing_data_option) = prepare_data( &args.data_source, - args.block_size, + args.block, args.block_size_multiple, true, args.validation_and_testing_split, @@ -116,14 +116,14 @@ fn run_bottomup(args: Args) -> (f64, f64) { fn parse_args(s: Vec<&str>) -> Args { Args { data_source: s[0].to_string(), - block_size: s[1].trim().parse().unwrap(), + block: s[1].trim().parse().unwrap(), block_size_multiple: s[2].trim().parse().unwrap(), k: s[3].trim().parse().unwrap(), min_difference: s[4].trim().parse().unwrap(), top_n: s[5].trim().parse().unwrap(), max_bits: Some(s[6].trim().parse().unwrap()), patterns_combined: s[7].trim().parse().unwrap(), - base_pattern_size: s[8].trim().parse().unwrap(), + deg: s[8].trim().parse().unwrap(), validation_and_testing_split: s[9].trim().parse().unwrap(), hist: s[10].trim().parse().unwrap(), config: false,