ista_tf.py 文件源码

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

项目:AdaptiveOptim 作者: tomMoral 项目源码 文件源码
def _get_step(self, inputs):
        Z, X, lmbd = self.inputs
        K, p = self.D.shape
        L = self.L
        with tf.name_scope("step_ISTA"):
            self.S = tf.constant(np.eye(K, dtype=np.float32) - self.S0/L,
                                 shape=[K, K], name='S')
            self.We = tf.constant(self.D.T / L, shape=[p, K],
                                  dtype=tf.float32, name='We')
            B = tf.matmul(X, self.We, name='B')
            hk = tf.matmul(Z, self.S) + B
            step = soft_thresholding(hk, lmbd / L)
            dz = tf.reduce_mean(tf.reduce_sum(
                tf.squared_difference(step, Z), reduction_indices=[1]))
        return step, dz
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号