Is dropout applied before or after the non-linear activation function? (2024)

Is dropout applied before or after the non-linear activation function?

Typically, dropout is applied after the non-linear activation function (a). However, when using rectified linear units (ReLUs), it might make sense to apply dropout before the non-linear activation (b) for reasons of computational efficiency depending on the particular code implementation.

(a): Fully connected, linear activation -> ReLU -> Dropout -> …
(b): Fully connected, linear activation -> Dropout -> ReLU -> …

Why do (a) and (b) produce the same results in case of ReLU?. Let’s answer this question with a simple example starting with the following logits (outputs of the linear activation of the fully connected layer):

[-1, -2, -3, 4, 5, 6]

Let’s walk through scenario (a), applying the ReLU activation first. The output of the non-linear ReLU functions are as follows:

[0, 0, 0, 4, 5, 6]

Remember, the ReLU activation function is defined as \(f(x) = max(0, x)\); thus, all non-zero values will be changed to zeros. Now, applying dropout with a probability 0f 50%, let’s assume that the units being deactivated are units 2, 4, and 6:

[0*2, 0, 0*2, 0, 0*2, 0] = [0, 0, 0, 0, 10, 0]

Note that in dropout, units are deactivated randomly by default. In the preceding example, we assumed that the 2nd, 4th, and 6th unit were deactivated during the training iteration. Also, because we applied dropout with 50% dropout probability, we scaled the remaining units by a factor of 2.

Now, let’s take a look at scenario (b). Again, we assume a 50% dropout rate and that units 2, 4, and 6 are deactivated:

[-1, -2, -3, 4, 5, 6] -> [-1*2, 0, -3*2, 0, 5*2, 0]

Now, if we pass this array to the ReLU function, the resulting array will look exactly like the one in scenario (a):

[-2, 0, -6, 0, 10, 0] -> [0, 0, 0, 0, 10, 0]

If you like this content and you are looking for similar, more polished Q & A’s, check out my new book Machine Learning Q and AI.

Is dropout applied before or after the non-linear activation function? (2024)
Top Articles
The Ultimate Guide to Taxes on Stocks for Foreign Investors | Amal Invest
Digital Secure Key | Seamless and secure banking – HSBC IN
Time in Baltimore, Maryland, United States now
Free Atm For Emerald Card Near Me
Gore Videos Uncensored
Aces Fmc Charting
Katie Boyle Dancer Biography
Lesson 3 Homework Practice Measures Of Variation Answer Key
Aries Auhsd
Job Shop Hearthside Schedule
Craigslist Free Stuff Greensboro Nc
10-Day Weather Forecast for Santa Cruz, CA - The Weather Channel | weather.com
Petco Vet Clinic Appointment
Huntersville Town Billboards
Lowes Undermount Kitchen Sinks
Att.com/Myatt.
Rqi.1Stop
Conan Exiles Sorcery Guide – How To Learn, Cast & Unlock Spells
Isaidup
The Largest Banks - ​​How to Transfer Money With Only Card Number and CVV (2024)
Ou Class Nav
Renfield Showtimes Near Paragon Theaters - Coral Square
R/Mp5
Perry Inhofe Mansion
Ilabs Ucsf
123Moviestvme
Shiftwizard Login Johnston
CARLY Thank You Notes
Poe Flameblast
Cheetah Pitbull For Sale
Vons Credit Union Routing Number
Who Is Responsible for Writing Obituaries After Death? | Pottstown Funeral Home & Crematory
Weekly Math Review Q2 7 Answer Key
Ds Cuts Saugus
Differential Diagnosis
Santa Clara County prepares for possible ‘tripledemic,’ with mask mandates for health care settings next month
Cuckold Gonewildaudio
Rs3 Nature Spirit Quick Guide
Petra Gorski Obituary (2024)
Enr 2100
From Grindr to Scruff: The best dating apps for gay, bi, and queer men in 2024
Amateur Lesbian Spanking
Market Place Tulsa Ok
Contico Tuff Box Replacement Locks
Rite Aid | Employee Benefits | Login / Register | Benefits Account Manager
Kushfly Promo Code
CPM Homework Help
Basic requirements | UC Admissions
211475039
What Responsibilities Are Listed In Duties 2 3 And 4
Supervisor-Managing Your Teams Risk – 3455 questions with correct answers
Latest Posts
Article information

Author: Frankie Dare

Last Updated:

Views: 6275

Rating: 4.2 / 5 (53 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Frankie Dare

Birthday: 2000-01-27

Address: Suite 313 45115 Caridad Freeway, Port Barabaraville, MS 66713

Phone: +3769542039359

Job: Sales Manager

Hobby: Baton twirling, Stand-up comedy, Leather crafting, Rugby, tabletop games, Jigsaw puzzles, Air sports

Introduction: My name is Frankie Dare, I am a funny, beautiful, proud, fair, pleasant, cheerful, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.