Hello, world
This is the first post on the blog. It mostly exists to check that everything renders.
Math
Inline math works with single dollar signs, like , and display math with double:
Code
import torch
import torch.nn.functional as F
def cross_entropy(logits: torch.Tensor, targets: torch.Tensor) -> torch.Tensor:
log_probs = F.log_softmax(logits, dim=-1)
return -log_probs.gather(-1, targets.unsqueeze(-1)).mean()