text
string
<filename>qiskit_metal/renderers/renderer_gds/gds_renderer.py # -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source ...
<reponame>jonbmartin/sigpy_rf<filename>sigpy/mri/rf/b1sel.py # -*- coding: utf-8 -*- """:math:`B_1^{+}`-selective RF Pulse Design functions. """ import numpy as np from sigpy.mri.rf import slr as slr from sigpy.mri.rf.util import dinf, b12wbs, calc_kbs from scipy.interpolate import interp1d __all__ = ['dz_bssel_rf', ...
#!/bin/python ################################################################################################### ### Name: Read zeTorch Data ### Developer: <NAME> ### Purpose: Reads zeTorch Data from a run where all of the run files are in the same directory ### Use: python read_zeTorch_data.py data_directory/ starti...
import elevation import tifffile import numpy as np import matplotlib.pyplot as plt from ECMapProb_Functions import read_input , import_map , read_map_utm , read_map_deg , matrix_deg , matrix_utm , create_inputs , create_vent_deg , create_vent_utm , read_comparison_polygon_deg , read_comparison_polygon_utm , initial_de...
import numpy as np import os import cv2 import PIL.Image as Image from scipy.signal import savgol_filter from itertools import product from string import ascii_lowercase import sys, math sys.path.append("../../IAD-Generator/iad-generation/") from csv_utils import read_csv from multiprocessing import Pool def op...
<filename>hic3defdr/analysis/alternatives.py<gh_stars>0 """ Experimental module exposing variants of the HiC3DeFDR model for benchmarking purposes. """ import numpy as np import scipy.stats as stats from hic3defdr.analysis import HiC3DeFDR from hic3defdr.util.printing import eprint from hic3defdr.util.dispersion impo...
<gh_stars>1-10 import numpy as np import matplotlib.pyplot as plt import csv from VAWT_Wake_Model import velocity_field from scipy.io import loadmat from numpy import fabs from os import path from matplotlib import rcParams rcParams['font.family'] = 'Times New Roman' rom = True # rom = False r = 0.5 # radius v = 1....
<filename>mcmc_gtb.py<gh_stars>0 #!/usr/bin/env python3 """ Markov Chain Monte Carlo (MCMC) sampler for polygenic prediction with continuous shrinkage (CS) priors. """ import scipy as sp from scipy import linalg from scipy import random import gigrnd def mcmc(a, b, phi, sst_dict, n, ld_blk, blk_size, n_iter, n_b...
import streamlit as st from alphapept.gui.utils import files_in_folder, read_log, escape_markdown from alphapept.paths import PROCESSED_PATH from alphapept.settings import load_settings import os import yaml import alphapept.io import pandas as pd import base64 import plotly.express as px from plotly.subplots import ma...
<filename>CaptionSaliency.py # -*- coding: utf-8 -*- """ Created on Thu Aug 27 15:58:48 2015 @author: haoran """ from pycocotools.coco import COCO import numpy as np import skimage.io as io import pickle import os #import nltk import matplotlib.pyplot as plt from nltk.corpus import wordnet as wn import scipy.io as si...
""" Authors: <NAME>, <NAME> Project: Graduation Thesis: GIAdog This file provides an interface to control and monitor the simulation status. """ import numpy as np import pybullet_utils.bullet_client as bc from scipy import interpolate from gym import spaces from Scene import TerrainScene from typing impo...
<gh_stars>1-10 import unittest import ros import numpy from scipy.stats import norm TOLERENCE = 0.2 class TestROS(unittest.TestCase): def test_ros(self): print "Testing on synthesized data" m = 10.0 s = 30.0 print "actual mean", m print "actual std", s ...
<gh_stars>1-10 # -*- coding: utf-8 -*- """ Created on Sun May 24 22:02:49 2015 @author: <NAME> """ import numpy as np from scipy.stats import norm from scipy.ndimage.filters import gaussian_filter from scipy.ndimage.filters import median_filter import xarray as xr """ learn from this example import xarray as xr ...
""" A combinatorial specification is a set rules of the form a -> b1, ..., bk where each of the bi appear exactly once on the left hand side of some rule. """ from copy import copy from functools import reduce from operator import mul from typing import Dict, Generic, Iterable, Iterator, List, Sequence, Set, Tuple, Uni...
import numpy as np import os from os.path import isfile, join from os import listdir import scipy.misc as misc import cv2 from PIL import Image import pdb from matplotlib import pyplot as plt import Crop_disc import parse as par import Inference as Inf from label_image import run_inference #import classifier.Inference ...
import numpy as np from scipy.linalg import eigh_tridiagonal class BNMatrix: """ Define a class to compute the B_N matrix ( with elements of b^N_mn) denoting the matrix of the operator L_c with respect to the basis T_Nn(x) by elements of b^N_mn. The matrix element b^N_mn is calculated as < T_Nm, L_c T...
#!/usr/bin/env ../../../../../dependencies/python/install/bin/python3 # -*- coding: utf-8 -*- # # This script extracts horizontal rings of edges from the stl mesh of biceps. The rings are not planar (but almost). # Use create_rings.py instead, which samples the mesh at prescribed z values and produces planar rings. # ...
<filename>merlion/models/anomaly/base.py<gh_stars>1000+ # # Copyright (c) 2022 salesforce.com, inc. # All rights reserved. # SPDX-License-Identifier: BSD-3-Clause # For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause # """ Base class for anomaly detectors. """ fr...
<filename>pypi/scipy.py import numpy as np from scipy import stats # trim mean stats.trim_mean([1,2,3,4,5,6,7,8,9], .1) # 5 # linear regression x = np.array([1,2,3,4]) y = [2,3,2,1] res = stats.linregress(x, y) list(res.intercept + res.slope * x) # [2.6, 2.2, 1.79, 1.4] # pearson corrolation r, _ = stats.pearsonr([1...
# Original Version: <NAME> (http://carpedm20.github.io) # + Source: https://github.com/carpedm20/DCGAN-tensorflow/blob/e30539fb5e20d5a0fed40935853da97e9e55eee8/main.py # + License: MIT # [2016-08-05] Modifications for Inpainting: <NAME> (http://bamos.github.io) # + License: MIT # [2017-07] Modifications for sText...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- """Folium ...
<reponame>apoorvam/smart-sensing import numpy as np import matplotlib.pyplot as plt from matplotlib import style import scipy.fftpack import scipy as sp from scipy.stats import zscore import pandas as pd from scipy.signal import butter, filtfilt from scipy import signal import warnings warnings.filterwarnings(action="i...
import os import numpy as np import scipy import cupy as cp from cupy.cuda import Device from cupy.cuda.runtime import getDeviceCount from mpi4py import MPI # import socket from ..common import _start, _finish # 計測開始 def start(method_name='', k=None): _start(method_name, k) return MPI.Wtime() # 計測終了 def f...
__doc__ = """\ a module holding simple utilities for reading bayesline chains. The conventions assumed herein are taken from the BayesWave source code: spline file structure: BayesWaveIO.c line 1737 spline model: BayesLine.c lines 1105-1139 line file structure: BayesWaveIO.c line 1773 line mo...
<reponame>LBJ-Wade/Neutron-Star-Structure import numpy as np import matplotlib.pyplot as plt from scipy.interpolate import CubicSpline global G,c G=6.67e-8 c=3e10 #Interpolating the EOS sly=np.genfromtxt("SLy.txt",delimiter=" ") nbs=sly[:,1] rhos=sly[:,2] Ps=sly[:,3] cPs=CubicSpline(rhos,Ps) crs=CubicSpline(Ps,rho...
<filename>experiment/process_activities.py import numpy as np import re import sys sys.path.insert(0, '../') import paths from scipy.constants import N_A from scipy.integrate import odeint from scipy.interpolate import interp1d class Au_Foil_Data(object): """This object is responsible for handling the postproces...
import numpy as np from PIL import Image import os from scipy.io import savemat def create_arrays(): for task_dir in os.listdir('images_background'): X = [] y = [] if not task_dir.startswith('.'): for label_dir in os.listdir('images_background/' + task_dir): if n...
<reponame>Lennart-Ma/data-efficient-gans from . import metric_utils import os import copy import dnnlib import torch import numpy as np import matplotlib.pyplot as plt from PIL import Image from skimage.metrics import structural_similarity as ssim from scipy.spatial import distance def get_ssim(**kwargs): """ ...
#use the nonlocal topological method to detect tips. # also records topologcially preserved values. #<NAME> #9.13.2021 from skimage import measure from numba import jit, njit from numba.typed import List import numpy as np, os from . import * # from .intersection import * from scipy.interpolate import interp2d from .i...
<reponame>talonchandler/polaris from polaris import spang, util import numpy as np from scipy.special import hyp1f1 from dipy.data import get_sphere import logging log = logging.getLogger('log') def three_helix(vox_dim=(130,130,130), px=(64,64,64), radius=600, scale=[1,1,1]): phant = spang.Spang(np.zeros(px + (15,...
<reponame>clean-code-craft-tcq-1/start-stats-python-AkshayUHegde import statistics class EmailAlert: def __init__(self): self.emailSent = False def trigger(self): self.emailSent = True class LEDAlert: def __init__(self): self.ledGlows = False def trigger(self): self...
import numpy as np from scipy.special import erfinv, gammainc from scipy.stats import gamma from scipy.linalg import lstsq from copy import deepcopy from obspy.geodetics.base import calc_vincenty_inverse """ Contains the auxilliary functions called by fast_lts_array.py Many of these codes are Python3 translations of...
""" Demonstration of the GazeTracking library. Check the README.md for complete documentation. """ from KalmanFilter1D import Kalman1D import cv2 from gaze_tracking import GazeTracking from scipy.interpolate import interp1d import numpy as np gaze = GazeTracking() webcam = cv2.VideoCapture("v4l2src device=/dev/video0...
__all__ = 'X', 'Y' from sympy.core.symbol import Symbol from .._r1.coord import X # coordinates of real Y axis Y = Symbol(name='y', real=True)
<reponame>stsievert/diff_classifier import matplotlib as mpl import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy.spatial import Voronoi import scipy.stats as stats import os import os.path as op from shapely.geometry import Point from shapely.geometry.polygon import Polygon import numpy.ma...
<filename>RData.py import csv import os import numpy as np from scipy.interpolate import interp1d from ActualData import ActualData # noinspection PyBroadException class RData: Rt = None Rt_t1 = [] Rt_interpolate = [] @staticmethod def load_file(file_name): if os.path.exists(file_name): ...
<reponame>bmoretz/Python-Playground # The distance of a particle from some fixed point is given by the following function. from sympy import symbols, Limit, Derivative, Integral def rate_of_change( f, a, b ): return ( f.subs( { t: b } ) - f.subs( { t: a } ) ) \ / ( b - a ) t,h = symbols( 't,h' ) sT = t**2 + 3*t - ...
from scipy.optimize import leastsq from copy import deepcopy import numpy as np import warnings def standardize_vector(vector): if vector[0] != 0: if vector[0] < 0: vector = np.array(vector) * -1 vector = vector.tolist() elif vector[1] != 0: if vector[1] < 0: ...
<reponame>charlesblakemore/opt_lev_analysis import numpy as np import matplotlib.pyplot as plt from hs_digitizer import * import glob import scipy.signal as signal import scipy.optimize as opti import re, sys from tqdm import tqdm from joblib import Parallel, delayed ncore = 30 import dill as pickle import bead_util...
<filename>DeepLearningAI/Harp.py from scipy.spatial import distance from imutils import face_utils import imutils import dlib import sys import cv2 import requests import datetime import notification import TkinterInitialScreen import pickle import json import webbrowser def eye_aspect_ratio(eye): A = distance.euclid...
<reponame>p-chambers/astra_simulator # coding=utf-8 """ This module contains classes for modelling the weather and atmosphere. The environment classes providing the simulator module with all the atmospheric data throughout a simulation. There are two environment subclasses defined here: forecastEnvironment : GFS-...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # --- # 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_st...
<reponame>elizabethnewman/tensor-fmri import numpy as np from numpy.linalg import norm from numpy.testing import assert_array_almost_equal from tensor.utils import assert_compatile_sizes_facewise, reshape import tensor.f_product as fprod from scipy.fft import dct, idct # choose dimensions to input (this will yield an...
<gh_stars>10-100 from ..utils import matrices from scipy.sparse.linalg import spsolve import numpy as np def solve_heat_flow(mesh, heat_sources, time): heat_sources = np.array(heat_sources) #hs = heat_sources.shape[0] L = matrices.laplacian_matrix(mesh) MM = matrices.mass_matrix(mesh) rhs = np...
<reponame>yujing1997/CTcnn import matplotlib matplotlib.use('Agg') #to actually be able to use matplotlib import numpy as np from scipy.misc import imsave,imread import time from keras import backend as K from vis.visualization import visualize_activation,visualize_saliency,visualize_cam,get_num_filters from vis.utils...
# Copyright 2018-2021 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...
<filename>tvd/tvd.py import geometry import networkx as nx import point import scipy.spatial as spatial class TVD(object): def __init__(self, grid, b_dist=1, n_size=1, auto=True): self.grid = grid self.auto = auto if auto: self.generate_graph(b_dist=b_dist, n_size=n_size) ...
<gh_stars>0 import random import numpy as np from biclustering import Construct_Binary_Clustering import matplotlib.pyplot as plt import scipy from functools import reduce import os import argparse import faulthandler; faulthandler.enable() class Winnow: def __init__(self,dims,i,string,data_normal=False,lr=None,d...
<reponame>chuckie82/psgeom<filename>psgeom/camera.py<gh_stars>0 #!/usr/bin/env python """ Detector Geometries =================== Briefly, geometries are organized heriarchically: there are `SensorElements` that compose the leaves of a tree. These represent arbitrary objects that actually measure e.g. photon intensit...
<reponame>shorohml/SuperComp<gh_stars>0 import numpy as np from scipy import integrate def f(x, y, z): xz_sq = x*x + z*z if xz_sq + y * y <= 1: return np.sin(xz_sq) * y else: return 0.0 if __name__ == '__main__': options = {'limit': 300} y, abserr = integrate.nquad( f, ...
import numpy as np import scipy.stats import matplotlib.pyplot as plt import time import os import pickle import pandas as pd # import seaborn as sns from sklearn.manifold import TSNE from matplotlib.ticker import FormatStrFormatter # sns.set_style("white") def get_bias(d1, d2, d3=None): z = d1 + d2 bias = 0...
<filename>single_step/ranking/candidates_extracting.py<gh_stars>1-10 import os import sys import pickle from pathlib import Path import numpy as np import pandas as pd import shutil import scipy.sparse as sp from utils.fingerprint_utils import SparseFingerprintCsrMatrix from utils.draw_utils import draw_mol_smi from ut...
<reponame>wolferobert3/vast_aaai_2022<filename>WEAT.py import numpy as np from helper_functions import cosine_similarity, std_deviation, create_permutation from scipy.stats import norm import random def permutation_test(A, B, X, Y, test_stat, permutations): distribution = [] for _ in range(permutati...
import numpy as np import matplotlib.pyplot as plt from scipy import optimize # lets just generate some data from known beta parameters x = np.linspace(0,10,30) beta0 = 2.7 beta1 = 1.3 y = (beta0*x)/(beta1+x) # determine beta0 and beta1 by minimizing the mean abs residual error def my_func(X): ...
import pathlib import numpy as np import pandas as pd import matplotlib as mpl import matplotlib.pyplot as plt from scipy.optimize import linear_sum_assignment from dicodile.config import DATA_HOME from dicodile.utils.viz import display_dictionaries OUTPUT_DIR = pathlib.Path('benchmarks_results') DATA_DIR = DATA_HO...
<reponame>goujou/CompartmentalSystems #!/usr/bin/env python # all array-like data structures are numpy.array import numpy as np from copy import copy from string import Template from sympy import Matrix, symbols, Symbol, Function, latex, atan, pi, sin, lambdify, Piecewise import matplotlib.pyplot as plt # load the com...
import collections import dataclasses import enum import functools import itertools import operator import random import re import typing from typing import ( Any, Mapping, Union, MutableMapping, Optional, TypeVar, Callable, NamedTuple, Type, Tuple, Sequence, ) import matpl...
<filename>spectrochempy/core/fitting/optimization.py # -*- coding: utf-8 -*- # ====================================================================================================================== # Copyright (©) 2015-2021 LCS - Laboratoire Catalyse et Spectrochimie, Caen, France. = ...
from datetime import time import os import pandas as pd import matplotlib.pyplot as plt from scipy.signal import find_peaks, butter, lfilter, filtfilt import numpy import math def normalizeData(data : list): maxv = max(data) minv = min(data) res = [] for i in data: res.append((i - minv)/(maxv...
<reponame>wenbin-hu/allegro_hand_ros_v4 import rospy from sensor_msgs.msg import JointState import numpy as np import scipy.io as sio import time from datetime import datetime from scipy.io import loadmat, savemat class AllegroController: def __init__(self): # define the publisher and subscriber s...
<filename>openmdao/surrogate_models/nn_interpolators/nn_base.py """Define the NNBase class.""" import numpy as np from math import ceil from scipy.spatial import cKDTree class NNBase(object): """ Base class for common functionality between nearest neighbor interpolants. Attributes ---------- _t...
from typing import Optional, Dict, List, Any from ausseabed.qajson.model import QajsonParam, QajsonOutputs, QajsonExecution from ausseabed.mbesgc.lib.data import InputFileDetails from ausseabed.mbesgc.lib.tiling import Tile import collections import numpy as np import numpy.ma as ma import scipy.ndimage as ndimage imp...
<gh_stars>1-10 import numpy as np import quinoa as qu import matplotlib.pyplot as plt import GPy as gpy from scipy import linalg #np.random.seed(31051985) X = np.random.normal(scale = 1, size = (100,1)) Y = np.sin(X) + 0.01 * np.random.normal(size = (100,1)) #kern = qu.RBF(1, 1, 1) ker = gpy.kern.RBF(1, 1, 1) kern ...
<filename>preprocessing/lineRemoval.py import numpy as np import cv2 # Hough line detection # Credit: https://vzaguskin.github.io/fourielines1/ def houghLines(img): from skimage.draw import line w, h = img.shape acc = [] for i in range(h): rr, cc = line(0, i, w-1, h-i-1) acc.append(np.s...
<gh_stars>0 #!/usr/bin/env python3 import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as anim import os import re from sys import argv from astropy.io import fits from scipy import ndimage from scipy.optimize import curve_fit from time import sleep from datetime import datetime, timedelta ...
<gh_stars>0 # coding: utf-8 # In[ ]: """ Microkinetic model for ammonia oxidation Inspired by Grabow, <NAME>. "Computational catalyst screening." Computational Catalysis. RSC Publishing, 2013. 1-58. """ # In[ ]: import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt import pickle...
<reponame>mbuhot/mbuhot-euler-solutions<filename>python/problem-033.py #! /usr/bin/env python3 description = """ Digit canceling fractions Problem 33 The fraction 49/98 is a curious fraction, as an inexperienced mathematician in attempting to simplify it may incorrectly believe that 49/98 = 4/8, which is correct, is o...
<filename>PrimalInteractive/python/PrimalInteractive/plotting/phz_plots.py """ Overview -------- general info about this module Module API ---------- """ from __future__ import absolute_import, division, print_function from builtins import (bytes, str, open, super, range, zip, round, input,...
import numpy as np import tensorflow as tf import theano.tensor as tht import scipy.misc from time import time from os.path import dirname, join import keras.backend as K from keras.models import Model from keras.layers import Layer, Input, InputLayer, Conv2D, MaxPooling2D, Activation, Conv2DTranspose from keras.prep...
<reponame>CSAILVision/placeschallenge<gh_stars>100-1000 # This script converts image annotations in a val/test into a RLE format json dataset import os import glob import argparse import json import numpy as np from scipy.misc import imread from pycocotools import mask as COCOmask def parse_args(): parser = argpar...
<reponame>charlesblakemore/opt_lev_analysis<filename>scripts/spinning/ringdown_analysis_parallel.py<gh_stars>0 import os, time, sys import numpy as np import matplotlib.pyplot as plt from iminuit import Minuit, describe from obspy.signal.detrend import polynomial import bead_util as bu import peakdetect as pdet impor...
"""Implements Exact Maximum Entropy IRL from my thesis""" import numpy as np from numba import jit from numba import types from numba.typed import Dict, List from scipy.optimize import minimize from mdp_extras import ( Linear, Disjoint, trajectory_reward, DiscreteExplicitExtras, DiscreteImplicit...
# coding=utf-8 """ Problem 57 21 November 2013 It is possible to show that the square root of two can be expressed as an infinite continued fraction. √ 2 = 1 + 1/(2 + 1/(2 + 1/(2 + ... ))) = 1.414213... By expanding this for the first four iterations, we get: 1 + 1/2 = 3/2 = 1.5 1 + 1/(2 + 1/2) = 7/5 = ...
<gh_stars>0 import sys sys.path.append("NumPy_path") import cv2 import scipy.misc import numpy as np import pcl import math import pcl.pcl_visualization import matplotlib.image as mpimg # from imresize import * from PIL import Image # import pcl.pcl_visualization # p = pcl.PointCloud(10) # "empty" point cloud # a = n...
<reponame>apahl/cellpainting2 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ ##### Tools ##### *Created on Thu Jun 7 14:45 2017 by <NAME>* Helper Tools acting on individual data.. """ import os import os.path as op import sys import glob from collections import Counter, namedtuple import yaml import pandas as ...
from collections import defaultdict from math import log10, log from threading import Thread import threading import math import pyglet import numpy as np import geoplotlib.colors as colors from geoplotlib.core import BatchPainter,FONT_NAME from geoplotlib.utils import BoundingBox import queue from inspect import isfun...
import urllib.request import json import dml import prov.model import datetime import uuid import statistics import pandas as pd from bson.code import Code class transform_citibike_byday(dml.Algorithm): contributor = 'anuragp1_jl101995' reads = ['anuragp1_jl101995.citibike'] writes = ['anuragp1_jl101995.ci...
# Copyright (c) 2018 <NAME> # Universidad Carlos III de Madrid and University of Sheffield import sys import numpy as np import GPy from GPy.inference.latent_function_inference import LatentFunctionInference from GPy.inference.latent_function_inference.posterior import Posterior from GPy.util import choleskies from GP...
""" TODO update description based on this: https://raw.githubusercontent.com/explosion/spaCy/master/examples/deep_learning_keras.py This example shows how to use an LSTM sentiment classification model trained using Keras in spaCy. spaCy splits the document into sentences, and each sentence is classified using the LSTM....
<gh_stars>0 # -*- coding: utf-8 -*- """Smoothing ROAR_Sim_waypoints_Berk.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1AHfcoJq3pELWIY2u3ghwsyE1GIXcI868 """ import numpy as np from scipy.interpolate import interp1d waypoints=np.array([[-809.3...
<filename>NeuralNetwork/RNN.py import numpy as np import pylab as pl import math from sympy import * class RNN: def __init__(self): pass def set_input_layer(self, x): self.input_layer = np.zeros(x) return self.input_layer def set_output_layer(self, x): self.output...
import pandas as pd import streamlit as st from sympy import lambdify, parse_expr from src.common.consts import TRANSFORMATIONS from src.common.methods.table_of_values_generators.equidistant_generator import EquidistantTableOfValuesGenerator from src.common.methods.table_of_values_generators.random_generator import Ra...
<filename>src/modeci_mdf/scheduler.py import os import sys import sympy from modeci_mdf.standard_functions import mdf_functions, create_python_expression from neuromllite.utils import evaluate as evaluate_params_nmllite from neuromllite.utils import _params_info, _val_info from neuromllite.utils import FORMAT_NUMPY, ...
<reponame>rokroskar/GPy import numpy as np import sympy as sp from sympy.utilities.codegen import codegen from sympy.core.cache import clear_cache from scipy import weave import re import os import sys current_dir = os.path.dirname(os.path.abspath(__file__)) import tempfile import pdb import ast from kernpart import Ke...
import numpy as np from matplotlib import pyplot as plt import pickle import scipy.stats as st def read(dim): file = open('../../data/simulation/clustering_group_{}D'.format(dim), 'rb') data = pickle.load(file) data = [dat[0] for dat in data] return np.array(data) def draw(dim, ax): settings = [...
<filename>specaugment.py #!/usr/bin/env python3 import time import random import argparse import sys import numpy as np import numpy.linalg as nl import matplotlib.pyplot as plt import librosa import librosa.display from scipy import interpolate from scipy import signal from scipy.io import wavfile from scipy.fftpack...
import sys import copy import numpy as np from scipy.misc import logsumexp import utils from environment import * class Fit(): def __init__(self, game_data = None, background_dir = None, player = None, test = False, stop_and_click = False): if game_data is not None: se...
# ================================================== # # Copyright (c) 2018, Alibaba Inc. # All Rights Reserved. # # ================================================== # -*- coding: utf-8 -*- """ EvaluationMetrics class for evaluating input data. Currently supported evaluation metrics: map,auc,mse,accuracy,ndcg@k,...
import logging import os from dataclasses import dataclass from string import Template import numpy as np import tables import pyinotify from phd.thunderstorm.convert_to_hdf5 import CylinderProtoSet from phd.utils.hdf5_tools import ProtoSetReader from phd.utils.run_tools import G4CinServer, CinServerParameters from t...
import numpy as np from scipy.spatial.distance import euclidean # Licence: GNU GPLv3 # Author: <NAME> # 2018 # objectif : # distribuer un nombre fixe d'items dans un nombre fixe de paniers # chaque item a deux attributs : categorie, poids # Cost function : # la somme des distances distribution_de_categories vs dis...
# # Autonomous driving - Car detection import argparse import os import matplotlib.pyplot as plt from matplotlib.pyplot import imshow import scipy.io import scipy.misc import numpy as np import pandas as pd import PIL import tensorflow as tf from keras import backend as K from keras.layers import Input, Lambda, Conv...
import os import sys import numpy as np from metrics_ddie import ddie_compute_metrics from scipy.special import softmax import glob _, outputs_dir = sys.argv cnt = 0 for path in glob.glob(os.path.join(outputs_dir, '*')): labels = np.load(os.path.join(path, 'labels.npy')) preds = np.load(os.path.join(path, 'pr...
import argparse import os import pickle as pkl from scipy.io import loadmat import numpy as np def parse_args(): parser = argparse.ArgumentParser(description="Generate database for RAPv2 dataset") parser.add_argument("--dataset-split", help="dataset split, e.g. train, val, test", defau...
<gh_stars>1-10 from collections import Counter import numpy as np from scipy.spatial.distance import euclidean from mla.base import BaseEstimator class KNNBase(BaseEstimator): def __init__(self, k=5, distance_func=euclidean): """Base for Nearest neighbors classifier and regressor. Parameters ...
<reponame>stairs1/memory-prosthetic-tools import time import deepspeech import numpy as np import threading from scipy import signal import pathlib import os class Buf: """ Assistant to Transcriber. This buffer holds audio data for a Transcriber until it can be fed to a deepspeech stream. This is needed to...
# MIT License # # Copyright (c) 2016 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, pub...
<filename>h5pyViewerLib/FrmProcRoiStat.py<gh_stars>1-10 #!/usr/bin/env python # *-----------------------------------------------------------------------* # | | # | Copyright (c) 2013 by Paul Scherrer Institute (http://www.psi.ch) | # | ...
import os import numpy as np import pandas as pd import tensorflow as tf import seaborn as sns from scipy.stats import spearmanr from scipy.stats.mstats import pearsonr from sklearn.metrics import mean_squared_error from sklearn.metrics import r2_score as r2 from tensorflow.core.util import event_pb2 def csr_to_spars...
<filename>2D/train_2D_rt_v2.py<gh_stars>0 import numpy as np import matplotlib.pyplot as plt from scipy.fft import irfft2 import scipy from scipy import integrate, stats from numpy import linalg import time from scipy.special import gammaln from itertools import repeat import numdifftools import torch import multipro...
<filename>tools/analysis/data.py # read snapshot and obtain multiple systems import collections from scipy import spatial as sp from .base import * from .bse import * G_MSUN_PC_MYR=0.00449830997959438 # Msun, pc, myr G_HENON=1 # Henon unit HEADER_OFFSET=24 # header offset in bytes for snapshots with the BINARY format ...