text
string
import os import csv import math import random from scipy import ndimage #allows to import image as RGB instead of CV2's BGR import numpy as np #because keras needs images as numpy arrays from matplotlib import pyplot as plt from PIL import Image import cv2 # This function gathers sets of images and corresponding stee...
import numpy as np from scipy import sparse from scipy.sparse.linalg import lobpcg import torch import torch.nn as nn import torch.nn.functional as F from torch_sparse import spmm from torch_geometric.utils import get_laplacian import torch_geometric.transforms as T # from ogb.nodeproppred import PygNodePropPredDataset...
<filename>hmc/solvers.py """Solvers for non-linear systems of equations for implicit integrators.""" from hmc.errors import ConvergenceError import numpy as np import scipy.linalg as sla def euclidean_norm(vct): """Calculate the Euclidean (L-2) norm of a vector.""" return np.sum(vct**2)**0.5 def maximum_no...
from __future__ import absolute_import,print_function from . import _ground_truth as __ground_truth from ._ground_truth import * import numpy from scipy import ndimage as ndi __all__ = [] for key in __ground_truth.__dict__.keys(): __all__.append(key) try: __ground_truth.__dict__[key].__module__='nift...
<gh_stars>0 import argparse import glob import os import sys import numpy as np import scipy.ndimage.measurements as measurements import scipy.ndimage.morphology as morphology import torch import torch.nn as nn import torch.optim from torch.utils.data import DataLoader from util.util import enumerateWithEstimate fr...
# Copyright (c) 2011, <NAME> [see LICENSE.txt] # This software is funded in part by NIH Grant P20 RR016454. # Python 2 to 3 workarounds import sys if sys.version_info[0] == 2: _strobj = str _xrange = xrange elif sys.version_info[0] == 3: _strobj = str _xrange = range import collections import csv im...
#!/usr/bin/env python3 import argparse from pathlib import Path parser = argparse.ArgumentParser( description="Run the watershed algorithm to produce segmented regions in an orthomosaic. Or run watershed with multiple overlapping segmented regions." ) parser.add_argument( "ortho", help="the path to the orthomo...
<gh_stars>0 import numpy as np import os.path import scipy import argparse import scipy.io as sio import matplotlib import matplotlib.colors as colors import matplotlib.cm as cmx import matplotlib.pyplot as plt import sys import cv2 as cv from skimage import data,filters,segmentation,measure,morphology,color...
<reponame>Silenc3IsGold3n/RS3GEPredictionModel import time import sqlite3 import pandas as pd import numpy as np import scipy as sp from scipy import stats import matplotlib.mlab as mlab import matplotlib.pyplot as plt traindataframes = [] testDataFrame = [] #this defines how many items we are looking at #max = 20 pr...
<reponame>RichardScottOZ/geoapps import numpy as np from scipy.interpolate import LinearNDInterpolator import matplotlib.pyplot as plt from scipy.interpolate import griddata from scipy.spatial import cKDTree from scipy.interpolate.interpnd import _ndim_coords_from_arrays from matplotlib.colors import LightSource, Norma...
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Tuesday 12 Dec 23:39:53 2017 @author: <NAME> & <NAME> """ # Import libralies import csv import serial import time import matplotlib.pyplot as plt from scipy import signal from scipy import stats import seaborn as sns import numpy as np import smtplib from email.MIM...
<filename>mmd/utils/davidson.py import numpy as np import scipy def davidson(A,roots,tol=1e-8): mat_dim = A.shape[0] sub_dim = 4*roots V = np.eye(mat_dim,sub_dim) converged = False while not converged: # subspace S = np.dot(V.T,np.dot(A,V)) # diag subspace E,C =...
# IMPORTS import itertools as it from typing import Union import numpy as np import openpyxl as xl import os import pandas as pd import scipy.interpolate as si import scipy.linalg as sl import scipy.signal as ss import sympy as sy import time # CLASSES class LinearRegression: """ Obtain the regression coef...
<gh_stars>1-10 import os import glob import pickle import re import pymc import ConfigParser config = ConfigParser.RawConfigParser() # Our numerical workhorses import numpy as np import pandas as pd import scipy # Import the project utils import sys sys.path.insert(0, '../') import NB_sortseq_utils as utils # Impor...
<filename>play.py<gh_stars>1-10 from numpy import * from scipy import fft from scipy.io.wavfile import write import os output_file = "test.wav" samples_per_sec = 44100 time = 1.5 # s samples_total = samples_per_sec*time t = linspace(0, time, samples_total) def tone(f): omega = 2*pi*f # RAD/s signal = exp(-0....
""" Test Cython optimize zeros API functions: ``bisect``, ``ridder``, ``brenth``, and ``brentq``, in `scipy.optimize.cython_optimize`, by finding the roots of a 3rd order polynomial given a sequence of constant terms, ``a0``, and fixed 1st, 2nd, and 3rd order terms in ``args``. .. math:: f(x, a0, args) = ((args[...
<gh_stars>0 # function that makes last pre-process step to images, preparing data for training the CNNs import numpy as np import tensorflow as tf import cv2 from scipy.fftpack import dct class custom_image_normalizer(): def normalize(self, local_image_rgb): local_image_rgb = cv2.cvtColor(local_image_rgb...
<filename>comancpipeline/Analysis/AstroCalibration.py import concurrent.futures import numpy as np from comancpipeline.Analysis import BaseClasses from comancpipeline.Analysis import Calibration from comancpipeline.Tools import WCS, Coordinates, Filtering, Fitting, Types, ffuncs, binFuncs, stats, CaliModels from scipy...
<reponame>nykabhishek/motion-planning import networkx as nx import numpy as np import matplotlib.pyplot as plt from scipy.spatial import distance_matrix import time from itertools import chain from tsp_heuristics.christofides import Christofides def frederickson(adj_matrix, vehicles, depot): tsp_tour, tsp_nodes, t...
import scipy.misc as scimisc from tkinter import * from PIL import Image from PIL import ImageTk import MalmoPython import os import sys import time import random import json import numpy as np import time import gym import gym_minecraft from gym.wrappers import Monitor class MinecraftWrapper(gym.Wrapper): def...
<reponame>vr25/long_doc<gh_stars>0 from scipy.sparse import csr_matrix import collections from sklearn.metrics import mean_squared_error, r2_score, mean_absolute_error from sklearn.model_selection import train_test_split, cross_val_score, cross_val_predict from sklearn import metrics from multiscorer import MultiScorer...
import os import numpy as np import pandas as pd import random from glob import glob from scipy.io import wavfile from scipy.signal import stft from sklearn.model_selection import train_test_split from keras.utils import to_categorical class DatasetGenerator(): def __init__(self, label_set, ...
import numpy as np from scipy.special import loggamma, gammaln, gamma from matplotlib import pyplot as plt from scipy.optimize import minimize from scipy.optimize import root from mpl_toolkits import mplot3d np.seterr(divide = 'raise') logmoments = np.load("logmoments_Harmonic_4.npy") moments = np.load("momen...
<gh_stars>1-10 # -*- coding: utf-8 -*- """ <NAME> @ 2017 Implements a simulation of a titration, for a system of two main components, N species and N-1 equilibrium constants. Some species (composed usually of a combination of a metal (M) and of a ligand (L), with a given UV-VIS spectrum) are contained in a flask. Mor...
<gh_stars>0 ####################################################################### # Copyright (C) 2016 <NAME> (<EMAIL>) # # Permission given to modify the code as long as you keep this # # declaration at the top # #################################################...
from numpy import pi import numpy as np import math #from sympy import Matrix import pylab #import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D #from scipy.interpolate import Rbf import pickle from scipy.sparse import csr_matrix from scipy.sparse import lil_matrix from scipy.sparse.linalg import sps...
<reponame>amikey/audio_scripts #!/Users/tkirke/anaconda/bin/python # -*- coding: utf-8 -*- import re,sys,os from math import sqrt,log,pi,sin,cos,atan2,floor import cmath from scipy import signal,fft import numpy # Quinn's method in # <NAME>, "Estimating Frequency by Interpolation Using Fourier # Coefficients," IEEE T...
<filename>src/lib/regression.py<gh_stars>0 #!/usr/bin/env python3 import numpy as np import scipy.linalg import numba as nb import copy as cp try: import lib.metrics as metrics except ModuleNotFoundError: import metrics __all__ = ["OLSRegression", "RidgeRegression", "LassoRegression"] @nb.jit(nopython=Tru...
#%% """ Created on July 05 2021 The Heston-Hull-White model and pricing European Options with Monte Carlo and the COS method This code is purely educational and comes from "Financial Engineering" course by <NAME> The course is based on the book “Mathematical Modeling and Computation in Finance: With Exercises ...
<filename>results.py from collections import defaultdict import matplotlib.pyplot as plt import numpy as np import pandas as pd from scipy.stats import hypergeom from sklearn.metrics import roc_auc_score, roc_curve from statsmodels.nonparametric.smoothers_lowess import lowess GROUP_NAMES = { 'Group_I_Introns': 'G...
import argparse import collections import sys import math import cPickle as pickle from StringIO import StringIO import scipy import scipy.stats import sexpdata import matplotlib import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib.backends import backend_pdf from sklearn.neural_net...
#! /usr/bin/env python # Write a CSV with meta data for each patch. #### ---- Imports & Dependencies ---- #### import sys import os import argparse import csv from configparser import ConfigParser import pathlib from glob import glob from random import shuffle import SimpleITK as sitk # pip install SimpleITK from tqd...
<gh_stars>0 import unittest from scipy import stats from src.simulation import * # do not change, resources were generated using this values POPULATION_SIZE = 100000 FREQ_A1 = 0.8 FREQ_B1 = 0.3 D = 0.01 BETA_A = 0.3 BETA_B = 0.2 class TestSimulations(unittest.TestCase): def test_get_haplotypes_probabilities(se...
from __future__ import absolute_import, print_function import os import sys import numpy as np from scipy import ndimage sys.path.append('./') import nibabel import random import SimpleITK as sitk import pdb def border_map(binary_img,neigh): """ Creates the border for a 3D image """ binary_map = np.asar...
import numpy as np import tensorflow as tf from scipy import sparse as sp from tensorflow.python.ops import gen_sparse_ops from . import ops def sp_matrix_to_sp_tensor(x): """ Converts a Scipy sparse matrix to a SparseTensor. :param x: a Scipy sparse matrix. :return: a SparseTensor. """ if le...
from sympy import * import math def fixed_point_iter(phi, x_0, max_steps=25, verbose=False): """不动点迭代 Args: phi: function, 迭代函数 x_0: float, 初值 max_steps: int, 最大迭代次数 verbose: bool, 打印出每一步的值,default False. Returns: x_final: float, 最终的近似根 x """ x = x_0 ...
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import gdal import numpy as np import geodepy.Height_filenames as Height_filenames from scipy.interpolate import griddata def mean_normal_grav(Lat,h): # GRS 80 constants a=6378137 b=6356752.3141 omega=7292115...
#!/usr/bin/env python # -*- coding: utf-8 -*- # MIT License <https://opensource.org/licenses/MIT> # # Copyright (C) 2018 <NAME>. # Copyright (C) 2017-2018 -- mrJean1 at Gmail dot com # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (...
<filename>lab/experimental_sweeps/sweep_open_classification.py<gh_stars>10-100 # Imports import os import warnings import tensorflow as tf import wandb from wandb.keras import WandbCallback import sklearn import numpy as np from sklearn.metrics import confusion_matrix, precision_recall_fscore_support from tensorflow.ke...
<reponame>damaha/iasi-atmosphere<gh_stars>0 import matplotlib import matplotlib.pyplot as plt import numpy as np from scipy.signal import convolve2d import scipy.sparse.linalg as ssl from mpl_toolkits.basemap import Basemap, cm def pccs(x, n_comps = "all"): if n_comps == "all": n_comps = x.shape[0]-1 ...
<gh_stars>1-10 # Load library dependencies import numpy as np import numpy.linalg import scipy as sp import scipy.optimize import scipy.stats import pandas as pd # Import logit() command in ipt module since ipw_att() calls it from .logit import logit from .ols import ols # Define ipw_att() function #---------------...
<gh_stars>1-10 # -*- coding:UTF-8 -*- # recon data combine by built model import numpy as np np.random.seed(1337) # for reproducibility from sklearn.cross_validation import train_test_split from sklearn.metrics.regression import r2_score, mean_squared_error from sklearn.preprocessing import MinMaxScaler from sklearn....
import re import numpy as np import torch import torchvision import torch.nn as nn import torchvision.datasets as dset from torch.autograd import Variable from torch.utils.data import DataLoader, Dataset from hanja import hangul from scipy import signal from scipy.io import wavfile # 그저 one_hot ... def one_hot(i,...
import sys, os import time import cv2 import numpy as np import math from scipy.signal import convolve2d from scipy.ndimage import label,sum from scipy.misc import imrotate from matplotlib import pyplot as plt from skimage import morphology from skimage.segmentation import slic from bwmorph import bwmorph_thin from c...
<gh_stars>0 """ Generic dataset implementation for loading, filtering and matching cubes. """ import numpy import glob from scipy.spatial import cKDTree as KDTree from collections import defaultdict from . import utility def read_dataset(dataset_id, datatype, variable, location_name=None, depth=None,...
# Some helper functions import numpy as np import scipy.special from scipy.signal import butter, lfilter # Return real part of exponential integral, same as matlab expint() def expint(v): return np.real(-scipy.special.expi(-v)-np.pi*1j) # Circular shift of an array def circular_shift(x,t): return [x[t:len(x)...
import sys import pdb import scipy as sp def read_fasta(filename): """Reads a sequence in FASTA format from filename and stores it in a dictionary - one entry per contig""" genome = dict() for line in open(filename, 'r'): if line[0] == '>': if not is_first: geno...
<reponame>lf-shaw/operon<gh_stars>0 # SPDX-License-Identifier: MIT # SPDX-FileCopyrightText: Copyright 2019-2021 Heal Research import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from scipy import stats import random, time, sys, os, json import operon as Operon ds ...
<filename>malaya_speech/utils/aligner.py<gh_stars>0 import numpy as np from dataclasses import dataclass from malaya_speech.utils.char import CTC_VOCAB as labels def beta_binomial_prior_distribution(phoneme_count, mel_count, scaling_factor=1.0): from scipy.stats import betabinom x = np.arange(0, phoneme_coun...
from datetime import datetime from functools import reduce from numpy.lib.arraypad import _pad_dispatcher from numpy.testing._private.utils import build_err_msg import pandas as pd import numpy as np import sys import logging from dmyplant2.dEngine import Engine from dmyplant2.dMyplant import MyPlant, load_pkl, save_p...
<reponame>Francisco95/ImageSearch from scipy import spatial from .validator import validate_keys import numpy as np import time from .utils import paral_query, print_histo, parallel_query _VALID_KWARGS = {"k1": None, "k5": None, "k10": None, "min_dist_vec": None, "n": None, "MRR": None, ...
from pyitab.io.loader import DataLoader from pyitab.analysis.iterator import AnalysisIterator from pyitab.analysis.configurator import AnalysisConfigurator from pyitab.analysis.pipeline import AnalysisPipeline from pyitab.analysis.decoding.temporal_decoding import TemporalDecoding from sklearn.svm.classes import SVC fr...
<filename>flip_image.py import numpy as np from scipy import ndimage from PIL import Image name_in = 'figures/Right_center_lane_driving.jpg' center_image = ndimage.imread(name_in) center_image_mirror = np.fliplr(center_image) name_out = 'figures/Mirror_Right_center_lane_driving.jpg' im = Image.fromarray(center_image...
<gh_stars>0 from pathlib import Path import json import shutil import sys import numpy as np import scipy.io from .utils import ShellScript from .basesorter import get_job_kwargs from spikeinterface.extractors import KiloSortSortingExtractor, BinaryRecordingExtractor class KilosortBase: """ Shared class for...
import numpy as np from matplotlib import pyplot as plt import glob from matplotlib import patches as mpatches from scipy.interpolate import PchipInterpolator import scipy.ndimage plt.style.use("../template.mplstyle") # purple - green - darkgoldenrod - blue - red colors = ['purple', '#306B37', 'darkgoldenrod', '#3F7BB...
<gh_stars>1-10 ''' Runs the analysis on vector file ''' import numpy as np from numpy import mean from numpy import std import time import configparser import math from sklearn.decomposition import PCA from sklearn.neighbors import KNeighborsRegressor from sklearn.neighbors import RadiusNeighborsRegressor from sklearn...
# !/usr/bin/env python # -*- coding: utf-8 -*- """Core Classes and Functions. This file stores the core classes and functions for the MRBLEs Analysis module. """ # [File header] | Copy and edit for each file in this project! # title : core.py # description : MRBLEs - Core Functions # author ...
<gh_stars>0 import h5py import numpy as np import matplotlib.pyplot as plt from pathlib import Path import click from scipy.signal import decimate from datetime import datetime from scipy import signal import logging logging.basicConfig(format="%(levelname)s:%(message)s", level=logging.DEBUG) def downsample( da...
def test_sympy__physics__quantum__cartesian__PxKet(): from sympy.physics.quantum.cartesian import PxKet assert _test_args(PxKet(x, y)) # Hello world to a function related to quantum physics...
<gh_stars>0 """ Author: <NAME> Version 3: - Renamed to peak_plotter - Using Matlibplot for subplot plotting """ import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import pandas as pd from tkinter.filedialog import askopenfilename from tkinter.filedialog import asksaveasfile fr...
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from sklearn.decomposition import PCA import scipy.io as sio from scipy import sparse import time from CSMSSMTools import * def getDiffusionMap(K, neigs = 4, thresh=5e-4): """ Perform diffusion maps with a unit timestep,...
<gh_stars>0 from django.contrib.gis.geos import Point from functools import reduce import numpy as np from scipy.optimize import minimize, basinhopping from optimization.models import OptimizedBaseStation from optimization.taguchi import taguchi import random class OptimizeLocation(): @staticmethod def groupe...
<gh_stars>0 import numpy as np import scipy.stats as stats from . import squareLaw from utils.unit_conversions import lin_to_db, db_to_lin import prop def det_test(y1, y2, noise_var, num_samples, prob_fa): """ Apply cross-correlation to determine whether a signal (y2) is present or absent in the provided ...
# -*- coding: utf-8 -*- """ Created on Mon Jan 8 00:21:38 2018 @author: JAE """ from keras.layers import Input, merge, Activation from keras.layers import Conv2D, MaxPooling2D, UpSampling2D, Dropout from keras.models import Model from keras.optimizers import Adam from keras import backend as K import scipy.io import...
""" Programming Project 1 <NAME> 15863 """ import cmath as c from random import random import numpy as np N = 3 # Number of qubits psi = np.ndarray((2 ** N, 1), complex) # N-qubit register ''' # psi is computational basis state comp_state = 5 for i in range(2**N): if i == comp_state: psi[i] = 1 el...
<reponame>BorgwardtLab/networkGWAS<filename>LMM/util/stats/chi2mixture_sum.py ''' Adapted code from fastlmm implementation ''' from __future__ import absolute_import import scipy as sp import scipy.stats as st import scipy.special import numpy as np import pdb import logging from six.moves import range from IPython im...
# Copyright 2018 Xanadu Quantum Technologies Inc. # 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 law or agre...
<gh_stars>1-10 import numpy as np import time import numpy as np import matplotlib.pyplot as plt from scipy import sparse import osqp import copy from gym.envs.robotics.utils import reset_mocap2body_xpos import safe_rl.pg.run_agent def quadprog(H, f, A=None, b=None, initvals=None, verbose=False): ...
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Tue Oct 10 @author: jaehyuk """ import numpy as np from . import normal from . import bsm import scipy.integrate as spint import sys sys.path.insert(sys.path.index('') + 1, 'C:/Users/cherr/Documents/GitHub/PyFeng') import pyfeng as pf ''' MC model class for Beta=1 ...
<reponame>danhey/Bunyip<filename>bunyip/ebai/ebai.py # -*- coding: utf-8 -*- from __future__ import division, print_function from .knn import KNN from .geometry import solve_geometry, from_geometry import numpy as np import ellc from scipy import optimize import lightkurve as lk import matplotlib.pyplot as plt __all...
import numpy as np import scipy as sp import os.path as osp from flowdec import data as fd_data import cytokit from cytokit import config as cytokit_config def load_simulated_bars_experiment(blur=False, **kwargs): ref_img = fd_data.bars_25pct().data if blur else fd_data.bars_25pct().actual # Subset image to n...
<filename>figs/slice/slice.py import sys import os import matplotlib import matplotlib.pyplot as plt import numpy as np #import units as cgs from math import pi #from polytropes import monotrope, polytrope #from crust import SLyCrust #from eoslib import get_eos, glue_crust_and_core, eosLib #from scipy.integrate import ...
<reponame>stefanialvs/PyForecast import numpy as np from numpy.random import seed seed(1) import pandas as pd from math import sqrt from scipy.optimize import minimize from sklearn.base import BaseEstimator, RegressorMixin, clone from scipy.optimize import minimize ##################################################...
import numpy as np from python_utils.mathu import quat_identity, quat_mult, vector_quat, matrix_from_quat, rodmat from scipy.spatial.transform import Rotation as R def exp_quat(v): """ See "Practical Parameterization of Rotations Using the Exponential Map" - F. <NAME> Section 3 """ ang = np.linalg....
<gh_stars>1-10 # # Copyright © 2021 United States Government as represented by the Administrator # of the National Aeronautics and Space Administration. No copyright is claimed # in the United States under Title 17, U.S. Code. All Other Rights Reserved. # # SPDX-License-Identifier: NASA-1.3 # """Dorado sensitivity calc...
<reponame>MapsPy/MapsPy<filename>fitting/leastsqbound.py ''' Created on Nov 29, 2011 @author: <NAME>, 2nd Look Consulting http://www.2ndlookconsulting.com/ Copyright (c) 2013, <NAME>, Argonne National Laboratory All rights reserved. Redistribution and use in source and binary forms, with or without mo...
<gh_stars>10-100 from __future__ import print_function import os, sys, argparse, ast, time, pdb import numpy as np from PIL import Image from scipy.misc import imsave import torch from cirtorch.datasets.testdataset import configdataset from cirtorch.utils.general import get_data_root from cirtorchclone.imageretriev...
import warnings # Suppress warning errors from importing pandas with warnings.catch_warnings(): warnings.simplefilter("ignore") import pandas as pd # noqa: F401 see: https://github.com/ContinuumIO/anaconda-issues/issues/6678 import h5py # noqa: F401 import scipy # noqa: F401 from scipy import n...
from .units import dimension, dimension_name, SI_symbol, pg_units from .interfaces.astra import write_astra from .interfaces.opal import write_opal from .readers import particle_array from .writers import write_pmd_bunch, pmd_init from h5py import File import numpy as np import scipy.constants mass_of = {'electron'...
<gh_stars>0 import random from scipy.special import lambertw import numpy as np import torch import torch.utils.data def compute_constants(reg, nz, R=1, num_random_samples=100, seed=49): q = (1 / 2) + (R ** 2) / reg y = R ** 2 / (reg * nz) q = np.real((1 / 2) * np.exp(lambertw(y))) C = (2 * q) ** (nz ...
# !/usr/bin/env python """ Pose Detector Object for ROS """ import cv2 as cv import numpy as np import time import math import rospkg from scipy.ndimage.filters import gaussian_filter import os # import sys # caffe_root = '/home/asilva/caffe/python' # sys.path.append(caffe_root) import caffe ### Begin Config: param...
# # BSD 3-Clause License # # Copyright (c) 2020, <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...
<gh_stars>0 #!/usr/bin/env python from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter import json import os import shutil import anndata import numpy as np from sklearn.metrics import roc_auc_score, roc_curve from scipy.sparse import issparse from collections import defaultdict import scvi from scvi.da...
<filename>species/analysis/fit_model.py<gh_stars>0 """ Module with functionalities for fitting atmospheric model spectra. """ import os import math import warnings from typing import Optional, Union, List, Tuple, Dict from multiprocessing import Pool, cpu_count import emcee import numpy as np import spectres from s...
#! /usr/bin/env python # ======= # Imports # ======= from __future__ import print_function import sys from special_functions import besseli from scipy.special import i0, i1, iv, ivp from math import isnan, isinf, copysign import warnings warnings.filterwarnings( "ignore", message="invalid value encoun...
<reponame>sandeepdas05/lsm-crack-width import skfmm import numpy as np from scipy.ndimage import gaussian_filter1d as gf1d from skimage.measure import label from lsml.initializer.initializer_base import InitializerBase from lsml.initializer.provided.util import radii_from_mask as rfm class RayTrimInitializer(Initia...
""" Calculates growth and non-growth associated maintenance to fit a diverse data set. """ from tools import conf_model import pandas as pd import settings import numpy as np import seaborn as sns from scipy import stats import matplotlib.pyplot as plt plt.style.use('seaborn') def train(model, exclude_data_index=[]...
import itertools import random import matplotlib.pyplot as plt import numpy as np from scipy.optimize import curve_fit class FitClass: """ This class is used for sigma optimization via curve_fit. """ def __init__(self): self.mu = [] def multi_modal(self, *args): """ This...
""" This program builds a Markov Random Field model From there, the user can interactively segment an image It will allow them to see the foreground and background """ import matplotlib.pyplot as plt import numpy as np import maxflow from scipy.spatial import distance from selectpoints import select_k_points """ Cre...
import numpy as np from scipy.sparse import csr_matrix,csc_matrix # def build2(size): #how many coefficients ? nc= 5*(size-2)**2+ 16*(size-2)+ 12 row= np.empty((nc),dtype=int) col=np.empty((nc),dtype=int) v=np.empty((nc),dtype=float) h=1./(size-1) h2=h*h cd=-4/h2 hd=1./h2; I=lamb...
""" Python script for compute lower and upper bounds for the mnll and jsd metrics License: MIT License Copyright (c) 2020 Kundaje Lab Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"...
def pre_build_hook(build_ext, ext): from scipy._build_utils.compiler_helper import ( get_cxx_std_flag, has_flag, try_add_flag) cc = build_ext._cxx_compiler args = ext.extra_compile_args std_flag = get_cxx_std_flag(cc) if std_flag is not None: args.append(std_flag) if cc.compil...
<reponame>mwong009/iclv_rbm<gh_stars>1-10 ## File 01nestedEstimation.py ## Simple nested logit model for the Optima case study ## Wed May 10 10:55:12 2017 from biogeme import * from headers import * from loglikelihood import * from statistics import * from nested import * ### Three alternatives: # CAR: automobile # P...
import numpy as np import torch from torch.utils.data import Dataset import os import time import collections import random from DSB2017.layers import iou, nms from scipy.ndimage import zoom import warnings from scipy.ndimage.interpolation import rotate import pandas class DataBowl3Classifier(Dataset): def __init...
<reponame>DominicTanzillo/srcdl """ Copyright (c) 2020 CRISP Auxilary helper functions :author: <NAME> """ import os import sys PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..") sys.path.append(PATH) import numpy as np from scipy.io import loadmat from .evaluate import f...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Diagnostic script to calculate ECS following Gregory et al. (2004). Description ----------- Calculate the equilibrium climate sensitivity (ECS) using the regression method proposed by Gregory et al. (2004). Author ------ <NAME> (DLR, Germany) Project ------- CRESCENDO...
import sys import argparse import statistics as stat from config import * import os delay = 30 parser = argparse.ArgumentParser('Analysis Plots') parser.add_argument('--topo', type=str, required=True, help='what topology to generate summary for') parser.add_argument('--payment-graph-type', ...
<reponame>OneOneFour/ICSP_Monte_Carlo<filename>graphics.py import matplotlib # matplotlib.use("Agg") import pygame import sgc from sgc.locals import * import monte import numpy as np import time as tme from multiprocessing import Pool import os from abc import ABC, abstractmethod from datetime import datetime as dt i...
# Copyright (c) 2008-2011, <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 t...
<filename>examples/realistic_example/user.py ''' user.py This is where the datasets (X, y), the parameter-space and the objective function are defined. - X: the features for the data - y: the labels (targets) - objective: function that returns a list of scores (mean and standard deviation score will be ...