# Energy based learning for HMMs: Viterbi training

I understand why we want to maximise the posterior probability to find the most likely sequence of hidden variables but I've read that this is equivalent to minimising some concept of free energy.

I'm trying to understand the various steps needed to get from equation 6 to equation 10 in the following paper (https://arxiv.org/pdf/1312.4551.pdf).

I'll try and break down my progress/problems so far:

Eqn 6 -> Eqn 7

Starting at equation 6. We want to maximise $$P(s|x) = \frac{P(s,x)}{P(x)}$$ which is equivalent to maximising $$\ln{P(s,x)}$$ since logarithms are monotonic and $$P(x)$$ is independent of s.

He then says that if the number of observations of $$x$$ is large then

$$\text{max}_s \ln{P(s,x)} = \Sigma_x P(x) \ln{P(s,x)}$$

Why is this true?

Eqn 7 -> Eqn 8

I looked this up in the cited reference and they define the auxiliary probability as $$\frac{e^{-\beta H(s,x)}}{\Sigma_x e^{-\beta H(s,x)}}$$. I have seen partition functions and the like before in physics and kind of recognise this format but it was a very long time ago. I can see it is the same structure as what is used in eqn 8 of this paper but I don't know why the version they've chosen to express it the way they have done in eqn 8 rather than using the format I've listed above?

More important: I'm struggling to see why we've done this. My best guess is that he wants to make a connection with energy. We know that states in physical systems have a probability to occur. Specifically, this auxiliary probability defines the probability of a physical system with Hamiltonian $$H(s,x)$$ and temperature $$\frac{1}{\beta}$$. What do $$s$$ and $$x$$ represent in this physical system?

Eqn 8 -> Eqn 9

I really don't follow what happens in this step. I think that in the limit $$\beta \rightarrow \infty$$, $$e^{-\beta H(s,x)}$$ will be dominated by the minima of $$H(s,x)$$. I believe the delta function is "selecting" these "ground states" that minimise the Hamiltonian but I can't be sure? And I don't know what $$\mathcal{N}$$ is coming from?

Eqn 10 This is a definition so there's nothing to prove. However, in the paragraph that follows, he says Viterbi training (finding the $$s$$ that maximises the posterior) corresponds to minimising eqn 10 with $$\ebta = \infty$$. Can anyone explain how to see this?