<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://kad99kev.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://kad99kev.github.io/" rel="alternate" type="text/html" /><updated>2026-04-30T09:54:53+00:00</updated><id>https://kad99kev.github.io/feed.xml</id><title type="html">Kevlyn Kadamala</title><subtitle>Kevlyn Kadamala&apos;s academic portfolio</subtitle><author><name>Kevlyn Kadamala</name><email>kadamala.kevlyn@gmail.com</email></author><entry><title type="html">How you play games, is how you do everything</title><link href="https://kad99kev.github.io/posts/2024/06/how-you-do-things/" rel="alternate" type="text/html" title="How you play games, is how you do everything" /><published>2024-06-26T00:00:00+00:00</published><updated>2024-06-26T00:00:00+00:00</updated><id>https://kad99kev.github.io/posts/2024/06/how-you-do-things</id><content type="html" xml:base="https://kad99kev.github.io/posts/2024/06/how-you-do-things/"><![CDATA[<p><img src="/images/how-you-do-things/featured.jpg" alt="" /></p>

<p>I am a stealthy player. I avoid confrontation. But when I am confident, or bored, I do not mind going all guns blazing. I suffer from mild social anxiety. If I have a choice, I would choose to avoid most social events, but it does not mean that I do not enjoy or thrive when I do participate in them.</p>

<p>If I see an NPC, I help them. I do not like killing good people (or civilians) unnecessarily. I believe most people playing games follow this. I do not think that humans inherently want to harm other humans (or living creatures), even if it is a game. Unless of course, it is essential for their survival.</p>

<p>I like games where we work as a team. I enjoy games like EAFC24 (formerly known as FIFA), Ghost Recon or Brothers in Arms that put you in a squad, where you have to work together as a team to achieve victory. When I see NPCs fight the bad guys, I do not feel alone in my quest. If anything, I always take to time to help them with their struggle. I also yearn for the ability to control my own aqua and assign them tasks. I enjoy being the captain or group leader. I enjoy responsibility when I know it is rewarding. It is not to say that I do not enjoy games like Ghost of Tsushima, Death Stranding or Red Dead Redemption, but the feeling of battling the evils together, does not make the battle lonely.</p>

<p>I do not like overstimulating	, fast paced games like Fortnite or Call of Duty, but I do enjoy Battlefield when I crave it. It has a slightly more drawn out play style that suits me. In fact, when I do play Battlefield, I play as a sniper/scout, sitting and killing from afar while planting traps around objectives. This is a weird one, because sometimes I enjoy overstimulation but if it crosses a limit, I end up crawling into a shell and retreating for the rest of the night. I haven’t quite figured out that part of me yet.</p>

<p>I like games with a limit on exploration, as I can get bored if it is too exploration heavy. It is a genre of video games I wish I had the patience to enjoy. I liked No Man’s Sky, I like Death Stranding and Fallout 76, but the idea of exploring large regions, reading detailed notes for the plot and collected resources for building, does not suit me. I do know that I will enjoy these games, if I work on my patience and calm.</p>

<p>My approach to game completion is somewhat unusual. When I notice that I am close to completing the game, when it is the last mission, I stop. I abandon it. It could be because I refuse to move on. It could be because I am afraid of getting too close to the end. I still remember when I finished The Last of Us on the PS3, I was heartbroken, empty, wondering what do I do now, now that it is over? I do not know if I ever completed any other game since. I left Days Gone on its last mission. I left Red Dead Redemption 2 as I was close to the end. I even left Cyberpunk 2077 before I could begin the last mission. So while I strive to complete a game, I also avoid completing it.</p>

<p>This train of thought was inspired by the YouTuber doozy speaks, with his video titled - <a href="https://youtu.be/6Ke2vQsjh8I?si=f0M7hsdoNBvLi_aN">How you play games, is how you do everything</a>. After listening to his introspective video essay on his play style, I decided to roughly jot down my own play style. Patterns of behaviour, whether in small or large consequential circumstances, define the principles that govern your life. Who would have thunk?</p>

