<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Dung Minh Dao</title>
        <link>https://dungminhdao.github.io/</link>
        <description>Recent content on Dung Minh Dao</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en-us</language>
        <lastBuildDate>Wed, 25 May 2022 20:13:33 +0700</lastBuildDate><atom:link href="https://dungminhdao.github.io/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>Quick note on the definition of AI</title>
        <link>https://dungminhdao.github.io/p/quick-note-on-the-definition-of-ai/</link>
        <pubDate>Wed, 25 May 2022 20:13:33 +0700</pubDate>
        
        <guid>https://dungminhdao.github.io/p/quick-note-on-the-definition-of-ai/</guid>
        <description>&lt;img src="https://dungminhdao.github.io/p/quick-note-on-the-definition-of-ai/Artificial-Intelligence.jpg" alt="Featured image of post Quick note on the definition of AI" /&gt;&lt;style&gt;
r { color: Red }
bl { color: Blue }
g { color: Green }
&lt;/style&gt;
&lt;p&gt;As a final-year student who has some experience about artificial intelligence(AI) and machine learning (ML), it&amp;rsquo;s great for me to have a chance to revisit the definition of AI through the introductory course to AI at Stanford University - CS221 - which content is available online. This is also a chance for me to look back at the Introduction to AI course that I studied in my second year at Hanoi University of Science and Technology (HUST).&lt;/p&gt;
&lt;h1 id=&#34;what-is-aiml-for-me-before-this-course&#34;&gt;What is AI/ML for me, before this course?&lt;/h1&gt;
&lt;p&gt;After many days of reading online content about the definition of AI in my early years at the university, I finally came up and satisfied with a definition of AI that seem to be general enough. In my own expression: &lt;strong&gt;&amp;ldquo;Artificial Intelligence is any kind of simulation that exhibit a feature of intelligence&amp;rdquo;&lt;/strong&gt;. This definition, to me, is acceptable for a number of reasons:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Some definitions equalize intelligence to human intelligence, which I believe is a limit to themselves. Animals exhibit some kinds of intelligence, and there can be types of intelligence that human don&amp;rsquo;t have.&lt;/li&gt;
&lt;li&gt;Simulations are created by human in general, but the &amp;ldquo;simulation&amp;rdquo; here is meant to be equivalent to &amp;ldquo;artificial&amp;rdquo; - not occuring in the nature.&lt;/li&gt;
&lt;li&gt;There are many type of intelligence and abilities associate with intelligence - as from Wikipedia, abstraction, logic, understanding, learning, emotional knowledge, etc. - and there is also no single definition for intelligence. So exhibition of one those traits is acceptable.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The definition of machine learning by Tom M. Mitchell in his book Machine Learning is commonly accepted by everyone:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P if its performance at tasks in T, as measured by P, improves with experience E.&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;ML is often regarded as a subset of AI. The difference here is, ML has an element called &lt;strong&gt;&amp;ldquo;learning&amp;rdquo;&lt;/strong&gt; - improvement of performance with more data/experience&lt;/p&gt;
&lt;h1 id=&#34;my-unanswered-questions&#34;&gt;My unanswered questions&lt;/h1&gt;
&lt;p&gt;You might ask &amp;ldquo;So what is the problem for you definition?&amp;rdquo;. Actually, I know that I can have a good definition for my own. The next step is what make me interested in: &lt;strong&gt;&amp;ldquo;How to categorize AI/ML in such a way that aligns well with some aspects of natural intelligence?&amp;rdquo;&lt;/strong&gt;. In fact, there are already some common ways of categorizing AI or ML:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Grouping by learning methods: supervised learning, unsupervised learning, reinforcement learning,&amp;hellip;&lt;/li&gt;
&lt;li&gt;Grouping by type of tasks: computer vision, natural language processing, speech processing,&amp;hellip;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;While these groupings are useful, I&amp;rsquo;m still not contented, since they are unnatural:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The groupings just &amp;ldquo;split&amp;rdquo; problems in AI/ML into group according to human-defined concepts (e.g: supervised) or functionalities of human (e.g: see - computer vision, or speak - speech processing) - which &lt;strong&gt;ignores general aspects of intelligence (e.g: logic, abstraction) mentioned above&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;There is not much thing to compare between groups. &lt;strong&gt;There isn&amp;rsquo;t seem to exist a scale from &amp;ldquo;low&amp;rdquo; to &amp;ldquo;high&amp;rdquo;&lt;/strong&gt; to measure any aspect of each category in comparison with other categories&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&#34;introduction-to-ai-course-at-my-university-and-my-doubt&#34;&gt;Introduction to AI course at my university, and my doubt&lt;/h1&gt;
&lt;p&gt;These are topics that were mentioned in my AI class:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Searching problems: tree methods (BFS, DFS), heuristic methods, constraint satisfaction problem (CSP)&lt;/li&gt;
&lt;li&gt;Logic: Propositional logic, First-order logic&lt;/li&gt;
&lt;li&gt;Machine learning: Some common methods (kNN, naive bayes, decision tree, neural network)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Studying this course made me feel that there wass some kind of ordered categorization here. Maybe the difficulty of the problems is the scale that I&amp;rsquo;m looking for? Or, the scale is based on how abstract the problems are?&lt;/p&gt;
&lt;p&gt;At the beginnning of the course, there was an introduction and overview of AI history. However, we students were not told why the course was structured in that way - we only knew the topics.&lt;/p&gt;
&lt;h1 id=&#34;what-i-learned-and-deduced-from-stanfords-ai-course&#34;&gt;What I learned and deduced from Stanford&amp;rsquo;s AI course&lt;/h1&gt;
&lt;p&gt;First, from the view of this course&amp;rsquo;s lecturer, there are 3 pillars to AI: Modeling (create a mathematical/logical representation of the real world), Inference (answer questions about models, e.g: shortest path, winning strategy), and Learning (transform an abstract model into a concrete one, with the help from additional data).&lt;/p&gt;
&lt;p float=&#34;left&#34;&gt;
  &lt;img src=&#34;modeling.png&#34; style=&#34;width: 30%&#34;/&gt;
  &lt;img src=&#34;inference.png&#34; style=&#34;width: 30%&#34;/&gt; 
  &lt;img src=&#34;learning.png&#34; style=&#34;width: 35%&#34;/&gt;
&lt;/p&gt;
&lt;p&gt;The below image pretty much sums up the categorization of AI/ML problem/model types used in this course. They are sorted by the &amp;ldquo;low-high&amp;rdquo; level of intelligence:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Reflex-based model&lt;/strong&gt; is a &lt;em&gt;fixed sequence of computations&lt;/em&gt; to get the output. This is equivalent to daily reflexive task that we can do very quickly, such as recognizing an object in the house&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;State-based model&lt;/strong&gt; considers available &lt;em&gt;states&lt;/em&gt; and &lt;em&gt;actions&lt;/em&gt; at each state, as well as plan the step-by-step actions that will followed. This is the model of some of our favorite games such as chess and go, or some riddles for children like the prisoners&amp;rsquo; dilemma&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Variable-based model&lt;/strong&gt; deals with assignment of &lt;em&gt;variable&lt;/em&gt; with respect to some &lt;em&gt;factors/conditions&lt;/em&gt;, regardless of order. Sudoku is a game that can be well-modelled in this category.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Logic-based model&lt;/strong&gt; can digest heterogeneous information into some &lt;em&gt;syntax&lt;/em&gt; and &lt;em&gt;semantic&lt;/em&gt; representations, and reason deeply using &lt;em&gt;inference rules&lt;/em&gt;. The common logical analysis we often do in daily life can be represented by this type of model.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure 
	
		class=&#34;gallery-image&#34; 
		style=&#34;
			flex-grow: 340; 
			flex-basis: 816px&#34;
	&gt;
	&lt;a href=&#34;https://dungminhdao.github.io/p/quick-note-on-the-definition-of-ai/ML_types.png&#34; data-size=&#34;2056x604&#34;&gt;
		&lt;img src=&#34;https://dungminhdao.github.io/p/quick-note-on-the-definition-of-ai/ML_types.png&#34;
			width=&#34;2056&#34;
			height=&#34;604&#34;
			srcset=&#34;https://dungminhdao.github.io/p/quick-note-on-the-definition-of-ai/ML_types_hu55f7986c80c37abb145a579770ec7996_104753_480x0_resize_box_3.png 480w, https://dungminhdao.github.io/p/quick-note-on-the-definition-of-ai/ML_types_hu55f7986c80c37abb145a579770ec7996_104753_1024x0_resize_box_3.png 1024w&#34;
			loading=&#34;lazy&#34;
			&gt;
	&lt;/a&gt;
	
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;So there is an ordered categorization here!!!&lt;/strong&gt;. A great news for me. However, to make the ordering clearer, I read through the course and try to &lt;strong&gt;make some scales to organize the problems/models according to the 3 pillars mentioned above&lt;/strong&gt;. Here is my own summary of analysis, based on what I learned from the course:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pillar&lt;/th&gt;
&lt;th&gt;Reflex&lt;/th&gt;
&lt;th&gt;States&lt;/th&gt;
&lt;th&gt;Variables&lt;/th&gt;
&lt;th&gt;Logic&lt;/th&gt;
&lt;th&gt;Conclusion&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;r&gt;&lt;strong&gt;Modeling&lt;/strong&gt;&lt;/r&gt;&lt;/td&gt;
&lt;td&gt;abstract model, &amp;ldquo;massive lookup  table of best actions&amp;rdquo;&lt;/td&gt;
&lt;td&gt;local interactions between  states (like in graph)&lt;/td&gt;
&lt;td&gt;solutions are assigned to  variables (lots of possibilities)&lt;/td&gt;
&lt;td&gt;syntax and semantics,  highly expressive&lt;/td&gt;
&lt;td&gt;Models get &lt;strong&gt;simpler&lt;/strong&gt; and &lt;strong&gt;more expressive&lt;/strong&gt;.  Moving from abstract → concrete (less learning)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;g&gt;&lt;strong&gt;Inference&lt;/strong&gt;&lt;/g&gt;&lt;/td&gt;
&lt;td&gt;follow a fixed sequence of  steps to get the output&lt;/td&gt;
&lt;td&gt;combine local interactions to  get optimization solutions&lt;/td&gt;
&lt;td&gt;find assignments to variables, or probabilistic inference&lt;/td&gt;
&lt;td&gt;draw (deep) logical reasoning from  knowledge, but rules can be deterministic&lt;/td&gt;
&lt;td&gt;Inference gets &lt;strong&gt;more complex&lt;/strong&gt;,  and &lt;strong&gt;handles less uncertainty&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;bl&gt;&lt;strong&gt;Learning&lt;/strong&gt;&lt;/bl&gt;&lt;/td&gt;
&lt;td&gt;have to learn from (lots of) data&lt;/td&gt;
&lt;td&gt;get data through exploration  action&lt;/td&gt;
&lt;td&gt;need few data, incorporate prior  domain knowledge&lt;/td&gt;
&lt;td&gt;rule-based, don&amp;rsquo;t allow fine-tuning  through data&lt;/td&gt;
&lt;td&gt;Learning gets &lt;strong&gt;easier&lt;/strong&gt; - but &lt;strong&gt;lower ability  to fine-tune&lt;/strong&gt; through additional data&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h1 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;In the end, I have found what I need: an ordered grouping that &amp;ldquo;aligns well with some aspects of natural intelligence&amp;rdquo;. This categorization also fill in the hole of my understanding about how my university&amp;rsquo;s Introduction to AI course was structured.&lt;/p&gt;
&lt;p&gt;Needless to say, there are many topics covered in this course. I think this is a very good course for anyone who want to get an overview of what AI is, and it can also be a starting point to find out more on specific topics of AI/ML.&lt;/p&gt;
&lt;h1 id=&#34;reference&#34;&gt;Reference&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Background image: &lt;a class=&#34;link&#34; href=&#34;https://upload.wikimedia.org/wikipedia/commons/thumb/4/42/Artificial-Intelligence.jpg/1024px-Artificial-Intelligence.jpg&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://upload.wikimedia.org/wikipedia/commons/thumb/4/42/Artificial-Intelligence.jpg/1024px-Artificial-Intelligence.jpg&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;CS221 - Spring 2022 lecture slides (and image references): &lt;a class=&#34;link&#34; href=&#34;https://stanford-cs221.github.io/spring2022/modules/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://stanford-cs221.github.io/spring2022/modules/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Intelligence - Wikipedia: &lt;a class=&#34;link&#34; href=&#34;https://en.wikipedia.org/wiki/Intelligence&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://en.wikipedia.org/wiki/Intelligence&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        </item>
        <item>
        <title>Chiến tranh Chechnya</title>
        <link>https://dungminhdao.github.io/p/chien-tranh-chechnya/</link>
        <pubDate>Thu, 19 May 2022 10:01:59 +0700</pubDate>
        
        <guid>https://dungminhdao.github.io/p/chien-tranh-chechnya/</guid>
        <description>&lt;img src="https://dungminhdao.github.io/p/chien-tranh-chechnya/background.png" alt="Featured image of post Chiến tranh Chechnya" /&gt;</description>
        </item>
        <item>
        <title>Machine Learning Operation (MLOps) Courses Review</title>
        <link>https://dungminhdao.github.io/p/mlops-courses-review/</link>
        <pubDate>Wed, 18 May 2022 08:59:52 +0700</pubDate>
        
        <guid>https://dungminhdao.github.io/p/mlops-courses-review/</guid>
        <description>&lt;img src="https://dungminhdao.github.io/p/mlops-courses-review/background.png" alt="Featured image of post Machine Learning Operation (MLOps) Courses Review" /&gt;&lt;p&gt;Hi. This is the first course review I&amp;rsquo;ve ever done on my blog, and today I will review the 2 series of courses on the same topic: Machine Learning Operations, or MLOps for short.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What to expect in this review&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An overview of what these programs do and don&amp;rsquo;t provide&lt;/li&gt;
