annotate squashfn.py @ 535:a6068dedfbd6

Added squashfn
author Joseph Turian <turian@gmail.com>
date Wed, 19 Nov 2008 18:14:43 -0500
parents
children
rev   line source
535
a6068dedfbd6 Added squashfn
Joseph Turian <turian@gmail.com>
parents:
diff changeset
1
a6068dedfbd6 Added squashfn
Joseph Turian <turian@gmail.com>
parents:
diff changeset
2 def squashfn(str):
a6068dedfbd6 Added squashfn
Joseph Turian <turian@gmail.com>
parents:
diff changeset
3 if str == "sigmoid":
a6068dedfbd6 Added squashfn
Joseph Turian <turian@gmail.com>
parents:
diff changeset
4 import theano.tensor.nnet as nnet
a6068dedfbd6 Added squashfn
Joseph Turian <turian@gmail.com>
parents:
diff changeset
5 return nnet.sigmoid
a6068dedfbd6 Added squashfn
Joseph Turian <turian@gmail.com>
parents:
diff changeset
6 elif str == "tanh":
a6068dedfbd6 Added squashfn
Joseph Turian <turian@gmail.com>
parents:
diff changeset
7 import theano.tensor as t
a6068dedfbd6 Added squashfn
Joseph Turian <turian@gmail.com>
parents:
diff changeset
8 return t.tanh
a6068dedfbd6 Added squashfn
Joseph Turian <turian@gmail.com>
parents:
diff changeset
9 elif str == "softsign":
a6068dedfbd6 Added squashfn
Joseph Turian <turian@gmail.com>
parents:
diff changeset
10 from theano.sandbox.softsign import softsign
a6068dedfbd6 Added squashfn
Joseph Turian <turian@gmail.com>
parents:
diff changeset
11 return softsign
a6068dedfbd6 Added squashfn
Joseph Turian <turian@gmail.com>
parents:
diff changeset
12 else: assert 0
a6068dedfbd6 Added squashfn
Joseph Turian <turian@gmail.com>
parents:
diff changeset
13
a6068dedfbd6 Added squashfn
Joseph Turian <turian@gmail.com>
parents:
diff changeset
14