Init the LSTM parameter: :see: init_params
(options, params, prefix='lstm')
| 136 | |
| 137 | |
| 138 | def 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 | |
| 160 | def lstm_layer(tparams, state_below, options, prefix='lstm', mask=None): |
nothing calls this directly
no test coverage detected