// Requires a Metal-capable development runtime and Apple GPU.
import aner.ml
import aner.nn
import aner.tensor

let x = [[0.0, 0.0], [0.0, 2.0], [10.0, 10.0], [10.0, 12.0]]
let device_x = nn.to(x.astype("Float32"), "mps")
let exhaustive = ml.fit_emeans(device_x, 2, 3.0, 42)
let indexed = ml.fit_omeans(device_x, 2, 3.0, 42)
print(exhaustive.summary())
print(indexed.summary())
print(exhaustive.inertia())
print(indexed.inertia())
let predicted = indexed.predict(device_x)
print(tensor.value(predicted, 0, 0) == tensor.value(indexed.labels(), 0, 0))
