changeset 776:72ce8288a283

small optimisation
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Thu, 11 Jun 2009 15:44:32 -0400
parents 164a76c8346f
children a985baadf74d
files pylearn/algorithms/sandbox/DAA_inputs_groups.py
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/algorithms/sandbox/DAA_inputs_groups.py	Thu Jun 11 13:35:31 2009 -0400
+++ b/pylearn/algorithms/sandbox/DAA_inputs_groups.py	Thu Jun 11 15:44:32 2009 -0400
@@ -19,6 +19,7 @@
     if type == 'l1':
         return T.sum(T.abs(param))
     if type == 'l2':
+        return T.sum(param*param)#faster...
         return T.sum(T.pow(param,2))
     raise NotImplementedError('Only l1 and l2 regularization are currently implemented')