This code is a proof of concept and part of an ongoing work. It is provided for reproducing the results of a published paper.
Caution
This code is NOT intended for production use
This repository contains the code to reproduce the results of the paper "Correction matricielle de l'indétermination d'échelle pour l'optimisation alternée" Submitted to the conference Gretsi 2025
This work has been supported by the ANR (French research agency "Agence Nationale de la Recherche") project DynaSTI: ANR-22-CE45-0008
The code is structured as follows:
├──data
├──external
| └──prox_TV_Condat
├──notebooks
| ├──figs
| ├──figs_Gretsi2025_soumission
| ├──Convergence_tests.ipynb
| ├──Convergence_tests.py
| ├──Plot_simulation_data.ipynb
| ├──Plot_simulation_data.py
| ├──evaluate_mutlirealization.ipynb
| ├──evaluate_mutlirealization.py
| ├──optimization_hyperparameters.ipynb
| └──optimization_hyperparameters.py
├──scripts
| ├──optimization_results
| ├──optimization_results_Gretsi_soumission
| ├──evaluate_model_mutliple_data.py
| └──optimize_hyperparameters_simulation.py
├──src
├──__init__.py
├──LICENCE_FRENCH
├──ReadMe.md
├──gretsi_soumission_ID1416.pdf
├──licence
├──requirements.txt
└──run_simulations.shThe data folder contains the example dataset used in the paper.
The external folder contains the C code of the function to compute the proximal operator of the total variation proposed and implemented by L. Condat.
The notebooks folder contains the Jupyter notebooks to analyze the results and plot the figures
The folder notebooks/figs_GRETSI_soumission contains the exact figures that are used in the manuscript
The figures generated when running the code are stored in folder notebooks/figs
The codes to run the methods for multiple datasets and on a grid of hyperparameters are in the scripts folder.
The source code of the methods are in the src folder
The PDF of the manuscript submitted to Gretsi 2025 is
gretsi_soumission_ID1416.pdf
Important
All the notebooks (.ipnb) in notebooks where converted into scripts (.py) of the same names to
allow automated execution.
The scripts should NOT be modified.
After cloning the repository, open a terminal in the root folder of the project.
-
First install the requirements in the file
requiremnts.txtby running the following commands in the terminal: This requires a valid Miniconda (or Anaconda) installation# Create a new environment conda create --name Grest2025_ID1416 python==3.11.11 # Activate environment conda activate Grest2025_ID1416 # Install dependencies conda install --yes --file requirements.txt # Compile the c library of L. Condat used to compute the proximal operator of total variation gcc -fpic -O3 -march=native -Wall -shared -o src/Estimation_A/lib_prox_TV_1D_Condat.so external/prox_TV_Condat/Condat_TV_1D_v2.c
-
You can run all the scripts at once with the bash script
run_simulations.sh# Activate environment if it is not activated conda activate Grest2025_ID1416 # Run the simulations bash run_simulations.sh
Running the script will:
-
Plot the example of simulation data used in the paper (Figure1)
-
Run the optimization for the three methods on a reduced grid of hyperparameters to produce Figure 2. (To run on the full grid of parameters as in the paper use the command
bash run_simulations.sh full) -
Evaluate the three methods for the best set of hyperparameters for 25 realizations of the simulation data (and with 100 realizations with the option
bash run_simulations.sh full). -
Plot the box plot of the reconstruction error on these realizations (Figure 3)
-
Evaluate the effect of initialization scaling on the convergence of the methods and plot the corresponding Figure 4.
-
Save all the figures presented in the paper in the folder
notebooks/figs
Important
It should be noted that for the study of the effect of hyperparameters, we evaluated 1008 combinations and the box plot Figure 3 is generated with 100 realizations.
Running these evaluations took 5 hours while using 52 CPU cores.
With fewer cores, it will take much longer.
The default behavior of the provided code is to run on a reduced grip of 108 hyperparameters and generate the box plot with 25 realizations.
You can run the full evaluation by adding the parameter full to the command:
bash run_simulations.sh full