<?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>Forem: dinhanhx</title>
    <description>The latest articles on Forem by dinhanhx (@dinhanhx).</description>
    <link>https://forem.com/dinhanhx</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%2F350004%2F94853ac2-5193-43ed-bd9b-a0505d0ea4f7.jpg</url>
      <title>Forem: dinhanhx</title>
      <link>https://forem.com/dinhanhx</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/dinhanhx"/>
    <language>en</language>
    <item>
      <title>Understand n dimension array with real life examples</title>
      <dc:creator>dinhanhx</dc:creator>
      <pubDate>Sun, 27 Feb 2022 12:51:38 +0000</pubDate>
      <link>https://forem.com/dinhanhx/understand-n-dimension-array-with-real-life-examples-1ggp</link>
      <guid>https://forem.com/dinhanhx/understand-n-dimension-array-with-real-life-examples-1ggp</guid>
      <description>&lt;h1&gt;
  
  
  Scenario
&lt;/h1&gt;

&lt;p&gt;You are/were struggling with one of these terms: nested array, high dimension, n dimension array, ... Probably you have tried to visualize an n dimension array and got stuck at 3 dimension or even 2.&lt;/p&gt;

&lt;h1&gt;
  
  
  The simple way to &lt;strong&gt;understand&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;You don't need to visualize it. You just need to know that an n dimension array is a group of groups ... (many "of groups"). &lt;/p&gt;

&lt;p&gt;Let start with 1D array. 1D array is a group of values &lt;code&gt;[1, 2, 3]&lt;/code&gt;. 2D array is a group of 1D groups &lt;code&gt;[[1, 2, 3], [1, 2, 3]]&lt;/code&gt;. 3D array is a group of 2D groups &lt;code&gt;[[[1, 2, 3], [1, 2, 3]], [[1, 2, 3], [1, 2, 3]]]&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;An n dimension array is also just a 1D array whose values are organized into groups. This is 1D array &lt;code&gt;[1, 2, 3, 4, 5, 6]&lt;/code&gt;. Now we will group 123, and 456. By doing that, it becomes 2D array &lt;code&gt;[[1, 2, 3], [4, 5, 6]]&lt;/code&gt;. Now we put each value into a group. As a result, 3D array is made &lt;code&gt;[[[1], [2], [3]], [[4], [5], [6]]]&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Every array has a very important attribute called &lt;code&gt;shape&lt;/code&gt;. A shape is a set of the number of groups/values in each dimension (ordered from the highest dimension to the lowest one). Let visit the previous example. 1D array has 6 values or shape &lt;code&gt;(6)&lt;/code&gt;. 2D array has 2 groups, each group has 3 values. In other word, its shape is (2, 3). That 3D array has shape &lt;code&gt;(2, 3, 1)&lt;/code&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Real life example 1: A book
&lt;/h1&gt;

&lt;p&gt;A book is a 5D array of letters whose shape is &lt;code&gt;(c, p, s, w, l)&lt;/code&gt;. A book has C chapters. Each chapter has P paragraphs. Each paragraph has S sentences. Each sentence has W words. Each word has L letters.&lt;/p&gt;

&lt;h1&gt;
  
  
  Real life example 2: A library
&lt;/h1&gt;

&lt;p&gt;A library is a 7D array of letters. A library has G genres. Each genre has B books. And so on.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>How to X paper</title>
      <dc:creator>dinhanhx</dc:creator>
      <pubDate>Wed, 26 Jan 2022 11:05:07 +0000</pubDate>
      <link>https://forem.com/dinhanhx/how-to-x-paper-16h</link>
      <guid>https://forem.com/dinhanhx/how-to-x-paper-16h</guid>
      <description>&lt;ul&gt;
