Skip to content

Commit

Permalink
update sim example in readme (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorStoneAstro authored Sep 26, 2024
1 parent f1c3ff5 commit 04d0c71
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ x = torch.tensor([
5.0, -0.2, 0.0, 0.8, 0.0, 1., 1.0, 10.0
]) # fmt: skip

minisim = caustics.LensSource(
sim = caustics.LensSource(
lens=sie, source=src, lens_light=lnslt, pixelscale=0.05, pixels_x=100
)
plt.imshow(minisim(x, quad_level=3), origin="lower")
plt.imshow(sim(x), origin="lower")
plt.axis("off")
plt.show()
```
Expand All @@ -63,7 +63,7 @@ plt.show()
newx = x.repeat(20, 1)
newx += torch.normal(mean=0, std=0.1 * torch.ones_like(newx))

images = torch.vmap(minisim)(newx)
images = torch.vmap(sim)(newx)

fig, axarr = plt.subplots(4, 5, figsize=(20, 16))
for ax, im in zip(axarr.flatten(), images):
Expand All @@ -76,7 +76,7 @@ plt.show()
### Automatic Differentiation

```python
J = torch.func.jacfwd(minisim)(x)
J = torch.func.jacfwd(sim)(x)

# Plot the new images
fig, axarr = plt.subplots(3, 7, figsize=(20, 9))
Expand Down

0 comments on commit 04d0c71

Please sign in to comment.