Skip to content

Instantly share code, notes, and snippets.

View andyljones's full-sized avatar
🤖
👩👨👩👨

Andy Jones andyljones

🤖
👩👨👩👨
View GitHub Profile
@andyljones
andyljones / ngo_restriction.py
Last active February 13, 2020 17:06
Exemplar plot for comparing pairs of discrete distributions
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import matplotlib as mpl
def raw_data():
restriction = ['not', 'slightly', 'moderately', 'very']
gov = pd.DataFrame({
'democracy': [.6, .2, .1, .1],
'autocracy': [.2, .3, .5, .4]}, index=restriction)
@andyljones
andyljones / bokeh_td.py
Created May 14, 2020 14:37
Bokeh timedelta axis formatting, showing just the parts of 00h00m00s necessary.
def timedelta_xaxis(f):
"""Expects the axis to be in millis"""
f.xaxis.ticker = bom.tickers.DatetimeTicker()
f.xaxis.formatter = bom.FuncTickFormatter(code="""
// TODO: Add support for millis
// Calculate the hours, mins and seconds
var s = Math.floor(tick / 1e3);
var m = Math.floor(s/60);
@andyljones
andyljones / Xorg.0.log
Last active August 8, 2020 07:01
healthy coolgpus logs
[ 53628.957]
X.Org X Server 1.20.8
X Protocol Version 11, Revision 0
[ 53628.957] Build Operating System: Linux 4.4.0-184-generic x86_64 Ubuntu
[ 53628.957] Current Operating System: Linux aj-server 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64
[ 53628.957] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.4.0-42-generic root=UUID=c089030c-4cd8-41c8-bddd-6545a222aa6f ro quiet splash vt.handoff=7
[ 53628.957] Build Date: 24 June 2020 06:00:21AM
[ 53628.957] xorg-server 2:1.20.8-2ubuntu2.2 (For technical support please see http://www.ubuntu.com/support)
[ 53628.957] Current version of pixman: 0.38.4
[ 53628.957] Before reporting problems, check http://wiki.x.org
@andyljones
andyljones / mcts_tests.py
Created December 13, 2020 12:26
example mcts tests
import torch
import torch.testing
import torch.distributions
import pytest
from . import cuda
from rebar import arrdict
import aljpy
### ROOT TESTS
@andyljones
andyljones / vaccinated_ifrs.py
Created February 13, 2021 15:36
A naive estimate in the reduction in IFR you get from vaccinating the most vulnerable fraction of the population
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from io import StringIO
import matplotlib.ticker as mtick
# Source: p11, https://www.imperial.ac.uk/media/imperial-college/medicine/mrc-gida/2020-10-29-COVID19-Report-34.pdf
IFR = """
0-4 0.00 (0.00, 0.03) 0.00 (0.00, 0.03)
5-9 0.01 (0.00, 0.06) 0.01 (0.00, 0.06)
@andyljones
andyljones / readme.md
Last active March 7, 2021 09:43
copyright with perfect attribution

Setup

  • Suppose you had a black box that could attribute a new idea to a bundle of old ideas, and identify the novel contribution.
  • Can we use this to set up a system where authors get paid based on anything that ever depends on their novel contribution?

Selling an idea

  • I'm an author. I've taken some other people's ideas, mixed them together, and come up with something new.
  • I announce to the world that I have had a new idea. I can't publish the idea openly, because then no-one'd pay me for it! Instead I publish some tags describing the idea so that potential purchasers can come talk to me.
  • A potential purchaser shows up. They send me a gogol* of themselves, a little AI approximation of them.
  • I put the purchaser's gogol in a sandbox with my idea. It evaluates the idea and proposes a price. The sandbox is then destroyed.
  • If I'm happy with the price, I send the purchaser the idea and they send me the cash. This transaction is public.