&lt;li&gt;&lt;a href="https://web.stanford.edu/class/ee384m/Handouts/HowtoReadPaper.pdf"&gt;How to read a paper&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.cs.ucr.edu/~eamonn/public/SDM_How_to_do_Research_Keogh.pdf"&gt;How to do good research, get it published&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.louisbouchard.ai/research-papers/"&gt;How to read more papers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>machinelearning</category>
      <category>ai</category>
      <category>research</category>
    </item>
    <item>
      <title>Dear machine learning newbies, please don't skip steps</title>
      <dc:creator>dinhanhx</dc:creator>
      <pubDate>Mon, 24 Jan 2022 11:15:44 +0000</pubDate>
      <link>https://forem.com/dinhanhx/dear-machine-learning-newbies-please-dont-skip-steps-51hi</link>
      <guid>https://forem.com/dinhanhx/dear-machine-learning-newbies-please-dont-skip-steps-51hi</guid>
      <description>&lt;p&gt;I know machine learning is a hot topic. You probably are motivated by news, social media saying how smart an AI system is. Your parents might have advised you to follow this field. Your smarty pant friend writes a very smart program to analyse weather. Maybe you, come from other majors than computer science, are influenced by your own professors.&lt;/p&gt;

&lt;p&gt;Then you decide to google "how to study machine learning" or "good university for AI major" or "how to make an assistant like Jarvis" despite the fact that you don't even know how to write a simple program. You probably don't understand the following abbreviations: CLI, OS, OOP. Magically, you copy code just like a monkey. It works, but you don't understand WHY. &lt;/p&gt;

&lt;p&gt;Basically, this is you -&amp;gt; &lt;a href="https://youtu.be/MNb9Q8vAzjw?t=49"&gt;https://youtu.be/MNb9Q8vAzjw?t=49&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Congratulations, you have taken shortcuts. Everyone is happy and clapping. And that's my sarcasm.&lt;/p&gt;

&lt;p&gt;If you are a self-study machine learning newbie, please read the requirements of the course, learn the requirements, then learn the course.&lt;/p&gt;

&lt;p&gt;For example, you take &lt;a href="https://www.tutorialspoint.com/machine_learning/index.htm"&gt;Machine Learning by Tutorialspoint&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PEHfXBbg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8nwu9jldqpc6a6gpr1re.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PEHfXBbg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8nwu9jldqpc6a6gpr1re.png" alt="Image description" width="735" height="170"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;See that prerequisites, learn all that first. &lt;/p&gt;

&lt;p&gt;If English is not your first language, learn English vocabulary for Computer Science. Most of the documents about Machine Learning are in English. Don't trust me? Just ask your any fellow people who have been working or learning things related to computer. &lt;/p&gt;

&lt;p&gt;If you are following this major by going to university, focus on class, close this blog, start doing your assignments. &lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>beginners</category>
      <category>python</category>
      <category>ai</category>
    </item>
    <item>
      <title>How stupid is Matlab?</title>
      <dc:creator>dinhanhx</dc:creator>
      <pubDate>Fri, 14 Jan 2022 03:49:41 +0000</pubDate>
      <link>https://forem.com/dinhanhx/how-stupid-is-matlab-5ehl</link>
      <guid>https://forem.com/dinhanhx/how-stupid-is-matlab-5ehl</guid>
      <description>&lt;h2&gt;
  
  
  Matlab Introduction from MathWork
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HlrxlVJJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bacfeb5aonlphy5gr9c6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HlrxlVJJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bacfeb5aonlphy5gr9c6.png" alt="Matlab intro" width="568" height="165"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's for Math, &lt;strong&gt;but&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Array indexing starts from 1. Ask your professors from Electrical Engineering which number signal indexing starts at? They will probably open textbook to show or to say it's 0. Or ask your Applied Math professors where is the axis's origin at? &lt;/li&gt;
&lt;li&gt;Functions are defined after being called in script. I'm pretty sure that we define/state a formula first, then we use it when doing math on paper.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's for Graph, yeah.&lt;/p&gt;

