From 78f53c0f17fbabc05952cb081691c7de4d402d02 Mon Sep 17 00:00:00 2001 From: mmcky Date: Fri, 12 May 2023 12:23:03 +1000 Subject: [PATCH] centralize admonitions --- lectures/_admonition/gpu.md | 9 +++++++++ lectures/aiyagari_jax.md | 9 +-------- lectures/arellano.md | 9 +-------- lectures/inventory_dynamics.md | 9 +-------- lectures/jax_intro.md | 9 +-------- lectures/kesten_processes.md | 9 +-------- lectures/newtons_method.md | 9 +-------- lectures/opt_invest.md | 9 +-------- lectures/opt_savings.md | 9 +-------- lectures/short_path.md | 9 +-------- lectures/wealth_dynamics.md | 9 +-------- 11 files changed, 19 insertions(+), 80 deletions(-) create mode 100644 lectures/_admonition/gpu.md diff --git a/lectures/_admonition/gpu.md b/lectures/_admonition/gpu.md new file mode 100644 index 00000000..a26a3429 --- /dev/null +++ b/lectures/_admonition/gpu.md @@ -0,0 +1,9 @@ +```{admonition} GPU +:class: warning + +This lecture is accelerated via [hardware](status:machine-details) that has access to a GPU and JAX for GPU programming. + +Free GPUs are available on Google Colab. To use this option, please click on the play icon top right, select Colab, and set the runtime environment to include a GPU. + +Alternatively, if you have your own GPU, you can follow the [instructions](https://github.com/google/jax) for installing JAX with GPU support. If you would like to install JAX running on the `cpu` only you can use `pip install jax[cpu]` +``` \ No newline at end of file diff --git a/lectures/aiyagari_jax.md b/lectures/aiyagari_jax.md index e180e65f..13eeb4c7 100644 --- a/lectures/aiyagari_jax.md +++ b/lectures/aiyagari_jax.md @@ -13,14 +13,7 @@ kernelspec: # The Aiyagari Model -```{admonition} GPU -:class: warning - -This lecture is accelerated via [hardware](status:machine-details) that has access to a GPU and JAX for GPU programming. - -Free GPUs are available on Google Colab. To use this option, please click on the play icon top right, select Colab, and set the runtime environment to include a GPU. - -Alternatively, if you have your own GPU, you can follow the [instructions](https://github.com/google/jax) for installing JAX with GPU support. If you would like to install JAX running on the `cpu` only you can use `pip install jax[cpu]` +```{include} _admonition/gpu.md ``` ## Overview diff --git a/lectures/arellano.md b/lectures/arellano.md index cf06bbf2..7239dde7 100644 --- a/lectures/arellano.md +++ b/lectures/arellano.md @@ -13,14 +13,7 @@ kernelspec: # Default Risk and Income Fluctuations -```{admonition} GPU -:class: warning - -This lecture is accelerated via [hardware](status:machine-details) that has access to a GPU and JAX for GPU programming. - -Free GPUs are available on Google Colab. To use this option, please click on the play icon top right, select Colab, and set the runtime environment to include a GPU. - -Alternatively, if you have your own GPU, you can follow the [instructions](https://github.com/google/jax) for installing JAX with GPU support. If you would like to install JAX running on the `cpu` only you can use `pip install jax[cpu]` +```{include} _admonition/gpu.md ``` In addition to what's in Anaconda, this lecture will need the following libraries: diff --git a/lectures/inventory_dynamics.md b/lectures/inventory_dynamics.md index d91db045..896df060 100644 --- a/lectures/inventory_dynamics.md +++ b/lectures/inventory_dynamics.md @@ -23,14 +23,7 @@ kernelspec: # Inventory Dynamics -```{admonition} GPU -:class: warning - -This lecture is accelerated via [hardware](status:machine-details) that has access to a GPU and JAX for GPU programming. - -Free GPUs are available on Google Colab. To use this option, please click on the play icon top right, select Colab, and set the runtime environment to include a GPU. - -Alternatively, if you have your own GPU, you can follow the [instructions](https://github.com/google/jax) for installing JAX with GPU support. If you would like to install JAX running on the `cpu` only you can use `pip install jax[cpu]` +```{include} _admonition/gpu.md ``` ```{index} single: Markov process, inventory diff --git a/lectures/jax_intro.md b/lectures/jax_intro.md index e7f0acc6..02e5ae6f 100644 --- a/lectures/jax_intro.md +++ b/lectures/jax_intro.md @@ -14,14 +14,7 @@ kernelspec: # An Introduction to JAX -```{admonition} GPU -:class: warning - -This lecture is accelerated via [hardware](status:machine-details) that has access to a GPU and JAX for GPU programming. - -Free GPUs are available on Google Colab. To use this option, please click on the play icon top right, select Colab, and set the runtime environment to include a GPU. - -Alternatively, if you have your own GPU, you can follow the [instructions](https://github.com/google/jax) for installing JAX with GPU support. If you would like to install JAX running on the `cpu` only you can use `pip install jax[cpu]` +```{include} _admonition/gpu.md ``` This lecture provides a short introduction to [Google JAX](https://github.com/google/jax). diff --git a/lectures/kesten_processes.md b/lectures/kesten_processes.md index 67943735..03db12fb 100644 --- a/lectures/kesten_processes.md +++ b/lectures/kesten_processes.md @@ -29,14 +29,7 @@ kernelspec: :depth: 2 ``` -```{admonition} GPU -:class: warning - -This lecture is accelerated via [hardware](status:machine-details) that has access to a GPU and JAX for GPU programming. - -Free GPUs are available on Google Colab. To use this option, please click on the play icon top right, select Colab, and set the runtime environment to include a GPU. - -Alternatively, if you have your own GPU, you can follow the [instructions](https://github.com/google/jax) for installing JAX with GPU support. If you would like to install JAX running on the `cpu` only you can use `pip install jax[cpu]` +```{include} _admonition/gpu.md ``` In addition to what's in Anaconda, this lecture will need the following libraries: diff --git a/lectures/newtons_method.md b/lectures/newtons_method.md index a8a8e168..01d097ba 100644 --- a/lectures/newtons_method.md +++ b/lectures/newtons_method.md @@ -14,14 +14,7 @@ kernelspec: # Newton’s Method via JAX -```{admonition} GPU -:class: warning - -This lecture is accelerated via [hardware](status:machine-details) that has access to a GPU and JAX for GPU programming. - -Free GPUs are available on Google Colab. To use this option, please click on the play icon top right, select Colab, and set the runtime environment to include a GPU. - -Alternatively, if you have your own GPU, you can follow the [instructions](https://github.com/google/jax) for installing JAX with GPU support. If you would like to install JAX running on the `cpu` only you can use `pip install jax[cpu]` +```{include} _admonition/gpu.md ``` ## Overview diff --git a/lectures/opt_invest.md b/lectures/opt_invest.md index 5d87af87..99fe9a69 100644 --- a/lectures/opt_invest.md +++ b/lectures/opt_invest.md @@ -14,14 +14,7 @@ kernelspec: # Optimal Investment -```{admonition} GPU -:class: warning - -This lecture is accelerated via [hardware](status:machine-details) that has access to a GPU and JAX for GPU programming. - -Free GPUs are available on Google Colab. To use this option, please click on the play icon top right, select Colab, and set the runtime environment to include a GPU. - -Alternatively, if you have your own GPU, you can follow the [instructions](https://github.com/google/jax) for installing JAX with GPU support. If you would like to install JAX running on the `cpu` only you can use `pip install jax[cpu]` +```{include} _admonition/gpu.md ``` We require the following library to be installed. diff --git a/lectures/opt_savings.md b/lectures/opt_savings.md index 694b1751..ffe12ef0 100644 --- a/lectures/opt_savings.md +++ b/lectures/opt_savings.md @@ -13,14 +13,7 @@ kernelspec: # Optimal Savings -```{admonition} GPU -:class: warning - -This lecture is accelerated via [hardware](status:machine-details) that has access to a GPU and JAX for GPU programming. - -Free GPUs are available on Google Colab. To use this option, please click on the play icon top right, select Colab, and set the runtime environment to include a GPU. - -Alternatively, if you have your own GPU, you can follow the [instructions](https://github.com/google/jax) for installing JAX with GPU support. If you would like to install JAX running on the `cpu` only you can use `pip install jax[cpu]` +```{include} _admonition/gpu.md ``` In addition to what’s in Anaconda, this lecture will need the following libraries: diff --git a/lectures/short_path.md b/lectures/short_path.md index 53b3c776..784adad8 100644 --- a/lectures/short_path.md +++ b/lectures/short_path.md @@ -15,14 +15,7 @@ kernelspec: # Shortest Paths -```{admonition} GPU -:class: warning - -This lecture is accelerated via [hardware](status:machine-details) that has access to a GPU and JAX for GPU programming. - -Free GPUs are available on Google Colab. To use this option, please click on the play icon top right, select Colab, and set the runtime environment to include a GPU. - -Alternatively, if you have your own GPU, you can follow the [instructions](https://github.com/google/jax) for installing JAX with GPU support. If you would like to install JAX running on the `cpu` only you can use `pip install jax[cpu]` +```{include} _admonition/gpu.md ``` ## Overview diff --git a/lectures/wealth_dynamics.md b/lectures/wealth_dynamics.md index 46d83317..21d3da3f 100644 --- a/lectures/wealth_dynamics.md +++ b/lectures/wealth_dynamics.md @@ -14,14 +14,7 @@ kernelspec: # Wealth Distribution Dynamics -```{admonition} GPU -:class: warning - -This lecture is accelerated via [hardware](status:machine-details) that has access to a GPU and JAX for GPU programming. - -Free GPUs are available on Google Colab. To use this option, please click on the play icon top right, select Colab, and set the runtime environment to include a GPU. - -Alternatively, if you have your own GPU, you can follow the [instructions](https://github.com/google/jax) for installing JAX with GPU support. If you would like to install JAX running on the `cpu` only you can use `pip install jax[cpu]` +```{include} _admonition/gpu.md ``` This lecture is the extended JAX implementation of [this lecture](https://python.quantecon.org/wealth_dynamics.html).