&lt;li&gt;The topics that are focused in each series and technological stacks used&lt;/li&gt;
&lt;li&gt;Methods of teaching, reviewing, and testing&lt;/li&gt;
&lt;li&gt;My experience studying each of these programs: what I find interesting (and what need to be improved)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What NOT to expect in my review&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Details on each of the topics (though I do provide some insights)&lt;/li&gt;
&lt;li&gt;How to complete each projects and tests&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&#34;why-should-you-care-about-mlops&#34;&gt;Why should you care about MLOps?&lt;/h1&gt;
&lt;p&gt;For most of beginners in Machine Learning or AI, it is a common practice to use notebooks and simple files to do experiments with readily available datasets, run and fine-tune a number of models. While this could be a good starting point for developing practical models, things are quite different in the production scenarios.&lt;/p&gt;
&lt;p&gt;I will not list all of the cumbersome theoretical and practical issues here, as the readers can easily search for posts on the topic of MLOps, as well as find some insights on the problems that MLOps solves through the rest of my course review. However, here is a simple summary of some of the problems that MLOps can provide solutions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The real-world data are constantly changing, which needs investigation to take action&lt;/li&gt;
&lt;li&gt;ML models need to be easy to run, fine-tune, and track to ensure good performances&lt;/li&gt;
&lt;li&gt;The ML project code should be organized in a pipeline with tracked dependencies for reproducibility and fault tolerance&lt;/li&gt;
&lt;li&gt;When put into production, model performance should be constantly monitored and retraining should be trigger when there is a significant performance downgrade&lt;/li&gt;
&lt;li&gt;Model fairness, information securities,&amp;hellip; are also problems for MLOps to deal with&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure 
	
		class=&#34;gallery-image&#34; 
		style=&#34;
			flex-grow: 223; 
			flex-basis: 535px&#34;
	&gt;
	&lt;a href=&#34;https://dungminhdao.github.io/p/mlops-courses-review/MlSystem.png&#34; data-size=&#34;919x412&#34;&gt;
		&lt;img src=&#34;https://dungminhdao.github.io/p/mlops-courses-review/MlSystem.png&#34;
			width=&#34;919&#34;
			height=&#34;412&#34;
			srcset=&#34;https://dungminhdao.github.io/p/mlops-courses-review/MlSystem_hu09b48d4dd31c44b21a9017300595384f_23009_480x0_resize_box_3.png 480w, https://dungminhdao.github.io/p/mlops-courses-review/MlSystem_hu09b48d4dd31c44b21a9017300595384f_23009_1024x0_resize_box_3.png 1024w&#34;
			loading=&#34;lazy&#34;
			alt=&#34;ML system in production&#34;&gt;
	&lt;/a&gt;
	
	&lt;figcaption&gt;ML system in production&lt;/figcaption&gt;
	
&lt;/figure&gt;&lt;/p&gt;
&lt;center&gt;&lt;b&gt;Figure 1&lt;/b&gt;: This is how production ML system looks like&lt;/center&gt;
&lt;p&gt;You can see that in the end of the day, ML engineers have to work with many other stakeholders - software engineers, data engineers, DevOps, customers, and managers - to implement a successful MLOps project.&lt;/p&gt;
&lt;h1 id=&#34;a-quick-summary-of-courses-and-their-providers&#34;&gt;A quick summary of courses and their providers&lt;/h1&gt;
&lt;p&gt;This topic is pretty new, and there are multiple approaches to deal with it. I have experience studying 2 series of courses on the topic of MLOps. The providers of these 2 courses have great reputation in organizing online courses in the topic of Machine Learning. Although these 2 programs are designed for a 3 to 4 months period of studying, it is personally beneficial for me to study each of these program in 1 month (as I can fully focus on MLOps topics). Links for these programs can be found at &lt;a class=&#34;link&#34; href=&#34;#references&#34; &gt;the reference part&lt;/a&gt;. Let&amp;rsquo;s have an overview:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Coursera Machine Learning Engineering for Production (MLOps) Specialization&lt;/strong&gt;: Well, another specialization provided by DeepLearning.AI; and from the past experience with their famous ML courses, I had a great expectation that this would be an another wonderful journey. Coursera&amp;rsquo;s courses can be audited for free, or you can get a financial aid to study these courses at a reasonable price - and sometimes for free!&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Udacity Nanodegree in Machine Learning DevOps Engineer&lt;/strong&gt;: the first Nanodegree program I have ever taken, and I study this course as a part of training in my company. For the regular students, you can take the courses with the price of as low (or high?) as $120. The price goes with benefit, of course: in return, you will get personalized assessment and suggestion for your project submissions&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&#34;coursera-mlops-specialization&#34;&gt;Coursera MLOps Specialization&lt;/h1&gt;
&lt;p&gt;This is a series of 4 courses, the first course is an introduction, and each of the other 3 courses focus on a specific topic: Data Lifecycle, Modeling Pipelines, and Deploying in Production. &lt;strong&gt;TensorFlow Extended (TFX) platform&lt;/strong&gt; is used for for creating production ML pipelines; the pipelines&amp;rsquo; components are introduced throughout the last 3 courses. Besides, other libraries (&lt;code&gt;ml_metdata&lt;/code&gt;, &lt;code&gt;sklearn&lt;/code&gt;) and technological platform related to Tensorflow (such as Google Cloud Platform) are also frequently used. A basic familiarity with the Tensorflow library can help you in some scenarios.&lt;/p&gt;
&lt;p&gt;&lt;figure 
	
		class=&#34;gallery-image&#34; 
		style=&#34;
			flex-grow: 169; 
			flex-basis: 407px&#34;
	&gt;
	&lt;a href=&#34;https://dungminhdao.github.io/p/mlops-courses-review/TFX.png&#34; data-size=&#34;1760x1036&#34;&gt;
		&lt;img src=&#34;https://dungminhdao.github.io/p/mlops-courses-review/TFX.png&#34;
			width=&#34;1760&#34;
			height=&#34;1036&#34;
			srcset=&#34;https://dungminhdao.github.io/p/mlops-courses-review/TFX_hu4a10abbfb7469d04efd92a89b4ca8f1a_119576_480x0_resize_box_3.png 480w, https://dungminhdao.github.io/p/mlops-courses-review/TFX_hu4a10abbfb7469d04efd92a89b4ca8f1a_119576_1024x0_resize_box_3.png 1024w&#34;
			loading=&#34;lazy&#34;
			alt=&#34;TensorFlow Extended (TFX)&#34;&gt;
	&lt;/a&gt;
	
	&lt;figcaption&gt;TensorFlow Extended (TFX)&lt;/figcaption&gt;
	