&lt;p&gt;It's for Programming, &lt;strong&gt;but&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/dinhanhx/how-stupid-is-matlab-oop-5dp6"&gt;OOP is unnecessarily complicated&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/dinhanhx/how-stupid-is-matlab-for-loop-6kc"&gt;For loop is awkward&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/dinhanhx/how-stupid-is-matlab-accessing-array-syntax-20jl"&gt;Accessing array syntax is weird&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;More proofs of how stupid is Matlab:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.rath.org/matlab-is-a-terrible-programming-language.html"&gt;MATLAB is a terrible programming language&lt;/a&gt; 2017&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://neuroplausible.com/matlab"&gt;I Hate Matlab: How an IDE, a Language, and a Mentality Harm&lt;/a&gt; 2017&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.mathworks.com/matlabcentral/answers/556024-what-frustrates-you-about-matlab-2"&gt;What frustrates you about MATLAB? #2&lt;/a&gt; 2020&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Matlab vs Python &lt;a href="https://www.mathworks.com/products/matlab/matlab-vs-python.html"&gt;&lt;strong&gt;comparison page&lt;/strong&gt;&lt;/a&gt;.
&lt;/h2&gt;

&lt;p&gt;The following picture is captured from &lt;a href="https://www.mathworks.com/products/matlab/matlab-vs-python.html"&gt;MathWork's page about comparing to Python&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eM0OBIin--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nndkglek3ayabjrm6rgb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eM0OBIin--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nndkglek3ayabjrm6rgb.png" alt="Matlab vs Python" width="880" height="244"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here you see they wrote 2 sentences describing how awesome their products are. And they just wrote 1 sentence describing Python. Then they went on how it's suitable for engineering and scientits from other fields other than computer science. &lt;/p&gt;

&lt;p&gt;I'm pretty sure that &lt;strong&gt;is not&lt;/strong&gt; how you should compare things, MathWork. Let take an example &lt;a href="https://realpython.com/matlab-vs-python/"&gt;Matlab vs Python by RealPython&lt;/a&gt; in which people fully compare things feature by feature. &lt;/p&gt;

&lt;h2&gt;
  
  
  Matlab pricing
&lt;/h2&gt;

&lt;p&gt;It's stupidly expensive if you are a scientist in a country that isn't rich as top economic countries.  &lt;/p&gt;

</description>
      <category>matlab</category>
      <category>programming</category>
    </item>
    <item>
      <title>How stupid is Matlab function?</title>
      <dc:creator>dinhanhx</dc:creator>
      <pubDate>Fri, 14 Jan 2022 02:52:24 +0000</pubDate>
      <link>https://forem.com/dinhanhx/how-stupid-is-matlab-function-51lo</link>
      <guid>https://forem.com/dinhanhx/how-stupid-is-matlab-function-51lo</guid>
      <description>&lt;h2&gt;
  
  
  Function definition in a script
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Python
&lt;/h3&gt;

&lt;p&gt;Filename: &lt;code&gt;the_amazing_file.py&lt;/code&gt;&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="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;returnTrue&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;returnTrue&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here you define the function first, then call it. It's like how you do math with paper. You write down the formula, then you apply it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Matlab
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DHJJTqoh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5o5wpvg951hp6tkzhgfs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DHJJTqoh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5o5wpvg951hp6tkzhgfs.png" alt="Matlab motto" width="573" height="154"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So the language for math, the function should be defined first right?&lt;/p&gt;

&lt;p&gt;Yeah no. &lt;/p&gt;

&lt;p&gt;Filename: &lt;code&gt;the_amazing_file.m&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight matlab"&gt;&lt;code&gt;&lt;span class="nb"&gt;disp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;returnTrue&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;returnTrue&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Seriously matlab, are you for math?&lt;/p&gt;

&lt;h2&gt;
  
  
  Calling non-parameter function
&lt;/h2&gt;

&lt;p&gt;Let say you have a function &lt;code&gt;foo()&lt;/code&gt; which doesn't have parameters&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight matlab"&gt;&lt;code&gt;&lt;span class="nb"&gt;bar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; 
&lt;span class="nb"&gt;bar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;foo&lt;/span&gt;
&lt;span class="c1"&gt;% Both are equivalent. &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But &lt;code&gt;foo()&lt;/code&gt; and &lt;code&gt;foo&lt;/code&gt; mean two different things. &lt;code&gt;foo()&lt;/code&gt; means calling a function. &lt;code&gt;foo&lt;/code&gt; means "I'm a variable". If you use Python, it's &lt;a href="https://www.geeksforgeeks.org/passing-function-as-an-argument-in-python/"&gt;passing functions as an argument&lt;/a&gt;. If you use C, it's &lt;a href="https://www.geeksforgeeks.org/function-pointer-in-c/"&gt;function pointer&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Passing functions as argument vs Defining anonymous functions
&lt;/h2&gt;

