Cartesian_to_spherical_coordinates returns NaN gradients near (0, 0, 1).

未关闭
#394 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
35/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
停滞
技术栈
python

调研方向

从 Cartesian_to_spherical_coordinates 入口点及其当前 docstring 开始,然后对比 issue 中链接的生成版 TensorFlow API 页面。确认现有文本如何描述平滑性,并更新相关文档以涵盖可能出现的 NaN 梯度和报告的失效链接;当本地文档和网站文档都准确反映该函数的行为时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

Hello tensorflow-graphics team,

Could you please update the docstring to mention that NaNs gradients can be returned?
You could also consider printing a warning when the input is close to (0, 0, 1) or returning a gradient other than NaNs (e.g. 1 or 0). Alternatively, branching based on (z/radius) to use arcsin rather than arccos can also minimize numerical instabilities in the gradient, though it may also reduce performance. See [2] for an example.

The docstring mentions that this function is not smooth at (0, 0, 1) but does not specify that NaN gradients can occur. Furthermore, the website [1] is not updated to mention the smoothness and has a dead github link (Related to #383?).

[1] https://www.tensorflow.org/graphics/api_docs/python/tfg/math/math_helpers/cartesian_to_spherical_coordinates
[2] https://colab.research.google.com/drive/1ECn4eYaeQfRfXaC46BX75ZDZmwSkMkWH?usp=sharing

主要语言
Python
星标
2.8k
派生
374
平均合并
5 天 9 小时
30 天内合并 PR
1

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

tensorflow/graphics 的其他 Issue

查看 tensorflow/graphics 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。