io-chess
UCI chess engine
Loading...
Searching...
No Matches
MoERouting Namespace Reference

Functions

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.
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.

Function Documentation

◆ collapse_top2_if_dominant()

int MoERouting::collapse_top2_if_dominant ( float & top1Weight,
float & top2Weight,
float dominantExpertCutoff = 0.8f )
inline

Collapses the top 2 experts into a single expert if the top one is highly dominant.

Parameters
top1WeightWeight of the highest ranked expert (modified in place).
top2WeightWeight of the second highest ranked expert (modified in place).
dominantExpertCutoffThreshold weight above which the second expert is dropped.
Returns
Number of active experts (1 or 2).
Here is the caller graph for this function:

◆ route_top2_base_experts()

void MoERouting::route_top2_base_experts ( const FactorizedInput & inp,
int & e0,
int & e1,
float & w0,
float & w1 )
inline

Identifies the top 2 base experts for a given factorized input.

Parameters
inpThe factorized input features.
e0Output index of the primary expert.
e1Output index of the secondary expert.
w0Output normalized weight for the primary expert.
w1Output normalized weight for the secondary expert.
Here is the call graph for this function:
Here is the caller graph for this function: