text
string
<gh_stars>0 #!/usr/bin/env python3 '''apogeeTharTest.py test #2 line fitting, plot optional (EM) EM, 09/23/2013 - program for the testing of fitting compare reference. The reference are "/data/apogee/quickred/56531/ap1D-a-09690003.fits.fz" (A) "ap1D-a-09690005.fits...
from email.utils import localtime from scipy import interpolate import time from stepper import Stepper az_motor = Stepper() el_motor = Stepper() def interpolate_pos_data(orig_arr): return interpolate.interp1d(orig_arr) def main(): #put in tracking data download logic when topocentric data is bug fixed. positi...
<reponame>Tarheel-Formal-Methods/kaa-optimize import numpy as np from scipy.spatial import ConvexHull from settings import KaaSettings """ Wrapper around list for representing arbitrary trajectories of a system. """ class Traj: def __init__(self, model, initial_point, steps=0, label=None, traj_mat=None): ...
<filename>expo.py #!/usr/bin/python3 import h5py import click from matplotlib import pyplot as plt from cycler import cycler import re import statistics import math import numpy as np from itertools import islice import scipy.stats as stats TEXT_ENCODING = 'utf-8' def get_gene(id, radix): gene = [] for x ...
import numpy as np from numpy.linalg import det from scipy.optimize import fsolve from scipy.stats import norm import itertools from .constants import * def check_condition(state, condition): # Define a success condition for each state, e.g., mutual exclusivity. if condition==EXCLUSIVITY: if sum(stat...
"""Use the pyDOE2 library to generate latin hypercube samples.""" import numpy as np import warnings try: from pyDOE2 import lhs as lhs_pydoe HAS_PYDOE2 = True except ImportError: HAS_PYDOE2 = False try: from scipy.stats.qmc import LatinHypercube as lhs_scipy HAS_SCIPY_QMC = True except ImportEr...
<reponame>prakass1/Rank_Based_Detection_Algorithm ########################################################################################## # # Synthetic simulation, to test the constructed algorithm approach against various scenarios # Uncomment to work with synthethic data analysis using - https://pyod.readthedocs.i...
import numpy as np import torch from scipy import linalg from torch.nn.functional import adaptive_avg_pool2d from tqdm import tqdm from utils.fid.inception import InceptionV3 class FID: def __init__(self, dims=2048): ''' 64: first max pooling features 192: second max pooling features ...
<reponame>super-resolution/Locan """ Regions as support for localization data. This module provides classes to define geometric regions for localization data. All region classes inherit from the abstract base class `Region`. """ # todo: fix docstrings import itertools as it from abc import ABC, abstractmethod impo...
import numpy as np from MachineLearning.Distances import DistancesMatrix import scipy as sp #Need to add the possibility to mix kenerls together like K1+K2, K1*K2 etc def KernelCalc(X,Xt,Nl,Nt,var=None,typeK='Poly',typeD=None,T=False,xinterval=None): ##################################################################...
import numpy as np import pandas as pd from sklearn.datasets import load_digits from sklearn.model_selection import train_test_split from sklearn.linear_model import LogisticRegression from sklearn.svm import SVC from sklearn.cluster import KMeans from sklearn.metrics import accuracy_score, confusion_matrix from sklear...
import math import h5py import nibabel as nib import numpy as np import SimpleITK as sitk import torch import torch.nn.functional as F from medpy import metric from tqdm import tqdm from scipy.ndimage import interpolation def test_single_case(net, image, stride, patch_size, num_classes=1): w, h, d = image.shape ...
import itertools import logging import statistics import struct from math import isclose from typing import NamedTuple, Optional, List, Tuple from numpy.random import default_rng from .name_gen import NameGenerator from .genome import Genome, GenomeMaker, make_identity_genome class BranchLenStats(NamedTuple): ave...
<reponame>danielabler/glimslib """Provides helper functions for visualisation module. """ import os import time import matplotlib.pylab as plt import numpy as np from matplotlib import pyplot as plt, colors as colors from mpl_toolkits.axes_grid1 import make_axes_locatable from scipy.interpolate import griddata from u...
<filename>pynrm/nirc2.py """NIRC2 specific methods and variables for an AOInstrument. """ from __future__ import division, print_function import astropy.io.fits as pyfits import numpy as np import scipy.ndimage as nd import matplotlib.pyplot as plt import matplotlib.cm as cm import time import glob import pdb import ti...
<gh_stars>0 from ast import Mod import numpy as np import scipy from multiprocessing import Pool from enum import Enum class Direction(Enum): N = 0 NE = 1 E = 2 SE = 3 S = 4 SW = 5 W = 6 NW = 7 transform = { 'N': (-1,0), 'NE': (-1,1), 'E': (0,1), 'SE': (1,1), 'S': ...
<gh_stars>0 # -*- coding: utf-8 -*- ''' Semiparametric Support Vector Machine model under POM3. ''' __author__ = "<NAME>" __date__ = "January 2021" import numpy as np from scipy.spatial.distance import cdist from sklearn.metrics import accuracy_score from MMLL.models.POM3.CommonML.POM3_CommonML import ...
<reponame>mathkann/understanding-random-forests<filename>scripts/ch4_bias_variance.py<gh_stars>100-1000 import numpy as np import matplotlib.pyplot as plt from scipy.stats import norm blue = (0, 0, 1.0) red = (1.0, 0, 0) gray = (0.7, 0.7, 0.7) x = np.arange(-10, 10, 0.0001) p_y = norm.pdf(x, -3.0, 1) p_y_hat = norm.p...
import datetime, inspect, random, msgpack, os, sys, math, time, torch, pdb import numpy as np from pprint import pprint from scipy.sparse.csgraph import floyd_warshall currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.insert(0, pa...
# coding: utf-8 # ## Heatmap with change-cell-size feature # # ### Motivation # Heatmap is a great chart to catch information in matrix. # However, I sometimes want to add more information in cases like this: # * matrix is like [product A-F] x [area a-f] # * want to see [profitability] and [sales volume] of each ...
from logs import logDecorator as lD import jsonref import pprint import statistics as stats from psycopg2.sql import SQL, Identifier, Literal from lib.databaseIO import pgIO from collections import Counter from tqdm import tqdm from multiprocessing import Pool from time import sleep config = jsonref.load(open('../con...
<filename>pk_predictors.py import subprocess as sp from arnie.utils import * import glob from os import getcwd, chdir, remove, mkdir, rmdir, path from scipy.optimize import linear_sum_assignment # TODO script all previous investigations # TODO Debug modes to print output and err to help with install issues # TODO pk_...
# Author: <NAME> <<EMAIL>> # Copyright (c) 2020 <NAME> # # This file is part of Monet. import logging from typing import Iterable from math import floor, ceil import pandas as pd import numpy as np from scipy.stats import binom, mannwhitneyu import plotly.graph_objs as go from ..core import ExpMatrix from .. import ...
<reponame>KongHag/emotion_project<filename>metrics.py # -*- coding: utf-8 -*- """ Created on Sun Mar 29 15:32:25 2020 @author: lucas """ import torch from scipy.stats import pearsonr def get_metrics(model, testloader): device = torch.device( 'cuda:0') if torch.cuda.is_available() else torch.device('c...
<gh_stars>0 from sympy import * import re x = Symbol('x') y = Symbol('y') z = Symbol('z') # if (tipo==1){ alert("numerador");} # if (tipo==2){ alert("numerador raiz");} # if (tipo==3){ alert("numerador e denominador");} # if (tipo==4){ alert("numerador raiz e denominador");} # if (tipo==5){ alert("numerador raiz e de...
<filename>peakhood/hoodlib.py<gh_stars>1-10 #!/usr/bin/env python3 from distutils.spawn import find_executable import matplotlib.pyplot as plt # import plotly.express as px import seaborn as sns import pandas as pd import numpy as np import subprocess import statistics import random import math import gzip import uuid...
<reponame>aalto-ui/chi21adaptive import csv #For fasttext word embedding # import fasttext # import fasttext.util #For word2vec embeddings # from gensim.models import KeyedVectors #To compute cosine similarity from scipy import spatial import math # reads a log file and returns a frequency distribution as a dict def l...
import tkinter as tk import tkinter.ttk as ttk from tkinter import filedialog from tkinter import font import sys import os import numpy as np import librosa from sklearn.model_selection import train_test_split import math import scipy import requests import tarfile import time import matplotlib from pylab import Max...
from __future__ import print_function from builtins import zip from builtins import range from builtins import object from cosmosis.gaussian_likelihood import GaussianLikelihood from cosmosis.datablock import names from twopoint_cosmosis import theory_names, type_table from astropy.io import fits from scipy.interpolate...
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ Scientific Python startup script Requires NumPy, SciPy and Matplotlib """ # Need a temporary print function that is Python version agnostic. import sys import o...
#!C:\\Python38\\python.exe DIR = "C:\\wamp64\\www\\ProjetS4\\" from sklearn.metrics.pairwise import cosine_similarity from IPython.display import display import matplotlib.pyplot as plt import pandas as pd import statistics import operator import subprocess import php import popen2 import simplejson as json import li...
import os import sys import glob import numpy as np import matplotlib.pyplot as plt import scipy.stats as sps from dlt import DLT from collections import defaultdict from calibration_point_selection import label_to_3Dcoord from config import * PATH = 'data_082421' IMAGE_PATH = os.path.join(PATH, 'calibration') CAL...
<filename>Utils/io.py import numpy as np import pandas as pd import torch import torch.nn.functional as F from scipy.sparse import coo_matrix except_chr = {'hsa': {'X': 23, 23: 'X'}, 'mouse': {'X': 20, 20: 'X'}} def readcoo2mat(cooFile, normFile, resolution): """ Function used for reading a coordinated tag f...
<filename>src/dimsm/measurement.py<gh_stars>0 """ Measurement =========== Contains table of measurements and the (co)variance matrix. """ from typing import List, Union from operator import attrgetter from itertools import product import numpy as np import pandas as pd from scipy.sparse import csr_matrix, diags from ...
<gh_stars>1-10 # -*- coding: utf-8 -*- #------------------------------------------------------------------------------ # FEDERAL UNIVERSITY OF UBERLANDIA # Faculty of Electrical Engineering # Biomedical Engineering Lab #------------------------------------------------------------------------------ # Author: <NAME>, MSc...
# -*- coding: utf-8 -*- """ Created on Wed Feb 17 18:09:11 2021 @author: peter """ import numpy as np from scipy.special import gammaln from scipy.stats import t import pandas as pd def loglikelihood_normal(resid, sigma2): """ Negative Log-Likelihood function whereas the underlying distribution is Normal. ...
from __future__ import absolute_import, division, print_function # TensorFlow and tf.keras import tensorflow as tf import keras from keras.utils import CustomObjectScope from keras.initializers import glorot_uniform from keras.preprocessing import image from keras.models import Sequential, load_model, model_from_json ...
<gh_stars>0 """ dab-seq: single-cell dna genotyping and antibody sequencing <NAME> 7.9.2019 functions required for the processing pipeline two classes are defined: * TapestriTube: variables and methods that operate on the level of a single Tapestri tube library * SingleCell: variables and methods that operate on the...
<reponame>EMSTrack/Algorithms from typing import List from geopy import Point from scipy.spatial import KDTree from ems.datasets.location.location_set import LocationSet class KDTreeLocationSet(LocationSet): def __init__(self, latitudes: List[float], longitudes: List[float]): ...
import logging import math import numpy as np from mdsea.constants import DTYPE from scipy import special from scipy.interpolate import interp1d log = logging.getLogger(__name__) MONTECARLO_SPEEDRANGE = np.arange(0, 50, 0.001) # ====================================================================== # --- Speed Di...
<reponame>open-pulse/OpenPulse import numpy as np from scipy.sparse import save_npz, load_npz # import pytest from pulse.utils import sparse_is_equal from pulse.preprocessing.cross_section import CrossSection from pulse.preprocessing.material import Material from pulse.preprocessing.preprocessor import Preprocessor ...
<filename>sys_simulator/channels/__init__.py import numpy as np import scipy from scipy.stats import nakagami, rayleigh from scipy import constants class Channel: def __init__(self, *kwargs): pass def large_scale(self, *kwargs): pass def pathloss(self, *kwargs): pass def sma...
<filename>utils.py import numpy as np import torch import matlab import csv import os import shutil import torch.nn as nn from torch.autograd import Variable import matplotlib.pyplot as plt import matlab.engine from numpy import random import json from skimage import img_as_float from skimage.metrics import structural_...
<filename>scripts/bayesian_LC.py #!/usr/bin/env python """ The main module of kNe-inference that sets up the Bayesian formalism. Classes: Kilonova_Inference Sampler """ __author__ = '<NAME>' import numpy as np import matplotlib.pyplot as plt from scipy.stats import norm, truncnorm from scipy.integrate impor...
import numpy as np from scipy.sparse import csr_matrix from scipy.sparse.csgraph import minimum_spanning_tree def main() -> None: N, M = map(int, input().split()) large, small = [], [] for i in range(N): x, y, c = map(int, input().split()) large.append((x, y, c)) for i in range(M): ...
<reponame>Taiji-pipeline/Taiji-utils import gzip import scipy as sp import numpy as np from sklearn.linear_model import LinearRegression class InputData: def __init__(self, filename): self.filename = filename with gzip.open(self.filename, mode='rt') as f: header = f.readline().strip() ...
<reponame>akarshkumar0101/timm-mlp-shaker import scipy import scipy.stats import numpy as np import torch import torchvision from torch import nn from torch.utils.data import Dataset from torch.utils.data import DataLoader from torchvision import transforms import matplotlib.pyplot as plt from tqdm.notebook import tqdm...
<reponame>pzh1989/trikit<filename>trikit/__init__.py """ _ | |_ _ __(_)/| _(_) | | __| '__| | |/ / | __| | |_| | | | <| | |_ \__|_| |_|_|\_\_|\__| A Pythonic Approach to Actuarial Reserving Copyright 2018 <NAME> """ import collections import datetime from functools import partial import os import os.path im...
<reponame>LuizFritsch/analise_projeto_algoritmo<gh_stars>0 #!/usr/bin/python3 # -*- coding: utf-8 -*- DEFAULT_OUT = "out_alg_naive_tsp.txt" DEFAULT_SEED = None DEFAULT_N_START = 1 DEFAULT_N_STOP = 10 DEFAULT_N_STEP = 1 DEFAULT_TRIALS = 3 from subprocess import Popen, PIPE from time import sleep, time from multiproce...
<filename>src/features/preprocess.py # region imports import math import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from scipy.stats import norm from sklearn.model_selection import train_test_split from sklearn.metrics import mean_squared_log_error from sklearn import preproce...
<reponame>wathen/PhD from dolfin import assemble, MixedFunctionSpace, tic,toc import petsc4py import sys petsc4py.init(sys.argv) from petsc4py import PETSc import CheckPetsc4py as CP import StokesPrecond import NSprecond import MaxwellPrecond as MP import PETScIO as IO import numpy as np import P as PrecondMulti impo...
import numpy as np import scipy.io as scio ''' Efficient and flexible MATLAB implementation of 2D and 3D elastoplastic problems https://github.com/matlabfem/matlab_fem_elastoplasticity D:\FluidSim\FluidSim\FEMNEW\matlab_fem_elastoplasticity-master ''' young = 206900 poisson = 0.29 shear = young / (2*(1 + poisson)) ...
<filename>polyML/TON_tools3.py # -*- coding: utf-8 -*- """ This function takes a data file and removes correlations Created on Fri Oct 14 18:53:40 2016 @author: pipolose """ import numpy as np import scipy.io import pandas as pd from sklearn.base import BaseEstimator, TransformerMixin import warnings import logging im...
""" Calibration =========== This module contains routines for the blind calibration of a microphone array with sources in the far field. The methods are: * `joint_calibration_gd`: Straightforward gradient descent method * `joint_calibration_sgd`: Straightforward stochastic gradient descent method * `struc...
# Copyright (c) 2020, 2021, NECSTLab, Politecnico di Milano. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this li...
<filename>arve/from_arve/Experiment.py<gh_stars>0 """ Copyright 2016 <NAME> This file is part of the COMTESSA project software. This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the L...
""" Runs a model on a single node across multiple gpus. """ import os from pathlib import Path import torch import numpy as np import torch.nn.functional as F import scipy.io as sio import matplotlib.pyplot as plt import configargparse from src.DeepRegression import Model TOL = 1e-14 def main(hparams): if hp...
# code for fitting spectra, using the models in spectral_model.py from __future__ import absolute_import, division, print_function # python2 compatibility import math import numpy as np from scipy.optimize import curve_fit from bisect import bisect from numpy.polynomial.chebyshev import chebval from scipy.ndimage impor...
<filename>tests/test_statistics.py<gh_stars>0 import sys import unittest import random import statistics from mpyc.runtime import mpc from mpyc.statistics import (mean, variance, stdev, pvariance, pstdev, mode, median, median_low, median_high, quantiles, covaria...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Oct 26 12:25:54 2018 @author: luoyuhao """ import base64 import cv2 import numpy as np import imageio from scipy import misc import json import time import os import sklearn from vector_normalization import Vector def base64_to_image(base64_code): #...
""" Script used to test the adaptive interpolation and the evaluation of said interpolant """ from __future__ import absolute_import import ctypes import ctypes.util import os import time import numpy as np import numpy.linalg as la import scipy.special as spec import matplotlib as mpl from tempfile import TemporaryD...
#!/usr/bin/env python # The MIT License (MIT) # # Copyright (c) 2016 <NAME>, National Institutes of Health / NINDS # # 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, incl...
<reponame>PoliHydra/hydra<filename>utils/npz2mat.py from __future__ import print_function import os import argparse from numpy import load from scipy.io import savemat def main(): parser = argparse.ArgumentParser( description='convert numpy .npz to matlab .mat format') parser.add_argument('npz', nargs...
<filename>src/chapter_02/code/ch2_fig4.py #%% import os import glob import pickle import re import numpy as np import pandas as pd import sys import phd.viz import phd.stats import matplotlib.pyplot as plt import matplotlib.cm as cm import matplotlib.gridspec as gridspec import matplotlib.colors as plc import altair as...
<reponame>david-zwicker/cv-mouse-burrows ''' Created on Oct 2, 2014 @author: <NAME> <<EMAIL>> Module that contains the class responsible for the fourth pass of the algorithm ''' from __future__ import division import copy import functools import time import cv2 import numpy as np from scipy import cluster from sha...
<gh_stars>1-10 #!/usr/bin/python ''' @author: <NAME> @email: <EMAIL> @title: FaekCast @description: Cast audio out of linux box (including seperate applications) from Chromium browser extension using MPEG HTTP Stream ''' import numpy import jack import time import sys import io import struct import warnings im...
"""SentimentInvestor Model""" __docformat__ = "numpy" import dataclasses import datetime import logging import multiprocessing import os import statistics import time from typing import Any, List, Optional, Tuple, Union import pandas as pd from colorama import Fore, Style from sentipy.sentipy import Sentipy from gam...
<filename>python/ex8_anomaly_recommender/ex8.py # Machine Learning Online Class # Exercise 8 | Anomaly Detection and Collaborative Filtering # # Instructions # ------------ # # This file contains code that helps you get started on the # exercise. You will need to complete the following functions: # # estimateG...
import requests from typing import Dict, List, Optional from datetime import date, timedelta from scipy import stats # type: ignore from .parser import Parser HEADERS = { 'User-Agent': "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 " "(KHTML, like Gecko) Chrome/79.0.3945.94 Safari/537.36" ...
""" Tests for functions used in Randomized Parcellation Based Inference. """ # Author: <NAME>, <<EMAIL>>, Feb. 2014 import numpy as np from numpy.testing import (assert_equal, assert_array_equal, assert_array_almost_equal, assert_raises) from sklearn.utils import check_random_state from nile...
<reponame>IceCubeOpenSource/ic3-labels<gh_stars>1-10 """nuVeto Atmospheric Self-Veto Models This file implements a wrapper class around nuVeto (https://github.com/tianluyuan/nuVeto) which builds splines in energy and zenith. These can then be used to calculate the self-veto effect for atmospheric neutrinos. See also t...
<gh_stars>1-10 #!/usr/bin/env python2 # # wsi_bot_apply2 # # Version 2 of Bag-Of_things: # # -uses OpenCV for faster operation - but different local descriptors than in the 1st version; # -uses annotation files for defining the regions from where the descriptors are to be # extracted from __future__ import (absolute...
<filename>angelinoNozzle_py/test_plug_code.py from plug_nozzle_angelino import plug_nozzle import matplotlib.pyplot as plt import numpy as np import aerospike_optimizer as ao import gasdynamics as gd from scipy import interpolate r_e = 0.027 T_w = 600 alpha = 1 beta = 1 truncate_ratio_init = 0.2 design_alt_init = 9...
import numpy as np import numpy.typing as npt import osqp from scipy.sparse import csc_matrix from optimization.__split_optimization_pu_classifier import SplitOptimizationPUClassifier from optimization.functions import mm_q, add_bias, joint_risk class MMClassifier(SplitOptimizationPUClassifier): osqp_max_iter: i...
<filename>pykomposter/behaviours.py from asyncio import events import fractions import sys import time import matplotlib.pyplot as plt import music21 import numpy as np import pandas as pd import tqdm ############################ # FOR FINITE STATE MACHINE # ############################ from transitions import Machin...
<reponame>gqfiddler/Stylometer<gh_stars>1-10 ''' contains example calls for adding authors or generating new data tables with authors / texts of your choice ''' from scipy.spatial.distance import minkowski import modules.dataGenerator as dataGenerator import modules.metrics as metrics import os THIS_FOLDER = os.path.d...
""" Copyright © 2020. All rights reserved. Author: <NAME> <<EMAIL>> Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 """ import numpy as np import random import copy import math import scipy.optimize as opt from .func import * class FormulaVertex: """ Класс вершины де...
"""A wrapper for the LibFM recommender. See www.libfm.org for implementation details.""" import numpy as np import scipy.sparse import wpyfm from . import recommender class LibFM(recommender.PredictRecommender): """The libFM recommendation model which is a factorization machine. Parameters ---------- ...
<filename>Lowess.py # -*- coding: utf-8 -*- """ Created on Wed Mar 16 14:54:33 2022 @author: marco """ import os import matplotlib.pyplot as plt import numpy as np import pandas as pd from datetime import date import warnings # `do not disturbe` mode import seaborn as sns...
# <NAME> (<EMAIL>) # Harvard-MIT Department of Health Sciences & Technology # Athinoula A. Martinos Center for Biomedical Imaging import numpy as np from skimage import measure import matplotlib.pylab as plt from scipy.ndimage.morphology import binary_fill_holes def Contours(mask, tissue_labels=[1,2,3]): contou...
# -*- coding: utf-8 -*- # SPDX-License-Identifier: BSD-3-Clause # SPDX-FileCopyrightText: © 2010 by California Institute of Technology. # # statefbk.py - tools for state feedback control # # Author: <NAME>, <NAME> # Date: 31 May 2010 # # This file contains routines for designing state space controllers # # Copyright (c...
<gh_stars>1-10 import rebalancer from sp500_data_loader import load_data import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy.stats import binom def plot_data(data1, data2, label1='asset1', label2='asset2'): f, (p1, p2) = plt.subplots(2, 2) p1[0].plot(data1, label=label1) p1[0...
<<<<<<< HEAD import logging import numpy as np import pandas as pd import torch import torch.nn as nn from scipy.stats import multivariate_normal from torch.utils.data import DataLoader from torch.utils.data.sampler import SubsetRandomSampler from tqdm import trange from .algorithm_utils import Algorithm, ...
''' ## Test ## # Test a trained DQN. This can be run alongside training by running 'run_every_new_ckpt.sh'. @author: <NAME> (<EMAIL>) ''' from datetime import datetime import os import sys import argparse import gym import tensorflow as tf import numpy as np import scipy.stats as ss import random impor...
import numpy as np import pytest from scipy.sparse import issparse from scipy.sparse import coo_matrix from scipy.sparse import csc_matrix from scipy.sparse import csr_matrix from scipy.sparse import dok_matrix from scipy.sparse import lil_matrix from sklearn.utils.multiclass import type_of_target from sklearn.util...
<reponame>AlbertMillan/THU--ACM_2019-2021<filename>THU--DDBS/HW1/bea.py import numpy as np import pylab import scipy.cluster.hierarchy as sch #Create matrices n = 7 # AA = np.zeros([n,n]) # AA = np.array([[42,0,37,5],[0,82,7,75],[37,7,44,0],[5,75,0,8]]) AA = np.array([ [30,30,30,30,30,30,30], ...
<gh_stars>10-100 # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from PIL import Image from typing import Any, Callable, Optional, Tuple import numpy as np import os impor...
<reponame>Lila14/multimds import numpy as np import data_tools as dt import sys import os import linear_algebra as la import array_tools as at from scipy import signal as sg from hmmlearn import hmm import argparse def call_peaks(data): """Calls peaks using Gaussian hidden markov model""" reshaped_data = data.reshap...
<reponame>marcovaas/uclametrics<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Tue Apr 12 17:39:48 2022 @author: marco """ import pandas as pd import numpy as np import os from scipy.linalg import pinv as pinv from scipy.linalg import inv as inv from sklearn.preprocessing import PolynomialFeatures os....
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals, division, absolute_import from builtins import (bytes, dict, int, list, object, range, str, # noqa ascii, chr, hex, input, next, oct, open, pow, round, super, filter, map, zip) from future import standard_library...
<filename>redshift_paper/code/high_spin_halos.py #!/usr/bin/env python ################################################################################ import sys sys.path.append("../code") from read_data import read_data import matplotlib.cm as cm import matplotlib.pyplot as plt import numpy as np from scipy import...
<reponame>austinbrown34/shap<gh_stars>0 import numpy as np import scipy as sp import warnings from .explainer import Explainer class LinearExplainer(Explainer): """ Computes SHAP values for a linear model, optionally accounting for inter-feature correlations. This computes the SHAP values for a linear model a...
<reponame>asceenl/lasp #!/usr/bin/env python3 # -*- coding: utf-8 -*- """! Author: <NAME> - ASCEE Description: FIR filter design for octave bands from 16Hz to 16 kHz for a sampling frequency of 48 kHz, filter design for one-third octave bands. Resulting filters are supposed to be standard compliant. See test/octave_f...
<filename>mcmc/util_cupy.py # -*- coding: utf-8 -*- """ Created on Thu Dec 13 14:17:09 2018 @author: puat133 """ # import math import h5py import scipy.io as sio import numpy as np import scipy.linalg as sla import numba as nb import cupy as cp import time import gc import mcmc.image_cupy as im import h5py from skimag...
# -*- coding: utf-8 -*- # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD 3 clause """ The :mod:`sklearn.feature_extraction.text` submodule gathers utilities to build feature vectors fr...
from os import listdir, path import numpy as np import scipy, cv2, os, sys, argparse, audio import json, subprocess, random, string from tqdm import tqdm from glob import glob import torch, face_detection from models import Wav2Lip parser = argparse.ArgumentParser(description='Inference code to lip-sync videos in the ...
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- from __future__ import division, print_function """diffacto.diffacto: provides entry point main().""" __version__ = "1.0.5" import csv import re import warnings from collections import defaultdict from multiprocessing import Pool from scipy import optimize, stats impor...
#!/usr/bin/python # -*- coding: utf-8 -*- ## Add path to library (just for examples; you do not need this) import sys, os sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..')) from scipy import random from PyQt4 import QtGui, QtCore from pyqtgraph.PlotWidget import * from pyqtgraph.graphicsItems import ...
<reponame>CAVED123/reinvent-randomized import random import math import numpy as np import scipy.stats as sps import torch import torch.utils.data as tud import torch.nn.utils as tnnu import models.dataset as md import models.vocabulary as mv import utils.chem as uc import utils.tensorboard as utb class Action: ...
from anndata import AnnData from collections import Counter import datetime from dateutil.parser import parse as dparse import errno import math import matplotlib.pyplot as plt import numpy as np import os import pandas as pd import random import scanpy as sc from scipy.sparse import csr_matrix, dok_matrix import scipy...