fix(guide): simplify directory structure

This commit is contained in:
Mrugesh Mohapatra
2018-10-16 21:26:13 +05:30
parent f989c28c52
commit da0df12ab7
35752 changed files with 0 additions and 317652 deletions

View File

@ -0,0 +1,29 @@
---
title: Gradient Descent
---
## Gradient Descent
Gradient descent is an optimization algorithm for finding the minimum of a function. In deep learning this optimization algorithm is very useful when the parameters cannot be calculated analytically.
![Gradient Descent](https://upload.wikimedia.org/wikipedia/commons/6/68/Gradient_descent.jpg)
What you want to do is to repeatedly update the value of the parameter theta until you minimize the value of the Cost Function J(θ) close to 0;
### Learning Rate
The size of a step is called the learning rate. A larger learning rate make iterating faster but it might overshoot the global minimum, the value that we are looking for. On the other hand we could prevent this overshooting by decreasing the learning rate; but beware that the smaller you make the learning rate, the more computationally intensive it gets. This could either prolong the computation unnecessarily, or you may not arrive at the global minimum altogether.
### Feature Scaling
A deep learning problem would require you to use multiple features for generating a predictive model. If for example if you are building a predictive model for house pricing, you would have to deal with features like the price itself, number of rooms, lot area, etc. And these features might extremely differ in range, like for example while the lot area might be between 0 and 2000 square feet, the other features like the number of rooms would be between 1 and 9.
This is where feature scaling, also called normalization, comes in handy, to make sure that your machine learning algorithm works properly.
### Stochastic Gradient Descent
Machine learning problems usually requires computations over a sample size in the millions, and that could be very computationally intensive.
In stochastic gradient descent you update the the parameter for the cost gradient of each example rather that the sum of the cost gradient of all the examples. You could arrive at a set of good parameters faster after only a few passes through the training examples, thus the learning is faster as well.
### Further Reading
* [A guide to Neural Networks and Deep Learning](http://neuralnetworksanddeeplearning.com/)
* [Gradient Descent For Machine Learning](https://machinelearningmastery.com/gradient-descent-for-machine-learning/)
* [Difference between Batch Gradient Descent and Stochastic Gradient Descent](https://towardsdatascience.com/difference-between-batch-gradient-descent-and-stochastic-gradient-descent-1187f1291aa1)

View File

@ -0,0 +1,52 @@
---
title: Deep Learning
---
## Deep Learning
Deep Learning refers to a technique in Machine Learning where you have a lots of artificial neural networks stacked together in some architecture.
To the uninitiated, an artificial neuron is basically a mathematical function of some sort. And neural nets are neurons conected to each other. So in deep learning, you have lots of mathematical functions stacked on top (or on the side) of each other in some architecture. Each of the mathematical functions may have its own parameters (for an instance, an equation of a line `y = mx + c` has 2 parameters `m` and `c`) which need to be learned (during training). Once learned for a given task (say for classifying cats and dogs), this stack of mathematical functions (neurons) is ready to do its work of classifying images of cats and dogs.
![Cat or a dog?](https://image.slidesharecdn.com/deeplearningfromanoviceperspective-150811155203-lva1-app6891/95/deep-learning-from-a-novice-perspective-3-638.jpg?cb=1439308391)
### Why is it a big deal?
Coming up with set of rules manually for some of the tasks can very tricky (though theoretically possible). For instance, if you try to write a manual set of rules in order to classify an image (basically bunch of pixel values) of whether it belongs to a cat or dog, you'll see why it is tricky. Add to that the fact that dogs and cats come in variety of shapes, sizes and colors, and, not to mention, the images can have different backgrounds. You can quickly understand why coding such a simple problem can be problematic.
Deep Learning helps tackle this problem of figuring out the set of rules that can classify an image as that of a cat or a dog, automatically! All it needs is bunch of images that are already correctly classified as that of a cat or a dog and it'll be able to learn the required set of rules. Magic!
Turns out that there are a lot of problems out there which are not image-related (like voice recognition), where finding the set of rules is very tricky. Deep Learning can help with that provided there is lot of labelled data already present.
### How to train a deep learning model?
Training a deep neural network (a.k.a. our stack of mathematical functions arranged in some architecture) is basically an art with lot of hyper-parameters. Hyper-parameters are basically things such as which mathematical function to use, or which architecture to use, that you need to manually figure until your network is able to successfully classify cats and dogs. In order to train, you need lots of labelled data (in this case lots of images already classified as cats or dogs) and lots computing power and patience!
In order to train, you provide a neural network with a loss function which basically says how different are the results of the neural network vs the correct answers. Depending on the value of the loss function, you change the parameters of the mathematical function in such a way that the next time your network tries to classify the same image, the value of loss function is lower. You keep on finding the value of the loss function and updating the parameters again and again across the entire training data set until the loss function values are within reasonable margins. Your massive neural network is now ready!
### Some standard Neural Network architectures
Over the past few years, some of the models (i.e. the combination of the mathematical functions, the architecture, and the parameters) have become standard for certain tasks. For instance, a model called Resnet-152 won the Imagenet Challenge in 2015 which involves trying to classify images into 1000 categories (cats and dogs included). If you are planning to do similar tasks, then the recommendation is to start with such standard models and tweak them if they don't meet your requirements.
A resnet-152 model looks like this (Don't worry if you don't understand it. It's just bunch of mathematical functions stacked on top of each other in some interesting fashion):
![Resnet-152 Model](https://adeshpande3.github.io/assets/ResNet.gif)
Google had its own neural network architecture that won the Imagenet challenged in 2014. Which can be seen in a <a href="https://adeshpande3.github.io/assets/GoogleNet.gif">gif here in more detail</a>.
### How to implement your own?
These days there are a variety of deep learning frameworks that allow you specify which mathematical function you want to use, which architecture for your functions, and which loss function to use for training. Since the training of such a model is very computationally intensive, most of these frameworks generate code optimized for whatever hardware you may have. Some of the famous frameworks are:
* <a href="https://mxnet.incubator.apache.org/">Apache MXNet</a>
* <a href="https://www.tensorflow.org/">Google's Tensorflow</a>
* <a href="http://pytorch.org//">Pytorch</a>
* <a href="https://keras.io/">Keras</a>
* <a href="https://caffe2.ai/">Caffe2</a>
* <a href="https://github.com/gluon-api/gluon-api/">Gluon</a>
* <a href="http://deeplearning.net/software/theano/">Theano</a>
### More Information:
* <a href="http://www.deeplearningbook.org">Deep Learning Textbook</a>
* <a href="https://en.wikipedia.org/wiki/Deep_learning">Deep Learning</a>
* <a href="https://github.com/freeCodeCamp/guides/blob/master/src/pages/machine-learning/neural-networks/index.md">FreeCodeCamp Guide to Neural Networks</a>
* <a href="http://image-net.org/">Imagenet</a>
* <a href="https://adeshpande3.github.io/adeshpande3.github.io/A-Beginner's-Guide-To-Understanding-Convolutional-Neural-Networks/">A Beginner's Guide To Understanding Convolutional Neural Networks</a>
* <a href="https://www.youtube.com/playlist?list=PLjJh1vlSEYgvGod9wWiydumYl8hOXixNu">Deep Learning SIMPLIFIED - DeepLearning.TV</a>
* <a href="http://neuralnetworksanddeeplearning.com"> Neural Networks and Deep Learning</a>

View File

@ -0,0 +1,20 @@
---
title: Music Classification
---
## Music Classification
Music classification is yet another field where deep learning strategies could be applied in order to attain higher classfication accuracies than traditional machine learning methods. Deep Neural Networks which were originally being used for image recognition and computer vision tasks could be employed for music classification through the use of spectrograms. A spectrogram is nothing but a visual representation of the spectrum of frequencies present in the music over a period of time. In other words, a music signal which is a resultant frequency, could be separated into its spectrum of frequencies and the loudness in terms of dB could be visually represented for each frequency. This image could be used for training a neural net that classifies such spectrograms. A great use-case is genre recognition.
### The follwing are examples of various spectrograms:
![Spectrogram1](http://deepsound.io/images/new_blues_00.png)
The above spectrogram is of a song from the blues genre. Frequencies are along the y-axis, and time on x-axis. The brighter colors represent that the sound of that frequency is loud whereas darker colors represents they are soft at those particular points in time. Such an image containing so much data could be used to train a neural network. We generally use a mel-scaled spectrogram for the purpose of genre recognition, which is a scale of pitches judged by listeners, i.e., how we perceive such frequencies to distinguish between components of various genres.
**Fourier transforms**
An important detail to know is that such spectrograms are created with the help of a mathematical concept known as Fourier transforms. The Fourier transform decomposes a function of time into the frequencies that make it up.
#### More information
If you are using python, there are many libraries for signal processing. [Librosa](https://librosa.github.io/librosa/) is a famous one, another is [scipy](https://scipy.org/) which could also be used for other scientific purposes. mel-spectrograms could be created be leveraging these libraries.
##### Please take a look at the following links for more info on the above topic:
- [Finding Genre](https://hackernoon.com/finding-the-genre-of-a-song-with-deep-learning-da8f59a61194)
- [Deepsound](http://deepsound.io/music_genre_recognition.html)

View File

@ -0,0 +1,15 @@
---
title: Optimization Algorithms for Gradient Descent
---
## Optimization Algorithms for Gradient Descent
This is a stub. <a href='https://github.com/freecodecamp/guides/tree/master/src/pages/machine-learning/deep-learning/optimization-algorithms-for-gradient-descent/index.md' target='_blank' rel='nofollow'>Help our community expand it</a>.
<a href='https://github.com/freecodecamp/guides/blob/master/README.md' target='_blank' rel='nofollow'>This quick style guide will help ensure your pull request gets accepted</a>.
<!-- The article goes here, in GitHub-flavored Markdown. Feel free to add YouTube videos, images, and CodePen/JSBin embeds -->
#### More Information:
<!-- Please add any articles you think might be helpful to read before writing the article -->