<p>I forgot to mention, I often pick up games again after dropping them initially, much like this thought. I can easily get distracted by a new game, a new book, a new hobby, a new experience or a new thought, only for me to go back to the comfort or feeling I had previously, and thus, the cycle repeats.</p>]]></content><author><name>Kevlyn Kadamala</name><email>kadamala.kevlyn@gmail.com</email></author><category term="life" /><summary type="html"><![CDATA[This train of thought was inspired by the YouTuber doozy speaks, with his video titled - [How you play games, is how you do everything](https://youtu.be/6Ke2vQsjh8I?si=f0M7hsdoNBvLi_aN). After listening to his introspective video essay on his play style, I decided to roughly jot down my own play style. Patterns of behaviour, whether in small or large consequential circumstances, define the principles that govern your life. Who would have thunk?]]></summary></entry><entry><title type="html">Life/Luck Abroad</title><link href="https://kad99kev.github.io/posts/2022/09/life-abroad/" rel="alternate" type="text/html" title="Life/Luck Abroad" /><published>2022-09-21T00:00:00+00:00</published><updated>2022-09-21T00:00:00+00:00</updated><id>https://kad99kev.github.io/posts/2022/09/life-abroad</id><content type="html" xml:base="https://kad99kev.github.io/posts/2022/09/life-abroad/"><![CDATA[<p>On the 6th of September 2022, I completed a year in Ireland. A year that feels almost a moment ago. Many memories made, and most certainly happy ones. I consider myself very lucky to be where I am. While I believe in hard work, I never underestimate the role that luck has played in my journey so far.</p>

<p>The National University of Ireland, Galway (now University of Galway) was my first choice of university. It also happened to be the only university out of all the universities that I applied to, to accept me. While my visa was being processed, I was looking for accommodation; and I had no idea how to search or apply for any accommodation - only applying to a few student accommodations. But, two weeks before I was bound to leave, <a href="https://www.menloparkgalway.com/student-accommodation">Menlo Park Apartments</a> offered me a room. I didn’t care what type of room it was, I was happy to accept it. I got my visa one day before my flight (livin’ on the edge) and I reached Dublin only to realise that two of my checked-in suitcases had been held back in Frankfurt. Luckily, I still had my cabin bag with some emergency supplies stacked, thanks to some good foresight from my father. I then settled into my new house, and things went pretty smooth from there.</p>

<p>Now I didn’t know to cook food before I came here. I was lucky enough to have my mother (who would pick the phone regardless of the time) and my housemates, who I now call friends, to help me cook. So we’d meal plan, shop groceries together and then cook together. Eventually, I learnt to cook! I was also lucky enough to have a housemate who supports Arsenal. So we’d watch games together and suffer together. We all shared similar taste in movies and music which led to movie nights and jam sessions when cleaning around the house.</p>

<p>I enjoyed the course and most importantly I enjoyed the workload. It wasn’t too overbearing nor was it too boring. I had enough time for myself while being happy about the amount of work I put in for the day. The professors at the university are good in nature and good at their work. I was lucky enough to interact with some of them and build some good working relationships.</p>

<p>When I preparing for my Master’s, I was not sure if I wanted a job or if I wanted to pursue a PhD. One thing I did know was that I wanted to get into research - but I felt that I was being picky for someone with no prior work experience. So in search of jobs, I attended a job fair. After interacting with a few senior engineers and managers, who all told me my resume was good, I was pretty happy with myself. I applied on all the websites and portals that they advised me to - only to not hear back from any of them. Well luckily, I met a professor who shared the same interests as me and was willing to take me on as a PhD student.</p>

<p>So after one year, I’ve learnt to cook, I’ve made friends, I’ve grown to be independent, I’ve been in situations way outside my comfort zone, I’ve become a PhD student and most importantly - I’ve lived. Finally, I consider myself very lucky to have my girlfriend. For without her suggestion, this wouldn’t have been possible in the first place.</p>

<p><img src="/images/life-abroad/featured.jpeg" alt="" /></p>]]></content><author><name>Kevlyn Kadamala</name><email>kadamala.kevlyn@gmail.com</email></author><category term="life" /><summary type="html"><![CDATA[A year has passed since I've moved to Ireland. In this article, I share the life/luck I've had so far.]]></summary></entry><entry><title type="html">An Introduction to Algorithmic Bias</title><link href="https://kad99kev.github.io/posts/2022/01/intro-to-algo-bias/" rel="alternate" type="text/html" title="An Introduction to Algorithmic Bias" /><published>2022-01-06T00:00:00+00:00</published><updated>2022-01-06T00:00:00+00:00</updated><id>https://kad99kev.github.io/posts/2022/01/algorithmic-bias</id><content type="html" xml:base="https://kad99kev.github.io/posts/2022/01/intro-to-algo-bias/"><![CDATA[<p>Humans write algorithms and code that run on data collected from the real world. Together, they may mimic or exaggerate any preexisting bias. This is what we call Algorithmic Bias. We could try to avoid collecting data that segregate people based on their gender, race or religion. But, they may still materialize as correlated features. For example, purchasing records could correlate to gender and zip codes could correlate to race. Bias could also arise due to the lack of relevant data. For example, in the famous dataset - “Labeled Faces in the Wild” <a href="#1">[1]</a> 83.5% of images are of white people <a href="#2">[2]</a>. It also contains a limited number of children, no babies, very few adults above the age of 80, and a small proportion of women. It also states that several ethnicities have very little or no representation at all. The creators of the LFW dataset mention that the dataset is not meant for commercial applications. But are companies active in trying to identify any pre-existing biases in their datasets? Are they aware of how their algorithms interact with society? Algorithmic systems shape our lives, influencing our opportunities in employment, education and finance. The data that we unknowingly provide them with often fuel these systems. This has been the source of the flame that has destroyed so many innocent lives.</p>

<p>In 2016, ProPublica published its analysis of COMPAS (Correctional Offender Management Profiling for Alternative Sanctions). This was an algorithm that not only assesses the risk of committing a crime in the future but also around two dozen so-called “criminogenic needs”. It ranks the defendants either as low, medium or high risk in each category <a href="#3">[3]</a>. The algorithm predicted that blacks are twice as likely as whites to be labelled a higher risk and not re-offend. But it would make the opposite mistake among whites. They were more likely labelled to be lower risk but go on and commit more crimes.</p>

<figure>
<img src="/images/algorithmic-bias/black-defendant.png" id="fig:black" alt="Black Defendants’ Risk Scores" /><figcaption style="text-align: center" aria-hidden="true">Black Defendants’ Risk Scores</figcaption>
</figure>

<figure>
<img src="/images/algorithmic-bias/white-defendant.png" id="fig:white" alt="White Defendants’ Risk Scores" /><figcaption style="text-align: center" aria-hidden="true">White Defendants’ Risk Scores</figcaption>
</figure>

<p>In 2018, researchers conducted a study with Convolution Neural Networks (CNN). It detected potentially cancerous skin lesions better than the study group that included 58 dermatologists. Yet, the data used to train the CNN came from fair-skinned populations in the US, Australia and Europe. As a result, people of colour could either be misdiagnosed with nonexistent skin cancers or they could be completely missed <a href="#4">[4]</a>. In 2019, Facebook was sued for letting advertisers target their ads based on race, gender and religion. It included postings for preschool teachers and secretaries which they showed to a higher fraction of women. And, they showed postings for janitors and taxi drivers to a higher proportion of minorities. White users were shown more ads on home sales, while minorities were shown ads for rentals <a href="#5">[5]</a>. The way these systems are established, create a positive feedback loop. Every incorrect prediction, every false sentencing and every targeted advertisement adds another data point to the already biased system.</p>

<figure>
<img src="/images/algorithmic-bias/bmj.jpg" id="fig:white" alt="White Defendants’ Risk Scores" /><figcaption style="text-align: center" aria-hidden="true">The cascading effect of AI.
<br />
Image source: The British Medical Journal <a href="#6">[6]</a></figcaption>
</figure>

<p>The first step that we as developers can take is understanding our responsibility. A study was conducted in 2019 where one on one interviews were conducted with around 35 ML practitioners. Most of the interviewees reported that their teams do not have any protocols in place to support the collection and curation of a balanced or representative dataset. Often these teams do not discover serious fairness issues until they receive customer feedback <a href="#7">[7]</a>. A biased society often leads to a biased AI, and programmers are merely a part of society. This same AI that we use so often, is developed by human programmers. Hence, we must recognize our own biases to avoid incorporating them into the AI systems that we develop. So, how can we combat algorithmic bias? There has been a lot of discussion around the power of open source and its communities. We could find great potential in its technologies and methodologies in the fight against algorithmic bias. We have AI research labs from companies like Google (Google Brain) and Facebook (Facebook AI Research) working on open-sourced Deep Learning libraries like Tensorflow and PyTorch respectively. These libraries along with Scikit-learn, SciPy, spaCy etc. already dominate modern AI. Open source is not only effective in software, but also for curating large datasets. We have platforms like Kaggle and CodaLab where individuals, organisations or companies publish their datasets to obtain a community-sourced solution. This also enables and encourages discourse on any existing bias. Openness will lead to awareness. It would only educate those unaware of algorithmic bias and help them understand its implications.</p>

<figure>
<img src="/images/algorithmic-bias/datasets.png" id="fig:white" alt="White Defendants’ Risk Scores" /><figcaption style="text-align: center" aria-hidden="true">Some publicly available dataset sources.
<br />
Image source: Great Learning <a href="#8">[8]</a></figcaption>
</figure>

<p>We have to recognize that issues regarding algorithmic fairness usually cannot be foreseen or detected before launch <a href="#9">[9]</a>. It often includes hindsight, and though wonderful, we need to identify any existing biases before causing any catastrophic damage. There might not be one solution that solves all problems. But the important point to keep in mind is that we will have problems to solve. There have been communities established for fairness, accountability and transparency (FAT ML <a href="#10">[10]</a>). Tools are being developed to help us understand our data better (Know Your Data <a href="#11">[11]</a>). Important metrics are being included to evaluate fairness and mitigate any bias in trained models (AllenNLP <a href="#12">[12]</a>, <a href="#13">[13]</a> and Fairlearn <a href="#14">[14]</a>). These steps are necessary to ensure that we incorporate equity into our AI systems to prevent it from amplifying inequalities.</p>

<p>While we all strive for equality, equity, fairness, justice, sometimes, it is not enough. Sometimes we need to be biased to ensure a level playing field for everyone. For example, the selective public schools of New York. A New York Times article released an article titled, “Only 7 Black Students Got Into Stuyvesant, N.Y.’s Most Selective High School, Out of 895 Spots,”. Eight of the nine specialized high schools require applicants to undergo the Specialized High Schools Admissions Test (SHSAT). The main problem is not that Black and Hispanic students neglect to give the SHSAT, even though they comprise the majority of students taking the test, they are disproportionately denied admission into these specialized schools. Another fact of the matter is that despite applying to these schools and taking entrance exams, children of colour do not attend middle schools that funnel students into specialized schools <a href="#15">[15]</a>. Here is another article that explains how racism affects children of colour in public schools <a href="#16">[16]</a>.</p>

<p>Many questions arise from this unfortunate situation. Could we find another way to fight this bias by working on an “anti-bias algorithm”? Could an algorithm be trained on biased data, where it manages to identify and disregard the bias? While these are hypotheticals, one thing is certain is that if we have to integrate AI into society, we have to keep algorithmic fairness in mind. But while algorithms and data is one thing, addressing social and political themes are another problem that we as a society have to solve.</p>

<h2 id="references">References</h2>

<p><a name="1"></a>[1] G. B. Huang, M. Ramesh, T. Berg, and E. Learned-Miller, “Labeled Faces in the Wild: A Database for Studying Face Recognition in Unconstrained Environments,” Tech. Rep. 07-49, University of Massachusetts, Amherst, October 2007.</p>

<p><a name="2"></a>[2] “Why Racial Bias is Prevalent in Facial Recognition Technology.” <a target="_blank" href="http://jolt.law.harvard.edu/digest/why-racial-bias-is-prevalent-in-facial-recognition-technology">http://jolt.law.harvard.edu/digest/why-racial-bias-is-prevalent-in-facial-recognition-technology</a>. Accessed: 20th December 2021.</p>

<p><a name="3"></a>[3] “Machine Bias.” <a target="_blank" href="https://www.propublica.org/article/machine-bias-risk-assessments-in-criminal-sentencing">https://www.propublica.org/article/machine-bias-risk-assessments-in-criminal-sentencing</a>. Accessed: 20th December 2021.</p>

<p><a name="4"></a>[4] A. Lashbrook, “AI-Driven Dermatology Could Leave Dark-Skinned Patients Be-
hind.” <a target="_blank" href="https://www.theatlantic.com/health/archive/2018/08/machine-learning-dermatology-skin-color/567619/">https://www.theatlantic.com/health/archive/2018/08/machine-learning-dermatology-skin-color/567619/</a>, Aug 2018. Accessed: 20th December 2021.</p>

<p><a name="5"></a>[5] “Facebook’s ad-serving algorithm discriminates by gender and race.” <a target="_blank" href="https://www.technologyreview.com/2019/04/05/1175/facebook-algorithm-discriminates-ai-bias/">https://www.technologyreview.com/2019/04/05/1175/facebook-algorithm-discriminates-ai-bias/</a>. Accessed: 20th December 2021.</p>

<p><a name="6"></a>[6] D. Leslie, A. Mazumder, A. Peppin, M. K. Wolters, and A. Hagerty, “Does “AI” stand for augmenting inequality in the era of covid-19 healthcare?,” BMJ, vol. 372, p. n304, March 2021.</p>

<p><a name="7"></a>[7] K. Holstein, J. Wortman Vaughan, H. Daumé, M. Dudik, and H. Wallach, “Improving Fairness in Machine Learning Systems: What Do Industry Practitioners Need?,” in Proceedings of the 2019 CHI Conference on Human Factors in Computing Systems, p. 1–16, ACM, May 2019.</p>

<p><a name="8"></a>[8] “Great Learning.” <a target="_blank" href="https://www.mygreatlearning.com/blog/sources-for-analytics-and-machine-learning-datasets/">https://www.mygreatlearning.com/blog/sources-for-analytics-and-machine-learning-datasets/</a>. Accessed: 5th January 2022.</p>

<p><a name="9"></a>[9] A. Woodruff, “10 things you should know about algorithmic fairness,” Interactions, vol. 26, p. 47–51, Jun 2019.</p>

<p><a name="10"></a>[10] “Fairness, Accountability, and Transparency in Machine Learning.” <a target="_blank" href="https://www.fatml.org/">https://www.fatml.org/</a>. Accessed: 4th January 2022.</p>

<p><a name="11"></a>[11] T. P. t. Google, “Know Your Data.” <a target="_blank" href="https://knowyourdata.withgoogle.com">https://knowyourdata.withgoogle.com</a>. Accessed: 4th January 2022.</p>

<p><a name="12"></a>[12] “Fairness and Bias Mitigation · A Guide to Natural Language Processing With AllenNLP.” <a target="_blank" href="https://guide.allennlp.org/fairness/">https://guide.allennlp.org/fairness/</a>. Accessed: 4th January 2022.</p>

<p><a name="13"></a>[13] “Fairness Metrics Allen NLP Documentation.” <a target="_blank" href="https://docs.allennlp.org/main/api/fairness/fairness_metrics/">https://docs.allennlp.org/main/api/fairness/fairness_metrics/</a>. Accessed: 4th January 2022.</p>

<p><a name="14"></a>[14] “Fairlearn.” <a target="_blank" href="https://fairlearn.org/">https://fairlearn.org/</a>. Accessed: 4th January 2022.</p>

<p><a name="15"></a>[15] “Why New York City’s Selective Public High Schools Are Neglecting to Reflect the City’s Actual Diversity.” <a target="_blank" href="https://raceandschools.barnard.edu/selectivehighschools/rita-2/">https://raceandschools.barnard.edu/selectivehighschools/rita-2/</a>. Accessed: 4th January 2022.</p>

<p><a name="16"></a>[16] “How Racism Affects Children of Color in Public Schools.” <a target="_blank" href="https://www.thoughtco.com/how-racism-affects-public-school-minorities-4025361">https://www.thoughtco.com/how-racism-affects-public-school-minorities-4025361</a>. Accessed: 4th January 2022.</p>

<p><a name="17"></a>[17] V. Warmerdam, “koaning.io: Naive Bias<a name="2"></a>[tm] and Fairness Tooling.” <a target="_blank" href="https://koaning.io/posts/just-another-dangerous-situation/">https://koaning.io/posts/just-another-dangerous-situation/</a>, 2021.</p>

<p><a name="18"></a>[18] CrashCourse, “Algorithmic Bias and Fairness: Crash Course AI #18.” <a target="_blank" href="https://www.youtube.com/watch?v=gV0_raKR2UQ">https://www.youtube.com/watch?v=gV0_raKR2UQ</a>, 2019. Accessed: 20th December 2021.</p>

<p><a name="19"></a>[19] V. Eubanks, “The Digital Poorhouse: Embracing habit in an automated world,” Harper’s Magazine, vol. January 2018, Jan 2018. Accessed: 20th December 2021.</p>

<p><a name="20"></a>[20] J. Sherman, “AI and machine learning bias has dangerous implications.” <a target="_blank" href="https://opensource.com/article/18/1/how-open-source-can-fight-algorithmic-bias">https://opensource.com/article/18/1/how-open-source-can-fight-algorithmic-bias</a>. Accessed: 20th December 2021.</p>

<p><a name="21"></a>[21] “Bias in machine learning: How to measure fairness in algorithms?” <a target="_blank" href="https://www.trilateralresearch.com/bias-in-machine-learning-how-to-measure-fairness-in-algorithms/">https://www.trilateralresearch.com/bias-in-machine-learning-how-to-measure-fairness-in-algorithms/</a>. Accessed: 4th January 2022.</p>

<div style="text-align: center; margin-top: 2rem">
Photo by <a href="https://unsplash.com/@markusspiske?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Markus Spiske</a> on <a href="https://unsplash.com/s/photos/algorithm?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a>
</div>]]></content><author><name>Kevlyn Kadamala</name><email>kadamala.kevlyn@gmail.com</email></author><category term="ethics" /><category term="ai" /><summary type="html"><![CDATA[A blog post that I wrote for my AI and Ethics module during my Master's.]]></summary></entry><entry><title type="html">Deep Learning on the Apple Silicon</title><link href="https://kad99kev.github.io/posts/2021/07/training-on-the-m1/" rel="alternate" type="text/html" title="Deep Learning on the Apple Silicon" /><published>2021-07-22T00:00:00+00:00</published><updated>2021-07-22T00:00:00+00:00</updated><id>https://kad99kev.github.io/posts/2021/07/training-on-the-m1</id><content type="html" xml:base="https://kad99kev.github.io/posts/2021/07/training-on-the-m1/"><![CDATA[<p>At the end of last year, I decided to switch my Mac 2013 for the latest Mac Mini with the Apple Silicon. This meant that initially some of the packages that supported the x86 chip could not natively run on the M1 chip. But what I was looking forward to the most was setting up TensorFlow and PyTorch onto my conda environment.</p>

<p>In this article, I will be walking you through my setup procedure, train a MobileNet model and compare the results (using Weights and Biases) from my other devices.</p>

<p>You will find the code and all its requirements in my GitHub repository here - <a href="https://github.com/kad99kev/TFonMac">TFonMac</a></p>

<h2 id="table-of-contents">Table of Contents</h2>

<ol>
  <li><a href="#1-setting-up">Setting Up</a></li>
  <li><a href="#2-training-a-model">Training a Model</a></li>
  <li><a href="#3-observations">Observations</a></li>
  <li><a href="#4-conclusion">Conclusion</a></li>
</ol>

<h2 id="1-setting-up">1. Setting Up</h2>

<h3 id="step-1-downloading-miniforge-creating-a-virtual-environment">Step 1: Downloading Miniforge (Creating a virtual environment)</h3>

<p>My entire setup procedure will be from the perspective of using the Apple Silicon. I highly recommend using a virtual environment for this. I use Miniforge. You can download the same <a href="https://github.com/conda-forge/miniforge">here</a>. Make sure you download the installer for arm64 (<code class="language-plaintext highlighter-rouge">Miniforge3-MacOSX-arm64</code>).</p>

<p>Once you have your environment ready, activate it using <code class="language-plaintext highlighter-rouge">conda activate &lt;env-name&gt;</code>.</p>

<h3 id="step-2-cloning-the-repository">Step 2: Cloning the Repository</h3>

<p>Then clone the repository using git - <code class="language-plaintext highlighter-rouge">git clone https://github.com/kad99kev/TFonMac.git</code></p>

<h3 id="step-3-downloading-the-requirements">Step 3: Downloading the Requirements</h3>

<p>Once the repository is cloned, run - <code class="language-plaintext highlighter-rouge">pip install -r m1-requirements.txt</code></p>

<p>Now just in case NumPy throws an error, you can install it directly with conda using - <code class="language-plaintext highlighter-rouge">conda install numpy</code></p>

<p>It took away this error that I was getting while trying to install it via pip.</p>

<p>We will be using TensorFlow Datasets to download the Cifar-10 dataset. The URL links are releases from TensorFlow that contain “Mac-optimised TensorFlow and TensorFlow Addons”. The link for that is <a href="https://github.com/apple/tensorflow_macos">here</a>. The repository is currently archived as TensorFlow v2.5  provides accelerated training with Metal (you can find more here), and it only works with macOS 12.0+</p>

<p>For people with Big Sur (like me), there would be no problem installing these libraries. However, on execution TensorFlow, would throw an error. Hence, I had to revert to the URLs that I linked above. I am interested in trying this method again once I have the Monterrey update. Once I do, I will write an updated article and compare the results from this experiment to the new one.</p>

<h2 id="2-training-a-model">2. Training a Model</h2>

<p>To compare the runtime, performance and GPU/CPU utilisation of the different devices, I followed the training script and procedures from <a href="https://wandb.ai/vanpelt/m1-benchmark/reports/Can-Apple-s-M1-help-you-train-models-faster-cheaper-than-NVIDIA-s-V100---VmlldzozNTkyMzg">this article</a>. The author provided a Google Colaboratory notebook. I converted this into Python scripts which makes it easier to use later if required.</p>

<p>Understanding the structure of the repository will help you tweak your experiment; if you want to try it, I will explain the repository structure below</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>project
│   main.py (Run this to run the experiment)
│   config.py (Configure parameters for your experiment)
│
└───utils
    │   info.py (Retreives information about the hardware and the model)
    │   preprocess.py (Image preprocessing functions)
    │   train.py (Main training loop)

</code></pre></div></div>

<p>In case you want to switch to GPU/CPU mode for the M1 chip, you can find it in <code class="language-plaintext highlighter-rouge">utils/info.py</code> and set <code class="language-plaintext highlighter-rouge">mlcompute.set_mlc_device(device_name="...")</code> to <code class="language-plaintext highlighter-rouge">"gpu"</code>, <code class="language-plaintext highlighter-rouge">"cpu"</code> or <code class="language-plaintext highlighter-rouge">"any"</code></p>

<p>Once <code class="language-plaintext highlighter-rouge">main.py</code> is executed, training should start. The model, metrics and performance data will automatically get logged with Weights and Biases (you might need to log in if you are a new user).</p>

<h2 id="3-observations">3. Observations</h2>

<p>You can find my training dashboard <a href="https://wandb.ai/kad99kev/m1-benchmark">here</a>.</p>

<p>I have tracked five runs in total, three on the Mac Mini (under the <code class="language-plaintext highlighter-rouge">gpu/cpu/any</code> setting), one on my Macbook Air and one with Google Colaboratory.</p>

<h3 id="training-curves">Training Curves</h3>

<p>The training curves for the Mac Mini are pretty similar, while the training curves on the Macbook and Google Colaboratory share patterns. The difference, however, lies in validation. The Mac Mini under the cpu and any settings show low validation accuracy, validation top k accuracy and a high validation loss. I have no idea why we observe this behaviour, and if you do, please reach out to me! The Mac Mini under the <code class="language-plaintext highlighter-rouge">gpu</code> setting shows improvement along with the Macbook Air and Google Colaboratory, with the validation loss slightly decreasing and the validation accuracy along with the top k accuracy much higher than previously observed.</p>

<h3 id="gpucpu-utilisation">GPU/CPU Utilisation</h3>

<p>From the charts, it is evident that the Mac Mini under the <code class="language-plaintext highlighter-rouge">gpu</code> setting utilises the GPU for around 90% of the time. Under the same settings, it utilises the CPU for ~15% of the time. What I do find weird (or maybe it’s expected?) is the amount of CPU and GPU being utilised under the <code class="language-plaintext highlighter-rouge">cpu</code> and <code class="language-plaintext highlighter-rouge">any</code> setting. I was expecting the <code class="language-plaintext highlighter-rouge">gpu</code> to train the fastest, but it took around 35m 29s for its execution to complete. Meanwhile using <code class="language-plaintext highlighter-rouge">cpu</code> took 31m 18s and <code class="language-plaintext highlighter-rouge">any</code> took almost the same amount of time (31m 22s).</p>

<h2 id="4-conclusion">4. Conclusion</h2>

<p>It was honestly my first time playing around with hardware settings, so I am not quite sure about most of the reasons behind what I observed. However, I am excited to experiment more, and I am eagerly waiting for <a href="https://developer.apple.com/metal/tensorflow-plugin/">TensorFlow v2.5 with Metal</a>. Once it is available to me, I will experiment again to look for any change in speed and performance. Until then, take care and stay safe! 😄</p>

<h2 id="references">References</h2>

<ol>
  <li><a href="https://caffeinedev.medium.com/how-to-install-tensorflow-on-m1-mac-8e9b91d93706">How To Install TensorFlow on M1 Mac (The Easy Way)</a></li>
  <li><a href="https://wandb.ai/vanpelt/m1-benchmark/reports/Can-Apple-s-M1-help-you-train-models-faster-cheaper-than-NVIDIA-s-V100---VmlldzozNTkyMzg">Can Apple’s M1 help you train models faster &amp; cheaper than NVIDIA’s V100?</a></li>
  <li><a href="https://developer.apple.com/metal/tensorflow-plugin/">Getting Started with tensorflow-metal PluggableDevice</a></li>
  <li><a href="https://stackoverflow.com/questions/67167886/make-tensorflow-use-the-gpu-on-an-arm-mac">A useful thread on stackoverflow</a></li>
</ol>]]></content><author><name>Kevlyn Kadamala</name><email>kadamala.kevlyn@gmail.com</email></author><category term="ai" /><summary type="html"><![CDATA[This article will walk you through the setup procedure, training and logging on an Apple Silicon device.]]></summary></entry><entry><title type="html">My Journey with Artificial Intelligence</title><link href="https://kad99kev.github.io/posts/2021/07/my-journey-with-ai/" rel="alternate" type="text/html" title="My Journey with Artificial Intelligence" /><published>2021-07-09T00:00:00+00:00</published><updated>2021-07-09T00:00:00+00:00</updated><id>https://kad99kev.github.io/posts/2021/07/my-journey-with-ai</id><content type="html" xml:base="https://kad99kev.github.io/posts/2021/07/my-journey-with-ai/"><![CDATA[<p>TL;DR - Try to make it as easy and fun as possible at the start. Once you get the hang of it, start challenging yourself. Exploring different domains is vital and once you find your niche, delve in deeper.</p>

