text string |
|---|
<reponame>AmirAbaskohi/Automatic-Speech-recognition-for-Speech-Assessment-of-Preschool-Children<filename>Models/CNN/model.py<gh_stars>1-10
import os
import librosa # for audio processing
import IPython.display as ipd
import matplotlib.pyplot as plt
import numpy as np
from scipy.io import wavfile # for audio processin... |
<filename>tectosaur/kernels/sympy_to_cpp.py
import sympy
import mpmath
def cpp_binop(op):
def _cpp_binop(expr):
out = '(' + to_cpp(expr.args[0])
for arg in expr.args[1:]:
out += op + to_cpp(arg)
out += ')'
return out
return _cpp_binop
def cpp_func(f_name):
def _... |
<gh_stars>1-10
import tensorflow as tf
import numpy as np
import scipy.sparse as sp
def convert_scipy_CRS_space_to_tensor(sparce_mat: sp.csr.csr_matrix):
sparce_mat_coo = sparce_mat.tocoo()
indices = np.transpose(np.array([sparce_mat_coo.row, sparce_mat_coo.col]))
return tf.SparseTensor(indices, sparce_m... |
<gh_stars>1-10
import argparse
from itertools import count
import gym
import gym.spaces
import scipy.optimize
import numpy as np
import math
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from models import *
from replay_memory import Memory
from running_state import ZF... |
<filename>profile_analysis/analysis_old.py
import csv
from scipy import stats, mean
import numpy as np
import make_scores
import processing
franco_dict = {}
franco_data = make_scores.data
james_dict = {}
james_data = []
anastassia_dict = {}
anastassia_data = []
def print_person_by_id(id):
ind = make_scores.indic... |
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy.random
import scipy.special
import scipy.stats
import torch
import torch.testing
from torch.distributions import Normal, Unifor... |
# To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
import pandas as pd
import argparse
import glob
from scipy.stats import ttest_ind
# %%
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument(
'problem',
help='MILP instance type ... |
<gh_stars>0
import numpy as np
from scipy.stats import norm
from scipy.stats import f
from scipy.stats import ncf
def simulate_statistics(n_simulations, sample_sizes, memory_limit, means, sd):
""" Simulate test statistics for a one-way ANOVA
Simulate [param: n_simulations] test statistics for a t-test with g... |
<gh_stars>0
"""Find the parameters for a levels adjustment between two images."""
import concurrent.futures
from PIL import Image
import numpy as np
from scipy.optimize import curve_fit
from level import LevelsAdjustment, level_array
def match_histogram(x: np.ndarray, y: np.ndarray, *,
xtol: fl... |
<reponame>zEttOn86/Convolutional-Neural-Networks-on-Graphs-with-Fast-Localized-Spectral-Filtering<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import scipy.sparse as ss
import scipy.spatial.distance
import sklearn.metrics.pairwise
def create_laplacian(W, normalize=True):
n = W.s... |
#!/usr/bin/env python3
#
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 14 22:04:35 2020
@author: henry
"""
import Config
import numpy as np
from scipy import constants
import os
import sys
def waterViscosityPoling(T):
A = 1.856e-11
B = 4209
C = 0.04527
D = -3.376e-5
return A*np.exp((B/T)+C*T+D*T... |
<gh_stars>0
""" Train for generating LIIF, from image to implicit representation.
Config:
train_dataset:
dataset: $spec; wrapper: $spec; batch_size:
val_dataset:
dataset: $spec; wrapper: $spec; batch_size:
(data_norm):
inp: {sub: []; div: []}
gt: ... |
<filename>Development/PyScripts/TankSim.py
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint
# animate plots?
animate=False # True / False
# define tank model
def tank(Level,time,c,valve):
rho = 1000.0 # water density (kg/m^3)
A = 1.0 # tank area (m^2)
# calculate ... |
# Copyright 2021 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
<filename>xrftomo/widgets/sinogram_actions.py<gh_stars>0
# #########################################################################
# Copyright (c) 2018, UChicago Argonne, LLC. All rights reserved. #
# #
# Copyright 2018. UChicago Argonne,... |
from torch.utils.data import Dataset
import torch
import numpy as np
import time
import os
import scipy.ndimage
from utils import remapper
blur0=np.ones((3,1,1)).astype('float32')/3
blur1=np.ones((1,3,1)).astype('float32')/3
blur2=np.ones((1,1,3)).astype('float32')/3
## Elastic augmentation from https://github.com/fa... |
#!/usr/bin/python
import scipy.misc
def euler15(numRows=20, numCols=20):
numPaths = scipy.misc.comb(numRows + numCols, numRows, exact=True)
print('In %dx%d grid, there are %d paths' % (numRows, numCols, numPaths))
if __name__ == "__main__":
euler15()
|
from sympy import diag
import rclpy
from rclpy.node import Node
from sensor_msgs.msg import Image
from rclpy.qos import QoSPresetProfiles
from cv_bridge import CvBridge
from stereo_msgs.msg import DisparityImage
import cv2
from time import time
import numpy as np
bridge = CvBridge()
stereo = cv2.StereoBM_create()
# ... |
import sys
from scipy import sparse
from utils.post_processing import *
from utils.pre_processing import *
from utils.submitter import Submitter
from utils.ensembler import *
from recommenders.similarity.s_plus import *
from utils.evaluator import Evaluator
from tqdm import tqdm
import random
def two_boost(rec_list, ... |
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as stats
import pandas as pd
df = pd.read_csv('D:\GitHub\CubingStats\WCAStats\WCA_export_Results.tsv','\t')
threespeed = df.loc[df.eventId=='333']
threespeed.to_excel('threespeed_results.xlsx') |
<reponame>claudiocc1/numba-stats<filename>tests/test_t.py
import scipy.stats as sc
import numpy as np
from numba_stats import t
import pytest
@pytest.mark.parametrize("df", (1, 1.5, 2, 3, 4, 5.5, 10))
def test_t_pdf(df):
x = np.linspace(-5, 5, 10)
got = t.pdf(x, df, 2, 3)
expected = sc.t.pdf(x, df, 2, 3) ... |
#!/usr/bin/env python3
import gzip
import pysam
from Bio import SeqIO
from collections import Counter, defaultdict
import scipy.stats as stats
import operator
import pandas as pd
import argparse
import sys
def main ():
parser = argparse.ArgumentParser(description='somatic var caller')
required = parser.add_a... |
import scipy.sparse as sp
from .walker import BiasedRandomWalker, BiasedRandomWalkerAlias
from .utils import Word2Vec
from .trainer import Trainer
class Node2Vec(Trainer):
r"""An implementation of `"Node2Vec" <https://cs.stanford.edu/~jure/pubs/node2vec-kdd16.pdf>`_
from the KDD '16 paper "node2vec: S... |
from typing import Tuple, Union
import torch
import numpy as np
from scipy.ndimage.morphology import binary_opening, binary_fill_holes
from skimage.transform import resize
class ToTensor:
"""Convert ndarrays in sample to Tensors."""
def __call__(self, sample):
img, mask = sample["img"], sample["mask... |
<gh_stars>1-10
# set library dir
import sys
for ind in range(1,len(sys.argv)):
sys.path.append(sys.argv[ind])
sys.argv = sys.argv[:1]
import numpy as np
import unittest
import qulacs
class TestQuantumState(unittest.TestCase):
def setUp(self):
self.n = 4
self.dim = 2**self.n
self.state... |
# To import required modules:
import numpy as np
import time
import os
import sys
import matplotlib
import matplotlib.cm as cm #for color maps
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec #for specifying plot attributes
from matplotlib import ticker #for setting contour plots to log scale
im... |
# -*- coding: utf-8 -*-
"""
*******************************************************************************
MODIFIED REDFIELD RATE MATRIX
*******************************************************************************
"""
import numpy
from scipy import integrate
from quantarhei.core.implementations import ... |
from natunits.prelude import *
import pytest
from fractions import Fraction
def test_operations():
assert 1 == pytest.approx(GeV / GeV)
assert GeV == ((GeV * s) / s)
assert GeV == ((GeV * s**Fraction(1, 2)) * s**Fraction(-1, 2))
assert 2 * GeV == GeV + GeV
assert 0 * GeV == GeV - GeV
assert Ge... |
<reponame>BridgeQZH/EL2700_MPC_Original<filename>Assignment 2/dp.py
import casadi as ca
import numpy as np
import time
from scipy import interpolate
# To speed up for loops
import multiprocessing
from joblib import Parallel, delayed
class Gridder(object):
def __init__(self, model, Q , R,
si... |
<gh_stars>0
'''
Combinatorics library
'''
from math import lgamma
from scipy.special import comb
def comb_fak(N, k):
return comb(N, k, exact=True)
# Compute the logarithm of number of combinations. Approximate, but works for large N
def log_comb(N, k):
return lgamma(N+1) - lgamma(N-k+1) - lgamma(k+1) |
import numpy as np
from jax.core import Primitive
from jax.interpreters import ad
from jax.interpreters import xla
from jax._src.lib import ndimage
from jax._src.numpy import lax_numpy as jnp
__all__ = [
"affine_transform",
"affine_transform_p",
]
def affine_transform(I, H):
return affine_transform_p.bind(I, ... |
<reponame>fzeiser/240Pu_article_supplement<gh_stars>0
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
import numpy as np
import ompy as om
import sys
import scipy.ndimage
import copy
import seaborn as sns
sns.set()
sns.set_context("paper")
# sns.set_context("talk")
# sns.set(font_scale=1.... |
<reponame>stefanv/dipy<gh_stars>0
import warnings
import numpy as np
from scipy.ndimage import map_coordinates
from dipy.reconst.recspeed import peak_finding, pdf_to_odf
from dipy.utils.spheremakers import sphere_vf_from
from scipy.fftpack import fftn, fftshift, ifftn,ifftshift
class DiffusionSpectrum(object):
'''... |
<gh_stars>0
import numpy as np
import matplotlib.pyplot as plt
from scipy.io import loadmat
from sklearn.svm import SVC
def showBoundary(svm, X, Y):
x1 = np.linspace(X[:, 0].min(), X[:, 0].max(), 200)
x2 = np.linspace(X[:, 1].min(), X[:, 1].max(), 200)
x1, x2 = np.meshgrid(x1, x2)
Yp = svm.predict(np... |
# coding: utf-8
import numpy as np
import pandas as pd
import scipy.misc as spm
import encode_decode, parse_vi
import argparse, os.path
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('likelihood_csv', type=str, help='Path to the csv file containing likelihood info.')
parser.add_... |
################################################################################
# The Neural Network (NN) based Speech Synthesis System
# https://svn.ecdf.ed.ac.uk/repo/inf/dnn_tts/
#
# Centre for Speech Technology Research
# University of Edinburgh, UK
# ... |
<reponame>herandy/Recipes
from __future__ import print_function
import os, sys
import warnings
import time
import numpy as np
import pandas as pd
from PIL import Image
from PIL import ImageOps
import itertools
import h5py
import cPickle as pickle
import timeit
import io
import glob
import pickle
from scipy.stats._co... |
# Import libraries
# You should try an import the bare minimum of modules
import sys # access system routines
import os
import glob
import re
import math
import scipy
import numpy as np
import matplotlib.pyplot as plt
# add path to our file
sys.path.append('c:/Users/robertsheehan/Programming/Python/Common/')
sys.path... |
"""
##############################################################################################################
Author: <NAME>
Date: 19 - Marzo - 2019
Description: Script que contiene una serie de funciones útiles para el proceso de construcción del dataset.
Contiene las funciones necesarias para importar y exportar... |
<gh_stars>0
#!/usr/bin/env python
import sys
sys.path.append('..')
import numpy as np
import scipy.integrate as quad
from neml import solvers, models, elasticity, drivers, surfaces, hardening, ri_flow, creep
import matplotlib.pyplot as plt
def example1():
# T is in hours, strain in percent, stress in MPa
A = 1... |
#!/usr/bin/env python
# coding: utf-8
import glob
import os
import subprocess
import pandas as pd
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
import tensorflow
from tensorflow import keras
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, LSTM, A... |
<filename>ML_utils.py
import numpy as np
import copy
import os
import tensorflow as tf
from SALib.sample import saltelli
from SALib.analyze import sobol
from timeit import default_timer as timer
from scipy import interpolate
from scipy import stats
import pandas as pd
import seaborn as sns
from scipy.integrate import s... |
import os
import numpy as np
from scipy import misc
from detection import constants
TEST_SEQUENCE_OVERLAY_ALPHA = 0.25
TEST_SEQUENCE_OVERLAY_COLOR = [0, 255, 0]
def save_mask(path, mask):
mask_image = np.copy(mask)
mask_image *= 255
mask_image = np.clip(mask_image, 0, 255)
mask_image = np.round(mas... |
<filename>examples/unstructured.py
#%%
import bvmm
import numpy as np
import pandas as pd
from math import log
from scipy.special import gammaln
#%%
k, full = 10, False
alphabet = [chr(i) for i in range(97, 97+k)]
root = bvmm.rand_tree(1, alphabet)
root.counts[:] = [1/k] * k
bvmm.print_tree(root, alphabet, max_counts=... |
<filename>Interpolation/SplineLineal/linearSplineMethod.py<gh_stars>1-10
import sympy
from prettytable import PrettyTable
import totalPivotingMethod
x = sympy.Symbol('x')
table = PrettyTable()
xn =[1,3,4,5,7]
fxn =[4.31,1.5,3.2,2.6,1.8]
inequality =[]
functions =[]
result =[]
des = []
'''
y-y1 = m(x-x1)
y = y1+((y1-... |
<filename>showimages_collected.py
from datetime import datetime
from dataloader.framesclass import ActionsDataLoader
from models.unet_acresnet import UNetAc
from models.vision import ResNet50Model
import numpy as np
import tensorflow as tf
import os
from scipy import signal
import matplotlib.pyplot as plt
import cv2
fr... |
<reponame>Dawwie/VendingMaschine
import math
import numpy as np
import fractions as fra
from pip._vendor.msgpack.fallback import xrange
# Jeżeli wyraz wolny jest zerem
def IfZero(x):
for item in reversed(x):
if item == 0:
x.pop()
elif item != 0:
break
return x
# Dodaje ... |
'''
Created on Feb 20, 2019
@author: Christian
'''
import pandas as pd
from util._file_loader import FileLoader
from util.StatisticalSignificanceTest import StatisticalSignificanceTest
import numpy as np
from scipy.stats import chisquare, chi2_contingency
class ProfessionStatistics(object):
'''
Compute diffe... |
<reponame>nimachm81/SpheroidalFuncs
__all__ = ["SpheroidScattering"]
from scipy.integrate import quadrature, quad
import numpy as np
from scipy import constants
import matplotlib.pyplot as plt
import matplotlib
from scipy.special import pro_rad1, pro_rad2, pro_ang1
import specfun
class SpheroidScattering:
... |
from importData import importMyData
import numpy as np
from abc import ABC
from scipy.stats import multivariate_normal
from sklearn.covariance import LedoitWolf
from mainFile import *
class Bayes(Classifier):
gauss = {}
def __init__(self, train_data, train_labels, n_classes, n_samples, n_features):
self.trainData... |
'''
Tests for tickers.
'''
from numpy import *
from numpy.testing import dec,assert_,assert_raises,assert_almost_equal,assert_allclose
from matplotlib.pyplot import *
from scipy import sparse as sps
from scipy.linalg import qr,eigvalsh,norm
import time,pdb,sys
from ..ticklib import *
from ..discretization import *
... |
<reponame>Jon-GSC/MercuryCycle
# clear up version for Github, on 2020-11-28
import os
import matplotlib.pyplot as plt
import numpy as np
from scipy import interpolate
from scipy.stats import skewnorm
from collections import OrderedDict
from tools import forWeb_funs as funs
plt.rcParams.update({'font.size': 23})
cmaps ... |
# -*- coding: utf-8 -*-
import os
import scipy.misc
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
# download Mnist data
mnist = input_data.read_data_sets("./MNIST_data", one_hot=True)
# check the data shape
print(mnist.train.image... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 6 10:09:55 2018
@author: keenanszulik
"""
"""
react deps
"""
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import json as json
import numpy as np
import scipy.stats as stats
proj = pd.read_csv('/Users/keenanszulik/Do... |
<gh_stars>1-10
import unittest
import warnings
import numpy as np
import scipy.signal as sig
import pyinduct as pi
import pyinduct.hyperbolic.feedforward as hff
import pyinduct.parabolic as parabolic
from pyinduct.tests import show_plots
import pyqtgraph as pg
class ConstantTrajectoryTestCase(unittest.TestCase):
... |
"""Functions for dealing with evoked BOLD response from brain regions.
The functions in this module are integrated with the lyman hierarchy
and use Python tools (nibabel and nitime) for processing.
"""
import os
import os.path as op
from glob import glob
import hashlib
import numpy as np
import scipy as sp
from scipy... |
<filename>visualiseEGM96.py
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 28 19:31:24 2015
Plot the gravity potential of the EGM96 gravity field model at a spherical surface.
Ignore tides for simplicity.
EGM96 coefficients available at:
ftp://cddis.gsfc.nasa.gov/pub/egm96/general_info/readme.egm96
Reference for the... |
<gh_stars>0
#Based off of http://wiki.wxpython.org/GLCanvas
#Lots of help from http://wiki.wxpython.org/Getting%20Started
from OpenGL.GL import *
from OpenGL.arrays import vbo
import wx
from wx import glcanvas
from Cameras3D import *
from LaplacianSound import *
from struct import *
from sys import exit, argv
import r... |
<filename>chemex/experiments/cest/reading.py
import os
import scipy as sc
import scipy.stats as st
import scipy.linalg as la
import scipy.signal as si
import scipy.interpolate as ip
from chemex import utils
def read_data(cfg, working_dir, global_parameters, res_incl=None,
res_excl=None):
# Reads ... |
<filename>Code/PCA_single_cell_analysis.py
#imports for all pkgs
import os
from subprocess import check_output
import scipy
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style("ticks")
matplotlib.rcParams.update({'font.size': 18})
from sklearn... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 31 14:33:56 2017
@author: <NAME>
"""
import numpy as np
from scipy.spatial.distance import pdist,squareform
from ..QuantumChem.calc import GuessBonds
from ..QuantumChem.Classes.molecule import Molecule
from ..QuantumChem.read_mine import read_TrEsp_charges
fr... |
<filename>vineyard/data/build.py
# USAGE
# python build_dataset.py
import logging
import os
import random
import shutil
import numpy as np
from PIL import Image as pil_image
from imutils import paths
# import the necessary packages
from keras.preprocessing.image import save_img, img_to_array
from scipy import misc
#... |
import unittest
from statistics import median
import hypothesis.strategies as st
from hypothesis import given
from median import Solution
class Test(unittest.TestCase):
def test_1(self):
solution = Solution()
self.assertEqual(solution.findMedianSortedArrays([1, 3], [2]), 2)
def test_2(self):... |
import sys
import pickle as pkl
import networkx as nx
import numpy as np
import scipy.sparse as sp
import torch
def encode_onehot(labels):
classes = set(labels)
classes_dict = {c: np.identity(len(classes))[i, :] for i, c in
enumerate(classes)}
labels_onehot = np.array(list(map(class... |
<filename>milp_formulation.py
import random
import numpy as np
import pulp
from tqdm import tqdm
from scipy.special import factorial, comb
from collections import Counter
from itertools import combinations, permutations, product
from utils import coverage_search, coverage_search2
from utils import permute_letters, a... |
<reponame>ernestiu/Cell-spreading-analysis<filename>measure_protrusions.py
# -*- coding: utf-8 -*-
"""
"""
import numpy as np
from scipy.signal import find_peaks, savgol_filter
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
from scipy.special import expit
import math
def logistic_growth(t, ... |
<gh_stars>10-100
import pickle
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from scipy.stats import fisher_exact
with open('screen.pkl','rb') as f:
[df_auc,sequences,predicted] = pickle.load(f)
pw = pd.read_csv('hiv_ref_pw.csv')
preds = []
for row in pw.iterrows():
... |
<filename>server/pantilt.py
from statistics import median
from .setting import motorConfig
import pantilthat, threading, time
class VAR:
thread = None
threadOn = False
lock, lock2 = threading.Lock(), threading.Lock()
def moveRelative(dir, angle):
with VAR.lock:
if dir == 'left' or dir == 'dow... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 22 09:52:11 2018
@author: dykua
Metrics used for matching
"""
import numpy as np
from scipy.stats import entropy, wasserstein_distance, energy_distance
def ED(x, y):
'''
Euclidian distance. x, y are locations of top peaks, y is the reference
'''
return ... |
<filename>audio_rest.py<gh_stars>0
from __future__ import division
import numpy as np
import sys
import traceback
from skimage.draw import line
from scipy import misc
from scipy.spatial import distance
from collections import Counter
import base64
import requests
import json
import web
import uuid
import time
import si... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.optimize import minimize
import emcee
import corner
import matplotlib as mpl
mpl.rcParams['text.usetex'] = True
mpl.rcParams['font.size'] = '25'
mpl.rcParams['xtick.labelsize'] = '20'
mpl.rcParams['ytick.labelsize'] = '20'
import warni... |
#!/usr/bin/python2
# recover the chip sequence from a Direct Sequence Spread Spectrum transmission
# see: Reverse Engineering DSSS, <NAME>, REcon 2017
import numpy
import scipy.signal
from matplotlib.pylab import *
tau = numpy.pi * 2
max_samples = 1000000
min_num_chips = 5
max_seq_length = 100000 # in samples
debug ... |
import numpy as np
from scipy.stats import chi2
from sklearn.cluster import KMeans
def coreset(scores, spike_index, coreset_k, coreset_th):
"""
Coreset based on hierarchical K-means
Parameters
----------
scores: list np.array(n_data, n_features, n_channels)
spike_index: np.array(n_data, 2)
... |
#Misc
import time, os, sys, pdb, argparse
from glob import glob
from fnmatch import fnmatch
#Base
import numpy as np
import numpy.ma as ma
import pandas as pd
import scipy.io as sio
import scipy.stats as st
import multiprocessing
#Save
import json
import scipy.io as sio
import h5py
import io_dict_to_hdf5 as ioh5
#Pl... |
<reponame>cor3bit/lunar-lander<filename>code/modeling/random_action.py
import numpy as np
from scipy import stats
from tqdm import tqdm
def random_action(
env,
n_episodes,
verbose=False,
render=False,
**kwargs
):
episode_total_rewards = []
# initializes w... |
import PIL
import sys
import numpy as np
import os
from PIL import Image, ImageFont
from PIL import ImageDraw
from scipy import fftpack
import spot_locations
if sys.argv[1] == "300":
spots = spot_locations.spots_300
else:
spots = spot_locations.spots_200
img_file = sys.argv[2]
base = os.path.basename(img_file... |
import time, os
import numpy as np
import scipy.signal as sg
from PyQt5.QtCore import *
import deepspeech as ds
import pvporcupine
import struct
import pyaudio
from hue_helper import HueHelper
from led_helper import LedHelper
from cal_helper import CalHelper
from joplin_helper import JoplinHelper
from thermometer i... |
<gh_stars>0
# preprocess_CPNEFluoxetine_data.py: a file defining CPNE-Fluoxetine dataset-specific preprocessing classes and functions
# SEE LICENSE STATEMENT AT THE END OF THE FILE
# dependency import statements
import os
import pickle as pkl
import argparse
from random import shuffle, randint
import scipy.io as scio
... |
import numpy as np
from util import *
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rc('text', usetex=True)
matplotlib.rcParams['text.latex.preamble']=[r"\usepackage{amsmath}"]
from scipy import optimize
def FWHM(X,Y):
half_max = max(Y) / 2.
#find when function crosses line half_max (when sign o... |
<reponame>tristone13th/PySparseLP<filename>pysparselp/MehrotraPDIP.py
"""Interior Point LP Solver.
For reference, please refer to "On the Implementation of a Primal-Dual
Interior Point Method" by <NAME>.
https://www.researchgate.net/publication/230873223_On_the_Implementation_of_a_Primal-Dual_Interior_Point_Method
thi... |
import numpy
import scipy.io
import matplotlib.pyplot
# load the data needed
mat = scipy.io.loadmat("problem1.mat")
x_data = mat.get('x')
y_data = mat.get('y')
order = 10
# modelOrder = numpy.random(0, 10)
# initialize X matrix
print(len(mat['x']))
print(type(mat['x']))
xx = numpy.zeros((x_data.shape[0], order))
pri... |
import time
import math as mt
import numpy as np
from scipy import interpolate
from .state_manager import StateManager
from primitives.planning.planners import SkeletonPlanning
from primitives.formation.control import FormationControl
from primitives.mrta.task_allocation import MRTA
class ActionManager(StateManag... |
<reponame>debnoob/em_examples
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
from SimPEG import Mesh, Maps, SolverLU, Utils
from SimPEG.Utils import ExtractCoreMesh
import numpy as np
from SimPEG.EM.Static import DC, IP
import matplotlib
import matp... |
import numpy as np
import math
import matplotlib.pyplot as plt
from scipy.stats import norm
from scipy.stats import invgamma
from scipy.stats import gaussian_kde
def mean_posterior(data, mu_0, sigma2_0, variance):
n = float(len(data))
sample_mean = np.mean(data)
posterior_mean = ((mu_0*variance)/n + sampl... |
from .base_metric import BaseMetric
from ..query import Query
from ..word_embedding_model import WordEmbeddingModel
from scipy.spatial import distance
import numpy as np
class ExampleMetric(BaseMetric):
def __init__(self):
template_needed = (2, 1)
metric_name = '<NAME>'
metric_short_name ... |
import snake
import numpy as np
import matplotlib.pyplot as plt
# testing an emcee fitting to the lines
# make a test data set
N = 101
t = np.linspace(58000, 58099.5, N)
np.random.seed(77)
t_inflexion = np.linspace(58000,58100, 12)
t_inflexion += np.random.uniform(0,5,size=t_inflexion.size)
f_min = 14
f_max = 15
... |
<gh_stars>10-100
#%%
from sympy import *
from sympy.abc import i, j, k, l, N
from sympy.utilities.codegen import codegen
n, m = symbols('n m', integer=True)
M = MatrixSymbol("M", n, m)
b = MatrixSymbol("b", m, 1)
expr = Sum(b[k, 0]*b[k, 0], (k, 0, m-1))
dexpr = diff(expr, b[j, 0])
print(dexpr)
funlist = [
('expr... |
<reponame>dpadilla-llano/CalibProc
# by <NAME> 2020
def pso4(func, lb, ub, x_init=[], v_init=[], p_init=[], fp_init=[], ieqcons=[], f_ieqcons=None, args=(), kwargs={},
swarmsize=100, max_omega=0.5, min_omega=0.5, phip=0.5, phig=0.5, minFractionNeighbors=0.25,
maxiter=100, minstep=1e-8, minfunc=1e-8,... |
import startup
import sys
import os
import glob
import argparse
import numpy as np
import scipy.io
from util.fs import mkdir_if_missing
import open3d
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument("--inp_dir", type=str)
parser.add_argument("--out_dir", type=str)
pars... |
<filename>core/generate_embeddings/build_tfidf_features.py
import os
import pickle
import numpy as np
from scipy.sparse import hstack
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
from sklearn import preprocessing
from iml_group_proj.config import RANDOM_STATE
from iml_group_proj.data.uti... |
#!/usr/bin/python3
# a poor man luminosity sensor with digital pins
# a photoresistor is chained with a 47uF capacitor
# we set the voltage to zero and count the time to
# get a high value again
import RPi.GPIO as GPIO
import time
import statistics
import settings
def get_lum():
GPIO.setup(settings.PIN, GPIO.O... |
import functools
from flask import (
Blueprint, flash, g, redirect, render_template, request, session, url_for
)
from werkzeug.exceptions import abort
from scipy.optimize import curve_fit
import numpy as np
import requests
import json
import time
bp = Blueprint('kill_times', __name__)
# decorator function (requir... |
<filename>tests/test_cram.py<gh_stars>100-1000
"""CRAM Tests"""
import numpy as np
import scipy.sparse as sp
import scipy.sparse.linalg as spla
from nose.tools import assert_true
from pyne import cram
DTYPES = ['f8', np.complex128]
def test_solve_identity_ones():
for dtype in DTYPES:
b = np.ones(cram.N... |
#!/usr/bin/env python
import argparse
import numpy as np
import tqdm
import sys
from LLC_Membranes.llclib import timeseries, fitting_functions, stats, rand
from LLC_Membranes.analysis import Poly_fit
import matplotlib.pyplot as plt
from multiprocessing import Pool
import time as timer
import fbm
from LLC_Membranes.tim... |
<gh_stars>1-10
import sys
import numpy as np
from scipy.integrate import ode
from pbpl import compton
from pbpl.common.units import *
def calc_electron_trajectory(n0, x0, KE, E, B, dx, cutoff):
m0 = me
q0 = -eplus
rest_energy = m0*c_light**2
total_energy = rest_energy + KE
gamma0 = total_energy/res... |
import os
import cv2
import time
import pickle
import numpy as np
from PIL import Image
import tensorflow as tf
from src.modules import utils
from src.ALIGNMENT import ALIGN
from src.modules.utils import l2_norm
from src.modules.models import ArcFaceModel
from scipy.spatial.distance import euclidean
def load_pickle(p... |
<filename>Machine_Learning_and_Parallel_Computing/FINAL_MLP_MAXMIN/mlp.py
import tensorflow as tf
import numpy as np
import scipy.io as scio
import math as ma
from tensorflow.contrib import layers
import time
def next_batch(data, label, batch_size):
index = np.arange(7293)
np.random.shuffle(index)
index =... |
<reponame>lorentzenchr/scipy
import numpy as np
from scipy.linalg import bandwidth, issymmetric, ishermitian
import pytest
from pytest import raises
def test_bandwidth_dtypes():
n = 5
for t in np.typecodes['All']:
A = np.zeros([n, n], dtype=t)
if t in 'eUVOMm':
raises(TypeError, ba... |
<filename>neogem.py
import numpy as np
import tables
import glob
from scipy import ndimage,stats
from scipy.optimize import curve_fit
import matplotlib.cm as pltcm
import matplotlib.pyplot as plt
#from matplotlib.colors import LogNorm
from matplotlib.backends.backend_pdf import PdfPages
from optparse import OptionP... |
import os
from operator import itemgetter
# Comment next line to run on GPU. With this configuration, it looks to run faster on CPU i7-8650U
os.environ['CUDA_VISIBLE_D5EVICES'] = '-1'
import random
import warnings
import gym
from keras.layers import Dense, Flatten
from keras.models import Sequential
from keras.optim... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.