Public
Edited
Jun 5
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
data = FileAttachment("training_progress.json").json()
Insert cell
import {Inputs, Plot} from "@observablehq/inputs"
Insert cell
import {button} from "@jashkenas/inputs"

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
filtered = indexed.filter(d => d.session === selectedSession)
Insert cell
Insert cell
Insert cell
params = history[iteration].params.map(arr => arr[0]) // [[mu1, mu2, var1, var2], ...]
Insert cell
ll_data = FileAttachment("training_progress.json").json()
Insert cell
Insert cell
Insert cell
// {
// const params = history[iteration].params.map(d => d[0]); // [[μ₁, μ₂, σ₁, σ₂], ...]

// const gaussian1D = (x, mu, sigma) => {
// sigma = Math.abs(sigma);
// const coef = 1 / (Math.sqrt(2 * Math.PI) * sigma);
// const exp = Math.exp(-((x - mu) ** 2) / (2 * sigma ** 2));
// return coef * exp;
// };

// const xs = d3.range(-6, 6.01, 0.1);
// const data = [];


// for (let i = 0; i < params.length; i++) {
// const [mu1, mu2, sigma1, sigma2] = params[i];
// console.log("σ₁:", params[0][2]); // State 0 σ₁
// console.log("μ₁:", params[0][0]); // State 0 μ₁
// for (let x of xs) {
// data.push({ x, y: gaussian1D(x, mu1, sigma1), label: `State ${i} - μ₁` });
// data.push({ x, y: gaussian1D(x, mu2, sigma2), label: `State ${i} - μ₂` });
// }
// }

// return Plot.plot({
// color: { legend: true }, // ✅ 색상별 범례 추가
// marks: [
// Plot.line(data, {
// x: "x",
// y: "y",
// stroke: "label", // label별 색 구분
// title: "label"
// })
// ],
// x: { label: "μ" },
// y: { label: "Density" },
// width: 600,
// height: 300
// });
// }

Insert cell
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