Git Product home page Git Product logo

Comments (5)

sxjscience avatar sxjscience commented on June 11, 2024 3

I see. So it's not consistent with https://github.com/hunkim/DeepLearningZeroToAll/blob/master/lab-11-2-mnist_deep_cnn.py#L51

from deeplearningzerotoall.

kkweon avatar kkweon commented on June 11, 2024 1

@sxjscience

@zeran4's issue is not about lowering the keep_prob to 0.3 from 0.7, but it's more like a confusing TensorFlow syntax.

In TensorFlow, there are two functions that perform the dropout

  • tf.layers.dropout

    • If you look at the doc, it uses the "dropout" rate
    • it behaves like MXNet
  • tf.contrib.layers.dropout (same as tf.nn.dropout)

    • It uses the "keep_prob" rate

By dropout rate, I mean the ratio of nodes to be dropped
By keep_prob, I mean the ratio nodes to be kept

dropout rate = 1 - keep_prob

So,

In lab-11-4-mnist_cnn_layers.py, the rate should be changed to 0.3 from 0.7
because it uses tf.layers.dropout and it uses the dropout rate not the keep_prob

from deeplearningzerotoall.

sxjscience avatar sxjscience commented on June 11, 2024

@zeran4 I've tested these two scripts and in fact a keeping probability of 0.7 is correct. If we change the keeping probability to 0.3, too many nodes will be dropped and the performance will be quite bad.

You can refer to the implementation using MXNet https://github.com/hunkim/DeepLearningZeroToAll/blob/master/mxnet/mxlab-11-2-mnist_deep_cnn.py#L27

One more thing is that "dropout" is usually inserted before the FC layers and it's not standard to insert it before the Conv-Layers. The reason is that Conv-Layers already have local sparse connection structures and are less prone to overfitting. Nevertheless, it's okay to use it in the scripts for demonstration.

from deeplearningzerotoall.

chg0901 avatar chg0901 commented on June 11, 2024

In the file DeepLearningZeroToAll/lab-10-5-mnist_nn_dropout.py, we have this problem too

from deeplearningzerotoall.

kkweon avatar kkweon commented on June 11, 2024

finally fixed with #205 #206

from deeplearningzerotoall.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.