Skip to main content
Version: Next

Appendix III: Model Compression Verification

In the model compression scheme, the range of sijs_{ij} is divided into LL intervals, resulting in L+1L+1 interpolation points, denoted as x1,x2,,xL+1x_1, x_2, \cdots, x_{L+1}. For each interval [xl,xl+1)[x_l, x_{l+1}), a fifth-order polynomial is used to approximate the embedding network:

gml(x)=amlx5+bmlx4+cmlx3+dmlx2+emlx+fmlg^l_m(x)=a^l_mx^5+b^l_mx^4+c^l_mx^3+d^l_mx^2+e^l_mx+f^l_m

Note: The variable xx in the polynomial should be sijxls_{ij} - x_l. At each grid point, the following three boundary conditions must be satisfied:

  1. Function value consistency:
yl=Gm(xl)y_l = \mathcal{G}_m(x_l)
  1. First-order derivative consistency:
yl=Gm(xl)y'_l = \mathcal{G}'_m(x_l)
  1. Second-order derivative consistency:
yl=Gm(xl)y''_l = \mathcal{G}''_m(x_l)

The coefficients can be computed as follows:

aml=12Δt5[12h6(yl+1+yl)Δt+(yl+1yl)Δt2]a^l_m = \frac{1}{2\Delta t^5}[12h - 6(y'_{l+1} + y'_l)\Delta t + (y''_{l+1} - y''_l)\Delta t^2] bml=12Δt4[30h+(14yl+1+16yl)Δt+(2yl+1+3yl)Δt2]b^l_m = \frac{1}{2\Delta t^4}[-30h + (14y'_{l+1} + 16y'_l)\Delta t + (-2y''_{l+1} + 3y''_l)\Delta t^2] cml=12Δt3[20h(8yl+1+12yl)Δt+(yl+13yl)Δt2]c^l_m = \frac{1}{2\Delta t^3}[20h - (8y'_{l+1} + 12y'_l)\Delta t + (y''_{l+1} - 3y''_l)\Delta t^2] dml=12yld^l_m = \frac{1}{2}y''_l eml=yle^l_m = y'_l fml=ylf^l_m = y_l

where h=yl+1ylh = y_{l+1} - y_l, and Δt=xl+1xl\Delta t = x_{l+1} - x_l.

Verification

The conditions to be satisfied are that when sij=xls_{ij} = x_l or xl+1x_{l+1}, the function value, first-order derivative, and second-order derivative values must all match those of the embedding network. The corresponding xx values are 00 and Δt\Delta t. The value of the fifth-order polynomial function is:

gml(x)=x52Δt5[12h6(yl+1+yl)Δt+(yl+1yl)Δt2]+x42Δt4[30h+(14yl+1+16yl)Δt+(2yl+1+3yl)Δt2]+x32Δt3[20h(8yl+1+12yl)Δt+(yl+13yl)Δt2]+12ylx2+ylx+yl\begin{aligned} g^l_m(x) &= \frac{x^5}{2\Delta t^5}[12h - 6(y'_{l+1} + y'_l)\Delta t + (y''_{l+1} - y''_l)\Delta t^2] \\ &+ \frac{x^4}{2\Delta t^4}[-30h + (14y'_{l+1} + 16y'_l)\Delta t + (-2y''_{l+1} + 3y''_l)\Delta t^2] \\ &+ \frac{x^3}{2\Delta t^3}[20h - (8y'_{l+1} + 12y'_l)\Delta t + (y''_{l+1} - 3y''_l)\Delta t^2] \\ &+ \frac{1}{2}y''_lx^2 + y'_lx + y_l \end{aligned}

The first-order derivative is:

gml(x)=x42Δt55[12h6(yl+1+yl)Δt+(yl+1yl)Δt2]+x32Δt44[30h+(14yl+1+16yl)Δt+(2yl+1+3yl)Δt2]+x22Δt33[20h(8yl+1+12yl)Δt+(yl+13yl)Δt2]+ylx+yl\begin{aligned} g^l_m(x) &= \frac{x^4}{2\Delta t^5} \cdot 5[12h - 6(y'_{l+1} + y'_l)\Delta t + (y''_{l+1} - y''_l)\Delta t^2] \\ &+ \frac{x^3}{2\Delta t^4} \cdot 4[-30h + (14y'_{l+1} + 16y'_l)\Delta t + (-2y''_{l+1} + 3y''_l)\Delta t^2] \\ &+ \frac{x^2}{2\Delta t^3} \cdot 3[20h - (8y'_{l+1} + 12y'_l)\Delta t + (y''_{l+1} - 3y''_l)\Delta t^2] \\ &+ y''_lx + y'_l \end{aligned}

The second-order derivative is:

