MCPcopy
hub / github.com/karpathy/neuraltalk / initw

Function initw

imagernn/utils.py:16–18  ·  view source on GitHub ↗
(n,d)

Source from the content-addressed store, hash-verified

14 s0['regularize'].extend(s1['regularize'])
15
16def initw(n,d): # initialize matrix of this size
17 magic_number = 0.1
18 return (np.random.rand(n,d) * 2 - 1) * magic_number # U[-0.1, 0.1]
19
20def accumNpDicts(d0, d1):
21 """ forall k in d0, d0 += d1 . d's are dictionaries of key -> numpy array """

Callers 3

initMethod · 0.90
initMethod · 0.90
initMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected