<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: AI Pool</title>
    <description>The latest articles on DEV Community by AI Pool (@aipool3).</description>
    <link>https://dev.to/aipool3</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F639870%2Fa3309e54-42e9-4e60-b07d-6234f6ad8082.png</url>
      <title>DEV Community: AI Pool</title>
      <link>https://dev.to/aipool3</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aipool3"/>
    <language>en</language>
    <item>
      <title>Confidence Interval Understanding</title>
      <dc:creator>AI Pool</dc:creator>
      <pubDate>Wed, 09 Jun 2021 17:12:20 +0000</pubDate>
      <link>https://dev.to/aipool3/confidence-interval-understanding-3878</link>
      <guid>https://dev.to/aipool3/confidence-interval-understanding-3878</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;Suppose you are looking for a particular value of a characteristic of a population, firstly data is obtained from a sample of that population(could be the mean), and the parameter is guessed from the sampled data. Due to not using the whole population, one may ask if the sampled data is a reliable estimation of the whole population. This is where confidence interval comes in.&lt;/p&gt;

&lt;h3&gt;
  
  
  Confidence Interval
&lt;/h3&gt;

&lt;p&gt;As earlier mentioned, the &lt;strong&gt;range of values&lt;/strong&gt; that you expect your estimate to lie within, within a certain level of confidence is the confidence interval.  For instance, if you say you have a 90% confidence level, it means you are &lt;strong&gt;very confident that 90% of the time&lt;/strong&gt;, your estimate falls between the lower and upper bounds which are specified by that confidence interval.&lt;/p&gt;

&lt;p&gt;There's a value called the &lt;strong&gt;alpha value&lt;/strong&gt;, which indicates a threshold, for instance, an alpha of 0.1, which means that there's a less than 10% chance that the test could have occurred under the null hypothesis. Coming back to our confidence level, the desired confidence level is normally 1 minus this alpha value used in the statistical testing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8lNLA-Ox--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://files.ai-pool.com/a/78fcb62f6ed4096377bfb01d63fb30b8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8lNLA-Ox--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://files.ai-pool.com/a/78fcb62f6ed4096377bfb01d63fb30b8.png" alt="img"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Therefore, if an &lt;strong&gt;alpha value of p &amp;lt; 0.1&lt;/strong&gt; is chosen for statistical significance, then the confidence level would ultimately be &lt;strong&gt;1-0.1= 0.9 or 90%&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Confidence intervals are used for various statistical estimates such as &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Proportions&lt;/li&gt;
&lt;li&gt;Mean of a population&lt;/li&gt;
&lt;li&gt;Differences that exist  between the mean and proportions of a population&lt;/li&gt;
&lt;li&gt;the variation estimates among groups&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As the same suggests, these are all estimates of a number and do not give valuable information around that number, but the confidence interval is a good way to know more information about the variations of the number.&lt;/p&gt;

&lt;p&gt;You can find more in the following article &lt;a href="https://ai-pool.com/a/s/confidence-interval-understanding"&gt;Confidence Interval Understanding&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Other Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/a/s/bias-variance-tradeoff-in-machine-learning"&gt;Bias-Variance Tradeoff in Machine Learning&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/a/s/understanding-of-probability-distribution-and-normal-distribution"&gt;Understanding of Probability Distribution and Normal Distribution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/a/s/recommendation-systems-by-matrix-factorization-and-collaborative-filtering"&gt;Recommendation Systems by Matrix Factorization and Collaborative Filtering&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/a/s/understanding-of-regularization-in-neural-networks"&gt;Understanding of Regularization in Neural Networks&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aipool</category>
      <category>ai</category>
      <category>machinelearning</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Normalization in Deep learning</title>
      <dc:creator>AI Pool</dc:creator>
      <pubDate>Sat, 05 Jun 2021 08:21:02 +0000</pubDate>
      <link>https://dev.to/aipool3/normalization-in-deep-learning-4m73</link>
      <guid>https://dev.to/aipool3/normalization-in-deep-learning-4m73</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;Deep learning is an exciting field in Artificial intelligence, it is at the forefront of the most innovative and exciting fields such as computer vision, reinforcement learning, and natural language processing. Deep learning has a complex architecture, which comes with some problems. These deep neural networks have tons of layers, which are difficult to train because they are responsive to the learning algorithm's initial random weights and configuration.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ffiles.ai-pool.com%2Fa%2Fbc86348d9d3a3ecdceeb6cfa89b13b6f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ffiles.ai-pool.com%2Fa%2Fbc86348d9d3a3ecdceeb6cfa89b13b6f.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The input layer may have certain features which dominate the process, due to having high numerical values. This can create a bias in the network because only those features contribute to the outcome of the training. For example, imagine feature one having values between 1 and 5, and feature two having values between &lt;strong&gt;100&lt;/strong&gt; and &lt;strong&gt;10000&lt;/strong&gt;. During training, due to the difference in scale of both features, feature two would dominate the network and only that feature would have a contribution to the outcome of the model.&lt;/p&gt;

