26 float &top1Weight,
float &top2Weight,
27 float dominantExpertCutoff = 0.8f) {
28 if (top1Weight > dominantExpertCutoff) {
47 int &e1,
float &w0,
float &w1) {
61 const float s = weights.
weights[e];
73 const float z = s0 + s1;
Computes expert weights for the Residual MoE architecture based on position features.
static constexpr int NUM_BASE
Definition ExpertRouter.hpp:33
static void compute_weights(const ChessInput &input, float eval_cp, ExpertWeights &out)
Definition ExpertRouter.hpp:106
Definition MoERouting.h:15
int collapse_top2_if_dominant(float &top1Weight, float &top2Weight, float dominantExpertCutoff=0.8f)
Collapses the top 2 experts into a single expert if the top one is highly dominant.
Definition MoERouting.h:25
void route_top2_base_experts(const FactorizedInput &inp, int &e0, int &e1, float &w0, float &w1)
Identifies the top 2 base experts for a given factorized input.
Definition MoERouting.h:46
Definition ExpertRouter.hpp:52
float weights[NUM_EXPERTS]
Definition ExpertRouter.hpp:53