diff --git a/README.md b/README.md index b342ad4c..7c800529 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,11 @@ Starting VNC server within container: ``` ./start_vnc ``` -Recommended VNC client: `remmina` +Recommended VNC client: + +- Ubuntu: `remmina` +- Windows: RealVNC + VNC installation instructions - see [VNC.md](VNC.md) - Entering Docker container with X11 support on native Linux ``` diff --git a/SMLP_SHORT_INTRO.pdf b/SMLP_SHORT_INTRO.pdf new file mode 100644 index 00000000..3d127a8a Binary files /dev/null and b/SMLP_SHORT_INTRO.pdf differ diff --git a/VNC.md b/VNC.md new file mode 100644 index 00000000..e0b0fee5 --- /dev/null +++ b/VNC.md @@ -0,0 +1,52 @@ +## Step 1: + +Download [RealVNC®](https://www.realvnc.com/en/connect/download/viewer) + +## Step 2: + +Install RealVNC + +## Step 3: Forward Port 5900 from Windows to WSL2 + +### Step 3.1 - in WSL2 window + +Get your WSL2 IP address from running below command: +```bash +hostname -I +``` + +### Step 3.2 + +Open Command Prompt and choose **Run as administrator** option + +### Step 3.3 - in Windows Command Prompt Window + +Use the **first IP** in the output (e.g., `172.31.26.155`). All the rest should be ignored +Run the following in **powershell**, replacing `` with your IP: + +```powershell +netsh interface portproxy add v4tov4 listenport=5900 listenaddress=0.0.0.0 connectport=5900 connectaddress= +``` + +Allow the port through Windows Firewall: +```powershell +New-NetFirewallRule -DisplayName "WSL2 VNC" -Direction Inbound -Protocol TCP -LocalPort 5900 -Action Allow +``` + +Verify the proxy is set: +```powershell +netsh interface portproxy show all +``` + +## Step 4: Connect with VNC + +**Connection should be performed after running** `./start_vnc` **command within Docker container** + +1. Launch VNC + Signing in VNC is optional +2. In VNC connect to: `locahost:5900` +- Ignore non-secure connection warning + +## Updating the Port Proxy After WSL2 Restart + +WSL2's IP address may change after restart. In this case, **Step 3** should be repeated after the reboot diff --git a/docker/python3.11/Dockerfile b/docker/python3.11/Dockerfile index e56339cd..ab917b9b 100644 --- a/docker/python3.11/Dockerfile +++ b/docker/python3.11/Dockerfile @@ -14,6 +14,7 @@ RUN apt-get update && apt-get install -y \ wget \ vim \ git \ + jq \ tcsh \ tzdata \ locales \ @@ -130,8 +131,5 @@ ENV LC_ALL=en_US.UTF-8 COPY start_vnc . RUN chmod +x start_vnc -#jq - needed for Intel SI test -RUN apt-get update && apt-get install -y jq && rm -rf /var/lib/apt/lists/* - ## Default command CMD ["/bin/tcsh"] diff --git a/docker/python3.11/enter_container b/docker/python3.11/enter_container index 9b579194..10d868e9 100755 --- a/docker/python3.11/enter_container +++ b/docker/python3.11/enter_container @@ -1,10 +1,62 @@ -#!/usr/bin/tcsh -f -mkdir -p $HOME/shared -if( ! $?TZ ) setenv TZ `readlink /etc/localtime | sed 's@/usr/share/zoneinfo/@@'` -@ p = 5900 -@ d = 99 -while( `ss -tln | grep -c :${p}` > 0 ) - @ p = $p + 1 - @ d = $d + 1 -end -docker run -e TZ=$TZ -e DISPLAY=:${d} -p ${p}:${p} -v $HOME/shared:/shared -it python311-dev:latest $* +#!/usr/bin/env bash +set -euo pipefail + +script_path=$(dirname "$(realpath "$0")") +script_name=$(basename "$(realpath "$0")") + +mkdir -p "$HOME/shared" + +if [[ $# -gt 0 ]]; then + if [[ "$1" == "-h" || "$1" == "--help" ]]; then + echo -e "\nUsage: $script_name [-geom x] []" + echo -e "Example: $script_name -geom 1280x1024\n" + exit 0 + fi +fi + +if [[ $# -gt 1 && "$1" == "-geom" ]]; then + screen_resolution="$2" + echo "User defined screen resolution: $screen_resolution" + shift 2 +fi + +if [[ -z "${TZ:-}" ]]; then + TZ=$(readlink /etc/localtime | sed 's|/usr/share/zoneinfo/||') + export TZ +fi + +p=5900 +d=99 +while ss -tln | grep -q ":${p}"; do + (( p++ )) + (( d++ )) +done + +if [[ -z "${screen_resolution:-}" ]]; then + if [[ "$(uname -r)" == *WSL2* ]]; then + powershell_exe=$(which powershell.exe 2>/dev/null || true) + if [[ "$powershell_exe" == *powershell.exe* ]]; then + screen_resolution=$($powershell_exe -ExecutionPolicy Bypass -File "$script_path/getres.ps1" | tail -1 | sed 's/.$//') + fi + else + if xset q &>/dev/null; then + screen_resolution=$(xdpyinfo | grep dimensions | cut -d':' -f2 | awk '{print $1}') + fi + fi + if [[ -n "$screen_resolution" ]]; then + echo "Automatically defined screen resolution: $screen_resolution" + fi +fi + +if [[ -z "$screen_resolution" ]]; then + screen_resolution="1280x1024" + echo "Using default screen resolution: $screen_resolution" +fi + +docker run \ + -e TZ="$TZ" \ + -e DISPLAY=":${d}" \ + -e VNC_SCREEN_RESOLUTION="$screen_resolution" \ + -p "${p}:${p}" \ + -v "$HOME/shared:/shared" \ + -it python311-dev:latest "$@" diff --git a/docker/python3.11/enter_released_container b/docker/python3.11/enter_released_container index ec90825c..3c43d82c 100755 --- a/docker/python3.11/enter_released_container +++ b/docker/python3.11/enter_released_container @@ -1,10 +1,62 @@ -#!/usr/bin/tcsh -f -mkdir -p $HOME/shared -if( ! $?TZ ) setenv TZ `readlink /etc/localtime | sed 's@/usr/share/zoneinfo/@@'` -@ p = 5900 -@ d = 99 -while( `ss -tln | grep -c :${p}` > 0 ) - @ p = $p + 1 - @ d = $d + 1 -end -docker run -e TZ=$TZ -e DISPLAY=:${d} -p ${p}:${p} -v $HOME/shared:/shared -it mdmitry1/python311-dev:latest $* +#!/usr/bin/env bash +set -euo pipefail + +script_path=$(dirname "$(realpath "$0")") +script_name=$(basename "$(realpath "$0")") + +mkdir -p "$HOME/shared" + +if [[ $# -gt 0 ]]; then + if [[ "$1" == "-h" || "$1" == "--help" ]]; then + echo -e "\nUsage: $script_name [-geom x] []" + echo -e "Example: $script_name -geom 1280x1024\n" + exit 0 + fi +fi + +if [[ $# -gt 1 && "$1" == "-geom" ]]; then + screen_resolution="$2" + echo "User defined screen resolution: $screen_resolution" + shift 2 +fi + +if [[ -z "${TZ:-}" ]]; then + TZ=$(readlink /etc/localtime | sed 's|/usr/share/zoneinfo/||') + export TZ +fi + +p=5900 +d=99 +while ss -tln | grep -q ":${p}"; do + (( p++ )) + (( d++ )) +done + +if [[ -z "${screen_resolution:-}" ]]; then + if [[ "$(uname -r)" == *WSL2* ]]; then + powershell_exe=$(which powershell.exe 2>/dev/null || true) + if [[ "$powershell_exe" == *powershell.exe* ]]; then + screen_resolution=$($powershell_exe -ExecutionPolicy Bypass -File "$script_path/getres.ps1" | tail -1 | sed 's/.$//') + fi + else + if xset q &>/dev/null; then + screen_resolution=$(xdpyinfo | grep dimensions | cut -d':' -f2 | awk '{print $1}') + fi + fi + if [[ -n "$screen_resolution" ]]; then + echo "Automatically defined screen resolution: $screen_resolution" + fi +fi + +if [[ -z "$screen_resolution" ]]; then + screen_resolution="1280x1024" + echo "Using default screen resolution: $screen_resolution" +fi + +docker run \ + -e TZ="$TZ" \ + -e DISPLAY=":${d}" \ + -e VNC_SCREEN_RESOLUTION="$screen_resolution" \ + -p "${p}:${p}" \ + -v "$HOME/shared:/shared" \ + -it mdmitry1/python311-dev:latest "$@" diff --git a/docker/python3.11/getres.ps1 b/docker/python3.11/getres.ps1 new file mode 100755 index 00000000..91099576 --- /dev/null +++ b/docker/python3.11/getres.ps1 @@ -0,0 +1,17 @@ +Add-Type -AssemblyName System.Windows.Forms +$screen = [System.Windows.Forms.Screen]::PrimaryScreen +$source = @" +using System; +using System.Runtime.InteropServices; +public class DPI { + [DllImport("gdi32.dll")] + public static extern int GetDeviceCaps(IntPtr hdc, int nIndex); + [DllImport("user32.dll")] + public static extern IntPtr GetDC(IntPtr hwnd); +} +"@ +Add-Type -TypeDefinition $source +$hdc = [DPI]::GetDC([IntPtr]::Zero) +$width = [DPI]::GetDeviceCaps($hdc, 118) # DESKTOPHORZRES +$height = [DPI]::GetDeviceCaps($hdc, 117) # DESKTOPVERTRES +Write-Output "${width}x${height}" \ No newline at end of file diff --git a/docker/python3.11/start_vnc b/docker/python3.11/start_vnc index d2e6cac8..9e344393 100755 --- a/docker/python3.11/start_vnc +++ b/docker/python3.11/start_vnc @@ -1,9 +1,18 @@ #!/usr/bin/tcsh -f -Xvfb $DISPLAY -screen 0 1024x768x16 >& Xvfb.log & +if($?VNC_SCREEN_RESOLUTION) then + set screen_resolution=$VNC_SCREEN_RESOLUTION +else + set screen_resolution=1280x1024 +endif +Xvfb $DISPLAY -screen 0 ${screen_resolution}x16 >& Xvfb.log & sleep 2 set d=`echo $DISPLAY | tr -d :` @ p = $d + 5801 x11vnc -display $DISPLAY -forever -nopw -shared -rfbport $p >& x11nc.log & autocutsel -selection CLIPBOARD -fork autocutsel -selection PRIMARY -fork -xterm -fn 12x24 & +if(`xset q >& /dev/null ; echo $status` == 0) then + echo "VNC server has started successfully with screen resolution $screen_resolution" +else + echo "VNC server failed - GUI won't work" +endif diff --git a/tutorial/README.md b/tutorial/README.md new file mode 100644 index 00000000..e1a7b3ef --- /dev/null +++ b/tutorial/README.md @@ -0,0 +1,488 @@ +# SMLP [1] Optimization Examples + +This tutorial contains three benchmark optimization problems and one industrial example demonstrating the capabilities of SMLP (Symbolic Machine Learning Prover) for solving constrained and multi-objective optimization tasks for **black-box functions**.
+Black-box function optimization definition used in this document [2]:
+#### *Blackbox optimization (BBO) is the study of design and analysis of algorithms for optimization problems in which the structure of the objective function f and/or the constraints defining the set Ω is unknown, unexploitable or non-existant*
+*In above definiton Ω is the feasible region : Ω → R* + +SMLP has been applied in industrial setting at Intel for analyzing and optimizing hardware designs at the analog level [1]. +This tutorial contains one of Intel examples in Signal Integrity domain (with mangled numerical values and objective function names). + +### In SMLP: +- Structure of the objective function *f* is unknown +- Constraint defining set is comprised of known functions, which are defined by Python expressions + +**SMLP** supports multiple modes: optimization, synthesis, verification and more +This tutorial focuses on optimization mode. In future it may be extended to other modes. + +### SMLP optimization flow is comprised of two stages: +- Model build: input data is converted into one of supported model types: + 1. Polynomial model + 2. Decision Trees + 3. Random Forest + 4. Extremely Randomized Trees + 3. Neural network model +- Optimization: model and constraints are used to find objective function(s) minimum considering input constraints + +## Overview + +Examples in this tutorial showcase SMLP's ability to: +- Handle single and multi-objective optimization +- Manage complex constraints +- Find global optima in challenging landscapes +- Generate Pareto fronts for multi-objective problems + +[1] [Franz Brauße, Zurab Khasidashvili, Konstantin Korovin. SMLP: Symbolic Machine Learning Prover](https://arxiv.org/pdf/2402.01415v1)
+[2] [Stéphane Alarie et al. Two decades of blackbox optimization applications](https://optimization-online.org/wp-content/uploads/2020/10/8082.pdf) + +## Examples + +### 1. Eggholder Function + +**Location:** `examples/eggholder/smlp/` + +A challenging global optimization problem commonly used for benchmarking optimization algorithms. + +#### Problem Definition + +The [Eggholder function](https://www.sfu.ca/~ssurjano/egg.html) is defined as: + +``` +f(x, y) = -(y + 47) * sin(√|x/2 + (y + 47)|) - x * sin(√|x - (y + 47)|) +``` + +**Domain:** -512 ≤ x₁, x₂ ≤ 512 + +**Expected Global Minimum:** f(x*) = -959.6407 at x* = (512, 404.2319)
+**SMLP Results:** f(x*) = -955.6113 at x* = (511.9, 405.3) + +#### Characteristics +- Highly multi-modal with many local minima +- Complex, irregular landscape +- Excellent test for global optimization algorithms +- Single objective (minimization) + +#### Files +- `eggholder.json` - SMLP configuration file +- `eggholder_dataset.py` - Dataset generator and visualization +- `eggholder_optimization_results_expected.json` - Expected optimization results +- `eggholder_benchmark_expected.txt` - Benchmark data + +#### Usage +```bash +# Generate dataset and vizualize +./examples/eggholder/smlp/eggholder_dataset.py +``` + +```bash +# Run optimization with SMLP +./examples/eggholder/smlp/run_eggholder +``` + +--- + +### 2. Constrained DORA (Distance to Optimal with Radial Adjustment) + +**Location:** `examples/constraint_dora/smlp/` + +A classic textbook example of constrained optimization using Lagrange multipliers. + +#### Problem Definition + +**Minimize:** f(x₁, x₂) = (x₁ - 2)² + (x₂ - 1)² + +**Subject to:** x₁² + x₂² ≤ 1 (inside unit circle) + +**Geometric Interpretation:** Find the point on the unit circle closest to (2, 1) + +#### Analytical Solution + +Using Lagrange multipliers (∇f = λ∇g): +- x₁ = 2/(1+λ) +- x₂ = 1/(1+λ) +- From constraint: 5 = (1+λ)² +- λ = √5 - 1 + +**Expected Results:** x₁ ≈ 0.894427, x₂ ≈ 0.447214, f ≈ 1.527864
+**SMLP Results:** x₁ = 0.894531, x₂ = 0.447004, f = 1.527865 + +[Reference: Wolfram Alpha](https://www.wolframalpha.com/input?i=Minimize%3A+f%28x1%2C+x2%29+%3D+%28x1+-+2%29%5E2+%2B+%28x2+-+1%29%5E2+subject+to+x1%5E2+%2B+x2%5E2+-+1+%3C%3D+0) + +#### Characteristics +- Single objective with constraint +- Demonstrates constrained optimization +- Known analytical solution for verification +- Geometric intuition (distance from point to circle) + +#### Files +- `constraint_dora.json` - SMLP configuration file +- `constraint_dora_dataset.py` - Dataset generator with visualization +- `constraint_dora_poly_optimization_results_expected.json` - Expected results +- `constraint_dora_poly_benchmark_expected.txt` - Benchmark data + +#### Usage +```bash +# Generate dataset and visualize +./examples/constraint_dora/smlp/constraint_dora_dataset.py + +# Run optimization with SMLP +./examples/constraint_dora/smlp/run_constraint_dora_poly +``` + +--- + +### 3. Binh and Korn (BNH) Multi-Objective Problem + +**Location:** `examples/bnh/smlp/` + +A classic multi-objective optimization problem with two objectives and two constraints. + +#### Problem Definition + +**Minimize:** +``` +f₁(x) = 4x₁² + 4x₂² +f₂(x) = (x₁ - 5)² + (x₂ - 5)² +``` + +**Subject to:** +``` +C₁(x) = (x₁ - 5)² + x₂² ≤ 25 +C₂(x) = (x₁ - 8)² + (x₂ + 3)² ≥ 7.7 +0 ≤ x₁ ≤ 5 +0 ≤ x₂ ≤ 3 +``` + +**Expected Results:** + +| x₁ | x₂ | f₁ | f₂ | +|---------|-----------|------------|-------------| +| 0 | 0 | 0 | 50 | +| 0.294118 | 0.294118 | 0.692042 | 44.290657 | +| 0.714286 | 0.714286 | 4.081633 | 36.734694 | +| 1.363636 | 1.363636 | 14.876033 | 26.446281 | +| 2.5 | 2.5 | 50 | 12.5 | +| 5 | 3 | 136 | 4 | + +Expected results reproduction: +```bash +./examples/bnh/smlp/pareto_analytical.py +``` + +**SMLP Results:** + +| x₁ | x₂ | f₁ | f₂ | +|---------|-----------|------------|-------------| +| 0 | 0 | 0 | 50 | +| 0.294118 | 0.296875 | 0.698560 | 44.264713 | +| 0.714286 | 0.718750 | 4.107223 | 36.696449 | +| 1.363636 | 1.363281 | 14.872160 | 26.448864 | +| 2.5 | 2.5 | 50 | 12.5 | +| 5 | 3 | 136 | 4 | + + +[Reference: Test Case 2, Binh and Korn (1997)](https://web.archive.org/web/20190801183649/https://pdfs.semanticscholar.org/cf68/41a6848ca2023342519b0e0e536b88bdea1d.pdf) + +#### Characteristics +- Two competing objectives (minimize both) +- Two non-linear constraints +- Well-defined Pareto front +- Constraints add difficulty without eliminating feasibility + +#### Pareto Front Structure + +In decision space: +- Segment 1: x₁ = x₂ for x ∈ [0, 3] +- Segment 2: x₁ ∈ [3, 5], x₂ = 3 + +#### Files +- `bnh_p1.json` through `bnh_p6.json` - Different objective weightings +- `bnh_dataset.py` - Dataset generator +- `bnh_pareto_X1_expected.txt` - Expected Pareto X₁ values +- `bnh_pareto_X2_expected.txt` - Expected Pareto X₂ values +- `bnh_pareto_F1_expected.txt` - Expected Pareto F₁ values +- `bnh_pareto_F2_expected.txt` - Expected Pareto F₂ values +- `plot_results.py` - Visualization script for Pareto fronts + +#### Configuration Files + +Each configuration file (`bnh_p1.json` through `bnh_p6.json`) uses different objective weightings to explore the Pareto front: + +- `bnh_p1.json`: Minimize F₁ only +- `bnh_p2.json`: Minimize 0.8F₁ + 0.2F₂ +- `bnh_p3.json`: Minimize 0.6F₁ + 0.4F₂ +- `bnh_p4.json`: Minimize 0.4F₁ + 0.6F₂ +- `bnh_p5.json`: Minimize 0.2F₁ + 0.8F₂ +- `bnh_p6.json`: Minimize F₂ only + +#### Usage +```bash +# Generate dataset +./examples/bnh/smlp/run_poly_pareto/bnh_dataset.py + +# Run optimization for each weighting and plot Pareto front +./examples/bnh/smlp/run_poly_pareto + +# Visualize Pareto front +./examples/bnh/smlp/plot_results.py +``` + +### 4. Intel Signal Integrity domain example + +**Location:** `examples/si/smlp` + +#### Problem Definition + +Multi-Objective optimization problem with 64 objectives and 4 categorical parameters + +#### Configuration File + +../bench/intel/specs/s2_tx_piv_anonym.spec + + +#### Input Dataset + +../bench/intel/data/s2_tx_piv_anonym.csv.bz2 + +#### Usage + +```bash +#Regular run + +examples/si/smlp/run_si_test_nosplit +``` + +```bash +#Run, in which all input data is used for training + +examples/si/smlp/run_si_test_split +``` + +#### Visualize results + +```bash +#Regular run + +examples/si/smlp/extract_results no_split_s2_tx_piv_anonym_optimization_results.json + +#Run, in which all input data is used for training + +examples/si/smlp/extract_results split_s2_tx_piv_anonym_optimization_results.json +``` + +Results will be shown on the screen and then saved to the png files: + +```bash +no_split_s2_tx_piv_anonym_optimization_results.png +split_s2_tx_piv_anonym_optimization_results.png +``` + +### 5. Running all examples + +```bash +./run_all +``` + +## SMLP Configuration Structure + +All examples use JSON configuration files with the following structure: + +```json +{ + "version": "1.2", + "variables": [ + {"label": "X1", "interface": "knob", "type": "real", "range": [min, max], "rad-abs": 0.0}, + {"label": "Y1", "interface": "output", "type": "real"} + ], + "alpha": "constraint_expression", + "objectives": { + "objective1": "expression_to_minimize" + } +} +``` + +### Key Fields + +- **variables**: Define input variables (knobs) and output variables + - `interface`: "knob" for controllable variables, "input" for inputs, "output" for outputs + - `range`: Valid range for input variables + - `rad-abs`: Radius for absolute perturbation (0.0 = exact values) + + SMLP finds optimal values for knobs
+ Inputs are "free" - they are not altered during optimization + +- **alpha**: Constraint expression using variable labels + - Supports arithmetic operations: `+`, `-`, `*`, `/` + - Supports logical operations: `and`, `or` + - Supports comparisons: `<=`, `>=`, `<`, `>`, `==` + +- **objectives**: One or more objectives to optimize + - For minimization, negate the objectives as SMLP searches for a maximum + - Can combine multiple outputs with weights + +--- + +## Dataset Generation + +Each example includes a Python script to generate training data: + +### Common Pattern +```python +from numpy import linspace, meshgrid +from gzip import open as gzopen + +# Define grid +x1 = linspace(x1_min, x1_max, n_points) +x2 = linspace(x2_min, x2_max, n_points) +X1, X2 = meshgrid(x1, x2) + +# Compute outputs +Y = objective_function(X1, X2) + +# Write compressed dataset +with gzopen("dataset.txt.gz", "wt") as ds: + ds.write("X1 X2 Y1\n") + for i in range(n_points): + for j in range(n_points): + ds.write(f"{X1[i][j]} {X2[i][j]} {Y[i][j]}\n") +``` + +### Visualization Support + +Dataset generators include optional visualization: +- Matplotlib 3D surface plots (Eggholder) +- Contour plots with constraint boundaries (DORA) +- Command-line timeout option for automation + +--- + +## Expected Results + +Each example includes expected results for verification: + +### JSON Result Format +```json +{ + "objective1": { + "X1": optimal_x1, + "X2": optimal_x2, + "Y1": optimal_output, + "objective1": objective_value, + "threshold_lo": lower_bound, + "threshold_up": upper_bound + }, + "smlp_execution": "completed", + "synthesis_feasible": "true" +} +``` + +### Verification +Compare your optimization results against the `*_expected.json` files to validate SMLP performance. + +--- + +## Dependencies + +### Python Requirements +``` +numpy +matplotlib +pandas +seaborn +``` + +### Installation +```bash +pip install numpy matplotlib pandas seaborn +``` + +### SMLP Installation + +See [README.md](https://github.com/SMLP-Systems/smlp/blob/master/README.md) + +### SMLP Options +```bash +python3.11 $(git rev-parse --show-toplevel)/src/run_smlp.py -h +``` +--- + +## Running the Examples + +### Basic Workflow + +1. **Generate Dataset** + ```bash + ./examples//smlp/_dataset.py + ``` + +2. **Run Optimization** + ```bash + python3.11 $(git rev-parse --show-toplevel)/src/run_smlp.py -data --spec + ``` + +3. **Visualize Results** (BNH only) + ```bash + ./examples/bnh/smlp/plot_results.py + ``` + +### Datasets visualization Options + +Eggholder and Constraint DORA dataset generators support timeout (specified in seconds) for automated testing: + +```bash +./examples/eggholder/smlp/eggholder_dataset.py -timeout 5 +./examples/constraint_dora/smlp/constraint_dora_dataset.py -timeout 5 +``` + +--- + +## Problem Characteristics Summary + +| Example | Variables | Objectives | Constraints | Difficulty | +|---------|-----------|------------|-------------|------------| +| Eggholder | 2 | 1 | None | High (multi-modal) | +| DORA | 2 | 1 | 1 (circular) | Low (convex) | +| BNH | 2 | 2 | 2 (non-linear) | Medium | + +--- + +## References + +### Eggholder +- [Virtual Library of Simulation Experiments](https://www.sfu.ca/~ssurjano/egg.html) + +### Constrained DORA +- [Wolfram Alpha Solution](https://www.wolframalpha.com/input?i=Minimize%3A+f%28x1%2C+x2%29+%3D+%28x1+-+2%29%5E2+%2B+%28x2+-+1%29%5E2+subject+to+x1%5E2+%2B+x2%5E2+-+1+%3C%3D+0) + +### BNH +- Binh, T. and Korn, U. (1997). [MOBES: A multiobjective evolution strategy for constrained optimization problems](https://web.archive.org/web/20190801183649/https://pdfs.semanticscholar.org/cf68/41a6848ca2023342519b0e0e536b88bdea1d.pdf) + Test Case 2 on Page 6 +--- + +## Contributing + +When adding new examples, please include: +1. Problem definition and mathematical formulation +2. Dataset generation script with visualization +3. SMLP configuration file(s) +4. Expected results for verification +5. README documentation following this template + +--- + +## License + +Please refer to the main repository license for usage terms. + +--- + +## Support + +For issues or questions: +- [SMLP User Manual](https://arxiv.org/pdf/2405.10215v1) +- Example-specific issues: See individual example READMEs +- General optimization questions: Consult the references provided + +--- + +*Last updated: February 2026* diff --git a/tutorial/examples/bnh/smlp/README.md b/tutorial/examples/bnh/smlp/README.md new file mode 100644 index 00000000..117aca28 --- /dev/null +++ b/tutorial/examples/bnh/smlp/README.md @@ -0,0 +1,24 @@ +# Binh and Korn (BNH) Multi-Objective Optimization Problem + +### Problem Definition + +**Minimize:** + +```math + f₁(x) = 4x₁² + 4x₂² + f₂(x) = (x₁ - 5)² + (x₂ - 5)² +``` + +**Subject to:** + +```math + C₁(x) = (x₁ - 5)² + x₂² ≤ 25 + C₂(x) = (x₁ - 8)² + (x₂ + 3)² ≥ 7.7 + 0 ≤ x₁ ≤ 5 + 0 ≤ x₂ ≤ 3 +``` + +[Reference: Test Case 2 on page 6](https://web.archive.org/web/20190801183649/https://pdfs.semanticscholar.org/cf68/41a6848ca2023342519b0e0e536b88bdea1d.pdf) + +### [Expected result:](https://en.wikipedia.org/wiki/File:Binh_and_Korn_function.pdf) +![ResultsImage](media/BNH.jpg) diff --git a/tutorial/examples/bnh/smlp/bnh.json b/tutorial/examples/bnh/smlp/bnh.json new file mode 100644 index 00000000..2e2c8ea9 --- /dev/null +++ b/tutorial/examples/bnh/smlp/bnh.json @@ -0,0 +1,10 @@ +{ + "version": "1.2", + "variables": [ + {"label":"X1", "interface":"knob", "type":"real", "range":[0,5], "rad-abs": 0.0}, + {"label":"X2", "interface":"knob", "type":"real", "range":[0,3], "rad-abs": 0.0}, + {"label":"F1", "interface":"output", "type":"real"}, + {"label":"F2", "interface":"output", "type":"real"} + ], + "alpha": "(X1-5)*(X1-5)+X2*X2<=25 and (X1-8)*(X1-8)+(X2+3)*(X2+3)>=7.7" +} diff --git a/tutorial/examples/bnh/smlp/bnh_certify_expected.txt b/tutorial/examples/bnh/smlp/bnh_certify_expected.txt new file mode 100644 index 00000000..4df75cc8 --- /dev/null +++ b/tutorial/examples/bnh/smlp/bnh_certify_expected.txt @@ -0,0 +1,6 @@ +1 F1*F1<1e-10 and (F2-50)*(F2-50)<1e-10 "PASS" +2 (F1-0.692042)*(F1-0.692042)<1e-10 and (F2-44.290657)*(F2-44.290657)<1e-10 "PASS" +3 (F1-4.081633)*(F1-4.081633)<1e-10 and (F2-36.734694)*(F2-36.734694)<1e-10 "PASS" +4 (F1-14.876033)*(F1-14.876033)<1e-10 and (F2-26.446281)*(F2-26.446281)<1e-10 "FAIL" +5 (F1-50.0)*(F1-50.0)<1e-10 and (F2-12.5)*(F2-12.5)<1e-10 "FAIL" +6 (F1-136.0)*(F1-136.0)<1e-10 and (F2-4.0)*(F2-4.0)<1e-10 "FAIL" diff --git a/tutorial/examples/bnh/smlp/bnh_dataset.py b/tutorial/examples/bnh/smlp/bnh_dataset.py new file mode 100755 index 00000000..ad1678f8 --- /dev/null +++ b/tutorial/examples/bnh/smlp/bnh_dataset.py @@ -0,0 +1,44 @@ +#!/usr/bin/python3.11 +""" +Binh and Korn (BNH) Multi-Objective Optimization Problem +Reference: https://web.archive.org/web/20190801183649/https://pdfs.semanticscholar.org/cf68/41a6848ca2023342519b0e0e536b88bdea1d.pdf, Test Case 2 on page 6 +Problem Definition: +------------------- +Minimize: + f₁(x) = 4x₁² + 4x₂² + f₂(x) = (x₁ - 5)² + (x₂ - 5)² + +Subject to: + C₁(x) = (x₁ - 5)² + x₂² ≤ 25 + C₂(x) = (x₁ - 8)² + (x₂ + 3)² ≥ 7.7 + 0 ≤ x₁ ≤ 5 + 0 ≤ x₂ ≤ 3 + +Characteristics: +---------------- +- 2 objectives (minimize both) +- 2 constraints +- 2 decision variables +- Constraints do not make any solution in the unconstrained Pareto-optimal + front infeasible, but introduce additional difficulty in solving +""" + +from numpy import linspace +from gzip import open as gzopen + +def main(): + n_samples = 101 # Reduced from 1000 + x1_range = linspace(0, 5, n_samples) + x2_range = linspace(0, 3, n_samples) + + # Create gzipped dataset + with gzopen("bnh.csv.gz", "wt") as f_data: + f_data.write("X1,X2,F1,F2\n") + for x1 in x1_range: + for x2 in x2_range: + F1 = 4*x1**2 + 4*x2**2 + F2 = (x1-5)**2 + (x2-5)**2 + f_data.write(f"{x1},{x2},{F1},{F2}\n") + +if __name__ == "__main__": + main() diff --git a/tutorial/examples/bnh/smlp/bnh_pareto_F1_expected.txt b/tutorial/examples/bnh/smlp/bnh_pareto_F1_expected.txt new file mode 100644 index 00000000..7e83b042 --- /dev/null +++ b/tutorial/examples/bnh/smlp/bnh_pareto_F1_expected.txt @@ -0,0 +1,6 @@ +-4.871658622195194e-13 +0.6985598880096705 +4.107223016570562 +14.872162314146907 +50.00000953674317 +135.99999427795385 diff --git a/tutorial/examples/bnh/smlp/bnh_pareto_F2_expected.txt b/tutorial/examples/bnh/smlp/bnh_pareto_F2_expected.txt new file mode 100644 index 00000000..46511ef4 --- /dev/null +++ b/tutorial/examples/bnh/smlp/bnh_pareto_F2_expected.txt @@ -0,0 +1,6 @@ +49.99999970197663 +44.264713229687125 +36.69644784494007 +26.448861949615228 +12.49999761581421 +4.000000953674251 diff --git a/tutorial/examples/bnh/smlp/bnh_pareto_X1_expected.txt b/tutorial/examples/bnh/smlp/bnh_pareto_X1_expected.txt new file mode 100644 index 00000000..e0215234 --- /dev/null +++ b/tutorial/examples/bnh/smlp/bnh_pareto_X1_expected.txt @@ -0,0 +1,6 @@ +2.220445916901415e-16 +0.29411765933036804 +0.7142857313156128 +1.3636364936828613 +2.500000238418579 +5.0 diff --git a/tutorial/examples/bnh/smlp/bnh_pareto_X2_expected.txt b/tutorial/examples/bnh/smlp/bnh_pareto_X2_expected.txt new file mode 100644 index 00000000..98027dcb --- /dev/null +++ b/tutorial/examples/bnh/smlp/bnh_pareto_X2_expected.txt @@ -0,0 +1,6 @@ +2.980232416405215e-8 +0.2968750149011612 +0.7187500596046448 +1.3632813692092896 +2.500000238418579 +2.999999761581421 diff --git a/tutorial/examples/bnh/smlp/bnh_w.json b/tutorial/examples/bnh/smlp/bnh_w.json new file mode 100644 index 00000000..2d177c86 --- /dev/null +++ b/tutorial/examples/bnh/smlp/bnh_w.json @@ -0,0 +1,18 @@ +{ + "version": "1.2", + "variables": [ + {"label":"X1", "interface":"knob", "type":"real", "range":[0,5], "rad-rel": 1e-7}, + {"label":"X2", "interface":"knob", "type":"real", "range":[0,3], "rad-rel": 1e-7}, + {"label":"F1", "interface":"output", "type":"real"}, + {"label":"F2", "interface":"output", "type":"real"} + ], + "alpha": "(X1-5)*(X1-5)+X2*X2<=25 and (X1-8)*(X1-8)+(X2+3)*(X2+3)>=7.7", + "witnesses": { + "query1": {"X1": 0.0, "X2": 0.0}, + "query2": {"X1": 0.294118, "X2": 0.294118}, + "query3": {"X1": 0.714286, "X2": 0.714286}, + "query4": {"X1": 1.363636, "X2": 1.363636}, + "query5": {"X1": 2.5, "X2": 2.5}, + "query6": {"X1": 5.0, "X2": 3.0} + } +} diff --git a/tutorial/examples/bnh/smlp/media/BNH.jpg b/tutorial/examples/bnh/smlp/media/BNH.jpg new file mode 100644 index 00000000..8f6a2590 Binary files /dev/null and b/tutorial/examples/bnh/smlp/media/BNH.jpg differ diff --git a/tutorial/examples/bnh/smlp/pareto_analytical.py b/tutorial/examples/bnh/smlp/pareto_analytical.py new file mode 100755 index 00000000..063f2a63 --- /dev/null +++ b/tutorial/examples/bnh/smlp/pareto_analytical.py @@ -0,0 +1,24 @@ +#!/usr/bin/python3.11 +import numpy as np + +# Generate analytical Pareto front in decision space +# Segment 1: x1 = x2 for x in [0, 3] +x1_seg1 = [5*(1-w)/(w*4+(1-w)) for w in [1,0.8,0.6,0.4,0.2]] +x2_seg1 = x1_seg1 + +# Segment 2: x1 in [3, 5], x2 = 3 +x1_seg2 = [3,5] +x2_seg2 = np.full_like(x1_seg2, 3) + +# Combine segments for decision space +x1_pareto = np.concatenate([x1_seg1, x1_seg2]) +x2_pareto = np.concatenate([x2_seg1, x2_seg2]) + +# Calculate corresponding objective values +# f1 = 4*x1^2 + 4*x2^2 +# f2 = (x1-5)^2 + (x2-5)^2 +f1_pareto = 4 * x1_pareto**2 + 4 * x2_pareto**2 +f2_pareto = (x1_pareto - 5)**2 + (x2_pareto - 5)**2 + +print("X1,X2,F1,F2") +[print(f"{x1_pareto[i]:.6f},{x2_pareto[i]:.6f},{f1_pareto[i]:.6f},{f2_pareto[i]:.6f}") for i in range(len(x1_pareto))] diff --git a/tutorial/examples/bnh/smlp/plot_results.py b/tutorial/examples/bnh/smlp/plot_results.py new file mode 100755 index 00000000..605f67b3 --- /dev/null +++ b/tutorial/examples/bnh/smlp/plot_results.py @@ -0,0 +1,69 @@ +#!/usr/bin/python3.11 +import pandas as pd +import seaborn as sns +import matplotlib.pyplot as plt +import numpy as np +from sys import argv +from math import inf + +# Read the data files +X1 = pd.read_csv('bnh_pareto_X1.txt', header=None, names=['X1']) +X2 = pd.read_csv('bnh_pareto_X2.txt', header=None, names=['X2']) +F1 = pd.read_csv('bnh_pareto_F1.txt', header=None, names=['F1']) +F2 = pd.read_csv('bnh_pareto_F2.txt', header=None, names=['F2']) + +# Combine X1 and X2 +df_X = pd.concat([X1, X2], axis=1) + +# Combine F1 and F2 +df_F = pd.concat([F1, F2], axis=1) + +# Generate analytical Pareto front in decision space +# Segment 1: x1 = x2 for x in [0, 3] +x1_seg1 = np.linspace(0, 3, 100) +x2_seg1 = x1_seg1 + +# Segment 2: x1 in [3, 5], x2 = 3 +x1_seg2 = np.linspace(3, 5, 100) +x2_seg2 = np.full_like(x1_seg2, 3) + +# Combine segments for decision space +x1_pareto = np.concatenate([x1_seg1, x1_seg2]) +x2_pareto = np.concatenate([x2_seg1, x2_seg2]) + +# Calculate corresponding objective values +# f1 = 4*x1^2 + 4*x2^2 +# f2 = (x1-5)^2 + (x2-5)^2 +f1_pareto = 4 * x1_pareto**2 + 4 * x2_pareto**2 +f2_pareto = (x1_pareto - 5)**2 + (x2_pareto - 5)**2 + +# Create two subplots +fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(10, 4)) + +# Plot X1 vs X2 +sns.scatterplot(data=df_X, x='X1', y='X2', ax=ax1, label='Computed Solutions') +ax1.plot(x1_pareto, x2_pareto, 'r-', linewidth=2, label='Analytical Pareto Front') +ax1.set_xlabel('X1') +ax1.set_ylabel('X2') +ax1.set_title('Pareto Front in Decision Space') +ax1.grid(True) +ax1.legend() + +# Plot F1 vs F2 +sns.scatterplot(data=df_F, x='F1', y='F2', ax=ax2, label='Computed Solutions') +ax2.plot(f1_pareto, f2_pareto, 'r-', linewidth=2, label='Analytical Pareto Front') +ax2.set_xlabel('F1') +ax2.set_ylabel('F2') +ax2.set_title('Pareto Front in Objective Space') +ax2.grid(True) +ax2.legend() + +plt.tight_layout() +timeout = inf +if len(argv) > 2: + if '-timeout' == argv[1]: + timeout = int(argv[2]) +if not inf == timeout: + timer = fig.canvas.new_timer(interval=timeout*1000, callbacks=[(plt.close, [], {})]) + timer.start() +plt.show() diff --git a/tutorial/examples/bnh/smlp/run_certify b/tutorial/examples/bnh/smlp/run_certify new file mode 100755 index 00000000..fd678982 --- /dev/null +++ b/tutorial/examples/bnh/smlp/run_certify @@ -0,0 +1,53 @@ +#!/usr/bin/tcsh -f +set script_path=`realpath $0 | xargs dirname` +set test=BNH +set test_lc=`echo $test | tr '[A-Z]' '[a-z]'` +set gzipped_dataset=${test_lc}.csv.gz +if($#argv > 0) then + if("-clean" == "$argv[1]") then + \rm -f ${test}* *.log >& /dev/null + \rm -f $gzipped_dataset >& /dev/null + exit(0) + endif +endif +${script_path}/bnh_dataset.py +set csv=${test}.csv +set json=${script_path}/${test_lc}_w.json +gunzip -c $gzipped_dataset > $csv +set noglob +set e1="F1*F1<1e-10 and (F2-50)*(F2-50)<1e-10" +set e2="(F1-0.692042)*(F1-0.692042)<1e-10 and (F2-44.290657)*(F2-44.290657)<1e-10" +set e3="(F1-4.081633)*(F1-4.081633)<1e-10 and (F2-36.734694)*(F2-36.734694)<1e-10" +set e4="(F1-14.876033)*(F1-14.876033)<1e-10 and (F2-26.446281)*(F2-26.446281)<1e-10" +set e5="(F1-50.0)*(F1-50.0)<1e-10 and (F2-12.5)*(F2-12.5)<1e-10" +set e6="(F1-136.0)*(F1-136.0)<1e-10 and (F2-4.0)*(F2-4.0)<1e-10" +set exprs=("$e1" "$e2" "$e3" "$e4" "$e5" "$e6") +python3.11 $script_path:h:h:h:h/src/run_smlp.py \ + -data $csv \ + -spec $json \ + -out_dir ./ \ + -pref $test \ + -mode certify \ + -quer_names query1,query2,query3,query4,query5,query6 \ + -quer_exprs "$e1;$e2;$e3;$e4;$e5;$e6" \ + -pareto f \ + -resp F1,F2 \ + -feat X1,X2 \ + -model poly_sklearn \ + -tree_encoding flat \ + -compress_rules t \ + -mrmr_pred 0 \ + -epsilon 0.000005 \ + -delta_rel 0.05 \ + -save_model t \ + -model_name $csv:r_model \ + -save_model_config t \ + -plots f \ + -pred_plots f \ + -resp_plots f \ + -seed 10 \ + -log_time f >& `realpath $0 | xargs basename`.log + +foreach p (`seq 1 6`) + echo $p $exprs[$p] `jq ".query${p}.witness_status" ${test}_${test}_certify_results.json` +end diff --git a/tutorial/examples/bnh/smlp/run_optimize.sh b/tutorial/examples/bnh/smlp/run_optimize.sh new file mode 100755 index 00000000..b3d68b22 --- /dev/null +++ b/tutorial/examples/bnh/smlp/run_optimize.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash +script_path=$(dirname "$(realpath "$0")") +test=BNH +test_lc=$(echo "$test" | tr '[A-Z]' '[a-z]') +gzipped_dataset="${test_lc}.csv.gz" + +if [[ $# -gt 0 ]]; then + if [[ "-clean" == "$1" ]]; then + rm -f ${test}* *.log > /dev/null 2>&1 + rm -f "$gzipped_dataset" > /dev/null 2>&1 + exit 0 + fi +fi + +${script_path}/bnh_dataset.py + +csv="${test}.csv" +json="${script_path}/${test_lc}_w.json" + +gunzip -c "$gzipped_dataset" > "$csv" + +o1="(-F1)" +o2="(-(F1*0.8+F2*0.2))" +o3="(-(F1*0.6+F2*0.4))" +o4="(-(F1*0.4+F2*0.6))" +o5="(-(F1*0.2+F2*0.8))" +o6="(-F2)" + +python3.11 "$(realpath "$0" | xargs dirname | xargs dirname | xargs dirname | xargs dirname | xargs dirname)/src/run_smlp.py" \ + -data "$csv" \ + -spec "$json" \ + -out_dir ./ \ + -pref "$test" \ + -mode optimize \ + -pareto f \ + -opt_strategy eager \ + -resp F1,F2 \ + -feat X1,X2 \ + -objv_names "w1,w2,w3,w4,w5,w6" \ + -objv_exprs "$o1;$o2;$o3;$o4;$o5;$o6" \ + -model poly_sklearn \ + -mrmr_pred 0 \ + -epsilon 0.000005 \ + -delta_rel 0.05 \ + -save_model t \ + -model_name "${csv%.*}_model" \ + -save_model_config t \ + -plots f \ + -pred_plots f \ + -resp_plots f \ + -seed 10 \ + -log_time f > "$(basename "$0").log" 2>&1 + +for var in "X1" "X2" "F1" "F2"; do + jq --arg f "$var" '.[] | select(type == "object") | .[$f]' ${test}_${test}_optimization_results.json | \ + sed 's/E/e/g' > ${test_lc}_pareto_${var}.txt +done diff --git a/tutorial/examples/bnh/smlp/run_poly_pareto b/tutorial/examples/bnh/smlp/run_poly_pareto new file mode 100755 index 00000000..ddc67d3b --- /dev/null +++ b/tutorial/examples/bnh/smlp/run_poly_pareto @@ -0,0 +1,14 @@ +#!/usr/bin/tcsh -f +set script_path=`realpath $0 | xargs dirname` +\rm -f bnh.csv.gz bnh_p*_optimization_results.json BNH* *.log >& /dev/null +foreach v (X1 X2 F1 F2) + \rm -f bnh_pareto_$v.txt >& /dev/null +end +if($#argv > 0) then + if("-clean" == "$argv[1]") then + exit(0) + endif +endif +${script_path}/bnh_dataset.py +${script_path}/run_optimize.sh +${script_path}/plot_results.py -timeout 5 diff --git a/tutorial/examples/constraint_dora/smlp/README.md b/tutorial/examples/constraint_dora/smlp/README.md new file mode 100644 index 00000000..54e25458 --- /dev/null +++ b/tutorial/examples/constraint_dora/smlp/README.md @@ -0,0 +1,5 @@ +# School book example of minimization with constraints +[Minimize: f(x1, x2) = (x1 - 2)^2 + (x2 - 1)^2 subject to x1^2 + x2^2 - 1 <= 0](https://www.wolframalpha.com/input?i=Minimize%3A+f%28x1%2C+x2%29+%3D+%28x1+-+2%29%5E2+%2B+%28x2+-+1%29%5E2+subject+to+x1%5E2+%2B+x2%5E2+-+1+%3C%3D+0)

+Analytical solution:
+![SolutionImage](media/solution.gif) +``` diff --git a/tutorial/examples/constraint_dora/smlp/constraint_dora.json b/tutorial/examples/constraint_dora/smlp/constraint_dora.json new file mode 100644 index 00000000..3b6f1472 --- /dev/null +++ b/tutorial/examples/constraint_dora/smlp/constraint_dora.json @@ -0,0 +1,12 @@ +{ + "version": "1.2", + "variables": [ + {"label":"X1", "interface":"knob", "type":"real", "range":[-1.5,2.5], "rad-abs": 0.0}, + {"label":"X2", "interface":"knob", "type":"real", "range":[-1.5,2.0], "rad-abs": 0.0}, + {"label":"Y1", "interface":"output", "type":"real"} + ], + "alpha": "X1*X1+X2*X2<=1", + "objectives": { + "objective1": "-Y1" + } +} diff --git a/tutorial/examples/constraint_dora/smlp/constraint_dora_dataset.py b/tutorial/examples/constraint_dora/smlp/constraint_dora_dataset.py new file mode 100755 index 00000000..b98d47a0 --- /dev/null +++ b/tutorial/examples/constraint_dora/smlp/constraint_dora_dataset.py @@ -0,0 +1,85 @@ +#!/usr/bin/python3.11 +""" +Constrained Optimization Example using SMLP +Classic Lagrange Multiplier Problem (appears in many optimization textbooks) + +Problem: + Minimize: f(x1, x2) = (x1 - 2)^2 + (x2 - 1)^2 + Subject to: x1^2 + x2^2 - 1 <= 0 (inside unit circle) + + Geometrically: Find the point on the unit circle closest to (2, 1) + +Analytical Solution (using Lagrange multipliers): + Setting ∇f = λ∇g where g(x1,x2) = x1² + x2² - 1: + - 2(x1-2) = 2λx1 → x1 = 2/(1+λ) + - 2(x2-1) = 2λx2 → x2 = 1/(1+λ) + - Substituting into constraint: 5 = (1+λ)² + - Solving: λ = √5 - 1 + +Expected Result: + Optimal point: x1 = 2/√5 ≈ 0.894427, x2 = 1/√5 ≈ 0.447214 + Minimum value: f = (√5 - 1)² ≈ 1.527864 + +Reference: Wolfram Alpha +https://www.wolframalpha.com/input?i=Minimize%3A+f%28x1%2C+x2%29+%3D+%28x1+-+2%29%5E2+%2B+%28x2+-+1%29%5E2+subject+to+x1%5E2+%2B+x2%5E2+-+1+%3C%3D+0 +""" + +from sys import argv +from numpy import linspace, meshgrid, cos, sin, pi, sqrt, inf +from pandas import read_csv, concat +from gzip import open as gzopen +from matplotlib import pyplot as plt + +def main(): +# Initial guess + rng = range(0, 1000) + x1_start, x1_stop = (-1.5, 2.5) + x2_start, x2_stop = (-1.5, 2.0) + x1 = linspace(x1_start, x1_stop, rng.stop) + x2 = linspace(x2_start, x2_stop, rng.stop) + X1, X2 = meshgrid(x1, x2) + Z = (X1 - 2)**2 + (X2 - 1)**2 + with gzopen('dataset.txt.gz',"wt") as ds: + ds.write("X1 X2 Y1\n") + [[ds.write(f"{X1[i][j]} {X2[i][j]} {Z[i][j]}\n") for j in rng] for i in rng] + + # Visualization + fig, ax = plt.subplots(figsize=(10, 8)) + + # Plot contours of objective function + contours = ax.contour(X1, X2, Z, levels=20, cmap='viridis', alpha=0.6) + ax.clabel(contours, inline=True, fontsize=8) + +# Plot constraint boundary (unit circle) + theta = linspace(0, 2*pi, 100) + circle_x = cos(theta) + circle_y = sin(theta) + ax.plot(circle_x, circle_y, 'r-', linewidth=2, label='Constraint boundary') + ax.fill(circle_x, circle_y, alpha=0.1, color='red', label='Feasible region') + + # Plot unconstrained optimum + ax.plot(2, 1, 'bs', markersize=12, label='Unconstrained optimum (2, 1)') + + ax.set_xlabel('x1', fontsize=12) + ax.set_ylabel('x2', fontsize=12) + ax.set_title('Constrained Optimization: Minimize f(x1,x2) subject to x1² + x2² ≤ 1', + fontsize=14) + # Plot constrained optimum + ax.plot(2/sqrt(5), 1/sqrt(5), 'go', markersize=12, label=f'Constrained optimum ({2/sqrt(5):.3f}, {1/sqrt(5):.3f})') + ax.legend(loc='upper right') + ax.grid(True, alpha=0.3) + ax.axis('equal') + ax.set_ylim(-1.5, 2.0) + + plt.tight_layout() + timeout = inf + if len(argv) > 2: + if '-timeout' == argv[1]: + timeout = int(argv[2]) + if not inf == timeout: + timer = fig.canvas.new_timer(interval=timeout*1000, callbacks=[(plt.close, [], {})]) + timer.start() + plt.show() + +if __name__ == "__main__": + main() diff --git a/tutorial/examples/constraint_dora/smlp/constraint_dora_poly_benchmark_expected.txt b/tutorial/examples/constraint_dora/smlp/constraint_dora_poly_benchmark_expected.txt new file mode 100644 index 00000000..1d6018a8 --- /dev/null +++ b/tutorial/examples/constraint_dora/smlp/constraint_dora_poly_benchmark_expected.txt @@ -0,0 +1 @@ +38.440u 2.050s 0:38.94 103.9% 0+0k 96+283296io 2pf+0w diff --git a/tutorial/examples/constraint_dora/smlp/constraint_dora_poly_optimization_results_expected.json b/tutorial/examples/constraint_dora/smlp/constraint_dora_poly_optimization_results_expected.json new file mode 100644 index 00000000..a7f8976b --- /dev/null +++ b/tutorial/examples/constraint_dora/smlp/constraint_dora_poly_optimization_results_expected.json @@ -0,0 +1,19 @@ +{ + "objective1": { + "X1": 0.89453125, + "X2": 0.4470043182373047, + "Y1": 1.5278653812779421, + "objective1_scaled": 0.9174128063161097, + "objective1": -1.5278653812779421, + "threshold_lo_scaled": 0.9174127578735352, + "threshold_lo": -1.5278662774654495, + "threshold_up_scaled": 0.9174132347106934, + "threshold_up": -1.527857455979217, + "max_in_data": -2.5050075100120686e-06, + "min_in_data": -18.5 + }, + "smlp_execution": "completed", + "interface_consistent": "true", + "model_consistent": "true", + "synthesis_feasible": "true" +} \ No newline at end of file diff --git a/tutorial/examples/constraint_dora/smlp/media/solution.gif b/tutorial/examples/constraint_dora/smlp/media/solution.gif new file mode 100644 index 00000000..69bcd4b9 Binary files /dev/null and b/tutorial/examples/constraint_dora/smlp/media/solution.gif differ diff --git a/tutorial/examples/constraint_dora/smlp/run_constraint_dora_poly b/tutorial/examples/constraint_dora/smlp/run_constraint_dora_poly new file mode 100755 index 00000000..8efc99d1 --- /dev/null +++ b/tutorial/examples/constraint_dora/smlp/run_constraint_dora_poly @@ -0,0 +1,46 @@ +#!/usr/bin/tcsh -f +set script_path=`realpath $0 | xargs dirname` +if($#argv > 0) then + if("-clean" == "$argv[1]") then + \rm -f dataset.txt.gz >& /dev/null + \rm -f Constraint_dora* *.log >& /dev/null + exit(0) + endif +endif +${script_path}/constraint_dora_dataset.py -timeout 5 +\ln -sf /usr/bin/python3.11 python3 +if($PATH !~ \.*) then + setenv PATH ".:${PATH}" +endif +set csv=Constraint_dora.csv +set json=`echo $csv:r | tr '[A-Z]' '[a-z]'`.json +gunzip -c dataset.txt.gz | tr ' ' , > $csv +$script_path:h:h:h:h/src/run_smlp.py -data $csv \ + -spec $script_path/$json \ + -out_dir ./ \ + -pref $csv:r \ + -mode optimize \ + -pareto f \ + -opt_strategy eager \ + -resp Y1 \ + -feat X1,X2 \ + -model poly_sklearn \ + -tree_encoding flat \ + -compress_rules t \ + -mrmr_pred 0 \ + -epsilon 0.0000005 \ + -delta_rel 0 \ + -rad_rel 0 \ + -save_model t \ + -model_name $csv:r_model \ + -save_model_config t \ + -plots f \ + -pred_plots f \ + -resp_plots f \ + -seed 10 \ + -log_time f \ + >& `realpath $0 | xargs basename`.log +foreach var (X1 X2 Y1) + echo $var = `jq ".objective1.${var}" Constraint_dora_Constraint_dora_optimization_results.json` +end +\rm -f python3 diff --git a/tutorial/examples/eggholder/smlp/README.md b/tutorial/examples/eggholder/smlp/README.md new file mode 100644 index 00000000..a6a3893f --- /dev/null +++ b/tutorial/examples/eggholder/smlp/README.md @@ -0,0 +1,10 @@ +# Eggholder Function Optimization + +This project demonstrates global optimization techniques using SMLP on the Eggholder function, a complex mathematical function commonly used for testing optimization algorithms. + +## Overview + +The [Eggholder function]( https://www.sfu.ca/~ssurjano/egg.html ) is a challenging optimization problem with many local minima, making it an excellent benchmark for testing global optimization algorithms.
+![Eggholder function figure](media/eggholder_figure.png)

+![Eggholder function formula](media/eggholder_formula.png)

+Global minimum: _f(x*) = -959.6407, at x* = (512, 404.2319)_ diff --git a/tutorial/examples/eggholder/smlp/eggholder.json b/tutorial/examples/eggholder/smlp/eggholder.json new file mode 100755 index 00000000..af983b81 --- /dev/null +++ b/tutorial/examples/eggholder/smlp/eggholder.json @@ -0,0 +1,11 @@ +{ + "version": "1.2", + "variables": [ + {"label":"X1", "interface":"knob", "type":"real", "range":[-512,512], "rad-abs": 0.1}, + {"label":"X2", "interface":"knob", "type":"real", "range":[-512,512], "rad-abs": 0.1}, + {"label":"Y1", "interface":"output", "type":"real"} + ], + "objectives": { + "objective1": "-Y1" + } +} diff --git a/tutorial/examples/eggholder/smlp/eggholder_benchmark_expected.txt b/tutorial/examples/eggholder/smlp/eggholder_benchmark_expected.txt new file mode 100644 index 00000000..5d72aaad --- /dev/null +++ b/tutorial/examples/eggholder/smlp/eggholder_benchmark_expected.txt @@ -0,0 +1 @@ +252.263u 5.690s 4:17.66 100.1% 0+0k 6672+330584io 66pf+0w diff --git a/tutorial/examples/eggholder/smlp/eggholder_dataset.py b/tutorial/examples/eggholder/smlp/eggholder_dataset.py new file mode 100755 index 00000000..31b8896b --- /dev/null +++ b/tutorial/examples/eggholder/smlp/eggholder_dataset.py @@ -0,0 +1,52 @@ +#!/usr/bin/python3.11 +""" +https://www.sfu.ca/~ssurjano/egg.html +""" +from matplotlib import pyplot as plt +from mpl_toolkits.mplot3d import Axes3D +from numpy import sin, sqrt, arange, meshgrid, stack, abs +from sys import argv +from gzip import open as gzopen +from math import inf + +eggholder = lambda x, k = 47: (-(x[1] + k) * sin(sqrt(abs(x[0]/2 + (x[1] + k)))) + -x[0] * sin(sqrt(abs(x[0] - (x[1] + k))))) + +def main(): + n = 512 + r = range(-n, n+1) + x = arange(r.start, r.stop) + xgrid, ygrid = meshgrid(x, x) + xy = stack([xgrid, ygrid]) + + fig = plt.figure() + ax = fig.add_subplot(111, projection='3d') + angle=45 + ax.view_init(angle, -angle) + eggholder_xy=eggholder(xy) + with gzopen("dataset.txt.gz","wt") as ds: + ds.write("X1 X2 Y1\n") + [[ds.write(f"{xy[0][i][j]} {xy[1][i][j]} {eggholder_xy[i][j]}\n") for j in r] for i in r] + ax.plot_surface(xgrid, ygrid, eggholder_xy, cmap='terrain') + ax.set_xlabel('x') + ax.set_ylabel('y') + ax.set_zlabel('eggholder(x, y)') + # set window title only if a canvas manager is available (some backends may not provide one) + mgr = getattr(fig.canvas, "manager", None) + if mgr is not None and hasattr(mgr, "set_window_title"): + try: + mgr.set_window_title('Eggholder plot') + except Exception: + pass + timeout = inf + if len(argv) > 2: + if '-timeout' == argv[1]: + timeout = int(argv[2]) + if not inf == timeout: + timer = fig.canvas.new_timer(interval=timeout*1000, callbacks=[(plt.close, [], {})]) + timer.start() + plt.show() +if __name__ == "__main__": + main() + + diff --git a/tutorial/examples/eggholder/smlp/eggholder_optimization_results_expected.json b/tutorial/examples/eggholder/smlp/eggholder_optimization_results_expected.json new file mode 100644 index 00000000..84a9a598 --- /dev/null +++ b/tutorial/examples/eggholder/smlp/eggholder_optimization_results_expected.json @@ -0,0 +1,19 @@ +{ + "objective1": { + "X1": 511.9, + "X2": 405.3, + "Y1": -955.611346830121, + "objective1_scaled": 0.9980244422968063, + "objective1": 955.611346830121, + "threshold_lo_scaled": 0.9970703125, + "threshold_lo": 953.6947755299911, + "threshold_up_scaled": 1.0, + "threshold_up": 959.579671903256, + "max_in_data": 959.579671903256, + "min_in_data": -1049.131623504493 + }, + "smlp_execution": "completed", + "interface_consistent": "true", + "model_consistent": "true", + "synthesis_feasible": "true" +} \ No newline at end of file diff --git a/tutorial/examples/eggholder/smlp/media/eggholder_figure.png b/tutorial/examples/eggholder/smlp/media/eggholder_figure.png new file mode 100644 index 00000000..b0f1285c Binary files /dev/null and b/tutorial/examples/eggholder/smlp/media/eggholder_figure.png differ diff --git a/tutorial/examples/eggholder/smlp/media/eggholder_formula.png b/tutorial/examples/eggholder/smlp/media/eggholder_formula.png new file mode 100644 index 00000000..a30ab232 Binary files /dev/null and b/tutorial/examples/eggholder/smlp/media/eggholder_formula.png differ diff --git a/tutorial/examples/eggholder/smlp/run_eggholder b/tutorial/examples/eggholder/smlp/run_eggholder new file mode 100755 index 00000000..cc502dec --- /dev/null +++ b/tutorial/examples/eggholder/smlp/run_eggholder @@ -0,0 +1,46 @@ +#!/usr/bin/tcsh -f +set script_path=`realpath $0 | xargs dirname` +if($#argv > 0) then + if("-clean" == "$argv[1]") then + \rm -f dataset.txt.gz >& /dev/null + \rm -f Eggholder* *.log >& /dev/null + exit(0) + endif +endif +\ln -sf /usr/bin/python3.11 python3 +if($PATH !~ \.*) then + setenv PATH ".:${PATH}" +endif +set csv=Eggholder.csv +set json=`echo $csv:r | tr '[A-Z]' '[a-z]'`.json +${script_path}/eggholder_dataset.py -timeout 5 +gunzip -c dataset.txt.gz | tr ' ' , > $csv +$script_path:h:h:h:h/src/run_smlp.py -data $csv \ + -spec $script_path/$json \ + -out_dir ./ \ + -pref $csv:r \ + -mode optimize \ + -pareto f \ + -opt_strategy eager \ + -resp Y1 \ + -feat X1,X2 \ + -model dt_sklearn \ + -dt_sklearn_max_depth 15 \ + -tree_encoding flat \ + -compress_rules t \ + -mrmr_pred 0 \ + -epsilon 0.005 \ + -delta_rel 0.5 \ + -save_model t \ + -model_name $csv:r_model \ + -save_model_config t \ + -plots f \ + -pred_plots f \ + -resp_plots f \ + -seed 10 \ + -log_time f \ + >& `realpath $0 | xargs basename`.log +\rm -f python3 +foreach var (X1 X2 Y1) + echo $var = `jq ".objective1.${var}" Eggholder_Eggholder_optimization_results.json` +end diff --git a/tutorial/examples/si/smlp/README.md b/tutorial/examples/si/smlp/README.md new file mode 100644 index 00000000..b6b06cd6 --- /dev/null +++ b/tutorial/examples/si/smlp/README.md @@ -0,0 +1,33 @@ +### 1. Pull the image + +```bash +docker pull mdmitry1/python311-dev:latest +``` + +### 2. Run the container + +```bash +docker run -it mdmitry1/python311-dev:latest +``` + +### 3. In the container + +```bash +cd smlp +git checkout remotes/origin/poly_pareto tutorial/examples/si/smlp +xvfb-run tutorial/examples/si/smlp/run_si_test_nosplit +``` + +### 4. Runtime benchmark results in Docker CLI environment +- Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz +` 1364.003u 2.921s 22:49.65 99.8% 0+0k 356456+416600io 531pf+0w` +- Mac M1 Docker CLI environment +` 653.405u 1.463s 10:53.50 100.2% 0+0k 5736+417504io 26pf+0w` + +### 6. Expected results plot + + +### 7. Numerical diffs validation +```bash +diff no_split_s2_tx_piv_anonym_optimization_results_relative_optimized_margin.txt results/NO_SPLIT_S2_TX_PIV_ANONYM_OPTIMIZATION_RESULTS_RELATIVE_OPTIMIZED_MARGIN_EXPECTED.txt +``` diff --git a/tutorial/examples/si/smlp/docker_cli_benchmark_expected.txt b/tutorial/examples/si/smlp/docker_cli_benchmark_expected.txt new file mode 100644 index 00000000..658e1b21 --- /dev/null +++ b/tutorial/examples/si/smlp/docker_cli_benchmark_expected.txt @@ -0,0 +1,4 @@ +/app/smlp/tutorial/examples/si/smlp/run_si_test_nosplit +1364.003u 2.921s 22:49.65 99.8% 0+0k 356456+416600io 531pf+0w +/app/smlp/tutorial/examples/si/smlp/run_si_test_split +1921.347u 2.466s 32:04.61 99.9% 0+0k 8+536144io 0pf+0w diff --git a/tutorial/examples/si/smlp/extract_all_results b/tutorial/examples/si/smlp/extract_all_results new file mode 100755 index 00000000..f27cce08 --- /dev/null +++ b/tutorial/examples/si/smlp/extract_all_results @@ -0,0 +1,12 @@ +#!/usr/bin/tcsh -f +foreach json (split_s2_tx_piv_anonym_optimization_results.json no_split_s2_tx_piv_anonym_optimization_results.json) + `realpath $0 | xargs dirname`/extract_results $json -clean +end +if($#argv > 0) then + if("-clean" == "$argv[1]") then + exit(0) + endif +endif +foreach json (split_s2_tx_piv_anonym_optimization_results.json no_split_s2_tx_piv_anonym_optimization_results.json) + `realpath $0 | xargs dirname`/extract_results $json -timeout 5 +end diff --git a/tutorial/examples/si/smlp/extract_results b/tutorial/examples/si/smlp/extract_results new file mode 100755 index 00000000..478d2eaf --- /dev/null +++ b/tutorial/examples/si/smlp/extract_results @@ -0,0 +1,28 @@ +#!/usr/bin/tcsh -f +set script_path=`realpath $0 | xargs dirname` +set script_name=`realpath $0 | xargs basename` +if($#argv < 1 ) then + echo "\nUsage: $script_name [] [-clean|-timeout ]\n" + exit(0) +endif +set json=$argv[1] +set out="$json:t:r_relative_optimized_margin.txt" +set out_sorted=$out:r_sorted.txt +set png="$json:t:r.png" +\rm -f $out_sorted $png >& /dev/null +if($#argv > 1) then + if("-clean" == "$argv[2]") then + exit(0) + endif +endif +if($#argv > 2) then + if("-timeout" == "$argv[2]") then + set timeout="$argv[3]" + endif +endif +sort -n -r -k 2 $out >& $out_sorted +set cmd="$script_path/plot_results.py $out_sorted" +if($?timeout) then + set cmd="$cmd -timeout $timeout" +endif +$cmd diff --git a/tutorial/examples/si/smlp/media/no_split_s2_tx_piv_anonym_optimization_results.png b/tutorial/examples/si/smlp/media/no_split_s2_tx_piv_anonym_optimization_results.png new file mode 100644 index 00000000..e18b364e Binary files /dev/null and b/tutorial/examples/si/smlp/media/no_split_s2_tx_piv_anonym_optimization_results.png differ diff --git a/tutorial/examples/si/smlp/media/split_s2_tx_piv_anonym_optimization_results.png b/tutorial/examples/si/smlp/media/split_s2_tx_piv_anonym_optimization_results.png new file mode 100644 index 00000000..936feb8c Binary files /dev/null and b/tutorial/examples/si/smlp/media/split_s2_tx_piv_anonym_optimization_results.png differ diff --git a/tutorial/examples/si/smlp/plot_results.py b/tutorial/examples/si/smlp/plot_results.py new file mode 100755 index 00000000..05bf5d8f --- /dev/null +++ b/tutorial/examples/si/smlp/plot_results.py @@ -0,0 +1,222 @@ +#!/usr/bin/python3.11 +import pandas as pd +import seaborn as sns +import matplotlib +matplotlib.use("TkAgg") +import matplotlib.pyplot as plt +import matplotlib.patches as mpatches +from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg +import tkinter as tk +import numpy as np +import re +from math import inf +from sys import argv +from os.path import basename, realpath +from pathlib import Path + +# ── 1. Load data ────────────────────────────────────────────────────────────── +rows = [] +if len(argv) < 2: + print(f"\nUsage {basename(realpath(argv[0]))} [-timeout ]\n") + exit(0) +file_path = argv[1] +with open(file_path) as f: + for line in f: + parts = line.strip().split() + if len(parts) == 2: + label, value = parts[0], float(parts[1]) + m = re.match(r"o(\d+)_CH(\d+)RANK(\d+)Byte(\d+)", label) + if m: + o, ch, rank, byte = m.groups() + rows.append({ + "label": label, + "value": value, + "Octet": f"O{o}", + "Channel": f"CH{ch}", + "Rank": f"RANK{rank}", + "Byte": int(byte), + "group": f"O{o} CH{ch} RANK{rank}", + "ch_rank_byte_group": f"CH{ch} RANK{rank} Byte{byte}", + "_ch": int(ch), + "_rank": int(rank), + "_byte": int(byte), + }) + +# ── df_value: sorted by value (for right chart) ─────────────────────────────── +df_value = pd.DataFrame(rows).sort_values("value", ascending=False).reset_index(drop=True) + +# ── df_grouped: sorted by O/CH/RANK group then Byte (left chart) ────────────── +df_grouped = pd.DataFrame(rows).sort_values( + ["group", "_byte"], ascending=True +).reset_index(drop=True) +df_grouped["index"] = df_grouped.index + +# ── 2. Colour palette — shared by both charts, keyed on group (O CH RANK) ──── +groups = sorted(df_value["group"].unique()) +palette = sns.color_palette("tab10", len(groups)) +group_color = dict(zip(groups, palette)) + +# ── 3. Plot ─────────────────────────────────────────────────────────────────── +fig, axes = plt.subplots( + 1, 2, + figsize=(18, 9), + gridspec_kw={"width_ratios": [2, 1]}, +) +fig.patch.set_facecolor("#f8f9fb") + +# ── LEFT: horizontal bar chart grouped by O/CH/RANK ─────────────────────────── +ax = axes[0] +ax.set_facecolor("#f0f2f5") + +colors = [group_color[g] for g in df_grouped["group"]] +bars = ax.barh( + df_grouped["index"], df_grouped["value"], + color=colors, edgecolor="white", linewidth=0.4, height=0.85 +) + +# Add value labels on bars +for bar, val in zip(bars, df_grouped["value"]): + x = bar.get_width() + ax.text( + x + 0.003, bar.get_y() + bar.get_height() / 2, + f"{val:.3f}", va="center", ha="left", + fontsize=6.5, color="#333333" + ) + +# Draw separator lines between O/CH/RANK groups +prev_grp = None +for idx, row in df_grouped.iterrows(): + curr_grp = row["group"] + if prev_grp is not None and curr_grp != prev_grp: + ax.axhline(idx - 0.5, color="#888888", linewidth=0.7, linestyle="-", alpha=0.5) + prev_grp = curr_grp + +# Threshold reference lines +ax.axvline(0.9, color="#e74c3c", linestyle="--", linewidth=1.2, alpha=0.8, label="Threshold = 0.90") +ax.axvline(1.0, color="#2ecc71", linestyle="--", linewidth=1.2, alpha=0.8, label="Max = 1.00") + +ax.set_yticks(df_grouped["index"]) +ax.set_yticklabels(df_grouped["label"], fontsize=7) +ax.invert_yaxis() +ax.set_xlim(0, 1.08) +ax.set_xlabel("Relative Optimized Margin", fontsize=11, labelpad=8) +plot_name = Path(file_path).stem.replace('_relative_optimized_margin_sorted', '') +ax.set_title(f"{plot_name} Optimization Results — Grouped by O / CH / RANK", fontsize=13, fontweight="bold", pad=12) +ax.tick_params(axis="x", labelsize=9) +ax.legend(fontsize=9, loc="lower right") +ax.axvspan(0.9, 1.08, alpha=0.06, color="#2ecc71") +ax.xaxis.grid(True, linestyle="--", alpha=0.5, color="white") +ax.set_axisbelow(True) + +# ── RIGHT: dot-strip plot by Group (unchanged) ──────────────────────────────── +ax2 = axes[1] +ax2.set_facecolor("#f0f2f5") + +group_order = sorted(df_value["group"].unique(), reverse=True) +for i, grp in enumerate(group_order): + sub = df_value[df_value["group"] == grp] + jitter = np.random.default_rng(42).uniform(-0.18, 0.18, len(sub)) + ax2.scatter( + sub["value"], [i + j for j in jitter], + color=group_color[grp], s=55, alpha=0.85, + edgecolors="white", linewidths=0.5, zorder=3 + ) + mean_val = sub["value"].mean() + ax2.hlines(i, mean_val - 0.001, mean_val + 0.001, colors=group_color[grp], + linewidths=0, zorder=2) + ax2.scatter([mean_val], [i], color=group_color[grp], s=120, + marker="D", edgecolors="#333", linewidths=0.8, zorder=4) + +ax2.set_yticks(range(len(group_order))) +ax2.set_yticklabels(group_order, fontsize=9) +ax2.set_xlabel("Relative Optimized Margin", fontsize=11, labelpad=8) +ax2.set_title("Distribution by Group\n(◆ = mean)", fontsize=12, fontweight="bold", pad=12) +ax2.axvline(0.9, color="#e74c3c", linestyle="--", linewidth=1.2, alpha=0.8) +ax2.axvspan(0.9, 1.08, alpha=0.06, color="#2ecc71") +ax2.set_xlim(0.4, 1.08) +ax2.xaxis.grid(True, linestyle="--", alpha=0.5, color="white") +ax2.set_axisbelow(True) +ax2.tick_params(axis="x", labelsize=9) + +# ── Summary stats box ───────────────────────────────────────────────────────── +n_total = len(df_grouped) +n_above = (df_grouped["value"] >= 0.9).sum() +stats_text = ( + f"Total signals: {n_total}\n" + f"Signals ≥ 0.90: {n_above} ({100*n_above/n_total:.0f}%)\n" + f"Signals < 0.90: {n_total - n_above} ({100*(n_total-n_above)/n_total:.0f}%)\n" + f"Min: {df_grouped['value'].min():.4f} Max: {df_grouped['value'].max():.4f}\n" + f"Mean: {df_grouped['value'].mean():.4f} Median: {df_grouped['value'].median():.4f}" +) +fig.text( + 0.5, 0.01, stats_text, + ha="center", va="bottom", fontsize=9, + bbox=dict(boxstyle="round,pad=0.5", facecolor="#dce3ec", edgecolor="#aab4c2", alpha=0.9) +) +plt.tight_layout(rect=[0, 0.08, 1, 1]) +plt.savefig(f"{plot_name}.png", dpi=150, bbox_inches="tight") + +# ── Scrollable Tk window ────────────────────────────────────────────────────── +timeout = inf +if len(argv) > 3: + if '-timeout' == argv[2]: + timeout = int(argv[3]) + +root = tk.Tk() +root.title(f"{plot_name} — Optimization Results") + +# Get screen dimensions and set window to full screen height +root.geometry("1280x1024") + +# Outer frame holds canvas + scrollbars +outer = tk.Frame(root) +outer.pack(fill=tk.BOTH, expand=True) + +# Horizontal + vertical scrollbars +hbar = tk.Scrollbar(outer, orient=tk.HORIZONTAL) +hbar.pack(side=tk.BOTTOM, fill=tk.X) +vbar = tk.Scrollbar(outer, orient=tk.VERTICAL) +vbar.pack(side=tk.RIGHT, fill=tk.Y) + +# Tk canvas (scroll container) +tk_canvas = tk.Canvas(outer, xscrollcommand=hbar.set, yscrollcommand=vbar.set) +tk_canvas.pack(side=tk.LEFT, fill=tk.BOTH, expand=True) +hbar.config(command=tk_canvas.xview) +vbar.config(command=tk_canvas.yview) + +# Embed matplotlib figure into the Tk canvas +mpl_canvas = FigureCanvasTkAgg(fig, master=tk_canvas) +mpl_widget = mpl_canvas.get_tk_widget() +# Place the widget inside the canvas +fig_w_px = int(fig.get_figwidth() * fig.dpi) +fig_h_px = int(fig.get_figheight() * fig.dpi) +tk_canvas.create_window(0, 0, anchor="nw", window=mpl_widget, width=fig_w_px, height=fig_h_px) +tk_canvas.config(scrollregion=(0, 0, fig_w_px, fig_h_px)) + +mpl_canvas.draw() + +# Mouse-wheel horizontal scroll (Shift+wheel or middle-drag) +def _on_mousewheel(event): + tk_canvas.yview_scroll(int(-1 * (event.delta / 120)), "units") +def _on_shift_mousewheel(event): + tk_canvas.xview_scroll(int(-1 * (event.delta / 120)), "units") + +root.bind_all("", _on_mousewheel) +root.bind_all("", _on_shift_mousewheel) +# Linux scroll events +root.bind_all("", lambda e: tk_canvas.yview_scroll(-1, "units")) +root.bind_all("", lambda e: tk_canvas.yview_scroll(1, "units")) +root.bind_all("", lambda e: tk_canvas.xview_scroll(-1, "units")) +root.bind_all("", lambda e: tk_canvas.xview_scroll(1, "units")) + +def _quit(e=None): + root.destroy() + import os; os._exit(0) + +root.bind_all("", _quit) +root.bind_all("", _quit) + +if not inf == timeout: + root.after(int(timeout * 1000), _quit) + +root.mainloop() diff --git a/tutorial/examples/si/smlp/results/NO_SPLIT_S2_TX_PIV_ANONYM_OPTIMIZATION_RESULTS_EXPECTED.csv b/tutorial/examples/si/smlp/results/NO_SPLIT_S2_TX_PIV_ANONYM_OPTIMIZATION_RESULTS_EXPECTED.csv new file mode 100644 index 00000000..45e4e782 --- /dev/null +++ b/tutorial/examples/si/smlp/results/NO_SPLIT_S2_TX_PIV_ANONYM_OPTIMIZATION_RESULTS_EXPECTED.csv @@ -0,0 +1,12 @@ +Iteration,p0,p1,p2,p3,o0_CH0RANK0Byte0,o0_CH0RANK0Byte1,o0_CH0RANK0Byte2,o0_CH0RANK0Byte3,o0_CH0RANK0Byte4,o0_CH0RANK0Byte5,o0_CH0RANK0Byte6,o0_CH0RANK0Byte7,o0_CH0RANK1Byte0,o0_CH0RANK1Byte1,o0_CH0RANK1Byte2,o0_CH0RANK1Byte3,o0_CH0RANK1Byte4,o0_CH0RANK1Byte5,o0_CH0RANK1Byte6,o0_CH0RANK1Byte7,o0_CH1RANK0Byte0,o0_CH1RANK0Byte1,o0_CH1RANK0Byte2,o0_CH1RANK0Byte3,o0_CH1RANK0Byte4,o0_CH1RANK0Byte5,o0_CH1RANK0Byte6,o0_CH1RANK0Byte7,o0_CH1RANK1Byte0,o0_CH1RANK1Byte1,o0_CH1RANK1Byte2,o0_CH1RANK1Byte3,o0_CH1RANK1Byte4,o0_CH1RANK1Byte5,o0_CH1RANK1Byte6,o0_CH1RANK1Byte7,o1_CH0RANK0Byte0,o1_CH0RANK0Byte1,o1_CH0RANK0Byte2,o1_CH0RANK0Byte3,o1_CH0RANK0Byte4,o1_CH0RANK0Byte5,o1_CH0RANK0Byte6,o1_CH0RANK0Byte7,o1_CH0RANK1Byte0,o1_CH0RANK1Byte1,o1_CH0RANK1Byte2,o1_CH0RANK1Byte3,o1_CH0RANK1Byte4,o1_CH0RANK1Byte5,o1_CH0RANK1Byte6,o1_CH0RANK1Byte7,o1_CH1RANK0Byte0,o1_CH1RANK0Byte1,o1_CH1RANK0Byte2,o1_CH1RANK0Byte3,o1_CH1RANK0Byte4,o1_CH1RANK0Byte5,o1_CH1RANK0Byte6,o1_CH1RANK0Byte7,o1_CH1RANK1Byte0,o1_CH1RANK1Byte1,o1_CH1RANK1Byte2,o1_CH1RANK1Byte3,o1_CH1RANK1Byte4,o1_CH1RANK1Byte5,o1_CH1RANK1Byte6,o1_CH1RANK1Byte7,objv_o0_CH0RANK0Byte0,objv_o0_CH0RANK0Byte1,objv_o0_CH0RANK0Byte2,objv_o0_CH0RANK0Byte3,objv_o0_CH0RANK0Byte4,objv_o0_CH0RANK0Byte5,objv_o0_CH0RANK0Byte6,objv_o0_CH0RANK0Byte7,objv_o0_CH0RANK1Byte0,objv_o0_CH0RANK1Byte1,objv_o0_CH0RANK1Byte2,objv_o0_CH0RANK1Byte3,objv_o0_CH0RANK1Byte4,objv_o0_CH0RANK1Byte5,objv_o0_CH0RANK1Byte6,objv_o0_CH0RANK1Byte7,objv_o0_CH1RANK0Byte0,objv_o0_CH1RANK0Byte1,objv_o0_CH1RANK0Byte2,objv_o0_CH1RANK0Byte3,objv_o0_CH1RANK0Byte4,objv_o0_CH1RANK0Byte5,objv_o0_CH1RANK0Byte6,objv_o0_CH1RANK0Byte7,objv_o0_CH1RANK1Byte0,objv_o0_CH1RANK1Byte1,objv_o0_CH1RANK1Byte2,objv_o0_CH1RANK1Byte3,objv_o0_CH1RANK1Byte4,objv_o0_CH1RANK1Byte5,objv_o0_CH1RANK1Byte6,objv_o0_CH1RANK1Byte7,objv_o1_CH0RANK0Byte0,objv_o1_CH0RANK0Byte1,objv_o1_CH0RANK0Byte2,objv_o1_CH0RANK0Byte3,objv_o1_CH0RANK0Byte4,objv_o1_CH0RANK0Byte5,objv_o1_CH0RANK0Byte6,objv_o1_CH0RANK0Byte7,objv_o1_CH0RANK1Byte0,objv_o1_CH0RANK1Byte1,objv_o1_CH0RANK1Byte2,objv_o1_CH0RANK1Byte3,objv_o1_CH0RANK1Byte4,objv_o1_CH0RANK1Byte5,objv_o1_CH0RANK1Byte6,objv_o1_CH0RANK1Byte7,objv_o1_CH1RANK0Byte0,objv_o1_CH1RANK0Byte1,objv_o1_CH1RANK0Byte2,objv_o1_CH1RANK0Byte3,objv_o1_CH1RANK0Byte4,objv_o1_CH1RANK0Byte5,objv_o1_CH1RANK0Byte6,objv_o1_CH1RANK0Byte7,objv_o1_CH1RANK1Byte0,objv_o1_CH1RANK1Byte1,objv_o1_CH1RANK1Byte2,objv_o1_CH1RANK1Byte3,objv_o1_CH1RANK1Byte4,objv_o1_CH1RANK1Byte5,objv_o1_CH1RANK1Byte6,objv_o1_CH1RANK1Byte7 +vacuity,15.0,3.0,20.0,60.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-25.6,-19.2,-19.2,-19.2,-25.600000000000005,-29.083333330000002,-25.6,-19.2,-25.600000000000005,-19.2,-25.6,-19.2,-25.6,-19.2,-25.600000000000005,-19.200000000000003,-32.0,-19.2,-19.2,-25.600000000000005,-25.600000000000005,-19.2,-25.6,-19.2,-25.6,-16.28333333,-19.2,-19.2,-32.0,-19.2,-25.6,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-25.6,-19.2,-19.2,-19.2,-25.600000000000005,-29.083333330000002,-25.6,-19.2,-25.600000000000005,-19.2,-25.6,-19.2,-25.6,-19.2,-25.600000000000005,-19.200000000000003,-32.0,-19.2,-19.2,-25.600000000000005,-25.600000000000005,-19.2,-25.6,-19.2,-25.6,-16.28333333,-19.2,-19.2,-32.0,-19.2,-25.6 +"iter(0, 'completed')",6.0,3.0,30.0,40.0,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-12.8,-12.8,-12.800000000000002,-12.800000000000002,-19.200000000000003,-19.2,-19.2,-19.2,-16.28333333,-16.28333333,-19.2,-12.800000000000002,-19.2,-16.28333333,-19.200000000000003,-12.800000000000006,-19.200000000000003,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-12.8,-12.8,-12.800000000000002,-12.800000000000002,-19.200000000000003,-19.2,-19.2,-19.2,-16.28333333,-16.28333333,-19.2,-12.800000000000002,-19.2,-16.28333333,-19.200000000000003,-12.800000000000006,-19.200000000000003,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996 +"iter(1, 'completed')",7.0,3.0,30.0,38.0,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-12.8,-12.8,-12.800000000000002,-12.800000000000002,-19.200000000000003,-19.2,-19.2,-19.2,-16.28333333,-16.28333333,-19.2,-12.800000000000002,-19.2,-16.28333333,-19.200000000000003,-12.800000000000006,-19.200000000000003,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-12.8,-12.8,-12.800000000000002,-12.800000000000002,-19.200000000000003,-19.2,-19.2,-19.2,-16.28333333,-16.28333333,-19.2,-12.800000000000002,-19.2,-16.28333333,-19.200000000000003,-12.800000000000006,-19.200000000000003,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996 +"iter(2, 'selection')",9.0,3.0,35.0,40.0,-5.0,0.0,-1.0000000000000004,-1.0000000000000004,0.0,0.0,0.0,0.0,0.0,0.0,-1.0000000000000004,-3.0,0.0,-1.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-12.800000000000002,-19.200000000000003,-19.2,-19.2,-12.8,-19.200000000000003,-12.800000000000002,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-19.200000000000003,-16.28333333,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-16.28333333,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996,-5.0,0.0,-1.0000000000000004,-1.0000000000000004,0.0,0.0,0.0,0.0,0.0,0.0,-1.0000000000000004,-3.0,0.0,-1.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-12.800000000000002,-19.200000000000003,-19.2,-19.2,-12.8,-19.200000000000003,-12.800000000000002,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-19.200000000000003,-16.28333333,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-16.28333333,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996 +"iter(2, 'completed')",9.0,3.0,35.0,34.0,-5.0,0.0,-1.0000000000000004,-1.0000000000000004,0.0,0.0,0.0,0.0,0.0,0.0,-1.0000000000000004,-3.0,0.0,-1.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-12.800000000000002,-19.200000000000003,-19.2,-19.2,-12.8,-19.200000000000003,-12.800000000000002,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-19.200000000000003,-16.28333333,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-16.28333333,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996,-5.0,0.0,-1.0000000000000004,-1.0000000000000004,0.0,0.0,0.0,0.0,0.0,0.0,-1.0000000000000004,-3.0,0.0,-1.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-12.800000000000002,-19.200000000000003,-19.2,-19.2,-12.8,-19.200000000000003,-12.800000000000002,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-19.200000000000003,-16.28333333,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-16.28333333,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996 +"iter(3, 'completed')",9.0,3.0,30.0,38.0,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-12.8,-12.8,-12.800000000000002,-12.800000000000002,-19.200000000000003,-19.2,-19.2,-19.2,-16.28333333,-16.28333333,-19.2,-12.800000000000002,-19.2,-16.28333333,-19.200000000000003,-12.800000000000006,-19.200000000000003,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-12.8,-12.8,-12.800000000000002,-12.800000000000002,-19.200000000000003,-19.2,-19.2,-19.2,-16.28333333,-16.28333333,-19.2,-12.800000000000002,-19.2,-16.28333333,-19.200000000000003,-12.800000000000006,-19.200000000000003,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996 +"iter(4, 'completed')",8.0,3.0,30.0,38.0,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-12.8,-12.8,-12.800000000000002,-12.800000000000002,-19.200000000000003,-19.2,-19.2,-19.2,-16.28333333,-16.28333333,-19.2,-12.800000000000002,-19.2,-16.28333333,-19.200000000000003,-12.800000000000006,-19.200000000000003,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-12.8,-12.8,-12.800000000000002,-12.800000000000002,-19.200000000000003,-19.2,-19.2,-19.2,-16.28333333,-16.28333333,-19.2,-12.800000000000002,-19.2,-16.28333333,-19.200000000000003,-12.800000000000006,-19.200000000000003,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996 +"iter(10, 'completed')",9.0,3.0,30.0,34.0,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-12.8,-12.8,-12.800000000000002,-12.800000000000002,-19.200000000000003,-19.2,-19.2,-19.2,-16.28333333,-16.28333333,-19.2,-12.800000000000002,-19.2,-16.28333333,-19.200000000000003,-12.800000000000006,-19.200000000000003,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-12.8,-12.8,-12.800000000000002,-12.800000000000002,-19.200000000000003,-19.2,-19.2,-19.2,-16.28333333,-16.28333333,-19.2,-12.800000000000002,-19.2,-16.28333333,-19.200000000000003,-12.800000000000006,-19.200000000000003,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996 +"iter(12, 'completed')",5.0,3.0,30.0,40.0,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-12.8,-12.8,-12.800000000000002,-12.800000000000002,-19.200000000000003,-19.2,-19.2,-19.2,-16.28333333,-16.28333333,-19.2,-12.800000000000002,-19.2,-16.28333333,-19.200000000000003,-12.800000000000006,-19.200000000000003,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-12.8,-12.8,-12.800000000000002,-12.800000000000002,-19.200000000000003,-19.2,-19.2,-19.2,-16.28333333,-16.28333333,-19.2,-12.800000000000002,-19.2,-16.28333333,-19.200000000000003,-12.800000000000006,-19.200000000000003,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996 +"iter(13, 'selection')",9.0,3.0,30.0,40.0,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-12.8,-12.8,-12.800000000000002,-12.800000000000002,-19.200000000000003,-19.2,-19.2,-19.2,-16.28333333,-16.28333333,-19.2,-12.800000000000002,-19.2,-16.28333333,-19.200000000000003,-12.800000000000006,-19.200000000000003,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-12.8,-12.8,-12.800000000000002,-12.800000000000002,-19.200000000000003,-19.2,-19.2,-19.2,-16.28333333,-16.28333333,-19.2,-12.800000000000002,-19.2,-16.28333333,-19.200000000000003,-12.800000000000006,-19.200000000000003,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996 +final,7.0,3.0,30.0,34.0,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-12.8,-12.8,-12.800000000000002,-12.800000000000002,-19.200000000000003,-19.2,-19.2,-19.2,-16.28333333,-16.28333333,-19.2,-12.800000000000002,-19.2,-16.28333333,-19.200000000000003,-12.800000000000006,-19.200000000000003,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-12.8,-12.8,-12.800000000000002,-12.800000000000002,-19.200000000000003,-19.2,-19.2,-19.2,-16.28333333,-16.28333333,-19.2,-12.800000000000002,-19.2,-16.28333333,-19.200000000000003,-12.800000000000006,-19.200000000000003,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996 diff --git a/tutorial/examples/si/smlp/results/NO_SPLIT_S2_TX_PIV_ANONYM_OPTIMIZATION_RESULTS_EXPECTED.json b/tutorial/examples/si/smlp/results/NO_SPLIT_S2_TX_PIV_ANONYM_OPTIMIZATION_RESULTS_EXPECTED.json new file mode 100644 index 00000000..da5a89ee --- /dev/null +++ b/tutorial/examples/si/smlp/results/NO_SPLIT_S2_TX_PIV_ANONYM_OPTIMIZATION_RESULTS_EXPECTED.json @@ -0,0 +1,679 @@ +{ + "objv_o0_CH0RANK0Byte0": { + "value_in_config": -0.9999999999999993, + "threshold_scaled": 0.9222914120756471, + "threshold": -1.0102116430165875, + "max_in_data": 0.0, + "min_in_data": -13.0 + }, + "objv_o0_CH0RANK0Byte1": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.05907572768853697, + "max_in_data": 0.0, + "min_in_data": -13.0 + }, + "objv_o0_CH0RANK0Byte2": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.04089858070744867, + "max_in_data": 0.0, + "min_in_data": -9.0 + }, + "objv_o0_CH0RANK0Byte3": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.04998715419799282, + "max_in_data": 0.0, + "min_in_data": -11.0 + }, + "objv_o0_CH0RANK0Byte4": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.04757300186456703, + "max_in_data": 0.0, + "min_in_data": -10.46875 + }, + "objv_o0_CH0RANK0Byte5": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.019313218667406318, + "max_in_data": 0.0, + "min_in_data": -4.25 + }, + "objv_o0_CH0RANK0Byte6": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.03181000721690452, + "max_in_data": 0.0, + "min_in_data": -7.0 + }, + "objv_o0_CH0RANK0Byte7": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.03181000721690452, + "max_in_data": 0.0, + "min_in_data": -7.0 + }, + "objv_o0_CH0RANK1Byte0": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.03181000721690452, + "max_in_data": 0.0, + "min_in_data": -7.0 + }, + "objv_o0_CH0RANK1Byte1": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.019313218667406318, + "max_in_data": 0.0, + "min_in_data": -4.25 + }, + "objv_o0_CH0RANK1Byte2": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.04089858070744867, + "max_in_data": 0.0, + "min_in_data": -9.0 + }, + "objv_o0_CH0RANK1Byte3": { + "value_in_config": -1.0, + "threshold_scaled": 0.8765869136390813, + "threshold": -1.0181579624775798, + "max_in_data": 0.0, + "min_in_data": -8.25 + }, + "objv_o0_CH0RANK1Byte4": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.022721433726360374, + "max_in_data": 0.0, + "min_in_data": -5.0 + }, + "objv_o0_CH0RANK1Byte5": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.03749036564849462, + "max_in_data": 0.0, + "min_in_data": -8.25 + }, + "objv_o0_CH0RANK1Byte6": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.03749036564849462, + "max_in_data": 0.0, + "min_in_data": -8.25 + }, + "objv_o0_CH0RANK1Byte7": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.03749036564849462, + "max_in_data": 0.0, + "min_in_data": -8.25 + }, + "objv_o0_CH1RANK0Byte0": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.019313218667406318, + "max_in_data": 0.0, + "min_in_data": -4.25 + }, + "objv_o0_CH1RANK0Byte1": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.03749036564849462, + "max_in_data": 0.0, + "min_in_data": -8.25 + }, + "objv_o0_CH1RANK0Byte2": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.013632860235816224, + "max_in_data": 0.0, + "min_in_data": -3.0 + }, + "objv_o0_CH1RANK0Byte3": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.004544286745272075, + "max_in_data": 0.0, + "min_in_data": -1.0 + }, + "objv_o0_CH1RANK0Byte4": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.03181000721690452, + "max_in_data": 0.0, + "min_in_data": -7.0 + }, + "objv_o0_CH1RANK0Byte5": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.03181000721690452, + "max_in_data": 0.0, + "min_in_data": -7.0 + }, + "objv_o0_CH1RANK0Byte6": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.02120667147945099, + "max_in_data": 0.0, + "min_in_data": -4.666666667 + }, + "objv_o0_CH1RANK0Byte7": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.022721433726360374, + "max_in_data": 0.0, + "min_in_data": -5.0 + }, + "objv_o0_CH1RANK1Byte0": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.022721433726360374, + "max_in_data": 0.0, + "min_in_data": -5.0 + }, + "objv_o0_CH1RANK1Byte1": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.04089858070744867, + "max_in_data": 0.0, + "min_in_data": -9.0 + }, + "objv_o0_CH1RANK1Byte2": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.03749036564849462, + "max_in_data": 0.0, + "min_in_data": -8.25 + }, + "objv_o0_CH1RANK1Byte3": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.03749036564849462, + "max_in_data": 0.0, + "min_in_data": -8.25 + }, + "objv_o0_CH1RANK1Byte4": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.022721433726360374, + "max_in_data": 0.0, + "min_in_data": -5.0 + }, + "objv_o0_CH1RANK1Byte5": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.022721433726360374, + "max_in_data": 0.0, + "min_in_data": -5.0 + }, + "objv_o0_CH1RANK1Byte6": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.022721433726360374, + "max_in_data": 0.0, + "min_in_data": -5.0 + }, + "objv_o0_CH1RANK1Byte7": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954557132547279, + "threshold": -0.03749036564849462, + "max_in_data": 0.0, + "min_in_data": -8.25 + }, + "objv_o1_CH0RANK0Byte0": { + "value_in_config": -19.2, + "threshold_scaled": 0.66505445034476, + "threshold": -19.23095455338061, + "max_in_data": -12.8, + "min_in_data": -32.0 + }, + "objv_o1_CH0RANK0Byte1": { + "value_in_config": -12.8, + "threshold_scaled": 0.7499631381518885, + "threshold": -12.801887326623309, + "max_in_data": 0.0, + "min_in_data": -51.2 + }, + "objv_o1_CH0RANK0Byte2": { + "value_in_config": -12.8, + "threshold_scaled": 0.9954557132547279, + "threshold": -12.887250305509223, + "max_in_data": -12.8, + "min_in_data": -32.0 + }, + "objv_o1_CH0RANK0Byte3": { + "value_in_config": -12.800000000000002, + "threshold_scaled": 0.9954557132547279, + "threshold": -12.903079570990108, + "max_in_data": -12.8, + "min_in_data": -35.48333333 + }, + "objv_o1_CH0RANK0Byte4": { + "value_in_config": -12.800000000000002, + "threshold_scaled": 0.9954557132547279, + "threshold": -12.903079570990108, + "max_in_data": -12.8, + "min_in_data": -35.48333333 + }, + "objv_o1_CH0RANK0Byte5": { + "value_in_config": -19.200000000000003, + "threshold_scaled": 0.5699497413635255, + "threshold": -19.266251586914056, + "max_in_data": 0.0, + "min_in_data": -44.8 + }, + "objv_o1_CH0RANK0Byte6": { + "value_in_config": -19.2, + "threshold_scaled": 0.7998935202040436, + "threshold": -19.203407353470606, + "max_in_data": -12.8, + "min_in_data": -44.8 + }, + "objv_o1_CH0RANK0Byte7": { + "value_in_config": -19.2, + "threshold_scaled": 0.9954557132547279, + "threshold": -19.28725030550922, + "max_in_data": -19.2, + "min_in_data": -38.4 + }, + "objv_o1_CH0RANK1Byte0": { + "value_in_config": -19.2, + "threshold_scaled": 0.7499631381518885, + "threshold": -19.200943663311655, + "max_in_data": -12.8, + "min_in_data": -38.4 + }, + "objv_o1_CH0RANK1Byte1": { + "value_in_config": -16.28333333, + "threshold_scaled": 0.6347224339842796, + "threshold": -16.364434957504272, + "max_in_data": 0.0, + "min_in_data": -44.8 + }, + "objv_o1_CH0RANK1Byte2": { + "value_in_config": -16.28333333, + "threshold_scaled": 0.8431069706327154, + "threshold": -16.358856882291594, + "max_in_data": -12.8, + "min_in_data": -35.48333333 + }, + "objv_o1_CH0RANK1Byte3": { + "value_in_config": -19.2, + "threshold_scaled": 0.7499631381518885, + "threshold": -19.200943663311655, + "max_in_data": -12.8, + "min_in_data": -38.4 + }, + "objv_o1_CH0RANK1Byte4": { + "value_in_config": -12.800000000000002, + "threshold_scaled": 0.9954557132547279, + "threshold": -12.903079570990108, + "max_in_data": -12.8, + "min_in_data": -35.48333333 + }, + "objv_o1_CH0RANK1Byte5": { + "value_in_config": -19.2, + "threshold_scaled": 0.49609375, + "threshold": -19.349999999999998, + "max_in_data": 0.0, + "min_in_data": -38.4 + }, + "objv_o1_CH0RANK1Byte6": { + "value_in_config": -16.28333333, + "threshold_scaled": 0.8170876751912908, + "threshold": -16.31191663632722, + "max_in_data": -12.8, + "min_in_data": -32.0 + }, + "objv_o1_CH0RANK1Byte7": { + "value_in_config": -19.200000000000003, + "threshold_scaled": 0.9954557132547279, + "threshold": -19.303079570990107, + "max_in_data": -19.2, + "min_in_data": -41.88333333 + }, + "objv_o1_CH1RANK0Byte0": { + "value_in_config": -12.800000000000006, + "threshold_scaled": 0.8431069706327154, + "threshold": -12.839807006703808, + "max_in_data": -8.083333333, + "min_in_data": -38.4 + }, + "objv_o1_CH1RANK0Byte1": { + "value_in_config": -19.200000000000003, + "threshold_scaled": 0.54007080078125, + "threshold": -19.26336795907888, + "max_in_data": 0.0, + "min_in_data": -41.88333333 + }, + "objv_o1_CH1RANK0Byte2": { + "value_in_config": -12.800000000000002, + "threshold_scaled": 0.9954557132547279, + "threshold": -12.903079570990108, + "max_in_data": -12.8, + "min_in_data": -35.48333333 + }, + "objv_o1_CH1RANK0Byte3": { + "value_in_config": -12.8, + "threshold_scaled": 0.9954557132547279, + "threshold": -12.945417175848707, + "max_in_data": -12.8, + "min_in_data": -44.8 + }, + "objv_o1_CH1RANK0Byte4": { + "value_in_config": -19.200000000000003, + "threshold_scaled": 0.54007080078125, + "threshold": -19.26336795907888, + "max_in_data": 0.0, + "min_in_data": -41.88333333 + }, + "objv_o1_CH1RANK0Byte5": { + "value_in_config": -19.200000000000003, + "threshold_scaled": 0.5699497413635255, + "threshold": -19.266251586914056, + "max_in_data": 0.0, + "min_in_data": -44.8 + }, + "objv_o1_CH1RANK0Byte6": { + "value_in_config": -12.800000000000002, + "threshold_scaled": 0.9954557132547279, + "threshold": -12.903079570990108, + "max_in_data": -12.8, + "min_in_data": -35.48333333 + }, + "objv_o1_CH1RANK0Byte7": { + "value_in_config": -19.2, + "threshold_scaled": 0.777935343950149, + "threshold": -19.25838041270962, + "max_in_data": -12.8, + "min_in_data": -41.88333333 + }, + "objv_o1_CH1RANK1Byte0": { + "value_in_config": -12.8, + "threshold_scaled": 0.9954557132547279, + "threshold": -12.887250305509223, + "max_in_data": -12.8, + "min_in_data": -32.0 + }, + "objv_o1_CH1RANK1Byte1": { + "value_in_config": -19.2, + "threshold_scaled": 0.7998935202040436, + "threshold": -19.26921330578698, + "max_in_data": -14.48333333, + "min_in_data": -38.4 + }, + "objv_o1_CH1RANK1Byte2": { + "value_in_config": -12.8, + "threshold_scaled": 0.9954557132547279, + "threshold": -12.887250305509223, + "max_in_data": -12.8, + "min_in_data": -32.0 + }, + "objv_o1_CH1RANK1Byte3": { + "value_in_config": -12.8, + "threshold_scaled": 0.9954557132547279, + "threshold": -12.916333740678965, + "max_in_data": -12.8, + "min_in_data": -38.4 + }, + "objv_o1_CH1RANK1Byte4": { + "value_in_config": -12.8, + "threshold_scaled": 0.9954557132547279, + "threshold": -12.916333740678965, + "max_in_data": -12.8, + "min_in_data": -38.4 + }, + "objv_o1_CH1RANK1Byte5": { + "value_in_config": -19.200000000000003, + "threshold_scaled": 0.54007080078125, + "threshold": -19.26336795907888, + "max_in_data": 0.0, + "min_in_data": -41.88333333 + }, + "objv_o1_CH1RANK1Byte6": { + "value_in_config": -12.800000000000002, + "threshold_scaled": 0.9954557132547279, + "threshold": -12.903079570990108, + "max_in_data": -12.8, + "min_in_data": -35.48333333 + }, + "objv_o1_CH1RANK1Byte7": { + "value_in_config": -19.199999999999996, + "threshold_scaled": 0.827647435341563, + "threshold": -19.205793601641172, + "max_in_data": -14.48333333, + "min_in_data": -41.88333333 + }, + "p1": { + "value_in_config": 3.0 + }, + "p2": { + "value_in_config": 30.0 + }, + "p3": { + "value_in_config": 34.0 + }, + "p0": { + "value_in_config": 7.0 + }, + "o0_CH1RANK0Byte2": { + "value_in_config": 0.0 + }, + "o0_CH1RANK1Byte7": { + "value_in_config": 0.0 + }, + "o0_CH0RANK0Byte4": { + "value_in_config": 0.0 + }, + "o1_CH0RANK1Byte6": { + "value_in_config": -16.28333333 + }, + "o1_CH1RANK1Byte1": { + "value_in_config": -19.2 + }, + "o1_CH0RANK1Byte5": { + "value_in_config": -19.2 + }, + "o1_CH0RANK0Byte1": { + "value_in_config": -12.8 + }, + "o0_CH0RANK1Byte6": { + "value_in_config": 0.0 + }, + "o0_CH0RANK0Byte3": { + "value_in_config": 0.0 + }, + "o0_CH0RANK1Byte5": { + "value_in_config": 0.0 + }, + "o0_CH1RANK0Byte1": { + "value_in_config": 0.0 + }, + "o0_CH0RANK0Byte7": { + "value_in_config": 0.0 + }, + "o0_CH0RANK1Byte1": { + "value_in_config": 0.0 + }, + "o0_CH0RANK1Byte2": { + "value_in_config": 0.0 + }, + "o1_CH0RANK1Byte0": { + "value_in_config": -19.2 + }, + "o1_CH1RANK1Byte5": { + "value_in_config": -19.200000000000003 + }, + "o0_CH1RANK0Byte4": { + "value_in_config": 0.0 + }, + "o1_CH0RANK0Byte3": { + "value_in_config": -12.800000000000002 + }, + "o0_CH0RANK0Byte5": { + "value_in_config": 0.0 + }, + "o0_CH1RANK1Byte3": { + "value_in_config": 0.0 + }, + "o1_CH0RANK0Byte4": { + "value_in_config": -12.800000000000002 + }, + "o1_CH0RANK0Byte7": { + "value_in_config": -19.2 + }, + "o0_CH0RANK1Byte3": { + "value_in_config": -1.0 + }, + "o0_CH1RANK1Byte1": { + "value_in_config": 0.0 + }, + "o1_CH0RANK1Byte2": { + "value_in_config": -16.28333333 + }, + "o0_CH1RANK0Byte3": { + "value_in_config": 0.0 + }, + "o0_CH1RANK0Byte7": { + "value_in_config": 0.0 + }, + "o0_CH1RANK1Byte4": { + "value_in_config": 0.0 + }, + "o1_CH0RANK0Byte5": { + "value_in_config": -19.200000000000003 + }, + "o1_CH1RANK0Byte0": { + "value_in_config": -12.800000000000006 + }, + "o0_CH1RANK0Byte0": { + "value_in_config": 0.0 + }, + "o0_CH0RANK1Byte0": { + "value_in_config": 0.0 + }, + "o1_CH1RANK0Byte4": { + "value_in_config": -19.200000000000003 + }, + "o1_CH1RANK0Byte6": { + "value_in_config": -12.800000000000002 + }, + "o1_CH1RANK0Byte5": { + "value_in_config": -19.200000000000003 + }, + "o1_CH0RANK1Byte1": { + "value_in_config": -16.28333333 + }, + "o1_CH1RANK1Byte4": { + "value_in_config": -12.8 + }, + "o0_CH1RANK1Byte2": { + "value_in_config": 0.0 + }, + "o0_CH0RANK0Byte6": { + "value_in_config": 0.0 + }, + "o1_CH0RANK1Byte7": { + "value_in_config": -19.200000000000003 + }, + "o1_CH1RANK0Byte2": { + "value_in_config": -12.800000000000002 + }, + "o1_CH0RANK1Byte4": { + "value_in_config": -12.800000000000002 + }, + "o0_CH0RANK1Byte4": { + "value_in_config": 0.0 + }, + "o0_CH1RANK1Byte6": { + "value_in_config": 0.0 + }, + "o0_CH1RANK0Byte6": { + "value_in_config": 0.0 + }, + "o0_CH1RANK0Byte5": { + "value_in_config": 0.0 + }, + "o1_CH1RANK0Byte7": { + "value_in_config": -19.2 + }, + "o1_CH1RANK1Byte0": { + "value_in_config": -12.8 + }, + "o1_CH1RANK1Byte3": { + "value_in_config": -12.8 + }, + "o1_CH1RANK1Byte7": { + "value_in_config": -19.199999999999996 + }, + "o1_CH1RANK1Byte6": { + "value_in_config": -12.800000000000002 + }, + "o1_CH0RANK1Byte3": { + "value_in_config": -19.2 + }, + "o0_CH0RANK0Byte1": { + "value_in_config": 0.0 + }, + "o0_CH1RANK1Byte0": { + "value_in_config": 0.0 + }, + "o0_CH0RANK0Byte2": { + "value_in_config": 0.0 + }, + "o0_CH1RANK1Byte5": { + "value_in_config": 0.0 + }, + "o1_CH0RANK0Byte0": { + "value_in_config": -19.2 + }, + "o1_CH1RANK1Byte2": { + "value_in_config": -12.8 + }, + "o0_CH0RANK1Byte7": { + "value_in_config": 0.0 + }, + "o0_CH0RANK0Byte0": { + "value_in_config": -0.9999999999999993 + }, + "o1_CH1RANK0Byte1": { + "value_in_config": -19.200000000000003 + }, + "o1_CH1RANK0Byte3": { + "value_in_config": -12.8 + }, + "o1_CH0RANK0Byte6": { + "value_in_config": -19.2 + }, + "o1_CH0RANK0Byte2": { + "value_in_config": -12.8 + }, + "objv_o0_CH0RANK0Byte1_scaled_objv_o0_CH0RANK0Byte2_scaled_objv_o0_CH0RANK0Byte3_scaled_objv_o0_CH0RANK0Byte4_scaled_objv_o0_CH0RANK0Byte5_scaled_objv_o0_CH0RANK0Byte6_scaled_objv_o0_CH0RANK0Byte7_scaled_objv_o0_CH0RANK1Byte0_scaled_objv_o0_CH0RANK1Byte1_scaled_objv_o0_CH0RANK1Byte2_scaled_objv_o0_CH0RANK1Byte4_scaled_objv_o0_CH0RANK1Byte5_scaled_objv_o0_CH0RANK1Byte6_scaled_objv_o0_CH0RANK1Byte7_scaled_objv_o0_CH1RANK0Byte0_scaled_objv_o0_CH1RANK0Byte1_scaled_objv_o0_CH1RANK0Byte2_scaled_objv_o0_CH1RANK0Byte3_scaled_objv_o0_CH1RANK0Byte4_scaled_objv_o0_CH1RANK0Byte5_scaled_objv_o0_CH1RANK0Byte6_scaled_objv_o0_CH1RANK0Byte7_scaled_objv_o0_CH1RANK1Byte0_scaled_objv_o0_CH1RANK1Byte1_scaled_objv_o0_CH1RANK1Byte2_scaled_objv_o0_CH1RANK1Byte3_scaled_objv_o0_CH1RANK1Byte4_scaled_objv_o0_CH1RANK1Byte5_scaled_objv_o0_CH1RANK1Byte6_scaled_objv_o0_CH1RANK1Byte7_scaled_objv_o1_CH0RANK0Byte2_scaled_objv_o1_CH0RANK0Byte3_scaled_objv_o1_CH0RANK0Byte4_scaled_objv_o1_CH0RANK0Byte7_scaled_objv_o1_CH0RANK1Byte4_scaled_objv_o1_CH0RANK1Byte7_scaled_objv_o1_CH1RANK0Byte2_scaled_objv_o1_CH1RANK0Byte3_scaled_objv_o1_CH1RANK0Byte6_scaled_objv_o1_CH1RANK1Byte0_scaled_objv_o1_CH1RANK1Byte2_scaled_objv_o1_CH1RANK1Byte3_scaled_objv_o1_CH1RANK1Byte4_scaled_objv_o1_CH1RANK1Byte6_scaled": { + "value_in_config": 0.9999999999999999 + }, + "threshold_lo_scaled": { + "value_in_config": 0.9954557132547279 + }, + "threshold_lo": { + "value_in_config": 0.9954557132547279 + }, + "threshold_up_scaled": { + "value_in_config": 1.0 + }, + "threshold_up": { + "value_in_config": 1.0 + }, + "max_in_data": { + "value_in_config": 1.0 + }, + "min_in_data": { + "value_in_config": 0.0 + }, + "smlp_execution": "completed", + "interface_consistent": "true", + "model_consistent": "true", + "synthesis_feasible": "true" +} \ No newline at end of file diff --git a/tutorial/examples/si/smlp/results/NO_SPLIT_S2_TX_PIV_ANONYM_OPTIMIZATION_RESULTS_RELATIVE_OPTIMIZED_MARGIN_EXPECTED.txt b/tutorial/examples/si/smlp/results/NO_SPLIT_S2_TX_PIV_ANONYM_OPTIMIZATION_RESULTS_RELATIVE_OPTIMIZED_MARGIN_EXPECTED.txt new file mode 100644 index 00000000..e564910e --- /dev/null +++ b/tutorial/examples/si/smlp/results/NO_SPLIT_S2_TX_PIV_ANONYM_OPTIMIZATION_RESULTS_RELATIVE_OPTIMIZED_MARGIN_EXPECTED.txt @@ -0,0 +1,64 @@ +o0_CH0RANK0Byte0 0.9222914120756471 +o0_CH0RANK0Byte1 0.9954557132547279 +o0_CH0RANK0Byte2 0.9954557132547279 +o0_CH0RANK0Byte3 0.9954557132547279 +o0_CH0RANK0Byte4 0.9954557132547279 +o0_CH0RANK0Byte5 0.9954557132547279 +o0_CH0RANK0Byte6 0.9954557132547279 +o0_CH0RANK0Byte7 0.9954557132547279 +o0_CH0RANK1Byte0 0.9954557132547279 +o0_CH0RANK1Byte1 0.9954557132547279 +o0_CH0RANK1Byte2 0.9954557132547279 +o0_CH0RANK1Byte3 0.8765869136390813 +o0_CH0RANK1Byte4 0.9954557132547279 +o0_CH0RANK1Byte5 0.9954557132547279 +o0_CH0RANK1Byte6 0.9954557132547279 +o0_CH0RANK1Byte7 0.9954557132547279 +o0_CH1RANK0Byte0 0.9954557132547279 +o0_CH1RANK0Byte1 0.9954557132547279 +o0_CH1RANK0Byte2 0.9954557132547279 +o0_CH1RANK0Byte3 0.9954557132547279 +o0_CH1RANK0Byte4 0.9954557132547279 +o0_CH1RANK0Byte5 0.9954557132547279 +o0_CH1RANK0Byte6 0.9954557132547279 +o0_CH1RANK0Byte7 0.9954557132547279 +o0_CH1RANK1Byte0 0.9954557132547279 +o0_CH1RANK1Byte1 0.9954557132547279 +o0_CH1RANK1Byte2 0.9954557132547279 +o0_CH1RANK1Byte3 0.9954557132547279 +o0_CH1RANK1Byte4 0.9954557132547279 +o0_CH1RANK1Byte5 0.9954557132547279 +o0_CH1RANK1Byte6 0.9954557132547279 +o0_CH1RANK1Byte7 0.9954557132547279 +o1_CH0RANK0Byte0 0.66505445034476 +o1_CH0RANK0Byte1 0.7499631381518885 +o1_CH0RANK0Byte2 0.9954557132547279 +o1_CH0RANK0Byte3 0.9954557132547279 +o1_CH0RANK0Byte4 0.9954557132547279 +o1_CH0RANK0Byte5 0.5699497413635255 +o1_CH0RANK0Byte6 0.7998935202040436 +o1_CH0RANK0Byte7 0.9954557132547279 +o1_CH0RANK1Byte0 0.7499631381518885 +o1_CH0RANK1Byte1 0.6347224339842796 +o1_CH0RANK1Byte2 0.8431069706327154 +o1_CH0RANK1Byte3 0.7499631381518885 +o1_CH0RANK1Byte4 0.9954557132547279 +o1_CH0RANK1Byte5 0.49609375 +o1_CH0RANK1Byte6 0.8170876751912908 +o1_CH0RANK1Byte7 0.9954557132547279 +o1_CH1RANK0Byte0 0.8431069706327154 +o1_CH1RANK0Byte1 0.54007080078125 +o1_CH1RANK0Byte2 0.9954557132547279 +o1_CH1RANK0Byte3 0.9954557132547279 +o1_CH1RANK0Byte4 0.54007080078125 +o1_CH1RANK0Byte5 0.5699497413635255 +o1_CH1RANK0Byte6 0.9954557132547279 +o1_CH1RANK0Byte7 0.777935343950149 +o1_CH1RANK1Byte0 0.9954557132547279 +o1_CH1RANK1Byte1 0.7998935202040436 +o1_CH1RANK1Byte2 0.9954557132547279 +o1_CH1RANK1Byte3 0.9954557132547279 +o1_CH1RANK1Byte4 0.9954557132547279 +o1_CH1RANK1Byte5 0.54007080078125 +o1_CH1RANK1Byte6 0.9954557132547279 +o1_CH1RANK1Byte7 0.827647435341563 diff --git a/tutorial/examples/si/smlp/results/SPLIT_S2_TX_PIV_ANONYM_OPTIMIZATION_RESULTS_EXPECTED.csv b/tutorial/examples/si/smlp/results/SPLIT_S2_TX_PIV_ANONYM_OPTIMIZATION_RESULTS_EXPECTED.csv new file mode 100644 index 00000000..029e5447 --- /dev/null +++ b/tutorial/examples/si/smlp/results/SPLIT_S2_TX_PIV_ANONYM_OPTIMIZATION_RESULTS_EXPECTED.csv @@ -0,0 +1,12 @@ +Iteration,p0,p1,p2,p3,o0_CH0RANK0Byte0,o0_CH0RANK0Byte1,o0_CH0RANK0Byte2,o0_CH0RANK0Byte3,o0_CH0RANK0Byte4,o0_CH0RANK0Byte5,o0_CH0RANK0Byte6,o0_CH0RANK0Byte7,o0_CH0RANK1Byte0,o0_CH0RANK1Byte1,o0_CH0RANK1Byte2,o0_CH0RANK1Byte3,o0_CH0RANK1Byte4,o0_CH0RANK1Byte5,o0_CH0RANK1Byte6,o0_CH0RANK1Byte7,o0_CH1RANK0Byte0,o0_CH1RANK0Byte1,o0_CH1RANK0Byte2,o0_CH1RANK0Byte3,o0_CH1RANK0Byte4,o0_CH1RANK0Byte5,o0_CH1RANK0Byte6,o0_CH1RANK0Byte7,o0_CH1RANK1Byte0,o0_CH1RANK1Byte1,o0_CH1RANK1Byte2,o0_CH1RANK1Byte3,o0_CH1RANK1Byte4,o0_CH1RANK1Byte5,o0_CH1RANK1Byte6,o0_CH1RANK1Byte7,o1_CH0RANK0Byte0,o1_CH0RANK0Byte1,o1_CH0RANK0Byte2,o1_CH0RANK0Byte3,o1_CH0RANK0Byte4,o1_CH0RANK0Byte5,o1_CH0RANK0Byte6,o1_CH0RANK0Byte7,o1_CH0RANK1Byte0,o1_CH0RANK1Byte1,o1_CH0RANK1Byte2,o1_CH0RANK1Byte3,o1_CH0RANK1Byte4,o1_CH0RANK1Byte5,o1_CH0RANK1Byte6,o1_CH0RANK1Byte7,o1_CH1RANK0Byte0,o1_CH1RANK0Byte1,o1_CH1RANK0Byte2,o1_CH1RANK0Byte3,o1_CH1RANK0Byte4,o1_CH1RANK0Byte5,o1_CH1RANK0Byte6,o1_CH1RANK0Byte7,o1_CH1RANK1Byte0,o1_CH1RANK1Byte1,o1_CH1RANK1Byte2,o1_CH1RANK1Byte3,o1_CH1RANK1Byte4,o1_CH1RANK1Byte5,o1_CH1RANK1Byte6,o1_CH1RANK1Byte7,objv_o0_CH0RANK0Byte0,objv_o0_CH0RANK0Byte1,objv_o0_CH0RANK0Byte2,objv_o0_CH0RANK0Byte3,objv_o0_CH0RANK0Byte4,objv_o0_CH0RANK0Byte5,objv_o0_CH0RANK0Byte6,objv_o0_CH0RANK0Byte7,objv_o0_CH0RANK1Byte0,objv_o0_CH0RANK1Byte1,objv_o0_CH0RANK1Byte2,objv_o0_CH0RANK1Byte3,objv_o0_CH0RANK1Byte4,objv_o0_CH0RANK1Byte5,objv_o0_CH0RANK1Byte6,objv_o0_CH0RANK1Byte7,objv_o0_CH1RANK0Byte0,objv_o0_CH1RANK0Byte1,objv_o0_CH1RANK0Byte2,objv_o0_CH1RANK0Byte3,objv_o0_CH1RANK0Byte4,objv_o0_CH1RANK0Byte5,objv_o0_CH1RANK0Byte6,objv_o0_CH1RANK0Byte7,objv_o0_CH1RANK1Byte0,objv_o0_CH1RANK1Byte1,objv_o0_CH1RANK1Byte2,objv_o0_CH1RANK1Byte3,objv_o0_CH1RANK1Byte4,objv_o0_CH1RANK1Byte5,objv_o0_CH1RANK1Byte6,objv_o0_CH1RANK1Byte7,objv_o1_CH0RANK0Byte0,objv_o1_CH0RANK0Byte1,objv_o1_CH0RANK0Byte2,objv_o1_CH0RANK0Byte3,objv_o1_CH0RANK0Byte4,objv_o1_CH0RANK0Byte5,objv_o1_CH0RANK0Byte6,objv_o1_CH0RANK0Byte7,objv_o1_CH0RANK1Byte0,objv_o1_CH0RANK1Byte1,objv_o1_CH0RANK1Byte2,objv_o1_CH0RANK1Byte3,objv_o1_CH0RANK1Byte4,objv_o1_CH0RANK1Byte5,objv_o1_CH0RANK1Byte6,objv_o1_CH0RANK1Byte7,objv_o1_CH1RANK0Byte0,objv_o1_CH1RANK0Byte1,objv_o1_CH1RANK0Byte2,objv_o1_CH1RANK0Byte3,objv_o1_CH1RANK0Byte4,objv_o1_CH1RANK0Byte5,objv_o1_CH1RANK0Byte6,objv_o1_CH1RANK0Byte7,objv_o1_CH1RANK1Byte0,objv_o1_CH1RANK1Byte1,objv_o1_CH1RANK1Byte2,objv_o1_CH1RANK1Byte3,objv_o1_CH1RANK1Byte4,objv_o1_CH1RANK1Byte5,objv_o1_CH1RANK1Byte6,objv_o1_CH1RANK1Byte7 +vacuity,11.0,2.0,45.0,240.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-25.6,-32.0,-25.6,-32.0,-32.0,-32.0,-32.0,-32.0,-32.0,-38.4,-25.6,-26.56666667,-32.0,-32.0,-32.0,-32.0,-25.600000000000005,-38.4,-25.6,-32.0,-38.4,-38.4,-32.0,-31.999999999999996,-25.6,-32.0,-25.6,-32.0,-32.0,-38.4,-32.0,-31.999999999999996,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-25.6,-32.0,-25.6,-32.0,-32.0,-32.0,-32.0,-32.0,-32.0,-38.4,-25.6,-26.56666667,-32.0,-32.0,-32.0,-32.0,-25.600000000000005,-38.4,-25.6,-32.0,-38.4,-38.4,-32.0,-31.999999999999996,-25.6,-32.0,-25.6,-32.0,-32.0,-38.4,-32.0,-31.999999999999996 +"iter(4, 'completed')",12.0,3.0,30.0,34.0,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-19.2,-19.200000000000003,-19.2,-19.2,-19.2,-19.200000000000003,-19.2,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-22.683333330000004,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-19.2,-19.200000000000003,-19.2,-19.2,-19.2,-19.200000000000003,-19.2,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-22.683333330000004,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996 +"iter(5, 'selection')",7.0,3.0,30.0,38.0,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-19.2,-19.200000000000003,-19.2,-19.2,-19.2,-19.200000000000003,-19.2,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-22.683333330000004,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-19.2,-19.200000000000003,-19.2,-19.2,-19.2,-19.200000000000003,-19.2,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-22.683333330000004,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996 +"iter(5, 'completed')",13.0,3.0,30.0,34.0,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-19.2,-19.200000000000003,-19.2,-19.2,-19.2,-19.200000000000003,-19.2,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-22.683333330000004,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-19.2,-19.200000000000003,-19.2,-19.2,-19.2,-19.200000000000003,-19.2,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-22.683333330000004,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996 +"iter(6, 'completed')",10.0,3.0,30.0,40.0,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-19.2,-19.200000000000003,-19.2,-19.2,-19.2,-19.200000000000003,-19.2,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-22.683333330000004,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-19.2,-19.200000000000003,-19.2,-19.2,-19.2,-19.200000000000003,-19.2,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-22.683333330000004,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996 +"iter(12, 'completed')",11.0,3.0,30.0,40.0,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-19.2,-19.200000000000003,-19.2,-19.2,-19.2,-19.200000000000003,-19.2,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-22.683333330000004,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-19.2,-19.200000000000003,-19.2,-19.2,-19.2,-19.200000000000003,-19.2,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-22.683333330000004,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996 +"iter(13, 'completed')",15.0,3.0,30.0,34.0,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-19.2,-19.200000000000003,-19.2,-19.2,-19.2,-19.200000000000003,-19.2,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-22.683333330000004,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-19.2,-19.200000000000003,-19.2,-19.2,-19.2,-19.200000000000003,-19.2,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-22.683333330000004,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996 +"iter(14, 'selection')",15.0,3.0,30.0,40.0,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-19.2,-19.200000000000003,-19.2,-19.2,-19.2,-19.200000000000003,-19.2,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-22.683333330000004,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-19.2,-19.200000000000003,-19.2,-19.2,-19.2,-19.200000000000003,-19.2,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-22.683333330000004,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996 +"iter(14, 'completed')",7.0,3.0,30.0,34.0,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-19.2,-19.200000000000003,-19.2,-19.2,-19.2,-19.200000000000003,-19.2,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-22.683333330000004,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-19.2,-19.200000000000003,-19.2,-19.2,-19.2,-19.200000000000003,-19.2,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-22.683333330000004,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996 +"iter(15, 'selection')",13.0,3.0,30.0,40.0,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-19.2,-19.200000000000003,-19.2,-19.2,-19.2,-19.200000000000003,-19.2,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-22.683333330000004,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-19.2,-19.200000000000003,-19.2,-19.2,-19.2,-19.200000000000003,-19.2,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-22.683333330000004,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996 +final,15.0,3.0,30.0,38.0,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-19.2,-19.200000000000003,-19.2,-19.2,-19.2,-19.200000000000003,-19.2,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-22.683333330000004,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996,-0.9999999999999993,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-19.2,-19.2,-12.8,-12.800000000000002,-19.2,-19.200000000000003,-19.2,-19.2,-19.2,-19.200000000000003,-19.2,-19.2,-12.800000000000002,-19.2,-12.8,-19.200000000000003,-12.800000000000006,-22.683333330000004,-12.800000000000002,-12.8,-19.200000000000003,-19.200000000000003,-12.800000000000002,-19.2,-12.8,-19.2,-12.8,-12.8,-12.8,-19.200000000000003,-12.800000000000002,-19.199999999999996 diff --git a/tutorial/examples/si/smlp/results/SPLIT_S2_TX_PIV_ANONYM_OPTIMIZATION_RESULTS_EXPECTED.json b/tutorial/examples/si/smlp/results/SPLIT_S2_TX_PIV_ANONYM_OPTIMIZATION_RESULTS_EXPECTED.json new file mode 100644 index 00000000..dd7663b2 --- /dev/null +++ b/tutorial/examples/si/smlp/results/SPLIT_S2_TX_PIV_ANONYM_OPTIMIZATION_RESULTS_EXPECTED.json @@ -0,0 +1,679 @@ +{ + "objv_o0_CH0RANK0Byte0": { + "value_in_config": -0.9999999999999993, + "threshold_scaled": 0.9226595760856392, + "threshold": -1.00542551088669, + "max_in_data": 0.0, + "min_in_data": -13.0 + }, + "objv_o0_CH0RANK0Byte1": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.05877659443041949, + "max_in_data": 0.0, + "min_in_data": -13.0 + }, + "objv_o0_CH0RANK0Byte2": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.040691488451829017, + "max_in_data": 0.0, + "min_in_data": -9.0 + }, + "objv_o0_CH0RANK0Byte3": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.04973404144112337, + "max_in_data": 0.0, + "min_in_data": -11.0 + }, + "objv_o0_CH0RANK0Byte4": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.04733211330334264, + "max_in_data": 0.0, + "min_in_data": -10.46875 + }, + "objv_o0_CH0RANK0Byte5": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.01921542510225205, + "max_in_data": 0.0, + "min_in_data": -4.25 + }, + "objv_o0_CH0RANK0Byte6": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.03164893546253289, + "max_in_data": 0.0, + "min_in_data": -7.0 + }, + "objv_o0_CH0RANK0Byte7": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.03164893546253289, + "max_in_data": 0.0, + "min_in_data": -7.0 + }, + "objv_o0_CH0RANK1Byte0": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.03164893546253289, + "max_in_data": 0.0, + "min_in_data": -7.0 + }, + "objv_o0_CH0RANK1Byte1": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.01921542510225205, + "max_in_data": 0.0, + "min_in_data": -4.25 + }, + "objv_o0_CH0RANK1Byte2": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.040691488451829017, + "max_in_data": 0.0, + "min_in_data": -9.0 + }, + "objv_o0_CH0RANK1Byte3": { + "value_in_config": -1.0, + "threshold_scaled": 0.8771479254638311, + "threshold": -1.0135296149233932, + "max_in_data": 0.0, + "min_in_data": -8.25 + }, + "objv_o0_CH0RANK1Byte4": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.02260638247323854, + "max_in_data": 0.0, + "min_in_data": -5.0 + }, + "objv_o0_CH0RANK1Byte5": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.03730053108084341, + "max_in_data": 0.0, + "min_in_data": -8.25 + }, + "objv_o0_CH0RANK1Byte6": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.03730053108084341, + "max_in_data": 0.0, + "min_in_data": -8.25 + }, + "objv_o0_CH0RANK1Byte7": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.03730053108084341, + "max_in_data": 0.0, + "min_in_data": -8.25 + }, + "objv_o0_CH1RANK0Byte0": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.01921542510225205, + "max_in_data": 0.0, + "min_in_data": -4.25 + }, + "objv_o0_CH1RANK0Byte1": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.03730053108084341, + "max_in_data": 0.0, + "min_in_data": -8.25 + }, + "objv_o0_CH1RANK0Byte2": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.013563829483942857, + "max_in_data": 0.0, + "min_in_data": -3.0 + }, + "objv_o0_CH1RANK0Byte3": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.004521276494647619, + "max_in_data": 0.0, + "min_in_data": -1.0 + }, + "objv_o0_CH1RANK0Byte4": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.03164893546253289, + "max_in_data": 0.0, + "min_in_data": -7.0 + }, + "objv_o0_CH1RANK0Byte5": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.03164893546253289, + "max_in_data": 0.0, + "min_in_data": -7.0 + }, + "objv_o0_CH1RANK0Byte6": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.021099290309862795, + "max_in_data": 0.0, + "min_in_data": -4.666666667 + }, + "objv_o0_CH1RANK0Byte7": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.02260638247323854, + "max_in_data": 0.0, + "min_in_data": -5.0 + }, + "objv_o0_CH1RANK1Byte0": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.02260638247323854, + "max_in_data": 0.0, + "min_in_data": -5.0 + }, + "objv_o0_CH1RANK1Byte1": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.040691488451829017, + "max_in_data": 0.0, + "min_in_data": -9.0 + }, + "objv_o0_CH1RANK1Byte2": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.03730053108084341, + "max_in_data": 0.0, + "min_in_data": -8.25 + }, + "objv_o0_CH1RANK1Byte3": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.03730053108084341, + "max_in_data": 0.0, + "min_in_data": -8.25 + }, + "objv_o0_CH1RANK1Byte4": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.02260638247323854, + "max_in_data": 0.0, + "min_in_data": -5.0 + }, + "objv_o0_CH1RANK1Byte5": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.02260638247323854, + "max_in_data": 0.0, + "min_in_data": -5.0 + }, + "objv_o0_CH1RANK1Byte6": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.02260638247323854, + "max_in_data": 0.0, + "min_in_data": -5.0 + }, + "objv_o0_CH1RANK1Byte7": { + "value_in_config": 0.0, + "threshold_scaled": 0.9954787235053524, + "threshold": -0.03730053108084341, + "max_in_data": 0.0, + "min_in_data": -8.25 + }, + "objv_o1_CH0RANK0Byte0": { + "value_in_config": -19.2, + "threshold_scaled": 0.6641686071708864, + "threshold": -19.247962742318983, + "max_in_data": -12.8, + "min_in_data": -32.0 + }, + "objv_o1_CH0RANK0Byte1": { + "value_in_config": -19.2, + "threshold_scaled": 0.6244274286023574, + "threshold": -19.2293156555593, + "max_in_data": 0.0, + "min_in_data": -51.2 + }, + "objv_o1_CH0RANK0Byte2": { + "value_in_config": -12.8, + "threshold_scaled": 0.9954787235053524, + "threshold": -12.886808508697236, + "max_in_data": -12.8, + "min_in_data": -32.0 + }, + "objv_o1_CH0RANK0Byte3": { + "value_in_config": -12.800000000000002, + "threshold_scaled": 0.9954787235053524, + "threshold": -12.902557621805187, + "max_in_data": -12.8, + "min_in_data": -35.48333333 + }, + "objv_o1_CH0RANK0Byte4": { + "value_in_config": -19.2, + "threshold_scaled": 0.7156917717874804, + "threshold": -19.24905830900629, + "max_in_data": -12.8, + "min_in_data": -35.48333333 + }, + "objv_o1_CH0RANK0Byte5": { + "value_in_config": -19.200000000000003, + "threshold_scaled": 0.5695726624876262, + "threshold": -19.283144720554347, + "max_in_data": 0.0, + "min_in_data": -44.8 + }, + "objv_o1_CH0RANK0Byte6": { + "value_in_config": -19.2, + "threshold_scaled": 0.7975144189901908, + "threshold": -19.279538592313894, + "max_in_data": -12.8, + "min_in_data": -44.8 + }, + "objv_o1_CH0RANK0Byte7": { + "value_in_config": -19.2, + "threshold_scaled": 0.9954787235053524, + "threshold": -19.286808508697234, + "max_in_data": -19.2, + "min_in_data": -38.4 + }, + "objv_o1_CH0RANK1Byte0": { + "value_in_config": -19.2, + "threshold_scaled": 0.7468769181824042, + "threshold": -19.27995089453045, + "max_in_data": -12.8, + "min_in_data": -38.4 + }, + "objv_o1_CH0RANK1Byte1": { + "value_in_config": -19.200000000000003, + "threshold_scaled": 0.5695726624876262, + "threshold": -19.283144720554347, + "max_in_data": 0.0, + "min_in_data": -44.8 + }, + "objv_o1_CH0RANK1Byte2": { + "value_in_config": -19.2, + "threshold_scaled": 0.7156917717874804, + "threshold": -19.24905830900629, + "max_in_data": -12.8, + "min_in_data": -35.48333333 + }, + "objv_o1_CH0RANK1Byte3": { + "value_in_config": -19.2, + "threshold_scaled": 0.7468769181824042, + "threshold": -19.27995089453045, + "max_in_data": -12.8, + "min_in_data": -38.4 + }, + "objv_o1_CH0RANK1Byte4": { + "value_in_config": -12.800000000000002, + "threshold_scaled": 0.9954787235053524, + "threshold": -12.902557621805187, + "max_in_data": -12.8, + "min_in_data": -35.48333333 + }, + "objv_o1_CH0RANK1Byte5": { + "value_in_config": -19.2, + "threshold_scaled": 0.499857177734375, + "threshold": -19.205484375, + "max_in_data": 0.0, + "min_in_data": -38.4 + }, + "objv_o1_CH0RANK1Byte6": { + "value_in_config": -12.8, + "threshold_scaled": 0.9954787235053524, + "threshold": -12.886808508697236, + "max_in_data": -12.8, + "min_in_data": -32.0 + }, + "objv_o1_CH0RANK1Byte7": { + "value_in_config": -19.200000000000003, + "threshold_scaled": 0.9954787235053524, + "threshold": -19.302557621805185, + "max_in_data": -19.2, + "min_in_data": -41.88333333 + }, + "objv_o1_CH1RANK0Byte0": { + "value_in_config": -12.800000000000006, + "threshold_scaled": 0.8437974467247151, + "threshold": -12.81887407318112, + "max_in_data": -8.083333333, + "min_in_data": -38.4 + }, + "objv_o1_CH1RANK0Byte1": { + "value_in_config": -22.683333330000004, + "threshold_scaled": 0.45703125, + "threshold": -22.741341144023437, + "max_in_data": 0.0, + "min_in_data": -41.88333333 + }, + "objv_o1_CH1RANK0Byte2": { + "value_in_config": -12.800000000000002, + "threshold_scaled": 0.9954787235053524, + "threshold": -12.902557621805187, + "max_in_data": -12.8, + "min_in_data": -35.48333333 + }, + "objv_o1_CH1RANK0Byte3": { + "value_in_config": -12.8, + "threshold_scaled": 0.9954787235053524, + "threshold": -12.944680847828725, + "max_in_data": -12.8, + "min_in_data": -44.8 + }, + "objv_o1_CH1RANK0Byte4": { + "value_in_config": -19.200000000000003, + "threshold_scaled": 0.5396719074249268, + "threshold": -19.28007494248489, + "max_in_data": 0.0, + "min_in_data": -41.88333333 + }, + "objv_o1_CH1RANK0Byte5": { + "value_in_config": -19.200000000000003, + "threshold_scaled": 0.5695726624876262, + "threshold": -19.283144720554347, + "max_in_data": 0.0, + "min_in_data": -44.8 + }, + "objv_o1_CH1RANK0Byte6": { + "value_in_config": -12.800000000000002, + "threshold_scaled": 0.9954787235053524, + "threshold": -12.902557621805187, + "max_in_data": -12.8, + "min_in_data": -35.48333333 + }, + "objv_o1_CH1RANK0Byte7": { + "value_in_config": -19.2, + "threshold_scaled": 0.7790153802562036, + "threshold": -19.22696935681213, + "max_in_data": -12.8, + "min_in_data": -41.88333333 + }, + "objv_o1_CH1RANK1Byte0": { + "value_in_config": -12.8, + "threshold_scaled": 0.9954787235053524, + "threshold": -12.886808508697236, + "max_in_data": -12.8, + "min_in_data": -32.0 + }, + "objv_o1_CH1RANK1Byte1": { + "value_in_config": -19.2, + "threshold_scaled": 0.8025144189901908, + "threshold": -19.20653014314289, + "max_in_data": -14.48333333, + "min_in_data": -38.4 + }, + "objv_o1_CH1RANK1Byte2": { + "value_in_config": -12.8, + "threshold_scaled": 0.9954787235053524, + "threshold": -12.886808508697236, + "max_in_data": -12.8, + "min_in_data": -32.0 + }, + "objv_o1_CH1RANK1Byte3": { + "value_in_config": -12.8, + "threshold_scaled": 0.9954787235053524, + "threshold": -12.915744678262978, + "max_in_data": -12.8, + "min_in_data": -38.4 + }, + "objv_o1_CH1RANK1Byte4": { + "value_in_config": -12.8, + "threshold_scaled": 0.9954787235053524, + "threshold": -12.915744678262978, + "max_in_data": -12.8, + "min_in_data": -38.4 + }, + "objv_o1_CH1RANK1Byte5": { + "value_in_config": -19.200000000000003, + "threshold_scaled": 0.5396719074249268, + "threshold": -19.28007494248489, + "max_in_data": 0.0, + "min_in_data": -41.88333333 + }, + "objv_o1_CH1RANK1Byte6": { + "value_in_config": -12.800000000000002, + "threshold_scaled": 0.9954787235053524, + "threshold": -12.902557621805187, + "max_in_data": -12.8, + "min_in_data": -35.48333333 + }, + "objv_o1_CH1RANK1Byte7": { + "value_in_config": -19.199999999999996, + "threshold_scaled": 0.8255599422098604, + "threshold": -19.262990913449826, + "max_in_data": -14.48333333, + "min_in_data": -41.88333333 + }, + "p1": { + "value_in_config": 3.0 + }, + "p2": { + "value_in_config": 30.0 + }, + "p3": { + "value_in_config": 38.0 + }, + "p0": { + "value_in_config": 15.0 + }, + "o0_CH1RANK0Byte2": { + "value_in_config": 0.0 + }, + "o0_CH1RANK1Byte7": { + "value_in_config": 0.0 + }, + "o0_CH0RANK0Byte4": { + "value_in_config": 0.0 + }, + "o1_CH0RANK1Byte6": { + "value_in_config": -12.8 + }, + "o1_CH1RANK1Byte1": { + "value_in_config": -19.2 + }, + "o1_CH0RANK1Byte5": { + "value_in_config": -19.2 + }, + "o1_CH0RANK0Byte1": { + "value_in_config": -19.2 + }, + "o0_CH0RANK1Byte6": { + "value_in_config": 0.0 + }, + "o0_CH0RANK0Byte3": { + "value_in_config": 0.0 + }, + "o0_CH0RANK1Byte5": { + "value_in_config": 0.0 + }, + "o0_CH1RANK0Byte1": { + "value_in_config": 0.0 + }, + "o0_CH0RANK0Byte7": { + "value_in_config": 0.0 + }, + "o0_CH0RANK1Byte1": { + "value_in_config": 0.0 + }, + "o0_CH0RANK1Byte2": { + "value_in_config": 0.0 + }, + "o1_CH0RANK1Byte0": { + "value_in_config": -19.2 + }, + "o1_CH1RANK1Byte5": { + "value_in_config": -19.200000000000003 + }, + "o0_CH1RANK0Byte4": { + "value_in_config": 0.0 + }, + "o1_CH0RANK0Byte3": { + "value_in_config": -12.800000000000002 + }, + "o0_CH0RANK0Byte5": { + "value_in_config": 0.0 + }, + "o0_CH1RANK1Byte3": { + "value_in_config": 0.0 + }, + "o1_CH0RANK0Byte4": { + "value_in_config": -19.2 + }, + "o1_CH0RANK0Byte7": { + "value_in_config": -19.2 + }, + "o0_CH0RANK1Byte3": { + "value_in_config": -1.0 + }, + "o0_CH1RANK1Byte1": { + "value_in_config": 0.0 + }, + "o1_CH0RANK1Byte2": { + "value_in_config": -19.2 + }, + "o0_CH1RANK0Byte3": { + "value_in_config": 0.0 + }, + "o0_CH1RANK0Byte7": { + "value_in_config": 0.0 + }, + "o0_CH1RANK1Byte4": { + "value_in_config": 0.0 + }, + "o1_CH0RANK0Byte5": { + "value_in_config": -19.200000000000003 + }, + "o1_CH1RANK0Byte0": { + "value_in_config": -12.800000000000006 + }, + "o0_CH1RANK0Byte0": { + "value_in_config": 0.0 + }, + "o0_CH0RANK1Byte0": { + "value_in_config": 0.0 + }, + "o1_CH1RANK0Byte4": { + "value_in_config": -19.200000000000003 + }, + "o1_CH1RANK0Byte6": { + "value_in_config": -12.800000000000002 + }, + "o1_CH1RANK0Byte5": { + "value_in_config": -19.200000000000003 + }, + "o1_CH0RANK1Byte1": { + "value_in_config": -19.200000000000003 + }, + "o1_CH1RANK1Byte4": { + "value_in_config": -12.8 + }, + "o0_CH1RANK1Byte2": { + "value_in_config": 0.0 + }, + "o0_CH0RANK0Byte6": { + "value_in_config": 0.0 + }, + "o1_CH0RANK1Byte7": { + "value_in_config": -19.200000000000003 + }, + "o1_CH1RANK0Byte2": { + "value_in_config": -12.800000000000002 + }, + "o1_CH0RANK1Byte4": { + "value_in_config": -12.800000000000002 + }, + "o0_CH0RANK1Byte4": { + "value_in_config": 0.0 + }, + "o0_CH1RANK1Byte6": { + "value_in_config": 0.0 + }, + "o0_CH1RANK0Byte6": { + "value_in_config": 0.0 + }, + "o0_CH1RANK0Byte5": { + "value_in_config": 0.0 + }, + "o1_CH1RANK0Byte7": { + "value_in_config": -19.2 + }, + "o1_CH1RANK1Byte0": { + "value_in_config": -12.8 + }, + "o1_CH1RANK1Byte3": { + "value_in_config": -12.8 + }, + "o1_CH1RANK1Byte7": { + "value_in_config": -19.199999999999996 + }, + "o1_CH1RANK1Byte6": { + "value_in_config": -12.800000000000002 + }, + "o1_CH0RANK1Byte3": { + "value_in_config": -19.2 + }, + "o0_CH0RANK0Byte1": { + "value_in_config": 0.0 + }, + "o0_CH1RANK1Byte0": { + "value_in_config": 0.0 + }, + "o0_CH0RANK0Byte2": { + "value_in_config": 0.0 + }, + "o0_CH1RANK1Byte5": { + "value_in_config": 0.0 + }, + "o1_CH0RANK0Byte0": { + "value_in_config": -19.2 + }, + "o1_CH1RANK1Byte2": { + "value_in_config": -12.8 + }, + "o0_CH0RANK1Byte7": { + "value_in_config": 0.0 + }, + "o0_CH0RANK0Byte0": { + "value_in_config": -0.9999999999999993 + }, + "o1_CH1RANK0Byte1": { + "value_in_config": -22.683333330000004 + }, + "o1_CH1RANK0Byte3": { + "value_in_config": -12.8 + }, + "o1_CH0RANK0Byte6": { + "value_in_config": -19.2 + }, + "o1_CH0RANK0Byte2": { + "value_in_config": -12.8 + }, + "objv_o0_CH0RANK0Byte1_scaled_objv_o0_CH0RANK0Byte2_scaled_objv_o0_CH0RANK0Byte3_scaled_objv_o0_CH0RANK0Byte4_scaled_objv_o0_CH0RANK0Byte5_scaled_objv_o0_CH0RANK0Byte6_scaled_objv_o0_CH0RANK0Byte7_scaled_objv_o0_CH0RANK1Byte0_scaled_objv_o0_CH0RANK1Byte1_scaled_objv_o0_CH0RANK1Byte2_scaled_objv_o0_CH0RANK1Byte4_scaled_objv_o0_CH0RANK1Byte5_scaled_objv_o0_CH0RANK1Byte6_scaled_objv_o0_CH0RANK1Byte7_scaled_objv_o0_CH1RANK0Byte0_scaled_objv_o0_CH1RANK0Byte1_scaled_objv_o0_CH1RANK0Byte2_scaled_objv_o0_CH1RANK0Byte3_scaled_objv_o0_CH1RANK0Byte4_scaled_objv_o0_CH1RANK0Byte5_scaled_objv_o0_CH1RANK0Byte6_scaled_objv_o0_CH1RANK0Byte7_scaled_objv_o0_CH1RANK1Byte0_scaled_objv_o0_CH1RANK1Byte1_scaled_objv_o0_CH1RANK1Byte2_scaled_objv_o0_CH1RANK1Byte3_scaled_objv_o0_CH1RANK1Byte4_scaled_objv_o0_CH1RANK1Byte5_scaled_objv_o0_CH1RANK1Byte6_scaled_objv_o0_CH1RANK1Byte7_scaled_objv_o1_CH0RANK0Byte2_scaled_objv_o1_CH0RANK0Byte3_scaled_objv_o1_CH0RANK0Byte7_scaled_objv_o1_CH0RANK1Byte4_scaled_objv_o1_CH0RANK1Byte6_scaled_objv_o1_CH0RANK1Byte7_scaled_objv_o1_CH1RANK0Byte2_scaled_objv_o1_CH1RANK0Byte3_scaled_objv_o1_CH1RANK0Byte6_scaled_objv_o1_CH1RANK1Byte0_scaled_objv_o1_CH1RANK1Byte2_scaled_objv_o1_CH1RANK1Byte3_scaled_objv_o1_CH1RANK1Byte4_scaled_objv_o1_CH1RANK1Byte6_scaled": { + "value_in_config": 0.9999999999999999 + }, + "threshold_lo_scaled": { + "value_in_config": 0.9954787235053524 + }, + "threshold_lo": { + "value_in_config": 0.9954787235053524 + }, + "threshold_up_scaled": { + "value_in_config": 1.0 + }, + "threshold_up": { + "value_in_config": 1.0 + }, + "max_in_data": { + "value_in_config": 1.0 + }, + "min_in_data": { + "value_in_config": 0.0 + }, + "smlp_execution": "completed", + "interface_consistent": "true", + "model_consistent": "true", + "synthesis_feasible": "true" +} \ No newline at end of file diff --git a/tutorial/examples/si/smlp/results/SPLIT_S2_TX_PIV_ANONYM_OPTIMIZATION_RESULTS_RELATIVE_OPTIMIZED_MARGIN_EXPECTED.txt b/tutorial/examples/si/smlp/results/SPLIT_S2_TX_PIV_ANONYM_OPTIMIZATION_RESULTS_RELATIVE_OPTIMIZED_MARGIN_EXPECTED.txt new file mode 100644 index 00000000..a65d188e --- /dev/null +++ b/tutorial/examples/si/smlp/results/SPLIT_S2_TX_PIV_ANONYM_OPTIMIZATION_RESULTS_RELATIVE_OPTIMIZED_MARGIN_EXPECTED.txt @@ -0,0 +1,64 @@ +o0_CH0RANK0Byte0 0.9226595760856392 +o0_CH0RANK0Byte1 0.9954787235053524 +o0_CH0RANK0Byte2 0.9954787235053524 +o0_CH0RANK0Byte3 0.9954787235053524 +o0_CH0RANK0Byte4 0.9954787235053524 +o0_CH0RANK0Byte5 0.9954787235053524 +o0_CH0RANK0Byte6 0.9954787235053524 +o0_CH0RANK0Byte7 0.9954787235053524 +o0_CH0RANK1Byte0 0.9954787235053524 +o0_CH0RANK1Byte1 0.9954787235053524 +o0_CH0RANK1Byte2 0.9954787235053524 +o0_CH0RANK1Byte3 0.8771479254638311 +o0_CH0RANK1Byte4 0.9954787235053524 +o0_CH0RANK1Byte5 0.9954787235053524 +o0_CH0RANK1Byte6 0.9954787235053524 +o0_CH0RANK1Byte7 0.9954787235053524 +o0_CH1RANK0Byte0 0.9954787235053524 +o0_CH1RANK0Byte1 0.9954787235053524 +o0_CH1RANK0Byte2 0.9954787235053524 +o0_CH1RANK0Byte3 0.9954787235053524 +o0_CH1RANK0Byte4 0.9954787235053524 +o0_CH1RANK0Byte5 0.9954787235053524 +o0_CH1RANK0Byte6 0.9954787235053524 +o0_CH1RANK0Byte7 0.9954787235053524 +o0_CH1RANK1Byte0 0.9954787235053524 +o0_CH1RANK1Byte1 0.9954787235053524 +o0_CH1RANK1Byte2 0.9954787235053524 +o0_CH1RANK1Byte3 0.9954787235053524 +o0_CH1RANK1Byte4 0.9954787235053524 +o0_CH1RANK1Byte5 0.9954787235053524 +o0_CH1RANK1Byte6 0.9954787235053524 +o0_CH1RANK1Byte7 0.9954787235053524 +o1_CH0RANK0Byte0 0.6641686071708864 +o1_CH0RANK0Byte1 0.6244274286023574 +o1_CH0RANK0Byte2 0.9954787235053524 +o1_CH0RANK0Byte3 0.9954787235053524 +o1_CH0RANK0Byte4 0.7156917717874804 +o1_CH0RANK0Byte5 0.5695726624876262 +o1_CH0RANK0Byte6 0.7975144189901908 +o1_CH0RANK0Byte7 0.9954787235053524 +o1_CH0RANK1Byte0 0.7468769181824042 +o1_CH0RANK1Byte1 0.5695726624876262 +o1_CH0RANK1Byte2 0.7156917717874804 +o1_CH0RANK1Byte3 0.7468769181824042 +o1_CH0RANK1Byte4 0.9954787235053524 +o1_CH0RANK1Byte5 0.499857177734375 +o1_CH0RANK1Byte6 0.9954787235053524 +o1_CH0RANK1Byte7 0.9954787235053524 +o1_CH1RANK0Byte0 0.8437974467247151 +o1_CH1RANK0Byte1 0.45703125 +o1_CH1RANK0Byte2 0.9954787235053524 +o1_CH1RANK0Byte3 0.9954787235053524 +o1_CH1RANK0Byte4 0.5396719074249268 +o1_CH1RANK0Byte5 0.5695726624876262 +o1_CH1RANK0Byte6 0.9954787235053524 +o1_CH1RANK0Byte7 0.7790153802562036 +o1_CH1RANK1Byte0 0.9954787235053524 +o1_CH1RANK1Byte1 0.8025144189901908 +o1_CH1RANK1Byte2 0.9954787235053524 +o1_CH1RANK1Byte3 0.9954787235053524 +o1_CH1RANK1Byte4 0.9954787235053524 +o1_CH1RANK1Byte5 0.5396719074249268 +o1_CH1RANK1Byte6 0.9954787235053524 +o1_CH1RANK1Byte7 0.8255599422098604 diff --git a/tutorial/examples/si/smlp/run_si_test_nosplit b/tutorial/examples/si/smlp/run_si_test_nosplit new file mode 100755 index 00000000..089fd838 --- /dev/null +++ b/tutorial/examples/si/smlp/run_si_test_nosplit @@ -0,0 +1,40 @@ +#!/usr/bin/tcsh -f +set log=`realpath $0 | xargs basename`.log +git rev-parse --show-toplevel >& /dev/null +if($status) then + echo "\nERROR: Current directory is outside git directory tree\n" + exit(1) +endif +set test=s2_tx_piv_anonym +set test_dir=bench/intel +set git_root=`git rev-parse --show-toplevel` +set pref=no_split +\rm -f logs.log $log >& /dev/null +\rm -f ${pref}* >& /dev/null +if($#argv > 0) then + if("-clean" == "$argv[1]") then + exit(0) + endif +endif +time python3.11 ${git_root}/src/run_smlp.py -data ${git_root}/${test_dir}/data/${test}.csv.bz2 \ + -spec ${git_root}/${test_dir}/specs/${test}.spec \ + -out_dir ./ \ + -pref $pref \ + -pred_plots f \ + -resp_plots f \ + -delta_abs 0.005 \ + -rad_rel 0 \ + -epsilon 0.005 \ + -mode optimize \ + -model dt_sklearn \ + -mrmr_pred 0 \ + -plots f \ + -tree_encoding flat \ + -opt_strategy eager \ + -seed 10 \ + -dt_sklearn_max_depth 17 >& $log +set json=${pref}_${test}_optimization_results.json +set out=$json:r_relative_optimized_margin.txt +foreach key (`jq 'keys[] | select(test("objv"))' $json`) + if( $key !~ "*scaled*" ) echo $key `jq ".${key}.threshold_scaled" $json` | tr -d '"' | sed 's/objv_//' >> $out +end diff --git a/tutorial/examples/si/smlp/run_si_test_split b/tutorial/examples/si/smlp/run_si_test_split new file mode 100755 index 00000000..dd8e6d4b --- /dev/null +++ b/tutorial/examples/si/smlp/run_si_test_split @@ -0,0 +1,41 @@ +#!/usr/bin/tcsh -f +set log=`realpath $0 | xargs basename`.log +git rev-parse --show-toplevel >& /dev/null +if($status) then + echo "\nERROR: Current directory is outside git directory tree\n" + exit(1) +endif +set test=s2_tx_piv_anonym +set test_dir=bench/intel +set git_root=`git rev-parse --show-toplevel` +set pref=split +\rm -f logs.log $log >& /dev/null +\rm -f ${pref}* >& /dev/null +if($#argv > 0) then + if("-clean" == "$argv[1]") then + exit(0) + endif +endif +time python3.11 ${git_root}/src/run_smlp.py -data ${git_root}/${test_dir}/data/${test}.csv.bz2 \ + -spec ${git_root}/${test_dir}/specs/${test}.spec \ + -out_dir ./ \ + -pref $pref \ + -split 1 \ + -pred_plots f \ + -resp_plots f \ + -delta_abs 0.005 \ + -rad_rel 0 \ + -epsilon 0.005 \ + -mode optimize \ + -model dt_sklearn \ + -mrmr_pred 0 \ + -plots f \ + -tree_encoding flat \ + -opt_strategy eager \ + -seed 10 \ + -dt_sklearn_max_depth 17 >& $log +set json=${pref}_${test}_optimization_results.json +set out=$json:r_relative_optimized_margin.txt +foreach key (`jq 'keys[] | select(test("objv"))' $json`) + if( $key !~ "*scaled*" ) echo $key `jq ".${key}.threshold_scaled" $json` | tr -d '"' | sed 's/objv_//' >> $out +end diff --git a/tutorial/examples/si/smlp/run_si_tests b/tutorial/examples/si/smlp/run_si_tests new file mode 100755 index 00000000..e15d95ae --- /dev/null +++ b/tutorial/examples/si/smlp/run_si_tests @@ -0,0 +1,29 @@ +#!/usr/bin/tcsh -f +set script_path=`realpath $0 | xargs dirname` +if($#argv > 0 ) then + if("-dryrun" == "$argv[1]") then + set dry_run + else + if("-clean" == "$argv[1]") then + foreach test (run_si_test_nosplit run_si_test_split) + $script_path/$test -clean + end + exit(0) + endif + endif +endif +if($?dry_run) then + echo "Dry run" + foreach f ($script_path/results/*_EXPECTED.txt) + set f_lc=`echo $f | tr '[A-Z]' '[a-z]' | sed 's/_expected//'` + \rm -f $f_lc >& /dev/null + \ln -sf $f $f_lc:t + end +else + foreach test (run_si_test_nosplit run_si_test_split) + set cmd="$script_path/$test" + echo $cmd + $cmd + end +endif +$script_path/extract_all_results diff --git a/tutorial/run_all b/tutorial/run_all new file mode 100755 index 00000000..5a5ca48e --- /dev/null +++ b/tutorial/run_all @@ -0,0 +1,20 @@ +#!/usr/bin/tcsh -f +cd `realpath $0 | xargs dirname` +set examples = ( \ + examples/constraint_dora/smlp/run_constraint_dora_poly \ + examples/bnh/smlp/run_poly_pareto \ + examples/eggholder/smlp/run_eggholder \ + examples/si/smlp/run_si_tests ) +foreach e ( $examples ) + $e -clean + if( $#argv > 0 ) then + if("-clean" == "$argv[1]") then + echo Cleaning $e:h + continue + endif + endif + echo Starting: $e + $e + echo DONE: $e + echo ============================================= +end diff --git a/utils/poly/src/common.cc b/utils/poly/src/common.cc index 38342f3a..20ab9281 100644 --- a/utils/poly/src/common.cc +++ b/utils/poly/src/common.cc @@ -11,6 +11,7 @@ static inline int isatty(int) { return 0; } #else #include +#include #endif #define CSI "\x1b[" diff --git a/utils/poly/src/ext-solver.cc b/utils/poly/src/ext-solver.cc index 8feb70dd..12bfa2cf 100644 --- a/utils/poly/src/ext-solver.cc +++ b/utils/poly/src/ext-solver.cc @@ -20,10 +20,10 @@ struct Pipe { file rd, wr; - explicit Pipe(int flags = 0) + explicit Pipe() { int rw[2]; - if (pipe2(rw, flags)) + if (pipe(rw)) throw std::error_code(errno, std::system_category()); rd = file(rw[0], "r"); wr = file(rw[1], "w"); diff --git a/utils/poly/src/meson.build b/utils/poly/src/meson.build index 2245839c..5f0a9a20 100644 --- a/utils/poly/src/meson.build +++ b/utils/poly/src/meson.build @@ -42,13 +42,15 @@ if flint_dep.found() all_deps += {'mpfr': dep} poly_deps += dep message('using Flint for Z and Q') + kay_deps = [flint_dep, dep] else gmpxx_dep = dependency('gmpxx', static: get_option('static')) all_deps += {'gmpxx': gmpxx_dep} - if gmpxx_dep.found() and cxx.check_header('gmpxx.h') + if gmpxx_dep.found() and cxx.check_header('gmpxx.h', dependencies: gmpxx_dep) config.set('KAY_USE_GMPXX', 1) poly_deps += gmpxx_dep message('using gmpxx for Z and Q') + kay_deps = [gmpxx_dep] else error('need either flint library or gmpxx headers') endif @@ -83,7 +85,7 @@ dep_libs = { }, 'kay': { 'libs_hdrs': { '': ['kay' / 'numbers.hh'] }, - 'extra': { 'required': true } + 'extra': { 'required': true, 'dependencies': kay_deps } }, 'kjson': { 'libs_hdrs': { 'kjson': ['kjson.h','kjson.hh'], }, @@ -271,7 +273,7 @@ libsmlp_deps = poly_deps py3 = import('python').find_installation('python', modules: ['fractions'], disabler: true, required: false) -py3_dep = py3.dependency(embed: true) +py3_dep = py3.dependency(embed: true, required: false) all_deps += {'python3': py3_dep} libsmlp_deps += py3_dep boost_dep = dependency('boost', diff --git a/utils/poly/src/smlp.cc b/utils/poly/src/smlp.cc index 5a529ce6..2178531f 100644 --- a/utils/poly/src/smlp.cc +++ b/utils/poly/src/smlp.cc @@ -33,6 +33,7 @@ #include #include +#include using namespace smlp; using std::isfinite;