style: run clang-format and configure pre-commit hooks

This commit is contained in:
AI-anonymous
2026-05-20 00:18:23 +02:00
parent 041eab7155
commit 3b15770437
28 changed files with 2226 additions and 2061 deletions

View File

@@ -18,65 +18,80 @@ namespace fces {
* All fields have sensible defaults matching the Python V49.0 implementation.
*/
struct FCESConfig {
// Learning rate (V49 optimal default)
float lr = 1.6e-3f;
// Learning rate (V49 optimal default)
float lr = 1.6e-3f;
// Weight decay coefficient
float weight_decay = 0.0f;
// Weight decay coefficient
float weight_decay = 0.0f;
// Population size for evolutionary search
int population_size = 200;
// Population size for evolutionary search
int population_size = 200;
// Total training steps (for progress-aware scheduling)
int total_steps = 5000;
// Total training steps (for progress-aware scheduling)
int total_steps = 5000;
// Signal mode for loss velocity calculation
std::string signal_mode = "relative";
// Signal mode for loss velocity calculation
std::string signal_mode = "relative";
// Grokking awareness coefficient (0.0 = disabled)
float grokking_coefficient = 0.1f;
// Grokking awareness coefficient (0.0 = disabled)
float grokking_coefficient = 0.1f;
// Spectral sensing frequency (every N steps)
int spectral_frequency = 10;
// Spectral sensing frequency (every N steps)
int spectral_frequency = 10;
// Curriculum Spectral Regularization
bool csr_enabled = false;
int csr_warmup_steps = 500;
int csr_ramp_steps = 1000;
// Curriculum Spectral Regularization
bool csr_enabled = false;
int csr_warmup_steps = 500;
int csr_ramp_steps = 1000;
// Trust region clipping
float trust_region_clip = 0.01f;
// Trust region clipping
float trust_region_clip = 0.01f;
// Rollback threshold
float rollback_threshold = 1.5f;
// Rollback threshold
float rollback_threshold = 1.5f;
// Adaptive weight decay
bool adaptive_wd = false;
// Adaptive weight decay
bool adaptive_wd = false;
// Parasitic mode (gradient alignment reward)
bool parasitic_mode = false;
// Parasitic mode (gradient alignment reward)
bool parasitic_mode = false;
// Ablation mode: "", "force_sign", "force_grad"
std::string ablation_mode = "";
// Ablation mode: "", "force_sign", "force_grad"
std::string ablation_mode = "";
// Fractional factorial scoring (CRO trick)
bool use_fractional_scoring = false;
// Fractional factorial scoring (CRO trick)
bool use_fractional_scoring = false;
// Direct construction mode (pop_size=1)
bool direct_construction = false;
// Direct construction mode (pop_size=1)
bool direct_construction = false;
// Banach-Tarski fission
bool use_banach_fission = false;
// Banach-Tarski fission
bool use_banach_fission = false;
// Auto-population (stabilize on divergence)
bool auto_population = false;
// Auto-population (stabilize on divergence)
bool auto_population = false;
// Builder pattern
FCESConfig& set_lr(float v) { lr = v; return *this; }
FCESConfig& set_population_size(int v) { population_size = v; return *this; }
FCESConfig& set_total_steps(int v) { total_steps = v; return *this; }
FCESConfig& set_grokking_coefficient(float v) { grokking_coefficient = v; return *this; }
FCESConfig& set_direct_construction(bool v) { direct_construction = v; return *this; }
// Builder pattern
FCESConfig &set_lr(float v) {
lr = v;
return *this;
}
FCESConfig &set_population_size(int v) {
population_size = v;
return *this;
}
FCESConfig &set_total_steps(int v) {
total_steps = v;
return *this;
}
FCESConfig &set_grokking_coefficient(float v) {
grokking_coefficient = v;
return *this;
}
FCESConfig &set_direct_construction(bool v) {
direct_construction = v;
return *this;
}
};
} // namespace fces
} // namespace fces