MACHINE LEARNING RECIPES
DATA CLEANING PYTHON
DATA MUNGING
PANDAS CHEATSHEET
ALL TAGS
# What is a relu activation function in keras and why is it used?

# What is a relu activation function in keras and why is it used?

This recipe explains what is a relu activation function in keras and why is it used

Relu activation function in keras and why is it used The Rectified Linear Unit is the most commonly used activation function in deep learning models. The function returns 0 if it receives any negative input, but for any positive value x it returns that value back. So it can be written as y =max(0,x) Some features of Relu function It is very easy to understand, there is no complicated maths formula behind it. It doesn't have the dying slope problem that mainly occurs in other activation functions like sigmoid or tanh. It has some variants in itself for some complicated maths like Leaky Relu and Parametric Relu.

```
import tensorflow as tf
from tensorflow.keras import layers
from tensorflow.keras import activations
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dropout
from tensorflow.keras import layers
```

We will Define the model and then define the layers, kernel initializer, and its input nodes shape.

```
#Model
model = Sequential()
model.add(layers.Dense(64, kernel_initializer='uniform', input_shape=(10,)))
```

We will show you how to use ReLU activation functions on some models to works.

```
a = tf.constant([-200, -10, 0.0, 10, 200], dtype = tf.float32)
b= tf.keras.activations.relu(a).numpy()
print(b)
```

[ 0. 0. 0. 10. 200.]

PySpark Project-Get a handle on using Python with Spark through this hands-on data processing spark python tutorial.

In this project, we are going to work on Sequence to Sequence Prediction using IMDB Movie Review Datasetâ€‹ using Keras in Python.

In this machine learning project, we will use binary leaf images and extracted features, including shape, margin, and texture to accurately identify plant species using different benchmark classification techniques.

In this machine learning resume parser example we use the popular Spacy NLP python library for OCR and text classification.

In this project, we are going to work on Deep Learning using H2O to predict Census income.

In this R data science project, we will explore wine dataset to assess red wine quality. The objective of this data science project is to explore which chemical properties will influence the quality of red wines.

In this project, we are going to talk about Time Series Forecasting to predict the electricity requirement for a particular house using Prophet.

In this data science project, you will learn how to perform market basket analysis with the application of Apriori and FP growth algorithms based on the concept of association rule learning.

The goal of this data science project is to build a predictive model and find out the sales of each product at a given Big Mart store.

In this machine learning pricing project, we implement a retail price optimization algorithm using regression trees. This is one of the first steps to building a dynamic pricing model.