10

I have just started learning Neural Networks for deep learning from cs231. I am trying to implement Neural Network in Python. I am looking at using Tensorflow or scikit-learn. What are some pros and cons of these libraries for this application?

Stephen Rauch
  • 1,831
  • 11
  • 23
  • 34
Muaaz Arif
  • 101
  • 1
  • 4

2 Answers2

13

Sklearn doesn't have much support for Deep Neural Networks. Among the two, since you are interested in deep learning, pick tensorflow.

However, I would suggest going with keras, which uses tensorflow as a backend, but offers an easier interface.

Djib2011
  • 8,068
  • 5
  • 28
  • 39
5

In the cs231n course, as far as I remeber, you spend most the time implementing neural networks yourself using nothing but NumPy! that was definitely an amazing learning experience for me.

After that, in the last assignments, you definitely need to be looking at either TensorFlow (examples) or Pytorch (examples) to build more complicated networks. These frameworks were built by people like those creating courses like CS231n - researchers and industry experts.

The SciKit Learn neural network module consists of feed-forward networks for either classification or regression, but nothing fancier, such as convolutional networks (CNNs), recurrent networks (RNNs) or other more exotic components, such as separate activation functions.

I agree with Djib2011, that that Keras is a great alternative to get started - and will let you choose between TensorFlow, CNTK or Theano as a backend. Keras is a nice uniform wrapper around all of the three monster frameworks, so let's you get things up and running very quickly. Here is a reletively recent and useful comparison of Keras with Pytorch

Once you are familiar with a tool like Keras, it will be faster to use that than the simple offerings in SciKit Learn.


I know you didn't ask about PyTorch, but I thought I'd mention it, as one of the original creators of CS231n, Andrej Karpathy, says it is the best framework(source 1, source 2).

n1k31t4
  • 15,468
  • 2
  • 33
  • 52