source: distools/sigmoid.m @ 144

Last change on this file since 144 was 10, checked in by bduin, 14 years ago
File size: 651 bytes
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
26function F = sigmoid(A,s)
27
28if nargin < 2,
29  s = 1;
30end
31
32F = 2./(1+exp(-A/s)) - 1;
33return;
Note: See TracBrowser for help on using the repository browser.