nse.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:onto-lstm 作者: pdasigi 项目源码 文件源码
def build(self, input_shape):
        self.input_spec = [InputSpec(shape=input_shape)]
        input_dim = input_shape[-1]
        reader_input_shape = self.get_reader_input_shape(input_shape)
        print >>sys.stderr, "NSE reader input shape:", reader_input_shape 
        writer_input_shape = (input_shape[0], 1, self.output_dim * 2)  # Will process one timestep at a time
        print >>sys.stderr, "NSE writer input shape:", writer_input_shape 
        composer_input_shape = self.get_composer_input_shape(input_shape)
        print >>sys.stderr, "NSE composer input shape:", composer_input_shape 
        self.reader.build(reader_input_shape)
        self.writer.build(writer_input_shape)
        self.composer.build(composer_input_shape)

        # Aggregate weights of individual components for this layer.
        reader_weights = self.reader.trainable_weights
        writer_weights = self.writer.trainable_weights
        composer_weights = self.composer.trainable_weights
        self.trainable_weights = reader_weights + writer_weights + composer_weights

        if self.initial_weights is not None:
            self.set_weights(self.initial_weights)
            del self.initial_weights
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号