← Writing

Hello, world (and a feature tour)

Welcome to the blog. This first post does double duty: it’s a placeholder you can delete, and it’s a quick reference for the formatting features you’ve got at your disposal. To write a new post, drop a .md file in src/content/blog/ with the frontmatter block you see at the top of this file.

Math with LaTeX

Inline math works with single dollar signs — for example, the attention scores aij=exp(sij)kexp(sik)a_{ij} = \frac{\exp(s_{ij})}{\sum_k \exp(s_{ik})} are just a softmax over similarities. Display math uses double dollar signs:

Attention(Q,K,V)=softmax ⁣(QKdk)V\mathrm{Attention}(Q, K, V) = \mathrm{softmax}\!\left(\frac{QK^\top}{\sqrt{d_k}}\right) V

You can write anything KaTeX supports — sums, integrals, matrices:

θL(θ)=1Ni=1Nθ(fθ(xi),yi)\nabla_\theta \mathcal{L}(\theta) = \frac{1}{N} \sum_{i=1}^{N} \nabla_\theta \ell\big(f_\theta(x_i), y_i\big)

Code snippets

Fenced code blocks are syntax-highlighted automatically (via Shiki). Here’s a bit of Python:

import torch
import torch.nn.functional as F

def scaled_dot_product_attention(q, k, v):
    d_k = q.size(-1)
    scores = q @ k.transpose(-2, -1) / d_k**0.5
    weights = F.softmax(scores, dim=-1)
    return weights @ v

And inline code like pip install torch works the way you’d expect.

Images

Embed images with standard Markdown. Put the file in src/assets/ and reference it with a relative path — Astro will optimize it for you:

A placeholder image

That’s the whole toolkit: math, code, and images, all from plain Markdown. Happy writing.