python_code
stringlengths
0
1.02M
repo_name
stringlengths
9
48
file_path
stringlengths
5
114
bolt-master
experiments/python/datasets/__init__.py
#!/usr/bin/env/python import os import numpy as np from joblib import Memory import pandas as pd from . import paths _memory = Memory('.', verbose=1, compress=9) UCR_DATASETS_DIR = paths.UCR UCR_INFO_PATH = paths.UCR_INFO # ================================================================ # Public # =============...
bolt-master
experiments/python/datasets/ucr.py
#!/bin/env python from __future__ import absolute_import, division, print_function from scipy import io import numpy as np import os from joblib import Memory _memory = Memory('.', verbose=1) DATADIR = '../datasets/svhn' TRAIN_PATH = os.path.join(DATADIR, 'train_32x32.mat') TEST_PATH = os.path.join(DATADIR, 'test_...
bolt-master
experiments/python/datasets/svhn.py
#!/bin/env/python """utility functions for data munging""" from __future__ import absolute_import, division, print_function import numpy as np import sklearn def split_train_test(X, Y, train_frac=.8, random_state=123): """Returns X_train, X_test, y_train, y_test""" np.random.seed(123) return sklearn.mo...
bolt-master
experiments/python/datasets/data_utils.py
#!/bin/env python # Load 3-lead ECG recordings from SHAREE Database: # https://physionet.org/content/shareedb/1.0.0/ from __future__ import division, print_function import matplotlib.pyplot as plt import numpy as np import os from . import paths from . import files from joblib import Memory _memory = Memory('.', v...
bolt-master
experiments/python/datasets/sharee.py
#!/bin/env python # Load 3-lead ECG recordings from SHAREE Database: # https://physionet.org/content/shareedb/1.0.0/ from __future__ import division, print_function import matplotlib.pyplot as plt import numpy as np import os from . import paths from . import files from joblib import Memory _memory = Memory('.', v...
bolt-master
experiments/python/datasets/incart.py
#!/bin/env python # from __future__ import absolute_import, division, print_function from __future__ import division, print_function import numpy as np from . import paths from . import image_utils as imgs from joblib import Memory _memory = Memory('.', verbose=1) DATADIR_101 = paths.CALTECH_101 DATADIR_256 = pat...
bolt-master
experiments/python/datasets/caltech.py
#!/bin/env python from __future__ import absolute_import, division, print_function import numpy as np from python import image_utils as imgs from joblib import Memory _memory = Memory('.', verbose=1) DATADIR_101 = '../datasets/caltech/101_ObjectCategories' def main(): import matplotlib.pyplot as plt # c...
bolt-master
experiments/python/datasets/flowers.py
#!/usr/bin/env python from __future__ import print_function import numpy as np from sklearn.datasets import load_digits import timeit import bolt # ================================================================ utils def _dists_sq(X, q): diffs = X - q return np.sum(diffs * diffs, axis=-1) def _dists_l...
bolt-master
tests/test_encoder.py
# This file is part of Eigen, a lightweight C++ template library # for linear algebra. # # Copyright (C) 2012 Keir Mierle <mierle@gmail.com> # # This Source Code Form is subject to the terms of the Mozilla # Public License v. 2.0. If a copy of the MPL was not distributed # with this file, You can obtain one at http://m...
bolt-master
cpp/src/external/eigen/scripts/relicense.py
# Intentionally empty
bolt-master
cpp/src/external/eigen/debug/gdb/__init__.py
# -*- coding: utf-8 -*- # This file is part of Eigen, a lightweight C++ template library # for linear algebra. # # Copyright (C) 2009 Benjamin Schindler <bschindler@inf.ethz.ch> # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this ...
bolt-master
cpp/src/external/eigen/debug/gdb/printers.py
from setuptools import setup, find_packages setup( name = 'attention-tensorflow-mesh', packages = find_packages(), version = '0.0.2', license='MIT', description = 'A bunch of attention related functions, for constructing transformers in tensorflow mesh', author = 'Phil Wang', author_email = 'lucidrains@g...
attention-tensorflow-mesh-master
setup.py
from attention_tensorflow_mesh.attention_tensorflow_mesh import transformer_lm, transformer, attention
attention-tensorflow-mesh-master
attention_tensorflow_mesh/__init__.py
import math import mesh_tensorflow as mtf import tensorflow.compat.v1 as tf # helpers def default(val, d): return val if val is not None else d # simple linear layer def linear(x, dim_out, scope = 'linear', bias = True): with tf.variable_scope(scope): *_, dim_in = x.shape w_init_stdev = 1 / ...
attention-tensorflow-mesh-master
attention_tensorflow_mesh/attention_tensorflow_mesh.py