<h3 id="table-of-contents-head-on-below-to-your-topic-of-interest-d">Table of Contents (Head on below to your topic of interest :D)</h3>

<ol>
  <li><a href="#my-first-introduction-to-ai">My First Introduction to AI</a></li>
  <li><a href="#my-first-proper-introduction-to-machine-learning">My First Proper Introduction to Machine Learning</a></li>
  <li><a href="#what-came-next">What Came Next?</a></li>
  <li><a href="#the-mistakes-ive-made">The Mistakes I’ve Made</a></li>
  <li><a href="#what-am-i-doing-now">What Am I Doing Now?</a></li>
</ol>

<h2 id="my-first-introduction-to-ai">My First Introduction to AI</h2>

<p>My first ever introduction to AI was through video games. The earliest game that I can remember playing was <a href="https://www.youtube.com/channel/UC-2UZImFFmsoK5dD-uvU_hg">Need for Speed: Porsche Unleashed</a>. Since being a kid (and even now), I’ve always been fascinated with the use of AI in games. While I know the use of AI in game development is different from fields like Data Science, Data Analytics etc. I have to acknowledge that without video games, I probably wouldn’t even be interested in computers! So +1 to video games because without them, I probably wouldn’t even be here.</p>

<h2 id="my-first-proper-introduction-to-machine-learning">My First Proper Introduction to Machine Learning</h2>

