I think we can see the logistic regression from the perspective of Boltzmann distribution in physics/Gibbs distribution(also refer to this thread) or the log linear model in statistics.
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).
The $\theta^{(i)}$ is just the sum of the ith y and its potentials between all features, and the $e$ makes it the product.
And we can see that it can date back to 1868:
The Boltzmann distribution is named after Ludwig Boltzmann who first formulated it in 1868 during his studies of the statistical mechanics of gases in thermal equilibrium.