Skip to content

Instantly share code, notes, and snippets.

View karm-patel's full-sized avatar

Karm Patel karm-patel

View GitHub Profile

GSoC 2022: Final Report

Getting accepted as a GSoC contributor and working with Dr. Kevin Murphy was a dream!

In this post, I will share my GSoC'22 journey with the TensorFlow organization on the project "JAX ML Textbook" mentored by Dr. Kevin Murphy. The project contains the tasks related to the upcoming textbook Probabilistic Machine Learning: Advanced Topics (book2) and the existing textbook Probabilistic Machine Learning: An Introduction (book1) by Dr. Murphy. I contributed in mainly two repos - 1) probml/pyprobml: A public repo where the code is published. 2) probml/bookv2: A private repo for the changes in the latex source code of the textbook.

Highlights

  • Created 75 PRs in public probml/pyprobml repo & 25 PRs in probml/probml-utils
  • Created 35 PRs i

Understanding the workflows

There are 3 workflows that need to be passed after creating the PR.

image

1. black_format

This workflow checks if all notebooks are formatted as per black's guidelines. There are two ways to apply black on notebooks.

a) Manually:

$ pip install black[jupyter]==22.3.0 # check this version in requirements-dev.txt
@karm-patel
karm-patel / pre-commit.md
Last active May 17, 2022 07:48
pre-commit and black

1. What is black[jupyter]

It take care of code formating of our notebook. When black jupyter is applied on our notebook some changes is done in our notebook. For example var=1 would be converted to var = 1.

2. what is pre-commit? Why do we need this?

Pre-commit is like security check at airport. When we commit something it will open our notebooks/files and check with some configurations. In our case it will apply black on that and change the notebook. Hence, pre-commit will takecare of our code formatting.

Setup black in pre-commit

As mentioned in this instrcutions, do following steps

Task: Solve the error for the given jupyter notebooks.

  1. Configure python 3.7.13 in your PC. I recommend you to use conda enviornment of python 3.7.13 and use WSL in case of windows OS.
  2. fork master repo (pyprobml). In your fork repo, enable github actions using GUI. click on I understand.... them button. image
  3. Usually we create new branch, then make changes. But in this task, we need to make changes in master branch only, because your changes will be applied on your PR's workflow if you make change in master branch.
  4. So make changes in master branch. And check if notebook runs in google colab also.
  5. Once done push the code in your local repo. This will trigger workflow like below image
  6. Once all workflows are executed, you can click on branch "w
@karm-patel
karm-patel / bw_adjust.md
Created April 14, 2022 06:26
bw_adjust
No bw_adjust bw_adjust = 1.5 bw_adjust = 2.0
image image image
@karm-patel
karm-patel / student_laplace_pdf_plot.md
Created April 7, 2022 14:10
student_laplace_pdf_plot.ipynb
Before PR After PR
image image
@karm-patel
karm-patel / iris_logreg.md
Created April 4, 2022 12:36
iris_logreg.ipynb
Before PR After PR
image image
@karm-patel
karm-patel / activation_function_plot.md
Last active April 2, 2022 15:29
activation_function_plot.ipynb
Before PR After PR
image ![image](image