Skip to content

Instantly share code, notes, and snippets.

@riceissa
Last active September 20, 2020 08:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riceissa/1ab549e34ee3cb19b83318ad5849af57 to your computer and use it in GitHub Desktop.
Save riceissa/1ab549e34ee3cb19b83318ad5849af57 to your computer and use it in GitHub Desktop.
Funding chains in the x-risk/AI safety ecosystem
#!/usr/bin/env python3
# License: CC0
from graphviz import Digraph
whitelist = {
'Open Philanthropy Project': "Open Phil",
'Future of Humanity Institute': "FHI",
'Machine Intelligence Research Institute': "MIRI",
'Berkeley Existential Risk Initiative': "BERI",
'Center for Applied Rationality': "CFAR",
'Center for Human-Compatible AI': "CHAI",
'Global Catastrophic Risk Institute': "GCRI",
'Effective Altruism Grants': "EA Grants",
'Future of Life Institute': "FLI",
'Effective Altruism Funds: Long Term Future Fund': "EA Funds LTF",
'Patrick Brinich-Langlois': 'Patrick Brinich-Langlois',
'AI Safety Camp': "AI Safety Camp",
'AI summer school': "AI summer school",
'AI Impacts': "AI Impacts",
'Centre for Effective Altruism': "CEA",
'Jaan Tallinn': "Jaan Tallinn",
'Raising for Effective Giving': "REG",
'Montreal Institute for Learning Algorithms': "MILA",
'Alex Flint AI risk fund': "Alex Flint fund",
'Alliance to Feed the Earth in Disasters': "ALLFED",
'Institute for Philosophical Research': "Inst. Phil. Research",
'Thiel Foundation': "Thiel",
'EA Giving Group': "EA Giving Group",
'Centre for Effective Altruism, Oxford': "CEA",
'OpenAI': "OpenAI",
'Ought': "Ought",
'LessWrong 2.0': "LW",
'Effective Altruism Foundation Fund': "EAFF",
"Survival and Flourishing Fund": "Survival and Flourishing",
}
edges = set()
with open("dump.tsv", "r") as f:
next(f) # skip header row
for line in f:
donor, donee = line.strip().split("\t")
if donor in whitelist and donee in whitelist:
edges.add((whitelist[donor], whitelist[donee]))
# This might not be necessary, but I was worried that graphviz might not be
# able to handle arbitrary strings as node labels, so I just replace each
# string by node_N where N keeps counting up
entity_map = {}
num_entities = 0
for edge in edges:
donor, donee = edge
if donor not in entity_map:
num_entities += 1
entity_map[donor] = "node_" + str(num_entities)
if donee not in entity_map:
num_entities += 1
entity_map[donee] = "node_" + str(num_entities)
dot = Digraph(format='png')
for entity in entity_map:
dot.node(entity_map[entity], entity)
labeled_edges = []
for edge in edges:
donor, donee = edge
from_label = entity_map[donor]
to_label = entity_map[donee]
dot.edge(from_label, to_label)
print(dot.source)
dot.render("blah")
mysql donations -e "select donor,donee from donations where substring_index(cause_area,'/',1) in ('AI safety','Global catastrophic risks','Existential risks','Global catastrophic risk','X-risks','Effective altruism');" > dump.tsv
# org-based query instead of cause-area-based query
mysql donations -e "select donor,donee from donations where donor in ('AI Impacts', 'AI Safety Camp', 'AI summer school', 'Alex Flint AI risk fund', 'Alliance to Feed the Earth in Disasters', 'Berkeley Existential Risk Initiative', 'Center for Applied Rationality', 'Center for Human-Compatible AI', 'Centre for Effective Altruism', 'Centre for Effective Altruism, Oxford', 'EA Giving Group', 'Effective Altruism Foundation Fund', 'Effective Altruism Funds: Long Term Future Fund', 'Effective Altruism Grants', 'Future of Humanity Institute', 'Future of Life Institute', 'Global Catastrophic Risk Institute', 'Institute for Philosophical Research', 'Jaan Tallinn', 'LessWrong 2.0', 'Machine Intelligence Research Institute', 'Montreal Institute for Learning Algorithms', 'Open Philanthropy Project', 'OpenAI', 'Ought', 'Patrick Brinich-Langlois', 'Raising for Effective Giving', 'Survival and Flourishing Fund', 'Thiel Foundation') or donee in ('AI Impacts', 'AI Safety Camp', 'AI summer school', 'Alex Flint AI risk fund', 'Alliance to Feed the Earth in Disasters', 'Berkeley Existential Risk Initiative', 'Center for Applied Rationality', 'Center for Human-Compatible AI', 'Centre for Effective Altruism', 'Centre for Effective Altruism, Oxford', 'EA Giving Group', 'Effective Altruism Foundation Fund', 'Effective Altruism Funds: Long Term Future Fund', 'Effective Altruism Grants', 'Future of Humanity Institute', 'Future of Life Institute', 'Global Catastrophic Risk Institute', 'Institute for Philosophical Research', 'Jaan Tallinn', 'LessWrong 2.0', 'Machine Intelligence Research Institute', 'Montreal Institute for Learning Algorithms', 'Open Philanthropy Project', 'OpenAI', 'Ought', 'Patrick Brinich-Langlois', 'Raising for Effective Giving', 'Survival and Flourishing Fund', 'Thiel Foundation');" > dump.tsv
@riceissa
Copy link
Author

Why the Lifeboat Foundation is not on the whitelist?

@EvgenyMashkantsev Lifeboat Foundation is currently not tracked on @vipulnaik's Donations List Website so there wouldn't be data to graph even if it was in the whitelist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment