text string |
|---|
import numpy as np
from numpy.linalg import inv, eigvals, svd
from scipy.linalg import sqrtm
from scipy.special import comb
_eps = 10 ** (-10)
class SpectralClustering:
def __init__(self, method, verbose=False):
self.verbose = verbose
self.method = method.lower()
assert type(method) == ... |
from collections import Counter
from concurrent.futures import ProcessPoolExecutor
import concurrent
from typing import List, Any, Generator, Tuple, KeysView, ValuesView, Dict
import scipy as sp
from scipy import sparse
import numpy as np
from tokenizers.spacy_tokenizer import SpacyTokenizer
from logger import logger... |
<reponame>MaayanLab/cst_drug_treatment<gh_stars>1-10
def main():
'''
This script will make cell-line by cell-line distnace vectors and using the
gene expression data (with and withouth gene-zscoring) and PTM data. I'll
then check how different PTM data processing methods (normalization/filtering)
affect the d... |
<filename>sputterINPUT.py
from dataclasses import dataclass, field
from typing import Union
import numpy as np
from scipy.integrate import quad
import matplotlib.pyplot as plt
import numba
from numba.experimental import jitclass
from numba import float64
onethird = 1./3.
twothird = 2. * onethird
fourpi = 4. * np.pi
... |
#! /usr/bin/python3
from abc import ABCMeta, abstractmethod
from numbers import Number
from typing import Union, List
import numpy as np
from scipy.stats import norm
from dgp import DGP
NORMAL_QUANTILE = norm.ppf(0.975)
class Evaluator(metaclass=ABCMeta):
def __init__(self) -> None:
pass
@abstra... |
#!/usr/bin/env python
import rospy
from geometry_msgs.msg import PoseStamped
from std_msgs.msg import Int32
from styx_msgs.msg import Lane, Waypoint
from scipy.spatial import KDTree
import numpy as np
import math
'''
This node will publish waypoints from the car's current position to some `x` distance ahead.
As ment... |
import numpy as np
from scipy.linalg import expm
from random import random, randint
from copy import deepcopy
from .Dyn import Dyn
class LinDyn(Dyn):
def __init__(self, A):
if not isinstance(A, np.ndarray):
A = np.array(A)
self._A = A
def A(self):
return self._A
def ... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.stats import norm
def plot_prob(y, mu, sigma, ax):
x = np.linspace(mu-3*sigma, mu+3*sigma, 35)
probs = [norm.pdf(k, loc=mu, scale=sigma) for k in x]
ax.vlines([y],[0],[np.max(probs)*1.3], color='red')
ax.vlines([mu],[0],[np.max(... |
import matplotlib
from sklearn import preprocessing
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import numpy, scipy, librosa, audioread, wave
import librosa.display
import sys, os
def showmfcc(wavpath,i):
t, spe = librosa.load(wavpath)
mfccs = librosa.feature.mfcc(t, sr=spe)
name = "E:/video-c... |
<reponame>sfefilatyev/cuda_python_examples
# This example shows calculation of integral value for PI using cuRAND library.
import pycuda.autoinit
import pycuda.driver as drv
from pycuda import gpuarray
from pycuda.compiler import SourceModule
import numpy as np
from sympy import Rational
ker = SourceModule(
no_extern... |
<gh_stars>1-10
import os
from scipy import spatial
import sys
from sent2vec.constants import PRETRAINED_VECTORS_PATH_WIKI, ROOT_DIR
from sent2vec.vectorizer import Vectorizer, BertVectorizer
from sent2vec.splitter import Splitter
def test_bert_01():
sentences = [
"This is an awesome book to learn NLP.",
... |
<reponame>aertslab/SCopeLoomPy
import anndata
import loompy as lp
import pandas as pd
from pathlib import Path
import os
from scipy.sparse import issparse
import numpy as np
import json
from scopeloompy import utils
class Loom():
GLOBAL_META_DATA_KEY = 'MetaData'
def __init__(self, file_path, title, ... |
<reponame>alan-turing-institute/pcit<filename>further/test.py
from pcit.StructureEstimation import find_neighbours
import numpy as np
from scipy import stats
from sklearn.datasets import load_boston, load_iris
## bost, iris, data, stock, synth
which = 'bost'
if which == 'bost':
X = load_boston()['data']
y = n... |
#! /usr/bin/env python
"""
Generate PWL DC transfer curve from transient simulation.
The assumed PWL function consists of two flat regions and a
linear region in-between. There are two cases: positive slope
and negative slope
_________ __ max(y)
/
/
... |
from __future__ import print_function
from __future__ import absolute_import
import sys
import random
from scipy import stats
import numpy as np
from ratio import count_terms
from numba import jit
class AbstractCorrection(object):
def __init__(self, pvals, a=.05, array=False):
if array:
self.p... |
<reponame>QROWD/transportation_mode_detection
"""
File copied from the PWCTools distribution available at
http://www.maxlittle.net/software/pwctools.zip with minor code style
adjustments.
Ported by <NAME> [http://mv.nanoscopy.eu <EMAIL>]
"""
import numpy as np
from scipy.signal import medfilt
def pwc_medfiltit(y, W)... |
#forecast simulations
import numpy as np
import pandas as pd
from sklearn.model_selection._split import (_BaseKFold)
import warnings
import numbers
import time
from traceback import format_exception_only
import numpy as np
import scipy.sparse as sp
from sklearn.base import is_classifier, clone
from sklearn.utils i... |
<gh_stars>0
'''
Created on Jan 5, 2016
@author: <NAME> <<EMAIL>>
'''
from __future__ import division
import numpy as np
from scipy import special
class PrimacyCodingMixin(object):
# default parameters that are used to initialize a class if not overwritten
parameters_default = {
'coding_receptors'... |
# flake8: noqa
from scipy.ndimage import gaussian_filter
from aydin.io.datasets import cropped_newyork, dots, dmel, add_noise
from aydin.it.classic_denoisers.butterworth import denoise_butterworth
from aydin.it.classic_denoisers.demo.demo_2D_butterworth import demo_butterworth
from aydin.it.classic_denoisers.test.util... |
<reponame>jlashner/ares
"""
ExcursionSet.py
Author: <NAME>
Affiliation: McGill
Created on: Mon 18 Feb 2019 10:38:06 EST
Description:
"""
import numpy as np
from .Constants import rho_cgs
from .Cosmology import Cosmology
from ..util.Math import central_difference
from ..util.ParameterFile import ParameterFile
from... |
<reponame>htjb/maxsmooth
import numpy as np
from scipy.special import lpmv
class derivative_class(object):
def __init__(
self, x, y, params, N, pivot_point, model_type, zero_crossings,
constraints, new_basis, **kwargs):
self.x = x
self.y = y
self.N = N
... |
import warnings
import numpy as np
from GPy.models import GPRegression
from GPy.kern import Matern32
from sklearn.preprocessing import StandardScaler
from scipy.optimize import minimize
from scipy.special import erfc
from scipy.stats import norm
class OptimisationResult(object):
def __init__(self, other=None):
... |
from copy import deepcopy
import scipy
from . import calc_clust, run_filter, make_sim_mat, cat_pval
from . import enrichr_functions as enr_fun
def make_clust(net, dist_type='cosine', run_clustering=True, dendro=True,
requested_views=['pct_row_sum', 'N_row_sum'],
link... |
<gh_stars>1-10
from text_processing import text_normalizer
from time import time
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
from sklearn.decomposition import NMF, LatentDirichletAllocation
from joblib import dump, load
import pickle
import os
import spacy
import numpy as np
from gensim... |
<gh_stars>0
import os
import numpy as np
from utils.constants import TZ_COND_DICT
from analysis import compute_stats, remove_none
from scipy.stats import pearsonr, sem, ttest_rel
from scipy import ndimage
from collections import defaultdict
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(style='white', pa... |
<gh_stars>0
"""
emg_diagnosis.py
Author: <NAME>
Email: <EMAIL>
Module contains the ANN functions for diagnosing EMG signals.
(For future development of the package).
"""
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow import keras as k
import wfdb
from . ... |
import numpy as np
import scipy
class gblockucl(Strategy):
def __init___(self, bandit, turns=10, mu, sigma):
Strategy.__init__(self, bandit, turns)
self._mu = mu # Kx1
self._sigma = sigma # Kx1
self._prior = numpy.random.multivariate_normal(self._mu, self._sigma * np.identity(sel... |
<reponame>kgourgou/concentration-information-bounds
# KL divergences
from scipy import log
from scipy.special import gamma, digamma
import scipy
# TODO missing KLTruncatedNormal
def KLSampling(ratio, data):
"""
Computes KL(q||p) by using samples of q.
Some very elementary checks are made to make sure th... |
<filename>chapter1/tools.py<gh_stars>10-100
import cv2
import numpy as np
from functools import lru_cache
from scipy.interpolate import UnivariateSpline
from typing import Tuple
def spline_to_lookup_table(spline_breaks: list, break_values: list):
spl = UnivariateSpline(spline_breaks, break_values)
return spl(... |
<reponame>JakeColtman/SurPyval<gh_stars>1-10
import numpy as np
from scipy.optimize import minimize
class PieceWiseConstantHazards:
def __init__(self, y_s, x_s, event, period_lengths):
self.y_s, self.x_s, self.event, self.period_lengths = y_s, x_s, event, period_lengths
@staticmethod
def lifetime... |
import matplotlib.pyplot as plt
import scipy.spatial
from src.data.image import common
def reflect_x(xy, max_x=120):
return [[max_x + (max_x - x), y] for x, y in xy]
def reflect_y(xy, max_y=80):
return [[x, (max_y + (max_y - y))] for x, y in xy]
def bounded_voronoi(points, xlim=(-1, 121), ylim=(-1, 81)):... |
<filename>src/results/metrics.py
import os
import neptune
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from tqdm import tqdm as tqdm
from scipy.stats import ttest_ind as ttest,pearsonr
import scipy
import xarray as xr
from scipy.spatial.distance import pdist,squareform,cd... |
<reponame>hailieqh/3D-Object-Primitive-Graph<filename>process_data/all/code/projection.py
from skimage import io, transform
from PyEXR import PyEXRImage
import scipy.io
import numpy as np
import math
import time
import json
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import os
import copy
import ma... |
import argparse
import sys
import numpy as np
import scipy.io as sio
from pyActionRecog.utils.video_funcs import default_aggregation_func
from pyActionRecog.utils.metrics import mean_class_accuracy, class_accuracy
def get_score(score_files, xxxx = 0.4):
crop_agg = "mean"
score_npz_files = [np.load(x) for x i... |
<gh_stars>0
# Copyright 2019 Huawei Technologies Co., Ltd
#
# 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 ... |
# ---------------------------------
# Prepare the data etc.
# ----------------------------------
import numpy as np
import pandas as pd
# Data creation (just random data)
rand = np.random.RandomState(71)
train_x = pd.DataFrame(rand.uniform(0.0, 1.0, (10000, 2)), columns=['model1', 'model2'])
adv_train = pd.Series(rand... |
import glob
import sys
import cPickle
from os.path import join
import numpy as n
import astropy.io.fits as fits
import os
import astropy.cosmology as co
cosmo = co.Planck13
import astropy.units as uu
import matplotlib
#matplotlib.use('pdf')
matplotlib.rcParams['font.size']=12
import matplotlib.pyplot as p
from scipy... |
from typing import Tuple, List
import gin
import tensorflow as tf
from scipy.special import owens_t
from tensorflow_probability import distributions as tfd
import numpy as np
import gpflow
from gpflow import Parameter
from gpflow import set_trainable
from gpflow.utilities import positive
from tf_agents.environments.tf... |
import numpy as np
import scipy.spatial
def stein_kernel_matrices(
X,
score_X,
kernel_type,
bandwidths_collection,
beta_imq,
):
"""
Compute Stein kernel matrices for several bandwidths.
Function adapted from https://github.com/pierreablin/ksddescent/blob/main/ksddescent/kernels.py
... |
#!/usr/bin/env python
import sys
import numpy as np
import math
from numpy import array, zeros, ones, around, unwrap, log10, angle, mean
from scipy.signal import lfilter, freqz, remez
from scipy import signal
import matplotlib.pyplot as plt
from openxcvr import Xcvr
xcvr = Xcvr("/dev/ttyUSB0")
parameters = []
for pa... |
<reponame>kcv-if/Agendernet-SSD
import numpy as np
import cv2
import dlib
import os
import pandas as pd
import datetime
import numpy as np
from datetime import datetime, timedelta
from tqdm import tqdm
from scipy.io import loadmat
def clean_data(db_frame: pd.DataFrame):
"""
Clean DataFrame from abnormal data
... |
import numpy as np
import matplotlib.pyplot as plt
import math as m
from Bezier import *
import time
from scipy.optimize import minimize
from sklearn.preprocessing import normalize
track_width = 1.4
set_track_width(track_width+0.1+0.5)
set_V_A_lim(14,10,5)
cone_radius = 0.15+0.1
center_offset = track_widt... |
from SequenceType.Geometric import GeometricSequence
from SequenceType.GeneralFib import GeneralFibonacciSequence
from SequenceType.Polynomial import PolynomialSequence
from SequenceType.Harmonic import HarmonicSequence
from SequenceType.CatalanNumber import CatalanNumberSequence
import sympy
from common.util import re... |
# import wrappers
# make method which does the following, take mano as parameter
# get start time
# sleep 5 min
# get NS instantiation time
# send instantiation request to osm/sonata
from wrappers import OSMClient
import time
import json
import requests
from urllib.request import urlopen
import csv
import os
import d... |
<reponame>mikh-rich-is-team/physics_modeling<filename>calculation_of_naphtalene_molecule_by_the_Huckel_method/matrix.py
import copy
from config import Config
import sympy as sym
class Matrix:
def __init__(self, x):
# string_matrix = Config.string_matrix
#
# matrix = []
# for i in ... |
<filename>pyknon/simplemusic.py
"""
A simple numeric library for music computation.
This module is good for teaching, demonstrations, and quick hacks. To
generate actual music you should use the music module.
"""
from __future__ import division
from itertools import combinations, chain
from fractions import Fraction... |
<reponame>aoustry/LSIP-Relaxations<filename>ALROMPSolver.py
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 16 17:30:32 2020
@author: aoust
"""
from Bundle import Bundle
import numpy as np
import qpsolvers
import time
import pandas as pd
import FiniteConstraintRelaxationSolver
from docplex.mp.advmodel imp... |
import json
import logging
import numpy as np
import os
from scipy.stats import pearsonr, spearmanr, kendalltau
from src.LM_experiments.BERT_NS import run_bert_ns
from src.LM_experiments.BERT_GPT2 import run_lm
from configuration import CONFIG_DIR
from datasets import DATASETS_DIR
from experiments_output import OUTP... |
<reponame>ndem0/ATHENA<filename>tutorials/tutorial05/05_SPDE_on_athena_vectorial_AS.py
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import GPy
from scipy.stats import multivariate_normal
from scipy.linalg import sqrtm
from collections import namedtuple
from functools import partia... |
<filename>emdrp/emdrp/cudaFRAG/parallel-cuda/dilation_optimize/driver-test.py<gh_stars>1-10
#!/usr/bin/env python
# use python3
import numpy as np
import time
import sys
import argparse
import scipy
from scipy import ndimage as nd
from dpFRAG import dpFRAG
import _dilation_Extension as dilation
#labeled chunks
chunk... |
import sympy as sp
import numpy as np
from kaa.model import Model
from kaa.bundle import Bundle
class Duffing_UnitBox(Model):
def __init__(self, delta=0.05):
x1, x2 = sp.Symbol('x1'), sp.Symbol('x2')
vars = [x1, x2]
dim_sys = len(vars)
dx1 = x1 + x2*delta
dx2 = x2 + (-x... |
from scipy.sparse import csr_matrix
from scipy.sparse import lil_matrix
from scipy.sparse import diags
from sklearn.metrics.pairwise import cosine_similarity
import numpy as np
import math
def cosine_sim(matrix):
"""Given a matrix NxM, returns a new matrix with size NxN containing all the cosine
similarities ... |
<reponame>git-sunao/fft-extended-source<gh_stars>0
"""
python module for calculating microlensing magnification with finite source size effect
by <NAME>
Jan 19, 2022
"""
import numpy as np
from. import fftlog
from scipy.special import j0, j1, jn, gamma
from scipy.special import ellipk as spellipk
from scipy.special im... |
"""Auxiliary functions for the quadratic GQTPAR trust-region subsolver."""
import math
from collections import namedtuple
import numpy as np
from scipy.linalg import cho_solve
from scipy.linalg import solve_triangular
from scipy.linalg.lapack import dpotrf as compute_cholesky_factorization
from scipy.optimize._trustre... |
<filename>process_video.py
#import boto
import json
with open('settings.json') as settings_file:
settings = json.load(settings_file)
from boto.s3.connection import S3Connection
s3conn = S3Connection(settings['aws_access_key_id'], settings["aws_secret_access_key"])
mybucket = s3conn.get_bucket(settings["incoming... |
<gh_stars>100-1000
# pylint: disable=too-many-arguments,too-many-locals
import os
import json
import base64
import typing
import warnings
import urllib.parse
import urllib.request
try:
import tqdm # pylint: disable=unused-import
except ImportError: # pragma: no cover
tqdm = None
from scipy import spatial
im... |
<filename>scripts/summarize/label.py
"""
Aggregate results and organize them into one dict.
"""
import os
import sys
import time
import argparse
from datetime import datetime
from itertools import product
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.stats import sem
from scipy.stat... |
<reponame>Keesiu/meta-kaggle
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 20 12:19:34 2014
@author: <NAME>
"""
from numpy import *
import numpy as np
import glob
import re
from pylab import *
from scipy.signal import *
import pandas as pd
def bandpass(sig,band,fs):
B,A = butter(5, array(band)/(fs... |
<gh_stars>0
import PIL.Image
import statistics
from prt.color import Color
from prt.light import BlinnPhongLight
from prt.point import Point
from prt.ray import Ray
from prt.sphere import Sphere
from prt.vector import Vector
from prt.volume import Volume
def test_main(top, bottom, left, right, near, resolution_facto... |
# Copyright 2019, <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# dis... |
<filename>audio/spectrogram.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Spectrogram of WAV file
# https://pythontic.com/visualization/signals/spectrogram
import matplotlib.pyplot as plot
from scipy.io import wavfile
# Read the wav file (mono)
samplingFrequency, signalData = wavfile.read('dataset/BASIC5000_0... |
"""
As the number of dimensions increases linear, the number of samples increases
exponentially. This is known as the curse of dimensionality. Except for
switching to Monte Carlo integration, the is no way to completly guard against
this problem. However, there are some possibility to mitigate the problem
personally. O... |
<gh_stars>10-100
__author__ = "<NAME>"
__license__ = "Apache 2"
__version__ = "2.0.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL> or <EMAIL>"
__project__ = "LLP - MicroPheno"
__website__ = "https://llp.berkeley.edu/micropheno/"
import re
import scipy.cluster.hierarchy as hac
import matplotlib.pyplot as plt
class ... |
<filename>train.py
"""Training script for the ScryGan network.
This script trains a network with ScryGan using data from a wav file corpus,
"""
from __future__ import print_function
import argparse
from datetime import datetime
import yaml
import os
import sys
import time
import random
import tensorflow as tf
impor... |
import os
import time
from scipy.io import loadmat
import h5py
import pandas as pd
import numpy as np
from tqdm import tqdm
from modAL.models import ActiveLearner
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.cluster import KMeans
from sklearn.ensembl... |
<reponame>huabeixiaobai/DSSM_e
"""
利用监督数据生成的embedding,来评估cv和jd的匹配度
"""
import numpy as np
from scipy.spatial.distance import cosine
from sklearn.metrics import classification_report
from gensim.models.keyedvectors import KeyedVectors
from sklearn.metrics import roc_curve
from sklearn.metrics import auc
def entity_avg... |
<reponame>titipata/penn-events-calendar<gh_stars>1-10
import os
import hug
import json
import numpy as np
import pandas as pd
from datetime import datetime, timedelta
from dateutil import parser
from scipy.spatial.distance import cosine
from elasticsearch import Elasticsearch
from elasticsearch_dsl import Search
from ... |
from argparse import ArgumentParser
from detectives.mapping import string_to_detective as mapping
from scipy.io import wavfile
import loader
def main():
parser = ArgumentParser()
parser.add_argument('filename', nargs='+')
detective_arg = 'bpm_constant'
args = parser.parse_args()
for fn in args.... |
<reponame>takluyver/xray
from cStringIO import StringIO
import numpy as np
import warnings
import xray
from xray.backends.common import AbstractWritableDataStore
from xray.conventions import (is_valid_nc3_name, coerce_nc3_dtype,
encode_cf_variable)
from xray.utils import Frozen
class Sc... |
<gh_stars>1-10
from SurfaceTopography import make_sphere
import ContactMechanics as Solid
from ContactMechanics.Systems import NonSmoothContactSystem
import scipy.optimize as optim
import numpy as np
import pytest
# import matplotlib.pyplot as plt
@pytest.mark.parametrize("s", [1., 2.])
def test_primal_obj(s):
... |
import numpy as np
import math
from scipy.interpolate import BSpline
def count_support_onesparse(input, ref):
"""
Computes the percentage of same elements in two lists or 1d numpy arrays.
"""
# deal with 1d row-array
if isinstance(ref, np.ndarray):
ref = ref.flatten()
if isinstance(inp... |
<filename>mechanistic/ssn.py
#!/usr/bin/env python
###
# A mini library containing the functions typically used when running
# simulations using the supralinear stabilized network (Rubin et al., 2015).
#
# <NAME>, September 2015
import numpy as np
import scipy.io
import matplotlib.image as mpimg
class SSNetwork:
... |
<gh_stars>1-10
import scipy as sp
import numpy as np
try:
import cupy as cp
except ImportError:
import numpy as cp
import utils as u
import time
import sys
import scipy.linalg as sl
import numpy.linalg as nl
import pickle
eps = sys.float_info.epsilon
def Psi2Rho(psi):
return np.einsum('i,j->ij', psi, np.... |
#!/usr/bin/env python3
# pyfu/rebin.py
import logging
import numpy as np
import sys
import yaml
from astropy.table import Table,Column
from astropy import units as u
from matplotlib import pyplot as plt
from scipy.ndimage import gaussian_filter1d
from pyFU.display import show_with_menu
from pyFU.utils ... |
# source https://stackoverflow.com/a/55209505/5476399
# Imports
from scipy.io import wavfile
import scipy.signal as sps
# Your new sampling rate
new_rate = 16000
path = "wav_files/test.wav"
# Read file
sampling_rate, data = wavfile.read(path)
# Resample data
number_of_samples = round(len(data) * float(new_rate) / ... |
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 14 15:46:07 2019
@author: eliseu.lucena
"""
import numpy as np
from scipy import stats
jogadores = [40000,18000,12000,250000,30000,140000,300000,40000,800000]
np.mean(jogadores)
np.median(jogadores)
quantile = np.quantile(jogadores,q=0.8)
stdVariance = np.std(joga... |
"""
These "unit tests" are purely visual, and won't be run via pytest.
The main goal here is just to make sure that the confidence sequences
look reasonable. It is advisable to run these before pushing to GitHub.
"""
from confseq.cs_plots import *
from confseq.betting_strategies import *
from confseq.betting import *
... |
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 4 17:55:20 2020
@author: <NAME>
"""
import numpy as np
import scipy
from scipy.stats import norm
import numpy.random as npr
import random
import utils as ut
import learningutil as lt
def d_prime(CF):
d = []
for i in range(len(CF[1])):
H = CF[i, i]/sum(C... |
#!/usr/bin/env python
import logging
log = logging.getLogger(__name__)
#logging.basicConfig(level=logging.DEBUG)
logging.basicConfig()
import sys
import argparse
import os
import glob
import numpy as np
import time
import traceback
start_time = None
end_time = None
count = 0
from scipy.optimize import fmin_bfgs
NU... |
import numpy
from sympy import Rational as frac
from sympy import cos, pi, sin, sqrt
from ..helpers import article, untangle
from ._helpers import NCubeScheme, _s
_citation = article(
authors=["<NAME>"],
title="Remarks on the Disposition of Points in Numerical Integration Formulas",
journal="Mathematical ... |
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 12 2015 09:34
@author: ftranschel
Adaption for the dissipative evoMPS extension. Lots of stuff to do, because the
implementation of sparse codes for huge interaction matrices in the 2D FH case
breaks compatibility with the compiled c code of standard evoMPS in some cases... |
<reponame>aalto-ml4h/pummel-regression
import sys, os
import datetime
from pathlib import Path
import warnings
warnings.simplefilter("ignore")
import copy
import re
import torch
import time
import torch
from torch.utils.data import Dataset, DataLoader
import torch.optim as optim
import torch.nn.functional as F
impor... |
import PySimpleGUI as sg
import statistics as stats
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
def clean_data(window):
""" clean and parse the raw data """
raw = window.AllKeysDict["-MLINE RAW-"].DefaultText.split("\n")
# remove whitespace
data = [r... |
<reponame>HillaPeter/FinalProject<gh_stars>0
import pandas as pd
from sklearn import linear_model
import statsmodels.api as sm
import numpy as np
from scipy import stats
df_all = pd.read_csv("/mnt/nadavrap-students/STS/data/imputed_data2.csv")
# print(df_all.head())
#
print(df_all.columns.tolist())
print (df_all.in... |
import tensorflow as tf
import numpy as np
import scipy.io.wavfile as wav
from python_speech_features import logfbank, mfcc, ssc
from postprocess import postprocess_model_outputs
class VisemeRegressor(object):
def __init__(self, pb_filepath):
# Load forzen graph
self.pb_filepath = pb_filepath
... |
import numpy as np
from numpy import sin, cos, einsum
from scipy.special import j0, j1, jn_zeros
from rssympim.constants import constants as consts
# Commented out until MPI implementation is ready
from mpi4py import MPI as mpi
# # #
#
# A Note On Indexing Conventions
#
# # #
#
# This class relies heavily on the einsu... |
<reponame>JoshKarpel/simulacra
import logging
from typing import Callable, Tuple, Union
import numpy as np
import numpy.random as rand
import scipy.special as special
import scipy.integrate as integ
from . import exceptions
from . import units as u
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
... |
from nibabel import four_to_three
from nibabel.processing import resample_to_output, resample_from_to
from skimage.measure import regionprops, label
from skimage.transform import resize
from tensorflow.python.keras.models import load_model
from scipy.ndimage import zoom
import os
import nibabel as nib
from os.path impo... |
<reponame>gineer01/pygnclib<filename>paypal.py
#!/usr/bin/env python
#
# This file is part of the pygnclib project.
#
# 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://mozilla.org/MPL/2.0/.
#
... |
import time
import copy
import numpy as np
import matplotlib.pyplot as plt
import math
import os
from shutil import copy2
from mpl_toolkits.axes_grid1 import make_axes_locatable
from mpi4py import MPI
import sys
import scipy.io as sio
from pysit import *
from pysit.gallery import horizontal_reflector
from pysit.util... |
import numpy as np
import scipy.stats as si
#S: spot price
#K: strike price
#T: time to maturity % year; choose 252 trading days or 365 calendar days i.e 30/252 or 30/365, it should be how much time left not total option duration
#r: interest rate
#sigma: volatility of underlying asset
... |
<filename>FET_PET_ICC_stats.py
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 26 09:10:23 2021
@author: cbri3325
"""
#%% Import functions
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
import pandas as pd
import datetime
import os
import glob
import shutil
import xlsxwriter
import time... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 4 15:42:42 2020
@author: elizabeth
"""
import numpy as np
from scipy import ndimage as ndi
import scipy
import os, sys
import SimpleITK as sitk
import argparse
import ants
from skimage.transform import resize
import glob
import re
import matplotl... |
"""
This file contains the class ExactMethod described in
<NAME>, <NAME>, <NAME>, <NAME>,
Multi-scale Mining of Kinematic Distributions with Wavelets.
"""
from __future__ import absolute_import
import numpy as np
import scipy.special as spf
from scipy.optimize import curve_fit
import math
from mpmath import mp
from ..... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
##########################################################################
#
# AutoTST - Automated Transition State Theory
#
# Copyright (c) 2015-2020 <NAME> (<EMAIL>)
# and the AutoTST Team
#
# Permission is hereby granted, free of charge, to any person obtaining a
# ... |
<reponame>uncc-visionlab/ros_rgbd_cnn
import numpy as np
import scipy.io
import imageio
import h5py
import os
from torch.utils.data import Dataset
import matplotlib
import matplotlib.colors
import skimage.transform
import random
import torchvision
import torch
from ros_rgbd_cnn.utils import depth2plane
from train_rgbpl... |
## header file for imports etc
## also sets up the global variables
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import itertools
import sys
import os.path
from copy import deepcopy
# from IPython import display
## color palettes
palette0 = sns.color... |
<gh_stars>0
from tkinter import W
import numpy as np
from scipy.linalg import expm, sinm, cosm
from scipy import integrate
from numpy import sin, cos, conj, cumsum, real, zeros, pi, trapz, arange, vstack, hstack, meshgrid, sqrt, diag, einsum, newaxis, float32
from numpy.random import rand
from scipy.integrate imp... |
from itertools import groupby, chain
from collections import Counter
import networkx as nx
from .utils import normalise_counters
import numpy as np
from itertools import combinations, permutations
from collections import defaultdict
import pandas as pd
from scipy.linalg import eigh
def local_role_den... |
<reponame>bxclib2/TCN
from scipy.io import loadmat
import torch
import numpy as np
def data_generator(dataset='./data/datalabel.mat'):
print('data...')
data = loadmat(dataset)
concat_data = np.concatenate([data['datalabel'][0,0], data['datalabel'][0,1]])
training_data = concat_data[:600000, :]
v... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.