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

Function param_init_lstm

code/lstm.py:138–157  ·  view source on GitHub ↗

Init the LSTM parameter: :see: init_params

(options, params, prefix='lstm')

Source from the content-addressed store, hash-verified

136
137
138def param_init_lstm(options, params, prefix='lstm'):
139 """
140 Init the LSTM parameter:
141
142 :see: init_params
143 """
144 W = numpy.concatenate([ortho_weight(options['dim_proj']),
145 ortho_weight(options['dim_proj']),
146 ortho_weight(options['dim_proj']),
147 ortho_weight(options['dim_proj'])], axis=1)
148 params[_p(prefix, 'W')] = W
149 U = numpy.concatenate([ortho_weight(options['dim_proj']),
150 ortho_weight(options['dim_proj']),
151 ortho_weight(options['dim_proj']),
152 ortho_weight(options['dim_proj'])], axis=1)
153 params[_p(prefix, 'U')] = U
154 b = numpy.zeros((4 * options['dim_proj'],))
155 params[_p(prefix, 'b')] = b.astype(config.floatX)
156
157 return params
158
159
160def lstm_layer(tparams, state_below, options, prefix='lstm', mask=None):

Callers

nothing calls this directly

Calls 2

ortho_weightFunction · 0.85
_pFunction · 0.85

Tested by

no test coverage detected