Notebooks 2.0 is here.

Published
Edited
Apr 27, 2022
Insert cell
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
Insert cell
clusterNames = [
"abstract AI alignment research",
"prosaic AI alignment research",
"AI governance",
"influence-seeking interventions",
"clarity-seeking interventions"
]
Insert cell
Insert cell
elements = [
"AI Scholarships — Scholarship Support (2018)",
"Machine Intelligence Research Institute — AI Safety Retraining Program",
"Ought — General Support (2018)",
"Stanford University — Machine Learning Security Research Led by Dan Boneh and Florian Tramer",
"Oxford University — Research on the Global Politics of AI",
"UC Berkeley — AI Safety Research (2018)",
"Open Phil AI Fellowship — 2018 Class",
"Wilson Center — AI Policy Seminar Series",
"AI Impacts — General Support (2018)"
]
Insert cell
clusters = ({
"abstract AI alignment research": [
"AI Scholarships — Scholarship Support (2018)",
"Machine Intelligence Research Institute — AI Safety Retraining Program"
],
"prosaic AI alignment research": [
"Ought — General Support (2018)",
"Stanford University — Machine Learning Security Research Led by Dan Boneh and Florian Tramer"
],
"AI governance": [
"Oxford University — Research on the Global Politics of AI"
],
"influence-seeking interventions": [
"UC Berkeley — AI Safety Research (2018)",
"Open Phil AI Fellowship — 2018 Class",
"Wilson Center — AI Policy Seminar Series"
],
"clarity-seeking interventions": ["AI Impacts — General Support (2018)"]
})
Insert cell
Insert cell
Insert cell
md`Below, replace the "x to y"s with a numeric range instead`
Insert cell
relativeValuesInClusters = ({
"abstract AI alignment research": {
"AI Scholarships — Scholarship Support (2018)": "1",
"Machine Intelligence Research Institute — AI Safety Retraining Program":
"0.5 to 2" // replace with "number to number"
},
"prosaic AI alignment research": {
"Ought — General Support (2018)": 1,
"Stanford University — Machine Learning Security Research Led by Dan Boneh and Florian Tramer":
"10 to 100"
},
"AI governance": {
"Oxford University — Research on the Global Politics of AI": 1
},
"influence-seeking interventions": {
"UC Berkeley — AI Safety Research (2018)": "1",
"Open Phil AI Fellowship — 2018 Class": "0.5 to 5",
"Wilson Center — AI Policy Seminar Series": "0.01 to 0.4"
},
"clarity-seeking interventions": {
"AI Impacts — General Support (2018)": 1
},
"general comparisons": {
"one year of Paul Christiano's work": 1, // reference value only
"abstract AI alignment research": "0.001 to 0.3",
"prosaic AI alignment research": "0.05 to 1.5",
"AI governance": "0.05 to 5",
"influence-seeking interventions": "0.005 to 0.5",
"clarity-seeking interventions": "0.01 to 0.7"
}
})
Insert cell
getRelativeValuesAndDisplay(
"Stanford University — Machine Learning Security Research Led by Dan Boneh and Florian Tramer",
"Open Phil AI Fellowship — 2018 Class"
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
data = {
let elementsSliced = elements
let results = []
for(let elementi of elementsSliced){
let object = ({name: elementi})
elementsSliced.forEach(elementj => object[elementj] = getRelativeValues(elementi, elementj)[1].replace("1 / 1", "1"))
results.push(object)
}
return results
}

Insert cell
format = {
let result = ({})
elements.forEach(element => result[element] = cell)
return result
}
Insert cell
Inputs.table(data)
Insert cell
Insert cell
squiggle = require("@quri/squiggle-components@0.2.4")
Insert cell
Insert cell
simpleSquiggleCalculate = (string) => simpleSquiggleImport.transformer(string)
Insert cell
simpleSquiggleDisplay = (string) => cell(simpleSquiggleCalculate(string)[0])
Insert cell
simpleSquiggleDisplay("1 to 10")
Insert cell
cell = (code, env) =>
squiggle.renderSquiggleEditorToDom({
initialSquiggleString: code,
environment: env ? env : []
})
Insert cell
cell("lognormal(1,0.1)")
Insert cell
function getXyshape(string) {
// do something
}
Insert cell
function sparkbar(max) {
return (x) => htl.html`<div style="
background: lightblue;
width: ${(100 * x) / max}%;
float: right;
padding-right: 3px;
box-sizing: border-box;
overflow: visible;
display: flex;
justify-content: end;">${x.toLocaleString("en")}`;
}
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