<p>It was during my Second Year of Engineering when we had something known as <em>Project-Based Learning</em>. Simply put - We choose a domain we would like to study, build a project and submit that project for grading. Some of the popular topics back then were Mobile Development and Web Development. I was honestly hesitant about what I should take. But after speaking to my father, he recommended selecting Machine Learning. Shortly after the domains got finalized, I worked on my first Machine Learning project (you can find it here). It also happened to be my first ever Python project.</p>

<h2 id="what-came-next">What Came Next?</h2>

<p>Summer vacations are more projects. These projects happened to be my first time working with JavaScript. It was around that time when I came across <a href="https://www.youtube.com/user/shiffman">The Coding Train</a>. His book <a href="https://natureofcode.com/book/">The Nature of Code</a> and his videos on <a href="https://p5js.org/">p5.js</a>, <a href="https://www.youtube.com/watch?v=c8gZguZWYik&amp;list=PLRqwX-V7Uu6bw4n02JP28QDuUdNi3EXxJ">Genetic Algorithms</a>, <a href="https://en.wikipedia.org/wiki/Neuroevolution_of_augmenting_topologies">NEAT</a> and <a href="https://js.tensorflow.org/api/latest/">Tensorflow.js</a> kept me busy throughout the summer. I don’t think there was a point where I needed to find motivation. I was enjoying the processing of learning and building. Later, I started participating in AI hackathons (they usually covered the domain of Computer Vision or Natural Language Processing) where I could test my skills against other talented developers. Participating in hackathons not only helped me technically, but I’ve become better and more confident at speaking and presenting. Looking back to my first hackathon, there has been a huge change in my speaking style and self-confidence. I always recommend developers to participate in hackathons irrespective of their background.</p>

