This file contains hidden or 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
def get_matching_variables(fname, tree, patterns): | |
from fnmatch import fnmatch | |
from root_numpy import list_branches | |
branches = list_branches(fname, tree) | |
selected = [] | |
for p in patterns: | |
for b in branches: |
This file contains hidden or 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
merge [] ys = ys | |
merge xs [] = xs | |
merge xs@(x:xt) ys@(y:yt) | x <= y = x : merge xt ys | |
| otherwise = y : merge xs yt | |
mergeLists [] = [] | |
mergeLists [x] = [x] | |
mergeLists (x:y:rest) = mergeLists $ (merge x y) : mergeLists rest | |
ll = [[1,2,3], [1,3,6], [1, 10], [3,3,3], [1], [1,1,1,5]] |
This file contains hidden or 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 gevent | |
import gevent.queue | |
import gevent.pool | |
import gevent.subprocess | |
import gevent.monkey | |
gevent.monkey.patch_all() |
This file contains hidden or 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 | |
import tensorflow as tf | |
sess = tf.Session() | |
TYPE=np.float64 | |
N = 1000000 | |
data = np.random.normal(0, 1, N).astype(TYPE) |
This file contains hidden or 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 | |
import tensorflow as tf | |
from scipy.optimize import minimize | |
import matplotlib | |
matplotlib.use('PDF') | |
import matplotlib.pyplot as plt | |
# Generate dataset | |
data = np.random.normal(0, 1, 1000) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
#include <array> | |
#include <iostream> | |
#include <vector> | |
template <typename T, | |
// Number of dimensions of tensor. | |
int D> | |
class Tensor { | |
public: | |
template <typename... T2, |
OlderNewer