Line | |
---|
1 | %SIGMOID Element-wise Sigmoid Tranformation of a Matrix |
---|
2 | % |
---|
3 | % F = SIGMOID(A,S) |
---|
4 | % |
---|
5 | % INPUT |
---|
6 | % A NxM matrix (dataset) |
---|
7 | % S Scale parameter (optional, default: 1) |
---|
8 | % |
---|
9 | % OUTPUT |
---|
10 | % F NxM matrix (dataset) |
---|
11 | % |
---|
12 | % DESCRIPTION |
---|
13 | % Applies sigmoid transformation to the elements of A. |
---|
14 | % The values of F are in (0,1] for positive values of A and |
---|
15 | % in [-1,0) for negative values. |
---|
16 | % |
---|
17 | % DEFAULT |
---|
18 | % S = 1 |
---|
19 | % |
---|
20 | |
---|
21 | % Copyright: Elzbieta Pekalska, ela.pekalska@googlemail.com |
---|
22 | % Faculty EWI, Delft University of Technology and |
---|
23 | % School of Computer Science, University of Manchester |
---|
24 | |
---|
25 | |
---|
26 | function F = sigmoid(A,s) |
---|
27 | |
---|
28 | if nargin < 2, |
---|
29 | s = 1; |
---|
30 | end |
---|
31 | |
---|
32 | F = 2./(1+exp(-A/s)) - 1; |
---|
33 | return; |
---|
Note: See
TracBrowser
for help on using the repository browser.