&lt;h3&gt;
  
  
  Batch Normalization
&lt;/h3&gt;

&lt;p&gt;Batch normalization is the most common form of normalization in deep learning. It scales the inputs to a layer to a common value for every mini-batch during the training of deep neural networks. This stabilizes the learning process and significantly reduces the number of epochs required to train deep networks, enabling the network to train faster.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ffiles.ai-pool.com%2Fa%2F8446673bcaeb050168ff1666aff18bdd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Ffiles.ai-pool.com%2Fa%2F8446673bcaeb050168ff1666aff18bdd.png" alt="BN"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The way batch normalization works are by calculating the mean and variance of every feature in the mini-batch, then the mean is subtracted and each feature is divided by the standard deviation of the mini-batch.&lt;/p&gt;

&lt;p&gt;You can find more in the following article &lt;a href="https://ai-pool.com/a/s/normalization-in-deep-learning" rel="noopener noreferrer"&gt;Normalization in Deep learning&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Other Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/a/s/optimization-methods" rel="noopener noreferrer"&gt;Optimization Methods, Gradient Descent&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/a/s/diving-into-object-detection-basics" rel="noopener noreferrer"&gt;Diving into Object Detection Basics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/a/s/understanding-of-support-vector-machine--svm" rel="noopener noreferrer"&gt;Understanding of Support Vector Machine (SVM)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/a/s/introduction-of-fast-fourier-transformation--fft" rel="noopener noreferrer"&gt;Introduction of Fast Fourier Transformation (FFT)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aipool</category>
      <category>ai</category>
      <category>machinelearning</category>
      <category>normalization</category>
    </item>
    <item>
      <title>Understanding of Probability Distribution and Normal Distribution</title>
      <dc:creator>AI Pool</dc:creator>
      <pubDate>Mon, 31 May 2021 17:44:56 +0000</pubDate>
      <link>https://dev.to/aipool3/understanding-of-probability-distribution-and-normal-distribution-3bfc</link>
      <guid>https://dev.to/aipool3/understanding-of-probability-distribution-and-normal-distribution-3bfc</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;Statistics is a key component in data science, which deals with gathering, analyzing, and drawing conclusions from data. An aspect of statistics is the probability distribution, which gives an idea of the likelihood of an event occurring, for example, there is an 80% chance of rain tonight. &lt;/p&gt;

&lt;p&gt;Regarding probability, the common notation used is p(X), which means the probability that a random variable X is equal to a particular value, therefore &lt;strong&gt;p(X=0.8)&lt;/strong&gt;, in the example given, indicates that there's an &lt;strong&gt;80%&lt;/strong&gt; chance of X occurring. The sum of all probabilities should be equal to 1, therefore if there's a &lt;strong&gt;0.8&lt;/strong&gt; chance of rain, then there's a &lt;strong&gt;0.2&lt;/strong&gt; chance of no rain. Probabilities are also between 0 and 1.  There are two types of probability distributions, &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Discrete probability distribution&lt;/li&gt;
&lt;li&gt;Continuous probability distribution&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The following sections talk a bit more about both distributions&lt;/p&gt;

&lt;h4&gt;
  
  
  Visualization of different types of distribution
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--11xR50qz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://files.ai-pool.com/a/e26089688028a208fcf058af4425aa6c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--11xR50qz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://files.ai-pool.com/a/e26089688028a208fcf058af4425aa6c.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are various types of a discrete probability distribution, some of which are&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Poisson, for counting situations, such as the counts of televisions sold at a video store per week&lt;/li&gt;
&lt;li&gt;Binomial for the binary situations, such as if it would rain or not&lt;/li&gt;
&lt;li&gt;Uniform distribution for multiple situations that have the same probability such as a die roll&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  The following plot is a visualization of Normal Distribution
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--As2iHXtH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://files.ai-pool.com/a/0e870fac6dada603d5ef8d831446131a.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--As2iHXtH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://files.ai-pool.com/a/0e870fac6dada603d5ef8d831446131a.jpg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The normal distribution has certain characteristics which make it a bit easier to spot, some of which are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The mean, median, and mode are equal&lt;/li&gt;
&lt;li&gt;There is no skew(whether left or right), meaning 50% of the values are on the left of the mean, and the other 50% on the right&lt;/li&gt;
&lt;li&gt;The mean and standard deviation are the key terms that characterize this&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can find more about Gaussian Distribution in the &lt;a href="https://ai-pool.com/a/s/understanding-of-probability-distribution-and-normal-distribution"&gt;Following Article&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Other Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/a/s/confidence-interval-understanding"&gt;Confidence Interval Understanding&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/a/s/decision-trees"&gt;Decision Trees&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/a/s/understanding-of-regularization-in-neural-networks"&gt;Understanding of Regularization in Neural Networks&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aipool</category>
      <category>ai</category>
      <category>machinelearning</category>
      <category>datascience</category>
    </item>
    <item>
      <title>AlexNet</title>
      <dc:creator>AI Pool</dc:creator>
      <pubDate>Sat, 29 May 2021 16:01:14 +0000</pubDate>
      <link>https://dev.to/aipool3/alexnet-pga</link>
      <guid>https://dev.to/aipool3/alexnet-pga</guid>
      <description>&lt;h3&gt;
  
  
  ImageNet Classification with Deep Convolutional Neural Networks
&lt;/h3&gt;

&lt;p&gt;We trained a large, deep convolutional neural network to classify the 1.2 million high-resolution images in the ImageNet LSVRC-2010 contest into the 1000 different classes. On the test data, we achieved top-1 and top-5 error rates of 37.5% and 17.0% which is considerably better than the previous state-of-the-art. The neural network, which has 60 million parameters and 650,000 neurons, consists of five convolutional layers, some of which are followed by max-pooling layers, and three fully-connected layers with a final 1000-way softmax.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks.pdf"&gt;Paper&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Implementations
&lt;/h1&gt;

&lt;p&gt;In 2012, AlexNet significantly outperformed all the prior competitors and won the challenge by reducing the top-5 error from 26% to 15.3%. The second place top-5 error rate, which was not a CNN variation, was around 26.2%.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;keras&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;keras.models&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Sequential&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;keras.layers&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Dense&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Activation&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Dropout&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Flatten&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Conv2D&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MaxPooling2D&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;keras.layers.normalization&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;BatchNormalization&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;
&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;seed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;#Instantiate an empty model
&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Sequential&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# 1st Convolutional Layer
&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Conv2D&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;filters&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;96&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;input_shape&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;224&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;224&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;kernel_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;strides&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;padding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="n"&gt;valid&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Activation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;relu&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="c1"&gt;# Max Pooling
&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MaxPooling2D&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pool_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;strides&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;padding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="n"&gt;valid&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="c1"&gt;# 2nd Convolutional Layer
&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Conv2D&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;filters&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;256&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;kernel_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;strides&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;padding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="n"&gt;valid&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Activation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;relu&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="c1"&gt;# Max Pooling
&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MaxPooling2D&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pool_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;strides&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;padding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="n"&gt;valid&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="c1"&gt;# 3rd Convolutional Layer
&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Conv2D&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;filters&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;384&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;kernel_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;strides&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;padding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="n"&gt;valid&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Activation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;relu&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="c1"&gt;# 4th Convolutional Layer
&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Conv2D&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;filters&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;384&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;kernel_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;strides&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;padding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="n"&gt;valid&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Activation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;relu&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="c1"&gt;# 5th Convolutional Layer
&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Conv2D&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;filters&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;256&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;kernel_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;strides&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;padding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="n"&gt;valid&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Activation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;relu&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="c1"&gt;# Max Pooling
&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MaxPooling2D&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;pool_size&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;strides&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;padding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="n"&gt;valid&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="c1"&gt;# Passing it to a Fully Connected layer
&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Flatten&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="c1"&gt;# 1st Fully Connected Layer
&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Dense&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4096&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;input_shape&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;224&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="mi"&gt;224&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,)))&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Activation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;relu&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="c1"&gt;# Add Dropout to prevent overfitting
&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Dropout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.4&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="c1"&gt;# 2nd Fully Connected Layer
&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Dense&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4096&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Activation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;relu&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="c1"&gt;# Add Dropout
&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Dropout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.4&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="c1"&gt;# 3rd Fully Connected Layer
&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Dense&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Activation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;relu&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="c1"&gt;# Add Dropout
&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Dropout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;0.4&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="c1"&gt;# Output Layer
&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Dense&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;17&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Activation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;‘&lt;/span&gt;&lt;span class="n"&gt;softmax&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# Compile the model
&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;compile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;loss&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;keras&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;losses&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;categorical_crossentropy&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;optimizer&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="n"&gt;adam&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;metrics&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;accuracy&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Author of the implementation: @engmrk&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ai-pool.com/m/alexnet-1564424451"&gt;AlexNet&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Other Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/m/mobilenetv2-1555182846"&gt;MobileNetV2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/m/enet-1555434151"&gt;ENet&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/m/segnet-1555409707"&gt;SegNet&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/m/ccnet-1555951522"&gt;CCNet&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/m/fpn-1555775451"&gt;FPN&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aipool</category>
      <category>ai</category>
      <category>keras</category>
      <category>alexnet</category>
    </item>
    <item>
      <title>Recommendation Systems by Matrix Factorization and Collaborative Filtering</title>
      <dc:creator>AI Pool</dc:creator>
      <pubDate>Sat, 29 May 2021 15:39:06 +0000</pubDate>
      <link>https://dev.to/aipool3/recommendation-systems-by-matrix-factorization-and-collaborative-filtering-7cb</link>
      <guid>https://dev.to/aipool3/recommendation-systems-by-matrix-factorization-and-collaborative-filtering-7cb</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;We're all using any platform which has some items and these items are made for us, for users. In general, we use some of them and get suggestions for other items as well, but what suggestions are they, how do they even know what to suggest, which type of items each user likes and what is the probability, that they are going to like something platform suggests?&lt;/p&gt;

