Beispiel #1
0
 def _make_bias(self, params):
     bias = []
     for i in range(params.num_layers):
         bias.append(L.RNNParameterSet(
             np.random.rand(params.hidden_size).astype(np.float32),
             np.random.rand(params.hidden_size).astype(np.float32)))
     return bias
Beispiel #2
0
 def _make_weights(self, params, skip=False):
     weights = []
     for i in range(params.num_layers):
         w_out = params.hidden_size
         w_in = params.hidden_size if i > 0 or skip else params.data_size
         weights.append(L.RNNParameterSet(
             np.random.rand(w_out, w_in).astype(np.float32),
             np.random.rand(w_out, w_out).astype(np.float32)))
     return weights