You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
***Random Search** with a fixed and reproducible base seed across runs
24
23
25
24
### Other Algorithms
26
-
***Evolutionary Algorithm**: Memetic Algorithm (a specialized Genetic Algorithm)
27
-
***Simulated Annealing**
25
+
***Evolutionary Algorithm**:
26
+
* Memetic Algorithm (a specialized Genetic Algorithm that escapes local search's plateau with one more tournament selection based on a `radius` parameter)
### Model Training with a Customized Tuning Process
107
-
* A Proof-of-Concept end-to-end quick demo is shown in the Jupyter Notebook: `notebooks\model_training_flow.ipynb`, including: a shorter demo with less data, data and model loading processes, an exhaustive tuning (without metaheuristics) on only the validation set, training and evaluating on the best found set of hyperparameters for each model.
107
+
* A Proof-of-Concept end-to-end quick demo is shown in the Jupyter Notebook: `notebooks\rs_training.ipynb`. It focuses primarily on using a random solver (our choice of baseline) to search for the best set of hyperparameters based on a more updated version of classes and functions interfaces from our models.
108
+
109
+
### Run a Search quickly
110
+
* You can run a quick hyperparameter search based on this script:
111
+
```bash
112
+
python hparam_search.py
113
+
```
114
+
**Available arguments:**
115
+
-`--model`: Model Choices - `["dt", "knn", "cnn"]`, default `dt`.
116
+
-`--trials`: Number of Evaluations - default 5
117
+
118
+
* It is designed for quick, simple hyperparameter optimization only with our baseline (random search), mainly for exploratory runs or TensorBoard logging.
119
+
* It supports `dt`, `knn`, and `cnn` model options, via script arguments, but the CNN training is simpler (no explicit config object, no patience/early stopping control).
120
+
* It passes parameters directly to model creation/training; and so, it'll be less flexible for advanced training configs (e.g., custom epochs, patience).
121
+
* It is intended for quick experiments, visualizations, and debugging with a single optimizer.
122
+
123
+
### Run a Full Experiment
124
+
* You can run a full hyperparameter search based on this script:
-`--runs`: Number of independent runs - default 1.
131
+
-`--trials`: Number of Evaluations - default 5.
132
+
-`--evaluations`: Number of fitness evaluations per run - default 50
133
+
-`--seed`: Base seed for randomization - default 42.
134
+
-`--n-jobs`: Number of parallel workers - default 1 for a sequential run. Use -1 for all CPUs.
135
+
136
+
* It is designed for systematic, reproducible experiments across all kinds of optimizers.
137
+
* All optimizers are supported and selectable via CLI.
138
+
* It saves results, convergence traces, and summaries to disk for later analysis (but not on TensorBoard).
139
+
* For CNN, it uses a TrainingConfig object for fine-grained control (learning rate, weight decay, optimizer, batch size, patience); and disables early stopping for CNN by default for fair comparison.
140
+
* Given its flexibility and robustness, it is intended for benchmarking, comparison, and research—especially when comparing optimizer performanc.
141
+
142
+
### Analyze Results
143
+
Upon completion of an execution from the `run_experiment.py` script, you will likely get some folders under `.cache/experiment` folder. You can visualize plots for analysis based on this script:
144
+
```bash
145
+
python scripts/analyze_experiment.py`
146
+
```
147
+
**Available arguments:**
148
+
- `--experiment`: Name of Experiment - `['cnn-rs', 'dt-ga', 'knn-pso']`
149
+
- `--diagnose-pso`: Whether it runs diagnostics for PSO search.
150
+
151
+
#### Supported Plots
152
+
* Plateau Detection
153
+
* Convergence Per Run
154
+
* Convergence Comparison. (Note: If you want to recompile this graph of the exact same pair of experiment, please delete the file from `.cache/experiment_figures/` folder, because the script tries to avoid generating repeated graphs.)
155
+
* Best Fitness over Evaluations with mean and std.
156
+
* Total Time Across Runs.
157
+
* Final Fitness Values Across Runs.
158
+
* Run this command with tensorboard to inspect GPU usages of specific runs: `tensorboard --logdir .cache/tensorboard/[specific folder]`.
159
+
* Note: this would require an extra dependency, by installing with: `pip install tensorflow`.
160
+
161
+
#### Analysis Specific to PSO
162
+
The `scripts/analyze_experiments.py` script tries to print diagnostics of the particle swarm optimization per run with advice.
163
+
164
+
### Analysis Specific to GA
165
+
You can also run the following script to run and visualize experiments in a scripted pipeline:
166
+
```bash
167
+
python scripts/analyze_ga.py
168
+
```
169
+
The above-mentioned script is only running 1 experiment followed by an analysis (with graphs plotting) in a **sequential** manner. If you prefer running with parallel processing, please run the following pipeline (but please note that you will likely waitfor all the experiments to complete before getting models and plots persisted on disk). You can run the pipeline alternatively with the following command:
170
+
```bash
171
+
python scripts/analyze_ga_parallel_run.py
172
+
```
173
+
They run with a single-job operation anyways (`--n-jobs = 1`).
0 commit comments