&lt;/figure&gt;&lt;/p&gt;
&lt;center&gt;&lt;b&gt;Figure 2&lt;/b&gt;: TensorFlow Extended Pipeline for production ML&lt;/center&gt;
&lt;p&gt;In every course, there is a series of videos introducing new concepts. After a few videos, small quizzes are provided to test how well you understand these concepts, and there are also hand-on labs for practical experiences. Each course final score is determined by a combination of some specific quizzes and hand-on labs score.&lt;/p&gt;
&lt;h2 id=&#34;benefit-of-taking-this-program&#34;&gt;Benefit of taking this program&lt;/h2&gt;
&lt;p&gt;This specialization introduce a lot of recent concept in Machine Learning and AI such as Semi-supervised learning, Neural Architecture Search (NAS), and Knowledge Distillation. I also find interesting recent techniques in handling data (feature transformation, feature selection) and working with models (quantization and pruning).&lt;/p&gt;
&lt;p&gt;Using a common platform (TFX) for creating pipeline make the courses in this specialization well-connected and coherent. A wide range of tools revolves around Tensorflow, especially from Google Cloud Platform, also help me to explore the new tools to train and deploy models automatically.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Side notes&lt;/strong&gt;: There are some guides provided by &lt;strong&gt;Qwiklabs&lt;/strong&gt; that help learners gain familiarity with deploying ML models on Google Cloud Platform in this courses. I recommend checking out other courses from &lt;strong&gt;Qwiklabs&lt;/strong&gt; for basic understanding of the whole platform. Signing up for a &lt;strong&gt;Qwiklabs&lt;/strong&gt; account through Google and get into the first guide, you will receive 30-days of studying any courses for free. Check out the link: &lt;a class=&#34;link&#34; href=&#34;https://www.qwiklabs.com/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://www.qwiklabs.com/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;figure 
	
		class=&#34;gallery-image&#34; 
		style=&#34;
			flex-grow: 141; 
			flex-basis: 339px&#34;
	&gt;
	&lt;a href=&#34;https://dungminhdao.github.io/p/mlops-courses-review/VertexAI.png&#34; data-size=&#34;2200x1554&#34;&gt;
		&lt;img src=&#34;https://dungminhdao.github.io/p/mlops-courses-review/VertexAI.png&#34;
			width=&#34;2200&#34;
			height=&#34;1554&#34;
			srcset=&#34;https://dungminhdao.github.io/p/mlops-courses-review/VertexAI_huc69181a8dfdd74eca5fe3f13ec43128c_513188_480x0_resize_box_3.png 480w, https://dungminhdao.github.io/p/mlops-courses-review/VertexAI_huc69181a8dfdd74eca5fe3f13ec43128c_513188_1024x0_resize_box_3.png 1024w&#34;
			loading=&#34;lazy&#34;
			&gt;
	&lt;/a&gt;
	
&lt;/figure&gt;&lt;/p&gt;
&lt;center&gt;&lt;b&gt;Figure 3&lt;/b&gt;: Vertex AI on GCP for end-to-end ML workflow (Course 4)&lt;/center&gt;
&lt;h2 id=&#34;drawback-or-things-that-this-program-needs-to-improve&#34;&gt;Drawback, or things that this program needs to improve&lt;/h2&gt;
&lt;p&gt;Unfortunately, this program requires basic knowledge in Deep Learning (e.g. completion of the Deep Learning Specialization) for comprehension of the recent concepts mentioned above, so it&amp;rsquo;s quite difficult for learners with knowledge in just traditional Machine Learning algorithms to understand many parts in these courses.&lt;/p&gt;
&lt;p&gt;Since the topic of the specialization is about MLOps, too much advanced or in-depth discussion on a specific state-of-the-art Machine Learning techniques can distract the learners from the main purpose.&lt;/p&gt;
&lt;p&gt;The hand-on labs provided are great in the knowledge provided; however, there aren&amp;rsquo;t much room for creativity and most of the time, learners just have to follow the instruction provided in the description in the notebooks or the guidelines in external labs to complete the graded exercises. This has 2 main disadvantages:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It is difficult to remember the knowledge provided if you just follow the instructions and not doing something for yourself. The course can be quite tedious sometimes.&lt;/li&gt;
&lt;li&gt;There are no project to complete for your own goods. Personally, I think that pushing projects you have done in the course to GitHub can help showing your ability and skill to recruiters a lot.&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&#34;udacity-ml-devops-nanodegree&#34;&gt;Udacity ML DevOps Nanodegree&lt;/h1&gt;
&lt;p&gt;This Nanodegree is also divided into 4 courses.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The first course helps developing skills that are necessary for production models, includes clean code, version control, testing and logging.&lt;/li&gt;
&lt;li&gt;The second course focuses on building a organized and reproducible end-to-end machine learning pipeline from scratch using MLFlow. Besides, experiments, codes and results are tracked using Github and Wandb (Weights and Biases)&lt;/li&gt;
&lt;li&gt;The third course teaches students about model deployment. Data Version Control (DVC) is used for data and models, and CI/CD workflow is built with Github Actions and Heroku.&lt;/li&gt;
&lt;li&gt;The final course is about automating all the stuffs mentioned above with DevOps process, including diagnose operational issues, as well as retraining and redeployment of models&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Videos are used for introducing new concepts to the learners in each course. After each concepts, there are questions and programming exercises (not counted toward the final course accomplishment) for students to reinforce their knowledge on the topic. Finally, after completing all the lessons, there is a final project for each course, which students have to complete and satisfy all the requirements in the rubric to get pass the project.&lt;/p&gt;
&lt;p&gt;&lt;figure 
	
		class=&#34;gallery-image&#34; 
		style=&#34;
			flex-grow: 177; 
			flex-basis: 426px&#34;
	&gt;
	&lt;a href=&#34;https://dungminhdao.github.io/p/mlops-courses-review/Wandb.png&#34; data-size=&#34;3840x2160&#34;&gt;
		&lt;img src=&#34;https://dungminhdao.github.io/p/mlops-courses-review/Wandb.png&#34;
			width=&#34;3840&#34;
			height=&#34;2160&#34;
			srcset=&#34;https://dungminhdao.github.io/p/mlops-courses-review/Wandb_hu345f21e14d72d063d4a8549e15f7819f_650713_480x0_resize_box_3.png 480w, https://dungminhdao.github.io/p/mlops-courses-review/Wandb_hu345f21e14d72d063d4a8549e15f7819f_650713_1024x0_resize_box_3.png 1024w&#34;
			loading=&#34;lazy&#34;
			&gt;
	&lt;/a&gt;
	
