mlx-vis is a Python library that implements six dimensionality reduction methods and a k-nearest neighbor graph algorithm entirely in MLX, Apple's array framework for Apple Silicon. The library provides UMAP, t-SNE, PaCMAP, TriMap, DREAMS, CNE, and NNDescent, all executing on Metal GPU through a unified fit_transform interface. Beyond embedding computation, mlx-vis includes a GPU-accelerated circle-splatting renderer that produces scatter plots and smooth animations without matplotlib, composing frames via scatter-add alpha blending on GPU and piping them to hardware H.264 encoding. On Fashion-MNIST with 70,000 points, all methods complete embedding in 2.1-3.8 seconds and render 800-frame animations in 1.4 seconds on an M3 Ultra, with the full pipeline from raw data to rendered video finishing in 3.6-5.2 seconds. The library depends only on MLX and NumPy, is released under the Apache 2.0 license, and is available at https://github.com/hanxiao/mlx-vis.
翻译:mlx-vis是一个Python库,在Apple Silicon专用数组框架MLX中完整实现了六种降维方法与一种k近邻图算法。该库提供UMAP、t-SNE、PaCMAP、TriMap、DREAMS、CNE及NNDescent算法,均通过统一的fit_transform接口在Metal GPU上执行。除嵌入计算外,mlx-vis还包含GPU加速的圆形溅射渲染器,无需matplotlib即可生成散点图与平滑动画,其通过GPU上的散射叠加Alpha混合技术合成帧序列并直接传输至硬件H.264编码器。在包含70,000个样本的Fashion-MNIST数据集上,所有方法在M3 Ultra芯片上完成嵌入仅需2.1-3.8秒,渲染800帧动画仅需1.4秒,从原始数据到渲染视频的完整流程仅需3.6-5.2秒。该库仅依赖MLX与NumPy,基于Apache 2.0许可证发布,代码仓库位于https://github.com/hanxiao/mlx-vis。