- Hustle Hub
- Posts
- Hustle Hub #22
Hustle Hub #22
š How to Debug Errors in Python, Give Updates Early, & More
New to Hustle Hub? Make sure to subscribe for more!
Read Time: 4.5 minutes
Hey friends,
I attended an AWS meetup last week about how to train Large Language Models (LLM) using distributed training. Given the current hype in ChatGPT, have you ever wondered how you could train an LLM from scratch?
𤯠The sharing was absolutely mind-blowing. I learned so much about the state of the art in distributed training for large models. In short, here are the 3 main ways you can use distributed training to train deep learning models (i.e. LLM) in AWS:
Data Parallelism: Use AWSās network infrastructure to train models by partitioning data into multiple GPUs / instances.
Model Parallelism: Partition a large model into multiple instances to solve memory limitations in a single instance.
Tensor Parallelism: Partition individual weights of a model into multiple instances.
This meetup made me realise how cloud computing makes the training of deep learning models accessible to the general public like us ā the future of AI is bright.
Okay. Enough of me talking about distributed training. š
In today's issue, Iād like to share with you how to debug errors in Python, why you should give updates early at work, and my favourite machine learning book.
Letās get to it! š
š What's in the hub today?
Tip: How to debug errors in Python
Mistake: I was afraid to give updates when I needed more time
Learning: Give updates early and frequently
Book: An Introduction to Statistical Learning
Tool: Canva Create
āļø 1 Tip
How to Debug Errors in Python

Me debugging when the bug is looking at me š
Debugging is part of the process when youāre analysing data. In fact, debugging may consume most of your time if youāre constantly stuck in errors. So here are my steps for debugging:

A typical Python error in Jupyter Notebook
Donāt panic, donāt stress, donāt cry. Just relax. š§š»āāļø
Go to the last error and read the line with the error message. It usually shows the source of the error.
Understand the error type.
Resolve the bug.
š Techniques of Debugging (4 Rules):
Rule 1: For large programs, use
print
statement to print out intermediate outputs to check the codes.Stop and test your work often as you go by printing out the intermediate outputs.
Rule 2: Understand what kind of error you are facing, and google for potential solutions.
For most errors that you will face, chances are others might have faced the same errors and solved them. You just have to google for potential solutions!
Usually, stackoverflow should have the answer you need!
Rule 3: Check the documentation.
When youāre not familiar with a Pythonās library, itās important to check the documentation to make sure you used the right methods and parameters.
Rule 4: Take a break.
Sometimes the best way to debug is by taking a break. When your brain is exhausted, starting at your code in frustration doesnāt help.
Iād go for a walk, exercise, take a shower, or just do nothing to relax. When Iām back to the code again, suddenly I know how to debug the error. Give it a try next time ā highly recommended.
š BONUS: Use ChatGPT.
Copy and paste your error in ChatGPT, give it some context, explain the error youāre facing, and ask it to fix it.
š§ How do you debug errors in Python? Let me know by replying to this email!
ā ļø 1 Mistake
When I was at Micron, I was afraid to give updates to my manager when I needed more time.
Because I didnāt want my manager to think that I couldnāt deliver on time. I only wanted to give updates after I had completed the task.
Guess what happened next?
I avoided my managerās emails and messages and just replied that I was still working on the task.
Bad move. š¤¦š»āāļø
š§ 1 Learning
While itās important to know your timeline to complete a task, itās common that we tend to underestimate the time we need in finishing a task.
In my opinion, itās okay to say that you need more time to complete a task. Or perhaps you might need help in certain areas. You just have to tell your manager to manage expectations and make sure everyone is aligned.
This will help your manager to trust you more if you give updates about the status more frequently than waiting for them to check on you.
š§ Hereās what Iāve learned:
Give updates early and frequently to your manager or colleagues.
Donāt pretend that you know everything or have everything in control. Be open to sharing your progress and seek help from others if needed.
Even better, share with your manager what youāre struggling with. The main role of a manager is to help you remove roadblocks. Donāt suffer alone. Seek support.
šļø 1 Book
Whenever people asked me how I learned machine learning in my early days, I always pointed them to this book ā An Introduction to Statistical Learning. This is like a bible to understanding the fundamentals of machine learning without getting too technical.
Think of this book like the Machine Learning course taught by Andrew Ng ā but in a written format.
If youāre new to machine learning, Iād highly recommend giving this book a read. You can get it for free HERE.
šļø Here are my takeaways from the book:
The crucial role statistical learning plays in solving real-world problems and how it is used in various fields such as business, finance, medicine, and more.
Understanding the fundamentals of statistical learning, including the bias-variance tradeoff, overfitting, regularization, and cross-validation.
Overview and practical implementation of popular statistical learning techniques such as linear regression, logistic regression, decision trees, support vector machines, clustering, and how to implement them using real-world datasets.
š§ Have you read this book? What's your thought on it?
š§° 1 Tool
If youāre not a designer, Iām sure youāve at least heard of or used Canva for your work.
Personally, Canva has been my life saviour to help me design logos, social media content, LinkedInās Carousel, YouTube thumbnails and many more! šŖ
⦠and finally the launch of Canva Create.
Itās so powerful that I canāt help but share it with you. Itās basically a graphic design platform ā powered by AI.
Canva will soon offer a range of new AI tools through this program.
These features will make creating content way easier for those without professional experience.
For example, Canva's Visual Worksuite will provide tools to help power all your visual communication needs. Here are some features you can use:
Magic Replace: upload an image, select a style, and let Canva visualize a design for you
Magic Edit: use text prompts to edit images
Translate: āspeak your audienceās languageā
Beat Sync: automatically sync audio and video
Magic Write: give Canva some text and itāll give you anything from a blog post to social captions
š§ Are you currently using Canva for your work? How would you intend to use Canva Createās features?
š Whenever youāre ready, there are 4 ways I can help you:
Book a coaching call with me if you need help in the following:
⢠How To Get Into Data Science
⢠LinkedIn Growth, Content Strategy & Personal Branding
⢠1:1 Mentorship & Career Guidance
⢠Resume Review
Promote your brand to ~1000 subscribers in the data/tech space by sponsoring this newsletter.
Watch my YouTube videos where I talk about data science tips, programming, and my tech life (P.S. Donāt forget to like and subscribe š).
Follow me on LinkedIn and Twitter for more data science career insights, my mistakes and lessons learned from building a startup.
That's all for today
Thanks for reading. I hope you enjoyed today's issue. More than that, I hope it has helped you in some ways and brought you some peace of mind.
You can always write to me by simply replying to this newsletter and we can chat.
See you again next week.
- Admond

Reply