<h2 id="the-mistakes-ive-made">The Mistakes I’ve Made</h2>

<p>In my Third Year of Engineering, things were getting a bit intense. It was a classic example of <em>The more you know, the more you don’t know</em> for me. Here a some of the mistakes I’ve made:</p>

<ol>
  <li>Not trusting my data: When you are responsible for curating data, you know best about to its strengths and weaknesses. I once cost my team a top 3 finish because I was eager to improve my model’s performance by combining the data I collected with another source. After the results, I realized that the model that got us through the qualifiers performed better because it trained <strong>only</strong> on my data. By combining it with an outside source that I did not curate, I effectively degraded the performance of our model. Safe to say, I stuck by this principle and won a hackathon when I had to make a similar decision months later.</li>
  <li>Not asking for help: I’ve always shied away from asking for help which is probably one of the biggest mistakes I’ve made (and maybe still do!). There is nothing wrong with asking someone to help you out. Feedback and criticism will only help you to become better. It also works the other way around, when someone approaches you for help, be humble about it and understand where they are coming from. Everyone was a beginner at one point in time. Help others just the way you would like others to help you.</li>
  <li>Kicking myself for being slow: Taking your time to learn a concept is vital. It is better to take time and fortify your knowledge rather than developing a project with concepts you still aren’t sure of. Giving yourself enough time to understand a concept will open up different ideas and perspectives that may improve the quality of your work.</li>
  <li>Not giving up: Yes, it is alright to give up <strong>but</strong> it is important to return later. There have been times where I’ve spent hours on a problem just to come back the next day and solve it within seconds. Sometimes things don’t seem to work out at the moment. The best thing you can do then is to move on. The most difficult of problems are sometimes easy with a fresh and clear mind.</li>
