Questions tagged [deep-learning]

Deep Learning is an area of machine learning whose goal is to learn complex functions using special neural network architectures that are "deep" (consist of many layers). This tag should be used for questions about implementation of deep learning architectures. General machine learning questions should be tagged "machine learning". Including a tag for the relevant software library (e.g., "keras", "tensorflow","pytorch","fast.ai" etc) is helpful.

Deep Learning is a branch of aimed at building to learn complex functions using special neural network architectures with many layers (hence the term "deep").

Deep neural network architectures allow for more complex tasks to be learned because, in addition to these neural networks having more layers to perform transformations, the larger number of layers and more complex architectures of the neural network allow a hierarchical organization of functionality to emerge.

Deep Learning was introduced into machine learning research with the intention of moving machine learning closer to artificial intelligence. A significant impact of deep learning lies in feature learning, mitigating much of the effort going into manual feature engineering in non-deep learning neural networks.

NOTE: If you want to use this tag for a question not directly concerning implementation, then consider posting on Cross Validated, Data Science, or Artificial Intelligence instead; otherwise your question is probably off-topic. Please choose one site only and do not cross-post to more than one - see Is cross-posting a question on multiple Stack Exchange sites permitted if the question is on-topic for each site? (tl;dr: no).

Resources

Papers

Books

Videos

Stack Exchange Sites

Other StackExchange sites with Deep Learning tag:

27406 questions
90
votes
4 answers

Batch Normalization in Convolutional Neural Network

I am newbie in convolutional neural networks and just have idea about feature maps and how convolution is done on images to extract features. I would be glad to know some details on applying batch normalisation in CNN. I read this paper…
89
votes
1 answer

How does the "number of workers" parameter in PyTorch dataloader actually work?

If num_workers is 2, Does that mean that it will put 2 batches in the RAM and send 1 of them to the GPU or Does it put 3 batches in the RAM then sends 1 of them to the GPU? What does actually happen when the number of workers is higher than the…
floyd
  • 1,431
  • 2
  • 12
  • 18
88
votes
2 answers

PyTorch: How to change the learning rate of an optimizer at any given moment (no LR schedule)

Is it possible in PyTorch to change the learning rate of the optimizer in the middle of training dynamically (I don't want to define a learning rate schedule beforehand)? So let's say I have an optimizer: optim = torch.optim.SGD(model.parameters(),…
patapouf_ai
  • 17,605
  • 13
  • 92
  • 132
88
votes
3 answers

What is the difference between loss function and metric in Keras?

It is not clear for me the difference between loss function and metrics in Keras. The documentation was not helpful for me.
Zaratruta
  • 2,097
  • 2
  • 20
  • 26
88
votes
8 answers

How to assign a value to a TensorFlow variable?

I am trying to assign a new value to a tensorflow variable in python. import tensorflow as tf import numpy as np x = tf.Variable(0) init = tf.initialize_all_variables() sess =…
87
votes
3 answers

How should the learning rate change as the batch size change?

When I increase/decrease batch size of the mini-batch used in SGD, should I change learning rate? If so, then how? For reference, I was discussing with someone, and it was said that, when batch size is increased, the learning rate should be…
Tanmay
  • 1,091
  • 1
  • 9
  • 15
84
votes
12 answers

How can I use a pre-trained neural network with grayscale images?

I have a dataset containing grayscale images and I want to train a state-of-the-art CNN on them. I'd very much like to fine-tune a pre-trained model (like the ones here). The problem is that almost all models I can find the weights for have been…
Jcart
  • 950
  • 1
  • 7
  • 6
83
votes
3 answers

How to calculate the number of parameters for convolutional neural network?

I'm using Lasagne to create a CNN for the MNIST dataset. I'm following closely to this example: Convolutional Neural Networks and Feature Extraction with Python. The CNN architecture I have at the moment, which doesn't include any dropout layers,…
Waddas
  • 1,353
  • 2
  • 16
  • 28
82
votes
10 answers

Neural network always predicts the same class

I'm trying to implement a neural network that classifies images into one of the two discrete categories. The problem is, however, that it currently always predicts 0 for any input and I'm not really sure why. Here's my feature extraction method: def…
79
votes
9 answers

How to import keras from tf.keras in Tensorflow?

import tensorflow as tf import tensorflow from tensorflow import keras from keras.layers import Dense I am getting the below error from keras.layers import Input, Dense Traceback (most recent call last): File "",…
GeorgeOfTheRF
  • 8,244
  • 23
  • 57
  • 80
77
votes
2 answers

How does keras handle multiple losses?

If I have something like: model = Model(inputs = input, outputs = [y1,y2]) l1 = 0.5 l2 = 0.3 model.compile(loss = [loss1,loss2], loss_weights = [l1,l2], ...) what does Keras do with the losses to obtain the final loss? Is it something…
jfga
  • 803
  • 1
  • 8
  • 8
77
votes
3 answers

Gradient Descent vs Adagrad vs Momentum in TensorFlow

I'm studying TensorFlow and how to use it, even if I'm not an expert of neural networks and deep learning (just the basics). Following tutorials, I don't understand the real and practical differences between the three optimizers for loss. I look at…
Kyrol
  • 3,475
  • 7
  • 34
  • 46
77
votes
3 answers

Estimating the number of neurons and number of layers of an artificial neural network

I am looking for a method on how to calculate the number of layers and the number of neurons per layer. As input I only have the size of the input vector, the size of the output vector and the size of the training set. Usually the best net is…
76
votes
2 answers

Tensorflow: None of the MLIR optimization passes are enabled (registered 1)

I am using a very small model for testing purposes using tensorflow 2.3 and keras. Looking at my terminal, I get the following warning: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:118] None of the MLIR optimization passes are enabled…
MichaelJanz
  • 1,775
  • 2
  • 8
  • 23
75
votes
12 answers

How to return history of validation loss in Keras

Using Anaconda Python 2.7 Windows 10. I am training a language model using the Keras exmaple: print('Build model...') model = Sequential() model.add(GRU(512, return_sequences=True, input_shape=(maxlen,…
ishido
  • 4,065
  • 9
  • 32
  • 42