&lt;p&gt;Alright how to pass function as an argument in matlab? You use &lt;code&gt;@&lt;/code&gt; I copied this example from &lt;a href="https://www.mathworks.com/help/matlab/ref/function.html"&gt;matlab function &lt;strong&gt;doc&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight matlab"&gt;&lt;code&gt;&lt;span class="c1"&gt;% Compute the value of the integrand at 2*pi/3.&lt;/span&gt;
&lt;span class="n"&gt;x&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="nb"&gt;pi&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;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;myIntegrand&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="c1"&gt;% Compute the area under the curve from 0 to pi.&lt;/span&gt;
&lt;span class="n"&gt;xmin&lt;/span&gt; &lt;span class="o"&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;xmax&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;pi&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="n"&gt;myIntegrand&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;integral&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;xmin&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;xmax&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;myIntegrand&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;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;sin&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="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="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Guess what else use &lt;code&gt;@&lt;/code&gt;? Anonymous functions&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight matlab"&gt;&lt;code&gt;&lt;span class="n"&gt;sqr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;@&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;x&lt;/span&gt;&lt;span class="o"&gt;.^&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you look at the way anonymous function is defined and look at how non-parameter function (previous section), you may ask the following line&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight matlab"&gt;&lt;code&gt;&lt;span class="nb"&gt;bar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;could mean anything right? Yeah it could mean:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;calling a function without parameters&lt;/li&gt;
&lt;li&gt;assigning anonymous function to different variable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The more confusing, the more we analyse.&lt;/p&gt;

&lt;p&gt;Now you may argue, "I know my functions". Yeah but can you remember &lt;strong&gt;other people&lt;/strong&gt; functions when reading a long file while trying to understand what it does? Can you?&lt;/p&gt;

</description>
      <category>matlab</category>
      <category>programming</category>
    </item>
    <item>
      <title>How stupidly expensive is Matlab for Deep Learning?</title>
      <dc:creator>dinhanhx</dc:creator>
      <pubDate>Wed, 12 Jan 2022 06:31:36 +0000</pubDate>
      <link>https://forem.com/dinhanhx/how-stupidly-expensive-is-matlab-for-deep-learning-3ep8</link>
      <guid>https://forem.com/dinhanhx/how-stupidly-expensive-is-matlab-for-deep-learning-3ep8</guid>
      <description>&lt;p&gt;Thank to &lt;a href="https://github.com/XuanVuNguyen"&gt;Xuan Vu Nguyen&lt;/a&gt; for some discussions. &lt;/p&gt;

&lt;p&gt;With Python, you have Tensorlow 2/Keras (free), PyTorch/Lightning (free), Jupyter Notebook (free). You can even use Google Colab if you don't own a decent gpu. &lt;/p&gt;

&lt;p&gt;With Matlab (perpetual license), you have to buy Matlab for 2.3K USD&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qxbqJ5XB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4tolwwnf2jzz2tuqdwbe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qxbqJ5XB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4tolwwnf2jzz2tuqdwbe.png" alt="Image description" width="880" height="300"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;DeepLearning ToolBox for 1.3K USD&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pDn8jMML--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hzaln3t34ozc5a7ne4gz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pDn8jMML--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hzaln3t34ozc5a7ne4gz.png" alt="Image description" width="880" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and to use that tool box &lt;strong&gt;with&lt;/strong&gt; gpu, you have to buy Parallel Computing Toolbox for 1.1K USD&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hfJJavXD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ffkesqo56pt2v30v92j5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hfJJavXD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ffkesqo56pt2v30v92j5.png" alt="Image description" width="880" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Not mention that Matlab often consume much hardware resources so you may need a better cpu, ram, hard disk. (You guess right, you have to pay even more).&lt;/p&gt;

