Skip to content

Commit b4b55b5

Browse files
committed
Update README
1 parent dafcf06 commit b4b55b5

File tree

2 files changed

+81
-81
lines changed

2 files changed

+81
-81
lines changed

README.md

Lines changed: 18 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -10,94 +10,49 @@ This is work in progress, so expect rough edges!
1010

1111
## Running the notebooks
1212

13-
The scripts needed to make all the figures for each chapter are automatically combined together into a series of Jupyter notebooks, one per chapter.
14-
* [Volume 1 figure notebooks](https://github.com/probml/pml-book/tree/main/pml1/)
15-
* [Volume 2 figure notebooks](https://github.com/probml/pml-book/tree/main/pml2). (Note: volume 2 is not finished yet.)
13+
The notebooks needed to make all the figures are available at the following locations.
1614

17-
In addition to the automatically generated notebooks, there are a series of manually created notebooks, which create additional figures, and provide supplementary material for the book. These are stored in the [notebooks repo](https://github.com/probml/probml-notebooks), since they can be quite large. Some of these notebooks use the scripts mentioned above, but others are independent of the book content.
15+
* [Volume 1 figure notebooks](https://github.com/probml/pyprobml/tree/master/notebooks/book1)
16+
* [Volume 2 figure notebooks](https://github.com/probml/pyprobml/tree/master/notebooks/book2). (Note: volume 2 is not finished yet.)
1817

19-
The easiest way to run these notebooks is inside [Colab](https://colab.research.google.com/notebooks/intro.ipynb). This has most of the libraries you will need (e.g., scikit-learn, JAX) pre-installed, and gives you access to a free GPU and TPU. We have a created a [intro to colab](https://colab.research.google.com/github/probml/probml-notebooks/blob/main/notebooks/colab_intro.ipynb) notebook with more details.
18+
Notebooks are saved in chapter-wise folders. For example, a notebook for figure 2.3 is saved in the folder `notebooks/book1/02/`.
2019

20+
In addition to the figure notebooks, there are a series of manually created notebooks, which create additional figures, and provide supplementary material for the book. These are stored in the [`misc` folder](https://github.com/probml/pyprobml/tree/master/notebooks/misc).
2121

22-
## Running scripts in colab
22+
### Running notebooks in colab
2323

24-
The easiest way to run individual scripts is inside [Colab](https://colab.research.google.com/notebooks/intro.ipynb).
25-
Just cut and paste this into a code cell:
26-
```py
27-
%pip install superimport
28-
!git clone --depth 1 https://github.com/probml/pyprobml &> /dev/null # THIS CODEBASE
29-
```
30-
Note: The [superimport](https://colab.research.google.com/github/probml/probml-notebooks/blob/main/notebooks/Superimport.ipynb)
31-
library will automatically install packages for any file which contains the line `import superimport'.
32-
33-
Then run a script from a cell like this:
34-
```py
35-
%run pyprobml/scripts/softmax_plot.py
36-
```
37-
38-
39-
To edit a file locally and then run it, follow the example below.
40-
```py
41-
# Make sure local changes to file are detected by runtime
42-
%load_ext autoreload
43-
%autoreload 2
24+
[Colab](https://colab.research.google.com/notebooks/intro.ipynb) has most of the libraries you will need (e.g., scikit-learn, JAX) pre-installed, and gives you access to a free GPU and TPU. We have a created a [intro to colab](https://colab.research.google.com/github/probml/probml-notebooks/blob/main/notebooks/colab_intro.ipynb) notebook with more details. To run the notebooks on colab in any browser, you can go to a particular notebook on GitHub and change the domain from `github.com` to `githubtocolab.com` as suggeted [here](https://stackoverflow.com/a/67344477/13330701). If you are using Google Chrome browser, you can use ["Open in Colab" Chrome extension](https://chrome.google.com/webstore/detail/open-in-colab/iogfkhleblhcpcekbiedikdehleodpjo) to do the same with a single click.
4425

45-
file = 'pyprobml/scripts/softmax_plot.py' # change this filename as needed
46-
from google.colab import files
47-
files.view(file) # open editor
48-
49-
%run $file
50-
```
51-
52-
To download and run code from github, follow the example below.
53-
(Note the `raw` in the URL.)
54-
```py
55-
!wget -q https://raw.githubusercontent.com/probml/pyprobml/master/scripts/softmax_plot.py
56-
%run softmax_plot.py
57-
```
58-
59-
## Running the scripts locally
26+
## Running the noteboks locally
6027

6128
We assume you have already installed [JAX](https://github.com/google/jax#installation) and
6229
[Tensorflow](https://www.tensorflow.org/install) and [Torch](https://pytorch.org/),
6330
since the details on how to do this depend on whether you have a CPU, GPU, etc.
6431

65-
For the remaining python packages, do this:
66-
```bash
67-
pip install superimport
68-
git clone --depth 1 https://github.com/probml/pyprobml &> /dev/null # THIS CODEBASE
69-
```
70-
71-
Note: The [superimport](https://colab.research.google.com/github/probml/probml-notebooks/blob/main/notebooks/Superimport.ipynb)
72-
library will automatically install packages for any file which contains the line `import superimport'.
32+
You can use any of the following options to install the other requirements.
7333

34+
* Option 1
7435

75-
To manually execute an individual script from the command line,
76-
follow this example:
7736
```bash
78-
python3 pyprobml/scripts/softmax_plot.py
37+
pip install -r https://raw.githubusercontent.com/probml/pyprobml/master/requirements.txt
7938
```
80-
This will run the script, plot a figure, and save the result to the `pyprobml/figures` directory.
8139

82-
## Running scripts for vol 2
40+
* Option 2
8341

84-
Some demos for vol 2 use [JSL (Jax State-space Library)](https://github.com/probml/JSL).
85-
This requires extra packages, see [these installation instructions](https://github.com/probml/JSL#installation).
86-
Then you can run the pyprobml version of the JSL demos like this
87-
```
88-
%run pyprobml/scripts/kf_tracking_demo.py # colab
89-
python3 pyprobml/scripts/kf_tracking_demo.py # locally
90-
```
42+
Download [requirements.txt](https://github.com/probml/pyprobml/blob/master/requirements.txt) locally to your path and run
9143

44+
```bash
45+
pip install -r requirements.txt
46+
```
9247

9348
## GCP, TPUs, and all that
9449

95-
When you want more power or control than colab gives you, you should get a Google Cloud Platform (GCP) account, and get access to a TPU VM. You can then use this as a virtual desktop which you can access via ssh from inside VScode. We have created [various tutorials on Colab, GCP and TPUs](https://github.com/probml/probml-notebooks/blob/main/markdown/colab_gcp_tpu_tutorial.md) with more information.
50+
When you want more power or control than colab gives you, you should get a Google Cloud Platform (GCP) account, and get access to a TPU VM. You can then use this as a virtual desktop which you can access via ssh from inside VScode. We have created [various tutorials on Colab, GCP and TPUs](https://github.com/probml/pyprobml/blob/master/tutorials/colab_gcp_tpu_tutorial.md) with more information.
9651

9752

9853
## How to contribute
9954

100-
See [this guide](https://github.com/probml/pyprobml/blob/master/CONTRIBUTING.md) for how to contribute code.
55+
See [this guide](https://github.com/probml/pyprobml/blob/master/CONTRIBUTING.md) for how to contribute code. Please follow [these guidelines](https://github.com/probml/pyprobml/blob/master/notebooks/README.md) to contribute new notebooks to the notebooks directory.
10156

10257

10358
## Metrics

README_new.md renamed to README_deprecated.md

Lines changed: 63 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,49 +10,94 @@ This is work in progress, so expect rough edges!
1010

1111
## Running the notebooks
1212

13-
The notebooks needed to make all the figures are available at the following locations.
13+
The scripts needed to make all the figures for each chapter are automatically combined together into a series of Jupyter notebooks, one per chapter.
14+
* [Volume 1 figure notebooks](https://github.com/probml/pml-book/tree/main/pml1/)
15+
* [Volume 2 figure notebooks](https://github.com/probml/pml-book/tree/main/pml2). (Note: volume 2 is not finished yet.)
1416

15-
* [Volume 1 figure notebooks](https://github.com/probml/pyprobml/tree/master/notebooks/book1)
16-
* [Volume 2 figure notebooks](https://github.com/probml/pyprobml/tree/master/notebooks/book2). (Note: volume 2 is not finished yet.)
17+
In addition to the automatically generated notebooks, there are a series of manually created notebooks, which create additional figures, and provide supplementary material for the book. These are stored in the [notebooks repo](https://github.com/probml/probml-notebooks), since they can be quite large. Some of these notebooks use the scripts mentioned above, but others are independent of the book content.
1718

18-
Notebooks are saved in chapter-wise folders. For example, a notebook for figure 2.3 is saved in the folder `notebooks/book1/02/`.
19+
The easiest way to run these notebooks is inside [Colab](https://colab.research.google.com/notebooks/intro.ipynb). This has most of the libraries you will need (e.g., scikit-learn, JAX) pre-installed, and gives you access to a free GPU and TPU. We have a created a [intro to colab](https://colab.research.google.com/github/probml/probml-notebooks/blob/main/notebooks/colab_intro.ipynb) notebook with more details.
1920

20-
In addition to the figure notebooks, there are a series of manually created notebooks, which create additional figures, and provide supplementary material for the book. These are stored in the [`misc` folder](https://github.com/probml/pyprobml/tree/master/notebooks/misc).
2121

22-
### Running notebooks in colab
22+
## Running scripts in colab
2323

24-
[Colab](https://colab.research.google.com/notebooks/intro.ipynb) has most of the libraries you will need (e.g., scikit-learn, JAX) pre-installed, and gives you access to a free GPU and TPU. We have a created a [intro to colab](https://colab.research.google.com/github/probml/probml-notebooks/blob/main/notebooks/colab_intro.ipynb) notebook with more details. To run the notebooks on colab in any browser, you can go to a particular notebook on GitHub and change the domain from `github.com` to `githubtocolab.com` as suggeted [here](https://stackoverflow.com/a/67344477/13330701). If you are using Google Chrome browser, you can use ["Open in Colab" Chrome extension](https://chrome.google.com/webstore/detail/open-in-colab/iogfkhleblhcpcekbiedikdehleodpjo) to do the same with a single click.
24+
The easiest way to run individual scripts is inside [Colab](https://colab.research.google.com/notebooks/intro.ipynb).
25+
Just cut and paste this into a code cell:
26+
```py
27+
%pip install superimport
28+
!git clone --depth 1 https://github.com/probml/pyprobml &> /dev/null # THIS CODEBASE
29+
```
30+
Note: The [superimport](https://colab.research.google.com/github/probml/probml-notebooks/blob/main/notebooks/Superimport.ipynb)
31+
library will automatically install packages for any file which contains the line `import superimport'.
32+
33+
Then run a script from a cell like this:
34+
```py
35+
%run pyprobml/scripts/softmax_plot.py
36+
```
37+
38+
39+
To edit a file locally and then run it, follow the example below.
40+
```py
41+
# Make sure local changes to file are detected by runtime
42+
%load_ext autoreload
43+
%autoreload 2
2544

26-
## Running the noteboks locally
45+
file = 'pyprobml/scripts/softmax_plot.py' # change this filename as needed
46+
from google.colab import files
47+
files.view(file) # open editor
48+
49+
%run $file
50+
```
51+
52+
To download and run code from github, follow the example below.
53+
(Note the `raw` in the URL.)
54+
```py
55+
!wget -q https://raw.githubusercontent.com/probml/pyprobml/master/scripts/softmax_plot.py
56+
%run softmax_plot.py
57+
```
58+
59+
## Running the scripts locally
2760

2861
We assume you have already installed [JAX](https://github.com/google/jax#installation) and
2962
[Tensorflow](https://www.tensorflow.org/install) and [Torch](https://pytorch.org/),
3063
since the details on how to do this depend on whether you have a CPU, GPU, etc.
3164

32-
You can use any of the following options to install the other requirements.
33-
34-
* Option 1
35-
65+
For the remaining python packages, do this:
3666
```bash
37-
pip install -r https://raw.githubusercontent.com/probml/pyprobml/master/requirements.txt
67+
pip install superimport
68+
git clone --depth 1 https://github.com/probml/pyprobml &> /dev/null # THIS CODEBASE
3869
```
3970

40-
* Option 2
71+
Note: The [superimport](https://colab.research.google.com/github/probml/probml-notebooks/blob/main/notebooks/Superimport.ipynb)
72+
library will automatically install packages for any file which contains the line `import superimport'.
4173

42-
Download [requirements.txt](https://github.com/probml/pyprobml/blob/master/requirements.txt) locally to your path and run
4374

75+
To manually execute an individual script from the command line,
76+
follow this example:
4477
```bash
45-
pip install -r requirements.txt
78+
python3 pyprobml/scripts/softmax_plot.py
79+
```
80+
This will run the script, plot a figure, and save the result to the `pyprobml/figures` directory.
81+
82+
## Running scripts for vol 2
83+
84+
Some demos for vol 2 use [JSL (Jax State-space Library)](https://github.com/probml/JSL).
85+
This requires extra packages, see [these installation instructions](https://github.com/probml/JSL#installation).
86+
Then you can run the pyprobml version of the JSL demos like this
4687
```
88+
%run pyprobml/scripts/kf_tracking_demo.py # colab
89+
python3 pyprobml/scripts/kf_tracking_demo.py # locally
90+
```
91+
4792

4893
## GCP, TPUs, and all that
4994

50-
When you want more power or control than colab gives you, you should get a Google Cloud Platform (GCP) account, and get access to a TPU VM. You can then use this as a virtual desktop which you can access via ssh from inside VScode. We have created [various tutorials on Colab, GCP and TPUs](https://github.com/probml/pyprobml/blob/master/tutorials/colab_gcp_tpu_tutorial.md) with more information.
95+
When you want more power or control than colab gives you, you should get a Google Cloud Platform (GCP) account, and get access to a TPU VM. You can then use this as a virtual desktop which you can access via ssh from inside VScode. We have created [various tutorials on Colab, GCP and TPUs](https://github.com/probml/probml-notebooks/blob/main/markdown/colab_gcp_tpu_tutorial.md) with more information.
5196

5297

5398
## How to contribute
5499

55-
See [this guide](https://github.com/probml/pyprobml/blob/master/CONTRIBUTING.md) for how to contribute code. Please follow [these guidelines](https://github.com/probml/pyprobml/blob/master/notebooks/README.md) to contribute new notebooks to the notebooks directory.
100+
See [this guide](https://github.com/probml/pyprobml/blob/master/CONTRIBUTING.md) for how to contribute code.
56101

57102

58103
## Metrics

0 commit comments

Comments
 (0)