&lt;/figure&gt;&lt;/p&gt;
&lt;center&gt;&lt;b&gt;Figure 4&lt;/b&gt;: Experiments and model tracking using Wandb (second project, my implementation)&lt;/center&gt;
&lt;h2 id=&#34;benefit-of-taking-this-program-1&#34;&gt;Benefit of taking this program&lt;/h2&gt;
&lt;p&gt;First of all, this Nanodegree doesn&amp;rsquo;t require you to have knowledge in Deep Learning; in fact, all the model used in the courses are simple traditional Machine Learning models. This is a great way to introduce MLOps concepts without going too much into other sophisticated methods specific to handling data or models.&lt;/p&gt;
&lt;p&gt;There are also multiple technologies introduced in this program. However, compared to the Coursera&amp;rsquo;s technological stacks, the tools in this course are easier to learn and apply in practice. The deployment part using CI/CD is one of the most challenging but rewarding part that I have learned in doing the projects.&lt;/p&gt;
&lt;p&gt;I find this Nanodegree&amp;rsquo;s projects very exciting to complete. There are many requirements in the rubrics, but it still create many rooms for my own creativity and improvements. Since not everything is provided readily like in the Coursera MLOps&amp;rsquo; hand-on labs, I have the experience of implementing from scratch for some parts of the project, which strengthen my ability to use the tools and reinforce my understanding of the concepts and the whole system.&lt;/p&gt;
&lt;p&gt;Last but not least, the personalized assessment and suggestion for project submissions gives me lots of insight on how to improve my implementation and best practices in MLOps.&lt;/p&gt;
&lt;p&gt;&lt;figure 
	
		class=&#34;gallery-image&#34; 
		style=&#34;
			flex-grow: 176; 
			flex-basis: 424px&#34;
	&gt;
	&lt;a href=&#34;https://dungminhdao.github.io/p/mlops-courses-review/AttritionRiskAssesmentSystem.png&#34; data-size=&#34;1081x611&#34;&gt;
		&lt;img src=&#34;https://dungminhdao.github.io/p/mlops-courses-review/AttritionRiskAssesmentSystem.png&#34;
			width=&#34;1081&#34;
			height=&#34;611&#34;
			srcset=&#34;https://dungminhdao.github.io/p/mlops-courses-review/AttritionRiskAssesmentSystem_hudd3d2084a29b467c09e8e93093a72320_74489_480x0_resize_box_3.png 480w, https://dungminhdao.github.io/p/mlops-courses-review/AttritionRiskAssesmentSystem_hudd3d2084a29b467c09e8e93093a72320_74489_1024x0_resize_box_3.png 1024w&#34;
			loading=&#34;lazy&#34;
			&gt;
	&lt;/a&gt;
	
&lt;/figure&gt;&lt;/p&gt;
&lt;center&gt;&lt;b&gt;Figure 5&lt;/b&gt;: ML system that allows scheduled re-train, re-deploy, monitor, and report on the model (final project)&lt;/center&gt;
&lt;h2 id=&#34;drawback-or-things-that-this-program-needs-to-improve-1&#34;&gt;Drawback, or things that this program needs to improve&lt;/h2&gt;
&lt;p&gt;Compared to the DeepLearningAI&amp;rsquo;s specialization, this Nanodegree doesn&amp;rsquo;t have implementation of MLOps for Deep Learning models. This is a drawback, since the MLOps process benefit the most for that type of model - which require frequent training, fine-tuning, and deployment compared to traditional one.&lt;/p&gt;
&lt;p&gt;There are trade-off in introducing a number of different libraries and focusing on a specific tools. From my point of view, the concepts are presented in an organized manner, but it can still be a challenge for other learners to keep track of all the technologies used.&lt;/p&gt;
&lt;h1 id=&#34;summary-and-final-words&#34;&gt;Summary and final words&lt;/h1&gt;
&lt;p&gt;I found the 2 courses to be very comprehensive and contain interesting materials. These knowledge from the 2 courses can supplement each other very well, and I recommend taking both of these courses if possible. But for further recommendation:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If you do not have experience with Deep Learning beforehand, or you want to study the concept of MLOps without focusing too much on advanced details, the Udacity Nanodegree program is definitely the better choice.&lt;/li&gt;
&lt;li&gt;If you want to know the state-of-the-art techniques in AI - especially for Deep Learning models - and get used to the TensorFlow-related libraries and Google Cloud Platform, then the Coursera Specialization is the way to go.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;A special thanks to my mentor at FPT Software AI Center, Dr. Khuong Nguyen, for recommending me these courses. Studying these courses helps me a lot to become a better Data Scientest and AI Engineer/Researcher.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There are some images in the post, some are mine, some are from the Internet, and it’s free to use as in the LICENSE below. But I always leave credit here to support authors, and so do you if you want to use content in my article.&lt;/p&gt;
&lt;h1 id=&#34;references&#34;&gt;References&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Image sources:
&lt;ul&gt;
&lt;li&gt;Figure 1: &lt;a class=&#34;link&#34; href=&#34;https://developers.google.com/machine-learning/crash-course/production-ml-systems&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://developers.google.com/machine-learning/crash-course/production-ml-systems&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Figure 2: &lt;a class=&#34;link&#34; href=&#34;https://www.tensorflow.org/tfx/guide&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://www.tensorflow.org/tfx/guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Figure 3: &lt;a class=&#34;link&#34; href=&#34;https://cloud.google.com/blog/topics/developers-practitioners/use-vertex-pipelines-build-automl-classification-end-end-workflow&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://cloud.google.com/blog/topics/developers-practitioners/use-vertex-pipelines-build-automl-classification-end-end-workflow&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Reference courses:
&lt;ul&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://www.coursera.org/specializations/machine-learning-engineering-for-production-mlops&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Coursera Machine Learning Engineering for Production (MLOps) Specialization&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://www.udacity.com/course/machine-learning-dev-ops-engineer-nanodegree--nd0821&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Udacity Nanodegree in Machine Learning DevOps Engineer&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
</description>
        </item>
        <item>
        <title>Getting Used to GitHub, Eps. 3</title>
        <link>https://dungminhdao.github.io/p/getting-used-to-github-eps-3/</link>
        <pubDate>Wed, 04 May 2022 21:55:37 +0700</pubDate>
        
        <guid>https://dungminhdao.github.io/p/getting-used-to-github-eps-3/</guid>
        <description>&lt;img src="https://dungminhdao.github.io/p/getting-used-to-github-eps-3/merge.gif" alt="Featured image of post Getting Used to GitHub, Eps. 3" /&gt;&lt;p&gt;Hi again. This is Dung Dao Minh, vice president of SoICT Innovation Club, and in this third post of series &amp;ldquo;Github 101&amp;rdquo;, I will talk about some kind of scenarios that can happen when you work on multiple branches in your work repositories, or work in collaboration with a team on a project.&lt;/p&gt;