&lt;p&gt;MathWork, do you even research what people demand? What people need? No one is going to pay 4.7K USD for a deep learning enviroment with matlab (a crappy framework with a stupid language) because they spend money on GPU already. &lt;/p&gt;

</description>
      <category>matlab</category>
      <category>programming</category>
    </item>
    <item>
      <title>How stupid is Matlab OOP?</title>
      <dc:creator>dinhanhx</dc:creator>
      <pubDate>Wed, 12 Jan 2022 05:57:15 +0000</pubDate>
      <link>https://forem.com/dinhanhx/how-stupid-is-matlab-oop-5dp6</link>
      <guid>https://forem.com/dinhanhx/how-stupid-is-matlab-oop-5dp6</guid>
      <description>&lt;p&gt;Let write a normal class in Java first&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Car&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;wheels&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;setWheels&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;new_wheels&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;wheels&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;new_wheels&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep in mind that Java is a lower-language than Matlab. Now you might ask in Matlab it should simpler than the Java code. Guess what. It's no.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight matlab"&gt;&lt;code&gt;&lt;span class="k"&gt;classdef&lt;/span&gt; &lt;span class="n"&gt;Car&lt;/span&gt;
    &lt;span class="k"&gt;properties&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Access&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;public&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;wheels&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
    &lt;span class="k"&gt;methods&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Access&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;private&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;setWheels&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;new_wheels&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;wheels&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;new_wheels&lt;/span&gt;
        &lt;span class="k"&gt;end&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In Matlab, you &lt;strong&gt;have&lt;/strong&gt; to define blocks (&lt;code&gt;methods&lt;/code&gt; and &lt;code&gt;properties&lt;/code&gt;) to separate functions and variables. What even more confusing is that MathWork calls &lt;code&gt;Access&lt;/code&gt; an attribute. (&lt;a href="https://www.mathworks.com/help/matlab/matlab_oop/method-attributes.html"&gt;Method Attributes&lt;/a&gt;, &lt;a href="https://www.mathworks.com/help/matlab/matlab_oop/property-attributes.html"&gt;Properties attributes&lt;/a&gt;). In UML notation or &lt;strong&gt;any&lt;/strong&gt; language providing OOP, attributes mean object/class variables or properties. The right words for &lt;code&gt;public&lt;/code&gt; or &lt;code&gt;private&lt;/code&gt; are modifiers (in Java), specifiers (in C++). As a result, when you are talking with other engineers (who are not proficient in matlab), you could make them confused with words. &lt;/p&gt;

&lt;p&gt;Now we will add a public integer attribute &lt;code&gt;plate&lt;/code&gt; to class &lt;code&gt;Car&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;in Java&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;plate&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;in Matlab&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight matlab"&gt;&lt;code&gt;&lt;span class="k"&gt;properties&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Access&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;private&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;plate&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You see unnecessary keywords and characters in matlab. If the researchers or the engineering need fast prototyping, matlab isn't for them. Ironically, Matlab claim to be the right language for scientific computing. &lt;/p&gt;

</description>
      <category>matlab</category>
      <category>programming</category>
    </item>
    <item>
      <title>How stupid is Matlab accessing array syntax?</title>
      <dc:creator>dinhanhx</dc:creator>
      <pubDate>Wed, 12 Jan 2022 04:15:50 +0000</pubDate>
      <link>https://forem.com/dinhanhx/how-stupid-is-matlab-accessing-array-syntax-20jl</link>
      <guid>https://forem.com/dinhanhx/how-stupid-is-matlab-accessing-array-syntax-20jl</guid>
      <description>&lt;p&gt;Here is how you define an array and print the &lt;strong&gt;first&lt;/strong&gt; element in it&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight matlab"&gt;&lt;code&gt;&lt;span class="n"&gt;v&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="mi"&gt;5&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="nb"&gt;disp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let not talk about the fact that matlab array starts with 1 for now. &lt;/p&gt;

&lt;p&gt;So what's the problem here? The functions also use &lt;code&gt;()&lt;/code&gt; for receiving parameters. When you read this line without previous lines, &lt;code&gt;disp(v(1))&lt;/code&gt; you have to ask yourself this question:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;v is a function or an array?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;"I always read the previous lines" you may argue. But can you remember which one is a function, which one is an array in a long script with many functions and variables?&lt;/p&gt;

