# HG changeset patch # User James Bergstra # Date 1268376640 18000 # Node ID 3b53ed688747fe47d7470aed9ed870abf6f7880f # Parent e966d5ab81034990a49fab9ef50852e61952f684 extension to kouh2008 layer have linear and softplus inputs diff -r e966d5ab8103 -r 3b53ed688747 pylearn/shared/layers/kouh2008.py --- a/pylearn/shared/layers/kouh2008.py Mon Mar 08 17:56:51 2010 -0500 +++ b/pylearn/shared/layers/kouh2008.py Fri Mar 12 01:50:40 2010 -0500 @@ -218,8 +218,14 @@ #softsign's range is (-1, 1) # we want filter responses to span (x_low, x_high) - x_list = [x_low + (x_high-x_low)*(d(0.5) + d(0.5)*softsign(tensor.dot(input, f_list[i])+b_list[i])) - for i in xrange(n_terms)] + if x_low < x_high: + x_list = [x_low + (x_high-x_low)*(d(0.5) + d(0.5)*softsign(tensor.dot(input, f_list[i])+b_list[i])) + for i in xrange(n_terms)] + else: + if x_low == x_high: + x_list = [(tensor.dot(input, f_list[i])+b_list[i]) for i in xrange(n_terms)] + else: #x_low > x_high + x_list = [softplus(tensor.dot(input, f_list[i])+b_list[i]) for i in xrange(n_terms)] rval = cls.new_expbounds(rng, x_list, n_out, dtype=dtype, params=f_list + b_list, p_range=p_range,