Posts

Batch Normalization

Image
Today let's enter inside the Deep Neural Network to understand what actually batch Normalization is, what all problems can we face if Batch Normalization is not used and advantages of using it in our model. In machine learning we have been constantly using this technique of feature scaling such as standardization or normalization over our features so that there is uniformity in ranges of all features and there's no inbuilt bias from the model over a particular feature or set of features. Similarly in Neural Network  we normalize our input by mean centring to zero and variance scaling to unity which is also known as "whitening". Okay so as of now we have normalized our inputs to zero mean and unit variance. Sounds good .  But what about the values deep inside the network?? Will it follow the same distribution as that of input values distribution?? Let's find out..!!! We are here extensively dealing with Deep Neural Network which are having a lot of hidden layers p...

Why activation function is needed in Neural Networks???

Image
Today allow me to share with you, the relationship between a spider and an activation function   Activation function is used in Neural network to introduce the non-linearity. Without the proper activation function, neural network will simply be large Linear Model.   Consider the case where you have a data which is linearly separable  Constructing a model to separate yellow and orange data points is very simple. A simple logistic regression will do this job very perfectly  Now consider the case where your data set looks like something shown below What do you think now?? will a simple linear model be able to carve out the hyperplane in such a way to classify both yellow and orange points. I don’t think so. And it is the fact that a simple linear model may not be able to find complex patterns in a data.  So now we go to big brother of linear model -Neural network. Neural Network has this super ability to both carve out linear...

Mathematical Formulation for Logistic Regression

Image
 Today we will explore the mathematical backing of the Machine Learning Algorithm LOGISTIC REGRESSION. I hope you are already well acquainted with the theory behind it. Let’s dive deep inside the pool of mathematics to know what goes behind logistic regression.  As we know Logistic Regression is a binary classifier, consider a two class classification problem consisting of red and blue as two classes, and are separated by a straight line. We assume that our data is linearly separable. The line L has a normal w and intercept b. Original direction of normal to the line is towards red points. If the L passes through origin then b equals 0. We know that a line can be represented in the form of its normal is L: wt*x +b=0 where w is a vector, x is a vector and b is a scalar Now the problem statement is given the data points consisting of red and blue points, we need to find such a line with w and b that separates red points from blue points. How can we approach this problem?? ...

SQL Revision Part -1

Image
 Let’s start with SQL basics. SQL is a standard language for storing, manipulating and retrieving data in databases. We will revise all the command and syntax used in the SQL. I assume that reader is well acquainted with the SQL or even has some idea about it. I hope you have worked with “imdb” dataset and know how to load it in the MySQL command line client. We will extensively use imdb database in the entire bootcamp               1.   USE : The "USE imdb " command will load the database imdb into SQL command line.              2. SHOW TABLES:             Displays all the tables present in the database.                From here we can see that there are total of 7 tables present in the imdb database.        3. DESCRIBE or DESC:         It describes the structure of ...

Visualizing Data Part - 1

Image
  Let's talk about features, how can they be visualized. Do you remember Cartesian plane we studied in our school days? Am pretty sure  you do.  A simple plane or space where we can represent our data. Consider a Cartesian plane having x axis and y axis .Now if we plot a data as (3,4) then we are aware that 3 is nothing but 3 units towards x axis from origin and  4 represents 4 units towards y axis from origin. And this point (3,4) is nothing but a scalar term so we used cartesian plane. But in ML we deal with features as a vectors so we need to know Vector Space. And if you know Cartesian Plane  then Vector Space/Plane is simply the same but with high dimensions representations capability.   Okay now that we are cleared with terminologies let's move forward. Consider that you have been given a task of classifying girls and boys on the basis of height of few students given to you . So we can intuitively say that girls have a somewhat shorter height th...