sigmoid.m
Sigmoid函数是一个信息科学中常用的阀值函数,其意义是将任意离散的值映射到0-1之间以方便进一步处理

1 2 3 4 5 6 7 8 9 10 11 12 |
<p>function g = sigmoid(z)<br> %SIGMOID Compute sigmoid function<br> % g = SIGMOID(z) computes the sigmoid of z.</p> <p>% You need to return the following variables correctly<br> %g = ones(size(z));</p> <p>% ====================== YOUR CODE HERE ======================<br> % Instructions: Compute the sigmoid of each value of z (z can be a matrix,<br> % vector or scalar).<br> e=exp(-z);<br> g=1./(1+e);</p> <p>% =============================================================</p> <p>end</p> |
新的编辑器真的和狗屎一样,然后我又咕了