Skip to content

Commit

Permalink
rename parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
jirigav committed Nov 25, 2023
1 parent 54c385e commit 8ce26c1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions src/bottomup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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());
Expand Down
22 changes: 11 additions & 11 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,50 +10,50 @@ 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,

/// Minimal difference between expected and actual count of a given pattern in data.
#[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<usize>,

/// Number of patterns combined into a multipattern.
#[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,
}
Expand Down
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 8ce26c1

Please sign in to comment.