Skip to content

Week 4 into GSoC

So, the phase 1 coding period ends and let me summarize what I did for the last week. Let's bring back the tasks proposed at the end of week 3 and figure out how many I have completed -

  • Write tests for conjugate normal models with known mean/variance.
  • Configure atol argument for np.testing.assert_allclose.
  • Complete docs for optimizers by adding **kwargs option and writing corresponding maths equations.
  • Properly configure convergence checks and add an example to quickstart notebooks.
  • Configure autobatching.
  • Integrate Deterministics callbacks. (But I did it wrong)
  • Complete remaining Approximations.
    • Full Rank Approximation.
    • Low Rank Approximation.
  • Configure Minibatches.
  • Update quick_start notebook with respect to all changes above.

I was unable to complete a few tasks because I got stuck for many days figuring out how to correctly handle shapes in Full Rank ADVI. Finally I was able to come up with a new _build_logfn to handle shapes (on the guidelines provided by my mentor).

Experiments

Gist 1 - Source

I started the fourth week with a plan to include deterministics callbacks. Here are my experiments doing the same with PyMC4. All the determinitics are included in trace function. But when I opted for the same strategy to include deterministics while sampling, I got many shapes errors. The reason determinitics_callback failed because it assumes sample size = 1. We need to change this API.

Gist 2 - Source

My experiments involving how to configure Full Rank ADVI in TFP.

Gist 3 - Source

Comparisons drawn between PyMC3 and PyMC4 for 2-d Gaussians. TODO - complete comparisons for Mixture Distributions as well.

Tasks for the remaining GSoC period

From the API point of view, only 5 tasks are left for the GSoC -

  • Configure autobatching.
  • Configure Minibatches.
  • Add an option of progressbar.
  • Include deterministics samples.
  • Add convergence checks.

From the view of adding examples, all the notebooks from PyMC3 need to be ported to PyMC4.

For week 5, I look forward to add progressbar and convergence checks to PyMC4.

Comparing with timeline

I have already completed all the tasks proposed for phase 1 evaluations. Also I have added Mean Field and Full Rank Approximations which were proposed for phase 2 and phase 3 of GSoC coding period respectively.

I am thankful to my mentor for his constant guidance and pymc-devs for being such a supportive community.

Thank you for reading!

With ❤, Sayam


Last update: June 29, 2020

Comments