在Tensorflow中运行会话之前,如何编写必须在占位符的张量上进行一些运算的损失函数?

时间:2018-10-18 07:08:24

标签: python tensorflow tensor

例如,我构建了AVE自动编码器,但是我需要在编码层进行一些计算,例如将编码层的W矩阵的某些行乘以或随机选择W矩阵的某些行。 sucode:

    # here the X is coding layer parameters in the autoencoder
    def func(X):
        # dosomething in X,such as randomly select some rows to do calulation
        # so i need use the index of row that i want to choose,i let the index
        # to be a placeholder.but it's terminate  before the session begin .
        dosomething
        return 

0 个答案:

没有答案