&lt;h1 id=&#34;first-words&#34;&gt;First words&lt;/h1&gt;
&lt;p&gt;In many cases, you (and your collaborators) create multiple branches for different purpose: creating features, bug fixing, code versioning,&amp;hellip; Most of the issues happen when you try to combine the code between those branches: you may realize that you still commit to the main branch while fixing bugs/adding features, another developer may add a little documentation on your code (which is great), or your evil coworker might mess up with your code and make it full of bugs. In short, there may be some modification on the branch you are trying to merge into, that you need to resolve to (happily) combine the two different commits.&lt;/p&gt;
&lt;p&gt;I will create (with additional references from other sources) some different scenarios here that represent the problem you might face when working on different branches, and make it easy to introduce some new definition, as well as some good practices when working with Git and Github&lt;/p&gt;
&lt;h1 id=&#34;scenario-1-working-on-new-feature-no-file-conflict-yet&#34;&gt;Scenario #1: Working on new feature (no file conflict yet)&lt;/h1&gt;
&lt;p&gt;Suppose that you are working on a project about real estate recommendation system, and you want to try using &lt;strong&gt;location&lt;/strong&gt; information for your system. In the middle of your work, your boss want you to focus 100% of your time on improving system based on &lt;strong&gt;demographic&lt;/strong&gt; information.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 1: assume that you are on the &lt;code&gt;develop&lt;/code&gt; branch. You should create a new branch &lt;code&gt;location&lt;/code&gt; for developing the new feature:&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Create and switch to new branch&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git checkout -b location
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Commit as you go &lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git commit -m &lt;span class=&#34;s2&#34;&gt;&amp;#34;add recommendation based on city&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Step 2: however, you boss want you to focus on &lt;code&gt;demographic&lt;/code&gt; features. You have not completed the &lt;code&gt;location&lt;/code&gt; feature yet&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Switch back to the develop branch&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git checkout develop
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Create and switch to `demographic` branch&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git checkout -b demographic
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Working on that branch and commit changes&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git commit -m &lt;span class=&#34;s2&#34;&gt;&amp;#34;finalized demographic-based recommendation&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Step 3: after you finish your work on &lt;code&gt;demographic&lt;/code&gt; feature, you can merge it to the &lt;code&gt;develop&lt;/code&gt; branch and push this to the remote &lt;code&gt;origin/develop&lt;/code&gt; branch (assuming that both &lt;code&gt;develop&lt;/code&gt; and &lt;code&gt;origin/develop&lt;/code&gt; have no additional commit in the mean time)&lt;/strong&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Switch back to the develop branch&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git checkout develop
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Merge the `demographic` branch into the `develop` branch&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git merge --no-ff demographic
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Push to the remote repository&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git push origin develop
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;quick-note-on-merge-fast-forward-vs-no-fast-forward&#34;&gt;Quick note on &lt;code&gt;merge&lt;/code&gt;: fast-forward vs. no fast-forward&lt;/h2&gt;
&lt;p&gt;You might see the &lt;code&gt;--no-ff&lt;/code&gt; (no fast-forward) in the step 3 above. The new demographic code seems to only add new code, without any modification.&lt;/p&gt;
&lt;p&gt;A picture is worth a thousand words:&lt;/p&gt;
&lt;p&gt;&lt;figure 
	
		class=&#34;gallery-image&#34; 
		style=&#34;
			flex-grow: 111; 
			flex-basis: 268px&#34;
	&gt;
	&lt;a href=&#34;https://dungminhdao.github.io/p/getting-used-to-github-eps-3/fast-forward.png&#34; data-size=&#34;463x414&#34;&gt;
		&lt;img src=&#34;https://dungminhdao.github.io/p/getting-used-to-github-eps-3/fast-forward.png&#34;
			width=&#34;463&#34;
			height=&#34;414&#34;
			srcset=&#34;https://dungminhdao.github.io/p/getting-used-to-github-eps-3/fast-forward_hu827ec79cdf04ac9ff920a800e8bee8db_40553_480x0_resize_box_3.png 480w, https://dungminhdao.github.io/p/getting-used-to-github-eps-3/fast-forward_hu827ec79cdf04ac9ff920a800e8bee8db_40553_1024x0_resize_box_3.png 1024w&#34;
			loading=&#34;lazy&#34;
			alt=&#34;Fast forward&#34;&gt;
	&lt;/a&gt;
	
	&lt;figcaption&gt;Fast forward&lt;/figcaption&gt;
	
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;--no-ff&lt;/code&gt; will create a new commit (with new id, but the file content is the same), while by default, &lt;code&gt;git merge&lt;/code&gt; will fast-forward - moving your branch pointer (in this case, at &lt;code&gt;develop&lt;/code&gt;) to point at the incoming commit (from &lt;code&gt;demographic&lt;/code&gt;).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; when you merge with &lt;code&gt;--no-ff&lt;/code&gt;, as a new commit is created, you might be asked to create message for that commit.&lt;/p&gt;
&lt;p&gt;In many cases, you want to prevent fast-forward from happening, because you want to maintain a specific branch &amp;ldquo;shape&amp;rdquo;, and someone (your manager) can read the history of changes that you made from creating the &lt;code&gt;demographic&lt;/code&gt; branch (instead of losing information when fast-forward)&lt;/p&gt;
&lt;p&gt;You can change you command or do some setups to merge with or without feed-forward:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Execute for once: add the `--ff-only`, or `--no-ff` flag&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Apply for both pull and merge (pull = fetch + merge)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git pull --ff-only
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git pull --no-ff
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Using git config to do it by default &lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# (git pull or git merge won&amp;#39;t need specific flag)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git config --add merge.ff &lt;span class=&#34;nb&#34;&gt;false&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git config --add merge.ff only
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h1 id=&#34;scenario-2-same-file-names-different-file-contents-on-different-branches-conflict&#34;&gt;Scenario #2: Same file names, different file contents on different branches (conflict)&lt;/h1&gt;
&lt;p&gt;You might wonder what&amp;rsquo;s the purpose of the &lt;code&gt;location&lt;/code&gt; branch created above. Now I will use it to demonstrate merge conflict.&lt;/p&gt;
&lt;p&gt;In a bad mood, you forgot that you create that &lt;code&gt;location&lt;/code&gt; branch for experimenting with location data, and you do some commit directly on the &lt;code&gt;develop&lt;/code&gt; branch to work with that data. Let review some of the recent commits you made (notice the &lt;code&gt;HEAD-&amp;gt;location&lt;/code&gt; (current branch) at commit f3b1b57 and the &lt;code&gt;develop&lt;/code&gt; branch at commit 9a5187c)&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;git log --graph --decorate --oneline --all

