def build(self, input_shape):
input_dim = input_shape[1]
self.input_spec = [InputSpec(dtype=K.floatx(),
shape=(None, input_dim))]
self.W = self.init((input_dim, self.output_dim), name='{}_W'.format(self.name))
self.trainable_weights = [self.W]
if self.initial_weights is not None:
self.set_weights(self.initial_weights)
del self.initial_weights
评论列表
文章目录