Extract methods on hidden layer fine tuning

Put the calculation of hidden-probabilities into a function.
Put the reformatting/reshaping of data to minimize into a function.