Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

内积计算方式可能有问题? #15

Open
xgxg1314 opened this issue May 31, 2022 · 0 comments
Open

内积计算方式可能有问题? #15

xgxg1314 opened this issue May 31, 2022 · 0 comments

Comments

@xgxg1314
Copy link

您好!谢谢您的开源代码,非常棒的工作,但我对代码实现有一些疑问。

1、在您的代码第46行,计算梯度向量内积似乎有点问题,当然也有可能是我没有完全理解您的算法,请您见谅!
inner_product = tf.reduce_sum(grad_task*grads_task[k])

这行代码是为了计算梯度向量的内积,比如说有2个task loss,那么grad_task是二维张量(里面是两个loss的梯度向量),而grads_task[k]是一维张量(里面是其中一个loss的梯度向量),这样内积再求和,得到的也不是两个向量的内积。请问您是怎么理解这一行代码的呢?谢谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant