<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[mahmood razzi]]></title><description><![CDATA[mahmood razzi]]></description><link>https://mahmoodrazzimy.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sun, 20 Sep 2026 00:54:12 GMT</lastBuildDate><atom:link href="https://mahmoodrazzimy.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[What is MatMul? How to calculate it?]]></title><description><![CDATA[MatMul is short for matrix multiplication, which is a mathematical operation that takes two matrices and produces another matrix.
To calculate MatMul, we need to ensure that the number of columns in the first matrix is equal to the number of rows in ...]]></description><link>https://mahmoodrazzimy.hashnode.dev/what-is-matmul-how-to-calculate-it</link><guid isPermaLink="true">https://mahmoodrazzimy.hashnode.dev/what-is-matmul-how-to-calculate-it</guid><category><![CDATA[neural networks]]></category><category><![CDATA[Python]]></category><category><![CDATA[spreadsheets]]></category><category><![CDATA[matmul]]></category><dc:creator><![CDATA[mahmood razzi]]></dc:creator><pubDate>Wed, 23 Aug 2023 12:16:33 GMT</pubDate><content:encoded><![CDATA[<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1692786724787/36c9829c-9923-49f1-bd5c-ba24c42f0984.png" alt class="image--center mx-auto" /></p>
<p>MatMul is short for matrix multiplication, which is a mathematical operation that takes two matrices and produces another matrix.</p>
<p>To calculate MatMul, we need to ensure that the number of columns in the first matrix is equal to the number of rows in the second matrix.</p>
<p>Then, we multiply each element of the row in the first matrix by the corresponding element of the column in the second matrix and sum the products.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1692787106880/6a1f05eb-85ad-4c78-8aa0-933e6fab29d0.png" alt class="image--center mx-auto" /></p>
<p>Refer: <a target="_blank" href="https://docs.google.com/spreadsheets/d/1uKK0N86XPEynoN1MpT_0Mm3IId38xzJz3Yptw2FujCo/edit?usp=sharing">https://docs.google.com/spreadsheets/d/1uKK0N86XPEynoN1MpT_0Mm3IId38xzJz3Yptw2FujCo/edit?usp=sharing</a></p>
<p>In Python, matmul is a function provided by the NumPy library for performing matrix multiplication. Here's an example of how to use matmul in Python:</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np

<span class="hljs-comment"># Define input and weight matrices</span>
input_matrix = np.array([[<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>], [<span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>]])
<span class="hljs-keyword">print</span> (<span class="hljs-string">'input matrix:'</span>)
<span class="hljs-keyword">print</span> (input_matrix)
<span class="hljs-keyword">print</span> ()


weight_matrix = np.array([[<span class="hljs-number">0.1</span>, <span class="hljs-number">0.2</span>], [<span class="hljs-number">0.3</span>, <span class="hljs-number">0.4</span>], [<span class="hljs-number">0.5</span>, <span class="hljs-number">0.6</span>]])
<span class="hljs-keyword">print</span> (<span class="hljs-string">'weight matrix:'</span>)
<span class="hljs-keyword">print</span> (weight_matrix)
<span class="hljs-keyword">print</span> ()

<span class="hljs-comment"># Perform matrix multiplication using matmul</span>
output_matrix = np.matmul(input_matrix, weight_matrix)

<span class="hljs-comment"># Print the output matrix</span>
<span class="hljs-keyword">print</span> (<span class="hljs-string">'output matrix:'</span>)
print(output_matrix)
</code></pre>
<p>Console output:</p>
<pre><code class="lang-python">input matrix:
[[<span class="hljs-number">1</span> <span class="hljs-number">2</span> <span class="hljs-number">3</span>]
 [<span class="hljs-number">4</span> <span class="hljs-number">5</span> <span class="hljs-number">6</span>]]

