text
string
<gh_stars>0 #!/usr/bin/env python # coding: utf-8 # In[1]: import os, sys import pandas as pd import numpy as np import numpy.matlib import scipy as sp import geopandas as gpd # Plotting import matplotlib.pyplot as plt import seaborn as sns # In[2]: from IPython.display import clear_output # In[3]: def upd...
<reponame>coganlab/IEEG_preprocessing<filename>Python/audio_stitch.py from bids import BIDSLayout from scipy.io import wavfile import os def get_audio(my_layout: BIDSLayout, sub_id, run) -> list: events = my_layout.get(subject=sub_id, run=run, suffix="events", extension=".tsv")[0].get_d...
import numpy as np import os from vtk import vtkImageData, vtkXMLImageDataReader, vtkXMLImageDataWriter from vtk.util import numpy_support as vn from scipy.spatial.transform import Rotation as R from scipy.interpolate import interpn from warnings import simplefilter simplefilter(action='ignore', category=Fut...
# Import Usefull libraries import sys import re import numpy as np import torch import argparse from os import path, system, chdir from load_csv import load_csv from text import text_to_sequence from text.symbols import symbols from model import Tacotron2, to_gpu code_PAR=text_to_sequence('§',['basic_cleaners'])[0] #...
<gh_stars>1-10 #http://scikit-learn.org/0.11/auto_examples/cluster/plot_dbscan.html print __doc__ import numpy as np from scipy.spatial import distance from sklearn.cluster import DBSCAN from sklearn import metrics from sklearn.datasets.samples_generator import make_blobs ############################################...
<gh_stars>1-10 import os import argparse import numpy as np import pathlib from track import Track import pickle from scipy.misc import imread def sample_tracks(dets_, tracks, sample_interval, track_idx_offset): """Sample tracks at specific interval""" # build a track_id to track_idx dict id2idx = {t.id:i+...
<gh_stars>10-100 #!/usr/bin/env python import os import sys import re import csv import argparse import math from collections import Counter #------------------------------------------------------------------------------- # complex imports #----------------------------------------------------------------------------...
<reponame>labolas89/koheron-sdk import visa import os import numpy as np import time import matplotlib.pyplot as plt from scipy import stats from fft import FFT, Window from koheron import connect # Both the Koheron Alpha and the Keysight 33600A must be # disciplined on the Tektronix MCA3027 OCXO 10 MHz output. clas...
# coding: utf-8 # created by deng on 7/30/2018 import numpy as np import scipy as sp import term_weighting_model.calc_weightings as cw from utils.data_util import load_to_df from utils.path_util import from_project_root from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer from sklearn.externa...
<filename>src/feature/demographics_content.py import numpy as np import scipy.sparse as sps import pandas as pd from src.data_management.data_getter import get_warmer_UCM from src.feature.clustering_utils import cluster_data def get_sub_class_content(ICM_subclass, original_feature_to_id_mapper, binned=True): """...
""" EXAMPLE FOR CAT 9, maximizing ndcg with norm_max_row, : python generic_bayesian.py 8 ndcg l1 quni """ import sys import time import json, os from skopt import gp_minimize from skopt.space import Real from utils.post_processing import eurm_to_recommendation_list,eurm_remove_seed from utils.pre_processing import...
<filename>lttnganalyses/cli/io.py # The MIT License (MIT) # # Copyright (C) 2015 - <NAME> <<EMAIL>> # 2015 - <NAME> <<EMAIL>> # 2015 - <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ...
<filename>kaggle-lung-cancer-approach1/modules/lungprepare.py import numpy as np from modules.utils import Timer from modules.logging import logger import modules.utils as utils import os import dicom import scipy.ndimage import matplotlib.pyplot as plt import matplotlib.patches as patches import scipy.ndimage as ndima...
<reponame>Thamik/lossy-stern-sig ''' Created on Jan 24, 2018 @author: <NAME>, Technische Universiteit Eindhoven, <EMAIL> ''' # imports from math import log, floor, ceil from scipy.optimize import minimize import numpy as np # binomial coefficient (source: wikipedia) def binom(n, k): if k < 0 or k > n: ...
# -*- coding: utf-8 -*- """Extract the soi from low field measurements. The density and mobility are extracted at the same time. """ # ============================================================================= # --- Parameters -------------------------------------------------------------- # ======================...
<filename>model_raisim/Dribble_Control/DRMpc_Arm/ForTra_Verify.py import numpy as np import matplotlib.pyplot as plt from scipy.integrate import odeint, solve_bvp, solve_ivp from scipy import optimize x_ref = -0.1 x_reb = -0.47 # f1 = 25 # f2 = 150 # k_vir = 560 k_con = 100000 g = 10 m = 0.5 class DefFun(object): ...
import argparse import os import matplotlib.pyplot as plt from matplotlib.pyplot import imshow import scipy.io import scipy.misc import numpy as np import pandas as pd import PIL import tensorflow.compat.v1 as tf tf.disable_v2_behavior() from keras import backend as K from keras.layers import Input, Lambda, Conv2D from...
import numpy as np import scipy as sp import scipy.constants import cPickle import radarmodel msl = np.array([-1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, 1, -1, -1, -1, 1, 1, -1, -1, 1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1, 1, -1, -1, 1, -1, -1, 1, -1, 1, 1]).astype(np.float_) m = 128...
<reponame>databyjp/asset_correlation_analysis<gh_stars>1-10 # ========== (c) <NAME> 16/3/21 ========== import logging import pandas as pd import numpy as np import requests import json import os import utils import plotly.express as px import scipy.stats logger = logging.getLogger(__name__) desired_width = 320 pd.s...
import numpy as np import matplotlib.pyplot as plt import scipy n = 365*5 t = np.linspace(0, n, n) x = 3 * np.sin(2*t*2*np.pi/365) # x = np.array([1, 1, 1, 1]) n = len(x) # w = np.exp(complex(0, -2*np.pi/n)) # # f = 2*np.pi/np.linspace(1/n, 1, n) # M = np.ndarray([n, n], dtype=complex) # for j in range(n): # for ...
from rdkit import DataStructs from scipy.spatial.distance import * import rdkit.Chem as Chem import numpy as np from .normalize import * from tqdm import tqdm def prior_unc(fps_train, fps_test, fp_fun=None, dis_fun=lambda x, y: euclidean(x, y), sc_fun=lambda dis...
# ------------------------------------------------------------------------------------- # Library import logging import numpy as np from scipy.interpolate import griddata # ------------------------------------------------------------------------------------- # ---------------------------------------------------------...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Written by <NAME> and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md """ import os import sys import glob import random import shutil import numpy as np import pandas as pd import scipy.io as sio sys.path.append("..") sys.path.app...
import numpy as np def spectral(im: np.ndarray, fm: int): from scipy import fftpack #Spectral Filter axis = len(np.shape(im)) dim = np.shape(im)[0] form = np.shape(im) half = np.zeros(len(form)) im_fft = fftpack.fftn(im) im_fft = np.fft.fftshift(im_fft) half[0] = int...
<gh_stars>0 #Ce fichier contient toute les fonctions nécéssaire pour la caméra from cmath import inf import cv2 as cv import numpy as np import RPi.GPIO as GPIO import time LED = 11 # Une classe qui permet de stocker les informations des zones souillées. class Zone : # Une méthode utilisée pour créer ...
<reponame>marc-h-lambert/L-RVGA<filename>KalmanMachine/KUtils.py<gh_stars>0 ################################################################################### # THE KALMAN MACHINE LIBRARY # # Code supported by <NAME> ...
import classifier import features import sound import numpy as np import pylab as pl import scipy.signal class TimeSpan(object): def __init__(self, start_time=None, end_time=None, duration=None): if start_time==None: raise ValueError("start_time must be provided") self.start_time=flo...
<filename>volumetricspy/volumetrics.py import numpy as np import matplotlib.pyplot as plt import pyvista as pv import pandas as pd from skimage import measure from scipy.integrate import simps from scipy.interpolate import griddata import geopandas as gpd from shapely.geometry import MultiPolygon, Polygon from zmapio i...
<filename>contact/contact.py import os import sys import pickle import numpy as np from scipy.spatial.distance import pdist, squareform from typing import List, Tuple import torch from sklearn.linear_model import Lasso, ElasticNet, LogisticRegression import logging import argparse from joblib import Parallel, delayed ...
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D, proj3d from scipy.stats import multivariate_normal from matplotlib.patches import FancyArrowPatch class Arrow3D(FancyArrowPatch): def __init__(self, xs, ys, zs, *args, **kwargs): FancyArrowPatch.__init__(self, (0,0...
# https://stackoverflow.com/questions/49306092/parsing-a-symbolic-expression-that-includes-user-defined-functions-in-sympy """ The logical flow of the class follows the paper by Wilson 2020. -produce heterogeneous terms for g for arbirary dx -substitute dx with g=g0 + psi*g1 + psi^2*g2+... -produce het. terms for irc ...
import glob import cv2 import matplotlib.image as mpimg import matplotlib.pyplot as plt import numpy as np import pickle from skimage.feature import hog from scipy.ndimage.measurements import label from collections import deque from moviepy.editor import VideoFileClip def get_hog_features(img, orient, pix_per_cell, c...
<gh_stars>1-10 from statistics import median from typing import Any, Callable, Dict, Optional import pandas as pd import plotly.graph_objects as go from hyperstyle.src.python.review.inspectors.issue import IssueType from analysis.src.python.evaluation.inspectors.common.statistics import IssuesStatistics, PenaltyInflue...
<reponame>roinaveiro/poisoning_hmms<filename>attackers/decoding_attacker.py import numpy as np from hmm_utils import HMM from params import * from itertools import product from scipy.special import softmax class dec_attacker(): def __init__(self, prior_m, transition_m, emission_m, rho_probs, X, w1, w2, ...
<filename>PropensityScoreMatching/__init__.py # -*- coding: utf-8 -*- """ Created on Mon May 18 15:09:03 2015 @author: Alexander """ from statsmodels.api import families from statsmodels.api import GLM from statsmodels.tools.tools import add_constant from statsmodels.stats.weightstats import ttest_ind import pandas a...
<filename>sympy/mpmath/tests/elliptic_torture_tests.py #!/usr/bin/env python """ Tests of the elliptic functions module. If all unittests are run at 100 digit precision, it takes ~ 12 m on a Athlon 64 X2 3800+. Author: <NAME> References: [1] Abramowitz & Stegun. 'Handbook of Mathematical Functio...
# <NAME> import argparse, sys, os import numpy as np import pylab as plt from glob import glob from spectral.io import envi from scipy.stats import norm from scipy.linalg import solve, inv from astropy import modeling from numba import jit def find_header(infile): if os.path.exists(infile+'.hdr'): return infile...
"""Gauss-Jordan assistant Enabling user-driven live demonstration of the Gauss-Jordan algorithm in a terminal/console. Source: https://github.com/aroberge/gauss-jordan-assistant Requires Python 3.8+ and Rich (https://github.com/willmcgugan/rich) All the content is in this single file, for those that do not want to ...
<reponame>porya-gohary/real-time-task-generators<filename>lib/generator_WATERS_fixedsum.py #!/usr/bin/env python3 """Task set generation with WATERS benchmark. From the paper: 'Real world automotive benchmark for free' (WATERS 2015). some part adapted from https://github.com/tu-dortmund-ls12-rt/end-to-end """ from scip...
""" Synth800K for Text Detection """ import os import cv2 import json import torch import random import numpy as np from PIL import Image from scipy.io import loadmat from torch.utils.data import Dataset from torchvision.transforms import transforms from datasets.utils import normalize_image, get_im_scale CLASSES = ...
<filename>archived/columbia_aerialplot-example.py # Columbia retreat 1957-2007, viewed from above, contour plot by colour # Jun/Nov 2016 EHU #from numpy import * from netCDF4 import Dataset import numpy as np import matplotlib.pyplot as plt from matplotlib import cm from mpl_toolkits.axes_grid1 import make_axes_locat...
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you m...
from __future__ import print_function import matplotlib.pyplot as plt import numpy as np from scipy import interpolate x_raw = np.linspace(0, 2*np.pi, 10) y_raw = np.sin(x_raw**(2/3)) linear = interpolate.interp1d(x_raw, y_raw) # linear interpolation cubic = interpolate.interp1d(x_raw, y_raw, kind='cubic') # cubic ...
__author__ = 'DGriffith' # Functions related to interpolation of xarray.DataArray and other utilities # Some sort of global data dictionary (CF compliant ?), including short names and synonyms # Could import some or all CF definitions from XML file. import numpy as np import xarray from scipy.interpolate import Regu...
""" Some methods which are useful but didn't quite fit into the graph classes. """ import logging import numpy import scipy.sparse class GraphUtils(object): def __init__(self): pass @staticmethod def vertexLabelPairs(graph, edgeArray): """ Create an array of pairs of vertex la...
import argparse import numpy as np from multiprocessing import Queue, JoinableQueue, Process from PIL import Image from scipy.spatial.transform import Rotation as R from tetrominoes import * import os as os import h5py as h5py def init_episode_dict(): return { 'obs': [], 'action_matrix': [], ...
<filename>NC_rBC_UHSAS_binned_data_to_txt_file-daily_averages.py import sys import os import numpy as np from pprint import pprint from datetime import datetime from datetime import timedelta import mysql.connector import math import matplotlib.pyplot as plt import matplotlib.colors from matplotlib import dates from mp...
<filename>eventsearch/utils.py import numpy as np from scipy.stats import gaussian_kde import scipy.signal as sig from scipy.spatial import distance from scipy.optimize import linear_sum_assignment def kernel_helper(window_len=11, window='hann', **kwargs): """ Helper function to call kernel from st...
""" Make a movie out of a shotgun VAE projection and an audio file. Reduce speed by 50%: :: ffmpeg -i out.mp4 -filter_complex "[0:v]setpts=PTS/0.5[v];[0:a]atempo=0.5[a]" -map "[v]" -map "[a]" -strict -2 out.mp4 TO DO ----- * Check whether ffmpeg is installed. """ __date__ = "November 2019 - November 2020" import...
import pickle import math import os from scipy.io.wavfile import write with open('music_genres_dataset.pkl', 'rb') as f: data = pickle.load(f) for idx, segment in enumerate(data['data']): track = int(math.floor(idx/15)) part = idx % 15 if not os.path.exists('tracks/{}'.format(track)): ...
<gh_stars>0 import numpy as np import matplotlib.pyplot as plt import scipy.optimize # volume_list_low = [4.0, 3.5, 3.0, 2.5, 2.0, 1.9, 1.8, 1.7, 1.6, 1.5, 1.4, 1.3, 1.2, 1.1, 1.0, 0.9, 0.8, 0.7, 0.6] # volume_list = [4.0, 3.5, 3.0, 2.5, 2.0, 1.9, 1.8, 1.7, 1.6, 1.5, 1.4, 1.3, 1.2, 1.1, 1.0, 0.9, 0.8, 0.7] # 21 degre...
<gh_stars>0 #important URLs: #http://192.168.1.113:8000/stream.mjpg #http://192.168.1.113:8000/prev_view.html #http://192.168.1.113:8000/next_view.html #http://192.168.1.113:8000/brighter.html #http://192.168.1.113:8000/dimmer.html # in virtual env, python qr.py # on browser, http://192.168.1.100:8000 # Overview # Re...
import numpy as np import math from scipy.spatial.distance import cityblock import matplotlib.pyplot as plt from re import split # sample finishing time based on statistics def sample_FT(f_t_model, fast_m, fast_s, medium_m, medium_s, slow_m, slow_s): sample_ft=np.zeros(len(f_t_model)) for i, model in enumerat...
<gh_stars>0 """ <NAME> & <NAME> 2022-01-10, v1.0 ! Make sure to cite the paper below if you use "ApThermo" in your research: Li and Costa (2020, GCA) https://doi.org/10.1016/j.gca.2019.10.035 """ import scipy.optimize import math, numpy as np, pandas as pd MassCl = 35.45 # Molar mass of Cl MassF = 18.998 ...
""" one_mode is an example file which seeks to verify the new Hamiltonian algorithm and update sequence as derived by Dan and Stephen. It will ignore much of the class structure applied to OLIVE in an attempt to provide a simple example of the algorithm. Once verified, it will be implemented within OLIVE using the ap...
<gh_stars>1-10 """Tracks PV modules over subsequent video frames. This module performs multiple-object tracking of segmentation masks of PV modules in subsequent IR video frames. The aim is to identify the same physical PC module in subsequent frames and assign a unique tracking ID to it. This allows to group ima...
import os import math import random import operator from functools import reduce import numpy as np from sklearn.metrics import f1_score from tqdm import tqdm from nltk.util import everygrams from scipy.stats import pearsonr import torch import torch.nn as nn import torch.nn.functional as F from pytorch_pretrained_be...
<reponame>dpopadic/arpmRes #!/usr/bin/env python3 # -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.4' # jupytext_version: 1.1.4 # kernelspec: # display_name: Python 3 # language: python # na...
<reponame>tmaiwald/OSIM import numpy as np from numba import jit from scipy.sparse.linalg import spsolve import scipy as np import numpy from OSIM.Modeling.CircuitSystemEquations import CircuitSystemEquations from OSIM.Modeling.Components.Port import Port from OSIM.Modeling.Components.VoltageSource import VoltageSource...
import os import sys import time import datetime import argparse import re from pathlib import Path from tqdm import tqdm from copy import deepcopy, copy import traceback import json import warnings import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib_venn import venn2 from mpl_toolk...
import scipy.io as io import numpy as np import scipy.ndimage as nd import os,random import tensorflow as tf import sys import argparse,sys def shuffle(names,max_epoch): # 我自己加的,因为后续程序会使每张图片的出现次数不一样!!! Names = names retu = [] for i in range(max_epoch): random.shuffle(Names) retu += Names ...
#!/usr/bin/env python ### Written by <NAME> @ AG Klebe Marburg University ### Please contact via <EMAIL> ### Numerical libraries import numpy as np from scipy import spatial as spatial_scipy ### Use field classes abd grid_water from io_operations import load_dx, write_files ### Other import sys import time if len(...
<reponame>LBJ-Wade/GALLUMI_public import numpy as np from matplotlib import pyplot as plt import glob from matplotlib import patches as mpatches import scipy.ndimage plt.style.use("../template.mplstyle") # purple - green - darkgoldenrod - blue - red colors = ['purple', '#306B37', 'darkgoldenrod', '#3F7BB6', '#BF4145']...
""" *Calculates plots for SIx from historical LENS* """ import numpy as np from netCDF4 import Dataset import matplotlib.pyplot as plt import scipy.stats as sts from mpl_toolkits.basemap import Basemap directory = '/volumes/eas-shared/ault/ecrl/spring-indices/data/' def SIxHistorical(): """ Reads in historic...
import pdb import os import pandas as pd import dymos as dm import numpy as np import datetime as dt from typing import Union import openmdao.api as om from pyNA.src.settings import Settings from pyNA.src.aircraft import Aircraft from pyNA.src.trajectory_src.atmosphere import Atmosphere from pyNA.src.engine import Engi...
#!/usr/bin/env python """Generate Input files Author: {0} ({1}) This module is part of CADEE, the framework for Computer-Aided Directed Evolution of Enzymes. """ from __future__ import print_function from random import randint from fractions import gcd import logging import os import sys from tools import get_...
<gh_stars>1-10 import numpy as np # from numba import jit import progressbar as pb import scipy as sp import sys # bayesian matting ------------------------------------------------------------ # @jit def bayesian(im, tm, dvar=.4, lws=60, overlap=1.0/3, npmin=400): # This uses a maximum-likelihood (Bayesian) approa...
#!/usr/bin/env python # -*- coding: utf-8 -*- # author: Yizhong # created_at: 10/26/2016 下午8:36 import argparse import gzip import pickle import scipy from data_helper import DataHelper from eval.evaluation import Evaluator from models.classifiers import ActionClassifier, RelationClassifier from models.parser import ...
<reponame>amirhertz/shadowpix<gh_stars>1-10 from PIL import Image import cv2 import numpy as np import matplotlib.pyplot as plt from scipy.ndimage.filters import convolve import os GRADIENT_KERNEL = np.array([[-1, -1, -1], [-1, 8, -1], [-1, -1, -1]]) x = cv2.getG...
# -*- coding: utf-8 -*- """ Generates primary figures for HCP results """ from pathlib import Path import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy import ndimage import seaborn as sns from parspin.partitions import NET_OPTIONS, YEO_CODES from parspin.plotting import savefig from par...
""" This module """ import numpy, math from numpy import log10 as log10 from numpy import pi as pi from scipy.interpolate import UnivariateSpline as interpolate from scipy.optimize import curve_fit as cf from s...
<filename>k210_code/gen_ary.py import numpy as np from scipy.special import expit with open('/home/zqh/Documents/kendryte-standalone-sdk/src/k210_face/act_ary.h', 'w') as f: f.write('#ifndef _ACTARY_H_ \n\ # define _ACTARY_H_ \n\ # include <stdint.h> \n\ float sigmoid[] = {') for i in range(256): f.wr...
""" Module for calculating pseudoinverses. """ from sympy import * class Calculator: @staticmethod def load_matrix(m, n): """ Returns the matrix which user gives as input or None if the input is incorrect. """ matrix = [] for i in range(m): matrix.append(in...
<gh_stars>0 import sys import os import gc import numpy as np import matplotlib.pyplot as plt from matplotlib import ticker import scipy.sparse.linalg as spLA import majoranaJJ.modules.plots as plots #plotting functions import majoranaJJ.modules.finders as fndrs import majoranaJJ.modules.SNRG as SNRG import majoranaJ...
<reponame>svz71195/XRBs import numpy as np from scipy.special import gammaincc, gamma from numba import njit class Integrate: @staticmethod def Riemann(func: np.ufunc, lim_l: float, lim_u: float, n: int, *arg: tuple) -> float: eval = np.linspace(lim_l,lim_u,n+1) delta = np.diff(eval) ...
<filename>data/data_util.py import scipy.fftpack as fftpack import librosa import pyworld as pw import numpy as np import os import soundfile as sf import fnmatch import matplotlib.pyplot as plt import pysptk from librosa.display import specshow import copy gamma = 0 mcepInput = 3 # 0 for dB, 3 for magnitude alpha =...
<reponame>ajeddeloh/ray-optics #!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright © 2016 <NAME> """ converting a spectrum to a colour code from the web blog: https://scipython.com/blog/converting-a-spectrum-to-a-colour/ @author: <NAME> """ import numpy as np from scipy.constants import h, c, k from rayop...
<reponame>Jael24/TB_ElasticStack<filename>images/python_analysis/src/venv/lib/python3.7/site-packages/mlxtend/classifier/stacking_classification.py # Stacking classifier # <NAME> 2014-2020 # mlxtend Machine Learning Library Extensions # # An ensemble-learning meta-classifier for stacking # Author: <NAME> <<EMAIL>> # #...
#!/usr/bin/env python import os import multiprocessing as mp import sys import numpy as np from scipy import linalg from saf.action.solve import solve from saf.euler1d.linear.config import Config from saf.euler1d.linear.asciireader import ASCIIReader E_ACT = 50.0 T_FINAL = 20 def _run_solver(args): q, n12 = ...
<reponame>v1259397/cosmic-gnuradio #!/usr/bin/env python # # Copyright 2011-2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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; ...
<reponame>MilesCranmer/bnn_chaos_model """This file takes a model at its minima, and models the Gaussian at the posterior mode""" import sys import seaborn as sns sns.set_style('darkgrid') from matplotlib import pyplot as plt import spock_reg_model spock_reg_model.HACK_MODEL = True from pytorch_lightning import Trainer...
""" Ledalab analysis functions (original folder: Ledalab/analyze) """ from __future__ import division import numpy as np from numpy import array as npa import math from scipy import stats from scipy.signal import convolve from scipy import interpolate from scipy.linalg import norm from . import leda2 from . import util...
<reponame>PascalSavage/procedural-cell-generation<filename>preprocess.py import numpy as np import cv2 import czifile import pickle import matplotlib.pyplot as plt import scipy.misc import os SLICE_COUNT = 15 def extract_channel(channel_number, czi_image, file_name): with open(file_name, 'wb+') as f: pick...
""" """ from .base_statistics import BaseStatistics from ..base import Base, CLUSTER_NAME_COLUMN_LABEL, CLUSTERED_FILENAME_POSFIX from ..plots.base_plot import BasePlot import numpy as np import os import sys import pandas as pd import matplotlib.pyplot as plt import scipy.cluster.hierarchy as shc from sklearn.clust...
<reponame>JoseChulani/PyFDTD import numpy as np import math import scipy.constants import time import matplotlib.pyplot as plt import matplotlib.animation as animation # ==== Preamble =============================================================== c0 = scipy.constants.speed_of_light mu0 = scipy.constants.mu_0 eps0 ...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- from co...
<reponame>johnmgregoire/JCAPdatavis import time, copy import os, os.path import sys import numpy from PyQt4.QtCore import * from PyQt4.QtGui import * from scipy import optimize from echem_plate_ui import * from echem_plate_math import * import pickle #p='C:/Users/Gregoire/Documents/CaltechWork/echemdrop/20120728NiFeCo...
<reponame>rocksat/jsis3d import os import json import h5py import argparse import numpy as np import plyfile as ply import scipy.stats as stats from utils import block_merge parser = argparse.ArgumentParser() parser.add_argument('--logdir', help='path to the logging directory') parser.add_argument('--visualize', act...
import numpy as np import nn_closed_loop.constraints as constraints import matplotlib.pyplot as plt from matplotlib import cm from matplotlib.patches import Rectangle from copy import deepcopy import os from nn_closed_loop.utils.utils import Hausdorff_dist_two_convex_hulls from nn_closed_loop.utils.utils import is_hul...
<reponame>e-pet/e-pet.github.io<filename>snippets/2018-04-04-interpolation.py from scipy import interpolate import numpy as np import matplotlib.pyplot as plt # Example 1: Impulse x1 = np.arange(0, 7) x1_dense = np.linspace(start=0, stop=6, num=1000) y1 = np.array([0, 0, 0, 1, 0, 0, 0]) f_cubic_splines = interpolate.i...
#!/usr/bin/env python import argparse as ap import cooler import gc import h5py import numpy as np import multiprocessing as mp from krbalancing import * from scipy.sparse import csr_matrix, triu, tril from cooler import ice from cooler.util import parse_cooler_uri import logging def cooler2csr(cooleruri): ''' ...
import mne import pandas as pd import numpy as np from scipy.signal import spectrogram from sklearn.svm import LinearSVC, SVC import matplotlib.pyplot as plt import matplotlib class ssvep: def __init__(self, set_fontsize=True, fontsize=22): """ Parameters ---------- set_fontsize : b...
<gh_stars>1-10 #!/usr/bin/env python """ Spherical Brain Mapping of 3D Brain Images. 3D brain imaging, such as MRI or PET produces a huge amount of data that is currently analysed using uni or multivariate approaches. The main aim of SBM is to provide a new framework that allows the mapping of a 3D brain image to ...
""" ----------------------------------------------------------------------- Harmoni: a Novel Method for Eliminating Spurious Neuronal Interactions due to the Harmonic Components in Neuronal Data <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME> https://doi.org/10.1101/2021.10.06.463319 ----------------------------...
#☆𝒐𝒎𝒂𝒋𝒊𝒏𝒂𝒊☆# import sys import math import cmath import itertools from functools import lru_cache from collections import deque sys.setrecursionlimit(10000000) input=lambda : sys.stdin.readline().rstrip() '''''✂''''''''''''''''''''''''''''''''''''''''''''''''''''''''' n=int(input()) d=[] for i in range(n): ...
<gh_stars>10-100 ''' This package contains code for submodular maximization and structured learning using stochastic gradient decent. It allows to learn an objective function as a linear combination of simpler functions f, i.e. .. math:: o(\mathbf{x_\mathcal{V}},\mathbf{y})=\mathbf{w^\mathrm{T}}\mathbf{f}(\mathbf{x_\m...
<filename>compare_J_from_mat_file.py<gh_stars>0 import numpy as np from scipy.stats import linregress import matplotlib.pyplot as plt import scipy.io as sio import seaborn import click import sys from sklearn.linear_model import Lasso @click.command() @click.option('--show_plot', type=click.BOOL, defaul...
"""Utilities for noise estimation.""" import numpy as np from scipy.special import gammainc def mmse_henriks(sigpspec, noise=None, alpha=.98, beta=.8, rule='wiener'): """Implement the MMSE method by Henriks et al for noise PSD estimation. Hendriks, <NAME>., <NAME>, and <NAME>. "MMSE based noise PSD track...
""" Simple shift-only and linear time-warping functions. This is an alternative to `affinewarp` time warping. Warning ------- * `ava.preprocessing.warping` is experimental and may change in a future version of AVA! """ __date__ = "September 2020 - November 2020" import numpy as np from scipy.interpolate import in...
<filename>escriptcore/py_src/start.py<gh_stars>0 ############################################################################## # # Copyright (c) 2003-2018 by The University of Queensland # http://www.uq.edu.au # # Primary Business: Queensland, Australia # Licensed under the Apache License, version 2.0 # http://www.ap...