tf.keras.models.Sequential()vs 和有什么区别tf.keras.Sequential()?我不太了解它们之间的差异。有人可以向我解释一下吗?我是 TensorFlow 新手,但对机器学习有一些基本了解。
我想在 google-collaboratory 中与 matplotlib 图形 2D 和 3D 进行交互。我无法使用此普通代码进行缩放、旋转或进行任何类型的交互。
import numpy as np
from sklearn.cluster import MeanShift
from sklearn.datasets.samples_generator import make_blobs
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import style
style.use("ggplot")
centers = [[1,1,1],[5,5,5],[3,10,10]]
X, _ = make_blobs(n_samples = 100, centers = centers, cluster_std = 1.5)
ms = MeanShift()
ms.fit(X)
labels = ms.labels_
cluster_centers = ms.cluster_centers_
print(cluster_centers)
n_clusters_ = len(np.unique(labels))
print("Number of estimated clusters:", n_clusters_)
colors = 10*['r','g','b','c','k','y','m']
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
for i …Run Code Online (Sandbox Code Playgroud)