import matplotlib.pyplot as plt
1,23,2,4])
plt.plot([ plt.show()

optionally add a subtitle
Under your first header, include a brief introduction to your chapter.
Starting prompt for this chapter: Chapter 4 introduces architectures and loss models, defining them and providing examples through two practical case studies: image restoration and segmentation. Although this chapter will include code snippets/exercises, the presentation of essential concepts should communicate the philosophy behind the choice of a model for non-programmers.
Use markdown heading level two for section headers. You can use standard markdown formatting, for example emphasize the end of this sentence.
This is a new paragraph with more text. Your paragraphs can cross reference other items, such as Figure 11.1. Use fig
to reference figures, and eq
to reference equations, such as Equation 11.1.
To make your sections cross reference-able throughout the book, include a section reference, as shown in the header for Section 11.4.
To cite a research article, add it to references.bib and then refer to the citation key. For example, reference1 refers to CellPose and reference2 refers to ZeroCostDL4Mic.
We are using R code to create a glossary for this book. To add a definition, edit the glossary.yml file. To reference the glossary, enclose the word as in these examples: LLMs suffer from hallucinations. It is important to understand the underlying training data, validation data and false positives to interpret your results. Clicking on the word will reveal its definition by taking you to the entry on the Glossary page. Pressing back in your browser will return you to your previous place in the textbook.
This is an example of including a python snippet that generates a figure
import matplotlib.pyplot as plt
1,23,2,4])
plt.plot([ plt.show()
In some cases, you may want to include a code-block that is not executed when the book is compiled. Use the eval: false
option for this.
import matplotlib.pyplot as plt
1,23,2,4])
plt.plot([ plt.show()
Figures can also be generated that do not show the code by using the option for code-fold: true
.
import numpy as np
import matplotlib.pyplot as plt
= np.arange(0, 2, 0.01)
r = 2 * np.pi * r
theta = plt.subplots(
fig, ax = {'projection': 'polar'}
subplot_kw
)
ax.plot(theta, r)0.5, 1, 1.5, 2])
ax.set_rticks([True)
ax.grid( plt.show()
Here is an example equation.
\[ s = \sqrt{\frac{1}{N-1} \sum_{i=1}^N (x_i - \overline{x})^2} \tag{4.1}\]
You can also embed figures from other notebooks in the repo as shown in the following embed example.
When embedding notebooks, please store the .ipynb file in the notebook directory. Include the chapter in the name of your file. For example, chapter4_example_u-net.ipynb
. This is how we will handle chapter- or example-specific environments. We will host notebooks on Google Colab so that any required packages for the code–but not for rendering the book at large–will be installed there. That way, we will not need to handle a global environment across the book.
You can learn more about markdown options and additional Quarto features in the Quarto documentation. One example that you might find interesting is the option to include callouts in your text. These callouts can be used to highlight potential pitfalls or provide additional optional exercises that the reader might find helpful. Below are examples of the types of callouts available in Quarto.
Note that there are five types of callouts, including: note
, tip
, warning
, caution
, and important
. They can default to open (like this example) or collapsed (example below).
These could be good for extra material or exercises.
There are caveats when applying these tools. Expand the code below to learn more.
= np.arange(0, 2, 0.01)
r = 2 * np.pi * r theta
Be careful to avoid hallucinations.
This is key information.