Published unlisted
Edited
Feb 11, 2022
Insert cell
# Transformer Language Model Dynamics
Insert cell
Insert cell
Insert cell
d3 = require("d3@5")
Insert cell
margin = ({top: 0, right: 0, bottom: 0, left: 0})
Insert cell
width = 600 - margin.left - margin.right
Insert cell
height = 300 - margin.top - margin.bottom
Insert cell
//data = (await fetch(url)).json()
data = FileAttachment("highres_transformer.json").json()
Insert cell
function kde(kernel, thresholds, data) {
return thresholds.map(t => [t, d3.mean(data, d => kernel(t - d))]);
}
Insert cell
function epanechnikov(bandwidth) {
return x => Math.abs(x /= bandwidth) <= 1 ? 0.75 * (1 - x * x) / bandwidth : 0;
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more