ReLu is an abbreviation for Rectified Linear Unit, in the branch of neural networks.
Questions tagged [relu]
101 questions
27
votes
5 answers
ReLU derivative in backpropagation
I am about making backpropagation on a neural network that uses ReLU.
In a previous project of mine, I did it on a network that was using Sigmoid activation function, but now I'm a little bit confused, since ReLU doesn't have a derivative.
Here's an…

Gergely Papp
- 800
- 1
- 7
- 12
11
votes
1 answer
Why is ReLU a non-linear activation function?
As I understand it, in a deep neural network, we use an activation function (g) after applying the weights (w) and bias(b) (z := w * X + b | a := g(z)). So there is a composition function of (g o z) and the activation function makes so our model…

FlyingZipper
- 701
- 6
- 26
9
votes
1 answer
Pytorch Autograd gives different gradients when using .clamp instead of torch.relu
I'm still working on my understanding of the PyTorch autograd system. One thing I'm struggling at is to understand why .clamp(min=0) and nn.functional.relu() seem to have different backward passes.
It's especially confusing as .clamp is used…

DaFlooo
- 91
- 1
- 6
8
votes
5 answers
How do I implement leaky relu using Numpy functions
I am trying to implement leaky Relu, the problem is I have to do 4 for loops for a 4 dimensional array of input.
Is there a way that I can do leaky relu only using Numpy functions?

Liu Hantao
- 620
- 1
- 9
- 19
6
votes
2 answers
cv2.dnn.readNetFromDarknet error: (-212:Parsing error) Unsupported activation: relu in function 'cv::dnn::darknet::ReadDarknetFromCfgStream'
I tried to run the Openpose on darknet with weights and cfg downloaded from this place: https://github.com/lincolnhard/openpose-darknet
This is the error when I tried to create a net in Opencv
modelConfiguration = path to cfg file
modelWeights =…

Water Chan
- 101
- 1
- 2
- 7
5
votes
1 answer
Why use multiple ReLU objects in Neural Net class definition?
Recently I observed that a lot of times while defining the neural nets we define separate ReLU objects for each layer. Why can't we use the same ReLU object wherever it is needed.
For example instead of writing like this-
def __init__(self):
…

Franklin Varghese
- 169
- 3
- 8
3
votes
1 answer
Assuming the order Conv2d->ReLU->BN, should the Conv2d layer have a bias parameter?
Should we include the bias parameter in Conv2d if we are going for Conv2d followed by ReLU followed by batch norm (bn)?
There is no need if we go for Conv2d followed by bn followed by ReLU, since the shift parameter of bn takes care of bias work.

Venkataraman
- 138
- 1
- 9
3
votes
2 answers
What are the disadvantages of Leaky-ReLU?
We use ReLu instead of Sigmoid activation function since it is devoid of vanishing and exploding gradients problem that has been in sigmoid like activation functions,
Leaky-ReLU is one of rely's improvements. Everyone is talking about the…

YFye
- 77
- 2
- 4
3
votes
1 answer
RELU Backpropagation
I am having trouble with implementing backprop while using the relu activation function. My model has two hidden layers with 10 nodes in both hidden layers and one node in the output layer (thus 3 weights, 3 biases). My model works other than for…

Nate
- 101
- 1
- 8
3
votes
1 answer
ReLU derivative with NumPy
import numpy as np
def relu(z):
return np.maximum(0,z)
def d_relu(z):
z[z>0]=1
z[z<=0]=0
return z
x=np.array([5,1,-4,0])
y=relu(x)
z=d_relu(y)
print("y = {}".format(y))
print("z = {}".format(z))
The code above prints out:
y = [1…

Egbert
- 35
- 1
- 6
2
votes
1 answer
Which type of function is ReL?
I was wondering if the ReL function is a linear or an identity function.
If the function was linear (meaning y=kx+d) the function could be "changed" a lot more.
If the function on the other hand was an identity function (meaning y=x), then output…

Phil3453
- 21
- 1
2
votes
3 answers
ValueError with ReLU function in python
I declared ReLU function like this:
def relu(x):
return (x if x > 0 else 0)
and an ValueError has occured and its traceback message is
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
But…

i.meant.to.be
- 31
- 4
2
votes
1 answer
Is there any difference between relu as an activation function or a layer?
Is there any difference between relu as an activation function or a layer? For example
Conv2D(filters=8, kernel_size=(3, 3), activation='relu',padding='SAME', name='conv_2')
or
Conv2D(filters=8, kernel_size=(3, 3),padding='SAME',…

LifeLongLearner
- 33
- 3
2
votes
1 answer
Why DNN doesnt learn?
Do you have any idea why this network doesn't want to learn? The idea is that it uses ReLU as an activation function in earlier layers and sigmoid as an activation function in the last layer. The network learned fine when I used only sigmoid. To…

XXXXXXXX
- 23
- 5
2
votes
1 answer
Neural Network TypeError: unsupported operand type(s) for +=: 'Dense' and 'str'
I am trying to use a neural network to predict the price of houses. Here is what the top of the dataset looks like:
Price Beds SqFt Built Garage FullBaths HalfBaths LotSqFt
485000 3 2336 2004 2 2.0 …

325
- 594
- 8
- 21