text
string
<reponame>ManishSahu53/Vector-Map-Generation-from-Aerial-Imagery-using-Deep-Learning-GeoSpatial-UNET """Post Processing of vector and Raster dataset""" import shapefile import numpy as np import os import cv2 from src import io import gdal import ogr import osr import config import logging # For Post Processing librar...
import numpy as np import scipy from scipy.stats import invgamma from base_model import * from output_format import * import math class NIGNormal(BaseModel): ''' Normal-inverse-Gamma_Normal model for Thompson Sampling. This model does not consider the context. ''' init_mu = 0 init_v = 1 in...
import os import json from collections import Counter, defaultdict import pandas as pd import networkx as nx import statistics import math from sklearn.metrics import cohen_kappa_score import seaborn as sns import pandas import matplotlib.pyplot as plt ANNOTATION_TASKS = ["participants", "subevents"] TASK_TO_INDEX ...
<gh_stars>100-1000 import os import re import argparse import codecs import cPickle import numpy as np import matplotlib as mpl from scipy.misc import imresize from multiprocessing import Pool import scipy.io as sio import cv2 import subprocess import shlex from log import logging from easydict import EasyDict as edict...
<reponame>Tuyki/mogp-decomposition<filename>experiments/Jester/jester.py """ Copyright 2021 Siemens AG Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limita...
<filename>experiments/sdr_document_ranking/method/aes.py<gh_stars>0 import math from six import iteritems from six.moves import xrange import numpy from numpy import dot import sys from numpy.linalg import norm from gensim.models import KeyedVectors from gensim.utils import simple_preprocess import scipy import scipy.s...
<reponame>kumagai-group/pydefect # -*- coding: utf-8 -*- # Copyright (c) 2020. Distributed under the terms of the MIT License. import string from dataclasses import dataclass, asdict from itertools import product from typing import Dict, Optional, Union, List, Set, Tuple import numpy as np import yaml from monty.json...
<reponame>StevenHuang2020/OpencvPython # python3 Steven segmentation test # import cv2 import numpy as np import argparse from ImageBase import binaryImage, loadImg, grayImg, autoThresholdValue from ImageBase import plotImg, thresHoldModel, cannyImg # from mainImageHist import plotImagAndHist, plotImgHist from mainImag...
<gh_stars>100-1000 from typing import Any, List import numpy as np import numpy.typing as npt from scipy.signal import savgol_filter from shapely.geometry import Polygon from nuplan.common.actor_state.agent import Agent from nuplan.common.actor_state.ego_state import EgoState from nuplan.common.actor_state.oriented_b...
import numpy as np import pandas as pd from scipy.stats import beta import deTiN.deTiN_utilities as du np.seterr(all='ignore') class model: """Model of tumor in normal (TiN) based on only candidate SSNVs. This estimate is most reliable when there are greater then 6 mutations and TiN is less then ~30%. Previ...
'''Utility functions for icnn. Author: <NAME> <<EMAIL>> ''' import numpy as np import PIL.Image import scipy.io as sio import scipy.ndimage as nd from scipy.misc import imresize def img_preprocess(img, img_mean=np.float32([104, 117, 123])): '''convert to Caffe's input image layout''' return np.float32(np.t...
"""Code to generate edge dislocations/singularities in lattices""" import numpy as np import dask.array as da import itertools as itert from skimage.feature import peak_local_max from scipy.interpolate import RectBivariateSpline from scipy.optimize import minimize from latticegen.transformations import ( rotate, ...
<filename>Test24_gan/test24_gan.py # -*- coding: utf-8 -*- import os import random import numpy as np import tensorflow as tf from PIL import Image # import cv2 import scipy.misc as misc #http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html CELEBA_DATE_DIR = '../../data/img_align_celeba' train_images = [] for image_filen...
<reponame>huangshenno1/project_euler from fractions import Fraction ex = [Fraction(0, 1)] * 1001 def expansion(n): if ex[n] > 0: return ex[n] if n == 0: ex[n] = Fraction(1, 1) else: ex[n] = 1 + 1 / (1 + expansion(n-1)) return ex[n] def valid(n): f = expansion(n) return len(str(f.numerator)) >...
""" calculates best erd/s and feeds it into REWB model: correlation of ERD/S with performance? later also correlation of BP and performance """ import numpy as np import sys import os.path import scipy from scipy.stats import zscore, iqr import csv import sklearn from sklearn.linear_model import LinearRegression import...
import numpy as np import pandas as pd from functools import reduce import scipy.ndimage.measurements as spm from regional import many as Many from regional import one as One from scipy.sparse import coo_matrix def stack_describe(stack): num_hybs = stack.shape[0] stats = [im_describe(stack[k, :]) for k in ran...
<filename>AutoXGBoost/gridSpec.py """A really stupid dumb uniform grid spec with only ranges/boxes available and separate messing with params in the spec and out of it""" from UniOpt.core.Spec import * import scipy.stats defaultGridSpec = { "colsample_bytree": HyperparamDefinition(float, scipy.stats.beta(a=10, b=1))...
import numpy as np from scipy.misc import imresize import gym import matplotlib.pyplot as plt def preprocess_frame(frame, v_crop=(0, 0), h_crop=(0, 0)): """ Preprocess image for faster computation Parameters ---------- frame : ndarray Color image, of shape (H,W,C) v_crop : tuple, opti...
import torch import torch.nn as nn import numpy as np import scipy from scipy import interpolate try: import matplotlib.pyplot as plt except Exception: plt = None class RandomSplineSCM(nn.Module): def __init__(self, input_noise=False, output_noise=True, span=6, num_anchors=10, order=3, ...
''' Static class dataset generator for inductive bias experiment Author: <NAME> ''' import numpy as np from scipy.stats import norm from scipy.stats import matrix_normal from tqdm import tqdm #compatible with jupyter after vscode update class DatasetGenerator: @staticmethod def generate_2d_rotation(theta=0,...
import os import numpy as np import scipy.io as scpio import tofu as tf _PATH_HERE = os.path.dirname(__file__) _PATH_INPUTS = os.path.dirname(_PATH_HERE) _PATH_SAVE = _PATH_INPUTS # ############################################################################# # ################################################...
<reponame>lwa19/dsc #!/usr/bin/env python __author__ = "<NAME>" __copyright__ = "Copyright 2016, Stephens lab" __email__ = "<EMAIL>" __license__ = "MIT" import sys, os, re, yaml, itertools, collections, sympy from itertools import cycle, chain, islice from fnmatch import fnmatch from difflib import SequenceMatcher fro...
<filename>tools.py import numpy as np import matplotlib.pyplot as plt from scipy.ndimage import gaussian_filter from numpy.lib import stride_tricks import matplotlib as mpl import socket import os import copy def sliding_window(im, win_height=128, win_width=64, x_stride=1, y_stride=1): """Returns a view win into ...
"""The Beta distribution.""" from equadratures.distributions.template import Distribution from equadratures.distributions.recurrence_utils import jacobi_recurrence_coefficients import numpy as np from scipy.special import erf, erfinv, gamma, beta, betainc, gammainc from scipy.stats import beta RECURRENCE_PDF_SAMPLES ...
<gh_stars>1-10 from __future__ import print_function, division, absolute_import, unicode_literals from builtins import bytes, dict, object, range, map, input#, str from future.utils import itervalues, viewitems, iteritems, listvalues, listitems from io import open import numpy as np import math import random from time...
<reponame>frejanordsiek/hdf5storage<filename>tests/test_matlab_compatibility.py # Copyright (c) 2014-2021, <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...
<gh_stars>1-10 # -*- coding: utf-8 -*- """ ====================== Laplacian segmentation ====================== This notebook implements the laplacian segmentation method of `McFee and Ellis, 2014 <http://bmcfee.github.io/papers/ismir2014_spectral.pdf>`_, with a couple of minor stability improvements. Throughout the ...
import time import cv2 as cv import numpy as np import math from libs.centroid_object_tracker import CentroidTracker from scipy.spatial import distance as dist from libs.loggers.loggers import Logger class Distancing: def __init__(self, config): self.config = config self.ui = None self.de...
<reponame>AntoineSIMTEK/NuMPI # # Copyright 2018, 2020 <NAME> # 2019 <NAME> # # ### MIT license # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including with...
import sklearn.datasets import scipy as sp all_data = sklearn.datasets.fetch_20newsgroups(subset="all") print("Number of total posts: %i" % len(all_data.filenames)) groups = [ 'comp.graphics', 'comp.os.ms-windows.misc', 'comp.sys.ibm.pc.hardware', 'comp.sys.mac.hardware', 'comp.windows.x', 'sci.spac...
<reponame>wangyifan717/UncertainSCI import numpy as np import scipy as sp from scipy import sparse as sprs from UncertainSCI.families import JacobiPolynomials, HermitePolynomials, LaguerrePolynomials from UncertainSCI.families import DiscreteChebyshevPolynomials from UncertainSCI.opolynd import TensorialPolynomials fr...
<filename>pysal/lib/io/iohandlers/mat.py import scipy.io as sio from .. import fileio from ...weights import W from ...weights.util import full, full2W __author__ = "<NAME> <<EMAIL>>" __all__ = ["MatIO"] class MatIO(fileio.FileIO): """ Opens, reads, and writes weights file objects in MATLAB Level 4-5 MAT for...
<gh_stars>1-10 import os import pandas as pd import numpy as np from genepy.utils import helper as h from genepy.utils import plot from genepy.epigenetics.chipseq import * import seaborn as sns import pyBigWig import matplotlib.pyplot as plt from scipy.optimize import minimize from scipy.special import factorial import...
# Question 01, Lab 07 # AB Satyaprakash - 180123062 # imports from math import sqrt, log, exp from scipy.stats import norm # functions def calEurCallPutPrices(T, K, S, r, σ, t): if(T == t): putp = max(K-S, 0) callp = max(S-K, 0) return [callp, putp] d1 = (log(S/K)+(r+(σ**2/2))*(T-t)...
<filename>simba/validate_model_on_single_video_copy.py<gh_stars>100-1000 import pickle from configparser import ConfigParser import os import pandas as pd import cv2 import numpy as np import matplotlib.pyplot as plt import imutils import subprocess from scipy import ndimage import warnings warnings.simplefilter(action...
<reponame>napoles-uach/streamlit_apps import streamlit as st import os import networkx as nx import matplotlib.pyplot as plt import pandas as pd import numpy as np import imageio from scipy.spatial.distance import cdist import random #st.title('Empty app :rocket:') # Put your Python+Streamlit code here ... # you can m...
#=============================================================================== # Copyright (c) 2012-2015, GPy authors (see AUTHORS.txt). # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Red...
<reponame>shibaji7/submarine_cable_modeling """ simulate_synB_synT.py: Module is used to implement Synthetic B-Field structures. """ __author__ = "<NAME>." __copyright__ = "" __credits__ = [] __license__ = "MIT" __version__ = "1.0." __maintainer__ = "<NAME>." __email__ = "<EMAIL>" __status__ = "Research" import n...
import numpy as np from scipy import interpolate, integrate class Signal: # Implements a signal that was sampled. def __init__(self, time, samples): if type(time) == list: time = np.array(time) if type(samples) == list: samples = np.array(samples) self.time = time self.samples = samples @property d...
<filename>nppac/clone_from_dataset_gp.py from gym.envs.mujoco import HalfCheetahEnv, HopperEnv, Walker2dEnv, AntEnv from rlkit.envs.wrappers import NormalizedBoxEnv import rlkit.torch.pytorch_util as ptu import torch import argparse import numpy as np import random import gpytorch import datetime import gym import m...
<reponame>ryanjdillon/smartmove ''' This module contains functions for generating individual plots for the smartmove paper, as well as a function to load the necessary data and call them all ''' from os.path import join as _join _linewidth = 0.5 def plot_sgls_tmbd(exps_all, path_plot=None, dpi=300): '''Plot percen...
<gh_stars>0 # from emuBot import from definintions import * import time class orderSet(list): def __sub__(self, y): x = self for a in y: if a in x: x.remove(a) return x class Reader(object): def __init__(self, filename): # Initialises the file to be ...
<gh_stars>0 import os import shutil import numericalunits as nu import pandas as pd from dddm import utils, exporter import warnings from scipy.interpolate import interp1d import numpy as np export, __all__ = exporter() @export class ShieldedSHM: """ class used to pass a halo model to the rate computation ba...
import numpy as np import matplotlib.pyplot as plt from tqdm import tqdm import cv2 import os import pickle import json from roipoly.roipoly import RoiPoly, MultiRoi import argparse import datetime import time from threading import Timer, Thread from OPTIMAS.utils.files_handling import images_list, read_fps, \ ...
import shutil, atexit, os, tempfile, logging import numpy as np import cv2 from scipy import ndimage import ray from src.focus_stack.utilities import Utilities import src.focus_stack.RayFunctions as RayFunctions # Setup logging log = logging.getLogger(__name__) class ImageHandler: image_storage = {} image_s...
""" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Make animations of rotating polytopes ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This script computes the data of a given polytope and writes it into a POV-Ray .inc file, then automatically calls POV-Ray to render the frames and calls FFmpeg to convert the frames to a mp4 movie. Yo...
import torchgeometry as tgm import torch.nn as nn import torch.nn.functional as F import torch import logging import datetime import os, json, sys import numpy as np from utils.Quaternions import Quaternions from utils.Pivots import Pivots import scipy.ndimage.filters as filters import copy device = torch.device("cud...
<reponame>4dnucleome/cog-abm import time from statistics import correct def timeit(fun, *args, **kwargs): start = time.time() ret = fun(*args, **kwargs) elapsed = time.time() - start return (ret, elapsed) def analyse_classifier(classifier, d_train, d_test): train_t = timeit(classifier.train, d_t...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Support functions for the sindy toolkit. Called by 'runToolkit.py', 'runToolkitExtended.py' and by 'plotSelectedIterations.py'. For the full procedure, see "README.md". For method details, please see "A toolkit for data-driven discovery of governing equations in h...
import numpy as np from GPy.kern import RBF from GPy.models import SparseGPRegression from hyperopt import fmin, hp, tpe from scipy.stats import spearmanr from sklearn import svm from sklearn.ensemble import ( GradientBoostingClassifier, GradientBoostingRegressor, RandomForestRegressor, ) from sklearn.linea...
#import cPickle as pickle import numpy as np import os from math import sqrt, ceil from random import randrange from scipy.misc import imread from sklearn.datasets import fetch_mldata def get_MNIST_data(num_training=50000, num_validation=10000, num_test=10000): """ Load the CIFAR-10 dataset from disk and perfo...
<reponame>fcoclavero/wordvectors __author__ = ["<NAME>"] __email__ = ["<EMAIL>"] __status__ = "Prototype" import sys from random import randrange import numpy as np from scipy.spatial.distance import cosine def random_insert(lst, item): """ Inserts an item into a list, at a random position. :param ls...
from .differentiation import Derivative, register from .utils import deriv, integ import numpy as np from numpy.linalg import inv from scipy import interpolate from scipy.special import legendre from sklearn.linear_model import Lasso @register("spectral") class Spectral(Derivative): def __init__(self, **kwargs):...
<reponame>zmlabe/ModelBiasesANN """ ANN for evaluating model biases, differences, and other thresholds using explainable AI for historical data for regional data Author : <NAME> Date : 7 June 2021 Version : 1 - adds extra class (#8), but tries the MMean """ ### Import packages import matplotlib.pyplot a...
<reponame>yifan-you-37/omnihang<gh_stars>1-10 from torch.utils.data import Dataset, DataLoader import os import json import sys import csv import itertools import numpy as np import pickle from scipy.spatial import KDTree, cKDTree BASE_DIR = os.path.dirname(os.path.abspath(__file__)) UTILS_DIR = os.path.abspath(os.pat...
import numpy as np from tabulate import tabulate import matplotlib.pyplot as plt from scipy.stats import chi2 from .core import * # Set the font size plt.rcParams.update({'font.size': 14}) class JointModel(ReadData, ModelFit, BaseFunc): def __init__(self, df, formula, poly_orders=(), optim_meth='defau...
<reponame>rutgerhartog/apocrypha from scipy.stats import chisquare as chi2 def calculate_chisquare(text: bytes) -> float: return chi2(text).statistics
<reponame>zozo123/tcrdist3 """ centers Module contains functions for evaluating TCRs as center(oids) of meta-clonotypes. find_center """ import warnings import numpy as np from tcrdist.ecdf import distance_ecdf def calc_radii(tr, tr_bkgd, chain = 'beta', ctrl_bkgd = 10**-5, use_sparse = True, max_radius=50, chunk...
<reponame>mbp28/determinantal-point-processes import numpy as np from scipy.linalg import orth def sample_dpp(vals, vecs, k=0, one_hot=False): """ This function expects Arguments: vals: NumPy 1D Array of Eigenvalues of Kernel Matrix vecs: Numpy 2D Array of Eigenvectors of Kernel Matrix ...
<reponame>rknop/amuse<filename>src/amuse/ic/_limepy/limepy.py # -*- coding: utf-8 -*- import numpy import scipy from numpy import exp, sqrt, pi, sin from scipy.interpolate import PiecewisePolynomial, interp1d from scipy.special import gamma, gammainc, dawsn, hyp1f1 from scipy.integrate import ode, quad, simps from mat...
#!/usr/bin/env python import numpy as np from scipy.optimize import fmin_cg from scipy.sparse.linalg import svds from sklearn.metrics.pairwise import pairwise_distances class ModelBasedRecommender(): def __init__(self, lambda_=0.1, n_features=20): self.lambda_ = lambda_ self.n_features = n_featur...
#!/usr/bin/env python # File: dataset_misr.py # Author: <NAME>, 5/7/13 # # Readers and plotters for MISR data sets # # Copyright 2013-2015, by the California Institute of Technology. ALL # RIGHTS RESERVED. United States Government Sponsorship # acknowledged. Any commercial use must be negotiated with the Office # of T...
# Project Quipu - data augmentation methods import scipy.signal as signal import numpy as np import Quipu.tools def addNoise(xs, std = 0.05): "Add gaussian noise" return xs + np.random.normal(0, std, xs.shape) def stretchDuration(xs, std = 0.1, probability = 0.5): """ Augment the length by re-samp...
from sklearn.cluster import KMeans from sklearn.neighbors import kneighbors_graph from scipy.spatial.distance import pdist, squareform from scipy.sparse.csgraph import laplacian import numpy as np """Args: X: input samples, array (num, dim) n_clusters: no. of clusters n_neighbours: neighborhood size ...
<reponame>andersx/fitmndod<gh_stars>0 #!/usr/bin/env python2 # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either in source code form or as a compiled # binary, for any purpose, commercial or no...
<gh_stars>0 #!/usr/bin/env python3 # # This file is part of https://github.com/martinruenz/maskfusion # # This program 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 ...
<reponame>chengyu0910/DeepFusion_IQA_V1.1 import scipy.io as sio import numpy as np import torch.nn as nn import torch from models.BCNN import BCNN #matlab文件名 class IQANet_trancated(nn.Module): def __init__(self, matfile): super(IQANet_trancated, self).__init__() # matfile = r"C:\Users\chengyu\De...
<gh_stars>0 from sympy import Rational as frac from ..helpers import book from ._helpers import QuadrilateralScheme, concat, symm_s, symm_s_t citation = book( authors=["<NAME>"], title="On quadrature and cubature", publisher="Cambridge University Press", year="1923", url="https://books.google.de/b...
<filename>jhfuncs/add_ellipse.py def add_ellipse(ax, scores, group, comp1 = 0, comp2 = 1, palette=None, alpha=0.95, **kwargs): """Add ellipses to a PCA ordination plot based on categorical variables. The indexes of scores and group must match. Parameters ---------- ax : matplotlib axes ...
<reponame>campovski/model-analysis-II<gh_stars>0 import os import numpy import matplotlib import matplotlib.pyplot as plt import scipy.integrate import scipy.constants def planetary_motion(y0, t0, t1, dt, G=1, M=1, a=1, omega=1): def system(t, ys): x = ys[0] y = ys[1] u = ys[2] v =...
from flerken.video.utils import apply_single from flerken.utils import BaseDict from torchtree import Directory_Tree from tqdm import tqdm from scipy.io.wavfile import read import sys from collections import deque import threading sys.path.append('/home/jfm/GitHub/OpenposeWrapper') from openpose_wrapper.co...
<filename>create_sound_files.py # -*- coding: utf-8 -*- """ Created on Thu Jan 31 08:40:33 2019 @author: Pertum # This code has the funcionality of create the sound files to the DSP test """ # includes import math import numpy as np from scipy import signal import pathlib import librosa # diretório de tra...
<filename>mlopt/tests/test_kkt_solver.py import unittest import cvxpy as cp from cvxpy.error import SolverError from mlopt.kkt import KKTSolver from mlopt.tests.settings import TEST_TOL as TOL from mlopt.strategy import Strategy import mlopt.settings as stg import numpy as np import numpy.testing as npt import scipy.sp...
import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pandas as pd from scipy.special import gamma as Gamma from scipy.integrate import quad G = 4.300918e-6 ## in units solar mass, km/s kpc GEV2cm5toMsol2kpc5 = 2.2482330e-07 GEVcm2toMsolkpc2 = 8.5358230e-15 def integrate_J_spherical_alphabe...
<reponame>Eagle517/io_scene_dts import os import bpy from colorsys import hsv_to_rgb from itertools import count from fractions import Fraction texture_extensions = ("png", "jpg") default_materials = { "black": (0, 0, 0, 255), "black25": (191, 191, 191, 255), "black50": (128, 128, 128, 255), "black75"...
<filename>singlecelltools/nonzero_wilcoxon.py from scipy import stats import numpy as np import pandas as pd from typing import Literal, Union, Iterable, Optional from statsmodels.stats.multitest import multipletests def nonzero_wilcoxon( adata, groupby: str, groups: Union[Literal['all'], Iterable[str]]...
#calculate the extinction between two bands #from Rieke & Lebofsky 1985 Table 3 import argparse parser=argparse.ArgumentParser( prog = 'CalcMIRExtinction', formatter_class=argparse.RawDescriptionHelpFormatter, description='''Calculate the MIR extinction and flux ratios between two wavelengths or bands based on Rie...
<filename>sfof/python/functions/kdtree.py ############################ # CLUSTER KDTREE FUNCTIONS # ############################ import numpy as np, scipy from scipy import spatial def make_kdtree(object_list): """ Function that returns a kd-tree of the provided object list. """ pos = [] for i...
<filename>baselines/neural_best_buddies/pyflow/poisson_image_editing.py """Poisson image editing. """ import numpy as np import cv2 import scipy.sparse from scipy.sparse.linalg import spsolve from os import path def laplacian_matrix(n, m): """Generate the Poisson matrix. Refer to: https://en.wikipedi...
<reponame>uchileFI3104B-2021A/informe-ejemplo ''' Este script resuelve la ecuacion (1) del documento enunciado.pdf. La idea es buscar el valor de a para el cual la integral toma un valor de 0.05. ''' import numpy as np import matplotlib.pyplot as plt from scipy.integrate import quad from scipy.optimize import newton ...
<filename>Drivers/ZI_MFLI_Lockin/criterion.py import os import math import time import pickle def get_pickle_filename(filename_helper): time_string = time.strftime('%Y-%m-%d_%H-%M-%S', time.localtime()) return os.path.join(os.path.dirname(__file__), 'data_{}{}.pickle'.format(time_string, filename_helper)) def...
<filename>move_points.py import numpy as np from tqdm import tqdm from sklearn.neighbors import KDTree from scipy.spatial import Voronoi from config import * from multiprocessing import Pool import os import traceback import time from matplotlib import pyplot as plt from matplotlib import collections as mc from sklear...
<reponame>wacky6/bilibili-live-tools from statistics import Statistics import printer import rafflehandler import utils import asyncio import struct import json import sys import aiohttp import zlib class BaseDanmu(): structer = struct.Struct('!I2H2I') def __init__(self, room_id, area_id): self.clien...
""" Functions to apply models. """ import glob import itertools import os import numpy as np import pandas as pd from pickle5 import pickle from scipy.special import softmax from sklearn.utils import shuffle from tqdm import tqdm def MAP_score(source_id, target_labels, prediction): """ Function to compute the M...
<gh_stars>0 import numpy as np from scipy.special import gamma from prml.rv.rv import RandomVariable np.seterr(all="ignore") class Beta(RandomVariable): """ Beta distribution p(mu|n_ones, n_zeros) = gamma(n_ones + n_zeros) * mu^(n_ones - 1) * (1 - mu)^(n_zeros - 1) / gamma(n_ones) / gamm...
<gh_stars>0 import xdesign from xdesign.propagation import * from xdesign.plot import * from xdesign.acquisition import Simulator import h5py from scipy.ndimage.interpolation import rotate import numpy as np import tensorflow as tf from tensorflow.contrib.image import rotate as tf_rotate import matplotlib.pyplot as plt...
from .base import Patient import numpy as np from scipy.integrate import ode import pandas as pd from collections import namedtuple import logging import pkg_resources logger = logging.getLogger(__name__) Action = namedtuple("patient_action", ['CHO', 'insulin']) Observation = namedtuple("observation", ['Gsub']) PATI...
<reponame>bataeves/kaggle<filename>instacart/imba/lgbm_cv.py import gc from concurrent.futures import ThreadPoolExecutor import pandas as pd import numpy as np import os import arboretum import lightgbm as lgb import json import sklearn.metrics from sklearn.metrics import f1_score, roc_auc_score from sklearn.model_sel...
import os import numpy as np import sys import cStringIO import re import scipy.io as sio import copy def cell2strtable(celltable, delim='\t'): ''' convert a cell table into a string table that can be printed nicely Parameters: celltable - array-like, ndarray with rows and columns in desired order...
#!/usr/bin/env python2.7 import sympy import z3 import numpy as np import scipy.optimize as op import argparse import sys, os import time import collections import subprocess import multiprocessing as mp import warnings import struct import cPickle as pickle sys.path.insert(0,os.path.join(os.getcwd(),"build/R_ulp")) i...
# -------------------------------------------------------------------------- # Source file provided under Apache License, Version 2.0, January 2004, # http://www.apache.org/licenses/ # (c) Copyright IBM Corp. 2015, 2016 # -------------------------------------------------------------------------- # gendoc: ignore impo...
<reponame>bu-bioinfo/workshops import pandas as pd import numpy as np import scanpy as sc from scipy import sparse def preprocess_cells(adata, min_cells, min_genes, pct_mito, n_hvgs): """ Preprocess and clean up scRNAseq data. params ------ adata : sc.AnnData dataset to clean min_cells...
<filename>datasetsnx/readers/voc.py<gh_stars>0 import os import ntpath import numpy as np from PIL import Image from addict import Dict from scipy.io import loadmat from .reader import Reader from .utils import read_image_paths try: import xml.etree.cElementTree as ET except ImportError: import xml.etree.Elemen...
<gh_stars>0 # Copyright (c) 2020 <NAME> & <NAME> # FEniCS Project # SPDX-License-Identifier: MIT import basix import numpy import pytest import sympy from .test_lagrange import sympy_lagrange def sympy_rt(celltype, n): x = sympy.Symbol("x") y = sympy.Symbol("y") z = sympy.Symbol("z") from sympy impo...
<gh_stars>10-100 ''' ################################################################################ # # SiEPIC-Tools # ################################################################################ Circuit simulations using Lumerical INTERCONNECT and a Compact Model Library - run_INTC: run INTERCONNECT using P...
"""The module for training ENAS.""" import contextlib import glob import math import os import numpy as np import scipy.signal from tensorboard import TensorBoard import torch from torch import nn import torch.nn.parallel from torch.autograd import Variable import models import utils logger = utils.get_logger() d...
# -*- coding: utf-8 -*- from __future__ import division, print_function __all__ = ["GP"] import warnings import numpy as np from scipy.linalg import LinAlgError from . import kernels from .solvers import TrivialSolver, BasicSolver from .modeling import ModelSet, ConstantModel from .utils import multivariate_gaussia...
import sys import pdb import scipy.stats as stats import scipy.special import pickle from rdatkit.settings import * from matplotlib.pylab import * import numpy as np from scipy import stats, optimize ########## patching scipy stats.distributions.vonmises.a = -np.pi stats.distributions.vonmises.b = np.pi def _fitst...
from basic import S, C from expr import Expr from sympify import _sympify, sympify from cache import cacheit from sympy.utilities.iterables import all # from add import Add /cyclic/ # from mul import Mul /cyclic/ # from function import Lambda, WildFunction /cyclic/ class AssocOp(Expr): """ Associative operati...
''' Created on Nov 27, 2017 @author: fan ''' import numpy as np import scipy.stats import pyfan.amto.array.mesh as mesh def three_vec_grids(vara_min, vara_max, vara_grid, vara_grid_add=None, varb_min=None, varb_max=None, varb_grid=None, varb_grid_add=None, varc_min=None, var...