Questions tagged [sigmoid]

A sigmoid function is a mathematical function having an "S" shape (sigmoid curve). Often, sigmoid function refers to the special case of the logistic function defined by the formula S ( t ) = 1 / (1 + e^-t)

Sigmoid function (Wikipedia)

256 questions
3
votes
1 answer

Pytorch Sigmoid Function what is e

I have a question on setting up the sigmoid function in pytroch. So I define it as this # Sigmoid function def sigmoid(x): return 1/(1 + torch.exp(-x)) But then looking at the sigmoid function from here…
MNM
  • 2,673
  • 6
  • 38
  • 73
3
votes
1 answer

Unwanted [Nan] output in Python neural network

newbie here. Just switched over from JS to Python to build Neural nets but getting [Nan] outputs from it. The weird thing is that my sigmoid func. doesn't seem to encounter any overflow but the derivative causes chaos. import numpy as np def…
neel g
  • 1,138
  • 1
  • 11
  • 25
3
votes
2 answers

Interpreting a sigmoid result as probability in neural networks

I've created a neural network with a sigmoid activation function in the last layer, so I get results between 0 and 1. I want to classify things in 2 classes, so I check "is the number > 0.5, then class 1 else class 0". All basic. However, I would…
Tominator
  • 1,224
  • 3
  • 19
  • 37
3
votes
2 answers

Handling numpy.exp overflow when using function on 2d-array

I've got a 2d numpy array on which I want to use my function sigmoid(x) which is: def sigmoid(x): return 1 / (1 + np.exp(-x)) My problem is that I have inputs that are too big like 3000 and I get this warning: RuntimeWarning: overflow…
Markus S
  • 33
  • 4
3
votes
3 answers

Activation Function in Machine learning

What is meant by Activation function in Machine learning. I go through with most of the articles and videos, everyone states or compare that with neural network. I'am a newbie to machine learning and not that much familiar with deep learning and…
mohangraj
  • 9,842
  • 19
  • 59
  • 94
3
votes
1 answer

Dataset values distribution for sigmoid and tanh

As many papers point out, for better learning curve of NN, it's better for dataset to be normalized in a way that values match Gaussian curve. Does this apply only if we use sigmoid function as squashing function? If not what deviation is best for…
3
votes
1 answer

Sigmoid layer in Keras

I have a list of values, ranging from 15000 to 25000. I have to separate them into two categories, such that (approx) 20000 will end up in category 1 and the rest in category 2. I figured out that the sigmoid activation should work for this. I am…
chiru player
  • 301
  • 3
  • 10
3
votes
0 answers

Tensorflow sporadically negative values with tf.losses.sigmoid_cross_entropy

I'm using an Inception-V4 model to do a multi-label classification with tensorflow. The model has an output dimension of 51 and my labels are either one or zero for these 51 classes. I did not modify the Inception-V4 any further. In order to learn…
andy
  • 1,852
  • 2
  • 20
  • 31
3
votes
1 answer

what is the fastest way to calculate sigmoid?

I am trying to implement a recurrent neural network where sigmoid is chosen to be the activation function. My first prototype is written in python and I find sigmoid is somehow the bottleneck of the program, accounts for ~30% of the total running…
bbvan
  • 618
  • 1
  • 7
  • 17
3
votes
1 answer

F# Pick function based on input?

I have the following functions let private sigmoid (z:float) = 1.0 / (1.0 + exp(-z)) let private sigmoidM (z : Matrix) : Matrix = z.Map (fun x -> sigmoid(x)) let private sigmoidV (z:Vector) = z.Map(fun x ->…
David Crook
  • 2,722
  • 3
  • 23
  • 49
2
votes
1 answer

Binomial logit model with glmer doesn't yield a good fit to sigmoidal data

I am trying to fit a model to my data, which has a dependent variable that can be 0 or 1. I tried to fit a binomial glmer to the data, but the fit is pretty bad as you can see below. This puzzles me because this is quite a sigmoid so I thought I…
FloLe
  • 41
  • 5
2
votes
1 answer

1D classification using Tensorflow 2.0

I am total noob in Tensorflow and trying to implement sample code that implements binary classification using Tensorflow 2.0. Here is my source code: import tensorflow as tf import numpy as np import matplotlib.pyplot as plt def sigmoid(x): …
user3583807
  • 766
  • 1
  • 8
  • 26
2
votes
1 answer

Change the precision of torch.sigmoid?

I want my sigmoid to never print a solid 1 or 0, but to actually print the exact value i tried using torch.set_printoptions(precision=20) but it didn't work. here's a sample output of the sigmoid function : before sigmoid :…
OneAndOnly
  • 1,048
  • 1
  • 13
  • 33
2
votes
1 answer

Why XOR problem works better with bipolar representation?

I am undertaking a course in Neural Networks and the Professor introduced us to the XOR problem. I understand the XOR problem is not linearly separable and why we need to employ Neural Network for this problem. However, he mentioned XOR works better…
Exploring
  • 2,493
  • 11
  • 56
  • 97
2
votes
1 answer

Simulate sklearn logistic regression predict_proba with only coefficients and intercept

I will create dummy data and train sklearn Logistic regression on it. Then I would like to get the output of predict_proba but only with own coef_ and intercept_ calculation, but the results are different. The setting is following: X = [[0,0,0],…
United121
  • 729
  • 1
  • 10
  • 24
1 2
3
17 18