Routines.py 文件源码

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

项目:structured-output-ae 作者: sbelharbi 项目源码 文件源码
def shared_dataset_xy(self, data_xy, nlabels = 10, train = False, task="cls", borrow=True):
        """Load the data to the shared variables of Theano.

        Copy for once the data to the shared memory on the GPU.
        """

        data_x, data_y = data_xy
        if (train) and (task=='cls'):
            data_y = np.int32(self.labels(data_y, nlabels))

        shared_x = theano.shared(
                np.asarray(data_x, dtype = theano.config.floatX),
                borrow=borrow)
        shared_y = theano.shared (
                np.asarray(data_y, dtype = theano.config.floatX),
                borrow=borrow)
        return shared_x, T.cast(shared_y, 'int32')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号