mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-18 13:55:14 +02:00
utils
This commit is contained in:
parent
e1b766a8dd
commit
aa13e095a9
7 changed files with 619 additions and 0 deletions
14
GPy/util/squashers.py
Normal file
14
GPy/util/squashers.py
Normal 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()
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue