Commit 6c7e3422 authored by Andrey Filippov's avatar Andrey Filippov

working snapshot for VegetationLMA, some debug tools

parent 8aa4bef7
...@@ -697,27 +697,41 @@ public class VegetationModel { ...@@ -697,27 +697,41 @@ public class VegetationModel {
Rectangle woi50 = new Rectangle(143,317,35,35); Rectangle woi50 = new Rectangle(143,317,35,35);
int min_scenes = 10; int min_scenes = 10;
double default_alpha = 0.8; double default_alpha = 0.8;
double [] scene_weights = null;
double reg_weights = 0.25; // fraction of the total weight used for regularization double reg_weights = 0.25; // fraction of the total weight used for regularization
double alpha_loss = 1.0; // quadratic loss when alpha reaches -1.0 or 2.0 double alpha_loss = 1000.0; // 100.; // 10.0; // quadratic loss when alpha reaches -1.0 or 2.0
double alpha_offset = 0.0; // if >0, start losses above 0.0 and below 1.0; double alpha_offset = 0.0; // if >0, start losses above 0.0 and below 1.0;
double alpha_lpf = 2.0; // 1.5; // 5.0; // 0.5; // pull to average of 4 neighbors
double boost_parallax = 5;
boolean exit_loop = debugLevel < 1000;
boolean next_run = false;
boolean read_pars = true;
String parameters_path = "/media/elphel/SSD3-4GB/lwir16-proc/berdich3/debug/vegetation/lma/parameters_vector_data.tiff";
do {
String par_path = (read_pars && !next_run)? parameters_path : null;
int num_samples = vegetationLMA.prepareLMA( int num_samples = vegetationLMA.prepareLMA(
next_run, // final boolean keep_parameters,
woi50, // final Rectangle woi, woi50, // final Rectangle woi,
min_scenes, // final int min_scenes, // minimal number of scenes (inside woi) vegetation pixel must influence min_scenes, // final int min_scenes, // minimal number of scenes (inside woi) vegetation pixel must influence
default_alpha, // final double default_alpha, default_alpha, // final double default_alpha,
scene_weights, // final double [] scene_weights, // null or per-scene weights (higher for larger offsets)?
reg_weights, // final double reg_weights, // fraction of the total weight used for regularization reg_weights, // final double reg_weights, // fraction of the total weight used for regularization
alpha_loss, // final double alpha_loss, // quadratic loss when alpha reaches -1.0 or 2.0 alpha_loss, // final double alpha_loss, // quadratic loss when alpha reaches -1.0 or 2.0
alpha_offset, // final double alpha_offset, // quadratic loss when alpha reaches -1.0 or 2.0 alpha_offset, // final double alpha_offset, // quadratic loss when alpha reaches -1.0 or 2.0
alpha_lpf, // final double alpha_lpf, // pull to average of 4 neighbors
boost_parallax, // final double boost_parallax, // increase weight of scene with maximal parallax relative to the reference scene
par_path, // final String parameters_read_path,
debugLevel); // final int debugLevel); debugLevel); // final int debugLevel);
if (debugLevel >-2) {
double lambda = 0.1; vegetationLMA.showYfX(
null, // double [] vector,
"reconstructed_model"); // String title)
}
next_run = true;
double lambda = 5.0; // 0.1;
double lambda_scale_good = 0.5; double lambda_scale_good = 0.5;
double lambda_scale_bad = 8.0; double lambda_scale_bad = 8.0;
double lambda_max = 1000; double lambda_max = 1000;
boolean last_run = false; boolean last_run = false;
double rms_diff = 0.0001; double rms_diff = 1e-8; // 0.0001; virtually forever
int num_iter = 100; int num_iter = 100;
vegetationLMA.debug_index = 0; vegetationLMA.debug_index = 0;
vegetationLMA.debug_image = new double [num_iter][]; vegetationLMA.debug_image = new double [num_iter][];
...@@ -732,6 +746,12 @@ public class VegetationModel { ...@@ -732,6 +746,12 @@ public class VegetationModel {
last_run, // boolean last_run, last_run, // boolean last_run,
null, // String dbg_prefix, null, // String dbg_prefix,
debugLevel); // int debug_level) debugLevel); // int debug_level)
} while (!exit_loop);
if (debugLevel >-2) {
vegetationLMA.showYfX(
null, // double [] vector,
"reconstructed_model_adjusted"); // String title)
}
return; // return; //
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment