text
string
#!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import sympy import matplotlib.pyplot as plt from scipy import integrate from scipy.special import legendre from numpy.polynomial.legendre import Legendre import matplotlib.ticker as mtick import itertools # Legendre polynomial def leg(n, x): r...
<reponame>robertokcanale/Tests_grayscale<filename>Scripts/use_handsnet.py import os import numpy as np import tensorflow as tf from sympy import print_ccode from tensorflow import keras #LIMITING THE GPU, i need this or it blows away gpus = tf.config.experimental.list_physical_devices('GPU') if gpus: # Restrict Te...
<gh_stars>0 import pandas as pd import sys from sklearn.naive_bayes import MultinomialNB from scipy.stats import f_oneway from mlxtend.evaluate import cochrans_q from mlxtend.evaluate import mcnemar from mlxtend.evaluate import mcnemar_table import classifier_tool as tool if __name__ == "__main__": f_in = sys.a...
#!/usr/bin/env pythonw # -*- coding: utf-8 -*- import wx import sys import os import scipy from scipy import * # need to set matplotlib backend to WXAgg or else the program just hangs import matplotlib matplotlib.use('WXAgg') from pmagpy import pmag from pmagpy import convert_2_magic as convert from pmagpy import contr...
<reponame>MickaelRigault/pysedm<gh_stars>1-10 #! /usr/bin/env python # -*- coding: utf-8 -*- """ This modules is made to find and handle the position on the spectral traces on the CCDs. """ import warnings import numpy as np import matplotlib.pyplot as mpl from scipy import sparse from astropy.utils.console import Pr...
#!/usr/bin/env python3 # vim: set noexpandtab tabstop=2 shiftwidth=2 softtabstop=-1 fileencoding=utf-8: __version__ = "0.0.3.2" import os import sys import argparse import yaml import subprocess def runcmd(cmd, log=subprocess.PIPE, echo=False): if echo: print('Running: ' + cmd) try: cp=subprocess.run('bash -c ...
''' ------------------------------------ Assignment 10 - EE2703 (Jan-May 2020) Done by <NAME> (EE18B122) Created on 02/05/20 Last Modified on 02/05/20 ------------------------------------ ''' # Imports import csv import numpy as np import numpy.fft as fft import matplotlib.pyplot as plt import scipy.signal as sgnl # ...
import unittest import numpy as np import sympy from sympy import symbols, Matrix, Eq, sqrt, FiniteSet, Derivative from scipy.optimize import root from scipy.stats import poisson, entropy from epipack import ( SymbolicEpiModel, SymbolicODEModel, SymbolicSISModel, Symbo...
<filename>plot_result.py import numpy as np import argparse import matplotlib.pyplot as plt import copy import scipy.io as sio if __name__ == '__main__': trial = 50 K = 20 N = 1 SNR = 100 B = 0 E = 1 lr = 0.05 PL = 3.0 P_r = 0.1 iid = 1 noniid_level = 2 loc = 50 kap...
<reponame>kanderso-nrel/pvOps<gh_stars>0 from scipy.interpolate import interp1d from sklearn.utils import resample from sklearn.metrics import classification_report, confusion_matrix from sklearn.metrics import accuracy_score from sklearn.model_selection import train_test_split, StratifiedKFold from sklearn.preprocessi...
from scipy.integrate import odeint import operator import inspect import numpy as np class ODEPetri: def __init__(self): self.stateVariables = [] self.stateVariableNames = {} self.dSdT = [] def add_StateVariable(self, theName, theInitial): if (theName in self.stateVariableNames...
""" Functions for creating a document-term matrix (DTM) and some compatibility functions for Gensim. """ import numpy as np from scipy.sparse import coo_matrix, issparse from .._pd_dt_compat import USE_DT #%% DTM creation def create_sparse_dtm(vocab, docs, n_unique_tokens, vocab_is_sorted=False, dtype=np.intc): ...
<filename>scripts/Figure_plotter/bckgrd_subtract_redefine_paper_figure.py<gh_stars>0 """ Created on Feb 8, 2017 @author: fangren """ import os.path import matplotlib.pyplot as plt import numpy as np from scipy.optimize import basinhopping from scipy.interpolate import interp1d from numpy.polynomial.chebyshev import c...
''' @author: <NAME> @copyright: Copyright 2016-2019, <NAME>. @license: MIT @contact: <EMAIL> ''' from __future__ import division import numpy as np from numpy.fft import rfft from numpy import argmax, mean, diff, log from scipy.signal import blackmanharris from scipy.fftpack import fft from scipy.signal...
import numpy as np import scipy.sparse as sp def unique_songs(file): """ This function returns a set of unique user - param: file : training file """ s = set() with open(file, "r") as f: for line in f: _, song, _ = line.strip().split('\t') if song not in s:...
# -*- coding: utf-8 -*- import tensorflow as tf import numpy as np import scipy.misc import time import os import glob import cv2 reader = tf.train.NewCheckpointReader("./checkpoint/CGAN_120/CGAN.model-9") def imread(path, is_grayscale=True): """ Read image using its path. Default value is gray-scale, and imag...
<reponame>MRN-Code/coinstac_gica ''' Independent Component Analysis (ICA): This script computes ICA using the INFOMAX criteria. The preprocessing steps include demeaning and whitening. ''' import numpy as np from numpy import dot from numpy.linalg import matrix_rank, inv from numpy.random import permutation from scipy....
<gh_stars>0 import jax.numpy as jnp import jax from jax.scipy.fft import dctn as jax_dctn from jax.numpy.fft import ifftn as jax_ifftn from scipy.fftpack import dctn as scp_dctn, idctn as scp_idctn, ifftn as scp_ifftn import cvgutils.Image as cvgim fn = '/home/mohammad/Projects/optimizer/DifferentiableSolver/testImage...
<reponame>OliverBamford/msc-proj from ern_functions import * from fenics import * import numpy as np import sympy as sym from matplotlib import rc import matplotlib.pylab as plt rc('font', **{'family': 'serif', 'serif': ['Computer Modern']}) rc('text', usetex=True) ## MODEL PROBLEM 1 ### mesh = UnitSquareMesh(...
''' 手动解码flv文件 用pvav frame推送保存! 比之前自己写的bitarray解码要精简,单文件完成解码 pts 开始后20秒大致 pyav解码播放: pts=17290 手工解码timestamp timestamp 4422400 /1000= pts=4422 不对 4422400/17290 = 255.77 20秒附近 手工 模拟玩家开始录像 timestamp 4426240 timestamp 4426240 CompoistionTime=0 直播中 pts 17290.0 解码结果 h264 [<av.VideoFrame #258, pts=17290 yuv420p 384x...
<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jul 14 12:10:33 2020 @author: <NAME>, Cambridge University, <EMAIL> """ import numpy as np import os import os.path from scipy.stats import beta import numpy.matlib as npm from scipy import interpolate def KLDiv(P,Q): # dist = KLDi...
#!/usr/bin/env python # coding: utf-8 # # 02__pairwise_alignment # # in this notebook, i determine the pairwise seq alignment scores between non-conserved TSS regions vs. closest TSS # In[1]: import warnings warnings.filterwarnings('ignore') import pandas as pd import math import matplotlib.pyplot as plt import n...
<gh_stars>0 import sys input = sys.stdin.readline n, m = [int(i) for i in input().split()] a = [int(i) for i in input().split()] num = [0] * n count = None for i, v in enumerate(a): num[i] = v // 2 _v = num[i] _count = 0 while True: if _v % 2 == 0: _v = _v // 2 _count...
<filename>climvis/graphics.py import matplotlib.pyplot as plt from climvis import core from scipy.stats import linregress def plot_annual_cycle(df, filepath=None): z = df.grid_point_elevation df = df.loc['1981':'2010'] df = df.groupby(df.index.month).mean() df.index = list('JFMAMJJASOND') f, ax...
<reponame>edawson/parliament2 # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # License: BSD 3 clause import numpy as np from scipy import interpolate from .base import BaseEstimator, TransformerMixin, RegressorMixin from .utils import as_float_array, check_arrays from ._isotonic im...
<filename>scqtl/simple.py<gh_stars>1-10 import numpy as np import scipy.optimize as so import scipy.special as sp import scipy.stats as st def check_args(x, size): n = x.shape[0] if x.shape != (n,): raise ValueError size = np.array(size) if size.shape != () and size.shape != x.shape: raise ValueError ...
<reponame>Krittisak/ShapeDeepLearning import numpy as np import math import random import scipy.misc from numpy.polynomial import Polynomial as P from numpy.polynomial.polynomial import polyval2d as p2d from scipy.linalg import qr from scipy.stats import ortho_group try: from poly import applyfixedpolynomial except...
from __future__ import absolute_import # import scipy.io as sio import os import matplotlib.pyplot as plt ########################################### # ML and AI Procedures for FTIR/Raman Spectroscopy # # # ########################################### import numpy as np # python 2.7 from sklearn.cross_validation impo...
from typing import List from math import sin,cos from scipy.stats import gmean, hmean from scipy.fft import fftn from numpy.linalg import norm from numpy import ( ndarray, concatenate, argmax, array, zeros, mean, sum, pad ) import numpy from ffast.poincare.token import Token from ffast.poincare.utils import P...
<gh_stars>1-10 import keras import numpy as np from keras import backend as K from keras.callbacks import ModelCheckpoint from keras.datasets import mnist from keras.layers import Conv2D, MaxPooling2D from keras.layers import Dense, Dropout, Flatten, Activation from keras.models import Sequential from scipy.special imp...
<reponame>leonheld/INE5118<gh_stars>0 from scipy.stats import binom import numpy as np import seaborn as sns import matplotlib.pyplot as plt n, p = 5, 0.4 data_binom = binom.rvs(n=20, p=0.8, loc=0, size=100000) sns.distplot(data_binom, kde = False) plt.show()
#!/usr/bin/env python # -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by <NAME> # -------------------------------------------------------- """ Demo script showing detections in sample images. ...
<reponame>YashengFu/exo-200_scripts<filename>ml-scripts/shapement_.py import pandas as pd import numpy as np import random #import nestpy import argparse import time import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages from scipy.optimize import curve_fit random.seed(0) def concat...
<reponame>NULLCT/LOMC<filename>src/data/943.py<gh_stars>0 #import sys #import numpy as np import math #from fractions import Fraction import itertools from collections import deque from collections import Counter import heapq from fractions import gcd #input=sys.stdin.readline #import bisect n, q = map(int, input().sp...
# Some helpful functions for Krylov methods # <NAME>, Texas Tech. # This code is in the public domain. import time import numpy as np import scipy.sparse as sp # A simple timer class class MyTimer: def __init__(self, name): self.name = name self.start = time.time() def stop(self): se...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ file: LaguerreGauss3d.py brief: Python configuration input file for the FDTD solver Meep simulating the scattering of a polarised Laguerre-Gaussian beam at a planar dielectric interface (3d) author: <NAME> version: 1.4.2 release date: 27.02.2020...
import torch import torchio as tio from torch.utils.data import DataLoader from time import time import pathlib import numpy as np import os from scipy.ndimage import find_objects import pytorch_lightning as pl from models import APetNet from fileio import read_nifty #------------------------------------------------...
<reponame>NumericalEnvironmental/A_Prototype_Lake_Package_for_Solute_Transport_Modeling_with_PHAST<filename>PhastLake.py #################################################### # # PhastLake.py - a lake boundary condition package # for the USGS's PHAST reactive transport model # ######################################...
from scipy import misc from math import floor, sqrt, sin, cos, pi, ceil import numpy as np import tsp from tree import Tree, TreeSegmention from pyChristofides import christofides from collections import deque class sceneGraph: def __init__(self, config_file, comm_radius, client_pos, offset=(0, 0)): self....
<gh_stars>0 import matplotlib.pyplot as plt from scipy.special import gamma import numpy as np # Plots Histogram along side acutal distribution def plotHistogram(sample, a1, a2, N): hist, bins, _ = plt.hist(sample, density=True, bins=100) xAxis = (bins[1:]+bins[:-1])/2 yAxis = [] for x in xAxis: yAxis.append(fx...
# Formalizing flowline selection algorithm for Greenland glaciers # Adding functionality to find widths # 16 March 2018 EHU ## Edits 20 Sept 2018: adding automated identification of centerline from netCDF4 import Dataset import numpy as np import matplotlib.pyplot as plt import csv import shapely.geometry as geom fro...
import tensorflow as tf import tensorflow_hub as hub from scipy.spatial import distance from sklearn.metrics.pairwise import cosine_similarity import numpy as np import math def s2v(text, embed): with tf.Session() as session: session.run([tf.global_variables_initializer(), tf.tables_initializer()]) ...
# -*- coding: utf-8 -*- """ Created on Fri Jul 10 11:23:44 2020 @author: SNC6SI: <NAME> <<EMAIL>> """ import os import re import numpy as np from .dbcparser import dbc2code from .blfc import read_info, read_data # import matlab.engine class blfload(): def __init__(self, dbc=None, blf=None, signals=None): ...
<gh_stars>0 # -*- coding: utf-8 -*- """projectcode.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1rrIdi-hMsLCm7nahb419JX9JPZ36lpeX ### Libraries """ import pandas as pd import numpy as np from scipy.stats import ttest_ind import matplotlib.pyp...
<reponame>HDI-Project/fhub_core import numbers from typing import Tuple import numpy as np import scipy.stats from scipy.special import digamma, gamma from sklearn.neighbors import NearestNeighbors from sklearn.utils import check_consistent_length from ballet.util import asarray2d, nonnegative from ballet.util.log im...
<filename>pvpy/PowerSpectrum.py # coding=utf-8 from copy import deepcopy import numpy as np from scipy import interpolate, integrate, constants from os import path # Solar Solid angular diameter from earth surface is 1919 arcseconds = 0.009303575 radians # Source: http://nssdc.gsfc.nasa.gov/planetary/factsheet/sunfact...
from requests import get, exceptions from bs4 import BeautifulSoup from datetime import datetime from termcolor import colored from yaml import safe_dump from random import uniform from time import sleep, time from statistics import median def save_data(data, file_path, open_mode, timestamp=False): try: i...
import sympy as sp from sympy.matrices.expressions.matadd import MatAdd ''' 实现Laplace展开的模块 有矩阵的表达式,请用MatAdd,MatMul实现加和乘 ''' def lap_expand(matrix, n: int = 0, coe = 1, axis: int = 0): #axis 0表示按行展开,否则按列展开 expr = _lap_expr_0(matrix, n, coe) if axis == 0 else _lap_expr_1(matrix, n, coe) return expr def ...
<reponame>ross-fisher/Post-Here-Reddit-Ranker import src.prawapi as prawapi from src.util import * import praw import pandas as pd from flask import Flask, request, json from sqlalchemy import create_engine from flask_jsonpify import jsonify from decouple import config from scipy.sparse import bsr_matrix from joblib im...
<gh_stars>0 """ A script for computing g_corr factor from simulation bandpowers. """ import os import glob import numpy as np import scipy.optimize as opt import argparse as ap from configparser import ConfigParser import xfaster as xf from xfaster import parse_tools as pt P = ap.ArgumentParser() P.add_argument("--gco...
#!/usr/bin/python ''' This script is an implementation for tanglegram for the KEGG-decoder.py versions after V.0.8 Runs tanglegram on two DataFrames - one generated from clustered KEGG metabolisms & one phylogenetic newick file provided by the user Added by <NAME> : <EMAIL> ''' def make_tanglegram(genome_df, newick, ...
import sys import os import numpy as np from scipy import stats import json import matplotlib.pyplot as plt from matplotlib import rc import collections rc('text', usetex=True) plt.rcParams["font.family"] = "Times New Roman" current_path = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.join(curren...
# -*- coding: utf-8 -*- # cython: profile=False """ Created on Fri Nov 4 13:05:59 2011 @author: <NAME> TODO: Look into using e.g. sp.linalg.fblas.zgemm._cpointer from cython? Or link it to blas at compile time using distutils... """ import scipy as sp import scipy.linalg as la #import scipy.sparse as spa c...
<reponame>Song-Jingyu/Carla-Roadside-Dataset-Generator ## Maintainer: <NAME> ##### ## Contact: <EMAIL> ##### from numpy.lib.function_base import append from scipy.optimize.nonlin import Jacobian # import torch import os import cv2 import numpy as np from sort import * from scipy.optimize import least_squares import s...
# -*- coding: utf-8 -*- import click import itertools import random import re import cPickle as pickle import numpy as np from collections import Counter from keras.preprocessing.sequence import pad_sequences from scipy.sparse import lil_matrix from sklearn.utils.class_weight import compute_class_weight from utils.to...
<reponame>luyang93/scripts #!/usr/bin/env python3 # -*- coding: utf-8 -*- # @File : LA.py # @Date : 18-9-14 # @Author : luyang(<EMAIL>) import sys import os import argparse from itertools import product from math import ceil import numpy as np from scipy.stats import chi2_contingency import xlsxwriter def pars...
from scipy.signal import filtfilt, butter def butterworth(x, order, freq=0.05): b, a = butter(order, freq) return filtfilt(b, a, x)
#!/usr/bin/env python3 ''' Tranformer GeoTiff DEM file to STL format ''' import argparse import numpy as np from osgeo import gdal from stltools import stlgenerator import scipy as sp import scipy.ndimage as scimage import click CMAX = np.inf CMIN = -np.inf ALLOWED_TYPES = {gdal.GDT_Byte,gdal.GDT_Int16,gdal.GDT_Int3...
# Problem: https://projecteuler.net/problem=581 """ Basically find all pairs of (n, n+1) such that both n and n+1 are 47-smooth. """ import sympy from sympy.solvers.diophantine.diophantine import diop_DN primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47] def is_47_smooth(n): for prime in prim...
<filename>pyllars/validation_utils.py<gh_stars>1-10 """ This module contains helpers for typical validation routines. """ import logging logger = logging.getLogger(__name__) import pyllars.utils as utils import collections import importlib import numpy as np import operator import scipy.sparse import sklearn import ...
<gh_stars>0 import networkx as nx import igraph as ig import numpy as np import glob import re from pathlib import Path import pandas as pd import matplotlib.pyplot as plt from matplotlib import gridspec import seaborn as sns; sns.set_style('white') import sys; sys.path.extend(['../', '../../', ]) from VRG.src.genera...
import numpy as np import matplotlib.pyplot as plt from matplotlib import gridspec from scipy.spatial.distance import pdist, squareform from csb.bio.utils import rmsd, radius_of_gyration as rog from ensemble_hic.analysis_functions import load_sr_samples def calculate_rgs(X): tad1 = X[:,:,:107] tad2 = X[:...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Jan 8 09:12:38 2020 @author: marianne """ import numpy as np import os from tqdm import tqdm import matplotlib.pyplot as plt from PIL import Image from scipy import interpolate import cv2 from autolabel.transformation_utilities import transform_xyz_po...
from scipy.io.wavfile import write import librosa import numpy as np def make_sr16(wav_file): sr = 16000 max_wav_value=32768.0 trim_fft_size = 1024 trim_hop_size = 256 trim_top_db = 23 silence_audio_size = trim_hop_size * 3 wav_file = 'another_audio/nem00397.wav' data, sampling_rate =...
<filename>examples/plot_generalized_cross_validation.py #! /usr/bin/env python # SPDX-FileCopyrightText: Copyright 2021, <NAME> <<EMAIL>> # SPDX-License-Identifier: BSD-3-Clause # SPDX-FileType: SOURCE # # This program is free software: you can redistribute it and/or modify it # under the terms of the license found in...
import csv import numpy as np from statistics import mean # inicializa os vetores/matrizes x = [[] for i in range(3)] #Inicializa a Matriz X com 3 colunas theta = np.random.rand(3) #Vetor Theta com valores aleatórios entre 0 e 1 y = [] #Vetor Y com o tamanho dos peixes l_cost=[] #Lista com o custo ap...
<filename>neural_deprojection/models/Simple_complete_model_GCD/visualize_3d.py<gh_stars>0 import sys sys.path.insert(1, '/data/s2675544/git/neural_deprojection/') sys.path.insert(1, '/home/matthijs/git/neural_deprojection/') import os import tensorflow as tf import glob from neural_deprojection.models.Simple_complete...
<reponame>Dovermore/vae-audio<filename>trainer/trainer.py import numpy as np import torch from torchvision.utils import make_grid from base import BaseTrainer from os import path from librosa.feature import inverse from librosa import core from scipy.io import wavfile class SpecVaeTrainer(BaseTrainer): """ Tr...
<gh_stars>0 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import glob import re import sys import urllib import tarfile import zipfile from collections import defaultdict import os.path as osp from scipy.io import loadmat import pdb import numpy ...
# -*- coding: utf-8 -*- """ Created on 28 Aug 28 2021 @author: <NAME> """ import copy as _copy import matplotlib as mpl import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable as _mal import numpy as _np import pandas as _pd import scipy.stats as _sst from . import stat_error_measure...
<gh_stars>100-1000 """ based on https://github.com/supikiti/PNCC/blob/master/pncc.py """ import scipy import numpy as np from ..utils.spectral import stft, powspec from ..utils.preprocessing import pre_emphasis from ..utils.cepstral import cms, cmvn, lifter_ceps from ..utils.exceptions import ParameterError, ErrorMsgs ...
<gh_stars>1-10 from __future__ import division from __future__ import print_function import time import tensorflow as tf from gcn.utils import * from scipy import sparse from gcn.models import GCN, MLP # Set random seed # seed = 3 # np.random.seed(seed) # tf.set_random_seed(seed) # Settings flags = tf.app.flags FLA...
import os,sys import numpy as np from scipy import signal from pandas import DataFrame import sympy def createPairs(n): pairs=np.zeros((n*n,2),dtype=int) c=0 for i in range(n): for j in range(n): pairs[c,0]=i pairs[c,1]=j c+=1 return pairs coeffs=np.loadtxt...
<filename>SimPEG/electromagnetics/natural_source/receivers.py """ Module RxNSEM.py Receivers for the NSEM problem """ from ...utils.code_utils import deprecate_class import numpy as np from scipy.constants import mu_0 import properties from ...survey import BaseRx def _alpha(src): return 1 / (2 * np.pi * mu_0...
from __future__ import division, print_function, absolute_import import numpy as np from scipy.optimize import fsolve, root from .multiflash import multiflash from .equilibriumresult import EquilibriumResult from warnings import warn def haz_objb(inc, T_P, type, model, index, equilibrium): X0 = inc[:-1].reshape(...
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- # cd /Volumes/Transcend/KibanDEM # extract_bl.py bl_template.txt import sys import cv2 import numpy as np from scipy import interpolate import conv_util as ut import kdem_util as kd kd.fname1='FG-GML-' kd.fname2='-dem10b-20161001.xml' param=sys.argv if len(p...
# -*- coding: utf-8 -*- """This is a fast Python implementation of SLFN. Created on Sun Sep 6 11:18:55 2015 @author: akusok """ import os import platform from .slfn import SLFN import numpy as np from scipy.linalg import blas, lapack class SLFNPython(SLFN): """Single Layer Feed-forward Network (SLFN), the neu...
import glob, re, html, nltk, os, heapq, argparse, sys, time, statistics, shutil from w3lib.html import replace_entities from collections import Counter from collections import OrderedDict from nltk.stem.porter import PorterStemmer # global variable size_limit = 1000 single_term_idx = Counter() sti_fn = 0 sin...
""" Supplementary Figure 20 """ """This script is used to generate the plot from the previously trained HLA, TCR, TCR+HLA models showing the certainty of the predictions for each sample for these models on the CheckMate-038 clinical trial data. """ import numpy as np from matplotlib import pyplot as plt import seabo...
<gh_stars>1-10 from cmath import exp, inf, pi from hypothesis import strategies as st JUST_FINITE = dict(allow_nan=False, allow_infinity=False) BIG = 1e10 SMALL = 1e-9 def _real_number_(min_value=-BIG, max_value=BIG, **kwargs): return st.floats(min_value, max_value, **JUST_FINITE, **kwargs) _real_number = _r...
<reponame>HPCCS/PARIS import pdb import csv import numpy as np from numpy import linalg as LA from scipy import stats import matplotlib.pyplot as plt from sklearn import linear_model from sklearn.kernel_ridge import KernelRidge from sklearn.neural_network import MLPRegressor from sklearn import preprocessing from skle...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed May 20 17:58:55 2020 @author: aayush """ import pickle import scipy.signal as sig import pandas as pd import unicodedata import matplotlib.pyplot as plt import numpy as np import matplotlib.gridspec as gridspec import seaborn as sns import pylab impor...
# -*- coding: utf-8 -*- """ Created on Sat Nov 11 21:57:16 2017 @author: cham Aim: wrap astropy.table.Table as parsec class """ import numpy as np from astropy.table import Table, vstack, Column from scipy.interpolate import Rbf, LinearNDInterpolator from tqdm import tqdm from collections import OrderedDict class...
<reponame>lamanno-epfl/tomographer<filename>tutorials/data_loaders.py import numpy as np import pandas as pd import h5py import re import os import matplotlib import matplotlib.pyplot as plt from sklearn.neighbors import NearestNeighbors from scipy.spatial.distance import pdist, squareform from sklearn.cluster import ...
""" Programmer: <NAME> Purpose: To develop a system for quick n' dirty genre classification based on ideas and data from [1]Tzanetakis, George, and <NAME>. "Musical genre classification of audio signals." IEEE Transactions on speech and audio processing 10.5 (2002): 293-302. DISCLAIMER: The notion of "genre" as descri...
from networkx.utils.decorators import random_state import numpy as np import time from numpy.core.fromnumeric import size import scipy.stats as stats import os import shutil try: from nextorch import plotting, bo, doe except ImportError: pass import copy from typing import Optional, Tuple, TypeVar import ppri...
<filename>all code (not organized)/wave maker.py from Virtuoso_utils.utils import * import os import re import time import numpy as np import midi import sounddevice as sd from scipy.signal import istft from scipy.signal import stft import librosa import librosa.display import skimage.transform import h5py...
import matplotlib.pyplot as plt import numpy as np from scipy.interpolate import interp1d x_array = [2, 4, 8, 16, 20, 40] y_array = [101.266, 58.3955, 45.395, 37.3023, 34.4435, 31.764] plt.figure(figsize=(13.33,7.5)) plt.plot(x_array, y_array, 'ro', ms=5.0, label='Completion Time') plt.legend(fontsize=13, loc=0) pl...
<reponame>certik/sympy-oldcore from sympy.core import SingleValuedFunction, S, Basic, pi ############################################################################### ###################### HURWITZ GENERALIZED ZETA FUNCTION ###################### ################################################################...
<reponame>neural-reckoning/decoding_sound_location ''' Shared imports, etc. modified from newlocalisation. ''' from brian import * from brian.hears import * from brian.tools import datamanager from brian.utils.progressreporting import * import os, sys, time, multiprocessing, Tkinter, pickle, gc, glob, datetime import ...
# coding=UTF-8 #------------------------------------------------------------------------------ # Copyright (c) 2007-2016, Acoular Development Team. #------------------------------------------------------------------------------ from setuptools import setup, Extension from os.path import join, abspath, dirname f...
""" Methods to analyze the lightcurve that is not related to FFT analysis """ import time import os,sys import numpy as np from scipy.signal import find_peaks #from astropy.convolution import convolve, Box1DKernel DIR = os.path.abspath(os.path.dirname(__file__)) sys.path.insert(0, os.path.join(DIR, '../..')) from s...
# ---------------------------------- # CCF1d.py (SPARTA UNICOR class) # ---------------------------------- # This file defines the "CCF1d" class. An object of this class stores # a Spectrum object, saved in the self.spec field and a Template object # stored in th...
#!/usr/bin/env python #encoding: utf-8 import numpy as np import scipy.io as sio import caffe np.set_printoptions(threshold='nan') MODEL_FILE = '/Users/lianshanchun/caffe/examples/imageFusion_Gold/train_val.prototxt' PRETRAIN_FILE = '/Users/lianshanchun/caffe/examples/imageFusion_Gold/models/solver_iter_122000.caffemo...
from cmath import pi from datetime import datetime from tkinter import Button, Frame, LabelFrame, StringVar, Tk, E, N, W from tkinter.filedialog import askdirectory, asksaveasfilename from tkinter.messagebox import askyesno, showinfo, showwarning from tkinter.ttk import Combobox, Entry, Label from generator import Gene...
<reponame>bartolsthoorn/SOAPY<filename>soap.py from ase.io import read from ase.neighborlist import neighbor_list import numpy as np from numba import jit from scipy.special import spherical_in, sph_harm import argparse from tqdm import tqdm from multiprocessing import Pool parser = argparse.ArgumentParser() parser.ad...
<gh_stars>0 import numpy as np from scipy.linalg import sqrtm from scipy.linalg import inv from sklearn.cluster import KMeans class SignedNetworkSpectralClustering: def __init__(self, positive_weight_matrix, negative_weight_matrix, num_clusters): self.positive_weight_matrix = positive_weight_matrix ...
<filename>gedi/calc.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as _np from scipy.linalg import cho_factor as _cho_factor from scipy.linalg import cho_solve as _cho_solve from gedi import kernels as _kernels def build_matrix(kern, x, yerr): """ build_matrix() creates the covariance mat...
import os import sys import xarray as xr import pandas as pd import scipy.io as sio import numpy as np import features.mds as mds def make_TS_ds(sose_dir=os.path.join(os.environ.get('extdir'),'sose'),records=None): '''Reads in SothernOceanStateEstimate Temperatures and Salinities and returns them in a Xarray data...
<filename>mir3/lib/feature_selection.py import numpy import numpy.linalg import scipy.stats def minimum_variance(data, n_features=1): """Selects features that have minimum variance """ variances = numpy.maximum(0.001, numpy.apply_along_axis(numpy.var, 0, data)) mask = numpy.zeros(variances.shape)...