</ol>

<h2 id="what-am-i-doing-now">What Am I Doing Now?</h2>

<p>Last month (10th June 2021) I completed my final year of engineering. We also presented our <a href="https://github.com/kad99kev/FGTD">work</a> at the <a href="http://icicct.org/2021/index.html">5th International Conference on Inventive Communication and Computational Technologies</a>. I now spend my time reading <a href="https://www.amazon.in/Deep-Learning-Scratch-Building-Principles/dp/935213902X">Deep Learning from Scratch: Building with Python from First Principles</a> by Seth Weidman while also participating in a few Kaggle competitions now and then. I plan to write a few technical articles soon alongside a few side projects that I have in mind. I plan to continue this exploration and to find new things to learn and apply. It is not possible to know everything about AI, so you might as well take it at your own pace and enjoy while you learn :D</p>]]></content><author><name>Kevlyn Kadamala</name><email>kadamala.kevlyn@gmail.com</email></author><category term="life" /><category term="ai" /><summary type="html"><![CDATA[I summarise my journey with AI so far.]]></summary></entry><entry><title type="html">My Experience as the Captain of the Football Team</title><link href="https://kad99kev.github.io/posts/2021/06/experience-as-captain/" rel="alternate" type="text/html" title="My Experience as the Captain of the Football Team" /><published>2021-06-14T00:00:00+00:00</published><updated>2021-06-14T00:00:00+00:00</updated><id>https://kad99kev.github.io/posts/2021/06/experience-as-captain</id><content type="html" xml:base="https://kad99kev.github.io/posts/2021/06/experience-as-captain/"><![CDATA[<p><img src="/images/experience-as-captain/featured.png" alt="" /></p>

