<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ashish Salunkhe</title>
    <description>The latest articles on DEV Community by Ashish Salunkhe (@ashishsalunkhe).</description>
    <link>https://dev.to/ashishsalunkhe</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%2F502536%2F39ab2318-f079-4762-9a7d-d58aad34a2b4.jpg</url>
      <title>DEV Community: Ashish Salunkhe</title>
      <link>https://dev.to/ashishsalunkhe</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ashishsalunkhe"/>
    <language>en</language>
    <item>
      <title>Code Practices every developer can follow!</title>
      <dc:creator>Ashish Salunkhe</dc:creator>
      <pubDate>Wed, 06 Oct 2021 19:46:06 +0000</pubDate>
      <link>https://dev.to/ashishsalunkhe/code-practices-every-developer-can-follow-11k5</link>
      <guid>https://dev.to/ashishsalunkhe/code-practices-every-developer-can-follow-11k5</guid>
      <description>&lt;h1&gt;
  
  
  Coding the right way!
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;You always feel difficulty understanding what doctors write, right? &lt;/li&gt;
&lt;li&gt;Ever found a code on the internet but found it difficult to understand? &lt;/li&gt;
&lt;/ul&gt;




&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Exception Handling&lt;/em&gt;&lt;/strong&gt; : Code in a defensive manner. Always consider the worst case scenario. Think about input failures, event handling exceptions. This would help keep a track of possible bugs and catch the exceptions.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F8fz8h2ijapwetttndq9f.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F8fz8h2ijapwetttndq9f.jpg" alt="Alt Text" width="800" height="493"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Enhance code readability&lt;/em&gt;&lt;/strong&gt; : Writing highly optimized code and creating complex libraries is easy but consider junior developer trying to understand 300 lines of code. Which more of a challenge than learning. Code which is clean and modular reflects maturity, competency and professionalism of the developer. A code logically structured into modules and functions is always more readable, effecient and reusable. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Minimize the memory footprint&lt;/em&gt;&lt;/strong&gt; : Simple yet significant coding habits can change the performance of your final product. Memory management involves ways programmer / developer dynamically allocates memory to code when requested and frees it for reuse when not needed. Here are a few good blogs I came accross: 

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.codeproject.com/Articles/13853/Secure-Coding-Best-Practices-for-Memory-Allocation" rel="noopener noreferrer"&gt;Secure Coding Best Practices for Memory Allocation in C and C++&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://towardsdatascience.com/memory-management-in-python-6bea0c8aecc9" rel="noopener noreferrer"&gt;Memory Management in Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.geekboots.com/story/best-practice-of-memory-management-in-programming" rel="noopener noreferrer"&gt;Best practice of memory management in programming&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;em&gt;Refactor your code&lt;/em&gt;&lt;/strong&gt; : Restructuring your existing code without changing it's functionality. Aggregate groups of functions doing similar tasks into a single function, use of abstraction, deduplication of code and polymorphism.

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://refactoring.guru/refactoring" rel="noopener noreferrer"&gt;Refactoring Guru&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F9u85gc41smlu2yl67eob.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F9u85gc41smlu2yl67eob.jpg" alt="Alt Text" width="707" height="695"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Version Control&lt;/em&gt;&lt;/strong&gt; : Tracking all changes and synchronization of codes, bug-resolve, managing changes to source codeover time. Basic, niche practice every developer should master. Git, GitHub, Gitlab, Mercurial are tools used for version control.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.atlassian.com/git/tutorials/what-is-version-control" rel="noopener noreferrer"&gt;What is version control?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Code Testing&lt;/em&gt;&lt;/strong&gt; : Isn't it nice when someone praises us after we dress up with a good outfit? Testing practices act just like that validation we need when code the functionalities of any software. It guides and shapes the development process of the software. Unit tests, code coverage and other testing techniques help maintain modular structure and good quality end-product.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;KISS-DRY-YAGNI&lt;/em&gt;&lt;/strong&gt; : &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;“Keep It Simple, Silly” - keep your code as concise as possible &lt;/li&gt;
&lt;li&gt;"Don’t Repeat Yourself" - reducing repetition and redundancies &lt;/li&gt;
&lt;li&gt;"You aren't gonna need it" - Don't try to think far ahead in future and 
add complex bits of code features. You don't need it, you ain't gonna need it!&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;




