Function to compute the free energy
(self, v_sample)
| 128 | # end-snippet-1 |
| 129 | |
| 130 | def free_energy(self, v_sample): |
| 131 | ''' Function to compute the free energy ''' |
| 132 | wx_b = T.dot(v_sample, self.W) + self.hbias |
| 133 | vbias_term = T.dot(v_sample, self.vbias) |
| 134 | hidden_term = T.sum(T.log(1 + T.exp(wx_b)), axis=1) |
| 135 | return -hidden_term - vbias_term |
| 136 | |
| 137 | def propup(self, vis): |
| 138 | '''This function propagates the visible units activation upwards to |
no outgoing calls
no test coverage detected