diff --git a/.ci/docker/common/install_docs_reqs.sh b/.ci/docker/common/install_docs_reqs.sh index 541c9976ad1..9617443200a 100644 --- a/.ci/docker/common/install_docs_reqs.sh +++ b/.ci/docker/common/install_docs_reqs.sh @@ -13,7 +13,9 @@ echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/source apt-get update apt-get install -y --no-install-recommends yarn -yarn global add katex --prefix /usr/local +# Pin katex: 0.18.5 switched to commander@^15, which requires Node >= 22.12 +# while this image installs Node 20, and yarn enforces engines strictly. +yarn global add katex@0.18.4 --prefix /usr/local sudo apt-get -y install doxygen diff --git a/.ci/docker/requirements.txt b/.ci/docker/requirements.txt index a1b0d6b5b37..547a72e9889 100644 --- a/.ci/docker/requirements.txt +++ b/.ci/docker/requirements.txt @@ -22,7 +22,10 @@ pytorch_sphinx_theme2==0.4.9 tqdm==4.66.1 numpy==1.24.4 pydantic>=2.10 -fastapi +# Pin fastapi: 0.139.2 made router route building thread-safe by adding an +# _effective_routes_lock (threading.Lock) to APIRouter, which ray[serve]'s +# @serve.ingress cannot cloudpickle. ray declares fastapi unbounded. +fastapi<0.139.2 matplotlib librosa torch==2.13 diff --git a/intermediate_source/parametrizations.py b/intermediate_source/parametrizations.py index 59cff1d241c..bfd86e8b1e8 100644 --- a/intermediate_source/parametrizations.py +++ b/intermediate_source/parametrizations.py @@ -321,8 +321,15 @@ def right_inverse(self, A): print(torch.dist(layer_orthogonal.weight, X)) # layer_orthogonal.weight == X ############################################################################### -# This initialization step can be written more succinctly as -layer_orthogonal.weight = nn.init.orthogonal_(layer_orthogonal.weight) +# This initialization step can be written more succinctly by sampling straight +# into ``layer_orthogonal.weight``. The determinant correction is still needed: +# ``nn.init.orthogonal_`` samples from ``O(3)``, and when ``det(A) = -1`` the +# matrix has an eigenvalue at ``-1``, which makes the ``A + I`` that +# ``CayleyMap.right_inverse`` inverts singular. +X = nn.init.orthogonal_(layer_orthogonal.weight) +if X.det() < 0.: + X[0].neg_() +layer_orthogonal.weight = X ############################################################################### # The name of this method comes from the fact that we would often expect