Last active
June 15, 2018 04:50
-
-
Save Alescontrela/9d12a0c26abf82bc222ddb24bcd594c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def initializeFilter(size, scale = 1.0): | |
''' | |
Initialize filter using a normal distribution with and a | |
standard deviation inversely proportional the square root of the number of units | |
''' | |
stddev = scale/np.sqrt(np.prod(size)) | |
return np.random.normal(loc = 0, scale = stddev, size = size) | |
def initializeWeight(size): | |
''' | |
Initialize weights with a random normal distribution | |
''' | |
return np.random.standard_normal(size=size) * 0.01 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment