text string |
|---|
<gh_stars>100-1000
import caffe
from scipy import stats
import numpy as np
#import ipdb
class AngularErrorLayer(caffe.Layer):
"""Layer that computes SROCC and LCC on batch."""
def setup(self, bottom, top):
print '*********************** SETTING UP'
pass
def forward(self, bottom, top):
... |
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as st
# from scipy.special import erf
# Global variables that were just used in main
number_of_iterations = 100
z_range = 8
r = 0.9
r_s = 0.9
mean_gen = 0
sd_gen = 1
k_val = -2
percent_step = 0.33
# Global variables that are used in here (the mod... |
<reponame>iamlemec/battle_royale
import pytoml as toml
import numpy as np
import pandas as pd
from collections import OrderedDict
import scipy.interpolate as interp
import scipy.special as special
import scipy.optimize as opt
from mectools.bundle import Bundle
from mectools.endy import random_vec
##
## tools
##
def ... |
import time
import ray
import argparse
import nums.numpy as nps
from nums.core import settings
from scipy.sparse import random
from scipy import stats
def routine(x1, x2):
result = x1 @ x2
print(result.get_shape())
def run():
print("running nums operation")
size = 5000
# Memory used is 8 * (1... |
import numpy as np
import torch
from scipy.stats import multivariate_normal
from torch.distributions import Normal
def rmse(y_pred, y_true):
assert y_pred.shape == y_true.shape
return np.sqrt(np.mean((y_pred - y_true) ** 2, axis=0))
def crps(mu, sigma, y):
# <NAME>., <NAME>., <NAME>., & <NAME>. (2005).
... |
<reponame>aycatakmaz/packnet-sfm
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 4 07:51:43 2020
@author: aycatakmaz
"""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 3 07:59:15 2020
@author: aycatakmaz
"""
import os
import numpy as np
import matplotlib.pyplot as plt
f... |
#!/usr/bin/env python3
"""Setup the convective Taylor vortex problem
"""
# ========================================================================
#
# Imports
#
# ========================================================================
import os
import yaml
import numpy as np
import subprocess as sp
from numpy.polyn... |
# ------------------------------
# The modified mass function
# ------------------------------
#
# This code utilizes the modified mass function, S, introduced
# by Shahaf, Mazeh and Faigler (2017, MNRAS). The main advantage of the
# modified mass function i... |
<filename>Simulations/Filter_(Passive_Model).py
#%%
import numpy as np
import scipy.signal as signal
import matplotlib.pyplot as plt
#%%
N = 100
n = np.arange (N)
f = 1000
fs = 44100
x = 18 * np.sin (2 * np.pi * n * f / fs)
for i in range (N):
if x[i] > 0:
x[i] = 18
elif x[i] < 0:
x[i] = -18
#... |
from __future__ import division
import scipy.stats as st
from numpy import exp
from numpy import sqrt
def get_bernoullis():
K = [0, 1]
class Lik(object):
def __init__(self, K):
self._K = K
self.name = "bernoulli"
self.params = dict(k=K)
def _canonical(se... |
from collections import namedtuple
from typing import List
import numpy as np
from astropy.stats import LombScargle
from scipy import interpolate
from scipy import signal
from flirt.hrv.features.data_utils import DomainFeatures
VlfBand = namedtuple("Vlf_band", ["low", "high"])
LfBand = namedtuple("Lf_band", ["low", ... |
<gh_stars>0
import os;
import numpy as np;
import scipy.stats
import scipy.io
import cPickle as pickle
import copy
from scipy import misc;
import visualize;
import math;
import random;
import time;
import util;
from tube_db import Tube, Tube_Manipulator,TubeHash_Manipulator,TubeHash
from collections import namedtuple
i... |
from pathlib import Path
from statistics import median
from typing import Dict
import pdf2image
import pytest
from courier.config import get_config
from courier.extract.utils import get_filenames
CONFIG = get_config()
def pdf_stats() -> Dict[str, int]:
tot_pages = []
for file in Path(CONFIG.pdf_dir).glob('... |
from scipy.interpolate import interp1d
from .fpa import generate_profile_faces, retrieve_contour_landmark_aug
__all__ = ['FacePoseAugmentor']
class FacePoseAugmentor(object):
def __init__(self) -> None:
pass
def __call__(self, image, tddfa_result, delta_poses, landmarks=None):
pass
|
<filename>BSSN/ShiftedKerrSchild.py
# This module sets up Shifted Kerr-Schild initial data in terms of
# the variables used in BSSN_RHSs.py
# Authors: <NAME>, gvopal **at** gmail **dot** com
# <NAME>, zachetie **at** gmail **dot** com
# ### NRPy+ Source Code for this module: [BSSN/ShiftedKerrSchild.py](../e... |
<reponame>marcinjurek/pyMRA<gh_stars>1-10
import scipy.optimize as opt
import gc
import logging
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import pdb
import time
import sys
import scipy.linalg as lng
sys.path.append('../..')
from pyMRA.MRATree import MRATree
from pyMRA import MRATools... |
<gh_stars>0
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# ISCAM Analysis, provide functions to analyse and plot iSCAM data
# Copyright 2019,2020 <NAME>
#
# 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 Li... |
# -*- coding: utf-8 -*-
"""
Created on Sun May 19 15:50:51 2019
@author: alheritier
"""
import numpy as np
from scipy.special import softmax
from lxml import etree
from Utils import LogWeightProb as lp
from pomegranate import MultivariateGaussianDistribution, UniformDistribution, DirichletDistribution, G... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Utility functions for spatial processing."""
import click
import logging
import numpy as np
import numpy.ma as ma
import os
import pdb
import rasterio
import scipy.stats
from importlib.machinery import SourceFileLoader
utils = SourceFileLoader("lib.utils", "src/00_li... |
<gh_stars>1-10
import win32gui
import win32com.client
import re
import psutil
import time
import GPUtil
import os
from datetime import datetime
from playsound import playsound
import statistics
import pyautogui
class WindowMgr:
"""Encapsulates some calls to the winapi for window management"""
def __init__ (s... |
<reponame>duyet/soda-core
import abc
import logging
from typing import Any, List, Tuple
import numpy as np
import pandas as pd
import yaml
from pydantic import FilePath
from scipy.stats import chisquare, ks_2samp
from soda.sodacl.distribution_check_cfg import DistributionCheckCfg
from soda.scientific.distribution.gen... |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
# 1. 주가 데이터를 로드 합니다.
data = pd.read_csv("D:/Desktop/Itwill ws/rnn/cacao5.csv")
print(data.tail())
print(data.shape)
# 2. 훈련데이터와 테스트 데이터를 나눕니다.
import datetime
data['date'] = pd.to_datetime(data['dat... |
<gh_stars>0
""" Utilities related to orbits. i.e. solving Kepler's equations. """
from numpy import *
import inclination as inc
from scipy.optimize import newton
from scipy.interpolate import UnivariateSpline as interpolate
from scipy.interpolate import LinearNDInterpolator as interpnd
from scipy.interpolate import i... |
<filename>Openharmony v1.0/third_party/ltp/testcases/realtime/tools/ftqviz.py<gh_stars>1-10
#!/usr/bin/env python3
# Filename: ftqviz.py
# Author: <NAME> <<EMAIL>>
# Description: Plot the time and frequency domain plots of a times and
# counts log file pair from the FTQ benchmark.
# Prereq... |
<reponame>cerisola/fiscomp<gh_stars>0
import importlib
import numpy as np
from scipy.stats import linregress
import matplotlib.pyplot as plt
import load_data
import common
import clusters
importlib.reload(load_data)
importlib.reload(common)
importlib.reload(clusters)
def fit_beta_percolating_cluster_strength(size, co... |
import numpy as np
from scipy.sparse.linalg import expm_multiply
def evolve_continuous(H, psi0, timesteps):
psiT = expm_multiply(-1j * timesteps * H, psi0)
prob = np.real(np.conj(psiT) * psiT)
return prob
def hamming_probabilities(prob, N, normalise=False):
result = np.zeros(N + 1)
normalise_arr... |
#%%
import graspy
import matplotlib.pyplot as plt
import numpy as np
from graspy.plot import heatmap
from graspy.simulations import sbm
from scipy.stats import chisquare
from scipy.stats import fisher_exact
from scipy.stats import ttest_ind
from mgcpy.independence_tests.dcorr import DCorr
from mgcpy.hypothesis_tests... |
# -*- coding: utf-8 -*-
"""
Created on Mon May 07 17:34:56 2018
@author: gerar
"""
import os
import pandas as pd
import numpy as np
from scipy.stats.stats import pearsonr
#%%
def rmse(predictions, targets):
return np.sqrt(((predictions - targets) ** 2).mean())
#%%
def mae(predictions,targets):
return np.abs... |
import sys
sys.path.append('/home-4/<EMAIL>/work/yuan/tools/python_lib/lib/python2.7/site-packages')
sys.path.append('/home-4/<EMAIL>/work/yuan/tools/python_lib/lib/python2.7/site-packages/lib/python2.7/site-packages')
import pandas as pd
import numpy as np
import os
import networkx as nx
import pickle
from scipy.sta... |
<filename>sparse_kmedoids/tests/test_sparse.py
import pytest
def test_kmedoids():
from sklearn import neighbors, datasets
from sparse_kmedoids import kmedoids, sparse_kmedoids
import scipy.sparse
n_passes = 20
k = 3
max_iter = 1000
iris = datasets.load_iris()
obs = iris['data']
dm... |
<gh_stars>0
import numpy as np
import matplotlib.pylab as plt
import math
from scipy.stats import norm
from scipy import stats
from sklearn.metrics import mean_squared_error
import pandas as pd
import plot
def godel(read,out_array,godel_numbers):
"""Count godel numbers in a given read.
Paramet... |
<gh_stars>10-100
import sys
import io
import time
import numpy as np
from command_base import Command
from elevation import settings
import pandas as pd
import elevation
import elevation.load_data
import elevation.util
import elevation.prediction_pipeline as pp
import matplotlib.pyplot as plt
import scipy.stats as st... |
import autograd
import numpy as np
from .sensitivity_lib import _append_jvp
from copy import deepcopy
import scipy as sp
import scipy.sparse
from scipy.sparse import coo_matrix
class SparseBlockHessian():
"""Efficiently calculate block-sparse Hessians.
The objective function is expected to be of the for... |
<filename>bayesfast/samplers/hmc_utils/metrics.py
import numpy as np
import scipy.linalg
from ...utils.random import check_state
__all__ = ['QuadMetric', 'QuadMetricDiag', 'QuadMetricFull',
'QuadMetricDiagAdapt']
class QuadMetric:
def velocity(self, x, out=None):
raise NotImplementedErro... |
# coding: utf-8
# std
import string
from datetime import timedelta, datetime
import csv
import os
import shutil
import pickle
import nltk, re
# math
import numpy as np
from scipy.sparse import *
# mabed
import mabed.utils as utils
import huspacy
__authors__ = "<NAME>, <NAME>"
__email__ = "<EMAIL>"
class Corpus:
... |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D
from UncertainSCI.distributions import NormalDistribution
from scipy.stats import multivariate_normal
dim = 2
mean = np.array([0, 0])
cov = np.array([[1, 0], [0, 5]])
p = NormalDistribution(mean=mean... |
<filename>extutils/imgproc/apng2gif.py
"""Module to convert ``apng`` to ``gif``."""
import io
from dataclasses import dataclass, field
from fractions import Fraction
import os
import time
from typing import Any, Tuple, List, Optional
from zipfile import ZipFile
from PIL import Image
from .apng2png import extract_fram... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Model an instrument response for spectroscopic simulations.
An instrument model is usually initialized from a configuration used to create
a simulator and then accessible via its ``instrument`` attribute, for example:
>>> import specsim.simulator
... |
#
# Vector class
#
import pybamm
import numpy as np
from scipy.sparse import csr_matrix
class Vector(pybamm.Array):
"""node in the expression tree that holds a vector type (e.g. :class:`numpy.array`)
**Extends:** :class:`Array`
Parameters
----------
entries : numpy.array
the array asso... |
import numpy as np
import scipy.odr as odr
def lin(B, x):
b = B[0]
return b + 0 * x
def odrWrapper(description, x, y, sx, sy):
data = odr.RealData(x, y, sx, sy)
regression = odr.ODR(data, odr.Model(lin), beta0=[1])
regression = regression.run()
popt = regression.beta
cov_beta = np.sqrt(n... |
<filename>model.py
import numpy as np
import csv
import cv2
from scipy import ndimage
from keras.models import Sequential
from keras.layers import Flatten, Dense, Lambda, ELU
from keras.layers.convolutional import Conv2D
from keras.layers.pooling import MaxPooling2D
from keras.layers import Cropping2D
def process_imag... |
<filename>Codes/model_cal.py
import os
import glob
import pandas as pd
import numpy as np
import scipy as sp
from scipy.interpolate import interp1d
from datetime import timedelta
# import matplotlib.pyplot as plt
# import warnings
from keras.preprocessing import sequence
import tensorflow as tf
from keras... |
<gh_stars>0
import os,re,json
import torch
import numpy as np
import torch
from torch.utils.data import Dataset,DataLoader
from mltool import tableprint as tp
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt
from .normlization import normlizationer,norm_dict
from .utils import *
from .Curve2vecto... |
<reponame>IoannisNasios/M5_Uncertainty_3rd_place
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
###############################################################################
################################# M5 UNCERTAINTY ##############################
###############################################################... |
<reponame>neural-reckoning/HumanlikeHearing
from .library import speech_voltmeter_svp56 as svp56
from .library import a_weighting
import numpy as np
import scipy
import soundfile
import librosa
class Sound(np.ndarray):
"""
A Sound object behaves as a numpy ndarray but incorporates level_dB and samplerate_Hz
... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright (c) 2020, Sandflow Consulting LLC
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, ... |
# -*- coding: utf-8 -*-
"""
calculate bands distance
"""
import numpy as np
from aiida import orm
from aiida.engine import calcfunction
@calcfunction
def calculate_bands_distance(bands_structure_a: orm.BandsData,
bands_parameters_a: orm.Dict,
bands_structure_... |
import numpy as np
import math
import scipy.constants
def confmap2ra(radar_configs, name, radordeg='rad'):
"""
Map confidence map to range(m) and angle(deg): not uniformed angle
:param radar_configs: radar configurations
:param name: 'range' for range mapping, 'angle' for angle mapping
:param rado... |
import h5py
import numpy
import scipy.stats
from sklearn.metrics import confusion_matrix
from crowdastro.experiment.results import Results
from crowdastro.crowd.raykar import RaykarClassifier
def raykar_params(crowdastro_path, results_path, method, n_annotators=50):
results = Results.from_path(results_path)
... |
<reponame>TanselArif-21/ds_modules_101
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import statsmodels.api as sm
from sklearn.preprocessing import PolynomialFeatures
import statsmodels.formula.api as smf
import scipy
import plotly.express as px
import plotly.graph_objects... |
<reponame>abraker-osu/osu_analyzer<filename>analysis/mania/map_metrics.py<gh_stars>0
import numpy as np
from scipy import signal
from ..utils import prob_trials
from .action_data import ManiaActionData
class ManiaMapMetrics():
"""
Raw metrics
"""
@staticmethod
def calc_press_rate(action_data, c... |
<filename>functions_legacy/blsimpv.py
from scipy.optimize import root, brentq
from blsprice import blsprice
def blsimpv(p, s, k, rf, t, div=0, cp=1):
"""
Computes implied Black vol from given price, forward, strike and time.
"""
f = lambda x: blsprice(s, k, rf, t, x, div, cp) - p
result = brentq(... |
"""
Scripts calculates SIT trends from LENS
Notes
-----
Source : http://psc.apl.washington.edu/zhang/IDAO/data_piomas.html
Author : <NAME>
Date : 23 February 2017
"""
### Import modules
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as c
import datetime
import read_SeaIceTh... |
# Import standard functions from numpy.
import numpy as np
from numpy.random import normal
# Import matplotlib and set related parameters.
import matplotlib.pyplot as plt
fig_width = 12
# Import SciPy utility functions for linear dynamical systems.
from scipy.signal import lti
from scipy.signal import dlti, dlsim
# ... |
#!/usr/bin/env python2
"""
Creates SRF files with perturbed variables.
Call from the command line specifying a type.
Type 1 is point source (create_ps_realisation)
Type 2 is not currently available
Type 3 is a finite fault
Type 4 is multiple segment finite fault
If run from the command line type 1 requires all argume... |
import numpy as np
import vedo
from scipy.spatial.transform import Rotation as scipy_Rotation
class VedoRenderer(object):
"""An interactive renderer for camera visualization."""
def __init__(self, scale=0.03):
"""Visualize cameras in an interactive scene supported by vedo.
Args:
... |
<filename>src/gmm.py<gh_stars>1-10
import os
import numpy as np
import sklearn.mixture
import matplotlib.pyplot as plt
from tqdm import tqdm
from scipy import linalg
import warnings
from sklearn.exceptions import ConvergenceWarning
warnings.filterwarnings(action='ignore', category=ConvergenceWarning)
from utils impor... |
# -*- coding: utf-8 -*-
''' Data Transforms Module
This module contains functions for transforming PV power data, including time-axis standardization and
2D-array generation
'''
from datetime import timedelta
import numpy as np
import pandas as pd
from scipy.signal import argrelextrema
from scipy.stats import mode
f... |
#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import logging
import numpy as np
from scipy import signal
def _get_non_zero_index(data: np.array):
return data.nonzero()[0]
def interpolate_nan(y: np.ndarray):
nans = np.isnan(y)
y1 = y.copy()
y1[nans] = np.interp(
... |
<reponame>eimrek/cp2k-spm-tools
"""
CP2K utilities
"""
import os
import numpy as np
import scipy
import scipy.io
import re
ang_2_bohr = 1.0/0.52917721067
hart_2_ev = 27.21138602
def is_float(s):
try:
float(s)
return True
except ValueError:
return False
def parse_cp2k_output(fil... |
"""Extract features and save as .mat files for ED-TCN. Only used for
spatial-temporal or appearance stream (in the case of 2 stream). Do NOT use
for motion stream.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import os
import sys
sys.path.insert(
... |
import scipy
from scipy import ndimage
import cv2
import numpy as np
import sys
import torch
import deeplab_resnet_sketchParse_r1
from torch.autograd import Variable
import torchvision.models as models
import torch.nn.functional as F
import torch.nn as nn
from collections import OrderedDict
import os
from os import wal... |
import math
import numpy as np
from scipy.stats import rankdata
from scipy.special import comb
from .environment import PagingEnvironment
class NormalizedPagingEnvironment(PagingEnvironment):
"""Normalized Paging Environment for pyloa.agent.PagingAgent agents to play on.
Normalized Paging Environment ranks... |
<reponame>carlosal1015/ACM-Python-Tutorials-KAUST-2015
"""
Construct a 1000x1000 lil_matrix and add some values to it, convert it
to CSC format and solve A x = b for x with a direct solver.
"""
%pylab inline --no-import-all
from matplotlib import pyplot as plt
import numpy as np
import scipy.sparse as sps
from scipy.sp... |
<filename>Lighthouse_problem.py
#!/usr/bin/env python
# coding: utf-8
# [1]
import numpy as np;import matplotlib.pyplot as plt
from IPython.display import Image
from IPython.html.widgets import interact
# [2]
Image('Lighthouse_schematic.jpg',width=500)
# The following is a classic estimation problem called the... |
import scipy.interpolate as interpolate
import matplotlib
import matplotlib.image as image
from matplotlib import rc, rcParams
import numpy as np
# Global formatting options
nearly_black = '#161616'
light_grey = '#EEEEEE'
lighter_grey = '#F5F5F5'
white = '#FFFFFF'
light_blue = '#6d9fd1'
fontsize = 16
tableau10 = [ ... |
import pandas as pd
import numpy as np
import import_data
import sort_data
from tqdm import tqdm_notebook as tqdm
import matplotlib.pyplot as plt
from scipy.spatial.distance import euclidean
from fastdtw import fastdtw
def curve_distance(a, b):
"""This function calculates the time warping distance between two cur... |
import scipy.sparse as sps
import numpy as np
from scipy.sparse.linalg import spsolve
from .base import SpookBase
from .utils import laplacian_square_S #, worth_sparsify
# from memory_profiler import profile
class SpookLinSolve(SpookBase):
"""
Spooktroscopy that involves only linear eq solving
This means:
... |
'''
file: COCO2017_dataloader.py
author: zhangxiong(<EMAIL>)
date: 2018_05_09
purpose: load COCO 2017 keypoint dataset
'''
import sys
from torch.utils.data import Dataset, DataLoader
import scipy.io as scio
import os
import glob
import numpy as np
import random
import cv2
import json
import t... |
<filename>Tmunu_analysis/__init__.py
"""
To process, analyze and plot data of the energy-momentum tensor and charge currents extracted from the Parton-Hadron-String Dynamics (PHSD) model.
Temperature and chemical potentials are obtained by using the EoS_HRG module.
"""
__version__ = '1.1.0'
import matplotlib.pyplot a... |
# -*- coding: utf-8 -*-
from __future__ import print_function
import re
import uuid
from odoo import _, api, fields, models, modules, tools
from odoo.exceptions import UserError
import base64
from PIL import Image
import os
import tempfile
from collections import defaultdict
from itertools import product
from sklearn... |
from __future__ import division
import numpy as np
from scipy.stats import norm
from scipy import stats
from sklearn.metrics.pairwise import euclidean_distances
from scipy.spatial.distance import cdist
from acquisition_maximization import acq_max
counter = 0
##########################################################... |
import os
import sys
import glob
import pandas as pd
import numpy as np
import pickle
import math
import scipy.io as sio
import time
TEXT_PATH = '../../../CMU_MOSI_Raw/Transcript/Segmented/'
LABEL_PATH = '../../../CMU_MOSI_Raw/Labels/OpinionLevelSentiment.csv'
AUDIO_PATH = '../../../data/cmumosi_alignmets_full_all.p... |
from attrbench.metrics import MaskerActivationMetricResult
import pandas as pd
from typing import Tuple, List
import numpy as np
import h5py
from attrbench.lib import NDArrayTree
from scipy.special import softmax
def _aoc(x: np.ndarray, columns: np.ndarray = None):
if columns is not None:
x = x[..., colum... |
<reponame>CreanzaLab/chipping_sparrows_time_of_day<filename>chipping_sparrows_time_of_day/withinBirdVariation.py
from __future__ import print_function
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
from matplotlib.ba... |
<reponame>vivekkhurana/handsign<gh_stars>1-10
import os
import cv2
import time
import argparse
import numpy as np
import subprocess as sp
import json
import tensorflow as tf
import scipy.misc
import operator
from queue import Queue
from threading import Thread
from utils.app_utils import FPS, HLSVideoStream, WebcamVi... |
<filename>training.py<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 24 13:30:47 2019
@author: kf4
"""
import argparse
import os
import numpy as np
import itertools
import time
import datetime
import sys
import scipy.io
import torchvision.transforms as transforms
from torchvision.utils imp... |
import numpy as np
from xaitk_saliency import GenerateDetectorProposalSaliency
import torch
from scipy.spatial.distance import cdist
import sklearn.preprocessing
class DetectorRISE (GenerateDetectorProposalSaliency):
"""
This interface proposes that implementations transform black-box image
object detect... |
<reponame>willgdjones/GTEx
import os
import sys
import pickle
import matplotlib.pyplot as plt
import numpy as np
import h5py
import argparse
from sklearn.decomposition import PCA
from sklearn.linear_model import LinearRegression
from matplotlib.colors import Normalize
sys.path.insert(0, os.getcwd())
from src.utils.help... |
# coding=utf-8
# Copyright 2018 Google LLC
#
# 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 agreed t... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# © 2017-2018, ETH Zurich, Institut für Theoretische Physik
# Author: <NAME> <<EMAIL>>
import sympy as sp
import symmetry_representation as sr
import kdotp_symmetry as kp
orbitals = [
sr.Orbital(position=coord, function_string=fct, spin=spin)
# for spin in (sr.... |
<filename>nets.py
#!/usr/bin/python
"""
Copyright 2018 <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, me... |
<gh_stars>0
import numpy as np
import matplotlib.pyplot as plt
import scipy.optimize
import scipy.interpolate
data = np.genfromtxt("data.txt", unpack=True, skip_header=1)
data[0] *= 0.2
plt.figure()
plt.plot(data[0], data[1], 'o')
plt.show() |
<gh_stars>0
import numpy as np
from scipy.fftpack import fft2, ifft2, fftshift
from skimage.transform import radon, iradon
from scipy.spatial import distance_matrix
from scipy.ndimage import rotate
import matplotlib.pyplot as plt
h = 100 # picture size
center = np.array([h/2., h/2.])
def simple_plot(canvas):
fi... |
# Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# 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 a... |
# -*- coding: utf-8 -*-
"""test_content_based_book.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1FMx2cdM-M1NQvBWwaKhmHf5Qdy-a5Auk
"""
import pandas as pd
import numpy as np
from sklearn.metrics.pairwise import cosine_similarity
imp... |
<reponame>GeoDesignTool/GeoDT<gh_stars>0
# ****************************************************************************
#### GeoDT Bulk Visualization
# ****************************************************************************
# ****************************************************************************
#### standa... |
<gh_stars>0
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import odeint
#import ploting packages
import os
os.environ["PATH"] += ':/usr/local/texlive/2015/bin/x86_64-darwin'
plt.rc('text', usetex=True)
plt.rc('font', family='serif')
plt.tick_params(labelsize=16)
plt.clf()
#declare simulati... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
import sympy as sy
def dct(xn:np.ndarray)->np.ndarray:
"""离散余弦变换
使用矩陈乘法来计算乘积累加。
:Parameters:
- xn: 离散信号序列
:Returns: DCT变换序列
"""
N = xn.size
n = k = np.arange(N).reshape(N, 1)
wnk = np.cos(np.dot((2*n + 1) * np... |
import traceback
from pygears.typing import Fixp, Array, code
from pygears.lib import drv, check, serialize, flatten, collect
from pygears.sim import sim, cosim, log
from pygears_dsp.lib.fft_bf import FFT_list, FFT_recursive
from scipy.fft import fft
from pygears import reg
import math
########################## DESIG... |
# *****************************************************************
# Copyright 2013 MIT Lincoln Laboratory
# Project: SPAR
# Authors: SY
# Description: A regression tool for use with the results database
#
# Modifications:
# Date Name Modification
# ---- ... |
import pysplishsplash as sph
import pysplishsplash.Utilities.SceneLoaderStructs as Scenes
import numpy as np
import math
from scipy.spatial.transform import Rotation as R
def time_step_callback():
sim = sph.Simulation.getCurrent()
boundary = sim.getBoundaryModel(1)
animatedBody = boundary.getRigidBodyObj... |
import numpy as np
import pandas as pd
from scipy.io.arff import loadarff
from sklearn.ensemble import RandomForestClassifier,GradientBoostingClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix,accuracy_score,p... |
import numpy as np
import matplotlib.pyplot as plt
import Liquid_Phase_O2_Analysis as lp
from Reaction_ODE_Fitting import ODE_matrix_fit_func, reaction_string_to_matrix, reaction_string_to_numba_matrix
from utility_functions import scientific_notation, plot_func
from scipy.optimize import minimize, differential_evoluti... |
<gh_stars>1-10
import os
import numpy as np
from PIL import Image
import scipy.io as sio
import torch
from torch.utils.data import ConcatDataset, Dataset, DataLoader
import torchvision.transforms as transforms
import dataloaders.custom_transforms as tr
class SBDDataset(Dataset):
def __init__(self, params, data_d... |
import typing as tp
import matplotlib.pyplot as plt
import numpy as np
import scipy.odr
from scipy.optimize import curve_fit
from devices.mca import MeasMCA
import plot
import stats
import type_hints
# Adjusting these may result in failed fits
THRESHOLD_LEVEL = 0.5
CUT_WIDTH_MULT = 1.7
# Functions to be fit
def p... |
<reponame>NTT123/hifigan-tpu
import pickle
from argparse import ArgumentParser
from pathlib import Path
import jax
import jax.numpy as jnp
import numpy as np
from scipy.io.wavfile import write
import config
from hifigan import Generator
parser = ArgumentParser()
parser.add_argument("--model", type=Path, required=Tru... |
<reponame>banboooo044/statistics
import numpy as np
import matplotlib.pyplot as plt
import scipy.optimize
import scipy.integrate
from scipy.stats import norm,uniform
class Convert_Random:
""" 任意の確率関数に従う乱数を生成 """
def __init__(self,f,Nsim = 100000):
np.random.seed()
self.f = f
self.f_normalized = lambda x: f(x) ... |
# -*- coding: utf-8 -*-
import sys
import os
import time
import re
import operator
from numpy import *
from scipy import *
from scipy.spatial import *
from ivutils import *
from viewer import *
from mplan_env import *
class State:
def __init__(self, parent=None, avec=zeros(6)):
self.parent = parent
... |
from scipy import *
OSletters = [
["SV","SW","SX","SY","SZ","TV"],
["","SR","SS","ST","SU","TQ","TR"],
["","SM","SN","SO","SP","TL","TM"],
["","","SH","SJ","SK","TF","TG"],
["","","SC","SD","SE","TA"],
["","NW","NX","NY","NZ","OV"],
["","NR","NS","NT","NU"],
["NL","NM","NN","NO"],
["NF","NG","NH","NJ","NK"],
["NA","NB... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.