Skip to content

Commit 594aeac

Browse files
jstacclaude
andauthored
Fix grammar and add Wikipedia links to jax_intro.md (#445)
- Fix spelling: 'parallize' → 'parallelize' - Fix grammar: 'target JAX' → 'targets JAX' - Fix grammar: remove extra 'is' in 'JAX is as a drop-in' - Fix grammar: add missing 'is' in 'full control of random state' - Add Wikipedia links for NumPy, SciPy, automatic differentiation, functional programming, pure functions, deterministic, and side effects - Add link to JAX scipy documentation - Add cross-reference link to Numba exercise using {ref} 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <[email protected]>
1 parent 9171836 commit 594aeac

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

lectures/jax_intro.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ kernelspec:
1515

1616
This lecture provides a short introduction to [Google JAX](https://github.com/jax-ml/jax).
1717

18-
JAX is a high-performance scientific computing library that provides
18+
JAX is a high-performance scientific computing library that provides
1919

20-
* a NumPy-like interface that can automatically parallize across CPUs and GPUs,
20+
* a [NumPy](https://en.wikipedia.org/wiki/NumPy)-like interface that can automatically parallelize across CPUs and GPUs,
2121
* a just-in-time compiler for accelerating a large range of numerical
2222
operations, and
23-
* automatic differentiation.
23+
* [automatic differentiation](https://en.wikipedia.org/wiki/Automatic_differentiation).
2424

25-
Increasingly, JAX also maintains and provides more specialized scientific
26-
computing routines, such as those originally found in SciPy.
25+
Increasingly, JAX also maintains and provides [more specialized scientific
26+
computing routines](https://docs.jax.dev/en/latest/jax.scipy.html), such as those originally found in [SciPy](https://en.wikipedia.org/wiki/SciPy).
2727

2828
In addition to what's in Anaconda, this lecture will need the following libraries:
2929

@@ -36,7 +36,7 @@ In addition to what's in Anaconda, this lecture will need the following librarie
3636
```{admonition} GPU
3737
:class: warning
3838
39-
This lecture is accelerated via [hardware](status:machine-details) that has access to a GPU and target JAX for GPU programming.
39+
This lecture is accelerated via [hardware](status:machine-details) that has access to a GPU and targets JAX for GPU programming.
4040
4141
Free GPUs are available on Google Colab.
4242
To use this option, please click on the play icon top right, select Colab, and set the runtime environment to include a GPU.
@@ -50,7 +50,7 @@ If you would like to install JAX running on the `cpu` only you can use `pip inst
5050
One of the attractive features of JAX is that, whenever possible, its array
5151
processing operations conform to the NumPy API.
5252

53-
This means that, in many cases, we can use JAX is as a drop-in NumPy replacement.
53+
This means that, in many cases, we can use JAX as a drop-in NumPy replacement.
5454

5555
Let's look at the similarities and differences between JAX and NumPy.
5656

@@ -199,7 +199,7 @@ a, a_new
199199
```
200200

201201
The designers of JAX chose to make arrays immutable because JAX uses a
202-
*functional programming style*.
202+
[functional programming](https://en.wikipedia.org/wiki/Functional_programming) style.
203203

204204
This design choice has important implications, which we explore next!
205205

@@ -241,19 +241,19 @@ In other words, JAX assumes a functional programming style.
241241

242242
The major implication is that JAX functions should be pure.
243243

244-
**Pure functions** have the following characteristics:
244+
[Pure functions](https://en.wikipedia.org/wiki/Pure_function) have the following characteristics:
245245

246246
1. *Deterministic*
247247
2. *No side effects*
248248

249-
**Deterministic** means
249+
[Deterministic](https://en.wikipedia.org/wiki/Deterministic_algorithm) means
250250

251251
* Same input $\implies$ same output
252252
* Outputs do not depend on global state
253253

254254
In particular, pure functions will always return the same result if invoked with the same inputs.
255255

256-
**No side effects** means that the function
256+
[No side effects](https://en.wikipedia.org/wiki/Side_effect_(computer_science)) means that the function
257257

258258
* Won't change global state
259259
* Won't modify data passed to the function (immutable data)
@@ -307,7 +307,7 @@ At first you might find the syntax rather verbose.
307307
But you will soon realize that the syntax and semantics are necessary in order
308308
to maintain the functional programming style we just discussed.
309309

310-
Moreover, full control of random state
310+
Moreover, full control of random state is
311311
essential for parallel programming, such as when we want to run independent experiments along multiple threads.
312312

313313

@@ -793,8 +793,8 @@ We defer further exploration of automatic differentiation with JAX until {doc}`j
793793
:label: jax_intro_ex2
794794
```
795795

796-
In the Exercise section of {doc}`our lecture on Numba <numba>`, we used Monte
797-
Carlo to price a European call option.
796+
In the Exercise section of {doc}`our lecture on Numba <numba>`, we {ref}`used Monte
797+
Carlo to price a European call option <numba_ex4>`.
798798

799799
The code was accelerated by Numba-based multithreading.
800800

0 commit comments

Comments
 (0)