Git Product home page Git Product logo

nsbplib's Introduction

Nonsmooth Bilevel TV Learning

A cleaned up version of the code for papers:

  • De los Reyes, Juan Carlos, and David Villacís. "Optimality conditions for bilevel imaging learning problems with total variation regularization." SIAM Journal on Imaging Sciences 15.4 (2022): 1646-1689.
  • De los Reyes, Juan Carlos, and David Villacís. "Interpretable Model Learning in Variational Imaging: A Bilevel Optimization Approach"

Prerequisites

The python environment must have numpy, pylops and pyproximal installed.

Installing a local version

After cloning the project, cd in the root folder and install the module using pip in experimental mode

$ cd nsbplib
$ pip install -e .

Running prebuilt experiments

Learning Optimal Scalar Parameter (Data Learning)

$ cd experiments
$ python experiments/learn_optimal_scalar_data_parameter.py $dataset_name $output_folder --size_training_set $size_dataset

Learning Optimal Patch Parameter (Data Learning)

$ cd experiments
$ python experiments/learn_optimal_patch_data_parameter.py $dataset_name $output_folder --patch_size $patch_size --size_training_set $size_dataset

Learning Optimal Scalar Parameter (Regularization Learning)

$ cd experiments
$ python experiments/learn_optimal_scalar_reg_parameter.py $dataset_name $output_folder --size_training_set $size_dataset

Learning Optimal Patch Parameter (Regularization Learning)

$ cd experiments
$ python experiments/learn_optimal_patch_reg_parameter.py $dataset_name $output_folder --patch_size $patch_size --size_training_set $size_dataset

Learning Optimal Scalar Parameter for Deblurring (Data Learning)

$ cd experiments
$ python experiments/learn_optimal_scalar_data_parameter_deblurring.py $dataset_name $output_folder --size_training_set $size_dataset

Learning Optimal Patch Parameter for Deblurring (Data Learning)

$ cd experiments
$ python experiments/learn_optimal_patch_data_parameter_deblurring.py $dataset_name $output_folder --patch_size $patch_size --size_training_set $size_dataset

Plotting the results from output_folder

For regenerating the plots presented in the paper, there are several scripts that generate the plots and tables

Plotting scalar cameraman reconstruction

$ python plotting/plot_scalar_reconstruction $output_folder/$dataset_name

Plotting reconstruction from different models

$ python plotting/plot_reconstructions $output_folder_1 $output_folder_2 ...

Plotting the validation results

This script generates the plot regarding the validation error of the learned parameter for different patch sizes and different training set sizes.

$ python plotting/plot_validation $validation_dataset_path $output_folder_1 $output_folder_2 ...

Generating the performance tables

This script generates the performance tables for the learned parameters for different patch sizes and different training set sizes.

$ python tables/generate_performance_tables.py $output_folder_1 $output_folder_2 ...

nsbplib's People

Contributors

dvillacis avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.