Posts

Showing posts from April, 2020

MSE Vs Entropy (2)

Image
This is the mean square error representation for a binary classification neural network, in which, our model outputs only one value; as a result, the mean square error graph has only one value which is globally optimal. While the mean square error representation for a  categorical neural network , in which, our model outputs more than one value;  the mean square error graph has more than one value which is locally sufficient solutions.  As a result, if we use the mean square error, the problem will have no solution, and for that reason, we use the cross-entropy loss instead.  Finally, here is the cross-entropy graph:

Max-pooling / Pooling in Neural Networks

Image
Max-pooling / Pooling Jump to: navigation ,  search Case  study  notes [1] Max pooling is a  sample-based discretization process . The objective is to down-sample an input representation (image, hidden-layer output matrix, etc.), reducing its dimensionality and allowing for assumptions to be made about features contained in the sub-regions binned. [2] How does it work and why [ edit ] This is done to in part to help over-fitting by providing an abstracted form of the representation. As well, it reduces the computational cost by reducing the  number  of parameters to learn and provides basic translation invariance to the internal representation. Max pooling is done by applying a max filter to (usually) non-overlapping subregions of the initial representation. Examples [ edit ] Let's say we have a 4x4 matrix representing our initial input. Let's say, as well, that we have a 2x2 filter that we'll run over our input. We'll have a  stride  of 2 (m

Your First Deep Learning Project in Python with Keras Step-By-Step

1. Load Data The first step is to define the functions and classes we intend to use in this tutorial. We will use the  NumPy library  to load our dataset and we will use two classes from the  Keras library  to define our model. The imports required are listed below. 1 2 3 4 5 # first neural network with keras tutorial from numpy import loadtxt from keras . models import Sequential from keras . layers import Dense . . . We can now load our dataset. In this Keras tutorial, we are going to use the Pima Indians onset of diabetes dataset. This is a standard machine learning dataset from the UCI Machine Learning repository. It describes patient medical record data for Pima Indians and whether they had an onset of diabetes within five years. As such, it is a binary classification problem (onset of diabetes as 1 or not as 0). All of the input variables that describe each patient are numerical. This makes it easy to use directly with neural network