# What is pm.Potential?

**URL:** <https://discourse.pymc.io/t/what-is-pm-potential/3274>\
**Category:** Questions\
**Created:** [May 16, 2019, 1:03pm UTC](https://discourse.pymc.io/t/what-is-pm-potential/3274 "2019-05-16T13:03:24Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Hamster\_on\_wheels](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/hamster_on_wheels/32/1823_2.png) [@Hamster\_on\_wheels](https://discourse.pymc.io/u/Hamster_on_wheels)\
**Post date:** [May 16, 2019, 2:57pm UTC](https://discourse.pymc.io/t/what-is-pm-potential/3274/3 "2019-05-16T14:57:13Z")

</div>

The model has 5 \times 10^6 iterations of matrix multiplications. Can use less iterations if I can sub-sample and provide a stochastic gradient to pymc (but I heard that NUTS can’t use [stochastic gradient](https://discourse.pymc.io/t/can-nuts-work-with-stochastic-gradient-mini-batch/3182)). Can also trade throughput for speed if I approximate the likelihood. If I use gpu, potentially I can fit 2 \times 10^{5} replicas of the model concurrently on a gpu with 4GB if I use 2GB to hold the data… Since all models are independent, the overall log-likelihood is sum of log-likelihood of all the replicas.

Is tree-building the main problem in implementing NUTS for gpu?

Can I provide methods that dynamically scale the number of replicas that I fit to NUTS? I was thinking about wrapping [chainer](https://chainer.org/) calculations into a theano operation and use a buffer to hold the growing/shrinking number of replicas.

---

_[View the full topic](https://discourse.pymc.io/t/what-is-pm-potential/3274)._
