text
string
from __future__ import absolute_import from __future__ import division from __future__ import print_function import networkx as networkx import numpy as numpy import scipy as scipy import scipy.integrate import pandas as pd from random import choices import matplotlib import matplotlib.pyplot as plt import matplotlib...
<filename>src/TIE_navigation/plan_manage/script/calc.py<gh_stars>1-10 import numpy as np import sympy as sp def calcInv(): dt = sp.symbols('dt') A = sp.Matrix([[1 / 6.0, 2 / 3.0, 1 / 6.0], [-1 / (2.0 * dt), 0, 1 / (2.0 * dt)], [1 / (dt * dt), -2 / (dt * dt), 1 / (dt * dt...
""" Semiclassical equations of motion """ __all__ = [ 'generate_eqm', 'eqm_to_semi_classical', 'sc_eqm_to_ode', 'sc_ode_to_matrix' ] from sympy import (Add, Mul, Pow, exp, Symbol, I, pi, simplify, oo, Function, Derivative, Eq, Matrix, MatMul, linear_eq_to_ma...
<filename>python/amici/petab_import.py """ Import a model in the PEtab (https://github.com/ICB-DCM/PEtab/) format into AMICI """ import argparse import logging import math import os import time from typing import List, Dict, Union, Optional import amici import libsbml import pandas as pd import petab from colorama im...
<filename>code_v1.0.6/cluster_byAccesson.py #!/usr/bin/python import warnings warnings.filterwarnings("ignore") # import os,numpy,pandas,random,time,copy from optparse import OptionParser import scipy.spatial.distance import scipy.io,scipy.sparse,scipy.stats from sklearn.decomposition import PCA from sklearn.manifold i...
# Author: vkaff # E-mail: <EMAIL> import numpy as np from scipy.stats import randint as sp_randint, expon, truncnorm #: Relative path to the test dataset. This value is used only when the *dtest* cmd argument is None. # test_dataset = 'datasets/dataset-string-similarity-test.txt' test_dataset = 'datasets/dataset-str...
import os import random import numpy as np from itertools import cycle from keras.utils.np_utils import to_categorical from keras.engine.training import generator_queue from SpectrogramGenerator import SpectrogramGenerator class DirectoryLoader(object): def __init__(self, source_directory, config, shuffle=True):...
<gh_stars>0 import numpy as np import numpy.random as npr import util_doucet as util from scipy.special import factorial class RBFN(object): def __init__(self, x, y, k, k_fixed=False, l=1, iota=0, \ nu_0=1, gamma_0=1, sig2 = None,\ alpha_del2=2, beta_del2=1, del2 = None,\ eps1=.1, eps2=.1): ''' x: N x d fe...
""" References: [1] <NAME> and <NAME>, Superposition of vortex cylinders for steady and unsteady simulation of rotors of finite tip-speed ratio - Wind Energy, 2014 [X] <NAME>, <NAME> - Cylindrical vortex wake model: right cylinder - Wind Energy, 2014 [X] <NAME>, <NAME> - Cylindrical vortex wake model: skew...
<filename>vossMap.py import requests def vossMap(s): def voss(s,c): return 1 if s == c else 0 Cn = [ voss(s,'C') for s in S ] Gn = [ voss(s,'G') for s in S ] An = [ voss(s,'A') for s in S ] Tn = [ voss(s,'T') for s in S ] return Cn, Gn, An, Tn SEQUENCES_URL = 'https://raw.githubuserc...
<filename>src/tasks/task5/5_3_meler_apply.py<gh_stars>0 import sys from typing import List, Callable, Protocol import pandas as pd import streamlit as st import seaborn as sns import sympy as sp from sympy.abc import x as x_symbol import matplotlib.pyplot as plt import numpy as np from numpy.polynomial import Polynomi...
import librosa import os import re import soundfile import numpy as np from scipy import signal from scipy import interpolate from scipy.io import wavfile class Audio: def __init__(self, audio_hparams): self.hps = audio_hparams def load_wav(self, path): return librosa.core.load...
from notebooks.profiles import BaseProfile import numpy as np from scipy.stats import norm # Note: Classes like this aren't going to completely follow Bayes rule or perfectly # calculate the normal PDF, because they don't have to. They just have to # calculate something proportional so that a good thresho...
import os import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import skimage.io import functools from skimage import measure from scipy.spatial import distance from sklearn.metrics import pairwise_distances_argmin_min from loguru import logger import numpy as np import matplotli...
<filename>html/team25ev/similarity_clustering/clusters_main.py import scipy.cluster.hierarchy as hcl from scipy.spatial.distance import squareform import pandas as pd import numpy as np from matplotlib import pyplot as plt from scipy.cluster.hierarchy import dendrogram import scipy import json def fancy_dendrogram(*ar...
<filename>DIP/fluo_beads_sim/fluorescent_beads.py # -*- coding: utf-8 -*- """ Experiments with simulation of images of fluorescent beads for evaluation of precision of their localization. In other words, for generationg ground truth data for tracking / segmentation evaluations. @author: ssklykov """ # %% General impor...
<reponame>machism0/non-bonded-periodic<filename>nbp/sysmodule.py<gh_stars>0 import numpy as np import scipy as sp import nbp from scipy.special import erfc class System: """This class represents the system itself: the box and its content. It's a wrapper containing SystemInfo and all the SystemStates, mostly...
<reponame>matthewtrotter/adaptive-asset-allocator-simulator from typing import Dict, List from assetuniverse import AssetUniverse import numpy as np import scipy.optimize as opt import pandas as pd class Subportfolio(object): def __init__(self, params: Dict, au: AssetUniverse, assets: pd.DataFrame, id: int, total_...
""" Name : c11_01_normal_density_function.py Book : Python for Finance (2nd ed.) Publisher: Packt Publishing Ltd. Author : <NAME> Date : 6/6/2017 email : <EMAIL> <EMAIL> """ import scipy.stats as stats from scipy import sqrt, exp,pi d1=stats.norm.pdf(0,0.1,0.05) print("...
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ...
<filename>machine-learning-ex3/ex3/oneVsAll.py import scipy.optimize as opt import lrCostFunction as lCF from sigmoid import * def one_vs_all(X, y, num_labels, lmd): # Some useful variables (m, n) = X.shape # You need to return the following variables correctly initial_theta = np.zeros(n + 1) all...
import copy import numpy as np import numpy.linalg as la from scipy.optimize import linprog # TODO: REMOVE from _errors import ConvergenceError # ====================================================================================================================== # Root-finding Methods # ================...
# System libs import os, csv, torch, numpy, scipy.io, PIL.Image, torchvision.transforms # Our libs from mit_semseg.models import ModelBuilder, SegmentationModule from mit_semseg.utils import colorEncode import cv2 import math from math import atan2, degrees import time def initialize(): colors = scipy.io.loadmat('...
import numpy as np from pyyeti import psd from nose.tools import * import scipy.signal as signal def test_get_freq_oct(): assert np.allclose( np.array(psd.get_freq_oct(1, [1, 5])), np.array( [ [1.0, 1.99526231, 3.98107171], [0.70794578, 1.41253754, 2.818...
<reponame>stevenmaclean94/Home-Assistant import mqttapi as mqtt import hassapi as hass import json import re import numpy as np from scipy.optimize import minimize from pykalman import KalmanFilter class RoomDetection(mqtt.Mqtt): def initialize(self): self.set_namespace("mqtt") self.hass = self.g...
import argparse import functools import io import librosa import librosa.display import matplotlib.pyplot as plt import numpy as np import os import scipy.io.wavfile as wavfile import sklearn import sys import torch import torch.utils.data from multiprocessing import Pool def to_mfcc(sig, rate, n_mfcc=13, n_fft=2048,...
<reponame>danibene/NeuroKit import numpy as np import pandas as pd import scipy.integrate from ..stats import density def entropy_power(signal, **kwargs): """**Entropy Power (PowEn)** The Shannon Entropy Power (PowEn or SEP) is a measure of the effective variance of a random vector. It is based on the e...
<reponame>turingbirds/howland_vccs # -*- coding: utf-8 -*- import matplotlib as mpl import matplotlib.font_manager as fm import matplotlib.ticker as plticker # mpl.rc('font', **{'family': 'serif', 'serif': ['Computer Modern']}) # mpl.rcParams["text.usetex"] = True # mpl.rcParams["text.latex.unicode"] = True #mpl.rcPar...
# -*- coding: utf-8 -*- """ Created on Sun Jan 21 15:39:49 2018 @author: ZMJ """ import numpy as np import time from scipy.ndimage import gaussian_filter from skimage.morphology import reconstruction ##ROF去噪 def denoise_rof(im, U_init, tolerance=0.1, tau=0.125, tv_weight=100): """ An implementation of ...
<reponame>WSWUP/MACA-ETr<filename>macaetr/maca.py # -*- coding: utf-8 -*- """ Python tools for downloading and using MACA downscaled and bias corrected climate data including the calculation of ASCE reference evapotranspiration. """ import pkg_resources import numpy as np import pandas as pd import refet import xarray...
<reponame>HackersForHarambe/Python-Repository import pygame import cmath import math as m from pygame import * from cmath import * import matplotlib as mat import numpy as np xmax = 20 ymax = 16 inter = 1 interx = 1 tmax = 10 intert = 10 j = sqrt(-1) WOUT_Last = [ 0, 0] def ln(x): try: return log(abs(...
<reponame>vishalbelsare/SocialMediaIE<gh_stars>10-100 import warnings from functools import partial import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from scipy import stats from sklearn import datasets from sklearn.feature_extraction.text import TfidfVectorizer from sklearn....
#!/usr/bin/env python """ Created on Tir 29 Oct 2013. Uses the Crank Nicolson scheme to solve the time dependent Schrodinger equation for a center potential spike (delta potential). Animation is done using the matplotlib.pyplot library. Usage: python CrankNicolsonPotentialSpike.py or equivalent: ./CrankNicol...
<reponame>damslab/reproducibility<filename>temp-uplift-submission/scikit-learn/adult_sk.py import sys import time import json import numpy as np import scipy as sp from scipy.sparse import csr_matrix import pandas as pd import math import warnings from sklearn.pipeline import make_pipeline from sklearn.compose import C...
<gh_stars>0 # -*- coding: utf-8 -*- """ Automated Tool for Optimized Modelling (ATOM) Author: Mavs Description: Module containing all available models. All classes must have the following structure: Name ---- Name of the model's class in camel case format. C...
<reponame>NengLu/topopy #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jan 24 09:42:34 2018 @author: vicen """ import sys sys.path.append("../../") from topopy import Flow, Grid import numpy as np from scipy.sparse import csc_matrix fd = Flow() fd.load_gtiff("../data/tunez_fd.tif") threshold = 1000...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Mar 14 18:25:54 2018 @author: paul """ import numpy as np import matplotlib.pyplot as plt from scipy.interpolate import griddata fs = 14 def plots(model): # ============================================================================= # h...
import argparse import pickle from collections import defaultdict from clustering_genomic_signatures.dbtools.get_signature_metadata import ( get_metadata_for, ) from scipy import stats from ete3 import NCBITaxa rank_dict = { 'species':'genus', 'superkingdom': None, 'class': None, '...
<gh_stars>1-10 """ Module for working with Bernstein polynomials. """ import numpy as np import sympy as sp import typing import vorpy.symbolic def bernstein_polynomial (t:typing.Any, *, degree:int, k:int) -> typing.Any: """ Returns the kth Bernstein polynomial of given degree in the given symbol. It's as...
<reponame>lovaulonze/paper.2D_dielectric<filename>src/gpaw_analysis/alpha_mass.py import ase.db import warnings import numpy import matplotlib.pyplot as plt from ase.data import covalent_radii from scipy.stats import linregress import os, os.path from scipy.constants import pi, epsilon_0 db_file = "../../data/gpaw_dat...
import numpy as np import scipy.sparse as sp from tophat.utils.sparse_utils import get_row_nz from tophat.sampling.utils import neg_samp_bsearch from typing import Sequence def sample_weighted(weights_cs: np.array, batch_size: int = 1, n_neg: int = 1): """Sample negatives uniformly over entire...
<reponame>Roald87/ev_forecast<filename>forecast.py import matplotlib.pyplot as plt import numpy as np from typing import TypeVar from scipy import optimize NumpyArray = TypeVar('numpy.ndarray') class Forecast(object): """ Model to forecast marketshare of a product with time. The model is from Nederlands Tij...
import pytest import numpy as np from scipy.optimize import check_grad from scipy.stats import ttest_rel from cblearn.datasets import make_random_triplets from cblearn.embedding._soe import SOE, _soe_loss def test_soe_repeat(): """ Test that the repeated initialization leads to stable results. """ n, d = 20,...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Mon Jun 11 12:50:13 2018 @author: madcas """ import math import numpy as np import h5py import matplotlib.pyplot as plt import scipy from PIL import Image from scipy import ndimage import tensorflow as tf from tensorflow.python.framework import ops from cn...
#!/usr/bin/env python3 import os import argparse import time import pandas as pd import numpy as np import matplotlib.pyplot as plt plt.style.use('clint.mpl') from pprint import pprint import scipy.signal as signal import itertools from pygama import DataSet import pygama.utils as pu import pygama.analysis.histograms ...
<filename>benchmark_gamut_map.py #!/usr/bin/env python3 """Benchmarks different optimization methods for gamut mapping.""" from functools import partial import time import numpy as np from scipy import optimize import cam try: import sys from IPython.core.ultratb import AutoFormattedTB sys.excepthook ...
import sys import os.path sys.path.insert(0, os.path.abspath("./simple-dnn")) #Import the libraries we will need. import tensorflow as tf import tensorflow.contrib.slim as slim import numpy as np from tensorflow.examples.tutorials.mnist import input_data import scipy.misc import scipy import scipy.io from sklearn impo...
<gh_stars>0 #import libraries import nibabel as nib import numpy as np import pylab as pl from scipy import stats import scipy import os import pandas as pd import csv from sklearn import linear_model #for regression analysis from sklearn.metrics import mean_squared_error, r2_score from sklearn.model_selection import...
# -*- coding: utf-8 -*- """ Created on Mon May 25 22:33:04 2020 @author: kkrao """ import pandas as pd from init import dir_data, lc_dict, color_dict import seaborn as sns import os import numpy as np import matplotlib.pyplot as plt from scipy.stats import mannwhitneyu, pearsonr from sklearn.ensemble import RandomFo...
import scipy.misc import plotload as pl import numpy as np import pygame, sys from PIL import Image import os """ Code inspired from: https://stackoverflow.com/questions/6136588/image-cropping-using-python/8696558 """ def _gui_displayImage(screen, px,brush,mask_array,startmouse,prior): # ensure that the rect alw...
<reponame>frostburn/frostsynth<filename>experiments/theta.py from __future__ import division from math import pi, exp, cosh, cos, log, floor from cmath import rect as from_polar, exp as cexp __author__ = "<NAME>" __copyright__ = "Copyright 2014, <NAME>" __credits__ = ["<NAME>"] __license__ = "MIT" __version__ = "1.0"...
<gh_stars>0 import sys from statistics import mean class StatPrinter(object): def __init__(self, exercise, file=sys.stdout): self.exercise = exercise self.file = file def print_stats(self, graph=True): avg_delay = mean(m.delay() for m in self.exercise.all()) avg_left_delay = ...
from scipy.stats import norm import random import numpy as np """ Given the current block index, return the corresponding position in SAVE method For example, for current_block_idx = (1,2), which means the first block of samples in second time block. it will return the start position of first block of samp...
#! /usr/bin/python # -*- coding: utf-8 -*- ########################################################################## # Fault Displacement Slip-Curve (FDSC) v1.0 # # # # Copyright (C) (2013-2014) <NAME> <EMAIL> ...
<gh_stars>0 from glob import glob import numpy as np import scipy.misc import os class LSUN(object): def __init__(self, path, cat=None): self.path = path self.train_images = np.empty((0)) self.train_label = None if cat: self.categories = cat else: se...
from scipy import misc import numpy as np from scipy import ndimage import matplotlib.pyplot as plt image = misc.imread('A_adding210',mode="L")#put your path and name of image # convert image into a array image = np.asarray(image) # put pixels in a 1D array by flattening out image array flat = image.flatten() # it sh...
from speakingfacespy.imtools import make_dir from imutils import paths import scipy.io.wavfile import argparse import cv2 import os def extract_frame(video_path, duration, path_to_image, sub_id, trial_id, pos_id, cmd_id, stream_id): # initialize the video stream and # pointer to output video file vs = c...
<reponame>pauxy-qmc/pauxy import numpy import pandas as pd import scipy.stats import scipy.optimize from pauxy.analysis.extraction import extract_data, set_info, get_metadata from pauxy.analysis.blocking import average_ratio def analyse_energy(files): sims = [] files = sorted(files) for f in files: ...
#!/usr/bin/env python # coding: utf-8 ## Generate HTML reports with D3 graphs using Python, Plotly, and Pandas # You can download the example report that this script generate from this link. # <a href="d3.js">d3.js</a> is an amazing JavaScript library for creating interactive, online graphics and charts. Plotly l...
<gh_stars>10-100 import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.path import numexpr as ne import scipy as sp import scipy.sparse plt.ion() import pybie2d """ Demonstrate how to use the pybie2d package to solve an interior/exterior Laplace problem on a complicated domain u...
<reponame>jtbuch/ml-fires<filename>notebooks/ml_utils.py<gh_stars>1-10 import numpy as np import pandas as pd #from time import clock from datetime import date, datetime, timedelta from cftime import num2date, date2num, DatetimeGregorian from tqdm import tqdm from copy import deepcopy #Import and write files import cs...
""" Script to help load EEG data files, separating files by class type """ import mne import glob import pandas import shutil import numpy as np import math import os import re from scipy import signal CWD = os.path.dirname(os.path.realpath(__file__)) class DataLoader(object): """ Data Loader class t...
### Importing dependencies # Gaussian sampler from sampler import samplerz # Gaussian sampler with repetitions from sampler_rep import samplerz_rep # Imports Falcon signature scheme from falcon import falcon # Estimators for moments from scipy.stats import skew, kurtosis, moment # Statistical (normality) t...
<filename>charts/charts/charts/base.py import math import statistics import time import traceback from operator import itemgetter from charts.orm.base import Base as ORMBase class Base: def __init__(self, create_db_connection, data, publisher, logger): self.logger = logger self.create_db_connectio...
#!/usr/bin/env python ''' qvalue: A python port of the qvalue package for R ''' __author__ = "<NAME>" __copyright__ = "Copyright 2011" __credits__ = ["<NAME>", "<NAME>"] __license__ = "FreeBSD" __version__ = "0.2" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" try: from scipy import interpolate from scipy.i...
import numpy from scipy.ndimage import convolve from skimage.data import camera from skimage.util import random_noise from dexp.processing.filters.fft_convolve import fft_convolve from dexp.utils.backends import Backend, CupyBackend, NumpyBackend def demo_fft_convolve_numpy(): with NumpyBackend(): _demo_...
import numpy as np import os, sys, time, shutil, tempfile from tqdm import trange, tqdm from urllib.request import urlopen from urllib.parse import urlparse import tempfile from scipy.ndimage import median_filter import cv2 from mxnet import gluon, nd from mxnet.gluon import nn import mxnet as mx from . import trans...
# This program creates FIR filter signals from the the recordings in folder # "recordings". # Main libraries import numpy as np from scipy.io import wavfile # System libraries import os import sys def exit(): print(50*'-') sys.exit() # Plotting libraries and settings import matplotlib.pyplot as plt import s...
# Test QP solver against Maros Mezaros Benchmark suite import numpy as np import numpy.linalg as la import scipy.io as spio import osqppurepy import matplotlib.pyplot as plt # Get data f = '../../../../extra/difficult_problems/data/polish_fail.mat' m = spio.loadmat(f) P = m['P'] A = m['A'] q = m['q'].T.flatten() l = m...
#!/usr/bin/python import re import os import sys import scipy import argparse from HTMLParser import HTMLParser from nltk.tokenize.treebank import TreebankWordTokenizer from nltk.tokenize.punkt import PunktSentenceTokenizer from nltk.tag.stanford import StanfordTagger from nltk.stem.snowball import SnowballStemmer de...
import os import h5py import matplotlib.pyplot as plt import numpy as np from scipy import signal from scipy.fft import irfft, rfft, rfftfreq from scipy.interpolate import interp1d import tensorflow as tf from . import gw_utils as gwu class GwTimeseries: def __init__(self, ts, freq, epoch=0, name=''): se...
import pickle from pathlib import Path from typing import List, Union from nptyping import Array from scipy.sparse import lil_matrix from Node import Node class Graph: def __init__(self, nodes: Array[Node]): assert isinstance(nodes, Array[Node]) self.__set_node_ids(nodes) self.__nodes =...
<reponame>annawzz/barbecue<gh_stars>0 # -*- coding: utf-8 -*- from fractions import Fraction def vnmax(features): return sum([max([j['value'] for j in i['enum']]) for i in features]) def calculate_coeficient(features, parameters): vmax = Fraction(vnmax(features)) vn = sum([Fraction(i['value']) for i in...
<filename>pp_sketch/__main__.py # Copyright 2019-2020 <NAME> '''Wrapper around sketch functions''' import os, sys import numpy as np from scipy.sparse import save_npz import pickle import h5py import pp_sketchlib from .matrix import ijv_to_coo from .__init__ import __version__ def iterDistRows(refSeqs, querySeqs...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Feb 17 10:06:36 2021 @author: patrice """ import numpy as np import glob import seaborn as sns import statistics import matplotlib.pyplot as plt import os ScorePath1 = '/media/patrice/DataDrive/SEE_ICE/FullData_Revision/Jak_VGG16_joint_50_RGBNIR_fp16...
# # Copyright (c) 2017, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This program is distributed in the hope it will be useful, but WITHOUT...
import sys,time,datetime,copy,subprocess,itertools,pickle,warnings import numpy as np import scipy as sp import pandas as pd from matplotlib import pyplot as plt import matplotlib as mpl class Data_Fin(pd.core.frame.DataFrame): _metadata = ['t','dt'] @property def _constructor(self): ret...
import numpy import scipy.interpolate def nearest_index(array, value): """ Returns the index from array that is less than the value specified. """ array = numpy.asarray(array) idx = (numpy.abs(array - value)).argmin() return idx def find_nearest(array, value): """ Returns the value fro...
import cv2 import os from scipy.io import loadmat import os.path as osp import numpy as np import json from PIL import Image import pickle import re import sys #from numba import jit from sklearn.metrics import average_precision_score from sklearn.preprocessing import normalize from iou_utils import get_max_iou def ...
#!/usr/bin/env python # Copyright 2014-2019 The PySCF Developers. All Rights Reserved. # # 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 # # U...
from numpy.testing import * import numpy.core.umath as ncu import numpy as np import nose from numpy import inf, nan, pi class TestDivision(TestCase): def test_division_int(self): # int division should return the floor of the result, a la Python x = np.array([5, 10, 90, 100, -5, -10, -90, -100, -12...
<reponame>tomwhite/anndata<filename>anndata/tests/readwrite.py from importlib.util import find_spec from pathlib import Path import numpy as np import pandas as pd import pytest from scipy.sparse import csr_matrix import anndata as ad HERE = Path(__file__).parent # -------------------------------------------------...
<reponame>Clinical-Genomics/scout import datetime import logging import re from fractions import Fraction from glob import glob from pathlib import Path from pprint import pprint as pp from ped_parser import FamilyParser from scout.constants import PHENOTYPE_MAP, SEX_MAP from scout.exceptions import PedigreeError fro...
<filename>zippy/benchmarks/src/benchmarks/sympy/sympy/printing/jscode.py """ Javascript code printer The JavascriptCodePrinter converts single sympy expressions into single Javascript expressions, using the functions defined in the Javascript Math object where possible. """ from __future__ import print_function, div...
import numpy as np import torch import torch.nn as nn from scipy import linalg from tqdm import tqdm from basicsr.archs.inception import InceptionV3 def load_patched_inception_v3(device='cuda', resize_input=True, normalize_input=False): # we may not res...
import argparse import functools import json import logging import numpy as np import os import random from overrides import overrides from scipy.stats import kendalltau, pearsonr, spearmanr from typing import Dict, List, Tuple, Union from sacrerouge.commands import RootSubcommand from sacrerouge.commands.correlate im...
<filename>src/generative_model/metrics.py """Calculates the Frechet Inception Distance (FID) to evalulate GANs The FID metric calculates the distance between two distributions of images. Typically, we have summary statistics (mean & covariance matrix) of one of these distributions, while the 2nd distribution is given b...
<reponame>Tapot/evidently #!/usr/bin/env python # coding: utf-8 import json from typing import Optional import pandas as pd import numpy as np from scipy.stats import probplot import plotly.graph_objs as go from evidently import ColumnMapping from evidently.analyzers.regression_performance_analyzer import Regressio...
<gh_stars>0 from glia import libglia from feat_extr import get_features from hed.run import Network import torch import params from pascal_voc_loader import pascalVOCLoader from loader import Loader import matplotlib.pyplot as plt from skimage import io, segmentation, color import numpy as np import os from os.path imp...
import numpy as np import time import torch from lietorch import SE3, LieGroupParameter from scipy.spatial.transform import Rotation as R import cv2 import configargparse import os, sys sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) from utils import * from render_utils i...
<gh_stars>1-10 import os import re import gzip import json from collections import defaultdict from itertools import groupby from subprocess import run import numpy as np import pandas as pd import pysam from scipy.sparse import coo_matrix from scipy.io import mmwrite def read_gtf(gtf): gene_table = [] mt_rege...
from __future__ import absolute_import from __future__ import print_function import autograd.numpy as np from autograd import value_and_grad from scipy.optimize import minimize import matplotlib.pyplot as plt import os from six.moves import range rows, cols = 40, 60 # Fluid simulation code based on # "Real-Time Flu...
#! /usr/bin/env python # # Author: <NAME> # Date: April 17, 2008 # # Copyright (C) 2008 <NAME> # # 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 # ...
import numpy as np from scipy.stats import rankdata from functools import partial from nptyping import Array from sklearn.metrics import pairwise_distances from sklearn.base import BaseEstimator, TransformerMixin class BoostedSURF(BaseEstimator, TransformerMixin): """sklearn compatible implementation of the boost...
from __future__ import print_function, division import copy from collections import defaultdict from sympy.core.containers import Dict from sympy.core.compatibility import is_sequence, as_int, range from sympy.core.logic import fuzzy_and from sympy.core.singleton import S from sympy.functions.elementary.miscellaneous...
import unittest import numpy try: import scipy.sparse scipy_available = True except ImportError: scipy_available = False import cupy import cupy.sparse from cupy import testing def _make(xp, sp, dtype): data = xp.array([0, 1, 2, 3], dtype) row = xp.array([0, 0, 1, 2], 'i') col = xp.array([0,...
<gh_stars>0 #!/usr/bin/env spcli # <NAME> <<EMAIL>> # # create an He file with the following format: # dHe He POP1 POP2 POP3 ... from seqpy import cout, cerr from seqpy.cmds import arg_parser from seqpy.core.bioio import tabparser import allel import numpy as np import scipy.spatial def init_argparser(p=None): ...
<reponame>wangyusu/pymatgen # coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module provides classes for non-standard space-group settings """ import re from fractions import Fraction from typing import List, Tuple, Union import numpy as np from p...
import numpy as np from numba import njit import scipy.sparse as sp import scipy.linalg as spl import tensorflow as tf from graphgallery import functional as gf from graphgallery.attack.targeted import Common from graphgallery.attack.utils.estimate_utils import ( estimate_loss_with_delta_eigenvals, estimate_l...
import numpy as np from scipy.stats.distributions import chi2 from abc import ABC, abstractmethod class NoiseObject(ABC): def __init__(self, **kwargs): self.arguments = kwargs super().__init__() @abstractmethod def calc(self, raw_data): pass class CalculateGaussia...