&lt;p&gt;Now you have to remember &lt;code&gt;()&lt;/code&gt; has two meanings. Well two usage of &lt;code&gt;()&lt;/code&gt; near each other can create confusion. &lt;/p&gt;

</description>
      <category>matlab</category>
      <category>programming</category>
    </item>
    <item>
      <title>How stupid is Matlab for loop?</title>
      <dc:creator>dinhanhx</dc:creator>
      <pubDate>Tue, 11 Jan 2022 12:39:55 +0000</pubDate>
      <link>https://forem.com/dinhanhx/how-stupid-is-matlab-for-loop-6kc</link>
      <guid>https://forem.com/dinhanhx/how-stupid-is-matlab-for-loop-6kc</guid>
      <description>&lt;p&gt;Before I answer the question in the title, let look at how for loop in Python and C are expressed in human language&lt;/p&gt;

&lt;h2&gt;
  
  
  Python
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;v&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;2&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;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Human language: there is a variable &lt;code&gt;v&lt;/code&gt; assigned a list &lt;code&gt;[1, 2, 3, 4]&lt;/code&gt;. Then &lt;strong&gt;for&lt;/strong&gt; each element &lt;strong&gt;in&lt;/strong&gt; &lt;code&gt;v&lt;/code&gt; (stored in variable &lt;code&gt;i&lt;/code&gt;) is printed. &lt;/p&gt;

&lt;p&gt;You can see it's very straight forward.&lt;/p&gt;

&lt;h2&gt;
  
  
  C
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;[]&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;2&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;4&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&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;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&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;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%d"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="c1"&gt;//for ( init; condition; increment ) {&lt;/span&gt;
&lt;span class="c1"&gt;//   statement(s);&lt;/span&gt;
&lt;span class="c1"&gt;//}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Human language: there is a variable &lt;code&gt;v&lt;/code&gt; assigned an array &lt;code&gt;{1, 2, 3, 4}&lt;/code&gt;. Then, a variable &lt;code&gt;i&lt;/code&gt; stores integer 0. Then &lt;strong&gt;for&lt;/strong&gt; &lt;code&gt;i&lt;/code&gt; starts with 0 (the initial), when is smaller than 4 (the condition), increase &lt;code&gt;i&lt;/code&gt; by one (the increment) and print the value element of &lt;code&gt;v&lt;/code&gt; by the index (the statment).&lt;/p&gt;

&lt;p&gt;It's longer than Python (of course, C is a low level language). However, the description is still straightforward. It's just added some linking words to ease human mind. &lt;/p&gt;

&lt;h2&gt;
  
  
  Matlab
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight matlab"&gt;&lt;code&gt;&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;v&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="mi"&gt;2&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
   &lt;span class="nb"&gt;disp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By instinct, when you see &lt;code&gt;v = [1 2 3 4]&lt;/code&gt;, you will say a variable &lt;code&gt;v&lt;/code&gt; assigned an array &lt;code&gt;[1 2 3 4]&lt;/code&gt;. Guess what? it becomes the iterator when being added to a for loop. &lt;/p&gt;

&lt;p&gt;I tried to express this thing in human language that is close to the code but nothing works. &lt;/p&gt;

&lt;p&gt;Try 1: for v is assigned to an array, display element of v&lt;/p&gt;

&lt;p&gt;Here you can see it doesn't show that v is an iterator. And v has two meanings. &lt;/p&gt;

&lt;p&gt;Try 2: for each v in &lt;code&gt;[1 2 3 4]&lt;/code&gt;, display v&lt;/p&gt;

&lt;p&gt;But v is assigned to an array?? We all know equal sign and belong sign are two different things.&lt;/p&gt;

