text string |
|---|
import sys
from data_reader import *
from scipy.stats import pearsonr, spearmanr
def get_ai_txt_2_sims(ai_txts, ai_sims, ni_txt_2_sims):
"""
The ai procedures calculate ALL similarities. Only some are manually
annotated however. So we must select the ai-similarities relevant for the
comparison.
"... |
"""
The Tornado Framework
By <NAME>
University of Ottawa, Ontario, Canada
E-mail: apesaran -at- uottawa -dot- ca / alipsgh -at- gmail -dot- com
"""
import numpy as np
from scipy.stats.mstats import rankdata
class ScoreProcessor:
"""This class is used for processing scores of (classifier, detector) ... |
"""
Script for score outlier elimination and visualization
"""
import numpy as np
from scipy.optimize import curve_fit
from scipy.stats import norm
import matplotlib.pyplot as plt
from scipy.interpolate import spline
import scipy.special as sps
def func(x_values, maximum_y, maximum_x, sigma):
t = maximum_y*np.ex... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
<gh_stars>0
import dataclasses
import numpy as np
from scipy import linalg
from scipy.stats import gamma, invgamma, invgauss, multivariate_normal
from tqdm import tqdm
@dataclasses.dataclass
class Lasso:
beta: np.ndarray
sigma_2: np.ndarray
lmbda_2: np.ndarray
u_inv: np.ndarray
def predict(x: np.nd... |
<filename>Data/Algae_Dataformating.py<gh_stars>1-10
import numpy as np
from sympy import *
import pandas as pd
def getrank(stringval):
rankmap = {}
ranklist=list()
templist=list()
keyindexlist=list()
counter=1
for i in range(len(stringval)):
if(stringval[i]!='<' and stringval[i]!='>')... |
<gh_stars>0
from graphsaint.globals import *
import math
from graphsaint.utils import *
from graphsaint.graph_samplers import *
from graphsaint.norm_aggr import *
import torch
import scipy.sparse as sp
import scipy
import numpy as np
import time
def _coo_scipy2torch(adj):
"""
convert a scipy sparse COO matr... |
<reponame>kieranricardo/pymyoEMG<filename>Scripts/optimized_model_training.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 2 13:32:44 2018
@author: <NAME>
"""
import pandas as pd
import numpy as np
from sklearn.neural_network import MLPClassif... |
# quantum solver
import numpy as np
from scipy.linalg import eigh
def ksolver(nk, nbasis, hamiton_mat, occ, debug=False):
"""
Solving for groundstate electron density & kinetic energy given a hamiltonian matrix
writen in k-space.
:param nk: number of k points
:param nbasis: number of plane wave b... |
from .back import BackNumber
from .dual import DualNumber
import numpy as np
from numpy import exp, sqrt, pi
from scipy.special import erf as sp_erf # pylint: disable=no-name-in-module
def erf(x):
if isinstance(x, BackNumber):
for node in (x,):
node.u += 1
return BackNumber(sp_erf(x.fu... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import numpy as np
from scipy.constants import epsilon_0
from ipywidgets import IntSlider, FloatSlider, FloatText, ToggleButtons
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
f... |
<filename>basilisk_env/envs/leoPowerAttitudeEnvironment.py
# 3rd party modules
import gym
import numpy as np
import scipy as sci
from scipy.linalg import expm
from gym import spaces
import copy
from basilisk_env.simulators import leoPowerAttitudeSimulator
from Basilisk.utilities import macros as mc
from Basilisk.utili... |
import os
import copy
import pyarrow as pa
from pyarrow import csv
import pandas as pd
import pyarrow.feather as feather
from rdkit.Chem import rdMolDescriptors
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit import DataStructs
import numpy as np
from datetime import timedelta
from timeit import time
f... |
<filename>tests/test_sampling.py<gh_stars>10-100
import kinetics
from scipy.stats import multivariate_normal, norm
# Define a multivariate_normal distribution, sample from it, be able to run a model.
def test_multivariate():
enzyme_1 = kinetics.Uni(kcat='enz1_kcat', kma='enz1_km', enz='enz_1', a='A',
... |
<reponame>NilaiVemula/PyCellFIT<filename>pycellfit/segmentation_transform.py
""" functions to convert between watershed and skeleton segmented images"""
import numpy as np
from scipy import stats
from pycellfit.segmentation_transform_utils import pad_with, PAD_VALUE, fill_region
def skeleton_to_watershed(skeleton_i... |
<gh_stars>1-10
import statistics
def calculate_stats(lst, print_results=False):
"""
Args:
lst (list): numeric values
print_results (bool): whether to print to console
Returns:
(dict): basic statistical results
"""
avg = stats.mean(lst)
median = stats.median(lst)
std... |
# coding: utf-8
# Call needed libraries
from sklearn.model_selection import train_test_split, cross_val_score, KFold, cross_val_predict
from scipy import misc
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from sklearn import linear_model
from sklearn.neighbors import KNeighborsClassifier... |
<filename>mvpa_itab/script/megmri/breakben_m24.py
import nibabel as ni
import numpy as np
from PIL import Image
import matplotlib.pyplot as pl
import os
import nilearn.plotting as nil
from scipy.ndimage.interpolation import shift, affine_transform, zoom
def convert_clustering(mat_file, fname_output):
from scipy.... |
"""This script computes the data for the benchmark
"""
import numpy as np
ks = np.array([1, 10, 100])
nr_refs = np.logspace(2, 6, num=15).astype(np.int32)
nr_queries = np.logspace(1, 6, num=15).astype(np.int32)
if __name__ == "__main__":
from IPython import get_ipython
from scipy.spatial import cKDTree
im... |
from sympy import pprint, simplify, satisfiable
import equibel as eb
if __name__ == '__main__':
formula = eb.random_formula(num_atoms=6, num_connectives=10)
pprint(formula)
for model in satisfiable(formula, all_models=True):
print(model)
simplified = simplify(formula)
pprint(simplified) |
<reponame>astellon/syncnet_trainer<filename>makeFileList.py
#! /usr/bin/python
# -*- encoding: utf-8 -*-
import pdb
import os
import glob
import argparse
import cv2
from scipy.io import wavfile
from tqdm import tqdm
from multiprocessing import Pool
parser = argparse.ArgumentParser(description="TrainArgs")
parser.ad... |
<filename>viz-data-gen-script/parserChain.py
import json, os, sys
from collections import defaultdict
import traceback
import statistics
def addValue(root, chain, filetype, value):
for parser in chain:
if parser not in root:
root[parser] = {'fileType' : defaultdict(list)}
root = root[p... |
<gh_stars>0
from statistics import median
from datetime import datetime
from sqlalchemy import func
from flask import flash
from flask_admin.babel import gettext
from flask_security import current_user
from wtforms import BooleanField
from wtforms.validators import DataRequired, NumberRange, InputRequired
from app.mode... |
<reponame>rodrigolece/shqod
"""Calculate features from trajectories."""
from typing import Tuple, List
from .io import UntidyLoader, read_level_grid
from .matrices import od_matrix, mobility_functional, visiting_order
from .utils import path_length, path_curvature, path_dtb
from .smoothing import smooth
import os
imp... |
import numpy as np
import scipy as sp
from numba import jit, int64
###############################################################
################# Use Only These Functions ####################
###############################################################
@jit(nopython=True)
def gegenbauer(x, kmax, d):
alpha =... |
<reponame>Dootmaan/PFSeg
# BraTS2020
import torch
import glob
import SimpleITK as sitk
import torch.utils.data
import os
from scipy import ndimage
import numpy as np
import cv2
import random
from config import config
img_size=config.input_img_size
crop_size=config.crop_size # z,x,y
# img_size=[64,96,96]
# crop_size=[... |
<reponame>AmrGalal7/DeepLearningTutorials<filename>Speech Recognition with CNN/visualise_data.py
from scipy.io import wavfile
import matplotlib.pyplot as plt
from scipy.signal import stft
import numpy as np
DIR = '/home/amrgalal7/Documents/speech_commands_v0.01'
fns = ['/off/00b01445_nohash_0.wav',
'/go/00b0144... |
"""
Script to visualize and organize read counts after quality control with fastp.
@author: <NAME>
@date: July 27, 2018
"""
# system imports
import os
os.environ['QT_QPA_PLATFORM'] = 'offscreen' # make cluster not crash
# file io imports
import json
# patten matching
import re
# numerical libraries
import numpy ... |
<reponame>grzeskokbol/pySatTools<filename>libpySat/pySatTransform.py
import datetime
import numpy as np
import libpySat as pySat
from astropy import _erfa as erfa
import warnings
from scipy import interpolate
class Transform:
def __init__(self):
self.epochSave=datetime.datetime.now()
self.rotSa... |
import numpy as np
import scipy as scipy
import lxmls.classifiers.linear_classifier as lc
import sys
from lxmls.distributions.gaussian import *
class MultinomialNaiveBayes(lc.LinearClassifier):
def __init__(self, xtype="gaussian"):
lc.LinearClassifier.__init__(self)
self.trained = False
s... |
<gh_stars>0
from fea_extractor import FeaExtractor
from fea_extractor import SKETCH, IMAGE
import argparse as ap
import numpy as np
import os
import cv2
from sklearn.svm import LinearSVC
from sklearn.externals import joblib
from scipy.cluster.vq import *
from scipy.spatial.distance import cdist
from scipy i... |
<reponame>Chenguang-Zhu/relancer
#!/usr/bin/env python
# coding: utf-8
# We are searching a solution
# ----
# data
# In[ ]:
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
# read data into dataset variable
train = pd.read_csv("../../../input/sammy123_lower-back-pain-sy... |
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.widgets import Button, SpanSelector
from scipy.constants import c
clight = c * 1e-3
# from ..sme.sme import SME_Struct
from .plot_colors import PlotColors
fmt = PlotColors()
class MaskPlot:
"""A plot that can be used t... |
import geopy.distance
from geopy.geocoders import Nominatim
from geography import Overpass
import statistics
import sys
import time
def _string_coordinate(coordinate):
"""
Private function.
It changes the type of coordinate data
from tuple with float numbers to a string.
:param coordinate: ... |
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import butter, lfilter, freqz, square
#time-frequency axis defination
fs=1001
T=1/fs
L=5001 # Keep this odd for ease of Mathematics
t=np.linspace(0,L-1,L)*T
#------------------------Delta-Modulation-------------------------
#INPUT Signal
... |
<filename>TeamMaskDetection/models/model_live.py
import numpy as np
import matplotlib.pyplot as plt
from sklearn.utils import shuffle
from sklearn.model_selection import GridSearchCV
import os
import sys
import pandas as pd
# Keras
import keras
from keras.models import Sequential
from keras.layers import Dense, Conv2D... |
#General
from datetime import datetime
from collections import Counter
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import lines
import seaborn as sns
from seaborn import displot
from seaborn import lineplot
import statsmodels.api as sm
import talib as ta
from statsmodels.st... |
<reponame>J-Moravec/CloneFinderAPI
from clonefinder.alignments.MegaAlignment import MegaAlignment
import scipy
import os
import sys
class cluster_test():
def remove_insignificant_clones(self, v_obs, CloFre_clone, clone_seq_builder, Tu2CNV, Cut):
Align=MegaAlignment()
OutAncAll='SigTest.txt' ... |
# pylint: disable=unused-argument, no-member, too-many-locals, invalid-name
""" create mesh using meshpy """
# Copyright (c) <NAME>. All rights reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
import numpy as np
import scipy.linalg as lp
from matplotlib.path import Path
import matplo... |
<filename>tests/distributions/test_bernoulli.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import paddle
import paddle.fluid as fluid
import numpy as np
from scipy import stats
from scipy.special import log... |
<gh_stars>0
# To 500HZ
import numpy as np
import pandas as pd
from scipy.fft import dct, idct
from tqdm import tqdm
def normalize(wave: np.array, wanted_std: float):
std = wave.std()
if std == 0:
return wave
else:
return (wave / wave.std()) * wanted_std
def padding(wave: np.array, wanted... |
# -*- coding: utf-8 -*-
""" Sahana Eden Climate Model
@copyright: 2011-2021 (c) Sahana Software Foundation
@license: MIT
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 witho... |
<reponame>Justin840727/seeplusplus
#!/usr/bin/env python
# for ROS
import rospy
from std_msgs.msg import Int8
import time
from statistics import mode
import cv2
from keras.models import load_model
import numpy as np
from utils.datasets import get_labels
from utils.inference import detect_faces
from utils.inference ... |
# av installation:
# using conda:
# RUN conda install av -c conda-forge
# or using pip (ubuntu 18 required):
# RUN apt-get install -y software-properties-common && \
# add-apt-repository ppa:djcj/hybrid && \
# apt-get update && \
# apt-get install -y ffmpeg
#
# RUN apt-get update && ap... |
from data_set_loader import DataSetLoader
from bagged_forest import BaggedForest, BaggedForestPredictor
from scipy.sparse import csr_matrix, vstack
import itertools
import math
import numpy as np
from inspect import signature
import pickle
class EnsembleValidatorTester:
@staticmethod
def split_data(all_featur... |
# Copyright 2017 Battelle Energy Alliance, LLC
#
# 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 agreed t... |
import numpy as np
import h5py
from astropy import wcs
from matplotlib import pyplot
from tqdm import tqdm
import pandas as pd
from scipy import linalg as la
import healpy as hp
from comancpipeline.Tools import binFuncs, stats
from comancpipeline.data import Data
from comancpipeline.MapMaking import MapTypes, OffsetT... |
<gh_stars>1-10
import contextlib
import csv
import math
import os
import pickle
import random
import copy
from matplotlib.ticker import (MultipleLocator, FormatStrFormatter,
AutoMinorLocator)
import matplotlib.pyplot as plt
import numpy
import tensorflow as tf
from django.core.managemen... |
<gh_stars>1-10
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
from hdphmm.generate_timeseries import GenARData
from LLC_Membranes.llclib import file_rw
from scipy.stats import norm
com, dt = file_rw.load_object('/home/ben/github/hdphmm/notebooks/comr.pl')
t = np.arange(com.shape[0]) * dt / ... |
<gh_stars>1-10
# Import packages
from __future__ import division, print_function
import os
import copy
import slug
import numpy as np
from astropy.io import fits
from astropy import wcs
from astropy.convolution import Gaussian2DKernel
from astropy.convolution import convolve
from astropy.table import Table, Column, hs... |
<filename>hovmoller/hovmoller_plot.py
import os, datetime
import datetime
from datetime import timedelta, date
import numpy as np
from numpy import newaxis
import scipy
import matplotlib as mpl
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap, shiftgrid
import mpl_toolkits.basemap
from collectio... |
import os, logging
import numpy as np
import matplotlib.pyplot as plt
from scipy import interp
from textwrap import wrap
from sklearn.metrics import precision_recall_curve, average_precision_score, auc
logger = logging.getLogger('eyegaze')
class VisdomLinePlotter(object):
"""Plots to Visdom"""
def __init__(s... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from sympy import *
#関数1
def f1(x):
return 1/x+exp(x)
#関数2
def f2(x):
return sin(5*x)+(x-5)**2
#黄金分割法
def golden_section(f, a, b, n):
print("(a0, b0) =",(a, b))
# τ
t = (-1+5**(1/2))/2
for i in range(n):
#λ1
r2 = t*(b-a)+a
#λ... |
# refer from test_oxford.py
# Test with clustering
from __future__ import division
import numpy as np
from sklearn import preprocessing
from Encoding import test_encoding
from evaluate import Evaluate
from pca import PCA_transform
from utils import *
from time import time
import scipy.io as sio
import pdb
import argpar... |
<reponame>YerongLi/pet
# 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 agreed to in writing, software... |
from typing import Iterable, List, Tuple
import numpy
import scipy
import click
import json
from .embeddings import Embedder
_VECTOR_DTYPE = numpy.dtype("float32")
_DEFAULT_LEAF_SIZE = 16
_PAIRWISE_DISTANCE_METRIC = "euclidean"
_DEFAULT_ANSWERS = "question-answers.json"
_DEFAULT_DATABASE = "answers.json"
_DEFAULT_V... |
"""
Contains routines to analyse coherent structures in 2D using 2nd-order cumulant
analysis
"""
import warnings
import re
import numpy as np
from scipy.constants import pi
import scipy.optimize
import scipy.integrate
from ...utils.intergrid import intergrid
import xarray as xr
from enum import Enum
import skimage.mea... |
import cv2
import numpy as np
import scipy
import torch
__all__ = [
'get_heatmaps_steps',
'decompose_projection_matrix',
'reproject_xyz_onto_world_coord',
'get_joints_from_heatmap',
'project_xyz_onto_camera_coord',
'compose_projection_matrix',
]
def get_heatmaps_steps(xyz, p_mat, width, heigh... |
import cv2
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import entropy
from scipy import ndimage
# imo = cv2.imread('ball1.jpg')
# imo = cv2.imread('room_balls.jpg')
def computeEntropy( I, Q = None):
# x,b = np.histogram( I, 20 )
x = I.flatten()
x = x/float(sum(x))
if Q is n... |
from __future__ import (absolute_import, division,
print_function, unicode_literals)
__all__ = ['Tensor', 'contract', 'distance', 'matrix_to_tensor',
'tensor_to_matrix', 'random_tensor', 'tensor_product', 'tensor_svd',
'truncated_svd', 'zeros_tensor']
import copy
import w... |
"""
pysat.model_utils - interface for modeled observations
======================================================
Main Features
-------------
- Comparison of models and measured data.
- Matching of instruments to modelled data parameters.
- Extraction of instrument-aligned data from a modelled data set.
"""
from __fu... |
# Based on the `skbio.stats.composition` module, with below copyright notice.
# The original COPYING.txt file can be found under licenses/scikit-bio.txt.
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of... |
<reponame>kalenforn/Real_time_face_recognition_with_insightface
# -*-coding: utf-8
"""
FileName: create_dataset.py
Author: kalentee
E-mail: <EMAIL>
Data: 2019-4-21 21:15
Work Speace: Visual Studio Code, Ubuntu18.04TLS, Anaconda5.1, Tensorflow1.13.1
The last modify time:2019-5-15 16:33
"""
impo... |
<reponame>maechler/a2e
from statistics import median
from numpy import percentile
from a2e.datasets.bearing import load_data
from a2e.experiment import Experiment
from a2e.processing.stats import mad
from a2e.utility import z_score as compute_z_score, compute_classification_metrics, compute_roc
run_configs = [
{'d... |
<reponame>BalazsHoranyi/movie_stream
# Create your tasks here
from __future__ import absolute_import, unicode_literals
from celery import shared_task
import pandas as pd
import pickle
from scipy.sparse import coo_matrix
from lightfm import LightFM
from movie_stream.models import Rating, Movie, LightFMModel
from django.... |
<reponame>ld32/scTE
"""
Initialise glbase, import all the libraries, set up the environment etc.
Requires:
* numpy
* matplotlib
* scipy
* sklearn
* h5py
* networkx
"""
import sys, os
#-----------------------------------------------------------------------
# Load all of the global configuration options.
try:
fro... |
import numpy as np
from scipy.stats import spearmanr
class UnivariateSimilarity(object):
"""
"""
self __init__(self, metric='pearson'):
self.metric=metric
self.simmap = {'pearson': } |
<gh_stars>10-100
import torch
from torch.autograd import Variable
import numpy as np
import os
import argparse
import random
import copy
from tqdm import tqdm
import pickle
from scorer.data_helper.json_reader import read_sorted_scores, read_articles, read_processed_scores, read_scores
from scipy.stats import spearmanr,... |
<filename>SeriesAnalysis/RegressionAnalysis/Statsmodels_LR_Residuals.py
import pandas as pd
import numpy as np
import yfinance as yf
from sklearn.linear_model import LinearRegression
import statsmodels
import statsmodels.api as sm
import statsmodels.tsa.stattools as ts
import datetime
import scipy.stats
import math
... |
"""DIP loss"""
from typing import Tuple, Dict
import sympy
import torch
from torch import Tensor
from pixyz.distributions import Distribution
from pixyz.losses.losses import Loss
from pixyz.utils import get_dict_values
def _get_cov_mu(mu: Tensor) -> Tensor:
"""Computes covariance of mu.
cov_mu = E[mu mu... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 3 00:06:46 2018
@author: <NAME>
Reference:
Approximate Parameter Learning in Conditional Random Fields: An Empirical Investigation
<NAME> and <NAME>
"""
import os
import numpy as np
#import chainer
import chainer.functions as F
from chainer impor... |
"""Created by sgoswami on 3/23/17 as part of leetcode"""
import statistics
"""There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays.
The overall run time complexity should be O(log (m+n))."""
import sys
import unittest
class Solution(object):
def find... |
import numpy as np
import pandas as pd
from copy import deepcopy
def main(net):
'''
calculate pvalue of category closeness
'''
# calculate the distance between the data points within the same category and
# compare to null distribution
for inst_rc in ['row', 'col']:
inst_nodes = deepcopy(net.dat['node... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Harmonic calculations for frequency representations"""
import warnings
import numpy as np
import scipy.interpolate
import scipy.signal
from ..util.exceptions import ParameterError
from ..util import is_unique
__all__ = ["salience", "interp_harmonics"]
def salience(
... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Methods for selecting the bin width of histograms
Ported from the astroML project: http://astroML.org/
"""
import numpy as np
from . import bayesian_blocks
__all__ = ['histogram', 'scott_bin_width', 'freedman_bin_width',
'knuth_bin_width... |
<filename>mvpa_itab/script/megmri/breakben_m36.py<gh_stars>1-10
from PIL import Image
from scipy.stats import kendalltau
from sklearn.metrics import jaccard_similarity_score, normalized_mutual_info_score
import itertools
import os
import numpy as np
from nipy.algorithms.registration.resample import resample
import ins... |
from math import *
from fractions import Fraction as F
import sys
import os
si = sys.stdin
so = sys.stdout
se = sys.stderr
ans = [0] * 101
p, q, n = 50,75,2
for i in range(101):
curdist = 0
l = 1
lft = 1.
c = i
while i < 100:
curdist += i * l / 100. * lft
... |
<reponame>dnidever/noaosourcecatalog<gh_stars>1-10
#!/usr/bin/env python
import os
import sys
import numpy as np
import warnings
from astropy.io import fits
from astropy.utils.exceptions import AstropyWarning
from astropy.table import Table
from astropy.wcs import WCS
import time
import shutil
import re
import subproc... |
<reponame>CyrilCadoux/dsp-labs
"""
Complete biquad implementation.
"""
from scipy.io import wavfile
import numpy as np
import os
from utils import add_offset
# parameters
buffer_len = 128
pole_coef = 0.95
OFFSET = 5000
# test signal
input_wav = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "_templa... |
#!/usr/bin/python
import petsc4py
import slepc4py
import sys
petsc4py.init(sys.argv)
slepc4py.init(sys.argv)
from petsc4py import PETSc
from slepc4py import SLEPc
Print = PETSc.Sys.Print
# from MatrixOperations import *
from dolfin import *
import numpy as np
import matplotlib.pylab as plt
import scipy.sparse as sps
... |
import math
import unittest
import numpy
import chainer
from chainer import backend
from chainer.backends import cuda
from chainer import initializers
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
default_scale = {
initializers.Uniform: 0.05,
}
default_coeff... |
<reponame>shun60s/glottal-source-spectrum
#coding:utf-8
# resample wav to 16Khz sampling
import os
import argparse
import librosa
import numpy as np
from scipy.io.wavfile import write as wavwrite
# Check version
# Python 3.6.4 on win32 (Windows 10)
# numpy 1.14.0
# librosa 0.6.0
# scipy 1.0.0
... |
# Copyright 2021 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
<reponame>soodsidd/instpyr
import scipy.signal as signal
import numpy as np
class MyFilter:
def __init__(self):
self.lowpassfilt=None
@classmethod
def lowpass(cls,data,cutoff, sampling):
# if self.lowpassfilt==None:
# b, a = signal.butter(10,cutoff,fs=sampling)
b,a=signal.bu... |
<reponame>richardxie1119/DCV_DA
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
#import umap
from sklearn.manifold import TSNE
from sklearn.decomposition import PCA
from scipy.stats import ranksums
from sklearn.utils import shuffle
from sklearn.metrics import roc_cu... |
<reponame>michaelRadigan/astroML
import numpy as np
from scipy import linalg
from sklearn.utils import check_random_state as sk_check_random_state
from astroML.utils.decorators import deprecated
from astroML.utils.exceptions import AstroMLDeprecationWarning
try: # SciPy >= 0.19
from scipy.special import logsumexp... |
import warnings
warnings.filterwarnings("ignore")
import argparse
import scipy
import scipy.misc
import random
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os
import torch
import torch.nn as nn
import torch.optim as optim
from torchvision import datasets, transform... |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
from __future__ import division
from datetime import datetime
from sklearn import linear_model
import pandas as pd
import numpy as np
import scipy.stats as st
import statsmodels.distributions.empirical_distribution as edis
import seaborn a... |
<gh_stars>100-1000
# Copyright 2013 Novo Nordisk Foundation Center for Biosustainability,
# Technical University of Denmark.
#
# 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.apa... |
import copy
from math import ceil
from typing import Callable, List, Tuple
from matplotlib import pyplot as plt
import numpy as np
from baselines.ga.direct_ga_fitness import DirectFitness
from baselines.ga.general_ga_pcg import _GeneralGAIndividual
from common.methods.pcg_method import PCGMethod
from games.game import... |
<gh_stars>1-10
import pandas as pd
import matplotlib.pyplot as plt
import utils
from scipy.signal import medfilt, butter
df_acc_train = pd.read_csv('data/dataset_uci/final_acc_test.txt', header=None, names=['ax', 'ay', 'az'])
df_acc_train[:500].plot()
# plt.show()
df = df_acc_train
# df['ax'] = medfilt(df['ax'].value... |
import collections
import numpy as np
import scipy.signal as signal
def gaussian_grad(im_input, sigma):
"""Performs smoothing with derivative gaussian kernel.
Uses seperable convolution to simultaneously smooth and calculate the
gradient of a grayscale image.
Parameters
----------
im_input :... |
<reponame>thanhtvt/TrackEval
import os
import numpy as np
from scipy.optimize import linear_sum_assignment
from ._base_metric import _BaseMetric
from .. import _timing
from .. import utils
# Global variables
fn_dataset = False
fp_dataset = False
idsw = False
class CLEAR(_BaseMetric):
"""Class which implements t... |
<gh_stars>1-10
import numpy as np
import torch
from scipy.special import expit
from .utils import chunks
from .utils import compute_probs
from .utils import sliding_window_view
def find_nonzero_runs(a):
# source: https://stackoverflow.com/
# questions/31544129/extract-separate-non-zero-blocks-from-array
... |
import numpy as np
import scipy.misc
# =============================================================================
# General image processing functions
# =============================================================================
def get_transform(center, scale, res, rot=0):
# Generate transformation matrix
... |
<filename>numpy/code/AEPDGP.py
import sys as Sys
# Print iterations progress
def printProgress (iteration, total, prefix = '', suffix = '', decimals = 2, barLength = 100):
"""
Call in a loop to create terminal progress bar
@params:
iteration - Required : current iteration (Int)
total ... |
<gh_stars>1-10
"""
===========================================
=== Adaptive Chirplet Transform Library ===
===========================================
# Core Functions
1. g(): Function for generating chirplets.
2. generate_chirplet_dictionary(): Generates a dictionary of chirplets along with a matrix of the associa... |
import numpy as np
from scipy.ndimage import map_coordinates
from scipy.fftpack import fftn, fftshift, ifftshift
from dipy.reconst.odf import OdfModel, OdfFit, gfa
from dipy.reconst.cache import Cache
from dipy.reconst.multi_voxel import multi_voxel_fit
from dipy.reconst.recspeed import local_maxima, remove_similar_ver... |
# https://deeplearningcourses.com/c/natural-language-processing-with-deep-learning-in-python
# https://udemy.com/natural-language-processing-with-deep-learning-in-python
from __future__ import print_function, division
from builtins import range
# Note: you may need to update your version of future
# sudo pip install -U... |
#!/usr/bin/env python
# coding: utf-8
#
# # LMC 3D structure Final Version with Systematics
#
# np.random.choice([Roger,Hector, Alfred,Luis,Angel,Xavi])
# In[ ]:
#######################
#### Load packages ####
#######################
from scipy import stats
import matplotlib.pyplot as plt
from mpl_toolkits.axe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.