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

Function init_params

code/lstm.py:90–107  ·  view source on GitHub ↗

Global (not LSTM) parameter. For the embeding and the classifier.

(options)

Source from the content-addressed store, hash-verified

88
89
90def init_params(options):
91 """
92 Global (not LSTM) parameter. For the embeding and the classifier.
93 """
94 params = OrderedDict()
95 # embedding
96 randn = numpy.random.rand(options['n_words'],
97 options['dim_proj'])
98 params['Wemb'] = (0.01 * randn).astype(config.floatX)
99 params = get_layer(options['encoder'])[0](options,
100 params,
101 prefix=options['encoder'])
102 # classifier
103 params['U'] = 0.01 * numpy.random.randn(options['dim_proj'],
104 options['ydim']).astype(config.floatX)
105 params['b'] = numpy.zeros((options['ydim'],)).astype(config.floatX)
106
107 return params
108
109
110def load_params(path, params):

Callers 1

train_lstmFunction · 0.85

Calls 1

get_layerFunction · 0.85

Tested by

no test coverage detected