TensorFlow 2.0中的tf.contrib.factorization.KMeans的等价API是什么?

问题描述 投票:0回答:1

在Tensorflow 1.13.1中,聚类模型可以通过使用 KMeans 对数 tf.contrib.factorization.KMeans 但升级到TensorFlow 2.0后,我发现很难找到一个合适的API来构建聚类模型。我找到了一个用于K-Means的估计器API。 tf.compat.v1.estimator.experimental.KMeans. 但是,它并不像前者那样对开发者友好。我需要使用TensorFlow实现一个聚类模型,但不知道哪个API会是合适的。

python tensorflow cluster-analysis k-means
1个回答
0
投票

旧的KMeans API经过重构后,按照Estimator API和? tf.contrib.factorization.KMeans 在转移到Tensorflow 2.0之前就已经被废弃了。做k-means的 "估计器 "方式在两个版本中是一样的。1.152.x.

如果你正在寻找更 "友好 "的方式,据我所知,你剩下的,如 scikit学习. 估算器不会很快消失,所以熟悉它们并不是一个坏主意(尽管有一个学习曲线)。

© www.soinside.com 2019 - 2024. All rights reserved.