changeset 1462:7c72948e1d53

Catch only exception to don't catch ctrl-C.
author Frederic Bastien <nouiz@nouiz.org>
date Fri, 08 Apr 2011 14:03:09 -0400
parents 2aa80f5b5bbc
children f9066ff6e198
files pylearn/gd/sgd.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/gd/sgd.py	Thu Apr 07 21:39:13 2011 -0400
+++ b/pylearn/gd/sgd.py	Fri Apr 08 14:03:09 2011 -0400
@@ -16,7 +16,7 @@
     """
     try:
         iter(stepsizes)
-    except:
+    except Exception:
         stepsizes = [stepsizes for p in params]
     if len(params) != len(grads):
         raise ValueError('params and grads have different lens')
@@ -27,11 +27,11 @@
     # if stepsizes is just a scalar, expand it to match params
     try:
         iter(stepsizes)
-    except:
+    except Exception:
         stepsizes = [stepsizes for p in params]
     try:
         iter(momentum)
-    except:
+    except Exception:
         momentum = [momentum for p in params]
     if len(params) != len(grads):
         raise ValueError('params and grads have different lens')