&lt;p&gt;Recommendation systems are created just for this. Let's take &lt;strong&gt;Netflix&lt;/strong&gt; as an example. It has a lot of movies and users watch them on their platform. When each user watches any movie, &lt;strong&gt;Netflix&lt;/strong&gt; suggests other movies relevant to the user or the item, which the user has watched.&lt;/p&gt;

&lt;p&gt;Nowadays almost all platforms like &lt;strong&gt;Facebook&lt;/strong&gt;, &lt;strong&gt;Youtube&lt;/strong&gt;, &lt;strong&gt;Twitter&lt;/strong&gt;, &lt;strong&gt;Pinterest&lt;/strong&gt;, &lt;strong&gt;Amazon&lt;/strong&gt;, etc. use recommendation systems, to suggest relevant content to their users. It gives good growth in terms of revenue or other business metrics, which is important to the company.&lt;/p&gt;

&lt;p&gt;Now let's formulate a recommendation system and show how it's going to suggest content relevant to users.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--osBxI_Gq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://files.ai-pool.com/a/eca7d9d969c4b56e58bdfeeda5e6a8c4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--osBxI_Gq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://files.ai-pool.com/a/eca7d9d969c4b56e58bdfeeda5e6a8c4.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Recommendation Systems, Problem Formulation
&lt;/h3&gt;

&lt;p&gt;Let's assume we have multiple users and movies. Each user has watched any movie and liked it. It means different movies can be liked by the same person and different users can like the same movie. It kind of like a matrix for users and items. This matrix will contain users and movies as rows and columns and each (i,j) position of the matrix will correspond to the rating of the movie or user has liked it or not. Something like this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--v5V9UbEm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://files.ai-pool.com/a/8ccc261ef0bb339e4f923b22ab06a42c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v5V9UbEm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://files.ai-pool.com/a/8ccc261ef0bb339e4f923b22ab06a42c.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is a sparse matrix. If the user has not watched the movie, then the corresponding place of this matrix will be undefined. Our goal is to find a model, which will fill all missing places in the matrix we showed above.&lt;/p&gt;

