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

@@ -23,23 +23,23 @@ namespace fces {
*/
class SpectralSensor {
public:
SpectralSensor() = default;
explicit SpectralSensor(torch::nn::Module& model);
SpectralSensor() = default;
explicit SpectralSensor(torch::nn::Module &model);
/// Track a layer's weight tensor
void track_layer(const std::string& name, const torch::Tensor& weight);
/// Track a layer's weight tensor
void track_layer(const std::string &name, const torch::Tensor &weight);
/// Get the global (average) effective rank
float get_global_rank() const;
/// Get the global (average) effective rank
float get_global_rank() const;
/// Reset all tracked layers
void reset();
/// Reset all tracked layers
void reset();
private:
std::unordered_map<std::string, float> layer_ranks_;
std::unordered_map<std::string, float> layer_ranks_;
/// Compute effective rank via SVD
static float compute_effective_rank(const torch::Tensor& weight);
/// Compute effective rank via SVD
static float compute_effective_rank(const torch::Tensor &weight);
};
/**
@@ -47,8 +47,8 @@ private:
*/
class SpectralController {
public:
/// Compute the spectral alpha (gating factor for rank-aware updates)
float compute_alpha(float global_rank, float grokking_coefficient) const;
/// Compute the spectral alpha (gating factor for rank-aware updates)
float compute_alpha(float global_rank, float grokking_coefficient) const;
};
} // namespace fces
} // namespace fces