What is Dropout in TF learn explain with example

This recipe explains what is Dropout in TF learn explain with example

Recipe Objective

This recipe explains what is dropout in TFLayer.

Dropout

Its syntax is: tflearn.layers.core.dropout (incoming, keep_prob, noise_shape=None, name='Dropout')
where its arguments is incoming which is a Tensor or list of Tensor Incoming tensor, keep_prob which is a float representing the probability that each element is kept, noise_shape which is a 1-D Tensor of type int32, representing the shape for randomly generated keep/drop flags and, name which is a name for this layer (optional).

Learn How to use XLNet for Text Classification

def Dropout(ic, prob, noise=None, Name="Dropout"):

    with tf.name_scope(Name) as s:

       inf = ic

       def apply_dropout():
          if type(inf) in [list, np.array]:
             for y in inf:
                y = tf.nn.dropout(y, prob, noise)
             return inf
          else:
             return tf.nn.dropout(inf, prob, noise)

       train = tflearn.get_training_mode()
       inf = tf.cond(train, apply_dropout, lambda: inf)

    tf.add_to_collection(tf.GraphKeys.LAYER_TENSOR + '/' + Name, inf)
    return inf

What Users are saying..

profile image

Jingwei Li

Graduate Research assistance at Stony Brook University
linkedin profile url

ProjectPro is an awesome platform that helps me learn much hands-on industrial experience with a step-by-step walkthrough of projects. There are two primary paths to learn: Data Science and Big Data.... Read More

Relevant Projects

Loan Default Prediction Project using Explainable AI ML Models
Loan Default Prediction Project that employs sophisticated machine learning models, such as XGBoost and Random Forest and delves deep into the realm of Explainable AI, ensuring every prediction is transparent and understandable.

Tensorflow Transfer Learning Model for Image Classification
Image Classification Project - Build an Image Classification Model on a Dataset of T-Shirt Images for Binary Classification

Census Income Data Set Project-Predict Adult Census Income
Use the Adult Income dataset to predict whether income exceeds 50K yr based oncensus data.

Recommender System Machine Learning Project for Beginners-2
Recommender System Machine Learning Project for Beginners Part 2- Learn how to build a recommender system for market basket analysis using association rule mining.

Demand prediction of driver availability using multistep time series analysis
In this supervised learning machine learning project, you will predict the availability of a driver in a specific area by using multi step time series analysis.

Isolation Forest Model and LOF for Anomaly Detection in Python
Credit Card Fraud Detection Project - Build an Isolation Forest Model and Local Outlier Factor (LOF) in Python to identify fraudulent credit card transactions.

AWS MLOps Project to Deploy a Classification Model [Banking]
In this AWS MLOps project, you will learn how to deploy a classification model using Flask on AWS.

Build an optimal End-to-End MLOps Pipeline and Deploy on GCP
Learn how to build and deploy an end-to-end optimal MLOps Pipeline for Loan Eligibility Prediction Model in Python on GCP

NLP Project to Build a Resume Parser in Python using Spacy
Use the popular Spacy NLP python library for OCR and text classification to build a Resume Parser in Python.

Build a Hybrid Recommender System in Python using LightFM
In this Recommender System project, you will build a hybrid recommender system in Python using LightFM .