adamconkey
adamconkey

Reputation: 4745

Octave - logsig transfer function

Does Octave have a built-in logistic transfer function similar to Matlab's logsig function?

Upvotes: 0

Views: 1456

Answers (2)

Andy
Andy

Reputation: 8091

logsig is part of the nnet octave-forge package. http://sourceforge.net/p/octave/code/HEAD/tree/trunk/octave-forge/main/nnet/inst/logsig.m

If it's not in core Matlab (Neural Network Toolbox in this case) you should have a look at the corresponding octave-forge package. Unfortunally nnet is unmaintained.

The logsig.m linked is basically the same as rayrengs but also checks for finite.

Upvotes: 1

rayryeng
rayryeng

Reputation: 104535

I don't believe Octave does, but you can certainly create logsig outputs yourself. The logsig transfer function (or the Log-Sigmoid function... or simply the Sigmoid function) is simply defined as:

a = 1 ./ (1 + exp(-n));

n would be the input values stored in a vector / matrix / etc. As such, simply place your values into a matrix / vector into n, then use the above code to apply the logsig function to every value that is defined in n.

Example

n = [0; 1; -0.5; 0.5];
a = 1 ./ (1 + exp(-n))

a =

    0.5000
    0.7311
    0.3775
    0.6225

Comparing this with MATLAB's logsig function, we get:

a2 = logsig(n)

a2 =

    0.5000
    0.7311
    0.3775
    0.6225

Upvotes: 4

Related Questions