annotate squashfn.py @ 536:c6563c629984

Moved word preprocessing out
author Joseph Turian <turian@gmail.com>
date Thu, 20 Nov 2008 06:11:52 -0500
parents a6068dedfbd6
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