text
string
<reponame>hmajid2301/EmotionCommotion<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Nov 11 14:18:26 2016 @author: <NAME> """ # In[1] import scipy.io.wavfile as wav # Reads wav file import pandas as pd import numpy as np import os import glob import sys sys.path.append('../') from data...
<reponame>brunojacobs/ulsdpb # External modules import numpy as np from scipy.special import gammaln, digamma # # Parameter mappings # def dim_from_concatenated_vector(v): """Returns the value of K for a (2K)-vector.""" return np.int(v.shape[0] / 2) def split_concatenated_vector(v): """Split a (2K,)-ve...
from scipy import spatial import torch.nn as nn import torch from lib.config import cfg from lib.networks.rdopt.util import rot_vec_to_mat class NetworkWrapper(nn.Module): def __init__(self, net): super(NetworkWrapper, self).__init__() self.net = net def forward(self, batch): output ...
#!/usr/bin/env python import sys import os import math import numpy from rdkit import Chem, DataStructs from rdkit.Chem import rdMolDescriptors as rdmd from sklearn.cluster import MiniBatchKMeans import pandas as pd from tqdm import tqdm import time import numpy as np from scipy.spatial.distance import cdist from...
import os import numpy as np from scipy import stats import matplotlib.pyplot as plt import os def getRewardsSingle(rewards, window=1000): moving_avg = [] i = window while i-window < len(rewards): moving_avg.append(np.average(rewards[i-window:i])) i += window moving_avg = np.array(movi...
"""Import data from the EIT-systems built at the Research Center Jülich (FZJ). As there is an increasing number of slightly different file formats in use, this module acts as an selector for the appropriate import functions. """ import functools import os import numpy as np import pandas as pd import scipy.io as sio ...
<reponame>Brian-Tomasik/leveraged_investing<gh_stars>1-10 import util import numpy import math import Market import Investor import TaxRates import BrokerageAccount import plots from scipy.optimize import fsolve import os from os import path import copy import write_results import margin_leverage from random import Ra...
<reponame>Millitesla/Retina_Python_Tools #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Mar 29 18:28:07 2017 Stratification Analyzer @author: ruff """ import pandas as pd import numpy as np import matplotlib as mpl import seaborn as sns import glob import math import matplotlib.pyplot as plt import...
<reponame>poornasairoyal/Laser-Simulation<filename>laser/misc.py import numpy as np from scipy.interpolate import interp1d, interp2d from scipy.optimize import curve_fit import matplotlib.image as mpimg def get_moments(image): """ Compute image centroid and statistical waist from the intensity distribution. ...
# Distributed under the MIT License. # See LICENSE.txt for details. import numpy as np from scipy.optimize import newton def compute_alpha(density, radius): def f(a): return density * radius**2 - 3. / (2. * np.pi) * a**10 / (1. + a**2)**6 def fprime(a): return 3. * a**9 * (a**2 - 5.) / (1. +...
import numpy as np import matplotlib.pyplot as plt import scipy.integrate as sp colours = [[0, 150 / 255, 100 / 255], [225 / 255, 149 / 255, 0], [207 / 255, 0, 48 / 255], 'C3', 'C4', 'C9', 'C6', 'C7', 'C8', 'C5'] blue = [23 / 255, 114 / 255, 183 / 255, 0.75] orange = [255 / 255, 119 / 255, 15 / 255, 0.75] g...
# -*- coding: utf-8 -*- from __future__ import absolute_import from .common_scroll_geo import * from .symm_scroll_geo import * from math import pi # If scipy is available, use its interpolation and optimization functions, otherwise, # use our implementation (for packaging purposes mostly) try: from scipy.optimi...
import math from scipy.stats import pearsonr, linregress from statsmodels.stats.power import TTestIndPower def is_valid_alt_hypothesis(alt_hypothesis): """ :param alt_hypothesis: str :return: boolean """ # check for valid alt_hypothesis if alt_hypothesis not in ('!=', '>', '<'): raise ...
# -*- coding: utf-8 -*- # Copyright 2020 The PsiZ Authors. 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 # # Unless r...
<filename>python/packages/isce3/signal/doppler_est_func.py """ Collection of functions for doppler centroid estimation. """ import functools import numbers import collections as cl import numpy as np from scipy import fft def corr_doppler_est(echo, prf, lag=1, axis=None): """Estimate Doppler centroid based on com...
<reponame>jensv/relative_canonical_helicity_tools # -*- coding: utf-8 -*- """ Created on Tue Dec 1 13:48:25 2015 @author: <NAME> """ import numpy as np from pyvisfile.vtk import (write_structured_grid, UnstructuredGrid, DataArray, Appen...
# -*- coding: utf-8 -*- # Paul's Extreme Sound Stretch (Paulstretch) - Python version # Batch processing adapted from https://github.com/paulnasca/paulstretch_python/blob/master/paulstretch_stereo.py # import contextlib from numpy import * import scipy.io.wavfile import sys import wave def load_wav(filename): tr...
<filename>tests/reprsimil/test_gbrsa.py # Copyright 2016 <NAME>, Princeton Neuroscience Instititute, # Princeton University # # 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...
import tensorflow as tf from scipy import misc import numpy as np import random class ImageData: def __init__(self, load_size, channels, augment_flag): self.load_size = load_size self.channels = channels self.augment_flag = augment_flag def image_processing(self, filename): x ...
<gh_stars>10-100 # MELO: Margin-dependent Elo ratings and predictions # Copyright 2019 <NAME> # MIT License import numpy as np from scipy.special import erf, erfc, erfcinv, expit class normal: """ Normal probability distribution function """ @staticmethod def cdf(x, loc=0, scale=1): """ ...
# Copyright 2019 Xanadu Quantum Technologies Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agre...
<filename>srtm_path.py import numpy as np from pathlib import Path from scipy.interpolate import RectBivariateSpline from tkinter.messagebox import showerror, showwarning # folder name where hgt files are located: hgtfolder = 'hgt' hgtpath = Path.joinpath(Path.cwd(), hgtfolder) x = np.linspace(0, 1, 3601, dtyp...
<reponame>adagj/ECS_SOconvection #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Oct 7 17:08:18 2020 @author: adag """ import sys sys.path.insert(1, '/scratch/adagj/CMIP6/CLIMSENS/CMIP6_UTILS') import CMIP6_ATMOS_UTILS as atmos import glob import numpy as np import warnings warnings.simplefilter('ig...
import scipy.io as scio from models import PF_GCN, VM_GCN from utils import cal_DAD, gen_batches from genSamples import LoadMatSamples, loadADJ import numpy as np import os import torch import torch.nn as nn import torch.optim as optim # This script is for SR in the base case (chapter 4.1) # This script...
""" =============================================================================== DelaunayCubic: Generate semi-random networks based on Delaunay Tessellations and perturbed cubic lattices =============================================================================== """ import OpenPNM import scipy as sp import sys ...
"""Script used to generate evoked spike test data Usage: python -i import_spike_detection.py expt_id cell_id This will load all spikes evoked in the specified cell one at a time. For each one you can select whether to write the data out to a new test file. Note that files are saved without results; to generate thes...
<filename>python/irispy/mosek_ellipsoid/matlab_wrapper.py import sys from scipy.io import loadmat, savemat from irispy.mosek_ellipsoid.lownerjohn_ellipsoid import lownerjohn_inner """ MATLAB wrapper to the python lownerjohn_inner function (the MATLAB interface to Mosek Fusion fails after any call to 'clear java', so ...
<filename>lorenz.py import numpy as np from mpl_toolkits.mplot3d import Axes3D from scipy.integrate import odeint import matplotlib.pyplot as plt def lorenz96(x, t, N=5, F=8): """ This is the Lorenz 96 model with constant forcing. Code snippet adapted from a Wikipedia example. Here the differential eq...
"""Linear models based on Torch library.""" from copy import deepcopy from typing import Sequence, Callable, Optional, Union import numpy as np import torch from log_calls import record_history from scipy import sparse from torch import nn from torch import optim from ...tasks.losses import TorchLossWrapper from ......
import numpy as np import matplotlib.pyplot as plt import scipy.special as sci import math import random from astropy.io.fits import getdata ### CONSTANTS ### G = 6.67408E-11 # Gravitational constant [m^3/(kg*s^2)] M = 1.989E30 ...
<reponame>WenlinG28/Encryption-Image from PIL import Image from scipy.misc import imread,imsave import matplotlib.pyplot as plt import numpy as np background = Image.open("import2.jpg") img = Image.open("import1.jpg") width, height = img.size backg_width = 2120 backg_height = 1414 # crop the center part of...
<gh_stars>0 import streamlit as st import pandas as pd from streamlit_lottie import st_lottie import requests import matplotlib.pyplot as plt import seaborn import statistics def load_lottieurl(url: str): r = requests.get(url) if r.status_code != 200: return None return r.json() lottie_book = load...
<reponame>barbayrak/PicnicHackathon #!/usr/bin/env python # coding: utf-8 # In[1]: import math import numpy as np import pandas as pd import h5py import matplotlib.pyplot as plt import matplotlib.image as mpimg import PIL import tensorflow as tf from tensorflow.python.framework import ops import scipy from scipy imp...
<filename>models/network.py import torch import torch.nn as nn from .transformer import * import scipy.io as sio # To handle a bug class Idn(nn.Module): def __init__(self,net): super(Idn, self).__init__() self.module = net def forward(self, inputs): return self.module(inputs) def init_...
import os import numpy as np import matplotlib.pyplot as plt from scipy import stats def element_wise_difference_matrix(list1,list2): ''' difference bound matrix (DBM) https://en.wikipedia.org/wiki/Difference_bound_matrix#DBMs :param list1: :param list2: :return: ''' # using list comp...
from sympy import Wild import itertools from .Math import isZero, expand from .Symbols import mMul from .Trace import trace, sortYukTrace class TensorDic(dict): def __new__(self, *args, **kwargs): return dict.__new__(self) def __init__(self, *args, **kwargs): self.args = args self.k...
from coopr.pyomo import * from math import sin, cos, sqrt, atan2, radians import matplotlib.pyplot as plt from random import uniform import gspread from oauth2client.service_account import ServiceAccountCredentials import ast import pprint from numpy import ones, vstack, arange from numpy.linalg import lstsq from stati...
# -*- encoding: utf-8 -*- """ @File Name : __init__.py @Create Time : 2021/9/25 8:45 @Description : @Version : @License : @Author : diklios @Contact Email : <EMAIL> @Github : https://github.com/diklios5768 @Blog : @Motto : All our ...
<reponame>ccarballolozano/transhipment-problem-solver import numpy as np from scipy.optimize import linprog import os import pandas as pd def build_and_solve(o_to_d, o_to_t, t_to_t, t_to_d, o_prod, t_prod, d_dem, t_dem, o_to_d_cap, o_to_t_cap, t_to_d_cap, t_to_t_cap): n_o = o_to_d.shape[0] n_d = o_to_d.shape[...
# get_ipython().magic('matplotlib inline') import matplotlib import numpy as np import matplotlib.pyplot as plt from sklearn import linear_model import functools from scipy.stats import poisson # Generate training data for sales probability regression def generate_train_data(B=100): def rank(a, p): return...
''' Portfolio Analysis : Skewness ''' # %% set system path import sys,os sys.path.append(os.path.abspath("..")) # %% import data import pandas as pd month_return = pd.read_hdf('.\\data\\month_return.h5', key='month_return') company_data = pd.read_hdf('.\\data\\last_filter_pe.h5', key='data') trade_data = pd.read_hd...
<filename>data/scripts/dmd_jov.py """ Derived module from dmdbase.py for classic dmd. """ import numpy as np import scipy as sp from pydmd import DMDBase class DMD_jov(DMDBase): """ Dynamic Mode Decomposition :param svd_rank: the rank for the truncation; If 0, the method computes the optimal rank...
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Tue Dec 10 14:38:13 2019 @author: Nathan """ import random import numpy as np import matplotlib.pyplot as plt from matplotlib import animation from scipy.spatial import distance from collections.abc import Iterator from itertools import islice import argparse from it...
# # Author: <NAME> <<EMAIL>> # import unittest import numpy import scipy.linalg import tempfile from pyscf import gto from pyscf import scf from pyscf import dft class KnowValues(unittest.TestCase): def test_nr_rhf(self): mol = gto.M( verbose = 5, output = '/dev/null', ...
import pandas as pd import scanpy as sc from pathlib import Path from scipy.stats import zscore import json #--------------------------------------------------------- fd_rss='./out/a01_gl-meni_01_rss' fd_ada='./out/a00_pp_00_load' fd_out='./out/a01_gl-meni_02_hm-pp' #--------------------------------------------------...
# Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # License: BSD (3-clause) from __future__ import division from os import path as op import numpy as np from scipy.linalg import pinv from math import factorial from .. import pick_types, pick_info from ..io.constants import FIFF from ..forward._compute_forward...
<reponame>takacsistvan01010101/OCR_API """Filename: server.py """ import os import pandas as pd from sklearn.externals import joblib from flask import Flask, jsonify, request app = Flask(__name__) @app.route('/predict', methods=['POST']) def apicall(): """API Call Pandas dataframe (sent as a payload) from A...
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- """ ================== prospect.utilities ================== Utility functions for prospect. """ import os, glob from pkg_resources import resource_string, resource_listdir import numpy as np import astropy.io.fits from astropy.t...
<gh_stars>0 from glue.config import data_factory from glue.core import Data from pathlib import Path import stl from stl import mesh import numpy as np from scipy import interpolate __all__ = ['is_3dgnome', 'read_3dgnome'] def is_3dgnome(filename, **kwargs): return filename.endswith('.stl') def fix_file(filenam...
<reponame>yihui-he/Estimated-Depth-Map-Helps-Image-Classification<gh_stars>10-100 #! /usr/bin/python # file: import-caffe.py # brief: Caffe importer # author: <NAME> and <NAME> # Requires Google Protobuf for Python and SciPy import sys import os import argparse import code import re import numpy as np from math impor...
import math import cmath energy = [0]*28 #[s] read energy for Sz in range(1,28,2): #[s] read file f_name = 'Sz%d/output/zvo_energy.dat' % Sz f = open(f_name) tmp = f.read() f.close #[e] read file line = tmp.split("\n") for name in line: x = name.split() if x[0] == "Energy": tmp_energy =...
<filename>phasepy/sgt/path_hk.py<gh_stars>10-100 from __future__ import division, print_function, absolute_import import numpy as np from scipy.optimize import fsolve from scipy.integrate import cumtrapz from .cijmix_cy import cmix_cy from .tensionresult import TensionResult def fobj_beta0(dro, ro1, dh2, s, temp_aux,...
#!/usr/bin/env python import matplotlib.pyplot as plt from scipy.stats import truncnorm from time import sleep def generate_group_membership_probabilities(num_hosts, mean, std_dev, avg_group_size = 0): a , b = a, b = (0 - mean) / std_dev, (1 - mean) / std_dev midpoint_ab = (b + a) / 2 scale = 1 / (b - a) ...
import logging import socket import pickle from select import select from gen import generate_code_str import time import os import numpy import scipy from net import * if __name__ == '__main__': logging.basicConfig(level=logging.INFO) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settimeout(15)...
<gh_stars>0 from setuptools import setup, find_packages import os # Taken from setup.py in seaborn. # temporarily redirect config directory to prevent matplotlib importing # testing that for writeable directory which results in sandbox error in # certain easy_install versions os.environ["MPLCONFIGDIR"]="." # Modified ...
import numpy as np import xarray as xr from scipy.spatial import Voronoi from scipy.spatial import Delaunay from ..graph import Graph from ...core.utils import as_id_array from ..ugrid import (MESH_ATTRS, update_node_coords, update_nodes_at_link, update_links_at_patch) def remove_bad_patches(m...
import argparse import numpy as np import numpy.random as npr import scipy import os import seaborn as sns import matplotlib.pyplot as plt import time import random from load_data import DSprites, Cars3D, MPI3D, SmallNORB import pandas as pd from utils import uniformize, IRS_score, betatc_compute_total_correlation, D...
<reponame>neuromusic/waver import numpy as np import scipy.ndimage as ndi from tqdm import tqdm # from napari.qt import progress as tqdm from ._detector import Detector from ._grid import Grid from ._source import Source from ._time import Time from ._wave import WaveEquation class Simulation: """Simulation of w...
<reponame>certik/sympy-oldcore """examples for print_gtk. It prints in gtkmathview using mathml""" import sys sys.path.append("..") from sympy import * from sympy.printing import print_gtk x = Symbol('x') #l1 = limit(sin(x)/x, x, 0, evaluate=False) #print_gtk(l1) l2 = integrate(exp(x), (x,0,1), evaluate=False) pri...
""" Testing data augmentation composed of rotations and reflections. """ import matplotlib.pyplot as plt import numpy as np import scipy.ndimage import tensorflow.keras as keras def with_numbers(): """ Test with a simple numbered array. Note that this uses scipy.ndimage.rotate for rotations, but I later...
<gh_stars>1-10 #!/usr/bin/env python """ tree_edit.py Tool that reads data from analyzed leaf networks and allows for graphcial selection of certain subtrees, followed by averaging over the associated tree asymmetries. Also exports all of the leaf metrics. <NAME> 2013 """ import os.path import os import sys import...
# Author: <NAME> # Demo: Compute largest inscribed spheres in (approximately) centroidal Laguerre diagram import numpy as np from scipy.optimize import linprog import vorostereology as vs from math import pi # NOTE: plotting requires packages not part of the dependencies. # Install via: # pip install vtk # pip install...
import numpy as np import pandas as pd from scipy import stats def get_common_timestep(data, units='m', string_output=True): """ Get the most commonly occuring timestep of data as frequency string. Parameters ---------- data : Series or DataFrame Data with a DateTimeIndex. units : str...
<filename>interactive_grid_transformation.py import sys import os import numpy as np import matplotlib.pyplot as plt import seaborn as sns from matplotlib.figure import Figure import matplotlib.image as mpimg import pandas as pd from scipy.spatial import cKDTree from PyQt4.QtCore import * import PyQt4.QtGui as QtGui ...
import scipy.io import numpy as np from util import save, read from channelPrune import takeOnlyCertainChannels from downsample import downSample files = { '01': ['1', '2', '3', '4'], '02': ['1', '2', '3'], '03': ['1', '2', '3', '4'], '04': ['1', '2', '3', '4'] } directories = ['S01', 'S02', 'S03', 'S...
from collections import OrderedDict import numpy as np import cgen as c from mpmath.libmp import prec_to_dps, to_str from sympy import Function from sympy.printing.ccode import C99CodePrinter class Allocator(object): """ Generate C strings to declare pointers, allocate and free memory. """ def __i...
<filename>deadtrees/loss/losses.py # source: https://github.com/LIVIAETS/boundary-loss # paper: https://doi.org/10.1016/j.media.2020.101851 # license: unspecified as of 2021-12-06 # only selected code from repo import logging from functools import partial from typing import Any, Callable, cast, Iterable, List, Set, Tu...
<gh_stars>0 import argparse import os os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" # see issue #152 os.environ["CUDA_VISIBLE_DEVICES"]="5" import time import shutil import torch import torch.nn.parallel import torch.backends.cudnn as cudnn import torch.optim import torch.utils.data import torchvision.transforms as ...
<filename>cosine_transform/test/tests.py from __future__ import print_function, absolute_import, unicode_literals import unittest import cosine_transform as ct import numpy from scipy.spatial.distance import cosine __author__ = 'calvin' class VariableVTransformTestCase(unittest.TestCase): def setUp(self): ...
from __future__ import print_function from time import time import torch.nn.functional as F from torch.autograd import Variable from tqdm import tqdm from torchvision import transforms import lmdb, six from torch.utils import data from PIL import Image import os import sys import numpy as np import tensorflow as tf im...
<reponame>xiaozai/openISP from matplotlib import pyplot as plt import numpy as np import csv from PIL import Image from skimage.metrics import structural_similarity as ssim from skimage.metrics import mean_squared_error from scipy.optimize import minimize, rosen, rosen_der import cv2 visualize = True def vis_img(im...
<reponame>emiliogozo/qmap import numpy as np from scipy.stats import gamma, rv_histogram import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from qm import do_qmap # sns.set_context('talk') sns.set_context('paper') sns.set_style('ticks') plt_args = { 'obs': { 'name': 'Obs', ...
<reponame>RWTH-EBC/Deep-learning-supervised-topology-detection<gh_stars>0 import numpy as np import sklearn import os from scipy.signal import savgol_filter from scipy.signal import butter from scipy.signal import wiener from scipy.signal import medfilt DATASET_NAMES = ["case_1_real", "case_1_real_sim", "case_1_sim", ...
#!/usr/bin/env python import numpy as np import pandas as pd import time import dask import dask.dataframe as dd import multiprocessing import os import logging import scipy.stats as stats import bisect from wistl.config import unit_vector_by_bearing, angle_between_unit_vectors class Tower(object): """ class...
<filename>cool_MPC/mpc_solver.py import torch from torch.autograd.functional import jacobian import numpy as np from scipy.optimize import minimize from cool_linear_solver import Variable, Constrained_least_squares from matplotlib import pyplot as plt from .tictoctimer import Tictoctimer class MPC_solver(object): ...
# -*- coding: utf-8 -*- """ Created on 30/10/2017 @Author: <NAME> Produces color image for Eta Carinae using HST images. """ from __future__ import division, print_function import os import numpy as np from astropy.io import fits import matplotlib.pyplot as plt from astropy.wcs import WCS from astropy.coordinates...
# %% import numpy as np import pandas as pd import scipy as sp import scipy.optimize from scipy.optimize import leastsq import git # Find home directory for repo repo = git.Repo("./", search_parent_directories=True) homedir = repo.working_dir # Import plotting features import matplotlib.pyplot as plt import matplot...
""" A model of thermal preference with clusters. Authors: <NAME> <NAME> Date: 01/05/2017 """ import numpy as np import math import pymc as pm import pysmc as ps from scipy.misc import logsumexp import os __all__ = ['DATA_FILE', 'load_training_data', 'pmv_functio...
<filename>moldyn/processing/data_proc.py # -*-encoding: utf-8 -*- import os from functools import wraps from pprint import pprint import numpy as np import numexpr as ne from matplotlib.tri import TriAnalyzer, Triangulation, UniformTriRefiner from scipy.spatial import Voronoi, ConvexHull import moderngl from moldyn....
<reponame>JRF-2018/simbd<gh_stars>0 #!/usr/bin/python3 __version__ = '0.0.1' # Time-stamp: <2021-01-15T17:44:23Z> ## Language: Japanese/UTF-8 """「大バクチ」の正規分布+マイナスのレヴィ分布のためのパラメータを計算しておく。""" ## ## License: ## ## Public Domain ## (Since this small code is close to be mathematically trivial.) ## ## Author:...
<reponame>deviantfero/leastfun from gi import require_version require_version( 'Gtk', '3.0' ) from gi.repository import Gtk import re as regexp import os import sys from ..proc.eparser import * from ..proc.least import * from ..proc.pdfactory import * from sympy import * WIDTH = 10 class MainGrid(Gtk.Grid): def...
<gh_stars>0 from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str import logging import requests from sympy.physics import units from indra.databases import chebi_client, uniprot_client from indra.statements import Inhibition, Agent, Evidence from collections import def...
import math import random import scipy.fftpack as fftp import numpy as np import cmath import sys import re def gaussianRnd(sig2=1.0): #function that get gaussian random number x1=0.0 x2=0.0 while(x1==0.0)and(x2==0.0): x1=random.random() x2=random.random() y1=math.sqrt(-2*sig2*math.log(x...
from scipy.spatial.transform import Rotation as R from tinkerforge.ip_connection import IPConnection from tinkerforge.bricklet_gps_v2 import BrickletGPSV2 from tinkerforge.brick_imu_v2 import BrickIMUV2 as IMU import astropy.units as u from astropy.time import Time from astropy.coordinates import SkyCoord, EarthLocati...
import json import glob import pickle as pkl import numpy as np import matplotlib.pyplot as plt import scipy.io from sklearn import svm, tree from sklearn.metrics import precision_recall_fscore_support from sklearn.preprocessing import normalize, scale from scipy.cluster.vq import whiten from sklearn.manifold import TS...
""" This module tests functions in the patient demographics module including the importation, preprocessing and selection of features. """ import sys import os import pandas as pd from icu_mortality import DATA_DIR """import datetime as datetime import numpy as np from dateutil.relativedelta import relativedelta f...
#!/usr/bin/env python ######################################################################################### # Spinal Cord Registration module # # --------------------------------------------------------------------------------------- # Copyright (c) 2020 NeuroPoly, Polytechnique Montreal <www.neuro.polymtl.ca> # # ...
import os import matplotlib.pyplot as plt import numpy as np import scipy.integrate from scipy.fftpack import fft import SBCcode from SBCcode.Tools import SBCtools class SiPMTrigger(object): def __init__(self, trig=0): self.trig=trig class SiPMPlotter(object): def __init__(self, pmt_data, left=None...
<filename>svgp/load_uci_data.py import torch from scipy.io import loadmat from sklearn.impute import SimpleImputer from math import floor import numpy as np import pandas as pd def set_seed(seed): torch.manual_seed(seed) if torch.cuda.is_available(): torch.cuda.manual_seed_all(seed) def load_airline...
<filename>metrics/fid.py<gh_stars>10-100 """ Created on Thu Dec 07 21:24:14 2019 @author: <NAME> A stand-alone program to calculate the the Frechet Inception Distance (FID) between two datasets distributions as described here : https://arxiv.org/abs/1706.08500. Usually used to evaluate GANs. Unlike the original paper,...
<reponame>OddballSports-tv/obies-eyes<gh_stars>0 # import packages import os import cv2 import imutils import argparse import numpy as np import time from pyimagesearch.descriptors.histogram import Histogram from sklearn.cluster import KMeans from scipy.spatial import distance as dist # construct the argument parser ...
import os import numpy as np import cv2 import math from scipy import io from skimage import feature from scipy import ndimage from tqdm import tqdm def canny_edge(depth, th_low=0.15, th_high=0.3): # normalize est depth map from 0 to 1 depth_normalized = depth.copy().astype('f') depth_normalized[depth_no...
import argparse import logging import matplotlib.pyplot as plt import numpy as np import os import pickle from PySide2 import QtWidgets from skimage.transform import resize import scipy.io as sio import sys import tensorflow as tf import trimesh import tqdm import yaml from pathlib import Path from collections import n...
<reponame>BriyanKleijn/DockerTest # imports import requests from math import sin, cos, sqrt, atan2, radians import pandas as pd import scipy.optimize import io import numpy as np import datetime # workaround for importing classes import sys sys.path.append('./weather_predictions/') import knmi class weather_estimate...
<reponame>julianschumann/ae-opt import numpy as np import scipy.sparse as sp from scipy.sparse.linalg import spsolve #from scikit.sparse.cholmod import cholesky def make_Conn_matrix(nelx,nely): #returns the pair with all nonzero entries in stiffness matrix nEl = nelx * nely #number of elements nodeNrs...
import warnings import numpy as np from scipy.spatial.distance import pdist, squareform from .wmean import wmean def knnimpute(x, k=3): """kNN missing value imputation using Euclidean distance. Parameters ---------- x: array-like An array-like object that contains the data with NaNs. k: ...
<filename>agents/policy_approximators.py import numpy as np from scipy.stats import binom_test from agents.stew.choice_set_data import ChoiceSetData from agents.stew.mlogit import StewMultinomialLogit import warnings class PolicyApproximator: """ Parent/base class from which other policy approximators inher...
import numpy as np import matplotlib.pyplot as plt from optimization.optimizn import * from scipy.stats import expon from scipy.optimize import minimize class Exponential(): def __init__(self, ts, xs=None): if xs is not None: denominator = sum(ts)+sum(xs) self.lmb = len(ts)/denomina...
<filename>opt/utils/kernels.py import numpy as np import numexpr as ne from scipy.linalg.blas import dgemm, sgemm def polynomial_kernel_matrix(P, Q, c, degree): """ Calculate kernel matrix using polynomial kernel. k(p,q) = (p^{T}q + c)^d Parameters: ----------- P : `numpy.ndarray` ...
import numpy as np from skimage import io from skimage.color import rgb2gray from scipy.spatial import distance import matplotlib.pyplot as plt # Configurar matplotlib plt.gray() # Cargar imagen image = io.imread('edificio_china.jpg') M, N = image.shape[:2] # Calcular DFT-2D fft = np.fft.fft2(rgb2gray(image)) # Con...