Enhanced scaling factor

This commit is contained in:
Ed Addario 2026-03-12 20:05:29 +00:00
parent d1ed43ca62
commit feda897fa2
No known key found for this signature in database
GPG Key ID: E7875815A3230993
1 changed files with 4 additions and 1 deletions

View File

@ -1428,7 +1428,10 @@ static std::unordered_map<std::string, ggml_type> target_bpw_type(
if (statistics_data) {
if (auto it = statistics_data->find(remapped_name); it != statistics_data->end() && !it->second.empty()) {
const auto & ts = it->second;
scaling_factor = 1.0f + std::log1p(std::max(0.0f, ts[KURTOSIS])) * std::max(1.0f, std::isnan(ts[GAIN]) ? 1.0f : ts[GAIN]);
const float gain = std::isnan(ts[GAIN]) ? 1.0f : ts[GAIN];
const float alignment = std::isfinite(ts[COSSIM]) ? std::max(0.0f, 1.0f - ts[COSSIM]) : 0.0f;
const float concentration = 1.0f - std::clamp(ts[H_NORM], 0.0f, 100.0f) / 100.0f;
scaling_factor = 1.0f + std::log1p(std::max(0.0f, ts[KURTOSIS])) * std::max(1.0f, gain) * (1.0f + alignment) * (1.0f + concentration);
}
}