Quiz: Write Pythonic and Clean Code With namedtuple

Interactive Quiz ⋅ 11 QuestionsBy Martin Breuss In this quiz, you’ll test your understanding of Python’s namedtuple(). By working through this quiz, you’ll revisit how to create namedtuple classes, identify and take advantage of the cool features of namedtuple, use namedtuple instances to write Pythonic code, and decide when to use a namedtuple over a similar data structure. The quiz contains 11 questions and there is no time limit. You’ll get 1 point for each correct answer. At the end […]

Read more

Quiz: Python’s unittest: Writing Unit Tests for Your Code

Interactive Quiz ⋅ 12 QuestionsBy Leodanis Pozo Ramos In this quiz, you’ll test your understanding of testing your Python code with the unittest framework. Testing in Python is a huge topic and can come with a lot of complexity, but it doesn’t need to be hard. You can create simple tests for your application in a few easy steps and then build on them from there. With this quiz, you can check your understanding of testing with Python’s unittest framework. […]

Read more

Quiz: Python Sequences: A Comprehensive Guide

Interactive Quiz ⋅ 12 QuestionsBy Martin Breuss In this quiz, you’ll test your understanding of Python sequences. By working through this quiz, you’ll revisit the basic characteristics of a sequence, operations common to most sequences, special methods associated with sequences, and how to create user-defined mutable and immutable sequences. The quiz contains 12 questions and there is no time limit. You’ll get 1 point for each correct answer. At the end of the quiz, you’ll receive a total score. The […]

Read more

Quiz: What Is the __pycache__ Folder in Python?

Interactive Quiz ⋅ 13 QuestionsBy Bartosz Zaczyński As your Python project grows, you typically organize your code in modules and packages for easier maintenance and reusability. When you do that, you’ll likely notice the sudden emergence of a __pycache__ folder alongside your original files, popping up in various locations unexpectedly. The quiz contains 13 questions and there is no time limit. You’ll get 1 point for each correct answer. At the end of the quiz, you’ll receive a total score. […]

Read more

Inpainting and Outpainting with Stable Diffusion

Inpainting and outpainting have long been popular and well-studied image processing domains. Traditional approaches to these problems often relied on complex algorithms and deep learning techniques yet still gave inconsistent outputs. However, recent advancements in the form of Stable diffusion have reshaped these domains. Stable diffusion now offers enhanced efficacy in inpainting and outpainting while maintaining a remarkably lightweight nature. In this post, you will explore the concepts of inpainting and outpainting and see how you can do these with […]

Read more

4 Ways to Crop Image in Python using NumPy, Pillow and OpenCV

Introduction In image processing & computer vision, cropping of images is a common task where we keep a specific region of interest from an image and discard the rest. In this article, we will see various ways you can crop an image in Python by using libraries like OpenCV, Pillow, and NumPy. Input Image In this tutorial, we will use the below image in all the examples of cropping image with Python.   Visualizing the Cropping Area on Image Before […]

Read more

Fine-tune Llama 3 with ORPO

ORPO is a new exciting fine-tuning technique that combines the traditional supervised fine-tuning and preference alignment stages into a single process. This reduces the computational resources and time required for training. Moreover, empirical results demonstrate that ORPO outperforms other alignment methods on various model sizes and benchmarks. In this article, we will fine-tune the new Llama 3 8B model using ORPO with the TRL library. The code is available on Google Colab and in the LLM Course on GitHub. ⚖️ […]

Read more

Ideas: Exploring AI frontiers with Rafah Hosn

[MUSIC FADES]  My guest today is Rafah Hosn. She’s a partner, group product manager for AI Frontiers at Microsoft Research. I’d call Rafah a sort of organizational conductor, working both with leaders to drive clarity around the mission as well as program managers to make sure they have solid operational strategies to execute on it. Rafah has mad skills in bringing research ideas from lab to life, and I’m thrilled to talk to her today. Rafah Hosn, welcome to Ideas!  RAFAH HOSN: […]

Read more

What’s Lazy Evaluation in Python?

Interactive Quiz ⋅ 7 QuestionsBy Bartosz Zaczyński Lazy evaluation is a programming concept where the evaluation of an expression is deferred until its value is actually needed. This can lead to performance enhancements by avoiding unnecessary calculations, and it can also allow for the creation of potentially infinite data structures. As you embark on this quiz, you’ll test your knowledge of lazy evaluation in Python and learn how to apply this concept to write cleaner and more efficient code. The […]

Read more

Python Sequences: A Comprehensive Guide

Interactive Quiz ⋅ 12 QuestionsBy Martin Breuss In this quiz, you’ll test your understanding of Python sequences. By working through this quiz, you’ll revisit the basic characteristics of a sequence, operations common to most sequences, special methods associated with sequences, and how to create user-defined mutable and immutable sequences. The quiz contains 12 questions and there is no time limit. You’ll get 1 point for each correct answer. At the end of the quiz, you’ll receive a total score. The […]

Read more
1 2 3 4 905