- start with asgd, finish with l-bfgs

This commit is contained in:
w.pomp committed 2026-07-31 15:14:44 +02:00
1 parent 36b24332cd
commit fdac4e04c4
2 files changed
+47 -35

No files matched your search

+30 -30
View File
@@ -1025,22 +1025,22 @@ mod tests {
}
}
let mean_diff = sum_diff / count as f64;
println!("Our: {:?} mean_coord_diff: {:.6}", t, mean_diff);
println!("Our: {:?}\nmean_coord_diff: {:.6}", t, mean_diff);
let mut tif = IJTiffFile::new(
std::env::home_dir()
.unwrap()
.join("tmp/register_real_images.tif"),
)?;
tif.save(fixed.mapv(|i| i as u16), 0, 0, 0)?;
tif.save(
t.interpolate_par::<1, _, _>(moving.view())?
.mapv(|i| i as u16),
1,
0,
0,
)?;
tif.save(moving.mapv(|i| i as u16), 2, 0, 0)?;
// let mut tif = IJTiffFile::new(
// std::env::home_dir()
// .unwrap()
// .join("tmp/register_real_images.tif"),
// )?;
// tif.save(fixed.mapv(|i| i as u16), 0, 0, 0)?;
// tif.save(
// t.interpolate_par::<3, _, _>(moving.view())?
// .mapv(|i| i as u16),
// 1,
// 0,
// 0,
// )?;
// tif.save(moving.mapv(|i| i as u16), 2, 0, 0)?;
assert!(mean_diff < 0.1);
@@ -1079,22 +1079,22 @@ mod tests {
}
}
let mean_diff = sum_diff / count as f64;
println!("Our: {:?} mean_coord_diff: {:.6}", t, mean_diff);
println!("Our: {:?}\nmean_coord_diff: {:.6}", t, mean_diff);
let mut tif = IJTiffFile::new(
std::env::home_dir()
.unwrap()
.join("tmp/register_real_images2.tif"),
)?;
tif.save(fixed.mapv(|i| i as u16), 0, 0, 0)?;
tif.save(
t.interpolate_par::<1, _, _>(moving.view())?
.mapv(|i| i as u16),
1,
0,
0,
)?;
tif.save(moving.mapv(|i| i as u16), 2, 0, 0)?;
// let mut tif = IJTiffFile::new(
// std::env::home_dir()
// .unwrap()
// .join("tmp/register_real_images2.tif"),
// )?;
// tif.save(fixed.mapv(|i| i as u16), 0, 0, 0)?;
// tif.save(
// t.interpolate_par::<3, _, _>(moving.view())?
// .mapv(|i| i as u16),
// 1,
// 0,
// 0,
// )?;
// tif.save(moving.mapv(|i| i as u16), 2, 0, 0)?;
assert!(mean_diff < 0.1);