70cf20f6cf5e21c3b6165067483b925db61c161c,deepmedic/neuralnet/ops.py,,applyDropout,#Any#Any#Any#Any#Any#Any#,29

Before Change


    if dropoutRate > 0.001 : //Below 0.001 I take it as if there is no dropout at all. (To avoid float problems with == 0.0. Although my tries show it actually works fine.)
        probabilityOfStayingActivated = (1-dropoutRate)
        srng = T.shared_randomstreams.RandomStreams(rng.randint(999999))
        dropoutMask = srng.binomial(n=1, size=inputTrainShape, p=probabilityOfStayingActivated, dtype=theano.config.floatX)
        inputImgAfterDropout = inputTrain * dropoutMask
        inputImgAfterDropoutInference = inputInference * probabilityOfStayingActivated
        inputImgAfterDropoutTesting = inputTesting * probabilityOfStayingActivated
    else :
        inputImgAfterDropout = inputTrain
        inputImgAfterDropoutInference = inputInference
        inputImgAfterDropoutTesting = inputTesting
    return (inputImgAfterDropout, inputImgAfterDropoutInference, inputImgAfterDropoutTesting)


def applyBn(rollingAverageForBatchNormalizationOverThatManyBatches, inputTrain, inputVal, inputTest, inputShapeTrain) :
    numberOfChannels = inputShapeTrain[1]

After Change


        // tf.nn.dropout(x, keep_prob) scales kept values UP, so that at inference you dont need to scale then. 
        inputImgAfterDropoutTrain = inputTrain * dropoutMask
        inputImgAfterDropoutVal = inputVal * keep_prob
        inputImgAfterDropoutTest = inputTest * keep_prob
    else :
        inputImgAfterDropoutTrain = inputTrain
        inputImgAfterDropoutVal = inputVal
        inputImgAfterDropoutTest = inputTest
    return (inputImgAfterDropoutTrain, inputImgAfterDropoutVal, inputImgAfterDropoutTest)


def applyBn(rollingAverageForBatchNormalizationOverThatManyBatches, inputTrain, inputVal, inputTest, inputShapeTrain) :
    numOfChanns = inputShapeTrain[1]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: Kamnitsask/deepmedic
Commit Name: 70cf20f6cf5e21c3b6165067483b925db61c161c
Time: 2018-06-17
Author: konstantinos.kamnitsas12@imperial.ac.uk
File Name: deepmedic/neuralnet/ops.py
Class Name:
Method Name: applyDropout


Project Name: scipy/scipy
Commit Name: 8fa96615ca15ac4e8cf0f47838b7e686b5a370b7
Time: 2020-05-03
Author: pvanmulbregt@users.noreply.github.com
File Name: scipy/stats/_discrete_distns.py
Class Name: betabinom_gen
Method Name: _rvs


Project Name: scipy/scipy
Commit Name: 79a29529fb362cda993fe12515ad966295bdf2e6
Time: 2016-06-17
Author: person142@users.noreply.github.com
File Name: scipy/special/tests/test_cdflib.py
Class Name:
Method Name: _binomial_cdf