Closed mdavezac closed 8 years ago
This is needed for #85
Added to sdmm the ability to warm-start from its own output:
sopt::Vector<double> const input = sopt::Vector<double>::Random(10)
auto sdmm = sopt::algorithm::SDMM<double>().itermax(10);
// setup sdmm
// ...
// then run it a first time
auto const first_output = sopt::algorithm(input);
// and this will restart pretty much from where it left off
auto const second_output = sopt::algorithm(first_input);
Using the same approach for ADMM and a specialization for adding weights should make #85 fairly simple. It might mean that we need an specialization of SDMM to RI though.
There are Behaviour Driven Development test for the sdmm and padmm warm starts.
See cpp/tests/*_warm_start.cc
and run ./build/cpp/tests/test_sdmm_warm_start -s
to see the
scenarios. E.g.:
Scenario: SDMM with warm start
Given An SDMM instance with its input
When the algorithms runs
When It is set to stop before convergence
When A warm restart is attempted
Then The warm restart is validated by the fast convergence
@Luke-Pratley, in order to get the warm start working, I've had to change the interface to ProximalADMM and friends. It now takes no input, or an tuple (x, residual) as an initial guess:
auto const result = padmm();
// or
auto const result = padmm(
{t_Vector::Random(image.size()), t_Vector::Random(padmm.target().size())});
// or warm-start
auto const result = padmm(previous_result);
// the output and associated residuals are returned:
auto const x_output = result.x;
auto const residual_output = result.residual;
We will have to modify the calls to PADMM in purify when this is merged. Still no Legion, so I won't be merging until I can run the tests there.
Quoting Rafael from astro-informatics/purify#29