void PolyCompiler_Apply_Norm_Factor_IMP(PolyCompiler *self, float factor) { PolyCompilerIVARS *const ivars = PolyCompiler_IVARS(self); for (size_t i = 0, max = Vec_Get_Size(ivars->children); i < max; i++) { Compiler *child = (Compiler*)Vec_Fetch(ivars->children, i); Compiler_Apply_Norm_Factor(child, factor); } }
void Compiler_normalize(Compiler *self) { // factor = (tf_q * idf_t) float factor = Compiler_Sum_Of_Squared_Weights(self); // factor /= norm_q factor = Sim_Query_Norm(self->sim, factor); // weight *= factor Compiler_Apply_Norm_Factor(self, factor); }