This commit is contained in:
Nicolo Fusi 2012-11-29 16:26:21 +00:00
parent e1b766a8dd
commit aa13e095a9
7 changed files with 619 additions and 0 deletions

14
GPy/util/squashers.py Normal file
View file

@ -0,0 +1,14 @@
import numpy as np
def sigmoid(x):
return 1./(1.+np.exp(-x))
def softmax(x):
ex = np.exp(x-x.max(1)[:,None])
return ex/ex.sum(1)[:,np.newaxis]
def single_softmax(x):
ex = np.exp(x)
return ex/ex.sum()