Mercurial > pylearn
view cost.py @ 437:2d8490d76b3e
added two methods to make_test_datasets
author | Olivier Breuleux <breuleuo@iro.umontreal.ca> |
---|---|
date | Wed, 06 Aug 2008 19:39:36 -0400 |
parents | 0f366ecb11ee |
children | 45879c1ecde7 |
line wrap: on
line source
""" Cost functions. """ import theano.tensor as T def quadratic(target, output, axis=1): return T.mean(T.sqr(target - output), axis) def cross_entropy(target, output, axis=1): return -T.mean(target * T.log(output) + (1 - target) * T.log(1 - output), axis=axis)