text
string
<reponame>Cristianobam/kappalib<gh_stars>0 import numpy as np from ._summary import Correlation, TTest, Descriptive from ._statistics import pooledVar from scipy.stats import t, f, norm __all__ = ['pooledVar', 'ttest', 'descriptives','correlation'] def ttest(x=None, y=None, alternative='two-sided', mu=0, data=None, ...
from __future__ import print_function import argparse import os import random import torch import torch.nn as nn import torch.autograd as autograd import torch.optim as optim import torch.backends.cudnn as cudnn from torch.autograd import Variable import math import util import classifier import classifier2 import sys...
# # This file is part of the statismo library. # # Author: <NAME> (<EMAIL>) # # Copyright (c) 2011 University of Basel # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # Redistributions of sour...
<gh_stars>10-100 """Commands to do statistics.""" import statistics from plumeria.command import commands from plumeria.util.command import string_filter from plumeria.message.lists import parse_numeric_list def format_output(n): return "{:f}".format(n) @commands.create('mean', category='Statistics') @string_...
<filename>plots/measures_of_goodness.py from IPython import embed import numpy as np import scipy.stats as stats import pandas as pd import os import sys networks_path = os.path.abspath(os.path.join((os.path.abspath(__file__)), '../../networks')) NNDB_path = os.path.abspath(os.path.join((os.path.abspath(__file__)), '....
# -*- coding: utf-8 -*- """Quantum_MNIST.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1WfmQHWMyJ6Dx1roE-Hm3RToyNHPuR_X5 [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github.com/R...
<reponame>alostbear/pymoo import matplotlib.pyplot as plt import numpy as np from scipy.spatial.distance import pdist, squareform, cdist from pymoo.model.problem import Problem class TravelingSalesman(Problem): def __init__(self, cities, **kwargs): """ A two-dimensional traveling salesman proble...
""" C++ Export ---------- This module provides all necessary functionality specify an ODE model and generate executable C++ simulation code. The user generally won't have to directly call any function from this module as this will be done by :func:`amici.pysb_import.pysb2amici`, :meth:`amici.sbml_import.SbmlImporter.sb...
# -*- coding: utf-8 -*- """ Created on Sat Jun 23 16:26:58 2018 @author: manjotms10 """ import numpy as np import pandas as pd import matplotlib.pyplot as plt from keras.models import Sequential, Model from keras.layers import Dense, Conv2D, Input, MaxPool2D, UpSampling2D, Concatenate, Conv2DTranspose imp...
"""Take 2 clouds of points, source and target, and morph source on target using thin plate splines as a model. The fitting minimizes the distance to the target surface. """ from vedo import * import scipy.optimize as opt import numpy as np # np.random.seed(1) class Morpher: def __init__(self): self.source ...
<gh_stars>0 """Modified version of Conway's Game of Life Usually S[t] = CGOL(S[t-1]) where CGOL is the standard function of Conway's game of life, and S is a binary matrix denoting if a cell is alive or dead. Here it is modified to S[t] = Min(1, CGOL(S[t-1]) + L[t-1]) * (I - D[t-1]) where L and D are two matrices whi...
import matplotlib matplotlib.use('TkAgg') # This is needed for plotting through a CLI call import matplotlib.pyplot as plt import pandas as pd import os import numpy as np import itertools import seaborn as sns from scipy.stats import ks_2samp import argparse import sys # This function allows violinplots visualizati...
<reponame>wrossmorrow/blendenpik """ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # DESCRIPTION # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #...
<gh_stars>1-10 import sys import os import pandas as pd import numpy as np import scipy.interpolate def interpolate_cm(bp, map_file): """ TODO: summary docstring line. Given a base position and recombination map file return the recombination distance (in centimorgans, cM). Interpolate if required. ""...
import numpy as np from .simplemodel import SimpleForwardModel from taurex.constants import PI from taurex.util.emission import black_body from taurex.core import derivedparam import numba @numba.jit(nopython=True, nogil=True,fastmath=True) def contribute_ktau_emission(startK,endK,density_offset,sigma,density,path,wei...
<filename>cpas_toolbox/datasets/nocs_dataset.py<gh_stars>1-10 """Module providing dataset class for NOCS datasets (CAMERA / REAL).""" import datetime import imghdr import json from glob import glob import os import pickle from shutil import copyfile import time from typing import TypedDict, Optional, List import zipfil...
<gh_stars>1-10 import argparse import csv from nltk.stem.wordnet import WordNetLemmatizer from collections import defaultdict, Counter import pandas as pd from scipy.stats import zscore import math import warnings from pandas.core.common import SettingWithCopyWarning import pickle from collections import Coun...
<filename>rb/complexity/word/wd_avg_depth_hypernym_tree.py from statistics import mean from rb.complexity.complexity_index import ComplexityIndex from rb.core.lang import Lang from rb.core.text_element import TextElement from rb.complexity.index_category import IndexCategory from rb.complexity.measure_function import M...
<reponame>valantiskon/Depression-Detection-using-ML<filename>SVM.py import Twitter_Depression_Detection # Reads the input and the training sets import numpy as np from sklearn.model_selection import KFold from sklearn import svm from sklearn import naive_bayes from sklearn.preprocessing import StandardScaler, MinM...
<reponame>AndresdPM/GetGaia<gh_stars>1-10 #!/usr/bin/env python from __future__ import print_function import argparse import sys import os import subprocess import warnings import numpy as np import pandas as pd pd.options.mode.chained_assignment = None import matplotlib.pyplot as plt from matplotlib.widgets import...
from itertools import combinations import numpy as np from scipy import optimize import scipy import itertools from numerik import lrpd, rref, ref, gauss_elimination np.set_printoptions(linewidth=200) # REF: # MYERS, <NAME>.; MYERS, <NAME>. # Numerical solution of chemical equilibria with simultaneous reactions. # Th...
""" sip.py Computes connectivity (KS-test or percentile scores) between a test similarity gct and a background similarity gct. The default output is signed connectivity, which means that the connectivity score is artifically made negative if the median of the test distribution is less than the median of the background...
<gh_stars>1-10 import spaceM import matplotlib.pyplot as plt import numpy as np import tifffile as tif import scipy.ndimage as scim from skimage.morphology import ball def scale(input): """Scale array between 0 and 1""" return (input - np.min(input)) / ((np.max(input) - np.min(input))) def contrast(arr, min, m...
<filename>utils.py # Copyright 2020 <NAME> # Computer-assisted Applications in Medicine Group, Computer Vision Lab, ITET, ETH Zurich import tensorflow as tf import numpy as np from scipy.spatial.transform import Rotation as R def meshgrid2D(h, w): x_coords = tf.linspace(0.0, w - 1, w) x_coords = tf.reshape(x...
<reponame>DaviGarba/netanalytics import warnings import numpy as np import pandas as pd from scipy.sparse import coo_matrix from netanalytics.utils import _check_axis def get_adjacency_csv(file): data = pd.read_csv(file, index_col=0) return data.values def _params_check(G, filename, labels, axis): ...
from __future__ import print_function from __future__ import absolute_import from __future__ import division from math import sin from math import cos from math import pi from compas.geometry.basic import scale_vector from compas.geometry.basic import scale_vector_xy from compas.geometry.basic import normalize_vector...
<reponame>guoyingying432/lung-segmentation-by-unet-and-tensorflow # -*- coding: utf-8 -*- """ Created on Tue Nov 12 16:37:32 2019 @author: wjcongyu """ import cv2 import operator import numpy as np import SimpleITK as sitk from skimage import measure from scipy import ndimage from scipy import signal from...
import numpy as np from numpy import mean import math import random import functools import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from scipy import optimize from scipy.optimize import curve_fit from fitEllipse import fit_ellipse graphWidth = 800 # units are pixels graphHeight = 600 # units ...
<gh_stars>1-10 # -*- coding: utf-8 -*- # # This file is part of the pyFDA project hosted at https://github.com/chipmuenk/pyfda # # Copyright © pyFDA Project Contributors # Licensed under the terms of the MIT License # (see file LICENSE in root directory for details) """ Widget for plotting impulse and general transien...
<filename>causaldag/classes/gaussdag.py # Author: <NAME> """ Base class for DAGs representing Gaussian distributions (i.e. linear SEMs with Gaussian noise). """ import operator as op import itertools as itr from typing import Any, Dict, Union, Set, Tuple, List import numpy as np from numpy import sqrt, diag from numpy...
from typing import Callable, Iterable, List, NamedTuple import io import os import subprocess import sys import numpy as np from scipy.io import wavfile class Audio(NamedTuple("Audio", [("rate", int), ("data", np.ndarray)])): """A raw audio object with its rate as metadata. Attribute: rate: The sam...
# -*- coding: utf-8 -*- import matplotlib.pyplot as plt import numpy as np from scipy.constants import pi from scipy.special import binom import warnings from .utilities import _initialize_figure, _format_axes class _BasePipe(object): """ Template for pipe classes. Pipe classes inherit from this class. ...
import numpy as np from scipy.optimize import fsolve from numpy.random import uniform from numpy import vectorize #Gamma: 0.5625 #gamma: 2.0 #Aggragate Labor Good 0.9505050505050505 #Aggragate Labor Good 0.908080808080808 @vectorize def U(c,n, Gam,gam): if c<=0 or n<0 or n>1: u = -np.inf ...
<reponame>jsleb333/transboost import numpy as np import scipy.ndimage as sn class AffineTransform: """ Computes the affine transformation from affine parameters and applies it to a matrix to transform, using its indices as coordinates. """ def __init__(self, rotation=0, scale=1, shear=0, translation=(...
import sys import cmath # convert -1 + i decimal int to plural num = sys.argv[1:] if len(num) == 0: print ("Converts a base -1 + 1j number, given in decimal") print ("of hex, to the form a + bj, with a, b real.") sys.exit() num = eval(num[0]) r = 0 weight = 1 while num > 0: if num & 1: r = r + weight; weight ...
from nlp.core import get_encoder, MODELS, get_distance_func import numpy as np from scipy.spatial.distance import cosine import math gpt2_center = list(map(float, open("center.txt", 'r').read().strip('][').split(', '))) def create_test(main_statement, comparisons): def tests(distance_func, file_p): # main_...
<gh_stars>1-10 # # This implementation is based on https://github.com/WXinlong/SOLO/blob/master/tools/test_ins_vis.py # import json import numpy as np import pycocotools.mask as mask_util import mmcv from scipy import ndimage import cv2 from tqdm import tqdm from config import dataset_meta def vis(conf_threshol...
import numpy as np import scipy as sp import qutip as qt from pyqm import purity from numpy.testing import assert_, assert_equal, assert_almost_equal def test_purity(): """ Test the purity function """ psi = qt.fock(3) rho_test = qt.ket2dm(psi) test_pure = purity(rho_test) assert_equal(test...
<reponame>aaronchantrill/jasper-client<gh_stars>1-10 import logging import os import requests import sys import scipy.io.wavfile as wav from jasper import plugin try: from deepspeech.model import Model deepspeech_available=True except ImportError: deepspeech_available=False class DeepSpeechSTTPlugin(plugi...
import numpy as np import numpy.linalg as la import numpy.random as npr import scipy.linalg as sla from functools import reduce import matplotlib.pyplot as plt def mdot(*args): """Multiple dot product.""" return reduce(np.dot, args) def sympart(A): """Return the symmetric part of matrix A.""" return...
"""Checks import order rule""" # pylint: disable=unused-import,relative-import,wrong-import-order,using-constant-test # pylint: disable=import-error import six import logging.config import os.path from astroid import are_exclusive import logging # [ungrouped-imports] import unused_import try: import os # [ungroup...
import numpy as np from scipy import optimize # Adapted from the SciPy Cookbook def calc_R(x,y, xc, yc): """ calculate the distance of each 2D points from the center (xc, yc) """ return np.sqrt((x-xc)**2 + (y-yc)**2) def f(c, x, y): """ calculate the algebraic distance between the data points and the mea...
<filename>skompiler/fromskast/sympy.py """ SKompiler: Generate Sympy expressions from SKAST. """ import numpy as np import sympy as sp from ..ast import IsElemwise, Mul from ._common import ASTProcessor, is_, StandardOps, StandardArithmetics def translate(node, dialect=None, true_argmax=True, assign_to='y', component...
<filename>examples/molecules/datagen.py import argparse import numpy as np import scipy.io as spio from scipy.spatial import distance as spdist import joblib import lie_learn.spaces.S2 as S2 MAX_NUM_ATOMS_PER_MOLECULE = 23 NUM_ATOM_TYPES = 5 def get_raw_data(path): """ load data from matlab file """ raw = s...
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np #from choldate import cholupdate, choldowndate import scipy.special as special import scipy.constants as constants import scipy.optimize as optimize from .lda import LDA class JLDA(LDA): ''' Join Latent Dirichlet Allocation ''' def __init...
<gh_stars>10-100 import _init_paths import cv2 from pymongo import MongoClient import time import operator import numpy as np import utils.zl_utils as zl from nltk.stem import PorterStemmer, WordNetLemmatizer from textblob import TextBlob as tb from textblob_aptagger import PerceptronTagger import nltk from nltk.tag....
import numpy as np from scipy import stats X = int(input()) N = list(map(int, input().split())) print(np.mean(N)) print(np.median(N)) print(stats.mode(N)[0][0])
<gh_stars>0 import scipy.stats import numpy as np def hypergeometric(binary_classification,feature_matrix): X = feature_matrix y = binary_classification nF = feature_matrix.shape[1] pvals = np.ones(nF) #p-values M = feature_matrix.shape[0] #total number of objects n = sum(y) #number in c...
# -*- coding: utf-8 -*- u"""SRW execution template. :copyright: Copyright (c) 2015 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function from pykern import pkcompat from pykern import pkio from pykern.pkcollec...
<filename>ProgettoLube/WebInspector/venv/Lib/site-packages/skimage/metrics/_contingency_table.py import scipy.sparse as sparse import numpy as np __all__ = ['contingency_table'] def contingency_table(im_true, im_test, *, ignore_labels=(), normalize=False): """ Return the contingency table for all regions in ...
# Copyright 2019 Xilinx 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 agreed to in writing, ...
# Copyright 2019 British Broadcasting Corporation # # 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...
<filename>kde_diffusion/kde2d.py """Kernel density estimation via diffusion for 2-dimensional data.""" __license__ = 'MIT' ######################################## # Dependencies # ######################################## from numpy import array, arange from numpy import exp, sqrt, pi...
import logging import sys from dataclasses import dataclass from typing import TextIO, Tuple, cast import scipy.stats from .abstract import AbstractEvaluator from .common import EvalResult, evaluate ScoreResult = Tuple[float, float, float] @dataclass class WilcoxonEvaluator(AbstractEvaluator): """ Evaluato...
<reponame>cqh6666/transfer_learning_code import numpy as np import scipy.io import scipy.linalg import sklearn.metrics from sklearn.neighbors import KNeighborsClassifier from sklearn.metrics import accuracy_score from sklearn.svm import LinearSVC from scipy.linalg import eig class JDA: ''' Implements Joint ...
<filename>src/speaker_verification_lstm_model.py """ This file contains the LSTM Deep Learning NN model usage for speaker identification in a phone call. An existing pre-trained model is loaded from configuration path and used to retrieve embedding from speach utterances. """ import tensorflow as tf import numpy as np...
<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 import sys sys.path.append(os.path.abspath(".")) from games.camera.came...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jun 15 13:14:02 2021 @author: shrohanmohapatra """ from sympy import symbols, integrate, simplify x, y = symbols('x y') print(simplify(integrate(1/(1-x**2-y**2),(y,0,1-x)))) # Answer to the above # sqrt(-1/(x**2 - 1))*(-log(sqrt(-1/(x**2 - 1))*(1 - x*...
""" *Function reads SLP and ENSO data from CESM control. Years listed below are for leaf/bloom March 2012-CESM correlations. Plots can create animations for SLP data* """ from control_SLP_datareader import SLP import matplotlib.pyplot as plt import numpy as np from netCDF4 import Dataset from mpl_toolkits.basemap im...
## @ingroup Methods-Aerodynamics-Common-Fidelity_Zero-Drag # compressibility_drag_wing.py # # Created: Dec 2013, SUAVE Team # Modified: Nov 2016, <NAME> # Apr 2020, <NAME> # Apr 2020, <NAME> # May 2021, <NAME> # -------------------------------------------------------------------...
<reponame>KorotkiyEugene/dsp_sdr_basic import numpy as np from common import create_harmonic, create_from_wav, usb_demod, usb_mod, plot_spectrum from common import filt, interpolate, decimate, create_complex_exponent import matplotlib.pyplot as plt from scipy.io.wavfile import write as write_wav CARRIER_FREQUENCY = ...
<reponame>kungfuai/d3m-forecasting-research from typing import Dict, List import matplotlib.pyplot as plt import numpy as np import pandas as pd from pandas._libs.tslibs.timestamps import Timestamp from statsmodels.tsa.vector_ar.var_model import VARResultsWrapper from gluonts.evaluation import Evaluator import scipy.s...
import torch import math import numpy as np import scipy.special import torch.nn.functional as F class BIMM1D(torch.nn.Module): #inherits from Module class '''Arc model for material with n_phases''' def __init__(self, n_phases): super(BIMM1D, self).__init__() #initializes superclass, does set-up ...
<reponame>qiaoxiaobin2018/mfcc_cnn # coding=utf-8 import os import time import numpy as np from keras import layers import keras.backend as K from keras.models import load_model from scipy.spatial.distance import cdist, euclidean, cosine from glob import glob from tools import get_mfcc_1,calculate_eer,get_mfcc_2 import...
<gh_stars>0 # -*- coding: utf-8 -*- """Functions for simulating dog vision. L and S response curves estimated from graph in 'Colour cues proved to be more informative for dogs than brightness' <NAME>, <NAME>, <NAME> Proc. R. Soc. B 2013 280 20131356; DOI: 10.1098/rspb.2013.1356. Published 17 July 2013 using WebPlot...
#!/usr/bin/python import argparse import nifgen import numpy as np from scipy import signal import sys import time number_of_points = 256 def calculate_sinewave(): time = np.linspace(start=0, stop=10, num=number_of_points) # np.linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None) ampli...
<filename>assets/code/GF.py from PIL import Image import numpy as np import math from scipy import signal def boxfilter(n): assert (n%2 != 0),"Dimension must be odd" a = np.empty((n, n)) a.fill(1/(n*n)) return a def gauss1d(sigma): arr_length = 6*sigma if arr_length % 2 == 0: val = ((a...
<reponame>amitkumarj441/QNET<gh_stars>10-100 from functools import partial import pytest from sympy import symbols, sqrt, exp, I, Rational, IndexedBase from qnet import ( CircuitSymbol, CIdentity, CircuitZero, CPermutation, SeriesProduct, Feedback, SeriesInverse, circuit_identity as cid, Beamsplitter, Op...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Testing the STL arbit 3D volume simulation option in pyroomacoustics Code is a slightly modified version of that on the Github repo (https://github.com/LCAV/pyroomacoustics/blob/pypi-release/examples/room_from_stl.py) """ import matplotlib.pyplot as plt import num...
<filename>pylearn2/datasets/tests/test_sparse_dataset.py """ Unit tests for ../sparse_dataset.py """ import numpy as np from pylearn2.datasets.sparse_dataset import SparseDataset from pylearn2.train import Train from pylearn2.models.model import Model from pylearn2.space import VectorSpace from pylearn2.termination_cr...
<reponame>dimitra-maoutsa/DeterministicParticleFlowControl # -*- coding: utf-8 -*- """ Created on Sun Dec 12 04:14:07 2021 @author: maout """ # optimal transport multidimensional reweighting from pyemd import emd_with_flow import numpy as np from scipy.spatial.distance import pdist, squareform __all__ = ["reweight...
import numpy as np import pandas as pd from scipy.optimize import brentq pd.set_option('mode.chained_assignment', None) class Instrument: def __init__(self, survey): # General survey information self.name = survey.instrument # General survey observing/instrument information self...
# -*- encoding: utf-8 -*- ''' @Author : lance @Email : <EMAIL> ''' from skimage import io,transform,exposure import numpy as np import os imgpath="./data/test/C3F/C3F_blockId#32756.bmp" img=io.imread(imgpath) io.imshow(img) print(type(img)) #显示类型 print(img.shape) #显示尺寸 #height/weight/channel print(img....
<filename>mcmcplot/utilities.py<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon May 14 06:24:12 2018 @author: prmiles """ import numpy as np from scipy import pi, sin, cos import sys import math def check_settings(default_settings, user_settings=None): ''' Check user settings ...
import numpy as np import scipy.stats as stats import aesara from aesara.tensor.basic import as_tensor_variable from aesara.tensor.random.op import RandomVariable, default_shape_from_params from aesara.tensor.random.utils import broadcast_params try: from pypolyagamma import PyPolyaGamma except ImportError: # p...
<reponame>ciholas/cuwb-monitor # Ciholas, Inc. - www.ciholas.com # Licensed under: creativecommons.org/licenses/by/4.0 # System libraries import numpy as np import sys import time from collections import deque from math import sqrt, log10, pi, e from scipy.signal import find_peaks_cwt # Local libraries from settings ...
import matplotlib.pyplot as plt import numpy as np from scipy.interpolate import spline T=[0.9294117647,0.9294117647,0.9294117647,0.9295624333,0.9294117647,0.9294117647,0.9294117647,0.9295624333,0.9254966887,0.9042979943,0.9006354708,0.8895382817,0.8800471559,0.8740740741,0.8666865494,0.8578298768,0.8481357987,0.84813...
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- """ This module implements an analytical along side with a numerical solution for the quantum harmonic oscillator eigenstates and eigenvalues. It is possible to compare them and plot a chart about how long it takes for achieving some arbitrary level of precisi...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Thu Jun 29 14:31:48 2017 @author: sayala <NAME> edited 7/28/2017. Includes passing interpolation parameters to this routine instead of making matlab call each iteration Also updated to include more than 6 sensors ("numsens"), as we had 9 Interpolation fix...
<filename>python/cusignal/test/test_filtering.py # Copyright (c) 2019-2020, NVIDIA CORPORATION. # 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....
"""Test functions in the h5io module These tests copy extensively from deepdish.io to test the io functions that were modified from the same library. Below is the entire text of deepdish's BSD-3 license: --- Copyright (c) 2014, <NAME> All rights reserved. Redistribution and use in source and binary forms, with or w...
<reponame>FurkanCan-eee/Convolutional-Neural-Network # Packages import tensorflow as tf import numpy as np import scipy.misc from tensorflow.keras.applications.resnet_v2 import ResNet50V2 from tensorflow.keras.preprocessing import image from tensorflow.keras.applications.resnet_v2 import preprocess_input, decode_predi...
<reponame>kastnerkyle/harmonic_recomposition_workshop import tensorflow as tf import numpy as np from scipy import linalg from scipy.stats import truncnorm from scipy.misc import factorial import tensorflow as tf from ..core import _get_name from ..core import get_logger from ..core import _get_name from ..core import...
<reponame>Muhammad-Yunus/Hoax-Classifier-App<gh_stars>1-10 from datetime import datetime import pandas as pd import numpy as np import ast import os from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer from sklearn.preprocessing import normalize from scipy import sparse from ml_core.json_util...
import numpy as np import scipy import scipy.optimize def sound_speed(gamma, pressure, density, dustFrac=0.): """ Calculate sound speed, scaled by the dust fraction according to: .. math:: \widetilde{c}_s = c_s \sqrt{1 - \epsilon} Where :math:`\epsilon` is the dustFrac ...
<gh_stars>1-10 # -*- coding: utf-8 -*- """ Created on Mon Jun 3 00:58:29 2019 Updated @author: <NAME> and xll Last updated: Jan 17 2020 Issues seem to arise if tau vector is > 1.5* freq vector, if freq vector is < 100 """ def cal_Basis(f,t,k=1e4): import numpy as np nf = f.size nt = t.size Ar = np....
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from absl import app from collections import Counter from scipy.signal import lfilter def _parse_integer(bytes): int_str = bytes.decode('ASCII') integers = [] try: int...
<reponame>MehdiN/sphere #!/usr/bin/env python """ The algorithms here are partially based on methods described in: [The Fisher-Bingham Distribution on the Sphere, <NAME> Journal of the Royal Statistical Society. Series B (Methodological) Vol. 44, No. 1 (1982), pp. 71-80 Published by: Wiley Article Stable URL: http://ww...
# -*- coding: utf-8 -*- from __future__ import print_function, division import argparse import torch import torch.nn as nn import torch.optim as optim from torch.optim import lr_scheduler from torch.autograd import Variable import torch.backends.cudnn as cudnn import numpy as np import torchvision from torchvision im...
<filename>mptpy/optimization/operations/substitution.py """ Interface for applying operations to MPTs. """ from sympy.combinatorics.partitions import RGS_enum, RGS_unrank from mptpy.optimization.operations.operation import Operation class Substitution(Operation): """ Parameter deletion operation on MPTs """ ...
<reponame>jaheel/Machine-Learning-Method_Code import numpy as np import matplotlib.pyplot as plt from scipy.spatial.distance import pdist, squareform def get_k_matrix(data, k): """ 近邻矩阵 @ param data: 样本集 @ param k: 近邻参数 @ return k_dist: 近邻矩阵 """ dist = pdist(data, 'euclidean') #距离矩阵 d...
<reponame>gsidsid/ErrorControl import numpy as np from scipy.linalg import solve import random import binascii import time noise_prob = 0.05 def decision(probability): return random.random() < probability print(" ") toControlMessage = raw_input("Enter a message: \n") binarizedMessage = ' '.join(format(ord(x), '...
from collections import defaultdict import numpy as np from scipy import sparse from ..indexing import inverse_index_dict class CatmullClarkSubdiv(object): def __init__(self, quads): quads = np.array(quads) assert quads.shape[1] == 4 self._quads_lo = quads n_verts = quads.max() +...
import scipy.signal as sps import numpy as np def smoothing(im, ny_nx, sy_sx=(1,1), mask=np.array([]), gk=np.array([]), mirror=False): """ This function performs 2D smoothing by convolving a masked image with a kernel. Parameters ---------- im : 2D array Image to be smoothed nx,ny ...
import scipy import importlib from hydroDL.master import basins from hydroDL.app import waterQuality from hydroDL import kPath, utils from hydroDL.model import trainTS from hydroDL.data import gageII, usgs from hydroDL.post import axplot, figplot import torch import os import json import pandas as pd import numpy as n...
import unittest import numpy as np import scipy.signal import ibllib.dsp.fourier as ft from ibllib.dsp import WindowGenerator, rms, rises, falls, fronts, smooth, shift, fit_phase,\ fcn_cosine class TestDspMisc(unittest.TestCase): def test_dsp_cosine_func(self): x = np.linspace(0, 40) fcn = f...
import numpy as np import pandas as pd import sys sys.path.append("..") sys.path.append("../..") import utils3 as utils from ParentThermalModel import ParentThermalModel import yaml from scipy.optimize import curve_fit # following model also works as a sklearn model. # TODO rename a1 and a2 to heating and cooling ...
import mne import numpy as np from src.utils import get_SAflow_bids from src.neuro import compute_PSD_hilbert, compute_PSD from src.saflow_params import BIDS_PATH, IMG_DIR, FREQS, FREQS_NAMES, SUBJ_LIST, BLOCS_LIST from scipy.io import savemat import pickle import argparse parser = argparse.ArgumentParser() parser.add...
from anndata import AnnData from typing import Optional from scipy.sparse import csr_matrix, find, issparse import pandas as pd import numpy as np from .. import logging as logg from .. import settings def diffusion( adata: AnnData, n_components=10, knn=30, alpha=0, multiscale: bool = True, n...
# -*- coding: utf-8 -*- """ This module is used for calculations of the orthonormalization matrix for the boundary wavelets. The boundary_wavelets.py package is licensed under the MIT "Expat" license. Copyright (c) 2019: <NAME> and <NAME>. """ # ========================================================================...