EMVal / PROTOCOL.md
haoliuarena's picture
Inline math in the delimiters the Hub renders
4c77359 verified
|
Raw
History Blame Contribute Delete
5.08 kB

EMVal evaluation protocol

Protocol version: 1.0.0.

EMVal evaluates models of time-harmonic electromagnetic behavior. EMVal-NF measures complex near-field predictions, and EMVal-SP measures complex S-parameter predictions.

Evaluation subsets and aggregation

EMVal separates in-distribution (ID) boards from out-of-distribution (OOD) boards by geometry family, where an ID board belongs to a design family that is included in model training, and an OOD board belongs to a design family that is excluded from model training. Regardless of whether a board geometry in our evaluation sets is ID or OOD, it is NOT included in the model training set. The public and private_standard groups are ID. The private_challenge group is OOD.

Each metric is computed for one board. The dataset-level value is the equal-weight mean of the board values. Thus, a board with more ports or probes does not receive more weight. Near-field metrics pool all excited ports, frequencies, and probes within each board before the board-level reduction.

Metrics

EMVal-NF

For a board excited at port jj and frequency ff, let FjfpC3\mathbf{F}_{jfp}\in\mathbb{C}^3 be the simulated field vector at probe pp, and let F^jfp\hat{\mathbf{F}}_{jfp} be the prediction. Here, F\mathbf{F} is either the electric field E\mathbf{E} or the magnetic field H\mathbf{H}.

The global relative L2L_2 error compares total error energy with total simulated field energy across every excited port, frequency, and probe:

relL2(F)=jfpF^jfpFjfp22jfpFjfp22. \operatorname{rel}L_2(\mathbf{F}) = \frac{\sqrt{\sum_{jfp}\lVert\hat{\mathbf{F}}_{jfp}-\mathbf{F}_{jfp}\rVert_2^2}}{\sqrt{\sum_{jfp}\lVert\mathbf{F}_{jfp}\rVert_2^2}}.

The scorer reports rel_l2_E and rel_l2_H. Because the metric sums squared absolute errors before normalization, it gives more weight to regions where the simulated field is strong. Lower values are better, and 0 is the optimum.

The median local error normalizes the error at each probe by the simulated field magnitude and then takes the median:

(F)=medianjfp(ejfp),ejfp=F^jfpFjfp2Fjfp2. \operatorname{local\text{-}q_{50}}(\mathbf{F}) = \operatorname{median}_{jfp}(e_{jfp}), \qquad e_{jfp} = \frac{\lVert\hat{\mathbf{F}}_{jfp}-\mathbf{F}_{jfp}\rVert_2}{\lVert\mathbf{F}_{jfp}\rVert_2}.

The scorer reports local_q50_E and local_q50_H. The local normalization gives low- and high-magnitude probes equal influence. The median limits the effect of a small number of large errors. Lower values are better, and 0 is the optimum.

The median local alignment measures the alignment of the predicted and simulated complex vectors at each probe:

(F)=medianjfp(cjfp),cjfp=Re ⁣(k=13F^jfp,kFjfp,k)F^jfp2Fjfp2. \operatorname{local\text{-}cos\text{-}q_{50}}(\mathbf{F}) = \operatorname{median}_{jfp}(c_{jfp}), \qquad c_{jfp} = \frac{\operatorname{Re}\!\left(\sum_{k=1}^{3}\hat F_{jfp,k}F_{jfp,k}^{*}\right)}{\lVert\hat{\mathbf{F}}_{jfp}\rVert_2\lVert\mathbf{F}_{jfp}\rVert_2}.

The scorer reports local_cos_q50_E and local_cos_q50_H. A value of 1 means that the prediction is aligned with the simulated vector in direction and complex phase. Higher values are better, and 1 is the optimum.

The scorer also reports two field-average values. rel_l2_avg is the arithmetic mean of the dataset-level rel_l2_E and rel_l2_H values. local_q50_avg is the corresponding mean of local_q50_E and local_q50_H.

EMVal-SP

For one board, let SijfCS_{ijf}\in\mathbb{C} be the true S-parameter for receiving port ii, excited port jj, and frequency ff. Let S^ijf\hat S_{ijf} be the prediction, and let NN be the number of (i,j,f)(i,j,f) entries.

The real-and-imaginary RMSE is

riRMSE=12Nijf[(Re(S^ijfSijf))2+(Im(S^ijfSijf))2]. \operatorname{riRMSE} = \sqrt{\frac{1}{2N}\sum_{ijf}\left[\left(\operatorname{Re}(\hat S_{ijf}-S_{ijf})\right)^2+\left(\operatorname{Im}(\hat S_{ijf}-S_{ijf})\right)^2\right]}.

The scorer reports this value as real_imag_rmse. The factor 2N2N treats the real and imaginary parts as separate dimensions. Lower values are better, and the mathematical optimum is 0.

For the magnitude weighted-MAE, define M=20log10SM=20\log_{10}|S|, M^=20log10S^\hat M=20\log_{10}|\hat S|, and

wijf=σ ⁣(MijfN0τ),N0=20 dB,τ=2 dB. w_{ijf} = \sigma\!\left(\frac{M_{ijf}-N_0}{\tau}\right), \qquad N_0=-20\ \mathrm{dB}, \qquad \tau=2\ \mathrm{dB}.

Then

mag-wMAE=ijfwijfM^ijfMijfijfwijf. \operatorname{mag\text{-}wMAE} = \frac{\sum_{ijf}w_{ijf}|\hat M_{ijf}-M_{ijf}|}{\sum_{ijf}w_{ijf}}.

The scorer reports this value as mag_wmae in dB. The sigmoid weight uses the simulated magnitude and reduces the contribution of deep nulls, where magnitude error in dB has limited engineering significance. Lower values are better, and 0 is the optimum.

The phase weighted-MAE applies the same magnitude-derived weights to the shortest angular distance between the predicted and simulated phases:

phase-wMAE=ijfwijfwrap[π,π](ϕ^ijfϕijf)ijfwijf. \operatorname{phase\text{-}wMAE} = \frac{\sum_{ijf}w_{ijf}\left|\operatorname{wrap}_{[-\pi,\pi]}(\hat\phi_{ijf}-\phi_{ijf})\right|}{\sum_{ijf}w_{ijf}}.

The scorer reports this value as ph_wmae in radians. The magnitude weights prevent phase errors in deep nulls from dominating the metric. Lower values are better, and 0 is the optimum.