text
string
#!/usr/bin/env python # Cluster_Ensembles/src/Cluster_Ensembles/Cluster_Ensembles.py; # Author: <NAME> for the GC Yuan Lab # Affiliation: Harvard University # Contact: <EMAIL>, <EMAIL> """Cluster_Ensembles is a package for combining multiple partitions into a consolidated clustering. The combinatorial optimization...
<reponame>NegriLuca/pigasus # -*- coding: UTF-8 -*- #! /usr/bin/python import sys import numpy as np from scipy.sparse.linalg import spsolve from pigasus.fem.constants import * from pigasus.fem.field import * from pigasus.fem.norm import * from pigasus.fem.grids import * from pigasus.fem.matrix import * from pigasus....
# -------------- # Import packages import numpy as np import pandas as pd from scipy.stats import mode # code starts here bank = pd.read_csv(path) categorical_var = bank.select_dtypes(include = 'object') print(categorical_var) print('='*50) numerical_var = bank.select_dtypes(include = 'number') print(numerical_var...
import warnings import numpy as np import scipy as sp from scipy.stats import ttest_ind from statsmodels.stats.multitest import multipletests def welch_ttest(x1, x2): """ Welch t-test for multiple arrays. Parameters __________ x1: array, shape (n1, n_features) x2: array, shape (n2, n_feature...
#!/usr/bin/env python from pylab import * from scipy.optimize import * from numpy import * import time import sys import bisect ion() N = 64 upsample_factor = 16 fftsize = N * upsample_factor F = matrix(exp(1j*2*pi*arange(fftsize)[:,newaxis]*arange(fftsize)[newaxis,:]/float(fftsize)) / fftsize) M = hstack((F[:,0], F[...
import torch import numpy as np import pandas as pd from torch.nn import BCELoss from pathlib import Path from collections import namedtuple from sklearn.metrics import classification_report from sklearn.linear_model import LogisticRegression from sklearn.ensemble import RandomForestClassifier, VotingClassifier from s...
import cv2 import dlib import numpy as np from scipy.spatial import distance from collections import deque def filter(frame,landmarks): crownImg = cv2.imread("wanda.png",-1) crownMask = crownImg[:, :, 3] # binary image crownMaskInv = cv2.bitwise_not(crownMask) # inverting the binary img crown...
# -*- coding: utf-8 -*- #Created on Wed Sep 28 10:15:56 2016 #@author: ryanday #MIT License #Copyright (c) 2018 <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 rest...
<reponame>Nachiket18/TreeNash ''' Created on 28-Mar-2021 @author: <NAME> ''' from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext import numpy import scipy ext_modules = [Extension("anomaly_detection", ["anomaly_detection.pyx"])] setup( package_dir={'s...
<filename>SparseAMsWithInteractions/src/AMsWithInteractionsL0/optimizer.py from copy import deepcopy from IPython.display import Math from ipywidgets import * import numpy as np import scipy.sparse as sp from scipy.special import comb from sklearn.metrics import mean_squared_error from tqdm import notebook import warni...
<gh_stars>0 import enum from numpy.core.fromnumeric import argmin from skimage import filters from skimage import segmentation as seg import scipy.ndimage as ndi from scipy.spatial.distance import cdist import numpy as np from warnings import warn from typing import Union, List from .. import * def __diamond_kernel(r,...
from __future__ import print_function "Fingerprint Image denoising using M-net" import os import glob import numpy as np from PIL import Image import datetime import scipy as sp import sys import keras as keras from keras.models import Model from keras.layers import Input, Activation, Conv2D, MaxPooling2D, UpSampling...
# -*- coding: utf-8 -*- """ Created on Sun Nov 14 17:16:16 2021 @author: jnguy """ import sys import numpy as np import math from scipy import spatial from queue import PriorityQueue class Node(): """ parent = parent of current node posiition = position of node right now it will be x,y coordinates g ...
<gh_stars>10-100 """ New modules with utils from the earlier util module which are needed for crispor. """ import numpy as np import pandas import scipy.stats as st import scipy as sp def spearmanr_nonan(x,y): ''' same as scipy.stats.spearmanr, but if all values are unique, returns 0 instead of nan (Outpu...
<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon May 11 21:33:50 2020 @author: darrenhsu """ import matplotlib.pyplot as plt import numpy as np from scipy.optimize import curve_fit from scipy.special import erf #%% def func(x, a, b, c, d, e, f, IRF): return (a * np.exp(-x/b) + c * n...
import networkx as nx import matplotlib.pyplot import numpy as np import pickle from relax import nonzeroColumnMethodRelaxation from random_strategy import greedyInitialStrategy from random_strategy import randomStrategy from random_strategy import enumerateAll from max_iteration import maxIterationComb from compute_re...
<gh_stars>0 ''' MIT License Copyright (c) 2018 <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, modify, merge, pub...
<reponame>MargKos/multiscaleRD #!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Dec 11 10:40:31 2019 @author: bzfkostr """ from __future__ import division import numpy as np import scipy.sparse from numpy.linalg import inv from math import exp from Parameters_Prolieferation import * ''' This code re...
<reponame>juancalheiros/voronoi-diagrams import numpy as np import matplotlib.pyplot as plt from scipy.spatial import Voronoi, voronoi_plot_2d, Delaunay def display_voronoi(points_x, points_y, COLOR_POINT): plt.plot(points_x, points_y,'o', color=COLOR_POINT) def display_delaunay(points_x, points_y, points_indice...
# -*- 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) """ Widget for plotting impulse and general transient responses """...
<reponame>1eg1on/dimreducers-crusher from .AbstractDataset import AbstractDataset from typing import Union import numpy as np from sklearn.datasets import fetch_20newsgroups from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer import scipy.sparse as sp...
<gh_stars>1-10 from __future__ import print_function import os import argparse import torch import torch.backends.cudnn as cudnn import numpy as np import time import model from data import DatasetLoader import cv2 import torchvision.models as models import numpy as np from scipy.optimize import leastsq import random i...
from scipy import stats import numpy as np from matplotlib import use use('Agg') from matplotlib import pyplot as plt from collections import Counter, defaultdict import pandas as pd import subsamplex from glob import glob suboral = pd.read_table('cold/suboral.tsv', squeeze=True, index_col=0) SUBSAMPLE = True counts...
import dash import dash_core_components as dcc import dash_html_components as html import plotly.graph_objs as go import os import numpy as np import pandas as pd pd.options.mode.chained_assignment = None # default='warn' import scipy.spatial.distance as dist import scipy.cluster.hierarchy as sch # fn = os.path....
import numpy as np import tie_decay_epidemics as tde from numpy.testing import assert_array_equal from scipy.sparse import csr_matrix def test_tie_decay_graph(): nodes = np.array(["A", "B", "C"]) graph = tde.TieDecay_Graph(nodes) graph.update_tie_strength("A", "B", 10) graph.update_tie_strength("B", ...
''' Feature selection as in G-algorithm but with success rates. To be run after session 2. We use a one-sample t-test. This time we comopute the t-test based on all blocks at once. ''' from copy import deepcopy import itertools import numpy as np import pandas as pd import pickle import random from scipy import stats...
<reponame>LafLaurine/imac2-projetTUT import numpy as np import torch from torch.autograd import Variable import torch.utils.data as data from tqdm import tqdm from sklearn import metrics from scipy.optimize import brentq from scipy.interpolate import interp1d from sklearn.metrics import roc_curve from torchvision.dat...
from scipy import signal import matplotlib.pyplot as plt import numpy as np t = np.linspace(-1, 1, 201) x = (0.3*np.sin(2*np.pi*0.75*t*(1-t) + 2.1) +0.5*np.sin(2*np.pi*2*t + 1) +2*np.cos(2*np.pi*1*t)) xn = x + np.random.randn(len(t)) * 0.5 b, a = signal.butter(5, 0.17) zi = signal.lfilter_zi(b, a) z, _ = signal.lfi...
<gh_stars>1-10 import dill import yaml import os import json import numpy as np import matplotlib.patheffects as pe from scipy.ndimage import rotate from matplotlib.offsetbox import OffsetImage, AnnotationBbox import matplotlib.pyplot as plt import torch import gc import sys from torch import nn, optim, utils from ysd...
## parse annotation import xml.etree.ElementTree as ET import mne import numpy as np import sys import os import scipy.io import cv2 path1='/ssd/hongyang/2018/physionet/data/shhs/' size= 2**20 scale_pool=5 freq=125 # all shhs1 records id_all=[] f=open('id_shhs1.txt','r') for line in f: id_all.append(line.rstrip(...
<reponame>vishalbelsare/S3M #!/usr/bin/env python3 import collections import csv import json import math import mpmath import tqdm import sys import numpy as np import matplotlib.pyplot as plt import scipy.spatial.distance as ss from scipy.stats import chi2 # Decimal digits of precision for th...
# lucky imaging library functions import numpy as np from skimage.registration import phase_cross_correlation from skimage.measure import centroid from skimage.transform import AffineTransform, warp from scipy.ndimage import fourier_shift from .image_processing import frame_center, shift_frame def lucky_image( ...
import math import time from random import randrange from typing import Optional import numpy from scipy.ndimage import sobel, laplace from aydin.util.fast_uniform_filter.uniform_filter import uniform_filter_auto from aydin.util.log.log import lprint def representative_crop( image, mode: str = 'sobelmin', ...
<reponame>marcinjurek/pyMRA import scipy.optimize as opt import gc import logging import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl import pdb import time import sys import scipy.linalg as lng sys.path.append('../..') from pyMRA.MRATree import MRATree from pyMRA import MRATools as mt if ...
<gh_stars>1-10 # -*- coding: utf-8 -*- """ Created on Fri Jul 17 02:02:36 2020 @author: admin """ ##Functions for replication study # Import modules. import pandas as pd import statsmodels.api as sm import numpy as np from scipy import stats from linearmodels import IV2SLS # Get significance asterix. def signific...
import keras from keras import applications from keras import backend as K import tensorflow as tf import numpy as np import scipy import scipy.misc import matplotlib.pyplot as plt import time import imageio #from scipy.misc import imsave class cmv: #out put index used in the paper #99 goose #968 cup #...
from tensorflow.keras.layers import Activation, UpSampling2D, Reshape, Input, Conv2D, \ LeakyReLU, BatchNormalization, Flatten, Dropout, Dense from tensorflow.keras.models import Model from tensorflow.keras.models import Sequential from tensorflow.keras.optimizers import Adam import numpy as np import pandas as pd ...
<gh_stars>0 # Reference: # 1. rankGauss by <NAME> # https://github.com/michaeljahrer/rankGauss/blob/master/rankGaussMain.cpp # 2. a beginning of scikit-learn compatible implementation of GaussRank # https://github.com/zygmuntz/gaussrank/blob/master/gaussrank.py # Extended by 오병화, 20180903 from sklearn.utils.validation ...
<gh_stars>1000+ # Copyright Materialize, Inc. and contributors. All rights reserved. # # Use of this software is governed by the Business Source License # included in the LICENSE file at the root of this repository. # # As of the Change Date specified in that file, in accordance with # the Business Source License, use ...
""" Script calcules EOFs of sea ice thickness anomalies from LENS Notes ----- Source : http://www.esrl.noaa.gov/psd/data/gridded/data. ncep.reanalysis.derived.html Reference : Lindsay and Zhang [2005] Author : <NAME> Date : 1 May 2017 """ ### Import modules import numpy as np import ma...
from collections import defaultdict from typing import Dict import numpy as np import scipy.constants as constants from bridge_sim.model import Config from bridge_sim.sim.build import det_shells from bridge_sim.sim.model import SimParams, DeckShells def opensees_self_weight_loads( config: Config, sim_params: Si...
import cv2 import numpy as np from PIL import Image import urllib.request import math import matplotlib import matplotlib.pyplot as plt import matplotlib.patches as patches from random import randint from scipy import ndimage, misc from scipy.spatial.distance import hamming #from selenium import webdriver from time i...
from scipy import ndimage def load_color(path, *args, **kwargs): return ndimage.imread(path, mode='RGB', *args, **kwargs) def load_gray(path, *args, **kwargs): return ndimage.imread(path, flatten=True, *args, **kwargs)
<gh_stars>1-10 import pandas as pd import numpy as np from numpy.random import normal import matplotlib.pyplot as plt import matplotlib.mlab as mlab import plotly.plotly as py # tools to communicate with Plotly's server import csv import scipy.stats as stats import pandas as pd #from statsmodels.graphics import tsaplo...
<filename>ufp_analysis_code.py import pandas as pd import numpy as np import matplotlib.pyplot as plt from scipy.stats.stats import pearsonr, spearmanr, kendalltau import seaborn as sbn from scipy.stats import norm from statsmodels.graphics.gofplots import qqplot from sklearn.linear_model import LinearRegression from s...
""" Purpose: MXNet Word Embedding Date created: 2020-05-04 https://gluon-nlp.mxnet.io/examples/word_embedding/word_embedding_training.html Contributor(s): <NAME>. """ import os os.chdir(r"C:\Users\Work1\Desktop\Info\GitHub\python-examples-main\notebook-samples") CSV_PATH = rf"{os.getcwd()}\csv-files\kiva-data.c...
import keras from keras.preprocessing.image import load_img, img_to_arraytarget_image_path= 'target.jpg' #target image style_image_path='style.jpg' #style image width,height =load_img(target_image_path).size image_height =400 image_width=int(width * image_height /height) import numpy as np from keras.applications impo...
# import required libraries import math import pandas as pd import scipy.stats as stats # HELPER FUNCTIONS def prop_error(n, p, alpha = 0.05): """ Return the confidence interval for a proportion at the given alpha level """ z_critical = stats.norm.ppf(1-alpha/2.0) returnstr = str(round(p, 2)) ...
<gh_stars>0 import numpy as np import pandas as pd import scipy.sparse from cirrocumulus.io_util import cirro_id class SimpleData: def __init__(self, X, obs, var): self.obs = obs self.var = var self.uns = {} if X is not None: if len(X.shape) == 1: X = ...
<gh_stars>1-10 #!/usr/bin/env python3 import argparse from collections import Counter import statistics import norman def main(args): with open(args.file) as fh: gs = list(norman.robust_load(fh.read())) re_map = norman.load_reifications(args.reify) co_map = norman.load_dereifications(args.collap...
<reponame>ericlee0920/Cluster-Viz import itertools import numpy as np import pandas as pd import networkx as nx from scipy.stats import zscore from scipy.spatial.distance import squareform, pdist import matplotlib.pyplot as plt """ How to use: expression_matrix, location_matrix, axis_matrix, size = read_data...
import os from collections import Counter import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Rectangle from matplotlib import image as mpimg import statistics # 2194 def getColors(img): pixels = img.reshape((72*72, 4)) .tolist() # filter pixels for all with A > .9 (almos...
<gh_stars>0 # %% import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt %matplotlib inline import matplotlib.pyplot as plt # %% KON = 1 KD = 5 KOFF = KD/KON def binding_one_to_one(concs, t, KD): KON = 1 KOFF = KD/KON dPdt = -KON*concs[0]*concs[1]+(KOFF)*...
<reponame>pombreda/pyamg<filename>Examples/Visualization_ConnectionViewer/demo.py ## # Import ConnectionViewer writers import numpy, scipy from pyamg import gallery, rootnode_solver from pyamg.gallery import stencil_grid from pyamg.gallery.diffusion import diffusion_stencil_2d from cvoutput import * from convergence_...
import wfdb from wfdb import processing from ecg_model import MultiEcg, Ecg import numpy as np import scipy.signal as signal import matplotlib.pyplot as plt from array_tool import resample import shutil import os from array_tool import med_filter def detect_qrs(sig, fs): # qrs_idx = processing.xqrs_detect(sig, fs...
from scipy.io import loadmat from numpy import transpose import skimage.io as sio from utils import visualize import numpy as np import os import argparse def main(args): detection = loadmat('/home/tju/pytorch-pose/evaluation/data/detections.mat') det_idxs = detection['RELEASE_img_index'] debug = 1 thr...
<reponame>s-neilson/CORNISH-CNN-classifier import copy import os from astropy.io import fits from astropy.visualization import MinMaxInterval from scipy.misc import imresize import numpy import keras_preprocessing class ImagedObject: name="" label=() imageSize=0 imageData=None #All of the data ...
<reponame>rhwhite/rhwhitepackages3 # Module for performing various processing of data # Written by rhwhite <EMAIL> import netCDF4 import numpy as np import xarray as xr from scipy import stats,signal import scipy.fftpack as fftpack # Lanczos function weight calculation. confirmed it matches that from NCL when normaliz...
import numpy as np import scipy.ndimage.filters as spf from scipy import ndimage from skimage.restoration import denoise_nl_means from skimage.transform import integral_image as sk_integral_image from gputools.convolve import median_filter, uniform_filter, gaussian_filter from gputools.transforms import scale, map_coor...
""" 'power.py' module serves mainly for interacting with C++ library fastsim.py - translate all power spectra, growth functions, correlations functions, etc. into C++ functions for speed - handles numpy arrays - cosmo == C++ class Cosmo_Param, accessible through SimInfo.sim.cosmo - FTYPE_t=[float, double, long...
<filename>NASA SPACEAPPS CHALLENGE/Solution/Software part/Astronomical Data and Python Libraries/Astropy/astropy-1.1.2/astropy/utils/compat/fractions.py # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Handles backports of the standard library's `fractions.py`. The fractions module in 2.6 does not h...
import numpy as np import scipy.linalg as LA import torch import torch.nn as nn import torch.nn.functional as F EPS = 1e-8 LOG_2 = 0.69314718056 EPS_TENSOR = torch.tensor(EPS) # 3D Levi-Civita tensor EIJK = torch.zeros(3, 3, 3, requires_grad=False) EIJK[0, 1, 2] = EIJK[1, 2, 0] = EIJK[2, 0, 1] = 1 EIJK[0, 2, 1] = EIJ...
import numpy as np import cv2, serial, time, os, sys from scipy import stats def getSerialPort(intASCII): # intASCII is the integer which can be recognized as a correct signal (e.g. laser level) by our Arduino UNO for portNum in range(1, 11): try: portName = 'COM' + str(portNum) ...
# Copyright (c) 2015, <NAME> and <NAME> All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions and ...
<reponame>evgeniy97/taskgenerator # coding: utf-8 # In[ ]: """ Numerical Methods, lab 3 """ import sympy as sy from sympy import Rational as syR from sympy import exp, sin, cos, sqrt, log, ln from sympy import pi, cot, sinh, cosh, atan, tan # Это был Task_db Tasks_db = { 'Task1': [ # 3.1.1 {'a':...
<reponame>yuwenhuisama/AudioSeparationExperiment<gh_stars>0 ''' File: \resource.py Project: AudioSourceSeparation Created Date: Tuesday April 24th 2018 Author: Huisama ----- Last Modified: Sunday May 6th 2018 12:58:23 am Modified By: Huisama ----- Copyright (c) 2018 Hui ''' import numpy as np import musdb...
# -*- coding: utf-8 -*-# ''' # Name: GMM # Description: 高斯混合模型实现 # Author: super # Date: 2020/5/10 ''' import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Ellipse from scipy.stats import multivariate_normal plt.style.use('seaborn') def generate_X(true_Mu, true_Var)...
import os, sys, pdb, time, gzip, pickle, math from collections import OrderedDict as odict from copy import copy import torch, osqp import cvxpy as cp, numpy as np, matplotlib.pyplot as plt, line_profiler as lp import scipy.sparse as sp, scipy.sparse.linalg as spla from matplotlib.patches import Rectangle from tqdm im...
<filename>toy_models/expected_max_value.py<gh_stars>1-10 import random as rand import matplotlib.pyplot as plt from scipy.stats import norm from scipy.integrate import quad import numpy as np def normal_prob(i): """ Calculates the probability of taking a step to the right, left, or staying at the ...
<reponame>chcaru/gcnet<gh_stars>10-100 print 'Loading dependencies...' import os, math, sys import numpy as np from scipy.misc import imsave from scipy.optimize import fmin_l_bfgs_b from keras.preprocessing.image import load_img, img_to_array from keras.applications import vgg16 as vgg16 from keras.layers import Inp...
''' 2017-02-28 place a colorbar. ''' import sys import scipy import pickle import scipy.misc import numpy as np import SimpleITK as sitk import PyQt5 import pyqtgraph.opengl as gl import matplotlib.pyplot as plt import pyqtgraph as pg from scipy import ndimage from PyQt5 import QtCore, QtGui # from pyqtgr...
<filename>archive/vc.py #!/usr/bin/env python3 # https://librosa.org/doc/latest/auto_examples/plot_music_sync.html#sphx-glr-auto-examples-plot-music-sync-py # pyrubberband may offer a higher quality stretch/compress function import argparse import librosa # pip install librosa import librosa.display...
__author__ = "<NAME>" __email_ = "<EMAIL>" import matplotlib.pyplot as plt from scipy.stats import linregress import scipy.constants as con import numpy as np import seaborn as sbn import ipywidgets as widgets from IPython.display import display from ipywidgets import Layout, Button, Box, FloatText, Textarea, Dropdo...
<reponame>WhoIsJack/chemokine_buffering_paper # -*- coding: utf-8 -*- """ Created on Sun May 14 13:54:22 2017 @author: <NAME> @ Gilmour group @ EMBL Heidelberg @descript: Preprocessing before landmark extraction for analysis of cxcr7 distribution. This includes a masking function to mask the entire ...
''' Code for downloading and processing Caltech Pedestrian Dataset - test part (P. Dollar et al. 2009, http://www.vision.caltech.edu/Image_Datasets/CaltechPedestrians/). Based on code related to PredNet - Lotter et al. 2016 (https://arxiv.org/abs/1605.08104 https://github.com/coxlab/prednet). Method of resizing was spe...
<filename>Stick_breaking.py<gh_stars>0 # -*- coding: utf-8 -*- """ @author: William """ from matplotlib import pyplot as plt import numpy as np import scipy as sp plt.rcParams['figure.dpi'] = 100 plt.rcParams['font.size'] = 10 N = 20 K = 30 alpha = 2. P0 = sp.stats.norm beta = sp.stats.beta.rvs(1, al...
import matplotlib import matplotlib.gridspec as gs import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import tensorflow as tf # Prevent text from rendering as paths new_rc_params = {'text.usetex': False, "svg.fonttype": 'none' } matplotlib.rcP...
<reponame>daniel620/QunatPlayground<filename>src/ou_noise/ou.py """ OU (Ornstein-Uhlenbeck) process dX = -A(X-alpha)dt + v dB """ import math import scipy.constants import scipy.stats import scipy.optimize import numpy from . import quadratic_variation def mle(t, x, start=None): """Maximum-likelihood es...
<reponame>eth-sri/ACE import numpy as np import torch import torchvision import matplotlib.pyplot as plt import pickle from scipy.stats import norm import re import json import os from layers import Linear, Conv2d from networks import FFNN, ConvMedBig, MyResnet, myNet, EfficientNet from itertools import combinations ...
<reponame>KmolYuan/fourbar-simscape<filename>hw4.py # -*- coding: utf-8 -*- from math import degrees, radians from numpy import array, arange, linspace, concatenate, zeros, pi, sin, cos, sqrt from scipy.interpolate import interp1d import matplotlib.pyplot as plt l2 = 38e-3 l3 = 133e-3 r2 = 0.3 * l2 r3 = 0.36 * l3 the...
import argparse, gc, gzip, multiprocessing, random, sys, time, traceback import numpy as np import scipy.misc start = time.time() def echo(msg): global start seconds = time.time() - start m, s = divmod(seconds, 60) h, m = divmod(m, 60) hms = "%02d:%02d:%02d" % (h, m, s) print('['+hms+'] ' + msg) def parse_a...
<gh_stars>0 """ This version of the extraction code has started with Lindsay's example but has been modified to work with the code in esi2d.py """ import sys import numpy as np from scipy import ndimage,interpolate from matplotlib import pyplot as plt try: from astropy.io import fits as pf except ImportError: ...
# %matplotlib inline import numpy as np # for the sigmoid function we need expit() from scipy import scipy.special # library for plotting arrays import matplotlib.pyplot as plt # A particularly interesting backend, provided by IPython, is the inline backend. # This is available only for the Jupyter Notebook and the Jup...
# dd_models.py - Distance distribtion parametric models # --------------------------------------------------------------------------- # This file is a part of DeerLab. License is MIT (see LICENSE.md). # Copyright(c) 2019-2021: <NAME>, <NAME> and other contributors. import math as m import numpy as np import scipy.spe...
<reponame>Pablo-Arias/STIM<gh_stars>1-10 #-*- coding: utf-8 -*- # --------------------------------------------------------------------# # --------------------------------------------------------------------# # ---------- Made by <NAME> @ircam on 11/2015 # ---------- Copyright (c) 2018 CREAM Lab // CNRS / IRCAM / Sorbon...
<gh_stars>10-100 # -*- coding: utf-8 -*- """ Created on Sun Sep 1 11:15:41 2019 at ISM, Tokyo Author: <NAME> @ IGP-CEA Bei ZHANGE @ IGP-CEA Co-Author: <NAME> @ ISM-Tokyo #################################################### MIT license Copyright @ pyBACGS 2019 All right rese...
<filename>tools/palantir/packages/CNV_infer/plotCnvArr.py import sys import math import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt import scipy.cluster.hierarchy as sch def plotcnv(cnvArr, chrArr, title, norm=None, norm_vals=None, norm_inds=None, cmap=plt.cm.bwr,...
<gh_stars>1-10 # Digital Signal Processing - hwk2 - Part 2.5 # <NAME> - 03117037 # Exercise 2.5: Digital Filter Design import numpy as np import matplotlib.pyplot as plt import scipy as sp from scipy import signal plt.close('all') counter =0 fs = 0.001 omega = np.arange(0,2*np.pi,fs) Hcont = 5/(np.sqrt...
import typing import pandas as pd import scipy.stats from pyextremes.models.model_emcee import Emcee from pyextremes.models.model_mle import MLE def get_model( model: str, extremes: pd.Series, distribution: typing.Union[str, scipy.stats.rv_continuous], distribution_kwargs: typing.Optional[dict] = No...
#!/usr/bin/env python """ show what outliers are using a poisson distirbution """ import numpy as np import matplotlib.pyplot as plt import scipy.stats as stats plt.style.use('seaborn') SMALL_SIZE = 18 MEDIUM_SIZE = 20 LARGE_SIZE = 22 plt.rc('font', size=SMALL_SIZE) # controls default text sizes plt.rc(...
<gh_stars>1-10 # Copyright 2020 <NAME>, <NAME>, <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-2.0 # # Unless required by appl...
import numpy as np import json import os from scipy.io import loadmat from pandas import DataFrame import xgboost as xgb from config_name_creator import create_fft_data_name ##xgb def load_train_data_xgb(data_path, subject): read_dir = data_path + '/' + subject filenames = sorted(os.listdir(read_dir)) trai...
<filename>pymirror/experimental/more_links.py #!/usr/bin/env python3 # coding: utf-8 import argparse import inspect import itertools import signal import statistics import time from pathlib import Path from typing import Optional from dracula import DraculaPalette as Dp from selenium.webdriver.common.by import By fr...
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.loss import _Loss from torch_geometric.utils import remove_self_loops, add_self_loops, softmax from tqdm import tqdm, trange from scipy import sparse class ClassBoundaryLoss(_Loss): __constants__ = ['reduc...
"""This module contains the public api of the EasyAgents reinforcement learning library. It consist mainly of the class hierarchy of the available agents (algorithms), registrations and the management of the available backends. In their implementation the agents forward their calls to the chosen backend. "...
from __future__ import unicode_literals, absolute_import, division import os import numpy as np from scipy.stats import binned_statistic from .base import BaseValidationTest, TestResult from .plotting import plt import healpy as hp __all__ = ['DensityVersusSkyPosition'] def create_hp_map(ra, dec, nside): """ ...
""" Created on 10:25 at 08/07/2021/ @author: bo """ import argparse import os import numpy as np import pickle import data.rruff as rruff from sklearn.metrics import roc_curve, auc from scipy.special import expit, softmax import const import test import vis_utils as vis_utils import data.prepare_data as pdd import matp...
<filename>test_sc_pix3d.py<gh_stars>10-100 from __future__ import print_function from __future__ import division import torch import torch.nn as nn import torch.optim as optim import numpy as np import matplotlib.pyplot as plt import time print("PyTorch Version: ",torch.__version__) import pickle import os import scip...
<gh_stars>1-10 from threading import Lock import random import sympy from datetime import datetime mutex = Lock() def modexp(b, e, m): bits = [(e >> bit) & 1 for bit in range(e.bit_length())] s = b v = 1 for bit in bits: if bit == 1: v *= s v %= m s *= s ...
''' Functions for loading and slicing data ''' from datetime import datetime from pkg_resources import resource_filename import numpy as np from scipy.io import loadmat __all__ = ['get_data', 'get_samplerate_mstimer', 'get_samplerate_datetime', '_sliding_window', 'rolling_...