This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
# number of nodes per layer | |
nodes = np.array([2,3,4]) | |
# upper bound on capacity according to eq 1.1 of https://arxiv.org/pdf/1901.00434.pdf | |
# pairwise product of nodes weighted by the minimum layer width up to that point | |
capacity = np.sum(np.minimum.accumulate(nodes)[:-1]*nodes[:-1]*nodes[1:]) | |
print(capacity) | |
# a fully connected arch with equal number of nodes per layer will have a capacity | |
# that scales linearly with the total matrix multiplication time (is this true?) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style> | |
body { | |
font: small/1.5 Arial,Helvetica,sans-serif; | |
letter-spacing: normal; | |
} | |
</style> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> | |
<script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import numpy as np | |
import pandas as pd | |
pd.set_option('display.width', None) | |
def get_dfs(which=["android","assistant","chrome","gmail","playstore","image","maps","search","voice","location"]): | |
dfs = {} | |
def get_fname(name): | |
if "Location History" in name: | |
return "Takeout/Location History/Location History.json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import numpy as np | |
import matplotlib as mpl | |
mpl.use('Agg') | |
import matplotlib.pyplot as plt | |
# matplotlib.font_manager._rebuild() # after installing calibri | |
from matplotlib import rcParams | |
from cycler import cycler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# main instructions from https://xgboost.readthedocs.io/en/latest/build.html#building-with-gpu-support | |
# first install cmake somewhere | |
curl -O -L https://cmake.org/files/v3.12/cmake-3.12.0-Linux-x86_64.tar.gz | |
tar xf cmake*.tar.gz | |
cd cmake*/ | |
export CMAKE_ROOT=`pwd` | |
# get 10X environment for slc7 | |
cd /cvmfs/cms.cern.ch/slc7_amd64_gcc630/cms/cmssw/CMSSW_10_2_0_pre6/ ; cmsenv ; cd - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in some versions of xgboost, can't easily dump to json, so dump to the "plaintext" | |
# format, and then do some string parsing to make a dictionary and then json | |
# next, convert the json to a c++ function (nested ternary statements for the tree branching) | |
# and don't forget the sigmoid at the end to get probabilities! | |
# let's say you have | |
# ... | |
# bst = xgb.train( param.items(), dtrain, num_round, evallist, early_stopping_rounds=20 ) | |
# feature_names = ["njets", "nbtags", "met"] |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function | |
""" | |
stolen from https://github.com/dmwm/CRABClient/blob/master/src/python/CRABClient/JobType/UserTarball.py | |
""" | |
import os | |
import glob | |
import tarfile | |
import tempfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import time | |
import numba | |
import numpy as np | |
import awkward | |
from awkward import JaggedArray | |
@numba.jit(nopython=True,cache=True) | |
def numba_min(content,offsets): | |
result = np.zeros(len(offsets)-1,dtype=content.dtype) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.