Global (not LSTM) parameter. For the embeding and the classifier.
(options)
| 88 | |
| 89 | |
| 90 | def 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 | |
| 110 | def load_params(path, params): |
no test coverage detected