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 implement ReLU in place of the Sigmoid Function

import numpy as np alpha = 0.0251 # as close to true alpha as possible def nonlinear(x, deriv=False): if(deriv==True): return x*(1-x) return 1/(1+np.e**(-x)) #seed np.random.seed(1) #testing sample test_x = np.array([[251,497,-246], …
Ikechukwu Anude
  • 346
  • 1
  • 4
  • 16
2
votes
0 answers

Using relu activation function destroys the model

I have implemented a neural network with 1 hidden layer for classification . It uses sigmoid activation function and cross entropy loss . But while watching a cs231n lecture , I came across relu activation function which converges much faster. So, I…
2
votes
1 answer

sigmoid function in python

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…
Tissuebox
  • 1,016
  • 3
  • 14
  • 36
2
votes
0 answers

Total network error get stuck in XOR gate with ReLU transfer function

I tried to use ReLU activation function on XOR problem to see its performance because I see a lot of post and page said it's better than sigmoid and others. I used this code: /** * Copyright 2010 Neuroph Project http://neuroph.sourceforge.net * *…
2
votes
1 answer

Backpropagation not working: Neural Network Java

I have created a simple neural network with 3 layers according to this python example: Link (PS: You have to scroll down until you reach Part 2) This is my Java implementation of the code: private void trainNet() { // INPUT is a 4*3 matrix …
2
votes
2 answers

How Precise Does an Activation Function Need to Be and How Large Will Its Inputs Be?

I am writing a basic neural network in Java and I am writing the activation functions (currently I have just written the sigmoid function). I am trying to use doubles (as apposed to BigDecimal) with hopes that training will actually take a…
2
votes
1 answer

Using Sigmoid instead of Tanh activation function fails - Neural Networks

I'm looking at the following code from this blog It gives the option to use both the sigmoid and the tanh activation function. The XOR test seems to work fine with the tanh function yielding ~ (0,1,1,0) But upon changing to sigmoid I get the wrong…
Greg Peckory
  • 7,700
  • 21
  • 67
  • 114
2
votes
1 answer

MathNet Raise Scalar by a Matrix

I'm attempting to implement Logistic regression in .net using MathNumerics Linear Algebra libraries. I need to implement the following equation and am unsure of how to accomplish raising e by a matrix. 1.0 ./ (1.0 + E .^ (-1 .* Z)) where Z is a…
David Crook
  • 2,722
  • 3
  • 23
  • 49
1
vote
0 answers

Why my plot cannot show sigmoid graph? Whereas I already input to the function

Hello I am confused with my code in MATLAB. I am use Runge-Kutta orde 4th. Why my plot cannot show sigmoid whereas I already input the sigmoid function into my code. Please somebody can explain how to fix it. This is my code. clc;clear; %input…
Cindy
  • 19
  • 3
1
vote
0 answers

Positive class in keras binary classification report has a F1 score of zero even if flatten() is used

I'm trying to do binary classification using sigmoid and binary cross-entrophy. The dataset used is also balanced. But the F1 score for positive class is 0. from keras.losses import binary_crossentropy dense_net = DenseNet121(weights='imagenet',…
1
vote
2 answers

Curve fit and extrapolate for sigmoid function in Python

I have the below dataset: import numpy as np from scipy.optimize import curve_fit import matplotlib.pyplot as plt ## Given datapoints xdata = np.array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]) ydata =…
1
vote
1 answer

Is there R library or way to draw sigmoid function and get equation from raw data

This plot means drugs Concentration. And I want to change this plot like sigmoid plot which is a curve. [raw data] μM <- c(0.01, 0.03, 0.1, 0.3, 1, 3, 10, 30) log_μM <- log(c(0.01, 0.03, 0.1, 0.3, 1, 3, 10, 30)) DMSO <- c(97.01, 98.43, 98.29,…
1
vote
1 answer

How to get most of the outputs of the sigmoid function in the range (0, 0.5)?

I use sigmoid function in my last layer. we know that sigmoid function, limits the outputs of network in range (0,1). I want most of the outputs to be in range (0, 0.5) and very few of them to be in range [0.5, 1). How can I do this in Pytorch to…
1
vote
1 answer

How to create a dose response curve in MATLAB? doseResponse function rank deficient warning

I've been searching for a way to create dose response curves from data within MATLAB. So far, I've been running the doseResponse function downloaded from here. However, I've been having trouble generating a sigmoidal curve that fits my data. By…
1
vote
1 answer

Can't seem to get Scipy curve_fit Sigmoid to work in Python

There are a few posts about this and normally the answer is to have a good initial guess and bounds. I've played around with it for a while and cannot find a configuration that produces any sort of curve. import numpy as np array1 =…
H2O2
  • 13
  • 2