</description>
    </item>
    <item>
      <title>Machine Learning meets DevOps: MLOps</title>
      <dc:creator>Ashish Salunkhe</dc:creator>
      <pubDate>Wed, 06 Oct 2021 18:15:43 +0000</pubDate>
      <link>https://dev.to/ashishsalunkhe/machine-learning-meets-devops-mlops-4g9n</link>
      <guid>https://dev.to/ashishsalunkhe/machine-learning-meets-devops-mlops-4g9n</guid>
      <description>&lt;h1&gt;
  
  
  Production ML Systems
&lt;/h1&gt;

&lt;p&gt;There's a lot more to machine learning. Implementation of an ML algorithm is just the tip of the iceberg. Machine learning systems are a part of a much larger ecosystem. Creating a well-performing machine learning model is just a small aspect of real-world machine learning solutions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fm9ralgaf6y69w4xht8xd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fm9ralgaf6y69w4xht8xd.png" alt="mlsystems" width="800" height="528"&gt;&lt;/a&gt;&lt;br&gt;
Image Source: &lt;a href="https://developers.google.com/machine-learning/crash-course/production-ml-systems" rel="noopener noreferrer"&gt;ML Crash Course by Google&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Scenario and the Challenge
&lt;/h3&gt;

&lt;p&gt;Let's say you are on the verge of signing the first customer for your startup. Your start-up has an amazing team of ML Engineers, Data Analysts, Data Scientists. They have been successful in creating state-of-the-art models with unprecedented results and metrics. &lt;/p&gt;

&lt;p&gt;The real problem here that arises is its deployment at the production level. In the &lt;a href="https://info.algorithmia.com/hubfs/2019/Whitepapers/The-State-of-Enterprise-ML-2020/Algorithmia_2020_State_of_Enterprise_ML.pdf?utm_campaign=The%20Batch&amp;amp;utm_source=hs_email&amp;amp;utm_medium=email&amp;amp;_hsenc=p2ANqtz-8dfpb_B2Fa0nNTtRa6cO2tl5CysdXFLGpPo6KYPnp5gFRXGXy8TLlKoGcIXlVFsUTb1E_s" rel="noopener noreferrer"&gt;2020 State of Enterprise Report&lt;/a&gt;, based on a survey of nearly 750 domain experts and practitioners in Machine Learning, had the following conclusions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;There was an increase in spending on AI by more than 2/3rds of the subgroups that were interviewed about their budget.&lt;/li&gt;
&lt;li&gt;43% of respondents cited difficulty in scaling their ML projects as to 30% in the previous year.&lt;/li&gt;
&lt;li&gt;Half of the respondents deploy their systems between a week and 3 months, while 18 percent require more than 3 months.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Machine Learning is evolving swiftly, growing into new sectors and industries yet building projects at scale is difficult. This marks a huge gap between models generated through scripts, notebooks, and their deployment in a production system at scale. &lt;/p&gt;
&lt;h3&gt;
  
  
  Traditional Software Engineering approaches v/s MLOps Trade-off
&lt;/h3&gt;

&lt;p&gt;As MLOps corresponds to DevOps for ML, there are challenges needed to be addressed.&lt;/p&gt;

&lt;p&gt;As highlighted by Arnab Bose, and Aditya Aggarwal in their &lt;a href="https://www.kdnuggets.com/2020/12/mlops-why-required-what-is.html" rel="noopener noreferrer"&gt;blog&lt;/a&gt;, an example of such challenge is the role of data. There are two different Software paradigms involved in traditional software engineering and machine learning - software developers have well-defined logic and code for their software programs whereas data scientists follow a parameterized problem-solving coding approach. These parameters depend on data which vary with changes in data thus altering the entire code behavior. Therefore, another aspect of data and its irregular variation causes difficulties in tracking a well-defined software.&lt;/p&gt;

