Key Functions
In this lesson, we will discuss some of the key functions that we will be using throughout the course.
Key functions
Below are the key function froms keras
, which will be used throughout the course.
Dense()
This function will be used to create our regular densely-connected neural network layer. There are many parameters accepted by this function, but we will mainly use the parameters below:
units
- the number of neurons (nodes) in a layer. In other words, the dimensionality of output space.activation
- the type of activation function for this layer. We will discuss the types of activation functions last.
Dropout()
The dropout layer randomly sets the neurons or nodes of a layer to 0
with a frequency of the rate
at each step during training time, which helps prevent overfitting. We pass the value of rate
as a parameter, i.e., how many neurons in a layer we want to be set to 0
.
Flatten()
This function is used to convert the shape of the data to a single column vector. For example, after passing the input to the dropout
layer, we get a shape of (1, 10, 64)
then, after applying the flattening we get the shape as (640,)
.
Conv2D()
This layer creates a convolution kernel that is convolved with the layer input to produce a tensor of outputs. In other words, this function is used to perform the convolution operation on the data. There are many parameters accepted by this function but we will mainly use the following parameters:
filters
- the number of filters we need or the