&lt;p&gt;Find more about collaborative filtering and matrix factorization in the &lt;a href="https://ai-pool.com/a/s/recommendation-systems-by-matrix-factorization-and-collaborative-filtering"&gt;Following Article&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Other Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/a/s/finding-an-optimal-number-of-clusters-with-elbow-method"&gt;Finding an Optimal Number of Clusters With Elbow Method&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/a/s/linear-and-logistic-regression"&gt;Linear and Logistic Regression&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/m/alexnet-1564424451"&gt;AlexNet&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aipool</category>
      <category>ai</category>
      <category>machinelearning</category>
      <category>python</category>
    </item>
    <item>
      <title>Bias-Variance Tradeoff in Machine Learning</title>
      <dc:creator>AI Pool</dc:creator>
      <pubDate>Sat, 29 May 2021 14:54:23 +0000</pubDate>
      <link>https://dev.to/aipool3/bias-variance-tradeoff-in-machine-learning-3c8f</link>
      <guid>https://dev.to/aipool3/bias-variance-tradeoff-in-machine-learning-3c8f</guid>
      <description>&lt;h3&gt;
  
  
  Hypothesis Space
&lt;/h3&gt;

&lt;p&gt;Before speaking about bias and variance, let's understand what hypothesis set is and how we are going to define it. First of all, when you train a model, you are seeking a hypothesis function over the entire space. It does not matter you train a linear regression, logistic regression or a deep network, you always have to understand what a hypothesis set is and how you're going to find a function you are looking for. &lt;/p&gt;

&lt;p&gt;If we create a model to approximate the given target function, it means we define a hypothesis set. Our trained model is a point from it, which can be far or close to the target function.&lt;/p&gt;

&lt;p&gt;Now let's define our hypothesis set. Let's assume we have chosen a model, which defines hypothesis set &lt;strong&gt;H&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bias-Variance Tradeoff
&lt;/h3&gt;

&lt;p&gt;There is an optimal point, where bias and variance are in a good position and their values are reasonable. To find that optimal point, we need to draw the curves for every value, which depends on the complexity of the model. By saying the complexity of the model, we mean the complexity of the hypothesis set, the size of it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VJn9ai8Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://files.ai-pool.com/a/c457c503205d0740d3efc553bdb74b0b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VJn9ai8Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://files.ai-pool.com/a/c457c503205d0740d3efc553bdb74b0b.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our goal is to minimize the total loss, which consists of bias, variance, and small noise. These curves show that increasing the complexity of the model, will decrease the bias, but the variance will increase and as a result, the total loss will be high.&lt;br&gt;
We can't take a too simple model, which can't even approximate the target function and can't take too big one either, because it has high variance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1oENvg9U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://files.ai-pool.com/a/492989098d60c7a2e6a592efb70804f7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1oENvg9U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://files.ai-pool.com/a/492989098d60c7a2e6a592efb70804f7.jpg" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is a known problem in the machine learning sphere, specifically in deep learning. Every specialist knows about Underfitting or High Bias and Overfitting or High Variance. These are the main problems everybody faces and there are a lot of approaches to fix them. People tried to solve this in the following ways.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Regularization&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Model Selection / Early Stopping&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cross-Validation&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Normalization Functions&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Augmentation Techniques&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Others&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can find more in the &lt;a href="https://ai-pool.com/a/s/bias-variance-tradeoff-in-machine-learning"&gt;Following Article&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Other Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/a/s/confidence-interval-understanding"&gt;Confidence Interval Understanding&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/a/s/introduction-of-fast-fourier-transformation--fft"&gt;Introduction of Fast Fourier Transformation (FFT)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/d/why_network_overfits_too_early_"&gt;Why network overfits too early?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/d/give_some_suggestions_to_avoid_overfitting"&gt;Give some suggestions to avoid overfitting&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aipool</category>
      <category>ai</category>
      <category>machinelearning</category>
      <category>math</category>
    </item>
    <item>
      <title>Diving into Object Detection Basics</title>
      <dc:creator>AI Pool</dc:creator>
      <pubDate>Sat, 29 May 2021 13:57:47 +0000</pubDate>
      <link>https://dev.to/aipool3/diving-into-object-detection-basics-1ak</link>
      <guid>https://dev.to/aipool3/diving-into-object-detection-basics-1ak</guid>
      <description>&lt;h3&gt;
  
  
  Intro
&lt;/h3&gt;

&lt;p&gt;The prospects of Artificial Intelligence (AI) are not just limited to predicting if a person will get a loan or not by giving his credit history, annual income, annual expenses, criminal records, etc. Computer Vision is a trending topic for AI enthusiasts of any experience level.&lt;/p&gt;

