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
2
votes
1 answer

How to get numpy.exp to work with an array as well as a scalar?

I am working on an assignment that asks me to code the sigmoid function in Python. I'm very new to this so I sort of understand how the Sigmoid function works. The assignment asks that I code it so that the function will work whether z is an array…
alpablo20
  • 342
  • 1
  • 15
2
votes
1 answer

Tensorflow 2.2 [predictions must be >= 0] [Condition x >= y did not hold element-wise:] [x (dense_1/Sigmoid:0) = ]

I am training a Binary detection architecture using TensorFlow 2.2 and Keras. Previously, I had this working if I loaded the data in the same script as the training of the model. However, when I use a larger dataset (x6 more samples, same ratio of …
2
votes
1 answer

How to get a sigmoid function between 0 and 1 for probability of correct answer?

I am trying to simulate some data where a response can either be right (1) or wrong (0). I am thus trying to find a distribution in which there are four conditions (in this case degrees of a circle). Thus, the x axis is pi/2, pi, pi1.5, 2pi. I have…
2
votes
1 answer

How to use sigmoid function in python when developing a NeuralNetwork

I am trying to create a neural network, but when i try implementing the sigmoid function (importing, or creating it manually like in this case) it just says that the variable sigmoid does not exist Here is my code Also, i am using visual studio code…
2
votes
1 answer

Syntax of a SIgmoid Function - Javascript

I've been trying to make this function work to no avail. Could anyone potentially shed some light? It is a Sigmoid with some applied boundaries/transormations. Here's the link to the function in desmos. That is working perfectly. It looks like…
Specific
  • 23
  • 2
2
votes
1 answer

Wrong dimensions XOR neural network python

I'm trying to build an XOR neural network in python with one hidden layer but I'm hitting a problem with dimensions and I can't figure out why I'm getting the wrong dimensions in the first place because the math looks correct to me. The dimensions…
n_1
  • 65
  • 1
  • 9
2
votes
3 answers

Difference in having Sigmoid activation function instead of linear activation and using sigmoid in loss

I am fairly new to the loss-functions and I have a 800 binary classification problem (meaning 800 neurons at the output that are not effected by eachother - probablity of each is 0 or 1). Now looking at the Documentations from:…
Yahya Nik
  • 85
  • 2
  • 10
2
votes
0 answers

Tensorflow sigmoid keeps on satuarting

so i have this environment and reward design that i specially designed to be close to -1, 0 and 1, so (as i got told) the sigmoid wouldn't saturate, also i kept the reward design fairly simple with ca -1 and 1 reward for end goal. so i am using DDPG…
user10795232
2
votes
1 answer

Using two different sigmoid-fucntions in Neuralnet in R

I am trying to repeat a study (https://www.sciencedirect.com/science/article/pii/S0957417410011711) In the study they use two different functions, one for the hidden layer and one for the output. On page 5314 they write "A tangent sigmoid transfer…
2
votes
3 answers

Usage of sigmoid activation function in Keras

I have a big dataset composed of 18260 input field with 4 outputs. I am using Keras and Tensorflow to build a neural network that can detect the possible output. However I tried many solutions but the accuracy is not getting above 55% unless I use…
Ahmad Hijazi
  • 635
  • 2
  • 9
  • 27
2
votes
1 answer

Why is the code for a neural network with a sigmoid so different than the code with softmax_cross_entropy_with_logits?

When using neural networks for classification, it is said that: You generally want to use softmax cross-entropy output, as this gives you the probability of each of the possible options. In the common case where there are only two options, you want…
rwallace
  • 31,405
  • 40
  • 123
  • 242
2
votes
1 answer

2-Class Support Vector Machine using Custom Kernel

Is there a sample python code for 2-class SVM classification using the custom kernel or sigmoid kernel? The code below uses 3-class classification. How to modify this to a 2-class SVM?…
Christel Junco
  • 123
  • 1
  • 2
  • 15
2
votes
2 answers

Does sigmoid_cross_entropy produce the mean loss over the whole batch?

I have a multi-label classification task and there are 6 labels. Any sample may have none or some labels to be 1. I have use the loss in tensorflow: self.loss = tf.losses.sigmoid_cross_entropy(self.labels, self.logits) Every time a batch (1000) of…
2
votes
1 answer

Sigmoid operation implementation in Tensorflow

For learning purposes I have a task to make a linear and sigmoid operations in tensorflow. I managed to do the linear op: def linear_op_forward(X, W): ''' linear operation''' return np.dot(X, W.T) def linear_op_backward(op, grads): ''' Linear…
Alex Nikitin
  • 514
  • 5
  • 12
2
votes
1 answer

The right way to calculate the derivative of sigmoid function in Python

I was walking through this article. In the code, the author mentions that the following function finds the derivative: # convert output of sigmoid function to its derivative def sigmoid_output_to_derivative(output): return output*(1-output) I…
Simplicity
  • 47,404
  • 98
  • 256
  • 385