Skip to content

Instantly share code, notes, and snippets.

View nottombrown's full-sized avatar

Tom B Brown nottombrown

View GitHub Profile
@nottombrown
nottombrown / test
Created September 18, 2020 19:44
test
tset
{{FrontSide}}
<hr id=answer>
{{Back}}
<script>
var content = document.querySelector('.card').innerHTML;
document.querySelector('.card').innerHTML = content.replace(/`(.*?)`/g, "<code>$1</code>");
</script>
<script type="text/x-mathjax-config">
@nottombrown
nottombrown / render_images.html
Created September 20, 2018 01:27
Messy prototype of confident error viewer
%%html_define_svelte ImageGrid
<div class="figure">
{{#each data as d, data_idx}}
<div class="selected-child" style="background-color: {{d['color']}}" on:click='select(data_idx)'>
<div class="label">
<div class='pred'> pred: {{d['pred_digit']}}</div>
<div class='label'> human: {{d['label']}}</div>
conf: {{d['conf']}}%
[tensor for tensor in tensors if preds_node.op in tensor.consumers()]
@nottombrown
nottombrown / earthquakes_in_sf.md
Last active December 31, 2020 01:02
Earthquake Danger in SF

SF Earthquake Danger

How dangerous are earthquakes to SF residents? My best guess is that we get an extra 15 micromorts per year. That’s a 3% increase over the non-natural causes mortality base rate in the US.

Math

Each year has about a 1/500 chance of a massive 7.9 magnitude earthquake that kills ~6000 people. SF has 800k people. (1/500) * (6000/800000) * 1000000 = 15 micromorts/year

Yearly all non-natural causes mortality in the US is 580 micromorts / year

15 / 580 = 2.6% increase in mortality rate

@nottombrown
nottombrown / imagenet1000_clsid_to_human.txt
Created January 31, 2018 01:08 — forked from yrevar/imagenet1000_clsidx_to_labels.txt
text: imagenet 1000 class id to human readable labels (Fox, E., & Guestrin, C. (n.d.). Coursera Machine Learning Specialization.)
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',
#!/bin/sh
# ----------------------------------------------------------------------
# Copyright (C) 2005-2011 Karl J. Runge <runge@karlrunge.com>
# All rights reserved.
#
# This file is part of Xdummy.
#
# Xdummy is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# Based on https://github.com/tensorflow/tensorflow/issues/2652#issue-158487397
import tensorflow as tf
tf.reset_default_graph()
def run(on_gpu):
tf.reset_default_graph()
tf.set_random_seed(42) # Try to set up determinism
with tf.device('/gpu:0' if on_gpu else '/cpu:0'):
a = tf.random_normal([16, 16])
b = tf.get_variable('b', shape = [], initializer = tf.constant_initializer(value = 0.0))

Keybase proof

I hereby claim:

  • I am nottombrown on github.
  • I am nottombrown (https://keybase.io/nottombrown) on keybase.
  • I have a public key ASDVHNVLxMWL4cN7DHIkg-aKMwpJb4qAZ-y0Yo-mM8qyXgo

To claim this, I am signing this object:

@nottombrown
nottombrown / id_rsa.pub
Last active August 7, 2016 23:52
Tom Brown's public SSH key
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0VouipRoYqWdJlTyKRhfGZ/Dyz2f2lRDdXElkBklUdN6TbJzaGkaUoDtOw5gq1X2pb15egvE5qEdtZqoPVUA1cyo9XlF8dK1LMR+wj7HNst3ynAZN98vIoiYwzIXKaECe5lBQ2e8+t3yA/WVn731wvvR+DHsG7DFGugND4HOLDfpfY+8AW0Thc0mROUDV0yhjuF6NWPqxuxgzExKD+huc8cJqVPzv9xiLQ1KdTms25739rhn28zhPLpyupUVbz1XB+SXOJFEFLdQzKszAeoaLFsZuZ+7yAAUUDJabVTQ/YtUxqGq5H8QTE7Jk6Zpz+QJM/yZ4o8UQ82XpXO9Ae/ctw== tombrown@PENELOPE-4.local