text string |
|---|
<reponame>lynnyi/clustering_on_transcript_compatibility_counts
from sklearn.metrics.pairwise import pairwise_distances
from scipy.stats import entropy
import pickle
import numpy as np
import sys
import multiprocessing as mp
import itertools
print(len(sys.argv))
if len(sys.argv)!=4:
print ('usage is \n python get_p... |
#!/usr/bin/env python
import os
import numpy as np
def gofr_snapshot(axes,pos,rmax,rmin=0,nbin=40,gofr_norm=None):
""" calculate the pair correlation function of a snapshot of a crystal structure given the 'axes' of the simulation cell and the positions ('pos') of atoms inside the cell.
'rmax' is the maximum p... |
<gh_stars>1-10
import pyttsx3 as pt
import sys
import random
import scipy.io.wavfile as wav
import sounddevice as sd
def shutdown(cmd):
e = pt.Engine()
e.say("good bye sir")
e.runAndWait()
sys.exit(101)
def record_denoiser(cmd):
e = pt.Engine()
e.say("Recording a new noise file")... |
<reponame>APS-XSD-OPT-Group/XSVT
# #########################################################################
# Copyright (c) 2020, UChicago Argonne, LLC. All rights reserved. #
# #
# Copyright 2020. UChicago Argonne, LLC. This software was ... |
import os
import torch
import time
import sys
from configs.config import MyConfiguration
import torch.nn as nn
import glob
from tqdm import tqdm
from scipy import misc
import numpy as np
import re
import functools
from collections import OrderedDict
import pandas as pd
# from torch.autograd import Variabl... |
<filename>Scripts/Analyzer_100.py
#!/usr/bin/env python
# coding: utf-8
# ##Analyzer
#
# Statistically and visually compare mRNA and lncRNA sequences from GenCode.v38.
#
# Assume user downloaded files from GenCode38 [FTP](http://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_38/)
# to a subdirectory calle... |
import numpy as np
import sympy
import devito.types.basic as basic
from devito.tools import dtype_to_cstr
from devito.ops.utils import namespace
class Array(basic.Array):
@property
def _C_typedata(self):
if isinstance(self.dtype, str):
return self.dtype
return super()._C_typeda... |
<filename>research/GDNN/cross_hindcast.py
import xarray as xr
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
from os.path import join
from scipy.stats import norm, pearsonr
from ninolearn.learn.models.dem import DEM
from ninolearn.learn.fit import cross... |
<filename>experiments/relation-confidence/bin/find_relation_confidence_metric.py
#!/bin/env python
import re, sys, os, apf, math, bisect, random, textwrap
from collections import defaultdict
import histogram; reload(histogram) # testing
reload(apf) # testing
from histogram import *
from scipy import stats
"""
Filter:... |
# -*- coding: utf-8 -*-
"""
Posture features
"""
from __future__ import division
import scipy.ndimage.filters as filters
import numpy as np
import warnings
import os
import tables
import cv2
from . import generic_features
from .generic_features import Feature
from .. import config, utils
from . import events
cl... |
<reponame>itsjeevs/projectEuler
#!/usr/bin/python
from euler.EulerUtils import add, isPermutation, isPrime, isGreater, multiply, isPerfectSquare
from euler.EulerUtils import primes
import math
import sys
from scipy.signal.waveforms import square
def euler7():
primesList=[]
counter=2
while 1:
if isPrime(count... |
# -*- coding: utf-8 -*-
#%% NumPyの読み込み
import numpy as np
# SciPyのstatsモジュールの読み込み
import scipy.stats as st
# MatplotlibのPyplotモジュールの読み込み
import matplotlib.pyplot as plt
# 日本語フォントの設定
from matplotlib.font_manager import FontProperties
import sys
if sys.platform.startswith('win'):
FontPath = 'C:\\Windows\\Fonts\... |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Users don't need to touch this script, but if you're interested...
THIS SCRIPT CONTAINS:
- getFlux(): used to get observed fllux from FSPS luminosity output
- getd_L(): used to get luminosity distance as a function of redshift
- getAvgFlux(): simply returns the avera... |
<reponame>nanoMFG/GSA-Image<filename>src/gsaimage/gsaimage2.py
from __future__ import division
from collections import OrderedDict
import cv2
import json
import numpy as np
import numpy.linalg as la
import os
import pyqtgraph as pg
import pyqtgraph.exporters
from scipy import signal
import seaborn
import subprocess
i... |
import torch
import numpy as np
import scipy.signal
from graphnas.gnn_model_manager import CitationGNNManager
from graphnas_variants.macro_graphnas.pyg.pyg_gnn_model_manager import GeoCitationManager
# import removed from the middle of the code
from graphnas.search_space import MacroSearchSpace
from graphnas.graphna... |
<filename>starvine/bvcopula/tests/test_rotation_gumbel.py
##
# \brief Test copula rotations
from __future__ import print_function, division
from starvine.bvcopula.pc_base import PairCopula
from starvine.bvcopula.copula_factory import Copula
import unittest
import numpy as np
import seaborn as sns
from scipy.stats impor... |
"""
pre-defined convenience force functions
"""
import numpy as np
from scipy.interpolate import RegularGridInterpolator
def force_from_data(grid, data):
"""create a force function from data on a grid
Arguments:
grid list of grid arrays along each dimension
data force data (shape [... |
<gh_stars>100-1000
import math
import diffrax
import jax
import jax.numpy as jnp
import jax.random as jrandom
import pytest
import scipy.stats as stats
_vals = {
int: [0, 2],
float: [0.0, 2.0],
jnp.int32: [jnp.array(0, dtype=jnp.int32), jnp.array(2, dtype=jnp.int32)],
jnp.float32: [jnp.array(0.0, dty... |
<gh_stars>10-100
# JN 2015-05-08 adding docstrings to this old, useful code
"""
Simple signal filtering for spike extraction
"""
from __future__ import absolute_import, division
import numpy as np
from scipy.signal import ellip, filtfilt
# pylint: disable=invalid-name, unbalanced-tuple-unpacking, E1101
DETECT_LOW ... |
from __future__ import absolute_import
import sys
import scipy
import scipy.misc
import numpy as np
import torch
from torch.autograd import Variable
import models
import matplotlib.pyplot as plt
import torchvision.transforms as transforms
from PIL import Image
from util import util
from models import dist_model as dm
... |
<reponame>WagnerLabPapers/Waskom_PNAS_2017
from __future__ import division, print_function
import sys
import os
import os.path as op
from copy import copy
import numpy as np
import pandas as pd
from scipy import stats
from sklearn.linear_model import LogisticRegression
from statsmodels.regression.linear_model import O... |
#!/usr/bin/python
import matplotlib
matplotlib.use('Agg')
from scipy import *
from pylab import *
from numpy import *
from matplotlib.collections import LineCollection
import glob
import os
from os.path import join as pjoin
'''
def comparacio(a,b):
(Sepa,numa) = a.split('_')
(pa,exta) = numa.split('.')
... |
import numpy as np
import scipy.linalg as spla
def poweriteration(A, t, x_0):
# Check if matrix is symmetric square matrix.
(n, m) = A.shape
assert(n == m)
assert(np.all(A == A.T))
x_k = x_0
Ax_k = A@x_k # cache matrix vector product.
lambda_k_1 = -1
lambda_k = np.sum(x_k * Ax_k)
... |
<reponame>TAN-OpenLab/TCSE-net<filename>PoPnet_model/ChebyGCN_Direc.py<gh_stars>0
import torch
import torch.nn as nn
import scipy as sp
from scipy.sparse import linalg,identity,spdiags
class ChebConv(nn.Module):
"""
The ChebNet convolution operation.
Laplacian is motified for direct-graph
:p... |
<filename>robustgp/robustgp.py
"""
Robust Gaussian Process Regression Based on Iterative Trimming
<NAME>, <NAME>, <NAME>, 2020
https://arxiv.org/abs/2011.11057
Change logs
-----------
May 04 2021
Updated for revised manuscript, with changes in API and default parameters
Aug 11 2020
Initial commit.
"""
import GPy
im... |
#!/usr/bin/env python
# coding: utf-8
# In[38]:
import rosbag, os, matplotlib
from matplotlib import pyplot as plt
from scipy.interpolate import interp1d
from qsrlib.qsrlib import QSRlib, QSRlib_Request_Message
from qsrlib_io.world_trace import Object_State, World_Trace
from qsrlib.qsrlib import QSR_QTC_BC_Simplifie... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import scipy.sparse.linalg
class CGSolver:
def __init__(self, A, **options):
self.A = A
self.options = dict(**options)
def __matmul__(self, b):
x, info = scipy.sparse.linalg.cg(self.A, b, **self.options)
if info ... |
import math
import numpy
import logging
import scipy.stats
from atnr import constants
from atnr.util import Profile
from skimage import filter
from skimage import measure
from skimage import transform
from skimage import morphology
# abstractions
class BaseOperation(object):
__abstract__ = True
__inputs__ ... |
<reponame>gergia/STLInspector
from ..core.parsing import *
from ..core.testgeneration import *
from fractions import gcd
# represents one open project
class Project:
# the id should be alphanumeric such that everything works fine
# such as the usage of the id as css class
# if data is given, the pr... |
<reponame>aymenmir1/ndf-1<gh_stars>1-10
from scipy.spatial import cKDTree as KDTree
import numpy as np
import trimesh
import os
import traceback
kdtree, grid_points, cfg = None, None, None
def voxelized_pointcloud_sampling(path):
try:
out_path = os.path.dirname(path)
file_name = os.path.splitext(o... |
# -*- coding: utf-8 -*-
import numpy as np
from scipy.optimize import fsolve
import random
import time
import os
import matplotlib.pyplot as plt
import logging
from Life import Life
from Fitness import Fitness
random.seed(10)
logging.basicConfig(level=logging.INFO, # 控制台打印的日志级别
filename='./logs/... |
# -*- coding: utf-8 -*-
"""
Created on Sat May 4 13:55:56 2019
FIR (ventanas frecuencia)
Tecnológico Nacional de México
Tecnológico de Estudios Superiores de Ixtapaluca
División de Ingeniería Electrónica
@author: <NAME> <NAME>
"""
from scipy import signal
from scipy.fftpack import fft, fftshift
import matpl... |
<filename>PythonTest/bin/Debug/PythonScripts/pyMAPOD/pyKriging.py
######################################################################
# #
# #
# Model-Assisted Probability ... |
# -*- coding: utf-8 -*-
#
# Authors: Swolf <<EMAIL>>
# Date: 2021/1/07
# License: MIT License
"""
Common Spatial Patterns and his happy little buddies!
"""
from copy import deepcopy
from typing import Union, Optional, List, Dict, Tuple
from functools import partial
import numpy as np
from numpy import ndarray
from sc... |
<gh_stars>1-10
import numpy as np
import itertools as it
from scipy.spatial.distance import pdist
from sklearn.cross_validation import KFold
from sklearn.utils import check_random_state
from textwrap import dedent
import time
import csv
from . import get_logger
_LOG = get_logger('adt17')
_ALPHAS = list(it.product(... |
<reponame>namurphy/SunNEI<gh_stars>1-10
"""
CMEheat
=====
This module contains non-equilibrium ionization routines to
investigate the heating of coronal mass ejection (CME) plasma.
"""
from __future__ import print_function
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd... |
import torch
import torch.nn.functional as F
import numpy as np
from scipy.special import lambertw
__all__ = [
'SuperLoss',
'LabelSmoothingCrossEntropyWithSuperLoss',
'LabelSmoothingCrossEntropy'
]
class SuperLoss(torch.nn.Module):
def __init__(self, C=330, lam=0.25, rank=None):
super(Supe... |
"""
Calculate error due to thermochemical quantities: heat capacity, entropy, enthalpy.
"""
import logging
from collections import OrderedDict
import sympy
from scipy.stats import norm
import numpy as np
from tinydb import where
from pycalphad import Model, ReferenceState, variables as v
from pycalphad.core.utils im... |
<filename>code/base.py
''' Santander satisfaction base code: <NAME> '''
from __future__ import division
import sys
import dill
import random
import pickle
import hyperopt
import itertools
import numpy as np
import pandas as pd
import seaborn as sns
import xgboost as xgb
from numbers import Number
from sklearn import m... |
<filename>gen2-fatigue-detection/main.py<gh_stars>1-10
import argparse
from datetime import datetime, timedelta
from pathlib import Path
import cv2
import numpy as np
import depthai
from scipy.spatial.distance import euclidean
import os
import time
from tools import *
from imutils.video import FPS
parser = argparse.Ar... |
import numpy as np
import scipy
import matplotlib.pyplot as plt
import openmdao.api as om
def main():
print('hello from script.py')
if __name__ == '__main__':
main() |
<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 7 14:03:35 2021
@author: rebeccakatz
"""
import cv2
import numpy as np
import os
import fnmatch
import sys
import re
import matplotlib
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
from sklearn.metrics import silh... |
import os, sys, json, requests
import datetime as dt
import time
import numpy as np
from scipy.stats import poisson
import matplotlib.pyplot as plt
# NOTE: TEAM1 = AWAY TEAM (ATK FIRST)
# TEAM2 = HOME TEAM (DEF FIRST)
SOURCE = "NETWORK"
ESCORT = ['junkertown', 'dorado', 'route-66', 'gibraltar']
ASSAULT = ['h... |
import numpy as np
from scipy.signal import correlate2d
rho = np.random.random((4,4)) + 1j * np.random.random((4,4))
res0 = correlate2d(rho, rho, 'full', 'fill', 0) # unwrapped
res1 = np.fft.fftshift(np.fft.ifftn(np.abs(np.fft.fftn(rho, s=2*np.array(rho.shape)-1))**2))
np.allclose(res0, np.flip(res1, axis=(0,1)).conj... |
<reponame>hzi-bifo/Model-T<filename>traitarm/learning/misc/get_cor_feats.py
import scipy.stats as stats
import pandas as ps
#phypat_f = "../../pfams_pts_counts_named.tsv"
#ml_f = "../gain_loss_prob0.5/pt%s.dat"
#target = "Motile"
#feat_f = "/net/metagenomics/projects/phenotypes_20130523/gideon/mapping/stol_2_NCBI2014... |
<gh_stars>0
## parse data for
# 1. gene expression
# 2. reactome pathway expression
# 3. immunotherapy response
# 4. immunotherapy response survival
import pandas as pd
from collections import defaultdict
import scipy.stats as stat
import numpy as np
import time, os
## pathway expression and immunotherapy response... |
<reponame>xiaoxiaoxh/OMAD
import argparse
import numpy as np
import os.path as osp
import open3d as o3d
import tqdm
import copy
import time
import os
import psutil
import mmcv
import torch.utils.data
from matplotlib import cm
import torch.multiprocessing as mp
from scipy.spatial.transform import Rotation as R
from data... |
<reponame>apokhr/PumpProbe-analysis
# -*- coding: utf-8 -*-
"""
Created on Wed May 3 21:38:01 2017
@author: sagustss
"""
from lib import redred as rr
import os
import numpy as np
import scipy
import matplotlib.pyplot as plt
import tkinter as tk
from tkinter import filedialog
from matplotlib import cm
root = tk.Tk(... |
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import lognorm
import matplotlib.ticker as ticker
import os
@ticker.FuncFormatter
def major_formatter(x, pos):
"""
For formatting plots
"""
label = -x if x < 0 else x
if label == 0:
return '0'
label = np.round(label, ... |
from cv.util import colors, tcolors
import matplotlib.pyplot as pl
import numpy as np
from PIL import Image as im
import scipy as sp
import skimage.transform as tf
import pdb
import wc
# epipolar geometry -----------------------------------------------------------
def euc_to_hom(p):
# converts points from euclidia... |
<filename>lenstronomywrapper/Utilities/probability_util.py
import numpy as np
from scipy.interpolate import interp1d
from scipy.interpolate import RegularGridInterpolator
def interp_2d_likelihood(x, y, nbins, param_range_1, param_range_2):
param_min_1, param_max_1 = param_range_1[0], param_range_1[1]
param_mi... |
<reponame>Seb-Good/physionet-challenge-2020
# -*- coding: utf-8 -*-
# pylint: disable-msg=
import numpy as np
from scipy import signal
from kardioml.segmentation.teijeiro.utils.units_helper import SAMPLING_FREQ
from kardioml.segmentation.teijeiro.model.interval import Interval as Iv
def filter_signal(x, fs, fmin, fm... |
import numpy as np
from scipy.ndimage import convolve2d
from .constants import filter0
from .constants import filter1
from .constants import filter2
from .constants import filter3
def demosaic(raw_bayer):
# height, width = raw_bayer.shape
# d0 = correlate(raw_bayer, filter0, mode='constant', cval=0.0) / np... |
import sys
sys.path.append('../lib')
import exchange
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import datetime
from scipy.optimize import minimize
from sklearn.linear_model import LinearRegression
from scipy.stats import norm
def moving_average(a, n=1000) :
ret = np.cumsum(a, dtype=f... |
<gh_stars>1-10
from sympy import Symbol, Rational, Derivative, I, log, sqrt, exp
x = Symbol('x')
y = Symbol('y')
z = Symbol('z')
w = Symbol('w')
def test_pow():
assert str(1/x) == "1/x"
def test_poly_str():
#if any of these tests fails, it can still be correct, just the terms can
#be in a different orde... |
<reponame>peterpdu/JACKS<gh_stars>0
import numpy as np
import random
import scipy as SP
import logging
logging.basicConfig(level=logging.DEBUG, format='[%(asctime)s] %(name)-5s: %(levelname)-8s %(message)s')
LOG = logging.getLogger("jacks")
LOG.setLevel(logging.INFO)
""" Main function from which to compute JACKS acro... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import DataLoader, SubsetRandomSampler
from torch.utils.tensorboard import SummaryWriter
from tqdm import tqdm
from pathlib import Path
import itertools
import sys
from datasets impor... |
<reponame>vishalbelsare/fast-cma-es
# This code was posted on https://gitter.im/pagmo2/Lobby by
# <NAME> @CoolRunning and extended by a
# fcmaes parallel differential evolution solver for comparison with the pagmo island concept.
# requires oagmo (pip install pagmo) for the comparison. Tested with Anaconda 2020.11
#... |
import numpy as np
import math
from sympy import pretty_print as pp, latex
class StatsCollector:
TRUE_INDEX = '__TRUE__'
def __init__(self):
self.data = {}
def add_true_for_instance(self, category, instance, value):
data = self.get_instance_data(category, instance)
data[StatsCollector.TRUE_INDEX] = value
... |
def cdice_input_maker(type_analysis,func_form,year):
#type_analysis is an indicator of what type of anlysis we are doing.
#1 is both DICE and policy
#2 is only DICE
#3 is only policy
#func_form indicates what policy approximator to use, options are linear, quad, or exp
#year indicates the year i... |
<reponame>poldrack/ci-analysis-minimal-example
# likelihood ratio test
# adapted from https://stackoverflow.com/questions/69162676/statsmodels-metric-for-comparing-logistic-regression-models
# - added code to flip the models if the first one is more complex
from scipy.stats.distributions import chi2
from statsmodels.d... |
from scipy.stats import beta
from . import (CATEGORIES, TEST_MESSAGES, BETA_SHAPE_PARAMETER_A,
BETA_SHAPE_PARAMETER_B, KAFKA_CONSUMER_SIZE,
KAFKA_CONSUMER_TIMEOUT, REWARD_ADD_TO_CART)
class Recommender:
"""
Class in charge of multi-armed bandit recommendations.
See: https://e... |
"""Test Routine for structural component"""
from unittest import TestCase
import numpy as np
from scipy.linalg import norm
from numpy.testing import assert_allclose
from copy import deepcopy
from amfe.io.tools import amfe_dir
from amfe.io.mesh.reader import GidJsonMeshReader
from amfe.io.mesh.writer import AmfeMeshC... |
<reponame>agonzs11/Polinomio-del-caos
"""Binomial probability distribution."""
from functools import wraps
import numpy
from scipy import special
from ..baseclass import Dist
class Binomial(Dist):
"""
Binomial probability distribution.
Point density:
comb(N, x) p^x (1-p)^{N-x} x in {0, 1, .... |
<reponame>ZijiaLewisLu/SkinGAN
# from mediapipe.solution import
import math
import cv2
from scipy.spatial import ConvexHull, convex_hull_plot_2d
from scipy.spatial import Delaunay
import numpy as np
CONNECTIONS = {
"lips": [
(61, 146),
(146, 91),
(91, 181),
(181, 84),
(84,... |
<filename>Mathstein/mathroot.py
#!/usr/bin/env python
# coding: utf-8
# In[26]:
import math, cmath
import numpy as np
def graphgen(coeff):
"""
Generates a graph for any given equation
:param coeff: list of all the coefficients of an equation
:return: Graph object plotted based on the equati... |
<gh_stars>0
"""Plot rewards with error bar
References:
----------
low pass filter:
https://stackoverflow.com/questions/47970683/vectorize-a-numpy-discount-calculation
https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.lfilter.html
"""
__author__ = '<NAME>'
__date__ = '2020-03-05'
im... |
<reponame>tinix84/pyFDA
# -*- coding: utf-8 -*-
#
# This file is part of the pyFDA project hosted at https://github.com/chipmuenk/pyfda
#
# Copyright © pyFDA Project Contributors
# Licensed under the terms of the MIT License
# (see file LICENSE in root directory for details)
#
# Taken from https://github.com/sriyash25/... |
import numpy as np
import plotly.graph_objects as go
from pyVHR.signals.bvp import BVPsignal
def getErrors(bpmES, bpmGT, timesES, timesGT):
RMSE = RMSEerror(bpmES, bpmGT, timesES, timesGT)
MAE = MAEerror(bpmES, bpmGT, timesES, timesGT)
MAX = MAXError(bpmES, bpmGT, timesES, timesGT)
PCC = PearsonCorr(bp... |
"""
useful functions for image processing
"""
from math import ceil
import numpy as np
from scipy.ndimage import rotate, label, fourier_shift
def rot_avg(img):
img_stack = np.zeros((360, *img.shape))
for i in range(360):
img_rot = rotate(img, i, reshape=False)
img_stack[i] = img_rot
retu... |
<reponame>bcaplins/NIST_APT_TOOLS<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 5 12:09:48 2019
@author: bwc
"""
raise SystemExit(0)
stoich = np.c_[pk_data['N_at_ct'][pk_data['is_anal_pk'],None],pk_data['Ga_at_ct'][pk_data['is_anal_pk'],None]]
cts = np.zeros(np.sum(pk_data['is_anal_pk']))-1
single... |
from bson.objectid import ObjectId
import haploqa.mongods as mds
import numpy as np
from scipy.stats import multivariate_normal
from scipy.spatial.distance import mahalanobis
from pprint import pprint
def _get_gemm_snp_intens(gemm_snp, sample):
# this is a bit convoluted but all we are doing here is extracting
... |
<filename>_imports/ai_core/dataset_management.py<gh_stars>0
import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
import copy as cp
from itertools import product
from scipy.signal import fftconvolve
from numpy.fft import fft2
from scipy.interpolate import RectBivariateSpline
import numba as nb
# Fu... |
<reponame>riadnassiffe/Simulator
"""
Copyright 2013 <NAME>
This file is part of CVXPY.
CVXPY 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 License, or
(at your option) any later version... |
Difference between LCM and HCF of two numbers
Two whole numbers N1 and N2 are passed as input. The program must print the difference between the LCM and HCF of these two numbers.
Input Format:
First line will contain the value of the first number N1
Second line will contain the value of the second number N2
Output For... |
<filename>src/quality_control/bin/modules/intensities.py
from skimage import io
from icecream import ic
import cv2
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import random # for random color plotting
from skimage import io
from skimage.util import img_as_ubyte
from scipy.signal import find_p... |
<reponame>zabaras/inn-surrogate<filename>2D/train.py
import torch
import torch.nn as nn
from time import time
import torch.optim as optim
import torch.nn.functional as F
import sys
import os
import numpy as np
import scipy.io as io
import matplotlib.pyplot as plt
from utils.load_data import load_data
from models.main_m... |
<reponame>stefaniaebli/pyripser
"""Pyrpser is a Python wrapper to the executable ripser:
https://github.com/Ripser/ripser
With this wrapper, it is possible to compute the births and deaths of
homology classes of Vietoris-Rips complexes up to the desired order(s)
for a given (Numpy) distance matrix.
Copyright <NAME>... |
<reponame>tesserato/envelope<filename>Comparison of Envelope Algorithms.py
import plotly.graph_objects as go
import numpy as np
from scipy.interpolate import interp1d
from scipy.signal import savgol_filter, hilbert, butter, filtfilt
# import sys
from timeit import default_timer as timer
import signal_envelope as se
fro... |
'''
<NAME>
<EMAIL>
September 23, 2017
'''
import operator as op
import numpy as np
from scipy import special
import util
import log
import plotFigures as plot
import regression as re
import variableSelection as vs
if __name__ == '__main__':
plot.pltSetUp()
#======= Problem 1 =======
data = util.readFileD... |
<filename>active_system/abp.py
from simtk.openmm.app import *
from simtk.openmm import *
from simtk.unit import *
from sys import stdout
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import gamma, binom, norm
import PIL
import freud
import fresnel
from mdtraj.reporters import HDF5Reporter
import t... |
#!/usr/bin/env python
#-*- coding:Utf-8 -*-
from scipy.ndimage.filters import gaussian_filter1d
from scipy.ndimage.filters import convolve1d
from scipy.ndimage.filters import uniform_filter1d
from numpy import *
import numpy as np
import matpl... |
<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri May 10 22:07:19 2019
@author: virati
"""
import numpy as np
import mayavi
import scipy
import scipy.signal as sig
import scipy.io
from collections import defaultdict
import pdb
import matplotlib.pyplot as plt
import wfdb
from scipy imp... |
<reponame>jmontgom10/Mimir_pyPol<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 16 13:23:45 2015
@author: jordan
"""
#Import whatever modules will be used
import os
import sys
import time
import pdb
import numpy as np
import matplotlib.pyplot as plt
from astropy.table import Table, Column
import astropy.co... |
import os
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 read a coordinated tag file to a square matri... |
import itertools
import scipy.signal
import numpy as np
import pytest
from streaming._iterator import *
#class TestConvolve(object):
#"""Test `convolve`.
#"""
#def test_convolve_lti(self):
#"""Test with a linear time-invariant system.
#"""
#nblock = 8
#ntaps = 3
#bl... |
<reponame>Strabes/helpers<gh_stars>0
import pandas as pd
import numpy as np
from typing import Union
from sklearn.preprocessing import OneHotEncoder
from scipy import sparse
class OneHotComboSparse:
def __init__(self, cols_to_enc = 'auto', num_cols = 'auto'):
if isinstance(cols_to_enc,str):
if ... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
import numpy as np
import math,cmath
def computecorrelation(x,y):
x_bar=np.mean(x)
y_bar=np.mean(y)
SSR=0
Varx=0
Vary=0
for i in range(0,len(x)):
SSR+=(x[i]-x_bar)*(y[i]-y_bar)
Varx+=(x[i]-x_bar)**2
Vary+=(y[i]-y_bar)**2
SST=cma... |
<gh_stars>0
import os
import pickle
import sys
import csv
import matplotlib.pyplot as plt
from PIL import Image
version = sys.version_info
import torch
from torch.utils.data import Dataset, DataLoader
from PIL import Image
import numpy as np
import skimage.data
import scipy.io as sio
import cv2
def image_brightness_... |
"""
Test bench to assess field of fire around vehicle.
"""
from math import pi, ceil, sin, atan2, sqrt
import logging, itertools, sys, os, _winreg
import numpy as np
import matplotlib.pyplot as plt
from scipy.ndimage.morphology import grey_erosion
def query_analysis_tools():
"""
Find the location ... |
#!/usr/bin/env python3
import sympy as sp
import numpy as np
import matplotlib.pyplot as plt
# Approx 10 kHz
w = 66e3
deltaW = 33e3
T = 2 * np.pi / w
T_lo = 2 * np.pi / (w - deltaW)
T_hi = 2 * np.pi / (w + deltaW)
A1 = 5
A2 = 30
x = sp.Symbol('x')
fsk_mod_lo = A1 * sp.sin(w * x)
fsk_mod_hi = A2 * s... |
#!/usr/bin/env python
import rospy
import tf2_geometry_msgs
from bluerov2_navigation.helpers import geodetic
from sensor_msgs.msg import NavSatFix
from geographic_msgs.msg import GeoPointStamped
from robot_localization.srv import SetDatum
import tf2_ros
from geometry_msgs.msg import Quaternion, Transform, Vector3, Po... |
<reponame>neonnnnn/pyrfm
import numpy as np
from scipy.sparse import csr_matrix
from sklearn.utils.testing import assert_allclose_dense_sparse
from sklearn.utils.extmath import safe_sparse_dot
from pyrfm import SubfeatureRandomMaclaurin
import pytest
import itertools
def polynomial(X, Y, degree, bias=0):
return... |
<reponame>rampage644/super-resolution<gh_stars>10-100
#%%
import tensorflow as tf
import numpy as np
import scipy.misc
import scipy.ndimage.filters
import matplotlib.pyplot as plt
import skimage
import subpixel.model
import subpixel.util
#%%
COLORS = 3
FILTERS = [64, 32]
KERNEL_SIZES = [5, 3, 3]
FLAGS = tf.app.flag... |
<reponame>laitoch/tree-bark-synthesis
#!/usr/bin/env python2
from scipy.ndimage import imread
import numpy as np
from scipy.misc import imsave
import sys
import shutil
sys.path.append('.')
from TextureByNumbers import tbn
from LabelGeneration import color_region_label, blur, add_eges_grayscale, increase_edge_size
fr... |
""" Optimizations of the expression tree representation for better CSE
opportunities.
"""
from sympy.core import Add, Mul, Expr
from sympy.utilities.iterables import preorder_traversal
class Sub(Expr):
""" Stub of a Sub operator to replace Add(x, Mul(NegativeOne(-1), y)).
"""
__slots__ = []
def sub_pre(e)... |
import numpy as np
import torch
from torch.optim import Adam
from pathlib import Path
import scipy
import scipy.signal
import time
import os
from rl_rvo_nav.policy_test.post_train import post_train
import threading
from mpi4py import MPI
def combined_shape(length, shape=None):
if shape is None:
return (len... |
<reponame>Imperial-lord/IITG
# Question 4 Lab Assignment 2
# AB Satyaprakash - 180123062
# imports ----------------------------------------------------------------------
from math import log, tan, factorial
from sympy import *
import numpy as np
# functions ------------------------------------------------------------... |
#!/usr/bin/env python3
import numpy as np
from scipy.io import wavfile
FILENAME_OUT = './wavSamples/sine.wav'
sampleRate = 44100
frequency = 100
length = 2
t = np.linspace(0, length, sampleRate * length) # Produces a 2 second Audio - File
y = np.sin(frequency * 2 * np.pi * t) # Has frequency of 440 Hz
z = np.exp(2)... |
<filename>neurosynth/analysis/meta.py
""" Meta-analysis tools """
import logging
import numpy as np
from scipy.stats import norm
from neurosynth.base import imageutils
from neurosynth.analysis import stats
from os.path import join, exists
from os import makedirs
logger = logging.getLogger('neurosynth.meta')
def ana... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.