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
# 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
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
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
<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 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?) |
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
# on uaf, use singularity to load docker. with `--nv` for nvidia stuff | |
singularity shell --bind /cvmfs --nv docker://tensorflow/tensorflow:latest-gpu-py3 | |
[ -d virtualenv ] || pip install --target=`pwd`/virtualenv virtualenv | |
[ -d myenv ] || virtualenv/bin/virtualenv -p `which python` myenv | |
source myenv/bin/activate | |
pip install pydicom pandas numpy matplotlib scikit-learn scikit-image opencv-python-headless tensorflow-gpu keras jupyter tqdm | |
export TF_FORCE_GPU_ALLOW_GROWTH=true | |
jupyter notebook --no-browser --port=8880 |
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 pset_rawsim_onlyhlt import process | |
def recurse_coll(item,already_dumped=[]): | |
if hasattr(item,"_seq"): | |
print("process.{} = {}\n".format(item.label(),item.dumpPython())) | |
for thing in item._seq._collection: | |
for x in recurse_coll(thing): yield x | |
if hasattr(item,"_Parameterizable__parameterNames"): | |
if not item.label() in already_dumped: | |
print("process.{} = {}\n".format(item.label(),item.dumpPython())) |
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 | |
import requests | |
import os | |
session = requests.Session() | |
session.cert = "/tmp/x509up_u{0}".format(os.getuid()) # should match `voms-proxy-info -path` | |
session.verify = "/etc/grid-security/certificates/" # or curl this locally: https://raw.githubusercontent.com/CMSTrackerDPG/cernrequests/master/cernrequests/cern-cacert.pem | |
def get_url_with_cert(url,params={}): | |
return session.get(url,params=params) |