Skip to content

Instantly share code, notes, and snippets.

View daviddao's full-sized avatar
🛖
Villagers share their technological secrets. Receive 2 Eurekas.

David Dao daviddao

🛖
Villagers share their technological secrets. Receive 2 Eurekas.
View GitHub Profile
release_id released title country genre
103 1999-01-01 The Necessary EP Canada Electronic
121 1998-01-01 Blue Monday / Stitches US Electronic
173 1999-01-01 SF DJ's Come Home US Electronic
202 1998-01-01 Cash US Electronic
266 1998-01-01 First Array US Electronic
271 1997-01-01 Circles UK Electronic
272 1996-11-04 Spymania Allstars: Avit UK Electronic
274 1994-01-01 Experimenta UK Electronic
281 1997-11-01 Alt. Frequencies Presents Disco Moonlight UK Electronic
@daviddao
daviddao / run_all_experiments.sh
Last active December 16, 2021 15:08
Rumble experiments
echo 'Experiment 0 logistic Criteo'
time spark-submit --name 'Experiment 0 logistic Criteo' --conf spark.dynamicAllocation.enabled=false --num-executors 4 --executor-cores 2 --executor-memory 19g s3://rumbleml-data/rumble_experiments/rumbledb-1.16.0.jar --query-path 's3://rumbleml-data/rumble_experiments/query_0_logistic_Criteo.rumble'
#time spark-submit --name 'Experiment 0 logistic Criteo' --conf spark.dynamicAllocation.enabled=false --num-executors 4 --executor-cores 2 --executor-memory 19g run_spark.py -m logistic -p 0 -d Criteo
#echo 'Experiment 0 RandomForest Criteo'
#time spark-submit --name 'Experiment 0 RandomForest Criteo' --conf spark.dynamicAllocation.enabled=false --num-executors 4 --executor-cores 2 --executor-memory 19g s3://rumbleml-data/rumble_experiments/rumbledb-1.16.0.jar --query-path 's3://rumbleml-data/rumble_experiments/query_0_RandomForest_Criteo.rumble'
#time spark-submit --name 'Experiment 0 RandomForest Criteo' --conf spark.dynamicAllocation.enabled=false --num-executors 4 --executo
declare type local:mytype as {"id": "integer", "label": "integer", "col_0": "decimal", "col_1": "decimal", "col_2": "decimal", "col_3": "decimal", "col_4": "decimal", "col_5": "decimal", "col_6": "decimal", "col_7": "decimal", "col_8": "decimal", "col_9": "decimal", "col_10": "decimal", "col_11": "decimal", "col_12": "decimal", "col_13": "decimal"};
validate type local:mytype* {
json-file("https://gist.githubusercontent.com/daviddao/31652ddf8226143688ae3fe1008c0bb7/raw/15a9b0f9c005e5b42d575ef4701c8146cfc31bab/X_train.jsonl")
}
{"id": 0, "label": 1, "col_0": 50.0,"col_1": 0.0,"col_2": 23686.0,"col_3": 1.0,"col_4": 10.0,"col_5": 0.0,"col_6": 8.0,"col_7": 4.0,"col_8": 0.0,"col_9": 0.0,"col_10": 0.0,"col_11": 0.0,"col_12": 35.0,"col_13": 0.0}
{"id": 1, "label": 1, "col_0": 47.0,"col_1": 0.0,"col_2": 158451.0,"col_3": 10.0,"col_4": 14.0,"col_5": 0.0,"col_6": 5.0,"col_7": 0.0,"col_8": 0.0,"col_9": 0.0,"col_10": 0.0,"col_11": 0.0,"col_12": 2.0,"col_13": 0.0}
{"id": 2, "label": 1, "col_0": 40.0,"col_1": 4.0,"col_2": 197012.0,"col_3": 0.0,"col_4": 13.0,"col_5": 1.0,"col_6": 0.0,"col_7": 3.0,"col_8": 0.0,"col_9": 0.0,"col_10": 8614.0,"col_11": 0.0,"col_12": 40.0,"col_13": 2.0}
{"id": 3, "label": 1, "col_0": 30.0,"col_1": 0.0,"col_2": 169583.0,"col_3": 0.0,"col_4": 13.0,"col_5": 6.0,"col_6": 4.0,"col_7": 0.0,"col_8": 0.0,"col_9": 0.0,"col_10": 0.0,"col_11": 0.0,"col_12": 40.0,"col_13": 0.0}
{"id": 4, "label": 1, "col_0": 38.0,"col_1": 5.0,"col_2": 343642.0,"col_3": 3.0,"col_4": 9.0,"col_5": 0.0,"col_6": 5.0,"col_7": 0.0,"col_8": 0.0,"col_9":
import numpy as np
import scipy.sparse as sps
import torch
import torch.nn.functional as F
def get_shapley_value_torch(X_train, y_train, X_test, y_test, K=1):
N = len(X_train)
M = len(X_test)
dist = torch.cdist(X_train.view(len(X_train), -1), X_test.view(len(X_test), -1))
@daviddao
daviddao / install.sh
Last active December 23, 2023 22:48
Set up when Mac crashes
#!/bin/bash
# brew install essential apps
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/david/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
# brew install iterm2
# brew install zsh
# sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# upgrade_oh_my_zsh
@daviddao
daviddao / modifiers.sol
Created November 7, 2018 05:32
Useful modifiers for solidity
// preventing from sending to useless addresses
modifier validDestination( address to ) {
require(to != address(0x0));
require(to != address(this) );
_;
}
// making contract inactive
bool private stopped = false;
address private owner;

Keybase proof

I hereby claim:

  • I am daviddao on github.
  • I am daviddao (https://keybase.io/daviddao) on keybase.
  • I have a public key ASDjk6i5ZIF9WqaG_paFtxVSVm2YAOoxuVxWMDs-iL6ubwo

To claim this, I am signing this object:

[{"constant":true,"inputs":[{"name":"_id","type":"bytes32"},{"name":"_key","type":"bytes32"}],"name":"meta","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"count","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_new","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"bytes32"}],"name":"unregister","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"register","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_fee","type":"uint256"}],"name":"setFee","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type
@daviddao
daviddao / students.md
Last active June 29, 2018 04:12
Doing a thesis under my supervision? Here are some things you should know

Thesis

So you want to do a thesis under my supervision? Here's what you should know ...

What I care about ...

  1. You, obviously! I want you to get smarter, more creative and ambitious during your thesis. I fail as teacher when you haven't picked up at least one new skill after submitting your thesis.
  2. The project! My thesis offers are often quite challenging, pioneering or/and researchy, but never useless and stupid work. Research is always an exploration into the unknown.

I respect ...