Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .ci/docker/common/install_docs_reqs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion .ci/docker/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions intermediate_source/parametrizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading