text
string
<filename>examples/mnist_sl/extract_mnist.py #!/usr/bin/env python # coding: utf-8 """ File Name: extract_mnist.py Author: <NAME> E-mail: <EMAIL> Created on: Tue Oct 13 21:13:51 2015 CST """ DESCRIPTION = """ """ import os import argparse import logging from struct import unpack import numpy as np f...
<filename>fitting/LimitCalculator_MC.py """ LimitCalculator_MC.py - 23/03/2017 Summary: Tool for calculating limits on New Physics models from measurements of Coherent Elastic Neutrino Nucleus Scattering (CEvNS). Uses MCMC to sample the likelihood. Requires numpy, scipy and CEvNS.py. Also requires emcee - http://da...
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Sat Dec 24 15:28:10 2016 @author: User """ import random, math import scipy.io import matplotlib as mpl import matplotlib.pyplot as plt import pandas as pd import numpy as np import time import matplotlib.pyplot as plt from sklearn import svm from sklearn.svm imp...
<gh_stars>1-10 # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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 # # ...
<reponame>twiewiora/smell-simulation import glob import os from statistics import median from itertools import groupby, product from matplotlib import pyplot as plt # general settings PREFIXES = ['formin', 'fortwist', 'torch', 'smog'] VARIANTS = ['default', 'variant1', 'variant2', 'variant3'] WORKERS_ROOT_MAX = 4 SAM...
<filename>core_compute.py<gh_stars>0 import sys import time import kombine import os import numpy as np import pandas as pd import scipy.stats as ss from ptemcee import Sampler as PTSampler from multiprocessing import Pool #from pymultinest.solve import solve def coef_summary(flattrace, pname, outname): headings...
from astropy.io import fits from sitelle.utils import * import numpy as np from scipy.interpolate import UnivariateSpline from orb.utils import io import subprocess import os import copy import sys from path import Path import socket __all__ = ['parameter_map', 'read', 'extract_spectrum', 'sew_spectra', 'NburstFitter'...
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Tue Oct 27 09:57:52 2020 Split the data into training, validation and test sets @author: <NAME>, <NAME> """ from sklearn.model_selection import StratifiedShuffleSplit import scipy.io as sio import numpy as np from preprocess import preprocess import pandas as pd impo...
<reponame>dc-aichara/signate-jpx import yaml import pandas as pd import numpy as np from scipy.stats import spearmanr from PriceIndices import Indices from sklearn.preprocessing import OneHotEncoder, OrdinalEncoder, MinMaxScaler from typing import Tuple, Optional, Union import lightgbm as lgb def load_data( data_...
import numpy as np import matplotlib.pyplot as plt from scipy.io import wavfile # Read the input file sampling_freq, audio = wavfile.read('input_read.wav') # Print the params print '\nShape:', audio.shape print 'Datatype:', audio.dtype print 'Duration:', round(audio.shape[0] / float(sampling_freq), 3), 'seconds' # N...
<reponame>igotchalk/simpegEM1D import scipy as sp import numpy as np from SimPEG.regularization import Sparse, SparseSmall, SparseDeriv, Simple from SimPEG import Mesh, Utils def get_2d_mesh(n_sounding, hz): """ Generate 2D mesh for regularization hx: hz: """ hx = np.ones(n_sound...
<filename>rcc_dp/sqkr_test.py # Copyright 2021, Google LLC. # # 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 applicab...
<filename>fish/scripts/save_dff.py #!/usr/bin/env python # -*- coding: utf-8 -*- # # Register, downsample, save dff as tif # # <NAME> # <EMAIL> # # License: MIT # def get_sc(app_name): from pyspark import SparkConf, SparkContext conf = SparkConf().setAppName(app_name) sc = SparkContext(conf=conf) r...
<filename>hardware/channel.py from collections import deque import math import numpy as np from scipy import signal class Channel: def __init__(self, name, min, max, maxNum, offset=0.0): self.name = name self.min = min self.max = max self.num = 0 self.sum = 0 self.buffersum = 0 self.size = maxNum se...
""" Script calculates accuracy of multi-decadal ANNv1 Author : <NAME> Date : 19 January 2021 """ ### Import modules import numpy as np import scipy.stats as sts import matplotlib.pyplot as plt import calc_Utilities as UT import calc_dataFunctions as df import palettable.wesanderson as ww import calc_Stats as ...
<reponame>Code-Cornelius/python_libraries<filename>corai_util/finance/src/implied_vol.py # normal libraries import warnings import numpy as np from scipy.optimize import bisect from scipy.stats import norm # priv_libraries from corai_util.finance.src.bs_model import BlackScholes, BlackScholesVegaCore from corai_util....
# -*- coding: utf-8 -*- """ Created on Tues at some point in time @author: bokorn with some code pulled from https://github.com/yuxng/PoseCNN/blob/master/lib/datasets/lov.py """ import os import cv2 import torch import numpy as np import scipy.io as sio import time import sys from se3_distributions.datasets.image_dat...
import argparse import numpy as NP from astropy.io import fits from astropy.io import ascii import scipy.constants as FCNST import matplotlib.pyplot as PLT import matplotlib.colors as PLTC import progressbar as PGB import healpy as HP import geometry as GEOM import interferometry as RI import catalog as SM import cons...
<filename>dml/KNN/kd.py from __future__ import division import numpy as np import scipy as sp from operator import itemgetter from scipy.spatial.distance import euclidean from dml.tool import Heap class KDNode: def __init__(self,x,y,l): self.x=x self.y=y self.l=l self.F=None self.Lc=None self.Rc=None sel...
""" Created on Thu Jan 26 17:04:11 2017 Preprocess Luna datasets and create nodule masks (and/or blank subsets) NOTE that: 1. we do NOT segment the lungs at all -- we will use the raw images for training (DO_NOT_SEGMENT = True) 2. No corrections are made to the nodule radius in relation to the thickness of th...
<filename>tests/test_choice_calcs.py<gh_stars>1-10 """ Tests for the choice_calcs.py file. """ import unittest import warnings from collections import OrderedDict import numpy as np import numpy.testing as npt import pandas as pd from scipy.sparse import csr_matrix from scipy.sparse import diags from scipy.sparse impo...
<gh_stars>0 # This file is part of GridCal. # # GridCal 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. # # GridCal is distributed in t...
<filename>DataPipeline/DataManagerFinal.py import os import csv import re import csv import math from collections import defaultdict from scipy.signal import butter, lfilter import matplotlib.pyplot as plt import pandas as pd import numpy as np from statistics import mean from scipy.stats import kurtosis, skew from skl...
"""Graph module to store a network and generate random walks from it.""" import numpy as np from scipy import sparse from residual2vec import utils class NodeSampler: def fit(self, A): """Fit the sampler. :param A: adjacency matrix :type A: scipy.csr_matrix :raises NotImplemented...
#!/usr/bin/env python # coding: utf-8 from sympy import Symbol from sympy import pprint def comment(): with open("180401054_yorum.txt", "w") as comment: comment.write("CEYDA KAMALI 180401054\n") comment.write("İntegral hesaplama işlemlerini yaparken yamuk metodunu kullandım.\n") commen...
<filename>qclib/isometry.py # Copyright 2021 qclib project. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable l...
<reponame>EFrion/montepython_public from scipy import interpolate import os import numpy as np import montepython.io_mp as io_mp from montepython.likelihood_class import Likelihood class bbn_omegab(Likelihood): # initialization routine def __init__(self, path, data, command_line): Likelihood.__init_...
__author__ = 'thor' import matplotlib.pyplot as plt import numpy as np import scipy def xy_density(xdat, ydat, cmap='jet', marker='.', imshow_kwargs={}, bins=[100, 100], density_thresh=0, xyrange=None, plot_kwargs={}): ''' graphs the density of (x,y) points in the plane, using color (defined b...
import numpy as np import numpy.random as npr import scipy.stats as ss import utilities as ut class Model: """ The models (objects of this class) represent quantum circuits that operate on na + nb qubits. We will call a list1 any list of numpy arrays of shapes given by the shapes1, with length gi...
import numpy as np import torch import torch.nn as nn from scipy.sparse import issparse from fonduer.learning.disc_learning import NoiseAwareModel from fonduer.learning.disc_models.layers.rnn import RNN from fonduer.learning.disc_models.utils import ( SymbolTable, mark_sentence, mention_to_tokens, pad_...
from subprocess import call import os, time import shutil import io import base64 from IPython.display import HTML import numpy as np from PIL import ImageDraw, Image, ImageFont from tempfile import NamedTemporaryFile import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import animati...
<reponame>EmPlatts/FRB """ Module for IGM calculations """ from __future__ import print_function, absolute_import, division, unicode_literals import numpy as np import os from IPython import embed from pkg_resources import resource_filename from scipy.interpolate import interp1d from scipy.interpolate import Interpo...
import numpy as np import math import scipy.stats def main(): N = 100000 num_iter = 200 k = 13 l = 3 alpha = 1.0*l/(k-l) print(alpha) eps = 0.005 for cov in [2.20,2.22,2.24,2.26]: print(cov) lamb = cov/(1+alpha) P_b = sampled_DE(lamb, num_iter, N, eps, k, l) print(P_b) def sampled_DE(lamb, num_iter, ...
"""Performs face alignment and calculates L2 distance between the embeddings of images.""" # MIT License # # Copyright (c) 2016 <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 wit...
<reponame>SanGreel/music-recommendation-system #!/usr/bin/env python # coding: utf-8 get_ipython().run_line_magic('pylab', 'inline') import warnings warnings.filterwarnings('ignore') import numpy as np import matplotlib.pyplot as plt from .audiofile_read import * from .rp_extract import rp_extract #from rp_plot import...
from MLModule.metric import np_celoss_pair import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from scipy.special import entr sns.set_style("white") sns.set(font_scale=2) kwargs = dict(hist_kws={'alpha': .4}, kde_kws={'linewidth': 2, "bw_adjust": 0.3}) df_by_ele = pd....
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/datasets/datasets.beibei.ipynb (unless otherwise specified). __all__ = ['BeibeiDataset'] # Cell import numpy as np import scipy.sparse as sp import pickle from .bases.common import Dataset from ..utils.common_utils import * # Cell class BeibeiDataset(Dataset): def...
from abc import ABC, abstractmethod from typing import MutableSequence import numpy as np from numpy.core.fromnumeric import size, transpose from scipy.signal.ltisys import LinearTimeInvariant from .model import Model from scipy import signal from si.util.metrics import mse, mse_prime from si.util.im2col import pad2...
<filename>src/preprocess/archive/preprocess_mongo.py import json import numpy as np import cPickle as pickle import progressbar from pymongo import MongoClient from scipy.sparse import coo_matrix def get_index_from_click_pattern(click_pattern, location): index = (location - 1) * 1024 index += int(''.join([st...
<gh_stars>0 from montepython.likelihood_class import Likelihood import io_mp import scipy.integrate from scipy import interpolate as itp import os import numpy as np import math # Adapted from <NAME> class euclid_lensing(Likelihood): def __init__(self, path, data, command_line): Likelihood.__init__(sel...
import os import torch.nn as nn import torch import warnings import argparse from Logger import * import pickle from Dataset import * warnings.filterwarnings("ignore") from Functions import * from Network import * import pandas as pd def get_args(): parser = argparse.ArgumentParser() parser.add_argument('--gpu_...
<reponame>peterewills/NetComp """ ********** Resistance ********** Resistance matrix. Renormalized version, as well as conductance and commute matrices. """ import networkx as nx from numpy import linalg as la from scipy import linalg as spla import numpy as np from scipy.sparse import issparse from netcomp.linalg.m...
# -*- coding: utf-8 -*- """ Classes and functions used to define 'wind environments' i.e. the spatial variation of mean and turbulence components of wind speed @author: RIHY """ import scipy import numpy import matplotlib.pyplot as plt from numpy import log as ln from scipy import spatial from scipy import interpol...
from typing import List, Dict, Tuple, Union from collections import defaultdict from itertools import groupby import escnn.nn from escnn.group import Group, GroupElement from escnn.group import Representation from escnn.gspaces import GSpace from escnn.group import directsum import numpy as np from scipy import spa...
<filename>threeML/minimizer/minimization.py from __future__ import division import collections import math from builtins import object, range, str, zip import numpy as np import pandas as pd import scipy.optimize from past.utils import old_div from threeML.config.config import threeML_config from threeML.exceptions....
<filename>python/redmonster/sandbox/dchi2_optimize.py # Optimize dchi2 threshold in zfitter for best purity/completeness import numpy as n import matplotlib.pyplot as p p.interactive(True) from redmonster.sandbox import yanny as y from astropy.io import fits from redmonster.datamgr import spec, io from redmonster.phys...
# https://deeplearningcourses.com/c/advanced-computer-vision # https://www.udemy.com/advanced-computer-vision from __future__ import print_function, division from builtins import range # Note: you may need to update your version of future # sudo pip install -U future from keras.models import Sequential, Model from ke...
<filename>loica/util.py import pickle import numpy as np from scipy.interpolate import interp1d from scipy.optimize import least_squares def forward_model_growth( Dt=0.05, sim_steps=10, muval=[0]*100, od0=0, nt=100 ): od_list, t_list = [],[] od = od0 for t in range(nt): od_list....
<filename>fstools/solver.py<gh_stars>0 import torch import torch import torch.nn as nn import torch.nn.functional as F import scipy.stats as st import numpy as np import random from tqdm import tqdm def get_loss_mse(alpha, D, X, loss_amp=1, per_elem_batch=False): """ Compute MSE loss on batches for weigh...
<gh_stars>0 from scipy.spatial.distance import cdist def knowledge_gap(centers1, centers2, metric='seuclidean') -> float: """ The knowledge gap is defined as the sum over the distances between centers in <centers1> and the closest center in <centers2>. Distance is defined by <metric>. :param centers1...
import pandas as pd import numpy as np import os from glob import glob import matplotlib.pyplot as plt import datetime from scipy.spatial import distance from sklearn.impute import KNNImputer from sklearn.model_selection import train_test_split from sklearn.metrics.pairwise import paired_distances from sklearn.preproce...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Sep 19 13:04:59 2020 @author: atkachev """ from magnetic import Ap, Bz import numpy as np from scipy import integrate import time R = np.linspace(0.001, 0.499, 10001) t1 = time.time() A1 = np.array([Ap(r,0,0.5,1000) for r in R]) t2 = time.time() prin...
""" ============ Rank filters ============ Rank filters are non-linear filters using the local greylevels ordering to compute the filtered value. This ensemble of filters share a common base: the local grey-level histogram extraction computed on the neighborhood of a pixel (defined by a 2D structuring element). If the...
<filename>behaviorAnalysis/magnification/training/auxiliaries.py import numpy as np, time, random, csv import torch, ast, pandas as pd, copy, itertools as it, os, torch.nn as nn from torchvision import transforms import torchvision import scipy.io as sio from tqdm import tqdm from PIL import Image from skimage import i...
<gh_stars>1-10 from __future__ import print_function import librosa from matplotlib import pyplot as plt, ticker as plticker, colors as colors, cm, patches import librosa.display from scipy.signal import argrelextrema import numpy import pandas as pd def specshow_localmax(Xdb, grid, percentil): """ Máximos lo...
<reponame>forest-snow/anchor-topic import scipy.sparse import numpy import math import scipy.stats def computeQ(word_doc, epsilon=1e-15): M = scipy.sparse.csc_matrix(word_doc.copy(), dtype=float) n_words, n_docs = M.shape # word_probs is sum of probabilities of word occurring in all documents word_pr...
from typing import List, Tuple, Dict import argparse from scipy.ndimage import fourier_shift, shift from skimage.feature import register_translation, masked_register_translation from skimage.transform import rescale from skimage import io from shutil import move from tqdm import tqdm from parseConfig import parseConfi...
<reponame>kevin-xuan/Traffic-Benchmark import pickle import numpy as np import os import scipy.sparse as sp import torch from scipy.sparse import linalg from torch.autograd import Variable def normal_std(x): return x.std() * np.sqrt((len(x) - 1.) / (len(x))) class DataLoaderS(object): def __init__(self, ...
import random import math import fractions from ..__init__ import * from .addition import * from .subtraction import * from .multiplication import * from .division import * from .binary_complement_1s import * from .modulo_division import * from .square_root import * from .power_rule_differentiation import * from .sq...
<reponame>williamgilpin/rk4 # Test out the runge kutta library # <NAME> 2014 from matplotlib import pyplot from scipy import * from numpy import * from rk4_poincare import * t = linspace(0, 100.0, 1000) print ("step size is " + str(t[1]-t[0])) # Four representative initial conditions for E=1/12 on the Henon-Heiles ...
<filename>Biological_Study/Plots_For_Enrichment_Jaccard_Mean_Level.py ############################################ # Script to make the plots for the article # ############################################ # Description ''' This script contains all the fucntions to generate the plots of the enrichment analyses includ...
<reponame>TatsuyaHaga/reversereplaymodel_codes<filename>Fig3_Fig4/sample_ISI_speed_symmetric/plot_bias_eachparam.py #!/usr/bin/env python3 import numpy import pylab import scipy.stats pylab.rcParams["font.size"]=8 pylab.rcParams["legend.fontsize"]=8 #pylab.rcParams["lines.linewidth"]=1 #pylab.rcParams["axes.linewidth...
import argparse import multiprocessing from functools import partial from io import BytesIO import lmdb from PIL import Image from tqdm import tqdm import torch import numpy as np import pandas as pd import cv2 import sys import json import os from glob import glob from utils.CUB_data_utils import square_bbox, pertur...
import scipy.io as sio from math import ceil,floor from statistics import mean from numpy import square,sqrt,absolute matfile = sio.loadmat( 'changed_param_2.mat' ) old_mat = sio.loadmat( 'learned_all_param_2.mat' ) #for i in range( 15 ): #print matfile['p'][[11 ,67 ,225,336,357,444,635,679],0],old_mat['p'][[11 ,67 ,2...
""" This file contains various statistical functions used for evaluating the results of a model. It also helps with the process of performing cross-validation. Finally, it has multiple functions to display results, as well. """ from statistics import mean, stdev from typing import Union from aenum import NamedTuple f...
<reponame>janvonrickenbach/Chaco_wxPhoenix_py3 """This example demonstrates creating a contour plot using the chaco shell subpackage. """ # Major library imports from numpy import linspace, meshgrid, sin from scipy.special import jn # Enthought library imports from chaco.shell import show, title, contour # Crate som...
# -*- coding: utf-8 -*- # SPDX-License-Identifier: Apache-2.0 """ This module defines the abstract base class for contextual multi-armed bandit algorithms. """ import abc from itertools import chain from typing import Callable, Dict, List, NoReturn, Optional, Union import multiprocessing as mp from joblib import Par...
from decimal import ROUND_HALF_UP, Decimal from fractions import Fraction from django.contrib.gis.db import models from django.db import connection, transaction from django.db.models import Max, Sum from django.utils.translation import pgettext_lazy from django.utils.translation import ugettext_lazy as _ from enumfiel...
<gh_stars>0 #!/usr/bin/env python3 ########################################################################################## # For a given spin qudit dimension, this script first generates random measurement axes, # then takes the best found measurment axes and tries to further optimize them by # minimizing their ass...
#!/usr/bin/env python # coding: utf-8 import sys sys.path.insert(0, '../py') from graviti import * import json import numpy as np from skimage.draw import polygon from skimage import io from matplotlib import pyplot as plt import glob import pandas as pd import os from scipy.sparse import coo_matrix from skimage.me...
#!/usr/bin/env python # coding: utf-8 # TODO: # # # R1 # - get the Nyquist plot axis dimensions issue when $k=1$ fixed # - figure out the failing of .pz with active elements # # # R2 # - make the frequency analysis stuff happen # # In[1]: from skidl.pyspice import * #can you say cheeky import PySpice as pspic...
# -*- coding: utf-8 -*- """ Created on Sat Jan 30 01:33:10 2016 @author: Adetola """ from __future__ import division from scipy.stats import nbinom import numpy.random as random def corner_spread(home_corners, away_corners, corner_mean, niterations): random.seed(1234) game_home_mean = [0] * niterations g...
<filename>sdmlib/__init__.py import scipy.stats as st import numpy as np from time import time class Memory: def __init__(self, N, M, U, d, T=None, seed=None): """ |Parameter|Description| |:-:|:-:| |`N`|Length of addresses in bits| |`M`|Number of hard addresses| |`U`...
<reponame>cadurosar/SGC import numpy as np import scipy.sparse as sp import torch def normalized_adjacency(adj): adj = sp.coo_matrix(adj) row_sum = np.array(adj.sum(1)) d_inv_sqrt = np.power(row_sum, -0.5).flatten() d_inv_sqrt[np.isinf(d_inv_sqrt)] = 0. d_mat_inv_sqrt = sp.diags(d_inv_sqrt) return d_...
<filename>scripts/gauss_legendre.py import numpy as np import sympy as sp from sympy.core import S, Dummy from sympy.polys.orthopolys import (legendre_poly, laguerre_poly, hermite_poly, jacobi_poly) from sympy.polys.rootoftools import RootOf def symbolic_gauss_legendre(n): """...
import numpy as np from scipy.stats import invwishart """ Code to simulate data from some simple outcome-covariate relationships. """ def make_func(a): def func(sample_size, D, noise): r, fx = a() x = (r[1] - r[0]) * np.random.rand(sample_size, D) + r[0] y = np.apply_along_axis(lambda x: [...
import MDSplus as mds import matplotlib.pyplot as plt import matplotlib.cm as cm from matplotlib.widgets import Slider from scipy.ndimage import median_filter import sys import numpy as np mask_y = np.arange(195, 384, 4) mask_x = np.arange(3, 512, 8) def main(argv): if len(argv) < 3: sys.stderr.write("Us...
from .database import Database from statistics import mean db = Database.shared() def main(speed, interval, num_of_tags, posts_threshold=15): cycle = 1 while True: cycle_start_time = db.time tags_rates = {} for x in db.rates: # Setting up data points min_rates_...
from __future__ import print_function from __future__ import division from collections import namedtuple import logging import numpy as np from scipy.optimize import minimize import open3d as o3 from . import features as ft from . import cost_functions as cf from .log import log class L2DistRegistration(object): ...
<gh_stars>1-10 import sys sys.dont_write_bytecode = True from sympy.core.symbol import Symbol from sympy.sets.sets import set_function from sympy import sin, cos, tan, exp, log, sinh, cosh, tanh, atan, diff, sqrt, Piecewise, Max from autogenu import autogenu from utils import is_None_dict from TwoWDRobotState import ...
import tensorflow as tf import numpy as np from scipy import misc import model import utils import graph import os import time os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' from sklearn.model_selection import train_test_split from settings import * data, output_dimension, label = utils.get_dataset(location, picture_dimensi...
<filename>python/cugraph/tests/test_graph.py # Copyright (c) 2019, <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...
<gh_stars>1-10 #!/usr/bin/env python3 from timfuz import Benchmark, Ar_di2np, loadc_Ads_b, index_names, A_ds2np, simplify_rows, OrderedSet import numpy as np import glob import math import json import sympy from collections import OrderedDict from fractions import Fraction def rm_zero_cols(Ads, verbose=True): re...
<gh_stars>1-10 """ A class for Gaussian process experts with a squared exponential kernel, where each feature is assumed independent (product). We can optionally have a zero-mean, linear-mean, or constant-mean GP. Author: <NAME> Date: 27/02/2018 """ from __future__ import division import GPy import MixtureOfE...
import abc import tensorflow as tf import numpy as np from numpy.fft import fftshift, ifftshift import fractions import cv2 import os def tf_compl_exp(phase, dtype=tf.complex64, name='complex_exp'): """ Adapted from [Sitzmann et al. 2018] phase is NOT normalized and should range from -pi to pi """ ...
<gh_stars>0 # SUAVE Imports # Imports import SUAVE from SUAVE.Core import Units, Data from SUAVE.Components.Energy.Networks.Battery_Propeller import Battery_Propeller from SUAVE.Methods.Geometry.Two_Dimensional.Cross_Section.Airfoil.compute_airfoil_polars import compute_airfoi...
<filename>scipy/_lib/_numpy_compat.py """Functions copypasted from newer versions of numpy. """ from __future__ import division, print_function, absolute_import import warnings from warnings import WarningMessage import re from functools import wraps import numpy as np from scipy._lib._version import NumpyVersion ...
<reponame>SuriyaNitt/DDD import numpy as np import os import warnings warnings.filterwarnings("ignore") from sklearn.cross_validation import KFold from sklearn.metrics import log_loss import keras from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation, Flatten, Merge, Reshape, La...
<gh_stars>1-10 from __future__ import division import numpy as np from scipy import stats, interpolate class Distribution(object): """ draws samples from a one dimensional probability distribution, by means of inversion of a discrete inverstion of a cumulative density function the pdf can b...
import numpy as np import scipy.optimize as opt import scipy.spatial.distance as d import matplotlib.pyplot as plt ''' Fits data in positions.txt to a Gumbel, Logistic and Boltzmann distribution. Takes care of edge effects in data (i.e. truncates edge effects - the edge cases are NOT included in the analysis) ''' ...
<filename>pyradar/Chapter03/planar_array_example.py """ Project: RadarBook File: planar_array_example.py Created by: <NAME> On: 8/1/2018 Created with: PyCharm """ import sys from Chapter03.ui.PlanarArray_ui import Ui_MainWindow from Libs.antenna.array import planar_uniform from numpy import linspace, radians, degrees,...
<reponame>tdalford1/bilby_relative_binning<filename>bilby/core/sampler/ptemcee.py<gh_stars>0 from __future__ import absolute_import, division, print_function import os import datetime import copy import signal import sys import time import dill from collections import namedtuple import numpy as np import pandas as pd...
<gh_stars>1-10 from ptsemseg.models.xception39 import xception39 from ptsemseg.models.xception39 import bisenet from ptsemseg.models.xception39 import bisenet3D import numpy as np import torch from torch.autograd import Variable # bisenet_model = bisenet(num_classes=1000, pretrained=False) # bisenet_model.cuda() # xc...
<gh_stars>1-10 # coding: utf-8 # In[1]: #VOTING import nltk import random from nltk.corpus import movie_reviews from nltk.classify import ClassifierI from statistics import mode from nltk.tokenize import word_tokenize import pickle class VoteClassifier(ClassifierI): def __init__(self, *classifiers): se...
<filename>bqskit/ir/gates/parameterized/pauli.py """This module implements the PauliGate.""" from __future__ import annotations import os import numpy as np import scipy as sp from bqskit.ir.gates.qubitgate import QubitGate from bqskit.qis.pauli import PauliMatrices from bqskit.qis.unitary.differentiable import Diff...
import scipy.stats as st import pandas as pd # related to processing splitseq def get_bc1_matches(): # from spclass.py - barcodes and their well/primer type identity bc_file = '/Users/fairliereese/mortazavi_lab/bin/pacbio-splitpipe/barcodes/bc_8nt_v2.csv' bc_df = pd.read_csv(bc_file, index_col=0, names=['bc']) b...
<reponame>odemangeon/bayev<gh_stars>0 import numpy as np import scipy.linalg import scipy.stats import random import math def log_sum(log_summands): a = np.inf x = log_summands.copy() while a == np.inf or a == -np.inf or np.isnan(a): a = x[0] + np.log(1 + np.sum(np.exp(x[1:] - x[0]))) rand...
import cortex import glob from nilearn import surface from bids import BIDSLayout import os.path as op import re import pandas as pd import scipy.stats as ss derivatives = '/data/risk_precision/ds-numrisk/derivatives' layout_us = BIDSLayout(op.join(derivatives, 'glm_stim1_surf'), validate=False) layout_s = BIDSLayout...
# -*- coding: utf-8 -*- # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # License: BSD (3-clause) import numpy as np from scipy import linalg from ..io.pick import _pick_data_channels from ..surface import _normalize_vectors from ..utils import logger, verbose from .utils import _get_lims_cola def _svd_cov...
from __future__ import division import numpy as np import sys import os import shutil import vtk from vtk.util.numpy_support import vtk_to_numpy import matplotlib import matplotlib.pyplot as plt import matplotlib.image as mpimg import matplotlib.animation as animation import matplotlib.colors as mcolors import argparse...