<p>If I had to sum up my experience as the captain of my college football team into a single word, it’d be - <strong><em>Grateful</em></strong></p>

<p>It wasn’t an easy start for me. Most of it was because of the confidence (or lack thereof) in myself. I doubted my ability as a football player and as a leader. I was afraid of being a failure. It was a big responsibility and the last thing I would want to do is lose the respect of my players.</p>

<p>But this is where my players taught me a lesson. A lesson of friendship and trust. When I was in my Second Year of Engineering, I was new to the team. I hardly ever spoke. I was shy, introverted and I honestly never made an effort to get to know my teammates better. I knew I couldn’t continue this way as a leader. A leader cannot be disconnected from his team, so I knew something had to change.</p>

<p>So, I tried to be more engaging, I would mostly follow the lead of my Vice Captain - Erhard, and shadow him. Erhard was undoubtedly the most experienced and one of the best players in the team. So, I knew I’d learn from him. Slowly, slowly things were changing. I felt connected to the team, something I hadn’t felt before, and this was all because I made an effort. I made an effort to do more than just say Hellos and Goodbyes before and after every practice or game. That’s when I started to realize my players were an amazing bunch of human beings. There was mutual respect all around. There was fun when there needed to be fun and there was discipline when discipline was demanded.</p>

<p>The start of my first season as a captain wasn’t smooth sailing. With a relatively new team and lack of experience, we struggled to get results. Soon, I fell sick. As soon as I recovered from the fever, I played a tournament with the team, I got blurry vision and had to sit the final minutes out, missing the opportunity to take penalties. We drew 3-3 in normal time and then got knocked out on penalties. A month later, I was diagnosed with episodic asthma, which meant I couldn’t exert myself until I recovered. Words wouldn’t be able to describe the amount of disappointment I felt. But throughout this period, I never expected the amount of support I would receive from my team. They constantly asked me how I was doing and how soon it would be before I played again. All this support made me want to support them even more. I would make sure I never missed a single practice, even though it meant straining myself a bit. I wanted to be there for the team because they made sure that they were there for me.</p>

<p>Results were up and down at the time. We were playing well but few silly mistakes were costing us, but deep down knew that we could achieve something as a team. I was recovering well, I couldn’t wait to get back onto the pitch with the team. I was towards the end of my recovery process when we participated in “Athlos”. Most of the team was there, those who were playing and those who weren’t. There was this feeling in the squad - that no matter who we picked, everyone would back each other up. Though we lost that day, there were encouraging signs.</p>

<p>Nothing, however, would triumph the memories we made at the tournament hosted by the KJ Somaiya Medical College. This was the toughest test we ever faced. In our first match itself, we had to dig our way out from being 2-1 down to win 3-2. It was tough for me, I was still feeling the side effects of my medication but with the help of some amazing play from our forwards, we managed to turn it around. What followed from there were some of the toughest three matches with some of our strongest plays. We drew one and won two from those three matches, putting us into the finals. It was our first ever finals, I could feel the nervous energy amongst the team. For me, it was a record I wanted to break. Before this match, I had already lost two finals as the captain of my class’s football team. So I was determined to win this. I will never forget the moment when Austin headed home the winning goal right in front of me. It was a dream come true. What made me happiest the most, however, was the constant support from the playing as well as the non-playing players. I don’t think we would have gone all the way without their support. This was undoubtedly one of my fondest memories as the captain.</p>

<p>Soon after this, COVID struck, our practices and games had to come to a halt. It was disappointing, we had good momentum and we certainly could have achieved more that season. However, this entire season had to be spent under lockdown. We were lucky enough to get together at few turf sessions and even conducted a practice session for the freshers. But it still nothing consistent. I won’t let this dampen the spirit though, the football team has been in constant touch which is something I am delighted about.</p>

<p>I am also happy that I can leave this wonderful team in the safe hands of Kaustubh (the new captain), Clafacio and Lance (the vice-captains). I know that they are the right set of minds and feet to take the team to next level.</p>

<p>I am grateful to Stafford (my captain), to Erhard (our vice-captain and coach) and the entire team, for allowing me to lead, to learn, to have fun and most importantly, to grow.</p>]]></content><author><name>Kevlyn Kadamala</name><email>kadamala.kevlyn@gmail.com</email></author><category term="life" /><summary type="html"><![CDATA[In this blog post, I write about my experience being the captain of the football team.]]></summary></entry><entry><title type="html">Getting into Habits</title><link href="https://kad99kev.github.io/posts/2021/05/getting-into-habits/" rel="alternate" type="text/html" title="Getting into Habits" /><published>2021-05-05T00:00:00+00:00</published><updated>2021-05-05T00:00:00+00:00</updated><id>https://kad99kev.github.io/posts/2021/05/getting-into-habits</id><content type="html" xml:base="https://kad99kev.github.io/posts/2021/05/getting-into-habits/"><![CDATA[<p>I started with the habit of reading. It was more of a new year’s resolution. It was difficult at first, trying to read everyday. My plan initially was to read atleast one chapter a day. I knew I wouldn’t be able to maintain this habit, but I was really really determined to complete atleast one book a month. It’s May now, and I think my determination paid off. I’ve so far read <em>The Little Prince by Antoine de Saint-Exupéry</em> in January, <em>Animal Farm by George Orwell</em> in February, <em>Rich Dad Poor Dad by Robert Kiyosaki</em> in March and <em>Storm in a Teacup by Helen Czerski</em> in April. Currently, my book for May is <em>Atomic Habits by James Clear</em> and I must say, it is a book I am enjoying a lot. It has really helped me plan my habits better.</p>

<p>For instance, another resolution that I planned for this year was to learn more languages, something I haven’t found quite success in yet. After reading his advice on “Habit Stacking”, I decided to stack my reading and language learning “habit” <em>(I call this a habit, because it is a habit I want to develop)</em> with my habit of always drinking tea from between 5 to 6 pm in the evening. Now I know this will work because I unintentionally developed the habit of watering my plants as soon as I finish my breakfast in the morning. I earlier used to set reminders on all my devices to water my plants at 3pm in the afternoon <em>(weird time I know)</em> but after some advice from my girlfriend, I started watering them in the morning, which resulted with me automatically developing this habit.</p>

<p>Today, the 5th of May 2021, I planned to do push-ups and pull-ups everyday before I have a shower in evening. I plan to develop this habit, and I am really curious to see how this works out. I’ve considered the environment and the timing, so it’s going to be an experiment that’s really fascinating.</p>]]></content><author><name>Kevlyn Kadamala</name><email>kadamala.kevlyn@gmail.com</email></author><category term="life" /><summary type="html"><![CDATA[I write about how I plan to get into habits.]]></summary></entry></feed>