* 9a5187c (develop) add recommendation based on city in develop
*   1fe34c7 Merge branch &amp;#39;demographic&amp;#39; into develop
|\  
| * 0883fd7 (demographic) finalized demographic-based recommendation
|/  
| * f3b1b57 (HEAD -&amp;gt; location) add recommendation based on city
|/  
* b3a463a (origin/develop) Create develop branch
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;For simple demonstration purpose, here are the 2 versions of &lt;code&gt;location.txt&lt;/code&gt; on that 2 branches:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;# On `develop` branch
location file in develop

# On `location` branch
location file
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;some-ways-you-might-consider-to-resolve-the-conflict&#34;&gt;Some ways you might consider to resolve the conflict&lt;/h2&gt;
&lt;p&gt;When you realize the mistake, there are some cases here:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Case 1: You recognize that there are part of the features you develop from both branches would be useful, and you want to combine them together.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Run the command &lt;code&gt;git merge develop&lt;/code&gt; will create the following message:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Auto-merging location.txt
CONFLICT (add/add): Merge conflict in location.txt
Automatic merge failed; fix conflicts and then commit the result.
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This is inevitable, since the 2 files have different contents inside. Inside the &lt;code&gt;location.txt&lt;/code&gt; file, you can see that the content has been modified. The upper part is the line of the current commit pointed by &lt;code&gt;HEAD&lt;/code&gt; and the lower part is the&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; HEAD
location file
=======
location file in develop
&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; develop
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Check &lt;code&gt;git status&lt;/code&gt; for additional understanding:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;On branch location
You have unmerged paths.
...
Unmerged paths:
  (use &amp;#34;git add &amp;lt;file&amp;gt;...&amp;#34; to mark resolution)
        both added:      location.txt
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To resolve the problem, simply modify the &lt;code&gt;location.txt&lt;/code&gt; file as you wish (obviously, you don&amp;rsquo;t want those &amp;ldquo;&amp;laquo;&amp;lt;&amp;rdquo; or &amp;ldquo;===&amp;rdquo; characters anyway) and add it to the staging area, then create a new commit. Here I will modify the text into &lt;strong&gt;&amp;ldquo;location file after resolve conflict&amp;rdquo;&lt;/strong&gt;:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git add location.txt
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git status
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# On branch location&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# All conflicts fixed but you are still merging.&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# ...&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git commit -m &lt;span class=&#34;s2&#34;&gt;&amp;#34;resolve conflict in location feature&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git log --graph --decorate --oneline --all
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Now we see that the `location` branch has new commit&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;*   1f79c56 &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;location&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt; resolve conflict in location feature
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;se&#34;&gt;\ &lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; * 9a5187c &lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;HEAD -&amp;gt; develop&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt; add recommendation based on city in develop
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; *   1fe34c7 Merge branch &lt;span class=&#34;s1&#34;&gt;&amp;#39;demographic&amp;#39;&lt;/span&gt; into develop
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Case 2: You have done a far better work in the &lt;code&gt;develop&lt;/code&gt; branch, and you don&amp;rsquo;t need the same code on &lt;code&gt;location&lt;/code&gt; branch anymore. Or the other way around, you soon realize the mistake, and the &lt;code&gt;location&lt;/code&gt; branch has more valuable code&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The obvious solution is to use the code in &lt;code&gt;develop&lt;/code&gt; instead of that code on &lt;code&gt;location&lt;/code&gt;, or the other way around. You can use the approach in Case 1, observing that in some IDE, they support you with choosing the respective version you want. An example in VSCode (you can accept either change or both changes):&lt;/p&gt;
&lt;p&gt;&lt;figure 
	
		class=&#34;gallery-image&#34; 
		style=&#34;
			flex-grow: 416; 
			flex-basis: 998px&#34;
	&gt;
	&lt;a href=&#34;https://dungminhdao.github.io/p/getting-used-to-github-eps-3/conflict_vscode.png&#34; data-size=&#34;1040x250&#34;&gt;
		&lt;img src=&#34;https://dungminhdao.github.io/p/getting-used-to-github-eps-3/conflict_vscode.png&#34;
			width=&#34;1040&#34;
			height=&#34;250&#34;
			srcset=&#34;https://dungminhdao.github.io/p/getting-used-to-github-eps-3/conflict_vscode_hu25a6cb6d96d9a698a29d308a4461dbd3_47410_480x0_resize_box_3.png 480w, https://dungminhdao.github.io/p/getting-used-to-github-eps-3/conflict_vscode_hu25a6cb6d96d9a698a29d308a4461dbd3_47410_1024x0_resize_box_3.png 1024w&#34;
			loading=&#34;lazy&#34;
			alt=&#34;Conflict VSCode&#34;&gt;
	&lt;/a&gt;
	
	&lt;figcaption&gt;Conflict VSCode&lt;/figcaption&gt;
	
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;A quicker way is to use additional flags, in favor of one of the branch (&lt;code&gt;ours&lt;/code&gt; strategy refer to preference of the current branch, and &lt;code&gt;theirs&lt;/code&gt; is the preference of the incoming branch):&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git merge --strategy&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;ours develop
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git merge -X theirs develop
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; &lt;code&gt;-s&lt;/code&gt; or &lt;code&gt;--strategy&lt;/code&gt; completely ignore the other side, while &lt;code&gt;-X&lt;/code&gt; or &lt;code&gt;--strategy-option&lt;/code&gt; resolve any conflicts using the chosen side.&lt;/p&gt;
&lt;h2 id=&#34;additional-note-merge-vs-rebase-and-options-for-git-pull&#34;&gt;Additional note: &lt;code&gt;merge&lt;/code&gt; vs &lt;code&gt;rebase&lt;/code&gt;, and options for &lt;code&gt;git pull&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;Perhaps some animation is great here (acknowledgement to &lt;a class=&#34;link&#34; href=&#34;https://blog.developer.atlassian.com/pull-request-merge-strategies-the-great-debate/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Nicola Paolucci&amp;rsquo;s post&lt;/a&gt;  with the animations). Click on animated images to see how it works:
&lt;figure 
	
		class=&#34;gallery-image&#34; 
		style=&#34;
			flex-grow: 183; 
			flex-basis: 440px&#34;
	&gt;
	&lt;a href=&#34;https://dungminhdao.github.io/p/getting-used-to-github-eps-3/merge.gif&#34; data-size=&#34;883x481&#34;&gt;
		&lt;img src=&#34;https://dungminhdao.github.io/p/getting-used-to-github-eps-3/merge.gif&#34;
			width=&#34;883&#34;
			height=&#34;481&#34;
			srcset=&#34;https://dungminhdao.github.io/p/getting-used-to-github-eps-3/merge_hu6ae8c8c5fad9c14566ba268e2c0186cc_78697_480x0_resize_box.gif 480w, https://dungminhdao.github.io/p/getting-used-to-github-eps-3/merge_hu6ae8c8c5fad9c14566ba268e2c0186cc_78697_1024x0_resize_box.gif 1024w&#34;
			loading=&#34;lazy&#34;
			alt=&#34;Merge&#34;&gt;
	&lt;/a&gt;
	
	&lt;figcaption&gt;Merge&lt;/figcaption&gt;
	
&lt;/figure&gt;
&lt;figure 
	
		class=&#34;gallery-image&#34; 
		style=&#34;
			flex-grow: 183; 
			flex-basis: 440px&#34;
	&gt;
	&lt;a href=&#34;https://dungminhdao.github.io/p/getting-used-to-github-eps-3/rebase.gif&#34; data-size=&#34;883x481&#34;&gt;
		&lt;img src=&#34;https://dungminhdao.github.io/p/getting-used-to-github-eps-3/rebase.gif&#34;
			width=&#34;883&#34;
			height=&#34;481&#34;
			srcset=&#34;https://dungminhdao.github.io/p/getting-used-to-github-eps-3/rebase_hu80fbca7437410330302d7a8016dd5d26_69827_480x0_resize_box.gif 480w, https://dungminhdao.github.io/p/getting-used-to-github-eps-3/rebase_hu80fbca7437410330302d7a8016dd5d26_69827_1024x0_resize_box.gif 1024w&#34;
			loading=&#34;lazy&#34;
			alt=&#34;Rebase&#34;&gt;
	&lt;/a&gt;
	
	&lt;figcaption&gt;Rebase&lt;/figcaption&gt;
	
&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;You should use &lt;code&gt;git rebase&lt;/code&gt; when your changes do not &amp;ldquo;deserve&amp;rdquo; a separate branch for its own. All the commands with &lt;code&gt;merge&lt;/code&gt; above can also be done with &lt;code&gt;rebase&lt;/code&gt;; note that it has a different behaviour as in the animations&lt;/p&gt;
&lt;p&gt;When working with remote directories, if you want to rebase instead of merge after fetching changes, you can add &lt;code&gt;--rebase&lt;/code&gt; flag to the &lt;code&gt;pull&lt;/code&gt; command:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;git pull&lt;/code&gt; = &lt;code&gt;git fetch&lt;/code&gt; + &lt;code&gt;git merge&lt;/code&gt; against tracking upstream branch&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git pull --rebase&lt;/code&gt; = &lt;code&gt;git fetch&lt;/code&gt; + &lt;code&gt;git rebase&lt;/code&gt; against tracking upstream branch&lt;/li&gt;
&lt;/ul&gt;
&lt;h1 id=&#34;final-words&#34;&gt;Final words&lt;/h1&gt;
&lt;p&gt;The conflict in reality can be more complex, but in this episode, I have list the common cases you might face when you need to merge 2 branches together.&lt;/p&gt;
&lt;p&gt;There are some images in the post, some are mine, some are from the Internet, and it’s free to use as in the LICENSE below. But I always leave credit here to support authors, and so do you if you want to use content in my article.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A scenario from the Udacity&amp;rsquo;s Machine Learning DevOps Engineer helps me a lot in creating a bunch of scenarios above: &lt;a class=&#34;link&#34; href=&#34;https://www.udacity.com/course/machine-learning-dev-ops-engineer-nanodegree--nd0821&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://www.udacity.com/course/machine-learning-dev-ops-engineer-nanodegree--nd0821&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Answers on StackOverflow that help me with explanation (and images) in the process:
&lt;ul&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://stackoverflow.com/questions/9069061/what-effect-does-the-no-ff-flag-have-for-git-merge&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://stackoverflow.com/questions/9069061/what-effect-does-the-no-ff-flag-have-for-git-merge&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://stackoverflow.com/questions/18930527/difference-between-git-pull-and-git-pull-rebase&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://stackoverflow.com/questions/18930527/difference-between-git-pull-and-git-pull-rebase&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://stackoverflow.com/questions/173919/is-there-a-theirs-version-of-git-merge-s-ours&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://stackoverflow.com/questions/173919/is-there-a-theirs-version-of-git-merge-s-ours&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class=&#34;link&#34; href=&#34;https://stackoverflow.com/questions/2500296/can-i-make-fast-forwarding-be-off-by-default-in-git&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://stackoverflow.com/questions/2500296/can-i-make-fast-forwarding-be-off-by-default-in-git&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Amazing images and explanations from Nicola Paolucci&amp;rsquo;s blog post: &lt;a class=&#34;link&#34; href=&#34;https://blog.developer.atlassian.com/pull-request-merge-strategies-the-great-debate/&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;https://blog.developer.atlassian.com/pull-request-merge-strategies-the-great-debate/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        </item>
        
    </channel>
</rss>