&lt;p&gt;Let me give you a brief idea about Computer Vision. It is nothing but when a machine identifies an 'object' in an image/video after learning from the data that was fed to it. For example, when we see an object first time, we are mostly aware of it like what it is called. But after getting to know its name, the next time we see it we know exactly what it is. Exactly like our brain, Computer Vision, to be specific Object Detection works.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ua_qiuxX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://files.ai-pool.com/a/bcdb850b5e8c7f7082ca5f4857aa6a55.undefined" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ua_qiuxX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://files.ai-pool.com/a/bcdb850b5e8c7f7082ca5f4857aa6a55.undefined" alt="intro"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Introduction of Object Detection
&lt;/h3&gt;

&lt;p&gt;Object detection is locating and identifying an object in an image or in a video. Locating an object is nothing but giving the exact position where the object resides in the frame. (Here frame can be a single image or a sequence of frames that is a video). To locate an object, we can either use a bounding box or any other geometrical shape like a circle. The easiest and standard approach is by using the bounding box, where we first obtain the center coordinates (x, y) and the width (w) and height (h) of the box.&lt;/p&gt;

&lt;p&gt;To identify an object, the network must be trained on data, for example, images of the person. This step is called the classification of objects and it is very essential for the bounding box to be formed correctly. To ensure the correct training of the network, ensure the data is correct.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FZ9XWXPh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://files.ai-pool.com/a/c933f0514293b8447bb725da690d7eb1.undefined" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FZ9XWXPh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://files.ai-pool.com/a/c933f0514293b8447bb725da690d7eb1.undefined" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Anchor Boxes
&lt;/h3&gt;

&lt;p&gt;How does the network predict or identify the box?&lt;/p&gt;

&lt;p&gt;The network first makes a random guess of the coordinates and assigns them a value w for width and h for height. It assigns (0, 0) for the center of the box (x, y). Of course, this is not the actual prediction. So after every step of training, which is termed as an iteration, the network performs regression to get the correct estimates.&lt;/p&gt;

&lt;h3&gt;
  
  
  Datasets to start with
&lt;/h3&gt;

&lt;p&gt;There are many datasets to start training your first object detection model. These datasets are open source meaning anyone is free to use them. These datasets have a large collection of classes of objects to choose from. So have fun while exploring these datasets&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;COCO Dataset&lt;/li&gt;
&lt;li&gt;ImageNet&lt;/li&gt;
&lt;li&gt;Open Image Dataset V6&lt;/li&gt;
&lt;li&gt;Labelme&lt;/li&gt;
&lt;li&gt;CelebFaces&lt;/li&gt;
&lt;li&gt;50 other datasets&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can find more in the &lt;a href="https://ai-pool.com/a/s/diving-into-object-detection-basics"&gt;Following Article&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Other Resources
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/a/s/dropout-in-deep-learning"&gt;Dropout in Deep Learning&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/a/s/normalization-in-deep-learning"&gt;Normalization in Deep learning&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/a/s/yolov3-and-yolov4-in-object-detection"&gt;Yolov3 and Yolov4 in Object Detection&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/d/how-can-i-find-the-paper-of-yolov5"&gt;How can I find the paper of yolov5?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aipool</category>
      <category>ai</category>
      <category>objectdetection</category>
      <category>computervision</category>
    </item>
    <item>
      <title>Introduction of Fast Fourier Transformation (FFT)</title>
      <dc:creator>AI Pool</dc:creator>
      <pubDate>Sat, 29 May 2021 13:45:45 +0000</pubDate>
      <link>https://dev.to/aipool3/introduction-of-fast-fourier-transformation-fft-555k</link>
      <guid>https://dev.to/aipool3/introduction-of-fast-fourier-transformation-fft-555k</guid>
      <description>&lt;h4&gt;
  
  
  Introduction
&lt;/h4&gt;

&lt;p&gt;Suppose you have an audio file, or even a video file, or let's say you have an image file. But the only problem is it has lots of noise. You can't distinguish between the required audio, frames, or the object in the three files respectively. So how are you supposed to distinguish between the &lt;strong&gt;noise&lt;/strong&gt; and the actual &lt;strong&gt;signal&lt;/strong&gt;?&lt;/p&gt;

&lt;p&gt;The odds are quite high that the file may contain a term called noise. Though the terms are of the communication domain, they are also involved in the AI domain.&lt;/p&gt;

&lt;h4&gt;
  
  
  Noise
&lt;/h4&gt;

