Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

negative exponentials

Status
Not open for further replies.
Joined
Dec 29, 2003
Messages
4
Location
GB
Hello All,
I'm playing around with Neural Networks but can't get the sigmoid function 1/(1+ e -var)to work correctly.
That's exponential to the negative variable - can't use superscript in this message box!

log()works fine with a positive number, but as soon as a negative number is applied it falls over!

Can anyone shed any light on the problem? Am I using the correct function?

My code reads along the lines of....
var = 1/(1+(log(0-SubTotArray[0][$OutCount])))
and works OK if the '0-' is removed.

Any ideas?

If anyone needs clarification of the sigmoid function, it can be found at..... ... just below the diagrams.


Thanks in advance for all your assistance.
 
Two questions...[ol][li]You do know you can't take the logarithm of a negative number, right?[/li][li]Why are you using the log() PHP function when the mathematical equation requires that you calculate a power of e -- wouldn't the exp() PHP function be more appropriate?[/li][/ol]

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top