Skip to content

Commit 68fdada

Browse files
Circle CICircle CI
authored andcommitted
CircleCI update of dev docs (3300).
1 parent 1fe70c0 commit 68fdada

278 files changed

Lines changed: 94230 additions & 101423 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Binary file not shown.
Binary file not shown.
Binary file not shown.

master/_downloads/182cd2b5746acd3aca9f610eab3f97ef/plot_ssw_unif_torch.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
.. math::
1111
\min_{x} SSW_2(\nu, \frac{1}{n}\sum_{i=1}^n \delta_{x_i})
1212
13-
where :math:`\nu=\mathrm{Unif}(S^1)`.
13+
where :math:`\nu=\mathrm{Unif}(S^{d-1})`.
1414
1515
"""
1616

@@ -46,15 +46,18 @@
4646

4747

4848
def plot_sphere(ax):
49-
xlist = np.linspace(-1.0, 1.0, 50)
50-
ylist = np.linspace(-1.0, 1.0, 50)
51-
r = np.linspace(1.0, 1.0, 50)
52-
X, Y = np.meshgrid(xlist, ylist)
49+
# Create a sphere using spherical coordinates
50+
phi = np.linspace(0, 2 * np.pi, 100)
51+
theta = np.linspace(0, np.pi, 100)
52+
phi, theta = np.meshgrid(phi, theta)
5353

54-
Z = np.sqrt(np.maximum(r**2 - X**2 - Y**2, 0))
54+
# Compute the spherical coordinates
55+
X = np.sin(theta) * np.cos(phi)
56+
Y = np.sin(theta) * np.sin(phi)
57+
Z = np.cos(theta)
5558

59+
# Plot the wireframe
5660
ax.plot_wireframe(X, Y, Z, color="gray", alpha=0.3)
57-
ax.plot_wireframe(X, Y, -Z, color="gray", alpha=0.3) # Now plot the bottom half
5861

5962

6063
# plot the distributions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)