please search this forum for “bayesian neural networks” and read those posts, for example this post or this post.
that medium post actually contains some regrettable technical errors.