text string |
|---|
<filename>kawin/Surrogate.py<gh_stars>1-10
import numpy as np
import pickle
from scipy.interpolate import Rbf
import scipy.spatial.distance as spd
def generateTrainingPoints(*arrays):
'''
Creates all combinations of inputted arrays
Used for creating training points in composition space for
Multicompone... |
#
# 《孫子算經》(https://zh.wikipedia.org/wiki/孫子算經)
# 今有雉、兔同籠,上有三十五頭,下九十四足。問雉、兔各幾何?
#
# <NAME> (https://en.wikipedia.org/wiki/Sunzi_Suanjing)
# There is a cage with a number of chickens and rabbits.
# There are 35 head and 94 feet.
# The question is how many chickens and rabbits are in the cage.
#
import sympy as sp
impor... |
<gh_stars>0
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
# src: https://www.kaggle.com/mchirico/linear-programming
# In[9]:
import matplotlib.pyplot as plt
# In[1]:
# scipy.linprog
# https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.linprog.html
# In[2]:
# Consider the following prob... |
<gh_stars>1-10
import torch
import numpy as np
def atomic_orbital_norm(basis):
"""Comptues the norm of a given function
Arguments:
basis {namespace} -- basis namespace
"""
# spherical
if basis.harmonics_type == 'sph':
if basis.radial_type == 'sto':
return norm_slater... |
from logic.helpers import *
import pandas as pd
from sklearn import svm, preprocessing
from scipy.stats import mode
from sklearn.model_selection import cross_validate
CLASS_LABEL = "class_label"
TIMESTAMP = "timestamp"
GROUP_INDEX = "group_index"
class ClassificationManager:
def __init__(self, windowSize=20):
... |
<filename>DigitalImageProcessing/python/prewitt_operator.py
#!/usr/bin/env python3
# encoding: utf-8
"""
@Funciton: Prewitt Operator(Algorithm) —— 可分离卷积核
Prewitt算子均是可分离的,为了减少耗时,
在代码实现中, 利用卷积运算的结合律先进行水平方向上的平滑,再进行垂直方向上的差分,
或者先进行垂直方向上的平滑,再进行水平方向上的差分
@Python Version: 3.8
@Author: <NAME>
@Date: 2... |
<reponame>sjforeman/RadioFisher<filename>plotting/plot_Veff.py
#!/usr/bin/python
"""
Plot effective volume as a function of perp/parallel k. (Fig. 2)
"""
import numpy as np
import pylab as P
import scipy.interpolate
import matplotlib.cm, matplotlib.ticker
import scipy.ndimage
from rfwrapper import rf
from radiofisher.u... |
<reponame>Aditya-kiran/ResNet-VAE
from flows import PlanarFlow, ResnetFlow
from losses import elbo_loss, vanilla_vae_loss, elbo_loss_resnet, cross_entropy_loss
from tb_logger import Logger
from utils import copy_files
import argparse
import numpy as np
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as... |
# <<BEGIN-copyright>>
# Copyright 2021, Lawrence Livermore National Security, LLC.
# See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
# <<END-copyright>>
"""
Contains the abstract base class for storing a physical quantity (e.g., mass, spin or halflife).
Also defines specific cl... |
<reponame>Batool-Salehi/beam_selection
from PIL import Image
import csv
from scipy.signal import convolve2d
import numpy as np
from tqdm import tqdm
def getEpScenValbyRec(filename):
with open(filename) as csvfile:
reader = csv.DictReader(csvfile)
numExamples = 0
epi_scen = []
heigh... |
# https://deeplearningcourses.com/c/deep-reinforcement-learning-in-python
# https://www.udemy.com/deep-reinforcement-learning-in-python
from __future__ import print_function, division
from builtins import range
# Note: you may need to update your version of future
# sudo pip install -U future
import copy
import gym
im... |
<filename>ddf/ddf/stainer.py
from time import time
import numpy as np
import pandas as pd
import itertools
from itertools import product
from pandas.api.types import is_numeric_dtype, is_datetime64_any_dtype, is_categorical_dtype
from statsmodels.regression.linear_model import OLS
from statsmodels.tools import add_con... |
import os
import sys
from fractions import Fraction
from PIL import Image
from imgurpython import ImgurClient
# PRECONDITIONS: pip3 install imgurpython pillow
client_id = '781fa4d6e460abd'
client_secret = '5b1b67e6eb340e851d3e43bd845c02ac5fc2c6e0'
client = ImgurClient(client_id, client_secret)
def _fix_dimensions... |
import numpy as np
from application_files.tracker.tracker import Tracker
from application_files.visualization.visualization import Visualization
from scipy.optimize import linear_sum_assignment
class Detection:
def __init__(self, par_path, deviation, red_line_pos, category_index):
self.par_path = par_path... |
<reponame>MuAuan/Caos
from scipy.integrate import odeint, simps
import numpy as np
import matplotlib.pyplot as plt
def pend(y, t, b, c):
theta, omega = y
dydt = [omega, -b*omega - c*np.sin(theta)]
return dydt
b = 0.025
c = 5.0
y0 = [np.pi - 0.1, 0.0]
t = np.linspace(0, 100, 1001)
sol = odeint(pend, y0, t,... |
import numpy as np
from ModulationPy import QAMModem
from scipy import special
import matplotlib.pyplot as plt
def BER_calc(a, b):
num_ber = np.sum(np.abs(a - b))
ber = np.mean(np.abs(a - b))
return int(num_ber), ber
def BER_qam(M, EbNo):
EbNo_lin = 10 ** (EbNo / 10)
if M > 4:
P = 2 * np... |
<gh_stars>0
"""Communication Module
"""
#------------------------------------------------------------------------
# Copyright (c) 2015 SGW
#
# Distributed under the terms of the New BSD License.
#
# The full License is in the file LICENSE
#------------------------------------------------------------------------
impor... |
<filename>lentil/detector.py
import warnings
import numpy as np
import scipy.signal
import scipy.ndimage
import lentil
def collect_charge(img, wave, qe, waveunit='nm'):
"""
Convert photon count (or flux) to electron count (or flux) by
applying the detector's wavelength-dependent quantum efficiency.
... |
<filename>examples/pinn_forward/Lotka_Volterra.py
"""Backend supported: tensorflow.compat.v1, tensorflow, pytorch"""
import deepxde as dde
import matplotlib.pyplot as plt
import numpy as np
from scipy import integrate
# Import tf if using backend tensorflow.compat.v1 or tensorflow
from deepxde.backend import tf
... |
"""
Compare the results of a pbtranscript run (or pbsmrtpipe IsoSeq job) to an
existing benchmark.
"""
from cPickle import *
import argparse
import difflib
import os.path as op
import numpy as np
from scipy.sparse import lil_matrix
from pbcore.io import *
def filter_clusters_by_size(clusters, min_cluster_size=2):... |
<reponame>lucabenedetto/edm2016
"""
Tests for item ogive response functions
"""
import unittest
import numpy as np
from scipy import stats as st
from rnn_prof.irt.constants import THETAS_KEY, OFFSET_COEFFS_KEY, NONOFFSET_COEFFS_KEY
from rnn_prof.irt.cpd import ogive as undertest
from rnn_prof.irt.updaters import Upda... |
<filename>badlands/badlands/underland/stratiWedge.py
##~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~##
## ##
## This file forms part of the Badlands surface processes modelling application. ##
## ... |
<gh_stars>100-1000
r"""Solve Poisson's equation using a mixed formulation
The Poisson equation is in strong form
.. math::
\nabla^2 u &= f \\
u(x, y=\pm 1) &= 0 \\
u(x=2\pi, y) &= u(x=0, y)
We solve using the mixed formulation
.. math::
g - \nabla(u) &= 0 \\
\nabla \cdot g &= f \\
u(x, y=\... |
<reponame>palindromedata/Dimagi_Births<filename>Set1_Org_XYZ_RTPFormat/Exploration_Work/Analyse.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 19 09:44:45 2018
@author: ksharpey
"""
# =============================================================================
# Description
# - simple corre... |
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: ipynb,py
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.9.1+dev
# kernelspec:
# display_name: Python [conda env:generic_expression_new] *
# language: py... |
'''
This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).
PM4Py is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any late... |
import numpy as np
import os
from generate_dxf import generate_dxf_circles, generate_dxf_horizontal_bands, generate_dxf_stick_circles, write_stick_length_file
from helper import chunks
from configuration import load_configuration, Configuration, StickConfiguration, Margin
def main():
import argparse
... |
<filename>decision_boundary_vertical.py
from single_qubit_classifier import generate_noisy_classification
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from mpl_toolkits.axes_grid1 import make_axes_locatable
import numpy as np
from pyquil import get_qc
from nisqa... |
<gh_stars>10-100
'''
Created on 2015年12月5日
@summary: 对算法运行中的一些中间文件进行管理
@author: suemi
'''
import os,sys
from gensim import corpora
import pickle as pk
from scipy.sparse import lil_matrix
from model.Entity import *
class CacheUtil:
path={}
path["data"]="/Volumes/MAC/Rnews/data/"
path["dictionary"]=path["d... |
<gh_stars>0
import random
import math
from os.path import join
from PIL import Image
import numpy as np
import argparse
import random
import numpy as np
import scipy
from scipy import ndimage
from PIL import Image, ImageEnhance, ImageOps, ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
import random
# from keras.pre... |
<filename>server/evaluate.py
import math
from fastdtw import fastdtw
import pandas as pd
import copy
import matplotlib.pyplot as plt
from scipy.spatial.distance import euclidean
#个数计算
def getTimes(pointXYlist, part, name):
number = 0
pointYList = []
for i in range(len(pointXYlist)):
pointYList.appe... |
<reponame>Jammy2211/AutoLens
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import norm
from os import path
import os
import autoarray as aa
import autogalaxy.plot as aplt
from autogalaxy.analysis.visualizer import plot_setting
from autogalaxy.analysis.visualizer import Visualizer as ... |
<reponame>SLprojects/statlab<filename>statlab/risk_metrics/metrics.py
import numpy as np
import scipy.stats as sts
from preprocessing.timeseries import points_of_crossing
def maxdrawdown_by_trend(close, trend):
cross = points_of_crossing(close, trend)
drawdowns_yields = []
drawdowns_indices = []
drawd... |
<gh_stars>0
#!/usr/bin/env python
# Copyright (C) 2017 Udacity Inc.
#
# This file is part of Robotic Arm: Pick and Place project for Udacity
# Robotics nano-degree program
#
# All Rights Reserved.
# Author: <NAME>
# import modules
import rospy
import tf
from kuka_arm.srv import *
from trajectory_msgs.msg import Join... |
<reponame>jappa/PyFR
# -*- coding: utf-8 -*-
import sympy as sy
from sympy.abc import x
from sympy.mpmath import mp
from pyfr.quadrules.base import BaseQuadRule, BaseAlgebraicQuadRule
class BaseLineQuadRule(BaseQuadRule):
eletype = 'line'
orbits = {'2': lambda a: [a],
'11': lambda a: [-a, a]}
... |
"""
Module rotors provides classes and functions to compute and analyse
orientational dynamics and statistics of interacting Brownian rotors.
(see https://yketa.github.io/DAMTP_MSC_2019_Wiki/#N-interacting%20Brownian%20rotors)
"""
import numpy as np
import scipy.special as special
import scipy.optimize as optimize
im... |
<gh_stars>0
'''Tasks specific to the IsMore project.'''
from __future__ import division
from collections import OrderedDict
import time
import datetime
import os
import re
import pdb
import pickle
import tables
import math
import traceback
import numpy as np
import pandas as pd
import random
import multiprocessing as... |
<filename>pyramidLK.py<gh_stars>1-10
import numpy as np
import cv2
import copy
from scipy.interpolate import RectBivariateSpline
import glob
from lktracker_bolt import LucasKanade
# function to calculate 1st order derivative of gaussian
def gaussian(sigma,x,y):
a= 1/(np.sqrt(2*np.pi)*sigma)
b= np.exp(-(x**2+y... |
# -*- coding: utf-8 -*-
import os
import sys
import time
import h5py
import numpy as np
import matplotlib.pyplot as plt
from scipy.spatial import distance
from tqdm import tqdm
from anomalyModelBase import AnomalyModelBase
from common import utils, logger
class AnomalyModelBalancedDistribution(AnomalyModelBase):
... |
<gh_stars>1-10
import math
from skdesign.power import (PowerBase,
is_in_0_1)
import scipy.stats as stats
import numpy.random as random
class Fisher(PowerBase):
""" Hypotheses for Fisher's Exact Test
Hypothesis:
The test for equality and the test for superiority can be unif... |
"""
Movie Recommender Project
<NAME>
This program implements a user based and a item based
collaborative filtering algorithm
"""
import numpy as np
from math import sqrt
from scipy.sparse.linalg import svds
from sklearn.metrics import mean_squared_error
from sklearn.model_selection import train_test_split
from sklear... |
<reponame>tlambert03/image-demos<gh_stars>0
import argparse
import h5py
import napari
import numpy as np
from skimage.measure import label
from batchlib.util import read_table, write_table, has_table
import os
from glob import glob
import imageio
import h5py
import numpy as np
import skimage.color as skc
from batc... |
import numpy
from numpy import sin, cos, pi
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
from clothoids.model import clothoids
def _rot(a, deg=False):
if deg:
a = numpy.deg2rad(a)
return numpy.array([[
[cos(a), -sin(a)],
[sin(a), cos(a)]
]])
def example1(s... |
# -*- coding: utf-8 -*-
"""
This script was used to test whether the hourly observations follow a normal
distribution.
Usage:
Execute the script from the command line using the following command:
python3 stats_test_normality.py -df input.pkl
Arguments:
-df/--dataframe: Path to the pandas DataFrame conta... |
<filename>titanic/parse.py
import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
import statistics as st
# Reading in the data:
os.chdir('/home/trevor/Documents/GitHub/cs290AK/titanic')
ledger = pd.read_csv('ledger.csv')
# Check the dimensions of the data and the types of data:
# print(ledg... |
# coding=utf-8
# Copyright 2019 The ML Fairness Gym Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
<gh_stars>1-10
#coding=utf-8
"""Module for visualizing common curve
The function of this Module is served for visualizing common curve.
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
def plot_cphCoef(dfx, coef_col='coef', se_col='se(coef)', c_col='p', name_col... |
<reponame>StevenDavisTechNotes/SparkAggregationMethods
#!python
# set PYSPARK_DRIVER_PYTHON=python
# set PYSPARK_DRIVER_PYTHON_OPTS=
# spark-submit --master local[7] --deploy-mode client BiLevelPerfTest.py
import gc
import scipy.stats, numpy
import time
from LinearRegression import linear_regression
from pyspark.sql im... |
import math as math
from scipy.spatial import distance
colors = 10*["g", "r", "c", "b", "m", "y", "tab:purple","tab:pink","tab:orange","tab:gray","tab:brown", "aquamarine", "darkblue"]
class dataset:
def __init__(self, nome, data, cluster):
self.nome = nome
self.data = data
self.closest =... |
from mpl_toolkits.mplot3d import Axes3D
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
def clip(subjectPolygon, clipPolygon):
# https://rosettacode.org/wiki/Sutherland-Hodgman_polygon_clipping
def inside(p):
return(cp2[0]-cp1[0])*(p[1]-cp1[1]) > (cp2[1]-cp1[1])... |
from Sequences.NiceErrorChecking import require_integers, require_geq, require_prime
from Sequences.Divisibility.Primes import primes, blum_primes
from Sequences.Simple import naturals, arithmetic
from Sequences.MathUtils import factors, prime_factorization, unique_prime_factors, \
nth_s... |
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 18 11:47:18 2016
@author: sebalander
"""
# %% IMPORTS
from matplotlib.pyplot import plot, imshow, legend, show, figure, gcf, imread
from matplotlib.pyplot import xlabel, ylabel
from cv2 import Rodrigues # , homogr2pose
from numpy import max, zeros, array, sqrt, roots, d... |
###############################################################################
# calc_effsel: calculate the effective selection function for various setups,
# **includes the area of the plate**
###############################################################################
import os, os.path
import pickl... |
<filename>simulator_euler.py
import os, sys
import time, glob
import random
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import ode, solve_ivp, odeint
from scipy.optimize import curve_fit, least_squares
class Simulator:
"""
"""
def __init__(self, model):
'''
... |
import numpy as np
import h5py
import scipy.io
from math import floor
from enum import Enum
from collections import namedtuple as tuple
# from keras.preprocessing.image import Iterator # For random batch sizes
class Dataset(Enum):
TRAIN=0
VALID=1
TEST=2
class DataFile(Enum):
NAME=0
X=1
Y=2
... |
<filename>code/kcorr.py
from __future__ import print_function
import os
import sys
import argparse
import numpy as np
import pandas as pd
from scipy.stats.mstats import gmean
from astropy.cosmology import WMAP9 as cosmo
def k_correction(df, gamma, sigma, z, dl_cm):
"""
Function to perform a k-correction accordin... |
from config import *
import numpy as np
import networkx as nx
import scipy.stats
import glob, os
def read_G(sub,ds,corr):
""" read the correlation graph for a subject with a given denoising strategy
"""
files = glob.glob(rootdir + "/data/04_correlations/corr-%s/ds-%s/*%s*.gexf"
... |
<filename>tests/test_utils/test_sampling_utils.py
# -*- coding: utf-8 -*-
"""
Test utilities for sampling in the latent space.
"""
import numpy as np
import pytest
from scipy import stats
from unittest.mock import patch
from nessai.utils.sampling import (
compute_radius,
draw_gaussian,
draw_nsphere,
dr... |
#-------------extract_gauge.py-------------------------------------------------#
#
# Purpose: This file takes a .mat file for a gauge field and turns it into
# something actually useable by GPUE / c++
#
#------------------------------------------------------------------------------#
import scipy.io
hbar = 1... |
import copy
import math
from datetime import timedelta
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import seaborn as sns
from matplotlib.lines import Line2D
from scipy.stats import entropy
from utils.generic.enums.columns import compartments
from utils.generic.stats import get_param_stats, ... |
from collections import defaultdict
from random import sample
from time import time
import csv
import matplotlib.pyplot as plt
import numpy as np
from sympy.printing.pretty.pretty_symbology import pretty_symbol
# Library located at https://pypi.python.org/pypi/Distance/
from Simulations import create_mel_dist, create... |
<gh_stars>1-10
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.1.4
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# # s_fit_discrete_markov_chain [<img sr... |
""" Control systems -related functions
(c) <NAME>, University of Oxford (<EMAIL>)
"""
import numpy as np
import scipy
import matplotlib.pyplot as plt
def eul(f, u, x_0, d, param):
"""Integrate dynamics using forward Euler method
x[k+1] = x[k] + delta*(f(x[k], u[k]))
Input: dynamics f,... |
from methods import Secant_method
from sympy import *
from sympy.functions import exp
x = Symbol('x')
function_formula = exp(-x) - x
call_func = Secant_method.Secant(function_formula, 1.0, 0.0, 0, 0)
# bool1 = call_func.verify_there_is_a_root()
# print(bool(bool1))
root = call_func.compute_root()
print(root)
call_... |
<filename>lab_classification/utilsClassifier.py
import re
import random
import numpy as np
import matplotlib.pyplot as plt
import os.path
import scipy.misc
from glob import glob
import scipy.io as sio
from skimage.transform import resize
import imageio
def get_dataset_size(data_folder):
images = glob(os.path.join(... |
<filename>train.py
import numpy as np
import tensorflow as tf
import scipy.misc as scm
import os
from tqdm import trange
from utils import *
from tensorflow.python.platform import flags
from models.vgg16 import VGG16
from models.vgg19 import VGG19
from models.resnet50 import RESNET50
from models.resnet101 import RESN... |
<filename>libs/utilsData.py
from builtins import print
import numpy as np
import pandas as pd
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
matplotlib.rcParams['font.family'] = 'sans-serif'
matplotlib.rcParams['font.sans-serif'] = 'Arial'
import os
import operator
import re
import ... |
<filename>src/gan/load_data.py<gh_stars>0
import numpy as np
from PIL import Image
import time
import torch
from torchvision import transforms
from torch.utils import data as torchdata
import scipy.io as io
import scipy.misc as misc
import glob
import csv
from skimage import color
def pil_loader(path):
with open... |
import os
os.chdir(os.path.split(os.path.realpath(__file__))[0])
from scipy import sparse
import pickle
import constants
from tqdm import tqdm
if __name__=='__main__':
epic_data_root = '../data'
MSA_list=constants.MSA_NAME_LIST
for MSA_name in MSA_list:
print(MSA_name)
MSA... |
import numpy as np
from scipy import linalg
from scipy import interpolate
import pickle, os
# For emcee MCMC
import emcee
import corner
import time
# For Plotting
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import matplotlib.font_manager as font_manager
# Physical constan... |
<filename>PyEMD/splines.py
from __future__ import division
import numpy as np
from scipy.interpolate import Akima1DInterpolator
def cubic_spline_3pts(x, y, T):
"""
Apparently scipy.interpolate.interp1d does not support
cubic spline for less than 4 points.
"""
x0, x1, x2 = x
y0, y1... |
<filename>util/putil.py
import inspect
import itertools
import json
import math
import os
import re
import smtplib
import string
# import intervaltree as it
import sys
import traceback
from collections import OrderedDict
# from bs4 import BeautifulSoup
from copy import copy
from datetime import datetime
from email.mime... |
import pyUngewiss as pu
import numpy as np
import unittest
class TestMethods(unittest.TestCase):
def test_FuzzyNumber(self):
nAlpha = 3
pFuzz = pu.UncertainNumber(
[1, 2, 3, 4], Form='trapazoid', nalpha=nAlpha
)
pFuzzTarget = np.array([[2.0, 3.0], [1.5, 3.5], [1.0, 4.0]... |
<reponame>cgmeyer/gen3sdk-python
import requests, json, fnmatch, os, os.path, sys, subprocess, glob, ntpath, copy, re, operator, statistics, datetime
import pandas as pd
from os import path
from pandas.io.json import json_normalize
from collections import Counter
from statistics import mean
from io import StringIO
from... |
<gh_stars>1-10
# Author: <NAME>
import random
import argparse
import numpy as np
import scipy as sp
import scipy.stats
class ArgsParser:
"""
Read the user's input and parse the arguments properly. When returning args, each value is properly filled.
Ideally one shouldn't have to read this function to acce... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import os.path
import json
import numpy as np
import sys
import torch
import torch.utils.data as data
from pyquaternion import Quaternion
from scipy.spatial import distance
sys.path.append('../models')
import quat_ops
import torch.nn.functional as F
import warnin... |
#! /usr/bin/env python
"""
Code used to generate the fits in Ruede/Waluga/Wohlmuth 2013
"""
__author__ = "<NAME> (<EMAIL>)"
__copyright__ = "Copyright (c) 2013 %s" % __author__
from dolfin import *
from energy_correction.meshtools import *
from energy_correction.extrapolate import *
import numpy as np
from math impo... |
import numpy as np
import pandas as pd
import itertools
import time
import scipy.optimize as optimize
from data_gen import gen_df
import matplotlib.pyplot as plt
import math
result = math.sqrt(4)
print(result)
"""
n1 = 100
n2 = 10000
x1 = np.linspace(1,10,n1)
y1 = np.random.uniform(0,1,n1)
x2 = np.linspace(1,10,n2... |
#!/usr/bin/env python3
############################################################
# Copyright 2013, by the California Institute of Technology#
# Author : <NAME>
############################################################
from .CenteredBasisFn import CenteredBasisFn
import numpy as np
from scipy.misc import factor... |
<reponame>JyLIU-emma/Complexit-_recettes<filename>script_projet/correlation.py
from bs4 import BeautifulSoup
import re
import shutil
import glob
# from MainAnnotator import parcours_corpus_annote # à décommenter si on veut lancer l'annotation
from sympy import symbols
def get_liste_of_niveau():
liste_f = []
... |
<reponame>tucan9389/MobileHumanPose
import os
import os.path as osp
import scipy.io as sio
import numpy as np
import cv2
import random
import json
import math
from tqdm import tqdm
root_dir = './images' # define path here
save_dir = './annotations' # define path here
joint_num = 17
subject_list = [1, 5, 6, 7, 8, 9, 1... |
<filename>fourth_day/lucifer.py
# -*- coding: utf-8 -*-
# Name: lucifer.py
# Authors: <NAME>, <NAME>
# Propagates the light to the detector position
import logging
import pandas as pd
import numpy as np
from scipy.interpolate import UnivariateSpline
from time import time
from .config import config
from .genesis import... |
<reponame>demaris/oscilite
__author__ = 'david'
"""
The competetive CML class: responsible for initializing defaults, iterating and managing the lattice (matrix)
"""
from numpy import *
from scipy.signal import convolve2d
class CompetitiveCML:
def __init__(self, lattice,l=5.0,a=0.26):
"""
latti... |
<filename>audio_utils/utils/add_noise.py<gh_stars>0
import math
import numpy as np
import librosa
import subprocess
from scipy.io.wavfile import write
'''
Signal to noise ratio (SNR) can be defined as
SNR = 20*log(RMS_signal/RMS_noise)
Where: RMS_signal is the RMS value of signal
RMS_noise is that of noise.
... |
import json
import plotly.offline as py
import plotly.graph_objs as go
import sys
from math import floor
from statistics import mean, harmonic_mean
if len(sys.argv) < 2:
print('Usage: paint-metric-analysis.py <filename>')
exit()
filename = sys.argv[1]
f = open(filename, 'r')
data = json.load(f)
f.close()
d... |
import sys
import os
path = os.path.abspath(__file__)
sys.path.append(os.path.dirname(path))
sys.path.append(os.path.dirname(os.path.dirname(path)))
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(path))))
import tensorflow as tf
import numpy as np
import cv2
from PIL import Image
import os
import glob
... |
<reponame>R6500/SLab
'''
AC submodule for the SLab project
It requires and imports slab.py
History:
Version 1.0 : First version (7/4/2017)
'''
import slab
import numpy as np # Numpy for math calculations
import pylab as pl # Pylab and Mathplotlib for plotting
import matplo... |
<gh_stars>1-10
import os
import sys
import json
import torch
import numpy as np
import scipy.io
import matplotlib
from scipy import ndimage
# matplotlib.use("pgf")
matplotlib.rcParams.update({
# 'font.family': 'serif',
'font.size':12,
})
from matplotlib import pyplot as plt
import pytorch_lightning as pl
from... |
"""
<NAME> -- Dec 17, 2021
Code Reference:
https://towardsdatascience.com/understanding-audio-data-fourier-transform-fft-spectrogram-and-speech-recognition-a4072d228520
https://stackoverflow.com/questions/23377665/python-scipy-fft-wav-files
"""
from os import path
from math import *
from scipy.fftpack import fft
f... |
import numpy as np
import scipy.sparse as sp
from pygcn.utils import normalize
'''测试论文编号处理'''
# 读取原始数据集
path="C:/Users/73416/PycharmProjects/PyGCN_Visualization/data/cora/"
dataset = "cora"
idx_features_labels = np.genfromtxt("{}{}.content".format(path, dataset),
dtype=np.dtype(... |
<filename>app/waterQual/30yr/AGU/map.py
import scipy
import importlib
from hydroDL.master import basins
from hydroDL.app import waterQuality
from hydroDL import kPath, utils
from hydroDL.model import trainTS
from hydroDL.data import gageII, usgs, transform
from hydroDL.post import axplot, figplot
import torch
import o... |
import numpy as np
import matplotlib.pyplot as plt
filename = 'Obrazy/images/image.jpg'
# ---
import matplotlib.pyplot
img = matplotlib.pyplot.imread(filename)
print(type(img), img.shape)
plt.imshow(img)
plt.show()
# ---
import cv2
img = cv2.imread(filename)
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
print(ty... |
import streamlit as st
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
import plotly
import plotly.graph_objs as go
from geopy.geocoders import Nominatim
import folium
from folium.plugins import MarkerCluster
import geopandas... |
<filename>tests/test_non_rigid_alignment.py
import os
import pickle
import mock
import numpy as np
import pytest
from scipy import ndimage
from sklearn.linear_model import LinearRegression
from sklearn.pipeline import make_pipeline, Pipeline
from sklearn.preprocessing import PolynomialFeatures
from ai_ct_scans import... |
<gh_stars>1-10
"""General Utlities"""
import codecs
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import os
import pandas as pd
import string
import tellurium as te
from scipy.special import comb
from SBMLLint.tools.sbmllint import lint
DIR = os.path.dirname(os.path.abspath(__file__))
PROJECT_DIR ... |
import numpy as np
import scipy.optimize as op
from traditional_ml.utils import initialize_theta
def optimize_theta(X, y, loss_fn, theta, gradient_fn, lamda=0):
result = op.minimize(fun=loss_fn,
x0=theta,
args=(X, y, lamda),
method='TNC',... |
<reponame>aschn/picolo
"""
@package mask
@author <NAME>
@version 0.1
@brief Contains classes for Mask
"""
# import from standard library
import collections
#import os
import logging
# import external packages
import numpy as np
#from scipy import spatial
from scipy.ndimage import morphology
import matplotlib.pyplot a... |
<reponame>aymericvie/evology<gh_stars>0
import pandas as pd
data = pd.read_csv(
"/Users/aymericvie/Documents/GitHub/evology/evology/research/MCarloLongRuns/data/data2.csv"
)
print(data)
import matplotlib.pyplot as plt
import seaborn as sns
print(data.columns)
import numpy as np
from scipy.ndimage.filters import g... |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Name: test_bson
# Purpose: Test driver for module bson
#
# Author: <NAME> (<EMAIL>)
#
# Copyright: (c) 2016 <NAME>
# ----------------------------------------------------------------------------
# $So... |
<filename>src/post-example.py
#!/usr/bin/env python
import matplotlib as mpl
mpl.rcParams['font.family'] = 'serif'
mpl.rcParams['font.size'] = 11
mpl.rcParams['font.serif'] = 'palatino'
mpl.rcParams['font.sans-serif'] = 'avant guard'
mpl.rcParams['text.usetex'] = 'yes'
mpl.rcParams['image.cmap'] = 'viridis'
import py... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.