&lt;p&gt;List of challenges that make it difficult to deploy ML models to production:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data Management

&lt;ul&gt;
&lt;li&gt;Huge Datasets&lt;/li&gt;
&lt;li&gt;Dataset Tracking&lt;/li&gt;
&lt;li&gt;Data Privacy&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Trial and Error and Iterative Development

&lt;ul&gt;
&lt;li&gt;Tracking changes: Hyper-parameter tuning, code changes, architecture changes&lt;/li&gt;
&lt;li&gt;Code Quality: Production-ready code, code optimizations&lt;/li&gt;
&lt;li&gt;Model Evaluation&lt;/li&gt;
&lt;li&gt;Training, Inference, and Retraining&lt;/li&gt;
&lt;li&gt;Testing&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Production Deployment

&lt;ul&gt;
&lt;li&gt;Monitoring&lt;/li&gt;
&lt;li&gt;Cloud / On-premise - batch and real-time predictions&lt;/li&gt;
&lt;li&gt;Infrastructure Requirements&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Security&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Shout out to &lt;a href="https://twitter.com/karpathy" rel="noopener noreferrer"&gt;Andrej Karpathy&lt;/a&gt; for the wonderful blog emphasizing Software 2.0 and the ongoing transition into the 2.0 stack.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__link"&gt;
  &lt;a href="https://medium.com/@karpathy/software-2-0-a64152b37c35" class="ltag__link__link" rel="noopener noreferrer"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fv2%2Fresize%3Afill%3A88%3A88%2F0%2A8ldFdx9B6FhSkQmV.jpeg" alt="Andrej Karpathy"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://medium.com/@karpathy/software-2-0-a64152b37c35" class="ltag__link__link" rel="noopener noreferrer"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Software 2.0. I sometimes see people refer to neural… | by Andrej Karpathy | Medium&lt;/h2&gt;
      &lt;h3&gt;Andrej Karpathy ・ &lt;time&gt;Mar 13, 2021&lt;/time&gt; ・ 
      &lt;div class="ltag__link__servicename"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fmedium-f709f79cf29704f9f4c2a83f950b2964e95007a3e311b77f686915c71574fef2.svg" alt="Medium Logo"&gt;
        Medium
      &lt;/div&gt;
    &lt;/h3&gt;
&lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;h4&gt;
  
  
  How does an MLOps Life Cycle look like?
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Data Engineering and Management&lt;/li&gt;
&lt;li&gt;Training / Modeling (Machine Learning Pipeline)&lt;/li&gt;
&lt;li&gt;Continuous Deployment&lt;/li&gt;
&lt;li&gt;Monitoring&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;At first, one needs to define a business problem and translate it into objectives that can be addressed through machine learning solutions. &lt;br&gt;
Second, there should be a focus on collaboration between data engineers and data scientists to explore, create and manage dataset(s) for modeling.&lt;br&gt;
Third, designing a pipeline comprising of operations like Model Training, Model Evaluation, Model Testing, and Model Packaging to be integrated with CI/CD for experimentation, tracking, validation, and testing.&lt;br&gt;
Fourth, seamless deployment into production server - cloud, on-premise, or hybrid.&lt;br&gt;
Finally, monitoring both model and computing resources (infrastructure) and their management. Key Performance Indicators (KPIs) help monitor the changes. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fujx0p6369qtmp1ex2snk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fujx0p6369qtmp1ex2snk.png" alt="mlops" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thus, the aim is to provide an end-to-end machine learning pipeline for designing, building and managing reproduciable ML Software alongside test-driven development.&lt;/p&gt;

&lt;p&gt;Co-author: &lt;a class="mentioned-user" href="https://dev.to/sonishreyas"&gt;@sonishreyas&lt;/a&gt; &lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>mlops</category>
      <category>devops</category>
      <category>python</category>
    </item>
  </channel>
</rss>
