text string |
|---|
<reponame>qthequartermasterman/geometry
from geompy import USE_EXACT, USE_PURE_SYMPY
use_numpy = not USE_EXACT
if use_numpy:
from .numpy_utils import (sympify,
identity as simplify,
identity as fullsimplify,
Expression,
... |
<filename>python/source/test/test_parametric.py
import numpy as np
from scipy import signal
from ..parametric.AutocorrelationMethod import AutocorrelationMethod
from ..parametric.CovarianceMethod import CovarianceMethod
from ..parametric.ModifiedCovarianceMethod import ModifiedCovarianceMethod
from ..parametric.Burg im... |
import cmath
from cmath import pi
import math
import numpy as np
from Potential import *
def TrainingData(alpha_N, delta_N, lamda_N, n_N, n_points):
count = int(0)
maxcount = alpha_N * delta_N * lamda_N * n_N
Y = np.zeros((maxcount, n_points), dtype=np.double)
X = np.zeros((maxcount,n_poi... |
<gh_stars>1-10
import numpy as np
import pylab as plt
from scipy.stats import norm#is it poisson
import glob,os
#import BeamDeconvolution
import numpy as np
from scipy.optimize import minimize
def ecliptic2quadratic(xc,yc,bmaj,bmin,pa,k=np.log(2)):
'''a*x**2 + b*x*y + c*y**2 + d*x + e*y + f = k
pa in deg'''
#unro... |
'''
=====================================
Author : <NAME>
Date : Feb. 11, 2020
Location: UC San Diego, La Jolla, CA
=====================================
'''
import numpy as np
import sympy as sp
from define_system import ControlAffineSystem
class InvertedPendulum:
'''
Define the symbolic dynamic: d... |
<reponame>steven-rr/AE8843<gh_stars>0
import random
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import animation
from scipy import integrate
from scipy import linalg as LA
import cvxpy as cp
# generate seed for random generator
random.seed(239)
class RLdMPC:
# State indices
... |
#!/usr/bin/python
'''
Matrix Product State.
'''
from numpy import *
from matplotlib.pyplot import *
from matplotlib import patches
from matplotlib.collections import LineCollection
from scipy.linalg import svd,qr,rq,norm,block_diag
from mps import MPS,VidalMPS,KMPS,BMPS
from scipy import sparse as sps
import pdb,time
... |
<gh_stars>0
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
from matplotlib.collections import PatchCollection
from matplotlib.patches import Rectangle
from scipy.stats import norm
from scipy.interpolate import spline
def make_error_boxes(ax, xlow, xhigh, ylow, yhi... |
import sys,argparse
import random
import numpy as np
import math as m
import scipy.optimize
import scipy
class ExactKrylovJacobian(scipy.optimize.nonlin.KrylovJacobian):
def __init__(self,exactgrad, rdiff=None, method='lgmres', inner_maxiter=20,inner_M=None, outer_k=10, **kw):
scipy.optimize.non... |
# coding: utf-8
# In[46]:
import numpy as np
import matplotlib.pyplot as plt
import scipy as sp
from scipy import optimize
import os
import random
# In[57]:
# Exercise 1
ID = [5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]
x = [203, 58, 210, 202, 198, 158, 165, 201, 157, 131, 166, 160, 186, 125, 218, 146]
y = [49... |
import torch
import torch.nn as nn
from mmcv.cnn import normal_init
import torch.nn.functional as F
from mmdet.core import distance2bbox, force_fp32, multi_apply, multiclass_nms_with_mask
from ..builder import build_loss
from ..registry import HEADS
from ..utils import ConvModule, Scale, bias_init_with_prob, cls_color,... |
<gh_stars>0
from scipy.stats import truncnorm, norm, uniform
import numpy as np
def generate_distribution(size, distribution_type, data_type, min_val=0, max_val=1, **kwargs):
"""
Generate different types of distribution. Implement uniform, normal and truncated distribution now.
:param size:Output array si... |
import pickle
import time
from argparse import ArgumentParser
from pathlib import Path
import librosa
import numpy as np
from scipy.io import wavfile
from wavegru_mod import WaveGRU
parser = ArgumentParser()
parser.add_argument("--weight", type=Path, help="Path to weight file", required=True)
parser.add_argument("--m... |
<filename>gym_energyplus/envs/energyplus_model_2ZoneDataCenterHVAC_wEconomizer_Temp_Fan.py
# Copyright (c) IBM Corp. 2018. All Rights Reserved.
# Project name: Reinforcement Learning Testbed for Power Consumption Optimization
# This project is licensed under the MIT License, see LICENSE
import os
import time
import nu... |
# ------------------------------------------------------------------ #
# ╦═╗╔═╗╔╦╗╔═╗╔═╗╔═╗
# ╠╦╝║ ║║║║╚═╗║ ║║
# ╩╚═╚═╝╩ ╩╚═╝╚═╝╚═╝
# Reduced Order Modelling, Simulation, Optimization of Coupled Systems
# 2017-2021
#... |
# @author: <NAME>
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
plt.style.use(style='ggplot')
plt.rcParams['figure.figsize'] = (10, 6)
train = pd.read_csv('train.csv')
# QUESTION 1
# Clean outlier garage data
garage_df = train.get('GarageArea')
print(garage_df)
z =... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# #########################################################################
# Copyright (c) 2020, UChicago Argonne, LLC. All rights reserved. #
# #
# Copyright 2020. UChicago Argonne, LLC. This ... |
# -*- coding: utf-8 -*-
"""
@author: hkaneko
"""
import numpy as np
import pandas as pd
from scipy.spatial.distance import cdist
from sklearn import svm
from sklearn.model_selection import train_test_split
ocsvm_nu = 0.045 # OCSVM における ν。トレーニングデータにおけるサンプル数に対する、サポートベクターの数の下限の割合
ocsvm_gammas = 2 ** np.aran... |
# plot_recon_anatomy.py
#
# <NAME> 2016
#
import mayavi
import scipy.io
from .ctmr_brain_plot import ctmr_gauss_plot, el_add
from .SupplementalFiles import FS_colorLUT as FS_colorLUT
import numpy as np
import os
def plot_recon_anatomy(hemi):
subj = patient.subj
hem = patient.hem
a = scipy.io.loadmat('%s/%s/Meshes... |
"""Parse Totani fluxes.
Based on simulation from arXiv:astro-ph/9710203, which is the primary
model used in the Hyper-Kamiokande Design Report.
All times are post-bounce, which differs slightly from the simulation time given
in the raw input files. We fix this when reading from the files in _parse().
"""
from math im... |
#!/usr/bin/env python
# coding: utf-8
# # Wasserstein Pareto Frontier Experiment on Adult Data Set
# ## Import Data
# The experiment used the Adult experiment_data2 data set as in "Optimized Pre-Processing for Discrimination Prevention" by Calmon and etc. for comparison purpose: https://github.com/fair-preprocessing/... |
import numpy as np
import imageio
import scipy.ndimage
import cv2
#you can add any image
#------important----------
#image and code file should in same folder
#if image on in same folder ou have to give the path
#-------------------------
my_img = "my_photo.jpg"
def rgb_photo(rgb):
return np.... |
<reponame>narroyo1/sffnn
"""
This module can be used to compose a stochastic function and train a neural network
to aproximate it.
"""
import numpy as np
from scipy.stats import truncnorm
# %%
###########################################
# 1D base functions
###########################################
def fn_sin(x_... |
from __future__ import print_function
from colour import Color
from math import sqrt
#Python tv watcher
import picamera
import picamera.array
from fractions import Fraction
from colors import *
import pyphue
myHue = pyphue.PyPHue(ip='192.168.0.157',user='DuuwppZiNJCneZcgQQs-01ckob4yjYnHw0UmoM0V')
xsize = 128
ysize=... |
# -*- coding: utf-8 -*-
#
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
#
# pylint: disable= no-member, arguments-differ, invalid-name
#
# Chemistry utils in JTVAE
from collections import defaultdict
from scipy.sparse import csr_matrix
from scipy.sparse.csgr... |
<reponame>openql-org/quantpy
# -*- coding:utf-8 -*-
import textwrap
from sympy.physics.quantum.gate import H, X, Y, Z, CNOT, SWAP, CPHASE, CGate, CGateS
from sympy.physics.quantum.gate import IdentityGate, UGate
from sympy.physics.quantum.qubit import Qubit, QubitBra
from quantpy.sympy.executor._base_quantum_executor ... |
from django.db import models
from django.db.models.aggregates import Min, Max
from scipy import special
from app.support.repetition import get_bow_dataframe
from .base import Song
__all__ = ['WordCache', 'WordOccurrenceInSong']
class WordCache(models.Model):
word = models.CharField(max_length=289, unique=True)... |
'''This code scipt handles the photon data once it has passed through the system'''
print 'Depreciated. You should now be running Analysis.phot'
exit()
# import pyfits
import astropy.io.fits as pyfits
import numpy as np
import os
from matplotlib import pyplot as plt
from matplotlib.ticker import MultipleLocator
import... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import stats
import statsmodels.api as sm
from statsmodels.formula.api import ols
from ipywidgets import *
from IPython.display import display, HTML
sns.set(color_codes=True)
dataurl = 'https://raw.githubusercontent... |
<gh_stars>10-100
# -*- coding: utf-8 -*-
# Copyright 2009 <NAME>
# Licensed under the Gnu General Public license, see COPYING
'''
Title: MLP of pythonGPLVM
Author: <NAME>
Date: 2009
Code version: 81a4ce9 on 23 Nov 2009
Availability: https://github.com/jameshensman/pythonGPLVM
'''
... |
<reponame>cyrlemaire/acv00<filename>experiments/utils.py<gh_stars>0
import itertools
from collections import defaultdict
from operator import itemgetter
import string
import random
import scipy.stats as stats
from typing import Tuple, List
from sklearn.cluster import AffinityPropagation
import matplotlib.pyplot as plt
... |
<gh_stars>1-10
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from joblib import Parallel, delayed
from scipy.special import wofz
from scipy.interpolate import interp1d
from scipy.optimize import least_squares
from scipy.optimize import minimize
from scipy.stats import norm
from ... |
import numpy as np
from scipy.spatial.transform import Rotation
def identity():
return np.eye(3, 4)
def transform(g: np.ndarray, pts: np.ndarray):
"""Applies the SE3 transform
Args:
g: SE3 transformation matrix of size ([B,] 3/4, 4)
pts: Points to be transformed ([B,] N, 3)
Returns... |
from sklearn.decomposition import PCA
from sklearn.feature_selection import VarianceThreshold
from scipy.sparse import csr_matrix
def get_feature_importances(features, feature_names=None):
if isinstance(features, csr_matrix):
features = features.A
feature_select = VarianceThreshold(threshold=0.0)
... |
import numpy as np
from scipy.integrate import ode
import matplotlib as mpl
mpl.rcParams['font.family'] = 'Helvetica Neue'
import matplotlib.pyplot as pl
# set equation of motion for SIR dynaics
def dxdt(t,y,eta,rho):
S = y[0]
I = y[1]
R = y[2]
dy = np.zeros(3)
dy[0] = -eta*S*I
dy[1] = +eta... |
import pandas as pd
import numpy as np
import scipy.sparse as sp
#Random MPRA sorting and shuffling functions
class LibraryPreparer :
def __init__(self, preparer_type_id) :
self.preparer_type_id = preparer_type_id
def _prepare(self, library_dict) :
raise NotImplementedError()
class ... |
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import numpy as np
import pickle
import cv2
import utils
import glob
from scipy.ndimage.measurements import label
from moviepy.editor import VideoFileClip
import PyQt5
#中期检查所用片段
count=0
dist_pickle = pickle.load(open("train_dist.p", "rb"))
svc = dist_pi... |
<reponame>dowlinglab/dmd-energy-markets
import numpy as np
from scipy import linalg as la
from cmath import exp
import matplotlib.pyplot as plt
def split(Xf, verbose=False):
'''
This function will perform a crutical manipulation for DMD
which is the splitting of a spacial-temporal matrix (Xf) into
two... |
# Version 3.1; <NAME>; Polar Geospatial Center, University of Minnesota; 2018
from __future__ import division
import inspect
import os
import re
import sys
import warnings
from glob import glob
from warnings import warn
if sys.version_info[0] < 3:
from StringIO import StringIO
else:
from io import StringIO
... |
<gh_stars>0
import numpy as np
import pandas as pd
import matplotlib
matplotlib.use("Agg")
from matplotlib import pyplot as plt
# import seaborn as sns
from scipy import stats
from tensorboard.backend.event_processing import event_accumulator
import tensorflow as tf
from packaging import version
number_of_points = 100... |
<filename>kblocks/ops/polynomials.py
import abc
import itertools
from typing import Optional, Sequence, Tuple, Union
import gin
import numpy as np
import six
import tensorflow as tf
Num = Union[int, float]
def factorial(n: int) -> int:
return np.prod(range(1, n + 1))
def get_geometric_polynomials(x: tf.Tensor... |
'''
Author: <NAME>
Date:
Description: This has many functions involved with importing data into the mongo database.
'''
# standard imports
import os
import sys
import pymongo
import numpy as np
import scipy.stats as stats
from itertools import izip
# path management
project_directory = os.path.dirname(os.path.realpat... |
<reponame>larrywang0128/video_analyzer<gh_stars>0
# In[]:
##################################################
## Set up environment and load facial recognition model
##################################################
import os
import dlib
import cv2
import numpy as np
from scipy.spatial import distance as dist
# import... |
#!/usr/bin/python
# coding: utf-8
# This program extract MO matrices from fchk or fmat files and calculate SVD
import math
import cmath
import numpy as np
np.set_printoptions(suppress=True)
from numpy import array
from numpy import diag
from numpy import dot
from numpy import zeros
import sys
##########
if len(sys.arg... |
<gh_stars>0
import logging
from typing import Union
import autograd.numpy as np
import numpy as nmp
import scipy.spatial.distance as distance
from autograd import grad
from autograd.test_util import check_grads
from scipy.spatial import KDTree
from sklearn.base import BaseEstimator
from sklearn.base import RegressorMi... |
import torch
import torch.distributions
import torch.nn as nn
from torch.nn import init
import functools
from torch.optim import lr_scheduler
import numpy as np
from . import layers
from scipy.ndimage.filters import gaussian_filter
import time
###########################################################################... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
.. Authors
<NAME> <<EMAIL>>
<NAME> <<EMAIL>>
<NAME> <<EMAIL>>
"""
import numpy as np
from xicsrt.util import profiler
from xicsrt.tools.xicsrt_doc import dochelper
from xicsrt.optics._ShapeObject import ShapeObject
from scipy.spatial import Delaunay
from scipy.sp... |
import numpy as np
np.random.seed(616)
from keras.models import Sequential
from keras.models import Model
from keras.layers.core import Dense, Activation
from keras.layers import LSTM, GRU
from keras.layers import Embedding
from keras.layers import Conv2D, MaxPooling2D, Dropout, Flatten, MaxoutDense
from keras.layers... |
<filename>dataloader.py<gh_stars>0
import torch
import pandas as pd
import numpy as np
from scipy import signal
def Load_Dataset_A(data_path, model):
"""
Load Dataset A. Since the dataset does not provide code, we follow the original literature to preprocess the data.
Args:
data_path (str): datas... |
from collections import Counter, Callable, Hashable
import itertools
import warnings
import numbers
import numpy as np
from sppa.constants import *
import sys
import re
from copy import copy
from scipy.optimize import newton
class SPPAWarning(Warning):
pass
class SPPAIllegalArgumentError(ValueEr... |
# Important librairies.
from PIL import Image
import glob
import numpy as np
import re
import matplotlib.pyplot as plt
from skimage import measure
import scipy.ndimage
import os
import cv2
import pickle
import copy
from tifffile import imsave
# ----------------------------------------------------------... |
<gh_stars>10-100
# Copyright (c) 2019-2021 - for information on the respective copyright owner
# see the NOTICE file and/or the repository
# https://github.com/boschresearch/pylife
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# Yo... |
<reponame>QUT-Motorsport/QUTMS_VehicleSim<filename>plotmass/track.py
from scipy.io import loadmat
from scipy.signal import find_peaks
import pandas as pd
from math import *
import numpy as np
from time import sleep
class Track:
def __init__(self, mat_file, crv_name, x_name):
# Read data from matlab file
... |
"""Module implements a Garch(1,1) model"""
import numpy as np
from scipy.optimize import minimize
class Garch:
"""Class implements Garch(1,1) model
Notes:
Conditional Maximum Likelihood Estimation is used to estimate
the parameters of Garch Model
See c.f https://math.berkeley.edu/~btw/thesis4.pd... |
import sympy as sym
from sympy.functions import sqrt
from scipy.integrate import odeint
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider
import numpy as np
plt.ion()
x0_e = 8.48528137423857
k, z = sym.symbols('k, z')
Jsym = sym.Matrix([[-10, 10, 0],
[1-k, -1, -sqrt(72)],
[sqrt(72), sqrt(72), sy... |
<reponame>Xiaosheng-Zhao/21cmDELFI<filename>tutorial/tpower.py<gh_stars>0
import numpy as np
from scipy import interpolate
from astropy import units as un
from astropy.cosmology import Planck15
from py21cmsense import GaussianBeam, Observatory, Observation, PowerSpectrum, hera
def noise_generator(k_21,delta_21,z):
... |
# imports and basic notebook setup
from cStringIO import StringIO
import numpy as np
import scipy.ndimage as nd
import PIL.Image
import random
import os
import argparse
import matplotlib.pyplot as plt
from IPython.display import clear_output, Image, display
from google.protobuf import text_format
import caffe
# If y... |
<reponame>RunOrVeith/FGG<gh_stars>1-10
import warnings
from multiprocessing import cpu_count
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor, as_completed
import time
from datetime import timedelta
from contextlib import contextmanager
import gzip
import numpy as np
import pandas as pd
import sc... |
<gh_stars>0
import numpy as np
import scipy as sp
import scipy.special as sp_spcl
import scipy.optimize as sp_opt
import sympy as sy
import matplotlib.pyplot as plt
from Robustness.exception import *
import Robustness.validation as valid
import misc_functions as misc
def line_integral_boundaries(view_line_point,cl... |
<filename>Result-of-Analysis-StackOverFlow/Data Analysis.py
#!/usr/bin/env python
# coding: utf-8
# ## Team StackOverflow :
# ## StackOverFlow Dataset Analysis
# ## 
# In[4]:
#Importing the some inbuit anyalysis functions
import os
import struct
import pandas as pd
import math
im... |
# Copyright Cloudinary
import zlib, hashlib, re, struct, uuid, base64, time, random, string, json, copy
from fractions import Fraction
import cloudinary
from cloudinary.compat import (PY3, to_bytes, to_bytearray, to_string, string_types, unquote, urlencode)
""" @deprecated: use cloudinary.SHARED_CDN """
SHARED_CDN = c... |
<reponame>aharrisonau/gym-ReverseTruck<filename>gym_ReverseTruck/envs/ReverseTruck_env.py
# preliminaries
import pandas as pd
import numpy as np
import math as math
import gym
from gym import error, spaces, utils
from gym.utils import seeding
import math
pi = math.pi
class ReverseTruckEnv(gym.Env):
metadata = {'rend... |
__author__ = '<NAME>, <EMAIL>'
#########################################################################
# The sensors that are available for the FlexCube Environment
#
# The FlexCube Environment is a Mass-Spring-System composed of 8 mass points.
# These resemble a cube with flexible edges.
#
# A wide variety of senso... |
"""
This example program demonstrates the use of ray tracing
for the simulation of rooms of different sizes.
"""
from __future__ import print_function
import argparse
import sys
import time
import matplotlib.pyplot as plt
import numpy as np
from scipy.io import wavfile
import pyroomacoustics as pra
fs, audio_anecho... |
'''
## Agent File ##
Implementation of Deep Distributed Distributional Deterministic Policy Gradients (D4PG) network
using Tensorflow.
See https://arxiv.org/pdf/1804.08617.pdf for algorithm details.
@author: <NAME> 2020 (<EMAIL>)
Based and modified from code by Mark Sinton at https://github.com/msinto93/D4PG
'''
#... |
<gh_stars>1-10
import numpy as np
import scipy
import itertools
import time
from math import factorial
import copy as cp
import sys
from tpsci import *
from pyscf_helper import *
import pyscf
from pyscf import gto, scf, ao2mo, molden, lo, mo_mapping, mcscf
ttt = time.time()
np.set_printoptions(suppress=True, precisio... |
#!/usr/bin/env python
import sys
import math
import numpy as np
from scipy.optimize import root
from numpy import count_nonzero
from collections import Counter
## Parser for hyperparameter to return to file
import argparse
parser = argparse.ArgumentParser()
# Decision in case of problems in the optimisation of phi:
... |
import math
import numpy as np
import scipy as scipy
from scipy import stats
class ComputeLayersByMass:
def __init__(self, distribution, T):
self.input = list(filter(lambda x: x < T // 2, distribution))
if (len(self.input) < 1):
self.input.append(0)
self.layerValues = []
... |
import numpy as np
from scipy.optimize import leastsq, curve_fit
import matplotlib.pyplot as plt
def lorentzian(width, central, height, x):
return height * width / (2 * np.pi) / ((x - central)**2 + width**2 / 4)
def error_func(p, x, y):
return lorentzian(*p, x) - y
def find_r_squared(f, p, x, y):
res ... |
<filename>code/src/tree_roots.py
import numpy as np
from scipy.interpolate import interp1d
from scipy.stats import gamma as sc_gamma
class TreeRoots(object):
"""
This class models tree roots. It computes the roots density for a given
depth and also returns roots efficiency, as described in refs. [1, 2].
... |
import numpy as np
from matplotlib import pyplot
from astropy.io import fits
from astropy import wcs
import sys
from scipy import linalg as la
from scipy.ndimage.filters import gaussian_filter, median_filter
from matplotlib.patches import Circle
from astropy.coordinates import SkyCoord
from astropy import units as u
f... |
import gym
from gym import spaces
import numpy as np
import pandas as pd
import random
from enum import Enum
from scipy.stats import linregress
class Actions(Enum):
""" enum for the two actions the agent can take
None = 0
Sell = 1
Buy = 2
"""
Null = 0
Sell = 0
Buy = 1
... |
# coding: utf-8
# Authors: <NAME> <<EMAIL>>
# License: MIT
import os
import csv
import ast
import time
import logging
import warnings
import numpy as np
import pandas as pd
import scipy as sp
from sklearn import metrics
from sklearn.base import clone
from sklearn.externals.joblib import Parallel, delayed
from sklear... |
<reponame>cbaeck1/T2KWP
#from configs.hparams import create_hparams
from hparams import create_hparams
from concurrent.futures import ProcessPoolExecutor
from functools import partial
import librosa
from utils import read_wav_np
import os
hparams = create_hparams()
from scipy.io.wavfile import write
from utils import r... |
"""Helper functions.
Helper functions to suport other modules.
"""
import numpy as np
from scipy.ndimage import label
import torch
__all__ = ['label_connected_components', 'compute_importance']
def label_connected_components(label_images, start_label=1, is_3d=False):
"""Label connected components in a label ... |
import numpy as np
from scipy import interpolate
def compute_midline_and_tangent(anch, N_points, tck, width):
# print('Generating meshgrid')
t = np.linspace(0, 1, N_points)
x, y = interpolate.splev(t, tck)
# y = interpolate.splev(t, y_tup)
dx, dy = interpolate.splev(t, tck, der=1)
# dy = interp... |
"""
TODO: Module-level desription
I adapted the code from:
https://github.com/alexandreday/fast_density_clustering.git
Copyright 2017 <NAME>
"""
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KernelDensity, NearestNeighbors
class KDE:
"""Kernel density estim... |
<filename>Reconstruction-3D/main.py
import numpy as np
import pydicom, os, sys, glob
import matplotlib.pyplot as plt
import scipy.ndimage
from skimage import measure
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
data_path = "/SlicerRtData/eclipse-8.1.20-phantom-prostate/Original/CT/"
output_path = "/Reconstr... |
<reponame>miltondsantos/software
"""
Project: RadarBook
File: horn_example.py
Created by: <NAME>
On: 7/30/2018
Created with: PyCharm
Copyright (C) 2019 Artech House (<EMAIL>)
This file is part of Introduction to Radar Using Python and MATLAB
and can not be copied and/or distributed without the express permission of Ar... |
import numpy
import json
from textstat.textstat import textstat
import utilities
from sklearn.feature_extraction.text import *
from sknn.mlp import Classifier, Layer
from sklearn import cross_validation
from tokenizer import simpleTokenize
import logging
from scipy.sparse import hstack, csr_matrix
logging.basicConfig(... |
<gh_stars>1-10
from pathlib import Path
import scipy.io as io
import numpy as np
import h5py
import cv2
from utils import associate_candidate, separate_validation
import argparse
def parse_args():
"""
Parse input arguments
"""
parser = argparse.ArgumentParser(description="data path")
parser.add_argume... |
# -*- coding: utf-8 -*-
"""
A set of routines for analysing an isolated run
<NAME>
University of Zurich
"""
import warnings
import numpy as np
import pynbody
import scipy as sp
from pynbody.analysis.angmom import faceon
from pynbody.analysis.profile import Profile, VerticalProfile
from . import diskfitting, paral... |
# Copyright 2018 Heisenberg Quantum Simulations
# -*- coding: utf-8 -*-
#
# 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... |
import torch
import src.utils.visualise as vis_tools
import logging
import numpy as np
import cv2
import scipy.ndimage as ndimage
from scipy.spatial.distance import cdist
from scipy.optimize import linear_sum_assignment
#from mean_average_precision import MeanAveragePrecision
def render_polygon(mask, polygon, shape, va... |
<filename>datasets/util/Util.py
import os
import random
import numpy as np
import skimage.measure as skimage_measure
import tensorflow as tf
from scipy.ndimage import distance_transform_edt
from skimage import color
from skimage.draw import circle
from scipy.stats import norm
from datasets import DataKeys
def userna... |
<reponame>lionfish0/integral_kernel
# Written by <NAME> <EMAIL>
from GPy.kern import Kern
from GPy.core.parameterization import Param
from paramz.transformations import Logexp
import math
from scipy.misc import factorial
import numpy as np
#TODO: Is it ok for us to just fill the rest of X in with zeros?
# these won't... |
"""
This library offers functions to parse different types of SNPs data from multiple formats into a snpsData objects.
Author: <NAME>
Email: <EMAIL>
"""
import time, random
import cPickle
from snpsdata import *
import scipy as sp
import h5py
# this should be fixed
#Standard missing value is N (Used to be NA)
missi... |
from scipy.optimize import minimize
def residual(x):
return (peak_infections(x) - 0.1) ** 2
x0 = 0.5
res = minimize(residual, x0, method="Nelder-Mead", options={'fatol':1e-04})
print(res)
## Edit
import numpy as np
from scipy.integrate import odeint
from scipy.optimize import minimize
import pandas as pd
d =... |
"""
@author: <NAME>
This file is the Fourier Neural Operator for 2D problem such as the Navier-Stokes equation discussed in Section 5.3 in the [paper](https://arxiv.org/pdf/2010.08895.pdf),
which uses a recurrent structure to propagates in time.
"""
import os
from utilities3 import *
import torch
import numpy as np
i... |
<gh_stars>0
import os
import argparse
import cma
import matplotlib.pyplot as plt
from scipy.stats import nbinom
from datetime import datetime, timedelta, date
import nottingham_covid_modelling.lib.priors as priors
import numpy as np
import pints
from nottingham_covid_modelling import MODULE_DIR
# Load project modules
... |
"""
A script to bin the avgTomoSeq data into 50 sections,
and to calculate the RCCs of the entire single cell
!scaled! dataset for training of our first proper model.
Example:
python bin_RCC_calc.py
"""
import numpy as np
from scipy.stats import spearmanr
def main():
"""
Loading data, generating bins and cal... |
<reponame>mohyunho/ENAS_ELM
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 12:10:02 2015
@author: akusok
"""
from tables import open_file
from six import string_types
from six.moves import xrange
import numpy as np
from scipy.spatial.distance import cdist
# TODO: use these parameters, or remove them
def rbf_para... |
import asyncio
import errno
import fractions
import logging
import threading
import time
import sys
from typing import Dict, Optional, Set
import numpy as np
import concurrent.futures
import os
import datetime
import av
from av import AudioFrame, VideoFrame
from av.frame import Frame
from ..mediastreams import AUDIO_... |
<filename>digital_servo_python_gui/XEM_GUI_MainWindow.py
"""
XEM6010 Phase-lock box GUI, displays diagnostics on the raw signal, phase noise measurements, and loop filters tuning
by <NAME>, October 2013
"""
from __future__ import print_function
import time
from PyQt5 import QtGui, Qt
#import PyQt5.Qwt5 as Qwt
import n... |
#!/usr/bin/python
import sys, math, itertools
import numpy as np
from scipy.optimize import fmin_powell
import random
import argparse
from ast import literal_eval as make_tuple
# Used to call datgnom and outsource Dmax determination.
import general_scripts as gs
import saxscalc as sc
def read_xvgs_all(filelist):
o... |
<reponame>pnnl/Temwizard
import pandas as pd
import json
from collections import defaultdict
from itertools import combinations
import sys
import ast
import datetime
import re
import hashlib
import hyperspy.api as hs
import atomap.api as am
from os import path
from PIL import Image
import os
from sc... |
"""
(C) 2018 <NAME>
This work is licensed under the Creative Commons Attribution 4.0 International
License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.
"""
import matplotlib.pyplot as plt
import numpy as np
from scipy.io import wavfile
fs, snd = wavfile.read("output.wav")
snd... |
<filename>sympy/calculus/tests/test_singularities.py
from sympy import Symbol, exp, log
from sympy.calculus.singularities import (singularities, is_increasing,
is_strictly_increasing, is_decreasing,
is_strictly_decreasing, is_monotonic)... |
<filename>dev/do_predict_patch.py
import csv
import pandas as pd
import numpy as np
import scipy as sp
import argparse
import glob
import sys
parser = argparse.ArgumentParser()
parser.add_argument("--model", type = str, help = "path to model.h5", default = None)
parser.add_argument('-l',"--im_folder", nargs = '*', he... |
<gh_stars>100-1000
import logging
import math
import numpy as np
from scipy.spatial.distance import cdist
from libs.utils.camera_calibration import get_camera_calibration_path
from tools.objects_post_process import extract_violating_objects
logger = logging.getLogger(__name__)
class SocialDistancePostProcessor:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.