Commit 8aa4bef7 authored by Andrey Filippov's avatar Andrey Filippov

regularization to alpha

parent 836e9158
......@@ -636,7 +636,7 @@ public class VegetationModel {
double [] terrain_average, // full image average terrain (no nulls)
double [] vegetation_average, // full image average vegetation (with nulls)
double [][] terrain_rendered, // terrain rendered for scenes (has nulls)
double [][][] vegetation_offsets, // [num_scenes][pixel]{dx,dy} differential offsets of vegetation to terrain grid
double [][][] vegetation_offsets, // [num_scenes][pixel]{dx,dy} differential offsets of vegetation to terrain grid
String [] titles,
int debugLevel) {
boolean diff_mode = true;
......@@ -698,11 +698,18 @@ public class VegetationModel {
int min_scenes = 10;
double default_alpha = 0.8;
double [] scene_weights = null;
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_offset = 0.0; // if >0, start losses above 0.0 and below 1.0;
int num_samples = vegetationLMA.prepareLMA(
woi50, // final Rectangle woi,
min_scenes, // final int min_scenes, // minimal number of scenes (inside woi) vegetation pixel must influence
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
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
debugLevel); // final int debugLevel);
double lambda = 0.1;
......@@ -712,6 +719,9 @@ public class VegetationModel {
boolean last_run = false;
double rms_diff = 0.0001;
int num_iter = 100;
vegetationLMA.debug_index = 0;
vegetationLMA.debug_image = new double [num_iter][];
int lma_rslt= vegetationLMA.runLma( // <0 - failed, >=0 iteration number (1 - immediately)
lambda, // double lambda, // 0.1
lambda_scale_good,// double lambda_scale_good,// 0.5
......
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