python - `tf.reciprocal` 与 `tf.inv` : is there any difference?

标签 python tensorflow matrix matrix-inverse

tf.reciprocaltf.inv 似乎是等效的。有什么区别吗?它们被实现为单独的 TF 操作,并且还具有单独的梯度实现,这看起来也是等效的。

最佳答案

它们的意思是一样的。事实上,tf.inv 已重命名为 tf.reciprocaltf.inv 在最新版本中不再暴露于顶级模块(尽管两者仍然存在于 gen_math_ops.py 中)。

来自migration documentation :

Many functions have been renamed to match NumPy. This was done to make the transition between NumPy and TensorFlow as easy as possible. There are still numerous cases where functions do not match, so this is far from a hard and fast rule, but we have removed several commonly noticed inconsistencies.

  • tf.inv
    • should be renamed to tf.reciprocal
    • This was done to avoid confusion with NumPy's matrix inverse np.inv

您可以看到还有多个已重命名的函数,例如 tf.multf.neg

关于python - `tf.reciprocal` 与 `tf.inv` : is there any difference?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48609466/

相关文章:

python - 使用 Tensorflow 作为 Anaconda 的环境

python - 导入keras时出错 ModuleNotFoundError : No module named 'tensorflow.examples' ; 'tensorflow' is not a package

algorithm - 方阵上的最大和

python - 嵌套语句,我做错了什么?

python - 尝试在屏幕上调用多个 Sprite 会导致故障?

python - Pycharm Python 控制台不打印输出

R keras包错误: Python module tensorflow. contrib.keras.python.keras未找到

python - 使用 Python 将多个文件中的项目组合成一个矩阵

python - 多个向量对的 Numpy 和点积 : how can it be done?

python - 如何使用 Pandas 查找重复名称?