I think we can see the logistic regression from the perspective of [Boltzmann distribution](https://en.wikipedia.org/wiki/Boltzmann_distribution)/Gibbs distribution(also refer to [this thread](https://stats.stackexchange.com/q/339748/103153)). We can treat the matrix(just view it from the softmax perspective), as the potentials between each visible feature variable and each hidden variable(the y's, if it is logistic regression there are two y's). [![enter image description here][1]][1] The $\theta^{(i)}$ is just the sum of the ith y and its potentials between all features, and the $e$ makes it the product. [1]: https://i.sstatic.net/ggaKw.png