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
6 changes: 6 additions & 0 deletions lectures/aiyagari_jax.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ import jax
import jax.numpy as jnp
```

Let's check the GPU we are running

```{code-cell} ipython3
!nvidia-smi
```

We will use 64 bit floats with JAX in order to increase the precision.

```{code-cell} ipython3
Expand Down
10 changes: 9 additions & 1 deletion lectures/arellano.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,16 @@ import jax
import jax.numpy as jnp
```

Let's check the GPU we are running

```{code-cell} ipython3
!nvidia-smi
```

We will use 64 bit floats with JAX in order to increase the precision.

```{code-cell} ipython3
jax.config.update('jax_enable_x64', True)
jax.config.update("jax_enable_x64", True)
```

## Structure
Expand Down
5 changes: 5 additions & 0 deletions lectures/ifp_egm.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ from numba import njit, float64
from numba.experimental import jitclass
```

Let's check the GPU we are running

```{code-cell} ipython3
!nvidia-smi
```

We use 64 bit floating point numbers for extra precision.

Expand Down
8 changes: 2 additions & 6 deletions lectures/inventory_dynamics.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,10 @@ from jax import random, lax
from collections import namedtuple
```

Lets check the backend used by JAX and the devices available
Let's check the GPU we are running

```{code-cell} ipython3
# Check if JAX is using GPU
print(f"JAX backend: {jax.devices()[0].platform}")

# Check the devices available for JAX
print(jax.devices())
!nvidia-smi
```

## Sample paths
Expand Down
6 changes: 6 additions & 0 deletions lectures/kesten_processes.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ import jax.numpy as jnp
from jax import random
```

Let's check the GPU we are running

```{code-cell} ipython3
!nvidia-smi
```

## Kesten processes

```{index} single: Kesten processes; heavy tails
Expand Down
6 changes: 6 additions & 0 deletions lectures/newtons_method.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ import jax.numpy as jnp
from scipy.optimize import root
```

Let's check the GPU we are running

```{code-cell} ipython3
!nvidia-smi
```

## The Equilibrium Problem

In this section we describe the market equilibrium problem we will solve with
Expand Down
7 changes: 6 additions & 1 deletion lectures/opt_invest.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ We require the following library to be installed.
!pip install --upgrade quantecon
```


A monopolist faces inverse demand
curve

Expand Down Expand Up @@ -66,6 +65,12 @@ import jax.numpy as jnp
import matplotlib.pyplot as plt
```

Let's check the GPU we are running

```{code-cell} ipython3
!nvidia-smi
```

We will use 64 bit floats with JAX in order to increase the precision.

```{code-cell} ipython3
Expand Down
6 changes: 6 additions & 0 deletions lectures/opt_savings.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ import matplotlib.pyplot as plt
import time
```

Let's check the GPU we are running

```{code-cell} ipython3
!nvidia-smi
```

Use 64 bit floats with JAX in order to match NumPy code
- By default, JAX uses 32-bit datatypes.
- By default, NumPy uses 64-bit datatypes.
Expand Down
6 changes: 6 additions & 0 deletions lectures/short_path.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ import jax.numpy as jnp
import jax
```

Let's check the GPU we are running

```{code-cell} ipython3
!nvidia-smi
```

## Solving for Minimum Cost-to-Go

Let $J(v)$ denote the minimum cost-to-go from node $v$,
Expand Down
6 changes: 6 additions & 0 deletions lectures/status.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,10 @@ You can check the backend used by JAX using:
import jax
# Check if JAX is using GPU
print(f"JAX backend: {jax.devices()[0].platform}")
```

and the hardware we are running on:

```{code-cell} ipython3
!nvidia-smi
```
2 changes: 1 addition & 1 deletion lectures/wealth_dynamics.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import jax.numpy as jnp
from collections import namedtuple
```

Let's check the hardware we are running on:
Let's check the GPU we are running

```{code-cell} ipython3
!nvidia-smi
Expand Down