# HG changeset patch # User Frederic Bastien # Date 1302285789 14400 # Node ID 7c72948e1d5301a6431d34ee49518665751ca1ec # Parent 2aa80f5b5bbcf371e6ad99c01d1a0c48a3625efb Catch only exception to don't catch ctrl-C. diff -r 2aa80f5b5bbc -r 7c72948e1d53 pylearn/gd/sgd.py --- 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')