&lt;p&gt;Noise is a random signal which consists of equal intensities or powers at every frequency. In computing, it is statistically defined as a sequence of random variables. So basically, in very simple terms, it is a random thing that may be a part of your signal.&lt;/p&gt;

&lt;h4&gt;
  
  
  Fourier Transformation (FT)
&lt;/h4&gt;

&lt;p&gt;Fourier Transformation which is the main highlight of this article is a very useful tool for analyzing signals, especially noisy signals. It transforms or converts complex mathematical equations into simpler trigonometric functions in terms of sin or cos. Sin or Cos are used because the signal is easier to analyze in their format. In other terms, Fourier transformation is used to convert time signals into frequency signals and power signals. You are using the applications of Fourier Transformation unknowingly every day.&lt;/p&gt;

&lt;h4&gt;
  
  
  Implementation of FFT
&lt;/h4&gt;

&lt;p&gt;Note: The codes are written and tested by the author. The outputs are the screenshots of Jupyter Notebook cells.&lt;/p&gt;

&lt;p&gt;For this implementation, we will be using scipy library as a Fourier transformation calculator.&lt;/p&gt;

&lt;h5&gt;
  
  
  1. Let's import the libraries for python fft
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;numpy&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;matplotlib.pyplot&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;plt&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;scipy.fftpack&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;fft&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fftfreq&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: If you have the latest package of scipy, use scipy.fft instead of scipy.fftpack&lt;/p&gt;

&lt;h5&gt;
  
  
  2. Defining a random signal
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt; &lt;span class="c1"&gt;# Number of data points
&lt;/span&gt;&lt;span class="n"&gt;dx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;5.0&lt;/span&gt; &lt;span class="c1"&gt;# Sampling period (in meters)
&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dx&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;arange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# x coordinates
&lt;/span&gt;&lt;span class="n"&gt;w1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;100.0&lt;/span&gt; &lt;span class="c1"&gt;# wavelength (meters)
&lt;/span&gt;&lt;span class="n"&gt;w2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;50.0&lt;/span&gt; &lt;span class="c1"&gt;# wavelength (meters)
&lt;/span&gt;
&lt;span class="n"&gt;fx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pi&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;w1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Signal as a function of time"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;fx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  3. Getting the Discrete Fourier Transform (DFT) using FFT
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;Fk&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fft&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="c1"&gt;# Fourier coefficients (divided by n)
&lt;/span&gt;
&lt;span class="c1"&gt;# To plot in the frequency domain
&lt;/span&gt;&lt;span class="n"&gt;Fk&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="n"&gt;fftshift&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Fk&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# Shift zero frequency to center
&lt;/span&gt;&lt;span class="n"&gt;nu&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fftfreq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;dx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# Natural frequencies
&lt;/span&gt;&lt;span class="n"&gt;nu&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fftshift&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nu&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# Shift zero frequency to center
&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'DFT of the signal'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nu&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Fk&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Get the absolute values of DFT
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see in the above image, the DFT of our signal is a simple graph in which we have a single pair of frequencies as I had mentioned earlier that DFTs are symmetrical. As the signal is a simple continuous signal and contains only one frequency component, it was expected to get a single pair of frequencies.&lt;/p&gt;

&lt;h5&gt;
  
  
  4. Adding a random noise
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;new_fx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pi&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;w1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pi&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;w2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
&lt;span class="c1"&gt;# new = old + random signal/noise
&lt;/span&gt;&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'Modified Signal'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;new_fx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  5. Getting the DFT for the modified signal
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;new_Fk&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fft&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new_fx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;  &lt;span class="c1"&gt;# Fourier coefficients (divided by n)
&lt;/span&gt;&lt;span class="n"&gt;new_Fk&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fftshift&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new_Fk&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Shift zero frequency to center
&lt;/span&gt;&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'DFT of Modified Signal'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;plt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nu&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new_Fk&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# Get the absolute values of DFT
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can find more details with plotted images in &lt;a href="https://ai-pool.com/a/s/introduction-of-fast-fourier-transformation--fft"&gt;this article&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Other Resources
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/a/s/visualization-with-seaborn"&gt;Visualization with Seaborn&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/a/s/understanding-of-probability-distribution-and-normal-distribution"&gt;Understanding of Probability Distribution and Normal Distribution&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ai-pool.com/a/s/understanding-of-regularization-in-neural-networks"&gt;Understanding of Regularization in Neural Networks&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aipool</category>
      <category>fft</category>
      <category>ai</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
