MCPcopy Index your code
hub / github.com/lisa-lab/DeepLearningTutorials / dropout_layer

Function dropout_layer

code/lstm.py:76–83  ·  view source on GitHub ↗
(state_before, use_noise, trng)

Source from the content-addressed store, hash-verified

74
75
76def dropout_layer(state_before, use_noise, trng):
77 proj = tensor.switch(use_noise,
78 (state_before *
79 trng.binomial(state_before.shape,
80 p=0.5, n=1,
81 dtype=state_before.dtype)),
82 state_before * 0.5)
83 return proj
84
85
86def _p(pp, name):

Callers 1

build_modelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected