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

Managing Multiple Python Versions With pyenv

Interactive Quiz ⋅ 9 QuestionsBy Martin Breuss In this quiz, you’ll test your understanding of how to use pyenv to manage multiple versions of Python. You’ll revisit how to install multiple versions of Python and switch between the installed versions. The quiz contains 9 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 maximum score is 100%. Good luck! « Browse All […]

Read more

Practical Prompt Engineering

Interactive Quiz ⋅ 13 QuestionsBy Martin Breuss In this quiz, you’ll test your understanding of Practical Prompt Engineering for large language models (LLMs). By working through this quiz, you’ll revisit how to work with OpenAI’s GPT-3.5 and GPT-4 models through their API, apply prompt engineering techniques to a practical, real-world example, and use strategies like numbered steps, delimiters, few-shot prompting, chain-of-thought prompting, and roles in messages to improve your results. The quiz contains 13 questions and there is no time […]

Read more

Supercharge Your Classes With Python super()

Interactive Quiz ⋅ 5 QuestionsBy Martin Breuss In this quiz, you’ll test your understanding of inheritance and the super() function in Python. By working through this quiz, you’ll revisit the concept of inheritance, multiple inheritance, and how the super() function works in both single and multiple inheritance scenarios. The quiz contains 5 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 maximum […]

Read more

Format Floats Within F-Strings

Interactive Quiz ⋅ 6 QuestionsBy Bartosz Zaczyński In this quiz, you’ll test your understanding of How to Format Floats Within F-Strings in Python. You’ll often need to format and round a Python float to display the results of your calculations neatly within strings. While there are several ways to format numbers in Python, formatted string literals or f-strings are usually the most frequent choice in modern Python programs. Knowing how to use f-strings effectively can make your code more readable […]

Read more

Affine Transformation in OpenCV with cv2.warpAffine()

Introduction In this article, we will learn how to perform the affine transformation on images using the OpenCV cv2.warpAffine() function. First, we will understand what is affine transformation, and its uses. Then we shall cover a few examples of warpAffine() by performing transformations such as rotation, translation, scaling, and shearing. What is Affine Transformation In image processing the affine transformation is a geometric transformation that preserves collinearity (the property of points lying on a straight line) and ratios of distances […]

Read more

SAMMO: A general-purpose framework for prompt optimization

Large language models (LLMs) have revolutionized a wide range of tasks and applications that were previously reliant on manually crafted machine learning (ML) solutions, streamlining through automation. However, despite these advances, a notable challenge persists: the need for extensive prompt engineering to adapt these models to new tasks. New generations of language models like GPT-4 and Mixtral 8x7B advance the capability to process long input texts. This progress enables the use of longer inputs, providing richer context and detailed instructions […]

Read more

Prompting Techniques for Stable Diffusion

Generating pictures using Stable Diffusion in all cases would involve to submit a prompt to the pipeline. This is only one of the parameters, but the most important one. An incomplete or poorly constructed prompt would make the resulting image not as you would expect. In this post, you will learn some key techniques to construct a prompt and see how much a good prompt can create a good image. Let’s get started. Prompting Techniques for Stable DiffusionPhoto by Sangga […]

Read more

Generate Realistic and Consistent Faces in Stable Diffusion

The deep learning model of Stable Diffusion is huge. The weight file is multiple GB large. Retraining the model means to update a lot of weights and that is a lot of work. Sometimes we must modify the Stable Diffusion model, for example, to define a new interpretation of prompts or make the model to generate a different style of painting by default. Indeed there are ways to make such an extension to existing model without modifying the existing model […]

Read more

How to Format Floats Within F-Strings in Python

You’ll often need to format and round a Python float to display the results of your calculations neatly within strings. In earlier versions of Python, this was a messy thing to do because you needed to round your numbers first and then use either string concatenation or the old string formatting technique to do this for you. Since Python 3.6, the literal string interpolation, more commonly known as a formatted string literal or f-string, allows you to customize the content […]

Read more
1 48 49 50 51 52 907