text
string
<reponame>MaruvkaLab/MSMuTect_3.2 # cython: language_level=3 import numpy as np from collections import namedtuple from scipy.stats import binom from src.IndelCalling.FisherTest import Fisher from src.IndelCalling.MutationCall import MutationCall from src.IndelCalling.AlleleSet import AlleleSet from src.IndelCalling.Hi...
<reponame>Fang-Ke/Fast-eTofts<gh_stars>1-10 import numpy as np from utils.config import get_config from scipy.optimize import least_squares as ls from scipy.optimize import lsq_linear config = get_config() r1 = config.protocol.r1 TR = config.protocol.TR alpha = config.protocol.alpha/180*np.pi deltt = config.protocol.de...
<reponame>geg58/cs194DRLProj import gym import random import numpy as np import tflearn import time from tflearn.layers.core import input_data, dropout, fully_connected from tflearn.layers.estimator import regression from statistics import median, mean from collections import Counter LR = 1e-3 env = gym.make("Humanoid...
import argparse from timeit import default_timer as timer import numpy as np from scipy.special import comb # binom function parser = argparse.ArgumentParser() parser.add_argument("-d", "--degree", help="Degree of polynomial features", default=2, type=int) parser.add_argument("-i", "--iterations", help="Number of it...
<gh_stars>1-10 from __future__ import absolute_import, division, print_function name = "Signal Processing toolkit | utils" import sys if sys.version_info[:2] < (3, 3): old_print = print def print(*args, **kwargs): flush = kwargs.pop('flush', False) old_print(*args, **kwargs) if flush: ...
<reponame>Ashelywang/Kaggle_toxic import numpy as np from scipy import sparse from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.base import BaseEstimator, ClassifierMixin from sklearn.utils.validation import check_X_y, check_is_fitted from sklearn.linear_model import LogisticRegression from ker...
from statistics import mean import numpy as np xs = np.array([1, 2, 3, 4, 5], dtype=np.float64) ys = np.array([5, 4, 6, 5, 6], dtype=np.float64) def best_fit_slope(xs, ys): m = ((mean(xs) * mean(ys)) - mean(xs * ys)) / (mean(xs)**2 - mean(xs**2)) return m m = best_fit_slope(xs, ys) print(m)
"""sympify -- convert objects SymPy internal format""" from inspect import getmro from core import all_classes as sympy_classes from sympy.core.compatibility import iterable class SympifyError(ValueError): def __init__(self, expr, base_exc=None): self.expr = expr self.base_exc = base_exc def ...
<filename>sympy/stats/tests/test_continuous_rv.py from sympy.stats import (P, E, where, density, variance, covariance, skewness, given, pspace, cdf, ContinuousRV, sample) from sympy.stats import (Arcsin, Benini, Beta, BetaPrime, Cauchy, Chi, Dagum, Exponential, Gamma, L...
<gh_stars>0 from __future__ import division, print_function #import matplotlib.pyplot as plt import numpy as np from numpy import log10 from sys import stderr, stdout, exit from dispersion import DR_Solve, init, DR_point, PlotDR2d from scipy.interpolate import InterpolatedUnivariateSpline as US def banner(...
<gh_stars>10-100 import matplotlib.pyplot as plt import sys from scipy.optimize import curve_fit import numpy as np # alaz files try: alfile = sys.argv[1] azfile = sys.argv[2] except IndexError: print 'Usage: python plotbeam.py alfile azfile' print 'Will then use offsets and power values in both files ...
#! /usr/bin/env python """ File: unstable_ODE Copyright (c) 2016 <NAME> License: MIT Course: PHYS227 Assignment: C.4 Date: April 7th, 2016 Email: <EMAIL> Name: <NAME> Description: Demonstrates the instability of an ODE """ from __future__ import division import matplotlib.pyplot as plt import numpy as np import sympy...
"""Generative adversarial network for toy Gaussian data (Goodfellow et al., 2014). Inspired by a blog post by <NAME>. Note there are several common failure modes, such as (1) saturation of either discriminative or generative network; (2) the generator running into a local optima that produces a Gaussian somewhere aro...
<filename>src/python/packages/metadapter/processors/mdoAzimuth_processor.py # -*- coding: utf-8 -*- """ Created on Fri Feb 03 2017 @author: <NAME> """ import numpy import math from sys import version_info if version_info.major <= 2: import OSC else: # Use the self-made port for Python 3 (experimental) f...
# -*- coding: utf-8 -*- """ cosmology utils. ... use astropy.cosmology. that is a full furnished util. Created on Sun Jun 28 18:31:23 2015 @author: hoseung """ from ..general import defaults #dfl = defaults.Default() #dir_repo = dfl.dir_repo from scipy.integrate import cumtrapz from numpy.core.records import fromarr...
from __future__ import print_function, division import sys import os from os.path import expanduser home = expanduser("~") path_to_cosmodc2 = os.path.join(home, 'cosmology/cosmodc2') if 'mira-home' in home: sys.path.insert(0, '/gpfs/mira-home/ekovacs/.local/lib/python2.7/site-packages') sys.path.insert(0, path_to_...
<gh_stars>1-10 import numpy as np import pandas as pd import os, errno import datetime import uuid import itertools import yaml import subprocess import scipy.sparse as sp from scipy.spatial.distance import squareform from sklearn.decomposition.nmf import non_negative_factorization from sklearn.cluster import KMeans ...
<filename>Simulation_Result_Analysis.py # -*- coding: utf-8 -*- """ Created on Fri Aug 05 15:59:30 2016 @author: <NAME> """ import numpy import matplotlib from matplotlib import pyplot from scipy import polyval, polyfit #hyper parameters matplotlib.rc('font', **{'sans-serif' : 'Arial','family' : 'sans-...
########################################################################## ########################################################################## ## ## What are you doing looking at this file? ## ########################################################################## ##############################...
<reponame>NMinhNguyen/wordsandbuttons<gh_stars>100-1000 from sympy import * x1, y1, x2, y2, x3, y3, a, b, c = symbols('x1 y1 x2 y2 x3 y3 a b c') print(solve([ a * x1 * x1 + b * x1 + c - y1, a * x2 * x2 + b * x2 + c - y2, a * x3 * x3 + b * x3 + c - y3, ], (a, b, c)))
''' Calculate and plot Fisher information over subsets of r. ''' import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt import matplotlib.colors as colors import cProfile, pstats import sys import os import numpy as np from scipy.special import spherical_jn from sst import Fisher from sst import cam...
#a method for ranking sites in an alignment according to GC bias, for filtering purposes. Inspired by the Munoz-Gomez et al. (2018) zed score for amino acid data from Bio import SeqIO, AlignIO import sys, operator import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from scipy im...
# -*- coding:utf-8 -*- # ------------------------ # written by <NAME> # 2019-02 # ------------------------ import h5py import scipy.io as io import glob import warnings import os import numpy as np import skimage.io from gaussian_filter import gaussian_filter_density warnings.filterwarnings("ignore") path = "../../d...
#!/usr/bin/env python ''' This script creates test functions for verification of Redi tendancy terms. <NAME>, LANL, Nov 2019 followed example at: https://pythonhosted.org/algopy/symbolic_differentiation.html ''' import sympy as sp import numpy as np # define algabraic variables: x, y, z = sp.symbols('x y z') fkx, fky...
<filename>sampling.py<gh_stars>100-1000 from lightning_model import NuWave from omegaconf import OmegaConf as OC import os import argparse import datetime from glob import glob import torch import librosa as rosa from scipy.io.wavfile import write as swrite import matplotlib.pyplot as plt from utils.stft import STFTMag...
<reponame>samtx/pyapprox from __future__ import (absolute_import, division, print_function, unicode_literals) import numpy as np from scipy import special as sp def charlier_recurrence(N, a): r""" Compute the recursion coefficients of the polynomials which are orthonormal with resp...
# 作者Hai import tkinter from scipy import special import math import openpyxl import sys # 主窗体 top = tkinter.Tk(className='Epsilon calculation', ) # 定义窗体大小及位置 width = 650 height = 240 screenwidth = top.winfo_screenwidth() screenheight = top.winfo_screenheight() alignstr = '%dx%d+%d+%d' % (width, height,...
<filename>Code/constants.py<gh_stars>0 import numpy as np import os from glob import glob import shutil from datetime import datetime from scipy.ndimage import imread from time import gmtime, strftime ## # Data ## def get_date_str(): """ @return: A string representing the current date/time that can be used as ...
<reponame>alifeee/ElecSus # Copyright 2014-2016 <NAME>, <NAME>, <NAME>, <NAME>, # <NAME> and <NAME>. # 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-...
<reponame>GEOS-ESM/GMAO_Shared from g5lib import dset import netCDF4 as nc import scipy as sp __all__=['ctl'] class Ctl(dset.NCDset): def __init__(self): name='HadISST' flist=['/gpfsm/dnb42/projects/p16/ssd/ocean/kovach/odas-2/obs/HADISST/HadISST_sst.nc'] f=nc.Dataset(flist[0]) tt...
import margin_leverage import util import Investor import Market import TaxRates import BrokerageAccount import plots from datetime import datetime import os import shutil import re import math from scipy.stats import norm #from scipy.optimize import fsolve # don't need this anymore import numpy import time import leve...
from math import pi,sin,cos from biogeme import * from headers import * from loglikelihood import * from statistics import * ###define k for trigonometric function, n for #covariates and ps for power series of dur#### k=4 n=4 ps=3 begin=range(1,49) end=range(1,49) choiceset=range(1,1177) arrmidpo...
<reponame>amadavan/Stuka import numpy as np import scipy as sp import scipy.sparse import stukapy as st c = np.array([2, 1]) A_ub = sp.sparse.bmat([[-1, 1], [-1, -1], [0, -1], [1, -2]], 'csc') b_ub = np.array([1, -2, 0, 4]) lp = st.LinearProgram(c=...
<gh_stars>1-10 import astropy.io.fits as fits import matplotlib.pyplot as plt import numpy as np import scipy.interpolate import scipy.ndimage.filters as scipy_filter import scipy.signal import sys,json import glob def load_spc(file): """ Load a spectrum fits file. return two nArray for wavelen...
import scipy from scipy.sparse import csc_matrix, save_npz from scipy.sparse.linalg import eigsh import numpy as np, enum import sparse_matrices class MassMatrixType(enum.Enum): IDENTITY = 1 FULL = 2 LUMPED = 3 def compute_vibrational_modes(obj, fixedVars = [], mtype = MassMatrixType.FULL, n = 7, sigma=-0...
<filename>rgbmcmr.py from __future__ import division, print_function from collections import namedtuple import numpy as np from scipy.special import erf, erfc import emceemr from astropy import units as u MINF = -np.inf class RGBModel(emceemr.Model): """ Note if biasfunc is used, the sense is mag_real = m...
<filename>cloneOLD.py import csv import cv2 import numpy as np from scipy import ndimage from keras.models import Model lines = [] with open('/home/workspace/CarND-Behavioral-Cloning-P3/run1/driving_log.csv') as csvfile: reader = csv.reader(csvfile) for line in reader: lines.append(line) imag...
""" Copyright chriskeraly Copyright (c) 2019 Lumerical Inc. """ import numpy as np import scipy as sp import scipy.constants import lumapi from lumopt.utilities.fields import Fields, FieldsNoInterp def get_lambda_from_cad(fdtd, field_result_name): fdtd.eval("wl = {0}.E.lambda;".format(field_result_n...
import numpy as np from scipy.signal import convolve from time import perf_counter as timer with open('input17.txt') as f: data = (np.array([list(i.strip()) for i in f]) == '#').astype(np.uint8) def cycle(init, dim, gen=6): state = init.reshape([1] * (dim - init.ndim) + list(init.shape)) kernel = np.ones(...
<gh_stars>0 # -*- coding: utf-8 -*- # Name: em_cascades.py # Authors: <NAME> # Constructs an electromagnetic cascade, defined by the emitted photons import logging import numpy as np import pickle import pkgutil from scipy.special import gamma as gamma_func from .config import config try: import jax.numpy as jnp ...
<filename>pysb/export/potterswheel.py """ Module containing a class for converting a PySB model to an equivalent set of ordinary differential equations for integration or analysis in PottersWheel_. .. _PottersWheel: http://www.potterswheel.de For information on how to use the model exporters, see the documentation fo...
<reponame>alisiahkoohi/HINT import os, glob, json import numpy as np import torch import torch.utils.data import pickle from numpy.random import rand, randn from scipy.io import loadmat from scipy.spatial.distance import pdist, squareform from matplotlib import pyplot as plt from collections import defaultdict from sha...
# -*- coding: utf-8 -*- from scipy import ndimage import imageio import matplotlib.pyplot as plt import numpy # Utilização do modulo imageio para ler as imagens mars1 = imageio.imread('Z:\DRPI\questoes_aula\Mars_Reconnaissance_11.tif') mars2 = imageio.imread('Z:\DRPI\questoes_aula\Mars_Reconnaissance_22.tif') def ...
<reponame>Enucatl/machine-learning-aging-brains from __future__ import division, print_function import os import click import numpy as np import tqdm import sklearn.neighbors as skn import sklearn.gaussian_process as skg import sklearn.base import sklearn.metrics import sklearn.model_selection import sklearn.preprocess...
<gh_stars>0 # USAGE: # python scan.py (--images <IMG_DIR> | --image <IMG_PATH>) [-i] # For example, to scan a single image with interactive mode: # python scan.py --image sample_images/desk.JPG -i # To scan all images in a directory automatically: # python scan.py --images sample_images # Scanned images will be output...
<filename>venv/Lib/site-packages/pybrain/tools/xml/handling.py __author__ = '<NAME>, <EMAIL>' from xml.dom.minidom import parse, getDOMImplementation from pybrain.utilities import fListToString from scipy import zeros import string class XMLHandling: """ general purpose methods for reading, writing and editing XM...
<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Copyright 2020-2022 <NAME>. All Rights Reserved. See LICENCE file for details """ import scipy.stats as stats import random import sys import pandas as pd import matplotlib.pyplot as plt from scipy.signal import convolve sys.path.append('../../') from PD...
<gh_stars>10-100 from abc import ABC, abstractmethod import numpy as np import pandas as pd from scipy.sparse import csr_matrix, csc_matrix from sklearn.base import BaseEstimator class BaseTree(ABC, BaseEstimator): """ Abstract base class of all Bayesian decision tree models (classification and regression). ...
import argparse import glob import os.path import gzip import pickle import sys import logging import re import numpy as np import pandas as pd import scipy.stats as sp_stats from run_with_gridsearch import dict2fn from ssvm.data_structures import CandSQLiteDB_Massbank # ================ # Setup the Logger LOGGER ...
import numpy as np import os from scanorama import * from scipy.sparse import vstack from sklearn.cluster import KMeans from sklearn.metrics import roc_auc_score from sklearn.preprocessing import normalize, LabelEncoder from experiments import * from process import load_names from utils import * np.random.seed(0) NA...
''' @author: <NAME> ''' import sys, logging import numpy as np import ibcc from scipy.linalg import block_diag from scipy.special import gammaln def state_to_alpha(logodds, var): alpha1 = 1/var * (1+np.exp(logodds)) alpha2 = alpha1 * (1+np.exp(-logodds)) return alpha1.reshape(logodds.shape), alpha2.reshape...
<filename>TotalActivation/filters/hrf.py import numpy as np from scipy import signal from TotalActivation.filters.cons import cons def bold_parameters(): eps = 0.54 ts = 1.54 tf = 2.46 t0 = 0.98 alpha = 0.33 E0 = 0.34 V0 = 1 k1 = 7 * E0 k2 = 2 k3 = 2 * E0 - 0.2 c = (1 + (1...
import numpy as np import copy import scipy.stats as stats import networkx as nx import matplotlib.pyplot as plt from model import get_data,get_status,stat,statA,data,a,d,T as ori_T,p beta = a+d T = ori_T inc_prob = 1-stats.lognorm.cdf(np.arange(0,999)/4.17,s=0.66) remove_prob = 1-stats.norm.cdf((np.arange(0,999)...
import numpy as np import time import cv2 from scipy.misc import imresize class Window: def __init__(self, name): self._window = name self._fps = 15 self._batch_size = 100 def show(self, generator): for img in generator: cv2.imshow(self._window, imresize(img, (300, 300))) if cv2.waitK...
import os import numpy as np import matplotlib as mat import matplotlib.pyplot as plt import copy import sys import scipy.stats from KMC_Run import * from utils import * import time import scipy class Replicates: ''' Performs statistical data analysis for muliple kMC trajectories with the same input, but dif...
<filename>inversetoon/core/intersect.py<gh_stars>1-10 # -*- coding: utf-8 -*- ## @package inversetoon.core.intersect # # Polyline intersection via internal subdivision. # @author tody # @date 2015/08/12 import numpy as np from scipy.interpolate import UnivariateSpline import matplotlib.pyplot as plt fr...
<filename>sknetwork/ranking/harmonic.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on November 19 2019 @author: <NAME> <<EMAIL>> """ from typing import Union, Optional import numpy as np from scipy import sparse from sknetwork.path.shortest_path import distance from sknetwork.ranking.base import BaseR...
<reponame>elijahc/ML_V1<filename>pretrained_feature_extraction/stats.py import scipy.io as sio import numpy as np def gen_y_fake(y, sem_y): loc = np.zeros_like(y) z = np.random.normal(loc,sem_y) return (y + z) def pairwise_pcc(y,y_pred): # Expects data in shape [nsamples, ncells] ncells = y.shape...
""" plasma functions """ from __future__ import annotations import typing as T import logging import numpy as np import xarray from scipy.integrate import cumtrapz from scipy.interpolate import interp1d, interp2d, interpn from . import read from . import LSP, SPECIES from . import write from .web import url_retrieve...
from __future__ import division import numpy as np import scipy as sp from scipy.sparse import diags import multiprocessing as mp import itertools import time import sys from suftware.src import deft_core from suftware.src import maxent from suftware.src import utils from suftware.src.utils import ControlledError x_M...
# Copyright (C) 2020 NumS Development Team. # # 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 ...
# Copyright 2016 Sandia Corporation and the National Renewable Energy # Laboratory # # 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 #...
import os import tensorflow as tf import numpy as np import pandas as pd from glob import glob from ivis import Ivis from ghost import BinaryGHOST from raise_utils.learners import Autoencoder, RandomForest, LogisticRegressionClassifier from raise_utils.hyperparams import DODGE from raise_utils.transforms import Transfo...
<filename>projects/amygActivation/amygActivation.py # main script to run the processing of the experiment import os import glob import numpy as np import json from datetime import datetime from dateutil import parser from subprocess import call import time import nilearn from nilearn.masking import apply_mask from sc...
# -*- coding: utf-8 -*- """ Created on Thu Jun 17 11:33:40 2021 @author: lukepinkel """ import numpy as np import scipy as sp import scipy.stats TWOPI = 2.0 * np.pi LN2PI = np.log(TWOPI) class SASH: @staticmethod def loglike(y, mu, sigma, nu, tau): return _logpdf(y, mu, sigma, nu, tau) ...
from scipy.io import loadmat import torch def load_and_reconfigure_mat_data(filename, im_size=(192, 192), device='cpu'): data = loadmat(filename) n1, n2 = im_size x = data['data'][0][0][0] y = data['data'][0][0][1] x = torch.stack((torch.tensor(x.real), torch.tensor(x.imag)), dim=2).view( ...
# ------------------------------------------------------------------------------ # Beam environment for damping compensation # ------------------------------------------------------------------------------ import sys sys.path.append('../') from pathlib import Path import time import os import pickle from argparse impo...
import unittest import numpy as np from scipy.spatial.transform import Rotation from d3d.abstraction import ObjectTag, ObjectTarget3D, Target3DArray from d3d.dataset.kitti import KittiObjectClass from d3d.tracking.matcher import (DistanceTypes, HungarianMatcher, NearestNeighborMatche...
import numpy as np from scipy.stats import rankdata class CornerScore(object): @staticmethod def get_scores(cat_word_counts, not_cat_word_counts): pos = CornerScore.get_scores_for_category(cat_word_counts, not_cat_word_counts) neg = CornerScore.get_scores_for_category(not_cat_word_counts, cat_word_counts) sco...
# 14 July 2018 <NAME> # Python bootcamp, lesson 40: Image processing practice with Python # Import modules import numpy as np import matplotlib.pyplot as plt import scipy.ndimage import skimage.io import skimage.segmentation import skimage.morphology # Import some pretty Seaborn settings import seaborn as sns rc={'...
<gh_stars>10-100 import numpy as np from scipy.spatial.ckdtree import cKDTree class DecisionMaking: def __init__(self, normalize=True, ideal_point=None, nadir_point=None) -> None: super().__init__() self.normalize = normalize self.ideal_point, self.nadir_point = ideal_point, nadir_point ...
#!/usr/bin/env python """Module for getting and plotting some basic statstics of segments""" from __future__ import absolute_import import glob import os import os.path import random import math from collections import defaultdict import pandas as pd import scipy.stats import numpy as np import matplotlib.pyplot as p...
<reponame>sharif1093/dextron import numpy as np from copy import deepcopy from digideep.utility.toolbox import get_class from digideep.utility.logging import logger # from digideep.utility.profiling import KeepTime from digideep.utility.monitoring import monitor from digideep.agent.agent_base import AgentBase from sc...
<gh_stars>0 # uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\objects\components\statistic_component.py # Compiled at: 2020-10-08 06:20:44 # Size of s...
import argparse import BLISS as bliss import exoparams import json import numpy as np from sklearn.externals import joblib from scipy import spatial from statsmodels.robust import scale y,x = 0,1 ppm = 1e6 def setup_BLISS_inputs_from_file(dataDir, xBinSize=0.01, yBinSize=0.01, xSigmaR...
<gh_stars>0 from socialsent import util import functools import numpy as np from socialsent import embedding_transformer from scipy.sparse import csr_matrix from multiprocessing import Pool from sklearn.linear_model import LogisticRegression, Ridge from socialsent.graph_construction import similarity_matrix, transitio...
#$ header function f(double[:],double[:,:,:],int) @sympy def g(v,w,i): from sympy import Lambda, Function ,symbols ,IndexedBase,Idx ,Max, Sum x = Function('x') i, n, j, dim, k =symbols('i, n, j, dim, k') v=IndexedBase('v') w=IndexedBase('w') net = Lambda((i, n, dim, k), Max(0.0, Sum(x(k)*w[n, k,...
#coding=utf-8 ''' Created on 2013.12.13 @author: dell ''' import numpy as np from scipy.stats.stats import pearsonr import matplotlib.pyplot as plt #from matplotlib.figure import Figure from matplotlib.pyplot import figure as Figure import os import struct from ..data_transform import Ion2Vector from .ion_calc impo...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ An interface to the excellent spglib library by <NAME> (http://spglib.sourceforge.net/) for pymatgen. v1.0 - Now works with both ordered and disordered structure. v2.0 - Updated for spglib 1.6. v3.0 - pyma...
#!/usr/bin/env python # coding: utf-8 # In[1]: import pandas as pd; import numpy as np; import scipy as sp; import sklearn; import sys; from nltk.corpus import stopwords; import nltk; from nltk.stem import WordNetLemmatizer, SnowballStemmer from nltk.stem.porter import * from gensim.models import ldamodel import gen...
<gh_stars>0 """ Prompt vs. Delayed model of the SN population """ import pandas import numpy as np from scipy import stats from .tools import asym_gaussian class PromptDelayModel(object): def __init__(self): """ """ # ====================== # # Methods # # ===================...
# -*- coding: utf-8 -*- """ Copyright (c) 2016 <NAME>, <NAME>, and <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy...
<gh_stars>1-10 """ Tests for simulation of time series Author: <NAME> License: Simplified-BSD """ import numpy as np from numpy.testing import assert_allclose import pytest from scipy.signal import lfilter from statsmodels.tools.sm_exceptions import SpecificationWarning, \ EstimationWarning from statsmodels.tsa....
<reponame>luiarthur/CytofDensityEstimation<gh_stars>0 from scipy.special import expit, logit, logsumexp from scipy import stats import matplotlib.pyplot as plt import pystan import numpy as np import mcmc from tqdm import trange def update_beta(y, p, sd): log_numer = np.log(p) - sum((y - 1) ** 2) / (2 * sd * sd) ...
"""Validate a face recognizer on the "Labeled Faces in the Wild" dataset (http://vis-www.cs.umass.edu/lfw/). Embeddings are calculated using the pairs from http://vis-www.cs.umass.edu/lfw/pairs.txt and the ROC curve is calculated and plotted. Both the model metagraph and the model parameters need to exist in the same d...
from __future__ import division import numpy as np import sys from sklearn.linear_model import OrthogonalMatchingPursuit from sklearn.linear_model import OrthogonalMatchingPursuitCV def CSSK(h,const=5.0,noise=0.0000001): """Compressed Sensing replacement of Fourier Transform on 1D array h * REQUIRES CVXPY P...
#===========================================# # # # # #----------CROSSWALK RECOGNITION------------# #-----------WRITTEN BY N.DALAL--------------# #-----------------2017 (c)------------------# # ...
<filename>code/methodology/count.py import re import os import matplotlib.pyplot as plt import re import numpy as np from scipy import stats from matplotlib.patches import Rectangle fig = plt.figure() ax = fig.add_subplot(111) PROJECTS_LIST = "../../info/settings-project.txt" RESULT_PATH="../../data/cleaned-complex...
<reponame>blackpigg/RL_landmark_finder #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Apr 7 23:31:43 2017 @author: wd """ """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" import gym from gym import spaces from gym.utils import s...
<filename>search.py import numpy as np import scipy from multiprocessing import Pool from os.path import join from sklearn.svm import SVC from sklearn.model_selection import GridSearchCV from util import load_data import argparse import pandas as pd def search(dataset, data_dir): gram = np.load(join(data_dir, 'gra...
<reponame>raylu/PoE.py<filename>poe/price.py<gh_stars>10-100 import operator import statistics as stats import numpy as np class PriceQuery: def __init__(self, league, listings): self.league = league self.listings = listings def lowest(self, results=3): return self.listings[:results]...
<reponame>goccert25/PowerSimData<filename>powersimdata/output/output_data.py<gh_stars>0 import os import pickle import numpy as np import pandas as pd from scipy.sparse import coo_matrix from powersimdata.data_access.context import Context from powersimdata.input.input_data import get_bus_demand from powersimdata.uti...
import numpy as np from scipy import ndimage from skimage import measure, morphology def find_edges(mask, level=0.5): edges = measure.find_contours(mask, level)[0] print(type(edges)) ys = edges[:, 0] xs = edges[:, 1] return xs, ys def plot_contours(arr, aux=None, level=0.5, ax=None, **kwargs): ...
import argparse import argparse import os import shutil import numpy as np import pandas as pd import torch from scipy.optimize import linear_sum_assignment from scipy.special import softmax from sklearn.metrics import confusion_matrix, accuracy_score, f1_score, \ classification_report import src.utils.plotting_u...
<reponame>pec27/lizard from lizard.lizard_c import * import sys def test(): """ Test that the linear interpolation gives the same result as scipy """ n = 50 # grid size (n,n,n) npts = 10 # number of points to interpolate from numpy import arange from numpy.random import random from scipy.ndimag...
""" 分段线性插值 """ import sympy as sp from sympy import Rational as r def piecewise_linear_inter(X, Y): """ 分段线性插值 :param X: 一系列x的一维向量 :param Y: 一系列y的一维向量 :return: 分段线性插值多项式 """ x = sp.Symbol('x') for i in range(len(X) - 1): # i代表当前第几段 print('在[{}, {}]上的线性插值为:'.format(X[i], X[i +...
<reponame>albertopoljak/code-jam-5 import datetime import os import pickle from pathlib import Path import numpy as np from scipy.interpolate import interp1d from sklearn.linear_model import LinearRegression from sklearn.preprocessing import PolynomialFeatures from practical_porcupines.flask_api.models import LevelMo...
<reponame>IronCretin/mandelbrot import argparse import sys import stdio import stddraw import time import color from math import * import cmath from picture import Picture from colorsys import hsv_to_rgb # This bit just sets up the argument handling parser = argparse.ArgumentParser(description='Generate Mandelbrot se...
# -*- coding: utf-8 -*- import numpy as np import numpy.matlib import scipy.misc from PIL import Image import scipy.io import os import scipy import sys caffe_root = '/home/lixiaoxing/code/PixelNet/tools/caffe' sys.path.insert(0, caffe_root+'python/') import caffe # Use GPU? use_gpu = 1; gpu_id = 3; net_struct = '/ho...
import pylab as p import glob import numpy as n import astropy.cosmology as co aa=co.Planck13 import astropy.units as uu import cPickle import sys from scipy.interpolate import interp1d import glob snL=glob.glob("/data2/DATA/eBOSS/Multidark-properties/MDPL/*0023*.cat.gz") import numpy as n import cPickle massB=n.aran...