&lt;p&gt;There isn't a proper human language description for this one. And you have to remember that &lt;code&gt;=&lt;/code&gt; has two meanings:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;assign when not in a for loop&lt;/li&gt;
&lt;li&gt;in when in a for loop&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If MathWork read this blog, please use something different than &lt;code&gt;=&lt;/code&gt;. You can use &lt;code&gt;in&lt;/code&gt; or &lt;code&gt;belongto&lt;/code&gt; or &lt;code&gt;iterate&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;Now you see how stupid it is. &lt;/p&gt;

</description>
      <category>matlab</category>
      <category>programming</category>
      <category>python</category>
      <category>c</category>
    </item>
    <item>
      <title>Attention this, attention that</title>
      <dc:creator>dinhanhx</dc:creator>
      <pubDate>Wed, 16 Jun 2021 03:07:29 +0000</pubDate>
      <link>https://forem.com/dinhanhx/attention-this-attention-that-229f</link>
      <guid>https://forem.com/dinhanhx/attention-this-attention-that-229f</guid>
      <description>&lt;p&gt;This post is for people who are working on or learning in deep learning with natural language processing. Minimum knowledge level: &lt;a href="https://huggingface.co/course/chapter1"&gt;Hugging Face - Transformer&lt;/a&gt; or equivalent. &lt;/p&gt;

&lt;p&gt;Who have read 3 followings papers are beneficial:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://arxiv.org/pdf/1409.0473.pdf"&gt;Neural Machine Translation by Jointly Learning to Align and Translate&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://arxiv.org/pdf/1508.04025.pdf"&gt;Effective Approaches to Attention-based Neural Machine Translation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://arxiv.org/pdf/1706.03762.pdf"&gt;Attention Is All You Need&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are 3 style of attention mechanism should not be confused with namely:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Tensorflow implementation&lt;/th&gt;
&lt;th&gt;PyTorch implementation&lt;/th&gt;
&lt;th&gt;Paper&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Bahdanau attention&lt;/td&gt;
&lt;td&gt;&lt;a href="https://keras.io/api/layers/attention_layers/additive_attention/"&gt;AdditiveAttention layer&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://pytorch.org/tutorials/intermediate/seq2seq_translation_tutorial.html#attention-decoder"&gt;Attention Decoder&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://arxiv.org/pdf/1409.0473.pdf"&gt;Neural Machine Translation by Jointly Learning to Align and Translate&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Luong attention&lt;/td&gt;
&lt;td&gt;&lt;a href="https://keras.io/api/layers/attention_layers/attention/"&gt;Attention layer&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://pytorch.org/tutorials/beginner/deploy_seq2seq_hybrid_frontend_tutorial.html#define-decoders-attention-module"&gt;Decoder's Attention&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://arxiv.org/pdf/1508.04025.pdf"&gt;Effective Approaches to Attention-based Neural Machine Translation&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MultiHeadAttention&lt;/td&gt;
&lt;td&gt;&lt;a href="https://keras.io/api/layers/attention_layers/multi_head_attention/"&gt;MultiHeadAttention layer&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://pytorch.org/docs/stable/generated/torch.nn.MultiheadAttention.html#torch.nn.MultiheadAttention"&gt;MultiheadAttention layer&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://arxiv.org/pdf/1706.03762.pdf"&gt;Attention Is All You Need&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Reading list recommendation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/questions/44238154/what-is-the-difference-between-luong-attention-and-bahdanau-attention"&gt;What is the difference between Luong attention and Bahdanau attention?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://jalammar.github.io/illustrated-transformer/"&gt;The illustrated Transformer&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: Please comment any attention mechanism not included in this post as well as paper, implementations.&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>naturallanguageprocessing</category>
    </item>
    <item>
      <title>My workflow for a research in machine learning</title>
      <dc:creator>dinhanhx</dc:creator>
      <pubDate>Tue, 15 Jun 2021 08:52:04 +0000</pubDate>
      <link>https://forem.com/dinhanhx/my-workflow-for-a-research-in-machine-learning-2886</link>
      <guid>https://forem.com/dinhanhx/my-workflow-for-a-research-in-machine-learning-2886</guid>
      <description>&lt;p&gt;This post is based on my experience when I was an intern at &lt;a href="https://ictlab.usth.edu.vn/"&gt;USTH ICT Lab&lt;/a&gt;. It's aimed for everyone to read. &lt;/p&gt;

