text
string
import numpy as np from scipy.fftpack import fft, fftshift import math """ A3-Part-3: Symmetry properties of the DFT Write a function to check if the input signal is real and even using the symmetry properties of its DFT. The function will return the result of this test, the zerophase windowed version of the input s...
"""Callback functions for CPF """ from numpy import c_, r_, amax, argmax, array from scipy.sparse import issparse import sys import os def cpf_default_callback(k, V_c, lam_c, V_p, lam_p, cb_data, cb_state, cb_args, results=None, is_final=False): """Default callback function for CPF """ # initialize plo...
<gh_stars>0 import numpy as np import scipy as scipy import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns from matplotlib import rc # plotting settings rc('text', usetex=True) rc('text.latex', preamble=r'\usepackage{cmbright}') rc('font', **{'family': 'sans-serif', 'sans-serif': ['Helvetica']...
import scipy.ndimage as ndimage import pylab as plt import moments #import indexTricks as iT import numpy class RingFinder(): def __init__(self,B,R,sB,sR,pB,pR,pixelsize=0.265,zerofluxB=1e12,zerofluxR=1e12,visualize=False,psfmode="worst"): self.pixelsize=pixelsize self.zerofluxB=zerofluxB ...
<reponame>xrick/Lcj-DSP-in-Python<gh_stars>0 from scipy.io.wavfile import read import matplotlib.pyplot as plt filename = input( "Please enter file name: " ) sampling_rate, x = read( filename ) plt.plot( x ) plt.xlabel( 'n' ) plt.ylabel( 'Amplitude' ) plt.show( )
import pickle as pkl import numpy as np from scipy import special as spec import higrid.Microphone as mc def shd_nm(channels, n, m): """ Calculate the n-the order, m-th degree SHD coefficients for the given Eigenmike em32 channels :param channels: 32 channels of audio from Eigenmike em32 :param n: S...
<reponame>akutkin/apipeline<gh_stars>0 #!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Clustering based on presence of artifacts around sources Created on Tue Dec 10 20:48:31 2019 @author: kutkin """ import os import sys import astropy.io.fits as fits from astropy.wcs import WCS from astropy.coordinates import Sk...
"""Back-calculating TrainingPeaks Normalized Graded Pace""" import os import pandas as pd from scipy.interpolate import interp1d from . import util def factor(grade, source='strava'): """Speed-independent factor for adjusting pace based on grade. TrainingPeaks: decimal grade is constrained to (-0.25, 0.3), be...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Apr 18 16:59:56 2017 @author: m.irvine """ import numpy as np import matplotlib.pyplot as plt from scipy.ndimage.filters import convolve def shortenKernel(l,N): k = np.floor(np.sqrt(2*np.log(1/0.025))*l**2)+1; #this selects the size of the kernel s...
import logging from collections import defaultdict import itertools import time import scipy as sp import scipy.stats as stats import numpy as np import pandas as pd import plotly.express as px from tqdm import tqdm from xps import get_methods_from_results # ███████╗██╗ ██╗███████╗ ██████╗██╗ ██╗█...
<filename>training_and_testing/make_life_assay_pilot_background_subtraction_comparison.py # The MIT License (MIT) # # Copyright (c) 2014 WUSTL ZPLAB # # 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 S...
<filename>rapidhrv/preprocessing.py import dataclasses from typing import Literal, Optional import numpy as np import scipy.interpolate import scipy.signal from .data import Signal def cubic_spline_interpolation(signal: Signal, resample_rate: int) -> Signal: if resample_rate % signal.sample_rate != 0: r...
#!/usr/bin/python3 # This is an initial, hacky implementation of the extended LQR paper. It's just # a proof of concept, so don't trust it too much. import numpy import scipy.optimize from matplotlib import pylab import sys from frc971.control_loops.python import controls class ArmDynamics(object): def __init__(s...
<gh_stars>0 #!/usr/bin/env python # coding: utf-8 import sys import scipy.sparse as sp import numpy as np from scipy.io import loadmat, savemat import os from sklearn.metrics import confusion_matrix import matplotlib.pyplot as plt from matplotlib import rcParams def replace_list_element(l, before, after): """Help...
import h5py import itertools import marshal import multiprocessing as mp import numpy as np import pandas as pd import pathlib import pickle import scipy.signal import sklearn.model_selection import sklearn.svm import tqdm.notebook as tqdm import types def _init_pdist(fastmap, _X1, _X2, _W1, _W2): global self, X1...
<gh_stars>0 # -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2012-2016 GEM Foundation # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 ...
<filename>TESTDPP.py import argparse import baselineUtils import torch import torch.utils.data import torch.nn as nn import torch.nn.functional as F import os import time from transformer.batch import subsequent_mask from torch.optim import Adam,SGD,RMSprop,Adagrad from transformer.noam_opt import NoamOpt import numpy ...
<filename>startup/43-ESM_utilities.py import IPython import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy.interpolate import interp1d import scipy.optimize as opt import os from bluesky.plans import scan, adaptive_scan, spiral_fermat, spiral,scan_nd from bluesky.plan_stubs import abs_set, m...
<reponame>scalabel/scalabel """Functions for KITTI.""" import os from typing import Dict, List, Tuple import numpy as np from scipy.spatial.transform import Rotation as R from ..common.io import open_read_text from ..common.typing import NDArrayF64 try: import utm except ImportError: utm = None # Functions...
<reponame>grawies/stable-poly #!/home/sam/shared-space/linux-system/anaconda3/bin/python import math import sympy as sp from bistochastic import generate_matrix import fpiter from polynomials import product_polynomial from functionals import elementary_symmetric_differential_operator import numpy.random SEED = 1 nump...
import matplotlib.pyplot as plt import numpy as np from scipy.spatial import HalfspaceIntersection from kaa.lputil import minLinProg, maxLinProg from kaa.timer import Timer from kaa.settings import PlotSettings plt.rcParams.update({'font.size': PlotSettings.plot_font}) """ Object encapsulating flowpipe data. """ cl...
<gh_stars>0 import numpy as np from numpy import pi, sin, cos import math import matplotlib.pyplot as plt import sympy as sp from sympy.interactive.printing import init_printing init_printing(use_unicode=False, wrap_line=False) from sympy.matrices import Matrix, eye, zeros, ones, diag, GramSchmidt from sympy im...
import csv import ray import logging import numpy as np import pandas as pd #import torch from scipy.stats.mstats import gmean # from .lw.lw_nn import LWNN # from .lw.lw_tree import LWTree from .estimator import Estimator from ..constants import NUM_THREADS, RESULT_ROOT from ..workload.workload import load_queryset,...
import os import torch from torch import nn import pytorch_lightning as pl from argparse import ArgumentParser import KohnShamSpin from tqdm import tqdm from scipy import optimize import sys import numpy as np class XC_Model(pl.LightningModule): def __init__(self, **hparams): """ Pass in parsed HyperOptArg...
<reponame>ozanarkancan/path-planning<filename>potential_field.py<gh_stars>1-10 import numpy as np from scipy.ndimage.filters import gaussian_filter class PotentialField: def __init__(self, start, goal, cspace): self.start = start self.goal = goal self.cspace = cspace def get_attractive...
<reponame>sfarrens/lenspack # -*- coding: utf-8 -*- import numpy as np from scipy.ndimage import convolve from scipy.signal import fftconvolve from lenspack.utils import radius2d, round_up_to_odd FILTER_OPTIONS = {'s98', 'vw98', 'jbj04', 'starlet', 'gauss'} METHOD_OPTIONS = {'direct', 'fourier', 'brute'} BORDER_OPT...
# 通用类 import cmath import wave import librosa import librosa.display import matplotlib.pyplot as plt import numpy as np import pyaudio class Speech: def audiorecorder(self, path, len=2, formater=pyaudio.paInt16, rate=16000, frames_per_buffer=1024, channels=2): p = pyaudio.PyAudio() stream = p.o...
from scipy.constants import hbar, pi import numpy as np DeltaS = 1.764*1.38064852e-23*1.1 e = 1.60217662e-19 GHz = 1e9 MHz = 1e6 kHz = 1e3 Hz = 1 bare_cavity_freq = 7.35*GHz dressed_cavity_freq_ground = 7.24426*GHz dressed_cavity_freq_exited = 7.21762*GHz #None f01 = 6.63387*GHz f12 = 5.79571*GHz Ec = ...
<filename>python/create_climatology.py # # Copyright (c) 2017, UT-BATTELLE, LLC # All rights reserved. # # This software is released under the BSD license detailed # in the LICENSE file in the top level a-prime directory # # Compute the climatology for a case # Uses MPI import numpy from scipy.io import netcdf from ...
import argparse import glob, os import random import re import sys import time from os.path import join import cv2 import numpy as np import tensorflow as tf from utils.metrics_utils import * random.seed(1024) np.random.seed(1024) tf.set_random_seed(1024) from utils.icp_zou import icp from tqdm import tqdm import ...
<filename>env_dev/lib/python3.6/site-packages/sparsegrad/tests/test_dot.py # -*- coding: utf-8; -*- # # sparsegrad - automatic calculation of sparse gradient # Copyright (C) 2016-2018 <NAME> (<EMAIL>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General...
<filename>tests/test_reduction.py #!/usr/bin/env python """Tests for reduction methods of CRN class. References ========== [1] <NAME>. "Fundamentals of enzyme kinetics". Elsevier, 2014. [2] <NAME>. "Mathematical Modelling in Systems Biology: An Introduction.", 2013. [3] SBMLsqueezer documentation, http://www.cogsys.cs...
import numpy as np from reader import read_cifar10 from scipy.io import loadmat class load_data(object): def __init__(self, name=None, bs=64): if name == 'svhn': data = loadmat('./dataset/svhn/svhn.mat') self.images = data['X'].transpose(3,0,1,2)/127.5 - 1.0 self.nums_images = self....
<reponame>TChis/Musketeer import os import tkinter as tk import tkinter.ttk as ttk import tkinter.filedialog as fd import packaging.version import numpy as np import tksheet from scipy.interpolate import interp1d from cycler import cycler from ttkbootstrap.widgets import InteractiveNotebook import tkinter.messagebox a...
<filename>diagnostics/thomson/Thomson/thomson_theory.py # -*- coding: utf-8 -*- """ Created on Wed Aug 8 08:19:21 2018 @author: James """ import matplotlib.pyplot as plt import numpy as np from scipy import signal from scipy.optimize import leastsq def laser_photons(E_pulse, laser_wavelength): h = 6.626*...
<filename>Croise_SCAT/croise_scatt.py from pylab import * import matplotlib import time from scipy.interpolate import interp1d from scipy.io.wavfile import read matplotlib.rc('xtick', labelsize=35) matplotlib.rc('ytick', labelsize=30) class sparse_filter: def __init__(self,coeffs,support,mu): self.mu = m...
<reponame>enjoyneer87/SciDataTool from numpy import ( array, stack, linspace, argmin, take, isclose, isin, all, abs as np_abs, where, zeros, unique, ) from scipy.interpolate import interp1d def get_common_base(values1, values2, is_extrap=False, is_downsample=False): ...
<filename>MEG eyes open vs closed.py # -*- coding: utf-8 -*- """ Created on Thu Aug 22 17:53:14 2019 @author: Localadmin_fesieben """ projects_directory = 'K:\\palva\\' #source_directory = 'D:\\felix\\OL2015\source\\' source_directory = 'E:\\HY-data\\FESIEBEN\\OL2000\\OL2015\\source\\' import...
''' AUTHORS: <NAME> and <NAME> DATE: March 22, 2019 COPYRIGHT MARCH 22, 2019 <NAME> AND <NAME> ''' from __future__ import print_function ''' This module should be organized as follows: Main function: chi_estimate() = returns chi_n, chi_b - calls: wealth.get_wealth_data() - returns data moments on wealth...
<reponame>xiaxin2000/OpenCDA-Documents<filename>opencda/core/sensing/perception/o3d_lidar_libs.py # -*- coding: utf-8 -*- """ Utility functions for 3d lidar visualization and processing by utilizing open3d. """ # Author: <NAME>, <NAME> <<EMAIL>> # License: MIT import time import open3d as o3d import numpy as np fro...
import pandas as pd import numpy as np import hickle, pickle import set_up import scipy.sparse as sp from sklearn.externals import joblib import os import logging import imp imp.reload(logging) logging.basicConfig(format = '[%(asctime)s] %(message)s', level = logging.INFO) logging.info('[Script for 1st st...
<reponame>pengyonghui/invRCA # -*- coding: utf-8 -*- """ Created on Sun Sep 13 13:54:59 2019 @author: yonghui Control func that fits NMR data multiexponentially using non-negative least squares(NNLS) with tikhonov regularization for nmr data analysis - first written by <NAME> in Sep. 2006 - Keating and Falzone rev...
#!/usr/bin/env python ''' things that make affine_transform easier ''' import numpy import quietscipy import scipy.ndimage import scipy.linalg def affine_transform_offset(inputshape, outputshape, affine_matrix, offset=(0,0)): ''' calculation of affine transform offset for now we assume center of image ''' outcen...
import numpy as np from scipy import constants, optimize, math from sympy.physics import units as U from sympy.physics.units import convert_to from pde.domain import Domain, DomainVar from property_set.property_set import PropertySet from utils.functional import cached_property class InputError(Exception): pass...
import numpy as np import itertools import scipy from scipy import sparse from tqdm.notebook import tqdm from itertools import chain, combinations, product from scipy.special import comb """ This is a Python implementation of the minimum epistasis interpolation method for sequence-fitness prediction by Zhou & McCandl...
import os import sys import datetime import numpy as np import scipy.signal import pandas as pd import yfinance as yf from contextlib import contextmanager from src.utils_date import add_days from src.utils_date import prev_weekday #from pandas_datareader.nasdaq_trader import get_nasdaq_symbols ERROR_NO_MINUTE_DATA_YT...
# AUTOGENERATED! DO NOT EDIT! File to edit: 03_visualize.ipynb (unless otherwise specified). __all__ = ['plot_poses', 'plot_delaunay', 'fig2img', 'excerpt_pose', 'overlay_poses', 'overlay_video', 'draw_figure', 'viz_dist_matrices', 'GC_INTERVAL', 'MIN_MOVE', 'MAX_MOVE'] # Cell import openpifpaf import num...
<reponame>chapman-phys227-2016s/hw-2-C0deMonkee #! /usr/bin/env python """ File: Lagrange_poly2b.py Copyright (c) 2016 <NAME> License: MIT Course: PHYS227 Assignment: 5.25 Date: Feb 11, 2016 Email: <EMAIL> Name: <NAME> Description: Behaivor of Lagrange interpolating polynomials """ import Lagrange_poly2 as L2 import ...
""" PTM_BTRACE Magnetic field tracing and analysis for magnetic field data on scattered grids. This module is intended to supercede the PTM_FIELDS_TRACING module. This module defines a "GRIDDED_MAGNETIC_FIELD" object that reads in gridded magnetic field data and allows for the fields to be arbitrarily evaluated, allo...
"""Film Mode Matching Mode Solver Implementation of the Film Mode Matching (FMM) algorithm, as described in: - Sudbo, "Film mode matching a versatile numerical method for vector mode field calculations in dielectric waveguides", Pure App. Optics, 2 (1993), 211-233 - Sudbo, "Improved formulation of the film mode mat...
import scipy.signal as signal from concurrent.futures import ProcessPoolExecutor import torch import torch.nn as nn import numpy as np import torch.nn.functional as F from torch.distributions import Categorical import cy_heuristics as cy_heu import sched INPUT_SIZE = 10 N_WORKERS = 8 executor = ProcessPoolExecutor(ma...
<filename>pcmc/pcmc-orig-synthetic.py<gh_stars>1-10 # (c) 2020 alherit # This code is licensed under MIT license (see LICENSE.txt for details) # python 2 # requires pcmc-nips\\lib from https://github.com/sragain/pcmc-nips in PYTHONPATH import numpy as np import pickle import os import pandas as pd f...
# -*- coding: utf-8 -*- """ Created on Fri Aug 31 14:18:58 2018 """ import geopandas as gpd import pandas as pd from scipy.stats import linregress from functools import reduce import matplotlib.pyplot as plt from math import sqrt import numpy as np from numpy.polynomial.polynomial import polyfit #---------------------...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 <NAME> <<EMAIL>> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Automated tests for checking transformation algorithms (the models package). """ import logging import unittest import os import os.path import tempfile...
#!/usr/bin/env python ''' A solution to a ROSALIND bioinformatics problem. Problem Title: Independent Alleles Rosalind ID: LIA Rosalind #: 015 URL: http://rosalind.info/problems/lia/ ''' from scipy.misc import comb with open('data/rosalind_lia.txt') as input_data: k, N = map(int, input_data.read().split()) prob = ...
# This code is licensed under the MIT License (see LICENSE file for details) import pathlib import os import pkg_resources import subprocess import tempfile import numpy from scipy import ndimage from sklearn import mixture import freeimage import zplib.image.mask as zpl_mask from . import load_data from . import w...
<gh_stars>0 """A collection of classes to that build regularisation matrices for a least squares inversion. The regularisation matrices are created to be used as part of Tikhonov regularisation [1]. I think this is also referred to as damping or damped least squares. In the simplest case the Tikhonov matrix (Γ) is jus...
<gh_stars>1-10 #============================================================ # THIS IS FOR COLLECTING ALL OBSERVATION DATA FOR FOLLOW-UP OBSERVATION TO S190425z # 2019.06.08 MADE BY <NAME> #============================================================ import os, glob import numpy as np from astropy.io import ascii from ...
<reponame>Timonzimm/CS-401<filename>project/api/api.py<gh_stars>0 import sqlite3 from scipy.stats import gaussian_kde from flask import Flask, g, jsonify from flask_cors import CORS app = Flask(__name__) CORS(app) DATABASE = 'data/database.sqlite' def get_db(): db = getattr(g, '_database', None) if db is None...
''' Created on 28 Mar 2021 @author: thomasgumbricht ''' import os from sys import exit import numpy as np import gc #from numpy import pi, log, tan, empty, float32, arctan, rad2deg, gradient from scipy.ndimage import gaussian_gradient_magnitude from math import sqrt from geoimagine.gis import RasterOpenGetFirs...
# -*- coding: utf-8 -*- """ Muse LSL Example Auxiliary Tools These functions perform the lower-level operations involved in buffering, epoching, and transforming EEG data into frequency bands @author: Cassani """ import numpy as np from scipy.signal import butter, lfilter, lfilter_zi NOTCH_B, NOTCH_A = butter(4, np.a...
import numpy as np from math import log,e import hankelmatrixcreator import sppy from sppy import linalg import sys import time import iohelpers import math from scipy import sparse import copy VERBOSE = True class SparseSpectralWFA: def __init__(self, n_symbols, prefixdict, suffixdict, basis_length, maxDim=80):...
<reponame>b7500af1/orbcomm_decoder ############################################################################## # # Author: <NAME> # Date: 17 April 2019 # Name: timing_detection_demo.py # Description: # This is a demo of transmitting and receiving qpsk samples. It uses a RRC # pulse shaping filter and matched filte...
<filename>tests/pyposmat/engines/PyposmatMonteCarloSampler/test__PyposmatMonteCarloSampler__eam_Ni/dev__PyposmatMonteCarloSampler__eam_Ni.py<gh_stars>1-10 import copy,yaml from collections import OrderedDict from pypospack.pyposmat import PyposmatMonteCarloSampler from pypospack.pyposmat import PyposmatDataFile from py...
<gh_stars>0 import numpy as np import matplotlib.pyplot as plt import os from scipy.interpolate import make_interp_spline, BSpline def comparison_plots(shape="medium", bkgd="1.0e+02", label="medium"): # PAPER PLOT- Medium case, 5% signal uncertainty and 0% uncertainty fig = plt.figure() fig.patch.set_facec...
<reponame>European-XFEL/euxfel-python """AGIPD & LPD geometry handling.""" from cfelpyutils.crystfel_utils import load_crystfel_geometry from copy import copy import h5py from itertools import product import numpy as np from scipy.ndimage import affine_transform import warnings from .crystfel_fmt import write_crystfel...
<filename>tde1.py #coding:utf-8 # (概要) # チャイム音(chime_wav)をマイクでステレオ録音しとき、L channelとR channelの音の時間差を推定するもの。 # # (方法) # 調波構造の majorな部分を抜きとって、再合成して 2つの信号を比較し、時間差を求める。 # # Check version # Python 3.6.4, 64bit on Win32 (Windows 10) # numpy 1.18.4 # scipy 1.4.1 # matplotlib 3.3.1 import sys import os ...
import numpy as np import ctypes from scipy.optimize import minimize, check_grad, approx_fprime from scipy.sparse import coo_matrix, csr_matrix, csc_matrix import test_math m = int(1e1) n = int(2e1) p = int(3e1) q = int(1e2) nzX = int(.25*m*n) nzU = int(.25*m*p) nzI = int(.25*n*q) lam = 6e-1 w_user = 0.1234 w_item = ...
from taylorDiagram import plot_Taylor_graph import matplotlib.pyplot as plt from PyEMD import EEMD from hht import hht from hht import plot_imfs from hht import plot_frequency import waipy from scipy.stats import norm import numpy as np # from matplotlib.ticker import FuncFormatter def millions(x, pos): 'The two a...
<gh_stars>1-10 import numpy as np from numpy import sin, cos, pi import matplotlib.pyplot as plt from scipy.spatial import Delaunay import scipy import fem import scipy as sp import pygmsh import time from scipy.spatial import ConvexHull, convex_hull_plot_2d import random import torch as T import torch_geom...
# -*- coding: utf-8 -*- """Main Controller""" from tg import expose, flash, require, url, lurl from tg import request, redirect, tmpl_context from tg.i18n import ugettext as _, lazy_ugettext as l_ from tg.exceptions import HTTPFound from icrar.model import DBSession from icrar.config.parameters import TELESCOPES, DEF...
<gh_stars>1-10 import torch from torch.utils.data import Dataset, DataLoader from pathlib import Path from scipy.io import loadmat import copy import mri_utils from fft_utils import numpy_2_complex import numpy as np DEFAULT_OPTS = {'root_dir':'data/knee', 'name':'coronal_pd', 'patients':[1,2,3,4,5,6...
<gh_stars>0 import statistics from communication.comm import LoxComm from api import sync_api_list, discover_api_fns from firmware_analyzer import unpacker, binary_analyzer from config_analyzer.loxcc_parser import uncompress_loxcc # , decompress_loxcc import argparse import pathlib async def echo(websocket, path): ...
import cv2 import os import numpy as np #import scipy as scp import scipy.misc import triangle_detection as triang import psycopg2 maindir = "E:\\Pesquisa\\codigos\\KittiSeg_shivam\\KittiSeg\\RUNS\\retrain_SVM_balanced_novo_2\\results\\" #or_imgs_dir = "C...
from __future__ import division import matplotlib from __builtin__ import dict matplotlib.use('Agg') import matplotlib.pyplot as plt import os import logging import numpy as np from sklearn.metrics import roc_curve, auc, f1_score, confusion_matrix, classification_report import datetime from scipy import integrate impor...
<gh_stars>0 import sys, getopt, os from scipy.stats import poisson usage = """ Usage: This script takes in the paired-end table containing the stats from the EpitopeID pipeine and calculates the Poisson p-value threshold given a minimum 2-fold enrichment over the expected tags based on the bin size. Example: python2 ...
<reponame>anton-petrov/centerline<filename>src/centerline/geometry.py # -*- coding: utf-8 -*- from __future__ import unicode_literals import os import pickle from numpy import array from scipy.spatial import Voronoi from shapely.geometry import LineString, MultiLineString, MultiPolygon, Polygon from shapely.ops impor...
<reponame>QNZhang/LC-KSVD # -*- coding: utf-8 -*- """ main """ import numpy as np from scipy.io import loadmat from sklearn.metrics import accuracy_score from lcksvd.dksvd import DKSVD def main(): ########################################################################### # ...
<gh_stars>0 import pandas as pd import numpy as np import csv import os from PIL import Image import imagehash import matplotlib.pyplot as plot import librosa from pydub import AudioSegment from tempfile import mktemp import librosa.display import numpy as np import os import pylab import pandas as pd import numpy as ...
<filename>limix_cl/tests/test_limix_lmm.py # -*- coding: utf-8 -*- import sys import os sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) import limix_lmm import numpy as np import scipy as sp import pandas as pd import unittest class BasicTestSuite(unittest.TestCase): """Te...
from __future__ import division import os import numpy as np #from scipy.ndimage import imread from imageio import imread import scipy.io as sio import torch import torch.utils.data as data from datasets import pms_transforms from . import util np.random.seed(0) class MyDataset(data.Dataset): def __init__(self, a...
<reponame>cgodine/RadTraQ<filename>radtraq/plotting/corner_reflector.py import numpy as np import matplotlib.pyplot as plt from scipy.interpolate import griddata import pandas as pd def plot_cr_raster(obj, field='reflectivity', target_range=None, ax=None, fig=None, delta_x=None, delta_y=None, az_li...
<filename>aced_hmm/visualize_forecasts.py import numpy as np import pandas as pd import matplotlib.pyplot as plt import json import scipy from scipy import stats import seaborn as sns import argparse sns.set_style("whitegrid") def plot_stat(stats_filepath, stat, last_N_not_nan=None): stats = pd.read_csv(stats_fil...
<reponame>zhampel/gaussGAN from __future__ import print_function try: import argparse import os import numpy as np import matplotlib import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib import cm as cm from scipy import stats import pickle import torch ...
<filename>resource_provisioning/calc.py import numpy as np from config import * import gurobipy from scipy.optimize import minimize, LinearConstraint from util import * from torch.optim import SGD from torch.autograd import Variable import gurobipy as gp from gurobipy import GRB import torch.nn as nn import cvxpy as cp...
# Use the OpenMDAO framework for OUU for optimizing a Rosenbrock function from __future__ import division, print_function import os import sys import errno sys.path.insert(0, '../../src') # pyStatReduce specific imports import numpy as np import chaospy as cp from stochastic_collocation import StochasticCollocation fr...
<filename>PrescribedAreaDrawing.py #Best you use Anaconda. If you do not have quadprog, you have to #install it.. in anaconda you can use this '-c omnia quadprog ' import numpy as np import random #import quadprog from sympy.geometry import * from PIL import Image, ImageDraw import matplotlib.pyplot as plt import matpl...
import matplotlib.pyplot as plt import numpy as np from scipy.ndimage import gaussian_filter import scipy.stats as st def whist(x, smooth=True, kde_n=512, kde_range=None, bins='auto', plot=None, kde_kwargs=None, hist_kwargs=None, **kwargs): """ Turn an array of samples, x, into an estimate of pro...
<filename>phase4_analysis/metrics.py # <NAME> (<EMAIL>) import numpy as np import scipy.stats as ss #from diagnostics import MIN_ESS MIN_ESS_PER_CHAIN = 1.0 # TODO limit dupes def stack_first(X): assert(X.ndim == 3) # Equivalent to: # Y = np.concatenate([X[ii, :, :] for ii in xrange(X.shape[0])], axis=0...
<filename>Assignment1/1.2/plot.py<gh_stars>1-10 import os import matplotlib.pyplot as plt import numpy as np import statistics with open('data.txt') as f: lines = f.readlines() z = [line.split()[0] for line in lines] rows, cols = (24, 5) data_set = [[0 for i in range(cols)] for j in range(rows)] for i in ra...
<filename>examples/applications/intent_recognition.py """ This is a simple application for sentence embeddings: semantic search We have a corpus with various sentences. Then, for a given query sentence, we want to find the most similar sentence in this corpus. This script outputs for various queries the top 5 most si...
import pandas as pd import numpy as np import scipy.stats as stats def compute_indep_ci(df, loc=0.95): mean_list, std_list, ci_list = [], [], [] for col_name in df: col_values = df[col_name].values sample_size = len(col_values) degrees_freedom = sample_size - 1 sample_mean = np...
# first version of two way lattice for getting more densities import numpy as np import numpy.random as rd import random as random import scipy import matplotlib as mpl import matplotlib.pyplot as plt from os import path from datetime import datetime now = datetime.now() #parameters N = 100 # number of sites a1 = ...
<gh_stars>10-100 # -*- coding: utf-8 -*- """ Created on Thu Aug 20 08:22:45 2020 This class fits multivariate ARMA-GARCH type models @author: iankh """ import pandas as pd import numpy as np from .errors import InputError, HessianError import datetime import scipy import shutil class multiModel(object): def __i...
import scipy as sc import more_itertools as mit length = 4 # Длина теплообменника [м] time = 300 # Время работы теплообменника [с] rball = 0.01 # Радиус однгого шара засыпки [м] rbckfill = 2 # Радиус засыпки [м] f...
import numpy as np import matplotlib.pyplot as plt from scipy.optimize import curve_fit import pandas as pd from scipy.stats.distributions import t # Import PySwarms import pyswarms as ps from pyswarms.utils.functions import single_obj as fx def exp_func(x, a, b, c): return c + a * np.exp(b * x) ...
"""Multiple MC to show how it can be bad.""" from scipy.stats import qmc from scipy.stats._qmc import check_random_state import numpy as np import matplotlib.pyplot as plt rng = np.random.default_rng(12345) n_sample = 256 dim = 2 sample = {} # MC sample['MC 1'] = rng.random((n_sample, dim)) sample["MC 2"] = rng.r...
<gh_stars>1-10 import tensorflow as tf import numpy as np import scipy.io.wavfile import scipy.io import scoping BATCH_AXIS = 0 # B LENGTH_AXIS = 1 # L DEPTH_AXIS = 2 # D CHANNELS_AXIS = -1 # C def sliding_window(inp, frame_length, frame_shift, max_number_frames=None, padding="VALID", name=None): ''' ...
<gh_stars>10-100 from scipy.io import loadmat import matplotlib.pyplot as plt from hsi_toolkit.signature_detectors import * from hsi_toolkit.util import get_RGB """ Demo script that runs all signature detectors in hsi_toolkit_py Inputs: hsi_sub - n_row x n_col x n_band hyperspectral image tgt_spectra - n_band x 1 t...
# -*- coding:utf-8 -*- """File I/O related operations, such as list files, import/export or remove files/folder.""" __author__ = "<NAME>" import os import shutil import json import pickle import zipfile import urllib import wget DependencyFlag = False #Check if dependencies are satisfied. If not, some...