weight matrix:
[[<span class="hljs-number">0.1</span> <span class="hljs-number">0.2</span>]
 [<span class="hljs-number">0.3</span> <span class="hljs-number">0.4</span>]
 [<span class="hljs-number">0.5</span> <span class="hljs-number">0.6</span>]]

output matrix:
[[<span class="hljs-number">2.2</span> <span class="hljs-number">2.8</span>]
 [<span class="hljs-number">4.9</span> <span class="hljs-number">6.4</span>]]
</code></pre>
<p>Refer: <a target="_blank" href="https://replit.com/@mahmoodrazzi/using-matmul-for-neural-network">https://replit.com/@mahmoodrazzi/using-matmul-for-neural-network</a></p>
<p>Matmul is a fundamental operation in neural networks that is used to calculate the weighted sum of inputs and weights.</p>
<p>The weighted sum in a neural network allows the network to <strong>learn and represent complex relationships between inputs and outputs</strong>.</p>
<p>By applying a set of weights to the inputs, the neural network can <strong>assign different levels of importance to each input feature</strong>, based on how relevant it is to the task at hand.</p>
<p>This allows the network to focus on the most important features and ignore irrelevant or noisy features.</p>
<p>The weighted sum also allows the network to <strong>learn non-linear relationships between inputs and outputs</strong>.</p>
<p>By applying different weights to different inputs, the network can <strong>capture complex interactions between features</strong> that would be difficult to model with a simple linear function.</p>
<p>For example, the above output matrix can be represented by a heat map graph as shown below. To generate a heatmap of the output matrix, use the imshow function in Matplotlib. Specify the color map to use (e.g. 'viridis' in this case), and add a color bar to indicate the scale of the values. Different colors indicate different levels of activation for each neuron in the layer.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1692794639041/8a0765da-7ac6-4dab-89da-613a4a2e8a39.png" alt class="image--center mx-auto" /></p>
<p>Refer:</p>
<p><a target="_blank" href="https://replit.com/@mahmoodrazzi/using-matmul-for-neural-network?v=1">https://replit.com/@mahmoodrazzi/using-matmul-for-neural-network?v=1</a></p>
<p>Neural Networks Matrix Math and NumPy (<a target="_blank" href="https://www.youtube.com/watch?v=P8Xrj70qtyo">https://www.youtube.com/watch?v=P8Xrj70qtyo</a>)</p>
<p>Neural Networks Explained from Scratch using Python (<a target="_blank" href="https://www.youtube.com/watch?v=9RN2Wr8xvro">https://www.youtube.com/watch?v=9RN2Wr8xvro</a>)</p>
<p>Why Neural Networks can learn (almost) anything (<a target="_blank" href="https://www.youtube.com/watch?v=0QczhVg5HaI">https://www.youtube.com/watch?v=0QczhVg5HaI</a>)</p>
]]></content:encoded></item><item><title><![CDATA[Machine Learning - Clustering]]></title><description><![CDATA[Clustering animation
https://codepen.io/sinobra/pen/eYdaaza
 
Clustering animation
https://codepen.io/maxwell_alexius/pen/vWeeLQ
 
Clustering - click to step through
https://codepen.io/jeffwilldesign/pen/rXyEZe
 
Clustering - click to start
https://c...]]></description><link>https://mahmoodrazzimy.hashnode.dev/machine-learning-clustering</link><guid isPermaLink="true">https://mahmoodrazzimy.hashnode.dev/machine-learning-clustering</guid><category><![CDATA[Machine Learning]]></category><category><![CDATA[clustering]]></category><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[mahmood razzi]]></dc:creator><pubDate>Sun, 20 Aug 2023 12:37:28 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/ToI01Apo4Pk/upload/46e4ee396b3dadb87dfe86d80b8f2b96.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Clustering animation</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/sinobra/pen/eYdaaza">https://codepen.io/sinobra/pen/eYdaaza</a></div>
<p> </p>
<p>Clustering animation</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/maxwell_alexius/pen/vWeeLQ">https://codepen.io/maxwell_alexius/pen/vWeeLQ</a></div>
<p> </p>
<p>Clustering - click to step through</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/jeffwilldesign/pen/rXyEZe">https://codepen.io/jeffwilldesign/pen/rXyEZe</a></div>
<p> </p>
<p>Clustering - click to start</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/aliath/pen/eYRqybE">https://codepen.io/aliath/pen/eYRqybE</a></div>
<p> </p>
<p>Clustering - click to start</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/victorfouquet/pen/ZErLeMj">https://codepen.io/victorfouquet/pen/ZErLeMj</a></div>
]]></content:encoded></item><item><title><![CDATA[Machine Learning - Regression]]></title><description><![CDATA[Regression - Animation
https://codepen.io/maxwell_alexius/pen/EwEVXj
 
Regression - enter input values
https://codepen.io/mahmood-razzi/pen/OJrJKGX
 
Regression
https://codepen.io/TinoF/pen/oNXPLEy
 
Regression - Line Graph
https://codepen.io/melaton...]]></description><link>https://mahmoodrazzimy.hashnode.dev/machine-learning-regression</link><guid isPermaLink="true">https://mahmoodrazzimy.hashnode.dev/machine-learning-regression</guid><category><![CDATA[Machine Learning]]></category><category><![CDATA[#Regression]]></category><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[mahmood razzi]]></dc:creator><pubDate>Sun, 20 Aug 2023 09:14:12 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/45FJgZMXCK8/upload/6cdbca06e5f5530a0d054bf9765d1ebf.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Regression - Animation</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/maxwell_alexius/pen/EwEVXj">https://codepen.io/maxwell_alexius/pen/EwEVXj</a></div>
<p> </p>
<p>Regression - enter input values</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/mahmood-razzi/pen/OJrJKGX">https://codepen.io/mahmood-razzi/pen/OJrJKGX</a></div>
<p> </p>
<p>Regression</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/TinoF/pen/oNXPLEy">https://codepen.io/TinoF/pen/oNXPLEy</a></div>
<p> </p>
<p>Regression - Line Graph</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/melatonind/pen/oNwexK">https://codepen.io/melatonind/pen/oNwexK</a></div>
]]></content:encoded></item><item><title><![CDATA[Machine Learning - Classification]]></title><description><![CDATA[This example showcases how you can use a pre-trained model called MobileNet -- a machine learning model trained to recognize the content of certain images -- in ml5.js. The example aims to highlight a general pattern for how ml5.js projects are setup...]]></description><link>https://mahmoodrazzimy.hashnode.dev/machine-learning-classification</link><guid isPermaLink="true">https://mahmoodrazzimy.hashnode.dev/machine-learning-classification</guid><category><![CDATA[image classification]]></category><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[mahmood razzi]]></dc:creator><pubDate>Sun, 20 Aug 2023 08:44:08 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/VVe3zOZM88E/upload/4431b7dff000f5ea63a95864d4a02d02.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This example showcases how you can use a <a target="_blank" href="https://youtu.be/yNkAuWz5lnY?t=33"><strong>pre-trained model</strong></a> called <a target="_blank" href="https://github.com/tensorflow/tfjs-models/tree/master/mobilenet"><strong>MobileNet</strong></a> -- a machine learning model trained to recognize the content of certain images -- in ml5.js. The example aims to highlight a general pattern for how ml5.js projects are setup.</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/mahmood-razzi/pen/oNJNKVR">https://codepen.io/mahmood-razzi/pen/oNJNKVR</a></div>
<p> </p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codesandbox.io/s/quizzical-dubinsky-3sy6dr">https://codesandbox.io/s/quizzical-dubinsky-3sy6dr</a></div>
]]></content:encoded></item><item><title><![CDATA[Machine Learning - Using Scatterplots]]></title><description><![CDATA[One of the ways of assessing linear relationships is through the use of scatterplots.
A scatterplot is a type of plot or mathematical diagram using Cartesian coordinates to display values for typically two variables for a set of data (Wikipedia).
htt...]]></description><link>https://mahmoodrazzimy.hashnode.dev/machine-learning-using-scatterplots</link><guid isPermaLink="true">https://mahmoodrazzimy.hashnode.dev/machine-learning-using-scatterplots</guid><category><![CDATA[Machine Learning]]></category><dc:creator><![CDATA[mahmood razzi]]></dc:creator><pubDate>Sun, 20 Aug 2023 06:26:30 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/9F5IWESAxL4/upload/6e6ca4f0601b5e616c577516b0b5f045.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>One of the ways of assessing linear relationships is through the use of scatterplots.</p>
<p>A scatterplot is a type of plot or mathematical diagram using Cartesian coordinates to display values for typically two variables for a set of data (<a target="_blank" href="https://en.wikipedia.org/wiki/Scatter_plot">Wikipedia</a>).</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/mahmood-razzi/pen/MWZWNgb">https://codepen.io/mahmood-razzi/pen/MWZWNgb</a></div>
<p> </p>
<p>Scatter plots are similar to line graphs in that they start with mapping quantitative data points.</p>
<p>However, with a scatter plot, the decision is made that the individual points should not be connected directly together with a line but, instead express a trend (<a target="_blank" href="https://labwrite.ncsu.edu/res/gh/gh-linegraph.html#:~:text=Scatter%20plots%20are%20similar%20to,but%2C%20instead%20express%20a%20trend.">LabWrite</a>).</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/mahmood-razzi/pen/BavagXX">https://codepen.io/mahmood-razzi/pen/BavagXX</a></div>
<p> </p>
<h2 id="heading-reference">Reference:</h2>
<p><a target="_blank" href="https://www.w3schools.com/ai/ai_scatter_plots.asp">https://www.w3schools.com/ai/ai_scatter_plots.asp</a></p>
]]></content:encoded></item><item><title><![CDATA[Machine Learning - Using Linear Graphs]]></title><description><![CDATA[Machine Learning often uses line graphs to show relationships.
A line graph displays the values of a linear function i.e. y = ax + b which describes a line by the following properties:

Linear (Straight)

Slope (Angle)

Intercept (Start value)


Line...]]></description><link>https://mahmoodrazzimy.hashnode.dev/machine-learning-using-linear-graphs</link><guid isPermaLink="true">https://mahmoodrazzimy.hashnode.dev/machine-learning-using-linear-graphs</guid><category><![CDATA[Machine Learning]]></category><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[mahmood razzi]]></dc:creator><pubDate>Sun, 20 Aug 2023 04:52:21 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/AT77Q0Njnt0/upload/61796a54d0b43519a7c3a58e18b0ea1a.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Machine Learning often uses line graphs to show relationships.</p>
<p>A line graph displays the values of a linear function i.e. y = ax + b which describes a line by the following properties:</p>
<ul>
<li><p><strong>Linear</strong> (Straight)</p>
</li>
<li><p><strong>Slope</strong> (Angle)</p>
</li>
<li><p><strong>Intercept</strong> (Start value)</p>
</li>
</ul>
<h2 id="heading-linear-property">Linear property</h2>
<p><strong>Linear</strong> means straight. A linear graph is a straight line.</p>
<p>The graph consists of two axes: x-axis (horizontal) and y-axis (vertical).</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/mahmood-razzi/pen/poqoXdo">https://codepen.io/mahmood-razzi/pen/poqoXdo</a></div>
<p> </p>
<h2 id="heading-slope-property">Slope property</h2>
<p>The <strong>slope</strong> is the angle of the graph.</p>
<p>The slope is the <strong>a</strong> value in a linear graph:</p>
<p>y = <strong>a</strong>x</p>
<p>In this example, <strong>slope</strong> = <strong>1.2</strong>:</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/mahmood-razzi/pen/NWeWZwm">https://codepen.io/mahmood-razzi/pen/NWeWZwm</a></div>
<p> </p>
<h2 id="heading-intercept-property">Intercept property</h2>
<p>The <strong>Intercept</strong> is the start value of the graph.</p>
<p>The intercept is the <strong>b</strong> value in a linear graph:</p>
<p>y = ax + <strong>b</strong></p>
<p>In this example, slope = 1.2 and <strong>intercept</strong> = <strong>2</strong>:</p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://codepen.io/mahmood-razzi/pen/NWeWZXV">https://codepen.io/mahmood-razzi/pen/NWeWZXV</a></div>
<p> </p>
<h2 id="heading-reference">Reference:</h2>
<p><a target="_blank" href="https://www.w3schools.com/ai/ai_linear_graphs.asp">https://www.w3schools.com/ai/ai_linear_graphs.asp</a></p>
]]></content:encoded></item><item><title><![CDATA[Machine Learning - What Is It?]]></title><description><![CDATA[Machine Learning is a subfield of Artificial intelligence.
Artificial intelligence refers to the simulation of human intelligence in machines that are programmed to think like humans and mimic their actions (Investopedia).
Machine learning aims to le...]]></description><link>https://mahmoodrazzimy.hashnode.dev/machine-learning-what-is-it</link><guid isPermaLink="true">https://mahmoodrazzimy.hashnode.dev/machine-learning-what-is-it</guid><category><![CDATA[Machine Learning]]></category><dc:creator><![CDATA[mahmood razzi]]></dc:creator><pubDate>Sun, 20 Aug 2023 04:02:38 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/MEldcHumbu8/upload/3c63d79c135a828b3767231c02653a0e.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Machine Learning is a subfield of Artificial intelligence.</p>
<p>Artificial intelligence refers to the simulation of human intelligence in machines that are programmed to think like humans and mimic their actions (<a target="_blank" href="https://www.investopedia.com/terms/a/artificial-intelligence-ai.asp">Investopedia</a>).</p>
<p>Machine learning aims to learn and improve from experience without being explicitly programmed (<a target="_blank" href="https://www.mygreatlearning.com/blog/what-is-machine-learning/">MyGreatLearning</a>).</p>
<p>Machine Learning consists of (1) Traditional Machine Learning (regression and classification), (2) Neural Networks and (3) Deep Neural Networks (aka Deep Learning).</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1692503952833/593e6f3a-7c8a-4988-9ce3-813f5d2db36f.png" alt class="image--center mx-auto" /></p>
<p><em>Traditional programming</em> <strong><em>uses known algorithms</em></strong> <em>to produce results from data. Machine learning</em> <strong><em>creates new algorithms</em></strong> <em>from data and results.</em></p>
<h2 id="heading-neural-networks-nn">Neural Networks (NN)</h2>
<p><strong>Neural Networks</strong> are based on how the human brain works:<br />Neurons are sending messages to each other. While the neurons are trying to solve a problem (over and over again), it is strengthening the connections that lead to success and diminishing the connections that lead to failure.</p>
<p><img src="https://www.w3schools.com/ai/img_nn_single_600.jpg" alt="Neural Networks" /></p>
<h2 id="heading-deep-neural-networks-dnn">Deep Neural Networks (DNN)</h2>
<p><strong>Deep Neural Networks</strong> are made up of several hidden layers of neural networks that perform complex operations on massive amounts of data.</p>
<p>Each successive layer uses the preceding layer as input.</p>
<p>For instance, optical reading uses low layers to identify edges, and higher layers to identify letters.</p>
<p><img src="https://www.w3schools.com/ai/img_neural_networks.jpg" alt="Neural Networks" /></p>
<p>Further reading:</p>
<p><a target="_blank" href="https://www.w3schools.com/ai/default.asp">https://www.w3schools.com/ai/default.asp</a></p>
]]></content:encoded></item></channel></rss>