&lt;p&gt;I divide the research into 3 stages. &lt;/p&gt;

&lt;h1&gt;
  
  
  Stage 1: Preparation
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Define in detail what the problem is.&lt;/li&gt;
&lt;li&gt;Define performance metrics.&lt;/li&gt;
&lt;li&gt;Find dataset and relevant datasets.&lt;/li&gt;
&lt;li&gt;Read top research papers related to the problem as much as you can but not too deep. Read abstract, read model overview, read results. &lt;/li&gt;
&lt;li&gt;Check their source code if there are. &lt;/li&gt;
&lt;li&gt;Summarize all the ideas, all results and all hardware specification. &lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Stage 2: Experiments
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Pick 2 or 3 research papers that you feel you can reproduce the results. &lt;/li&gt;
&lt;li&gt;Read them in detail.&lt;/li&gt;
&lt;li&gt;Reproduce results. &lt;/li&gt;
&lt;li&gt;Brainstorm idea to what can be done to improve the result.&lt;/li&gt;
&lt;li&gt;Carry out your experiments.&lt;/li&gt;
&lt;li&gt;Summarize your work.&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Stage 3: Report
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Write a research paper&lt;/li&gt;
&lt;li&gt;Publish your work.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>machinelearning</category>
      <category>research</category>
    </item>
    <item>
      <title>The way you should install C++ libraries and install Visual Studio on Windows 10</title>
      <dc:creator>dinhanhx</dc:creator>
      <pubDate>Thu, 25 Mar 2021 08:56:02 +0000</pubDate>
      <link>https://forem.com/dinhanhx/the-way-you-should-install-c-libraries-and-install-visual-studio-on-windows-10-3aj7</link>
      <guid>https://forem.com/dinhanhx/the-way-you-should-install-c-libraries-and-install-visual-studio-on-windows-10-3aj7</guid>
      <description>&lt;p&gt;In this tutorial, I will show you the way to install Visual Studio as small as minimum as possible.&lt;/p&gt;

&lt;h1&gt;
  
  
  Install Visual Studio
&lt;/h1&gt;

&lt;p&gt;Download &lt;a href="https://visualstudio.microsoft.com/vs/community/" rel="noopener noreferrer"&gt;Visual Studio Installer&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When in Visual Studio Installer GUI windows, I suggest you tick like this&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwfq8ktu2ohepdx7dm1dk.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwfq8ktu2ohepdx7dm1dk.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It will consume your diskspace at most &lt;strong&gt;4gb&lt;/strong&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Install vcpkg
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://github.com/Microsoft/vcpkg" rel="noopener noreferrer"&gt;vcpkg&lt;/a&gt; is a cross-platform C++ libraries manager. It will do the hard work for you such as building, importing, setting up PATHS, ..etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/microsoft/vcpkg#quick-start-windows" rel="noopener noreferrer"&gt;How to install vcpkg&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To install vcpkg&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; git clone https://github.com/microsoft/vcpkg
&amp;gt; .\vcpkg\bootstrap-vcpkg.bat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To install the libraries for your project, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; .\vcpkg\vcpkg install [packages to install]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also search for the libraries you need with the &lt;code&gt;search&lt;/code&gt; subcommand:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; .\vcpkg\vcpkg search [search term]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In order to use vcpkg with Visual Studio,&lt;br&gt;
run the following command (may require administrator elevation):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; .\vcpkg\vcpkg integrate install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;All installed libraries&lt;/strong&gt; are &lt;strong&gt;immediately ready to be &lt;code&gt;#include&lt;/code&gt;'d&lt;/strong&gt; and used in your project without additional configuration.&lt;/p&gt;

&lt;h1&gt;
  
  
  Example
&lt;/h1&gt;

&lt;p&gt;I want to setup glut, glew, glm for my Computer Graphics course.&lt;/p&gt;

&lt;p&gt;I go to where my vcpkg is installed. Then I run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vcpkg.exe install freeglut glew glm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I wait until it is done.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vcpkg.exe integrate install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>cpp</category>
      <category>windows10</category>
    </item>
  </channel>
</rss>
