def preprocess_input(self, x):
if self.consume_less == 'cpu':
input_shape = K.int_shape(x)
input_dim = input_shape[2]
timesteps = input_shape[1]
x_f = time_distributed_dense(x, self.W_f, self.b_f, self.dropout_W,
input_dim, self.output_dim, timesteps)
x_h = time_distributed_dense(x, self.W_h, self.b_h, self.dropout_W,
input_dim, self.output_dim, timesteps)
return K.concatenate([x_f, x_h], axis=2)
else:
return x
评论列表
文章目录