Published
Edited
May 5, 2022
1 fork
Insert cell
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 = [
"Michael Cohen and Dmitrii Krasheninnikov — 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": [
"Michael Cohen and Dmitrii Krasheninnikov — 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
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
relativeValuesInClusters = ({
"abstract AI alignment research": {
"Michael Cohen and Dmitrii Krasheninnikov — Scholarship Support (2018)":
"1",
"Machine Intelligence Research Institute — AI Safety Retraining Program":
"x to y" // 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":
"x to y"
},
"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": "x to y",
"Wilson Center — AI Policy Seminar Series": "x to y"
},
"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": "x to y",
"prosaic AI alignment research": "x to y",
"AI governance": "x to y",
"influence-seeking interventions": "x to y",
"clarity-seeking interventions": "x to y"
}
})
Insert cell
getRelativeValues("Stanford University — Machine Learning Security Research Led by Dan Boneh and Florian Tramer", "Open Phil AI Fellowship — 2018 Class")
Insert cell
getRelativeValuesAndDisplay("Stanford University — Machine Learning Security Research Led by Dan Boneh and Florian Tramer", "Open Phil AI Fellowship — 2018 Class")
Insert cell
getRelativeValues("Stanford University — Machine Learning Security Research Led by Dan Boneh and Florian Tramer", "Stanford University — Machine Learning Security Research Led by Dan Boneh and Florian Tramer")
Insert cell
function getRelativeValues(item1, item2) {
if(item1 == item2) return ({
squiggleString: "1",
shortGuesstimateString: "1",
array90CI: "1",
})
// using simpleSquiggle
let clusterNames = Object.keys(relativeValuesInClusters);
let getCluster = (item) =>
clusterNames.filter((clusterName) =>
Object.keys(relativeValuesInClusters[clusterName]).includes(item)
);
let cluster1Name = getCluster(item1)[0];
let cluster2Name = getCluster(item2)[0];
let relativeValueCalculation;
if (cluster1Name == cluster2Name) {
let relativeValue1 = relativeValuesInClusters[cluster1Name][item1];
let relativeValue2 = relativeValuesInClusters[cluster1Name][item2];
relativeValueCalculation = `${relativeValue1}/${relativeValue2}`;
} else {
let relativeValueCluster1 =
relativeValuesInClusters["general comparisons"][cluster1Name];
let relativeValueCluster2 =
relativeValuesInClusters["general comparisons"][cluster2Name];
let relativeValueOfClustersCalculation = `${relativeValueCluster1}/${relativeValueCluster2}`;

let relativeValueWithinCluster1 =
relativeValuesInClusters[cluster1Name][item1];
let relativeValueWithinCluster2 =
relativeValuesInClusters[cluster2Name][item2];

relativeValueCalculation = `( ${relativeValueWithinCluster1} * ${relativeValueCluster1} )/( ${relativeValueWithinCluster2} * ${relativeValueCluster2} )`;
}

let relativeValueCalculationOutput = simpleSquiggleCalculate(
relativeValueCalculation
);
/*
let relativeValueDisplay = simpleSquiggleDisplay(
relativeValueCalculationOutput
);
*/
return relativeValueCalculationOutput; // value1/value2

//console.log([cluster1Name, cluster2Name])
}
Insert cell
Insert cell
Insert cell
Insert cell
data = {
let elementsSliced = elements;
let results = [];
let getInnerDisplay = (x) =>
x > 100
? BigInt(Math.round(x.toPrecision(2))).toString()
: x.toPrecision(2).toLocaleString();
let getDisplayString0 = (relativeValues) =>
!!relativeValues.array90CI
? `${getInnerDisplay(relativeValues.array90CI[0])} to ${getInnerDisplay(
relativeValues.array90CI[1]
)}`
: relativeValues.squiggleString;
let getDisplayString = (relativeValues) => relativeValues.shortGuesstimateString
for (let elementi of elementsSliced) {
let object = { name: elementi };
elementsSliced.forEach(
(elementj) =>
(object[elementj] =
elementi == elementj
? 1
: getDisplayString(getRelativeValues(elementi, elementj)))
);
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
Insert cell
simpleSquiggleImport = import('https://cdn.skypack.dev/@forecasting/simple-squiggle@1.3.1')
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
simpleSquiggleCalculate = (string) =>
simpleSquiggleImport.calculator(string)
Insert cell
simpleSquiggleDisplay = (string) => cell(simpleSquiggleCalculate(string).squiggleString)
Insert cell
simpleSquiggleCalculate("1 to 10")
Insert cell
simpleSquiggleDisplay("1 to 10")
Insert cell
Insert cell
cell("lognormal(1,0.1)")
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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more