首页 > 解决方案 > 使用 WALS 方法在 tensorflow 2.0 中进行矩阵分解

问题描述

我正在使用 WALS 方法来执行矩阵分解。最初在 tensorflow 1.13 中,我可以使用导入 factorization_ops

from tensorflow.contrib.factorization.python.ops import factorization_ops 

文档中所述

Wals 模型可以通过使用从 factorization_ops 调用

factorization_ops.WALSModel

在 tensorflow 2.0 中使用相同的命令给我以下错误

ModuleNotFoundError:没有名为“tensorflow.contrib.factorization”的模块

通过这个问题,似乎没有办法在 tensorflow 2.0+ 中使用 WALSModel。

此外,在 tensorflow 发布更新中也提到tf.contrib 已被弃用,功能已迁移到核心 TensorFlow API、生态系统项目(如 tensorflow/addons 或 tensorflow/io),或完全删除。

如何在 tensorflow 2.0 中使用 WALS 模型(目前我在 windows 机器上使用 2.0.0-rc0)?WALSModel 是否已被删除或者我错过了一些信息?

标签: pythontensorflowtensorflow2.0matrix-factorization

解决方案


我相信 TF 2.0 不支持 WALS ...官方推荐的模型是Neural Collaborative Filter (NCF)

我希望这有帮助。


推荐阅读