Mercurial > pylearn
changeset 1395:54b2268db0d7
mcRBM.contrastive_grad accepts optional "consider_constant" arg
author | James Bergstra <bergstrj@iro.umontreal.ca> |
---|---|
date | Sat, 08 Jan 2011 17:14:44 -0500 |
parents | 48e8292e22e7 |
children | 310e22d7e44b |
files | pylearn/algorithms/mcRBM.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/pylearn/algorithms/mcRBM.py Fri Jan 07 11:42:38 2011 -0500 +++ b/pylearn/algorithms/mcRBM.py Sat Jan 08 17:14:44 2011 -0500 @@ -265,7 +265,7 @@ """ return (free_energy_fn(pos_v) - free_energy_fn(neg_v)).sum() -def contrastive_grad(free_energy_fn, pos_v, neg_v, wrt, other_cost=0): +def contrastive_grad(free_energy_fn, pos_v, neg_v, wrt, other_cost=0, consider_constant=[]): """ :param free_energy_fn: lambda (TensorType matrix MxN) -> TensorType vector of M free energies :param pos_v: positive-phase sample of visible units @@ -299,7 +299,7 @@ cost = cost + other_cost return theano.tensor.grad(cost, wrt=wrt, - consider_constant=[neg_v]) + consider_constant=consider_constant+[neg_v]) ########################################### #