Firmware Version 1.0.4

This commit is contained in:
0x23 2026-03-13 09:10:45 +01:00
parent 18313cc6ae
commit e13cbda4cc
26 changed files with 794 additions and 256 deletions

View file

@ -147,7 +147,7 @@ bool LookupTable::init_interpolating(std::vector<std::pair<float, float>> in_out
return true;
}
bool LookupTable::optimize_lut(std::vector<std::pair<float, float>> in_out_pairs) {
bool LookupTable::optimize_lut(std::vector<std::pair<float, float>> in_out_pairs, float& rms_error) {
if (lookup_table.empty() || in_out_pairs.empty())
return false;
@ -198,7 +198,9 @@ bool LookupTable::optimize_lut(std::vector<std::pair<float, float>> in_out_pairs
//if(iter%100 == 0)
// LOG_DEBUG("iteration %04i: rms=%f", iter, sqrtf(total_loss));
}
LOG_DEBUG("Optimizing lookup table finished: rms=%f", total_loss);
rms_error = sqrt(total_loss);
LOG_DEBUG("Optimizing lookup table finished: rms_error=%f", rms_error);
return true;
}

View file

@ -27,7 +27,7 @@ class LookupTable {
int table_size, bool sort_input);
// optimizes the lookup table using gradient descen to minimize error to provided data
bool optimize_lut(std::vector<std::pair<float, float>> in_out_pairs);
bool optimize_lut(std::vector<std::pair<float, float>> in_out_pairs, float& rms_error);
// clear the lookup table, use init to use it again
void clear();