HazyResearch / hippo-code

Apache License 2.0
168 stars 30 forks source link

Matrix B of HiPPO-LegS #11

Open kenkenpa2126 opened 9 months ago

kenkenpa2126 commented 9 months ago

I have a question concerning the derivation found in Appendix D.1.2 of the LSSL paper, specifically equation (18), which is given as:

$$ \begin{align} \dot{x}_n (t) &= u(t) p_n(t,t) \omega (t, t) + \int^t_0 u(Y) (\frac{\partial}{\partial t} p_n (t, Y)) \omega (t, Y) dY + \int^t_0 u(Y) p_n (t, Y) (\frac{\partial}{\partial t} \omega (t, Y) ) dY \end{align} $$

(Correctly, $u(Y)$ in the third term of the equation, which was denoted as $f(Y)$ in the paper. I thought this is a typo, considering that the paper introduces $h(t, Y) =u(Y) p_n(t,Y) \omega (t, Y)$.)

The first term is interpreted as follows to derive the HiPPO-LegS ODE:

$$ u(t) p_n(t,t) \omega (t, t) = (2n+1)^{\frac{1}{2}} t^{-1} u(t) $$

However this term was omitted in the HiPPO paper's Appendix D.3 derivation of the HiPPO-LegS, I think that including this term modifies the coefficient $B$ from $B = (2n+1)^{\frac{1}{2}}$ to $B = 2(2n+1)^{\frac{1}{2}}$.

Could you let me know about this discrepancy between these derivations?

albertfgu commented 9 months ago

I don't remember exactly details of the LSSL derivation. However, I am sure that the HIPPO formulas are correct. Note that this repo is deprecated: I would check out the repo github.com/state-spaces/s4 instead. There you can find visualizations under notebooks/ of the HIPPO methods showing that their formulas are correct.

Note that the LSSL paper is also "deprecated": its derivations are generalized and simplified by followups, including the S4 paper (https://arxiv.org/abs/2111.00396) and HTTYH paper (https://arxiv.org/abs/2206.12037). The latter in particular should have more correct derivations of the HIPPO-LegS ODE.