scikit-learn 会使用 GPU 吗? [英] Will scikit-learn utilize GPU?

查看:197
本文介绍了scikit-learn 会使用 GPU 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 TensorFlow 中阅读 scikit-learn 的实现:http://learningtensorflow.com/lesson6/ 和scikit-learn:http://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html 我正在努力决定使用哪个实现.

Reading implementation of scikit-learn in TensorFlow: http://learningtensorflow.com/lesson6/ and scikit-learn: http://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html I'm struggling to decide which implementation to use.

scikit-learn 作为 tensorflow docker 容器的一部分安装,因此可以使用任一实现.

scikit-learn is installed as part of the tensorflow docker container so can use either implementation.

使用 scikit-learn 的原因:

Reason to use scikit-learn :

scikit-learn 包含的样板文件比 tensorflow 少实施.

scikit-learn contains less boilerplate than the tensorflow implementation.

使用张量流的原因:

如果在 Nvidia GPU 上运行,算法将并行运行,我不确定 scikit-learn 是否会利用所有可用的 GPU?

If running on Nvidia GPU the algorithm will be run against in parallel , I'm not sure if scikit-learn will utilize all available GPUs?

阅读https://www.quora.com/What-are-the-main-differences-between-TensorFlow-and-SciKit-Learn

TensorFlow 更底层;基本上,乐高积木有帮助你实现机器学习算法,而 scikit-learn为您提供现成的算法,例如,算法分类,例如 SVM、随机森林、逻辑回归和许多,更多.如果您想实施,TensorFlow 会大放异彩深度学习算法,因为它允许您利用GPU 可实现更高效的训练.

TensorFlow is more low-level; basically, the Lego bricks that help you to implement machine learning algorithms whereas scikit-learn offers you off-the-shelf algorithms, e.g., algorithms for classification such as SVMs, Random Forests, Logistic Regression, and many, many more. TensorFlow shines if you want to implement deep learning algorithms, since it allows you to take advantage of GPUs for more efficient training.

此声明再次强化了我的断言,即scikit-learn 包含的样板文件少于 tensorflow 实现";但也暗示 scikit-learn 不会利用所有可用的 GPU?

This statement re-enforces my assertion that "scikit-learn contains less boilerplate than the tensorflow implementation" but also suggests scikit-learn will not utilize all available GPUs?

推荐答案

Tensorflow 仅在针对 Cuda 和 CuDNN 构建时才使用 GPU.默认情况下它不使用 GPU,尤其是当它在 Docker 中运行时,除非您使用 nvidia-docker 和带有内置支持的图像.

Tensorflow only uses GPU if it is built against Cuda and CuDNN. By default it does not use GPU, especially if it is running inside Docker, unless you use nvidia-docker and an image with a built-in support.

Scikit-learn 不打算用作深度学习框架,也不提供任何 GPU 支持.

Scikit-learn is not intended to be used as a deep-learning framework and it does not provide any GPU support.

为什么不支持深度学习或强化学习/scikit-learn 中会支持深度学习或强化学习吗?

深度学习和强化学习都需要丰富的定义架构的词汇,另外还有深度学习需要 GPU 来进行高效计算.然而,这两者都不适合在 scikit-learn 的设计限制内;结果,深学习和强化学习目前超出了scikit-learn 想要实现的目标.

Deep learning and reinforcement learning both require a rich vocabulary to define an architecture, with deep learning additionally requiring GPUs for efficient computing. However, neither of these fit within the design constraints of scikit-learn; as a result, deep learning and reinforcement learning are currently out of scope for what scikit-learn seeks to achieve.

摘自 http://scikit-learn.org/stable/faq.html#why-is-there-no-support-for-deep-or-reinforcement-learning-will-there-be-support-for-deep-or-reinforcement-learning-in-scikit-learn

你会在 scikit-learn 中添加 GPU 支持吗?

不会,或者至少在不久的将来不会.主要原因是GPU支持将引入许多软件依赖项并引入平台特定问题.scikit-learn 旨在易于安装在各种平台上.在神经网络之外,GPU 在今天的机器学习中并没有发挥很大的作用,而且很多通过谨慎选择,通常可以实现更大的速度提升算法.

No, or at least not in the near future. The main reason is that GPU support will introduce many software dependencies and introduce platform specific issues. scikit-learn is designed to be easy to install on a wide variety of platforms. Outside of neural networks, GPUs don’t play a large role in machine learning today, and much larger gains in speed can often be achieved by a careful choice of algorithms.

摘自 http://scikit-learn.org/stable/faq.html#will-you-add-gpu-support

这篇关于scikit-learn 会使用 GPU 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