I am trying to understand why my sigmoid function when the input is 37, it output 1. the sigmoid function:
import math
def sigmoid(x):
return 1 / (1 + math.e ** -x)
I am not good in math but I think there should never be a moment where the f(x) is equal to 1 right? maybe it is because the e constant isnt precise enough however my real problem is I want to map a number between 0 and 1 to what is x when f(x) is 0 and what x is when f(x) is 1. my map function:
def p5map(n, start1, stop1, start2, stop2):
return ((float(n)-start1)/(stop1-start1))*(stop2-start2)+start2
so for exemple I want to do
p5map(y, 0, 1, -37, 37)
where the y would be f(x) in the sigmoid curve and -37 and 37 would be where f(x) is 0 and 1 respectively. using -37 and 37 would not work for me so what I am asking is why is it 37 and how can I fix that so it is between -1 and 1 for exemple