gml(x)=x32Δt520[12h6(yl+1+yl)Δt+(yl+1yl)Δt2]+x22Δt412[30h+(14yl+1+16yl)Δt+(2yl+1+3yl)Δt2]+x2Δt36[20h(8yl+1+12yl)Δt+(yl+13yl)Δt2]+yl\begin{aligned} g^l_m(x) &= \frac{x^3}{2\Delta t^5} \cdot 20[12h - 6(y'_{l+1} + y'_l)\Delta t + (y''_{l+1} - y''_l)\Delta t^2] \\ &+ \frac{x^2}{2\Delta t^4} \cdot 12[-30h + (14y'_{l+1} + 16y'_l)\Delta t + (-2y''_{l+1} + 3y''_l)\Delta t^2] \\ &+ \frac{x}{2\Delta t^3} \cdot 6[20h - (8y'_{l+1} + 12y'_l)\Delta t + (y''_{l+1} - 3y''_l)\Delta t^2] \\ &+ y''_l \end{aligned}

When x=0x = 0, the requirements are obviously satisfied. To verify the result when x=Δtx = \Delta t, the function value is:

gml(Δt)=12[12h6(yl+1+yl)Δt+(yl+1yl)Δt2]+12[30h+(14yl+1+16yl)Δt+(2yl+1+3yl)Δt2]+12[20h(8yl+1+12yl)Δt+(yl+13yl)Δt2]+12ylΔt2+ylΔt+yl=hylΔt12ylΔt2+12ylΔt2+ylΔt+yl=yl+1\begin{aligned} g^l_m(\Delta t) &= \frac{1}{2}[12h - 6(y'_{l+1} + y'_l)\Delta t + (y''_{l+1} - y''_l)\Delta t^2] \\ &+ \frac{1}{2}[-30h + (14y'_{l+1} + 16y'_l)\Delta t + (-2y''_{l+1} + 3y''_l)\Delta t^2] \\ &+ \frac{1}{2}[20h - (8y'_{l+1} + 12y'_l)\Delta t + (y''_{l+1} - 3y''_l)\Delta t^2] \\ &+ \frac{1}{2}y''_l\Delta t^2 + y'_l\Delta t + y_l \\ &= h - y'_l\Delta t - \frac{1}{2}y''_l\Delta t^2 + \frac{1}{2}y''_l\Delta t^2 + y'_l\Delta t + y_l \\ &= y_{l+1} \end{aligned}

The first-order derivative value is:

gml(Δt)=52Δt[12h6(yl+1+yl)Δt+(yl+1yl)Δt2]+42Δt[30h+(14yl+1+16yl)Δt+(2yl+1+3yl)Δt2]+32Δt[20h(8yl+1+12yl)Δt+(yl+13yl)Δt2]+ylΔt+yl=yl+1ylylΔt+ylΔt+yl=yl+1\begin{aligned} g^l_m(\Delta t) &= \frac{5}{2\Delta t}[12h - 6(y'_{l+1} + y'_l)\Delta t + (y''_{l+1} - y''_l)\Delta t^2] \\ &+ \frac{4}{2\Delta t}[-30h + (14y'_{l+1} + 16y'_l)\Delta t + (-2y''_{l+1} + 3y''_l)\Delta t^2] \\ &+ \frac{3}{2\Delta t}[20h - (8y'_{l+1} + 12y'_l)\Delta t + (y''_{l+1} - 3y''_l)\Delta t^2] \\ &+ y''_l\Delta t + y'_l \\ &= y'_{l+1} - y'_l - y''_l\Delta t + y''_l\Delta t + y'_l \\ &= y'_{l+1} \end{aligned}

The second-order derivative value is:

gml(Δt)=202Δt2[12h6(yl+1+yl)Δt+(yl+1yl)Δt2]+122Δt2[30h+(14yl+1+16yl)Δt+(2yl+1+3yl)Δt2]+62Δt2[20h(8yl+1+12yl)Δt+(yl+13yl)Δt2]+yl=yl+1yl+yl=yl+1\begin{aligned} g^l_m(\Delta t) &= \frac{20}{2\Delta t^2}[12h - 6(y'_{l+1} + y'_l)\Delta t + (y''_{l+1} - y''_l)\Delta t^2] \\ &+ \frac{12}{2\Delta t^2}[-30h + (14y'_{l+1} + 16y'_l)\Delta t + (-2y''_{l+1} + 3y''_l)\Delta t^2] \\ &+ \frac{6}{2\Delta t^2}[20h - (8y'_{l+1} + 12y'_l)\Delta t + (y''_{l+1} - 3y''_l)\Delta t^2] \\ &+ y''_l \\ &= y''_{l+1} - y''_l + y''_l \\ &= y''_{l+1} \end{aligned}