update_function.py 文件源码

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

项目:recnet 作者: joergfranke 项目源码 文件源码
def fit(self, weights, o_error, tpo):

        gradients = theano.grad(o_error, weights)

        updates = []
        for v, w, g in zip(self.t_velocity, weights, gradients):
            #gradient = T.grad(o_error ,w)
            new_velocity = tpo["momentum_rate"] * v - tpo["learn_rate"] * g
            new_weights = w + new_velocity
            updates.append((w, new_weights))
            updates.append((v, new_velocity))
        return updates



######                       Vanilla SGD
########################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号