text string |
|---|
<reponame>najeeb97khan/ConvNets
## Importing required libraries
import tensorflow as tf
import pandas as pd
import numpy as np
import sys
import os
import scipy.io
from scipy import misc
import matplotlib.pyplot as plt
import tqdm
import glob
sys.path.insert(0, '../')
import visualising_vgg as vgg
## Defining constan... |
<gh_stars>0
import tensorflow as tf
import scipy.sparse as sp
from .layer_utils import *
import numpy as np
class BaseLayer(object):
def __init__(self,
input_dim, output_dim,
activation_func,
name,
dropout_prob = None,
bias = Fals... |
"""
References:
-----------
[1] https://github.com/lars76/kmeans-anchor-boxes/blob/master/kmeans.py
[2] https://github.com/ultralytics/yolov5/blob/master/utils/general.py#L752
"""
import numpy as np
from scipy.cluster.vq import kmeans
import torch
def iou(box, clusters):
"""
Calculates the Intersection over ... |
<reponame>Arunken/PythonScripts
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 3 13:41:32 2018
@author: SilverDoe
"""
'''
SciPy has many modules, classes, and functions available to read data from and write data to a variety of file formats.
https://docs.scipy.org/doc/scipy/reference/io.html
'''
import scipy.io as... |
<filename>modeling/main/crossvalidation/experiment.py
import pandas as pd
import os
import util
import modeling.feature_extraction as fe
from modeling import common
from scipy import stats as st
from sklearn import metrics
import numpy as np
import keras
from sklearn.linear_model import RidgeCV, LogisticRegressionCV
fr... |
<filename>src/model/tools.py
from collections import OrderedDict
import numpy as np
from scipy import signal
from sklearn.cluster import KMeans
import torch
from torch import nn
from torch.nn import functional as F
from torch.utils.data.dataloader import DataLoader
def copy_with_noise(t, noise_scale=0.0001):
ret... |
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
import sys
#import argparse
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import h5py
import copy
from scipy.signal import savgol_filter
from scipy.stats import entropy
#from scipy import ndimage
# # SlidingHistogram: AttentionMe... |
import numpy as np
from global_matching import matching_upd
from scipy.sparse import csr_matrix
import time
import glob
import pickle
from sklearn.base import BaseEstimator, ClusterMixin
import os
def load_sparse_csr(filename):
loader = np.load(filename)
return csr_matrix((loader['data'], loader['indices'], l... |
<reponame>Marc-Goritschnig/SOS_Ex_3_SOM
import numpy as np
from visualizations.iVisualization import VisualizationInterface
from scipy.spatial import Voronoi
from skimage.draw import polygon
from controls.controllers import SkyMetaphorController
import holoviews as hv
import panel as pn
import scipy.ndimage
class Sky... |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 5 09:33:58 2019
@author: constatza
"""
import numpy as np
import matplotlib.pyplot as plt
import fempy.smartplot as smartplot
import fempy.mathematics.manilearn as ml
from scipy.stats import zscore
import fempy.mathematics.statistics as stat
plt.close('a... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# MEASURE - Master Equation Automatic Solver for Unimolecular REactions
#
# Copyright (c) 2010 by <NAME> (<EMAIL>)
#
# Permission is hereby granted, free of charge, to any person obtai... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
# test_fastKNN.m
# <NAME>
# script based on README
# Dataset taken from http://www.jiaaro.com/KNN-for-humans/
# -------------------------------------------------------
# | weight (g) | color | # seeds || Type of fruit |
# |==============|... |
# -*- coding=utf-8 -*-
# Kalman filter example demo in Python
# http://www.cs.unc.edu/~welch/kalman/kalmanIntro.html
# by Even
# _*_coding:utf-8_*_
import pywt
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
# from statsmodels.robust import stand_mad
'''
Kalman滤波本身是贝叶斯滤波体系的,建立... |
<gh_stars>0
"""
Modules defining a series of utility functions to perform hankel transformation
and Fourier transformation from correlation function to power spectrum.
"""
from typing import List
import numpy as np
import scipy.integrate as intg
from scipy.stats import poisson
import time
from scipy.interpolate import... |
<filename>graphs/models/time_frequence.py<gh_stars>10-100
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
import scipy.signal
class ifft(nn.Module):
def __init__(self, nfft=1024... |
from __future__ import division
from __future__ import print_function
# import re
import sys
import math
from scipy.io import wavfile
import numpy as np
import h5py
from numpy.lib.stride_tricks import as_strided
import tensorflow as tf
from tensorflow.keras.layers import Input, Reshape, Conv2D, BatchNormalization, Sof... |
"""Load the TIMIT dataset."""
import os
from scipy.io import wavfile
from python.params import MIN_EXAMPLE_LENGTH, MAX_EXAMPLE_LENGTH
from python.dataset.config import CORPUS_DIR
from python.dataset.txt_files import generate_txt
# Path to the TIMIT dataset.
__NAME = 'timit'
__FOLDER_NAME = 'timit/TIMIT'
__TARGET_P... |
<reponame>Peter-E-Martin/HeFTy_GOFplotter<gh_stars>0
# -*- coding: utf-8 -*-
'''
This code takes the .txt output from HeFTy (saved by right-clicking on the Time-Temperature history
and chosing "Export --> Save as Text...") and replots the data using a weighted mean of the goodness
of fit modeled by HeFTy.
It is meant ... |
#!/usr/bin/env python3
import argparse
import mcb185
import statistics
# Write a program that computes statistics about a fasta file
# Number of sequences
# Total length
# Minimum and maximum lengths
# Average and median lengths
# N50 length
# Use argparse
# Make useful functions and add them to your librar... |
import argparse
import numpy as np
import torch
import json
import subprocess
import pandas as pd
import matlab.engine
from scipy.interpolate import interp1d
from skimage.morphology import dilation
from scipy.signal import medfilt
from skimage import measure
from PIL import Image
from scipy.io import loadmat
from colle... |
<gh_stars>1-10
# Get population sparseness
# Run as: python get_spar_biophys.py basedir
# basedir is eg data_r20
# Saves results as .mat in basedir
import numpy as np
import pickle as pkl
import scipy.io as io
from datetime import datetime
import sys
basedir = sys.argv[1]
def get_spar(x):
N = x.shape[0]; T =x.shap... |
import numpy as np
from scipy.linalg import solve
import pytest
from shenfun import inner, TestFunction, TrialFunction, div, grad, \
SparseMatrix, FunctionSpace, Function, Array, la
np.warnings.filterwarnings('ignore')
N = 10
d = [
{0: np.arange(N)+1},
{0: -2, 2: 1},
{-1: 1, 0: -2, 1: 1},
{-2: 1, 0... |
<reponame>massimovassalli/softmech
#import the main panels structure, required
from ..panels import fitPanel
#import here your procedure-specific modules, no requirements (numpy as an example)
import numpy as np
from scipy.optimize import curve_fit
import math
#Set here the details of the procedure
NAME = '<NAME>' #Na... |
import numpy as np
from scipy.sparse import lil_matrix
from utils.dataset import *
class TensorTypeGraph(object):
def __init__(self, triple_dat, n_ent, n_rel):
self.rel2mat = [lil_matrix((n_ent, n_ent)) for _ in range(n_rel)]
for triple in triple_dat.batch_iter(1, rand_flg=False):
su... |
"""
=============================================================
Receiver operating characteristic (ROC) with cross validation
=============================================================
Example of Receiver operating characteristic (ROC) metric to
evaluate the quality of the output of a classifier using
cross-valid... |
<gh_stars>0
import os
from os.path import join
import tempfile
import math
import numpy as np
import pandas as pd
import zarr
from numcodecs import Zlib
from scipy.sparse import csr_matrix
from scipy.sparse import coo_matrix
from starlette.responses import JSONResponse, UJSONResponse
from starlette.routing import Rou... |
import datetime
import difflib
import inspect
import os
import logging
import time
from functools import wraps
import io
import sys
import numpy as np
from scipy.sparse import csr_matrix
import mpmath
from sympy import lambdify, symbols
from sympy.utilities.decorator import conserve_mpmath_dps
t = symbols('t', real=... |
from __init__ import *
import sys
import subprocess
import numpy as np
from fractions import Fraction
sys.path.insert(0, ROOT)
from compiler import *
from constructs import *
def pyramid_blending(pipe_data):
R = Parameter(Int, "R")
C = Parameter(Int, "C")
x = Variable(Int, "x")
y = Variable(Int, "y... |
"""
Parse through files with Divvy raw data.
Group trips by day in order to average trip time.
"""
import csv
import pandas as pd
from statistics import mean
# create place to store ride durations for each day
sun_times = []
mon_times = []
tues_times = []
wed_times = []
thurs_times = []
fri_times = []
sat_times = []
... |
# -*- coding: utf-8 -*-
"""
@author: <NAME>
"""
import os
import warnings
from time import perf_counter
import numpy as np
from scipy.sparse.linalg import spsolve
from ._hf_data_class import HighFidelityData
from ._plotting import plot_singular_values, plot_relative_information_content, plot_mesh, plot_displacement,... |
# -*- coding: utf-8 -*-
# encoding=utf8
from __future__ import unicode_literals
'''#############################'''
'''#####Importing Libraries#####'''
###################################
import sys
import os
import io
import re
import pickle
from random import randint as rnd
from random import shuffle
from itertools i... |
import h5py
import numpy as np
import matplotlib.pyplot as plt
import scipy.integrate
filename = 'contour_0000100.h5'
h5file = h5py.File( filename, mode = "r" )
def get_source_current( h5file ):
time_step = h5file["/TimeGrid"].attrs["time_step_size"]
charge = h5file["/ParticleSources/cathode_emitter"].attrs["... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import abc
import numpy as np
from scipy.stats import chi2
from gammapy.utils.roots import find_roots
from .fit_statistics import cash, wstat
__all__ = ["WStatCountsStatistic", "CashCountsStatistic"]
class CountsStatistic(abc.ABC):
@property
def... |
import gym
import numpy as np
from numpy.random import normal
from scipy.stats import skewnorm
from gym import error, spaces, utils
from gym.utils import seeding
from gym.envs.toy_text import discrete
LEFT = 0
RIGHT = 1
SKEWNESS = -6
def categorical_sample(prob_n, np_random):
"""
Sample from categorical d... |
<reponame>AlexTsagas/Quality-Graphs
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rc
import pandas as pd
from scipy.optimize import curve_fit
# Write with LaTeX
rc('text', usetex=True)
rc('font', family='serif')
# Read .csv file
file = pd.read_csv('Exp1.csv', header=None)
a = file[0][19:3... |
from scarpa.generate.template import stack_template
from scarpa.generate.modulation import create_modulation
from scarpa.estimate.contraints import (
constraint_template_mean,
constraint_template_range,
)
from scipy.signal import hilbert, correlate, medfilt
from scipy.linalg import norm
import numpy as np
from ... |
from __future__ import absolute_import, division, print_function
from datetime import datetime
from numpy import nan, isnan
from pandas import DataFrame
from sympy import Eq, Expr, Max, Min, Piecewise, Symbol, symbols
from sympy.printing.theanocode import theano_function
from HelpyFuncs.SymPy import sympy_eval_by_thean... |
<filename>data_generator.py
import h5py
import numpy as np
import keras
from yad2k.models.keras_yolo import preprocess_true_boxes
import scipy.ndimage as ndi
from skimage import transform
import PIL
from spine_preprocessing.spine_preprocessing import process_data
import cv2
def random_rotation_with_boxes(x, boxes, rg,... |
#!/usr/bin/env python
import rospy
import tf
import scipy.linalg as la
import scipy.signal as sig
import numpy as np
from math import *
import mavros_msgs.srv
from mavros_msgs.msg import AttitudeTarget
from nav_msgs.msg import Odometry
from std_msgs.msg import *
from test.msg import *
from geometry_msgs.msg import *
fr... |
<filename>data-prepare/PythonAPI/salicon/salicon.py
__author__ = 'shane-huang'
__version__ = '1.0'
# Interface for accessing the SALICON dataset - saliency annotations for Microsoft COCO dataset.
import copy
import json
from pycocotools.coco import COCO
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import ubelt as ub # NOQA
def argsubmax(ydata, xdata=None):
"""
Finds a single submaximum value to subindex accuracy.
If xdata is not specified, submax_x is a fractional index.
... |
# !/usr/bin/python
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import animation
from DGMesh import*
from exportParaview import*
import types
import pickle
import os
import pdb
from sympy import *
from scipy import optimize
###############################################################
de... |
<reponame>lukepinkel/pylmm
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Aug 9 04:16:40 2020
@author: lukepinkel
"""
import arviz as az # analysis:ignore
import numpy as np # analysis:ignore
import scipy as sp # analysis:ignore
import scipy.stats # analysis:ignore
import pandas as pd # analysis:i... |
<filename>Java_customization/seleniumActions.py
from cmath import e
from re import X
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
from RPA.Desktop import Desktop
from io import BytesIO
from PIL import Image, ImageFile, ImageGrab
import oci
import logging
from selenium.webdr... |
from SpatialCluster.methods.DMoN_core import IncrementalCOOMatrix
from SpatialCluster.utils.data_format import position_data_format
from scipy import spatial
import numpy as np
def adjacencyMatrix(features_position, r_max = 0.00034, leafsize = 10, k = 2):
features_position = position_data_format(features_position)... |
# -*- coding: utf-8 -*-
"""
@author: <NAME>
Copyright (C) 2016, <NAME>.
Licensed under the Apache License 2.0. See LICENSE file in the project root for full license information.
"""
import cv2
import numpy as np
from scipy import optimize
from math import fabs
from Core.Math.Point2 import Point2
from Core.Features... |
# coding: utf-8
# In[2]:
import pandas as pd
import numpy as np
import os
import glob
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from matplotlib.dates import MO, TU, WE, TH, FR, SA, SU
from pandas.tools.plotting import autocorrelation_plot
# from statsmodels.tsa.arima_model import ARIMA
from ... |
<reponame>AxelHenningsson/xrd_simulator<gh_stars>1-10
"""The beam module is used to represent a beam of xrays. The idea is to create a :class:`xrd_simulator.beam.Beam` object and
pass it along to the :func:`xrd_simulator.polycrystal.Polycrystal.diffract` function to compute diffraction from the sample
for the specified... |
import soundfile as sf
import argparse
import musdb
import museval
import test
import test_mtl_sf
import multiprocessing
import functools
from pathlib import Path
import torch
import json
import tqdm
import numpy as np
import os
import pickle
import crepe
import scipy.io.wavfile
import mir_eval
import... |
<reponame>IGLICT/PRS-Net
### Copyright (C) 2017 NVIDIA Corporation. All rights reserved.
### Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
import numpy as np
import os
import ntpath
import time
from . import util
import scipy.misc
try:
from StringIO import... |
#encoding: UTF-8
# Copyright (C) 2016 <NAME>
# This file is distributed under the terms of the # MIT License.
# See the file `License' in the root directory of the present distribution.
"""
This submodule groups all functions relevant for minimizing the energy in the
anisotropic case. It also contains the functions ... |
<gh_stars>100-1000
# -*- coding: utf-8 -*-
u"""
Created on 2017-1-7
@author: cheng.li
"""
import numpy as np
from scipy.optimize import least_squares
from PyFin.PricingEngines.SVIInterpolationImpl import sviVolatility
from PyFin.PricingEngines.SVIInterpolationImpl import sviVolatilities
from PyFin.PricingEngines.SVII... |
#!/usr/bin/python
##############################################
###Python template
###Author: <NAME>
###Date: 7/25/13
###Function: Draw OR by season severity plots where season severity is defined as attack rate per 100,000 in acute care or inpatient facilities in flu peak weeks
###Import data: SQL_export/OR_swk6.cs... |
<gh_stars>0
__author__ = 'ferrard'
# ---------------------------------------------------------------
# Imports
# ---------------------------------------------------------------
import scipy as sp
import matplotlib.pyplot as plt
import math
# ---------------------------------------------------------------
# Class
# -... |
import numpy as np
from scipy.interpolate import griddata
TOL = 0.001
def rec2cyl( x, y, z):
theta = np.arctan2( y, x )
r = np.sqrt(x**2+y**2)
return r, theta, z
def cyl2rec( r, theta, z ):
x = r * np.cos( theta )
y = r * np.sin( theta )
z = z
return x, y, z
def getGeomImperfection(r,... |
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 11 10:14:19 2020
@author: Philipe_Leal
"""
import numpy as np
from scipy import spatial
import xarray as xr
def get_tutorial_dataset():
ds = xr.tutorial.open_dataset('rasm').load()
Tair = ds['Tair']
Tair.coords['xc'] = (Tair.coords['xc'] + 180) % ... |
""" Custom distributions."""
__author__ = "<EMAIL>"
import numpy as np
import scipy.stats
from scipy.special import gamma, gammaincinv
from scipy.stats import beta, norm, truncnorm, uniform
def ep_rvs(mu=0, alpha=1, beta=1, size=1):
u = uniform.rvs(loc=0, scale=1, size=size)
z = 2 * np.abs(u - 1. / 2)
... |
import pytest
import sys
import numpy as np
import matplotlib.pyplot as plt
from copy import deepcopy
from scipy.integrate import solve_ivp, odeint
from toybox.premade import *
from toybox.forcings import *
from toybox.nonlinearities import *
from toybox.integrators import rk4, scipy
'''
Some tests that make sure t... |
<gh_stars>0
"""
Common statistics from BoW matrices.
<NAME> <<EMAIL>>
"""
import itertools
import numpy as np
from scipy.sparse import issparse
def get_doc_lengths(dtm):
if isinstance(dtm, np.matrix):
dtm = dtm.A
if dtm.ndim != 2:
raise ValueError('`dtm` must be a 2D array/matrix')
res... |
<reponame>mb4512/DXA-RelaxationVolume-Analysis
import numpy as np
from scipy import spatial
from lib.graphstuff import pbcdistvec
def probe_bond(r, d, b, dfile, ktree, maxbond=2.9, probedistance=7.0, proberadius=5.0):
'''Return the mean bond lengths along b-vector in a region near the core.
Find all atoms w... |
<gh_stars>1-10
import numpy as np
from keras.models import Model
from keras.models import Sequential
from keras.layers.core import Reshape
from keras.layers import Activation, Dropout, Flatten, Dense
from keras.layers.convolutional import Convolution2D
from keras.layers.convolutional import MaxPooling2D
from keras.laye... |
#!/usr/bin/env python
# coding: utf-8
import pandas as pd
import sys
import matplotlib.pyplot as plt
import scipy as sci
import os.path
from scipy import stats
regrex = pd.read_csv(sys.argv[1])
print("loading {}".format(sys.argv[1]))
basename = os.path.splitext(sys.argv[1])
print(basename)
x = regrex.x
y = regrex.y... |
<reponame>gilwoolee/brl_gym
from itertools import product
import numpy as np
from gym.spaces import Box
from brl_gym.estimators.estimator import Estimator
from scipy.special import logsumexp
class ParamEnvDiscreteEstimator(Estimator):
"""
Estimates parameter distribution
"""
def __init__(self, env,
... |
''' data processing for neuron project '''
# built-in
import sys
import os
import shutil
import six
# third party
import nibabel as nib
import numpy as np
import scipy.ndimage.interpolation
from tqdm import tqdm_notebook as tqdm # for verbosity for forloops
from PIL import Image
import matplotlib.pyplot as plt
# n... |
<reponame>CubeSkyy/ILU-RL<gh_stars>0
import os
import json
import pandas as pd
import argparse
import numpy as np
from pathlib import Path
from scipy import stats
import configparser
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import seaborn as sns
from analysis.utils import str2bool, get... |
<gh_stars>0
"""
Copyright (c) 2017, <NAME>
This code and is available
under the terms of MIT License provided in LICENSE.
Please retain this notice and LICENSE if you use
this file (or any portion of it) in your project.
---------------------------------------------------------
"""
import torc... |
<filename>stickers.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
from scipy.integrate import quad
import numpy as np
import bigfloat
import argparse
class Stikers():
"""Calculate the amount paid for n stikers while exchanging with f friends
n/f[*+]integrate_0^inf(1-(1-(1+x/2!+x**2)/e^x))dx
Bas... |
<reponame>cdfassnacht/CodeCDF
"""
ccdredux.py - A library of functions to do various basic CCD image processing
operations
High-level Functions:
make_bias - combines input bias or dark frames into one master file
make_flat - combines input flat frames into a master flat
make_flat... |
<reponame>garsontrier/pitch-modification
import numpy as np
from scipy.signal import find_peaks
import statistics as st
def remove_unvoiced(y, samples, frame_len):
unvoiced_pos = []
unvoiced_win = []
voiced_win = []
index = 0
win_no = 0
y1 = []
for i in range(len(samples)):
... |
<reponame>kperrynrel/rdtools
'''Functions for normalizing, rescaling, and regularizing PV system data.'''
import pandas as pd
import pvlib
import numpy as np
from scipy.optimize import minimize
import warnings
from rdtools._deprecation import deprecated
class ConvergenceError(Exception):
'''Rescale optimization ... |
import logging
import pickle
from pathlib import Path
import fire # type: ignore
import numpy as np
from scipy.linalg import norm # type: ignore
from elicitation import append, load, save_reward, update_inputs
from sampling import Sampler
from simulation_utils import create_env, get_feedback, get_simulated_feedback... |
from typing import Tuple, Union
import numpy as np
from scipy.spatial.transform import Rotation
def generate_billboards_2d(coords: np.ndarray, size: Union[float, np.ndarray] =20) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:
"""
Returns (vertices, faces, texture coordinates) of a <n> standard 2D billboards of... |
#!/usr/bin/env python
# This module provides access to some variables used or maintained by the interpreter.
import sys
# This module provides a portable way of using operating system dependent functionality.
import os
# The module offers a number of high-level operations on files and collections of files.
import shuti... |
#sleeping packages
from imutils.video import VideoStream
from imutils import face_utils
import numpy as np
import imutils
import time
import dlib
import cv2
#mouth packages
from scipy.spatial import distance as dist
from imutils.video import VideoStream
from imutils import face_utils
from threading import Thread
import... |
<filename>dython/model_utils.py<gh_stars>0
import numpy as np
import matplotlib.pyplot as plt
import dython.nominal as nominal
from scipy import interp
from sklearn.metrics import roc_curve, auc
from dython._private import convert
def _display_plot():
plt.plot([0, 1], [0, 1], color='grey', lw=1, linestyle='--')
... |
from scipy.linalg import eigh
import matplotlib.pyplot as plt
import numpy as np
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler
from sklearn.feature_selection import mutual_info_classif
class Eigenspectrum:
# Eigenspectrum is composed of:
# eigenvalues
# % info for each eige... |
import collections
import itertools
from numbers import Number
from typing import (Iterable, Mapping, NamedTuple, Optional, Tuple)
import casadi as ca
import numba
import numpy as np
from numpy import sin, cos, tan, exp, sqrt, arctan, tanh
import scipy.interpolate as interpolate
import sympy as sym
import pycollo.fun... |
# flake8: noqa
import numpy as np
from sklearn.datasets.samples_generator import make_blobs
from scipy.stats import multivariate_normal
import matplotlib.pyplot as plt
import seaborn as sns
# https://seaborn.pydata.org/generated/seaborn.set_context.html
# https://seaborn.pydata.org/generated/seaborn.set_style.html
s... |
<gh_stars>10-100
from typing import Optional, Sequence, Tuple
import numpy
from numpy.random import rand
from scipy.ndimage import gaussian_filter
from aydin.features.groups.correlation import CorrelationFeatures
class RandomFeatures(CorrelationFeatures):
"""
Random Feature Group class
Generates featur... |
<reponame>MIPT-Oulu/Ultrasound_IQ_analysis
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 6 15:31:51 2020
@author: sinkinen
"""
#import matplotlib.pyplot as plt
import pydicom
import numpy as np
from os import listdir
from os.path import isfile, join
from skimage.measure import label
import cv2 as cv
from scipy.s... |
<gh_stars>1-10
import numpy as np
import matplotlib.pyplot as plt
import platform
from scipy.spatial import Delaunay, Voronoi, voronoi_plot_2d
from scipy import argmin, inner
def cvt(samples, times, rnum):
s_num = rnum * rnum
p = np.random.random((samples, 2))
interval = np.linspace(0.0, 1.0, rnum)
sx ... |
#!/usr/bin/env python3
import cv2
import argparse
import sys
import os
import time
from random import randint
import numpy as np
import scipy.misc
import skvideo.io
import json
import keras
import gc
from keras.preprocessing import image
from keras.models import model_from_json
from keras.optimizers import SGD, RMSprop... |
<gh_stars>1-10
import numpy as np
from scipy import integrate
from mpi4py import MPI
import matplotlib.pyplot as plt
import pandas as pd
def g_theo_MP(z, gamma):
return ((1-gamma) - z + np.sqrt((z-gamma-1)**2 - 4*gamma)) / (2*z*gamma)
def g_theo(z, gamma, delta):
return z * g_theo_MP(z**2 * np.sqrt(gamma) / ... |
<reponame>pburnham50/FateTrack
### testing image registration functions
import numpy as np
from urllib.parse import urlparse
from cellpose import utils, io,models
import matplotlib
import matplotlib.pyplot as plt
import time, os, sys
import pandas as pd
import glob
### Part 1 : Image Registration
from skimage import im... |
import os
import sys
import math
import argparse
import itertools
import numpy as np
import scipy
from scipy.stats import ttest_ind
import pandas as pd
# The labels in 'JFRC2', used for label-wise evaluation
labels = [ 16, 64, 8, 32, 2, 4, 65, 66, 33, 67, 34, 17, 69, 70, 35, 71, 9, 18, 72, 36, 73, 74, 37, 75, 19,... |
import os
from itertools import zip_longest, product
from functools import partial
from os.path import dirname
import numpy as np
import scipy.sparse
from tqdm.autonotebook import tqdm
import torch
import random
import pdb
import string
import logging
from sklearn.cluster import k_means, DBSCAN
import matplotlib.pyplo... |
<filename>research/delf/delf/python/training/extract_global_features.py
import os, time
import os.path as osp
import numpy as np
from pathlib import Path
import tensorflow as tf
from PIL import Image
from scipy.spatial import distance
import argparse, sys
from delf import datum_io
from tensorflow.python.platform import... |
#!/usr/bin/env python3
"""Unit test for ellipsefits.py"""
import unittest
import numpy as np
from scipy.interpolate import InterpolatedUnivariateSpline as Interp
import ellipsefits_copy as ellipsefits # module to be tested
# prepare input and reference data
efitFileDir = '/Beleriand/data/sdss/n5831/'
efitFile_... |
from __future__ import annotations
import sympy
def ugly_sequence_iterative(number: int) -> list[int]:
sequence = []
term = 2
while len(sequence) != number:
factors = set(sympy.primefactors(term))
if factors.issubset({2, 3, 5}):
sequence.append(term)
term += 1
retur... |
<gh_stars>1-10
import numpy as np
from scipy import signal as sg
class Signal:
def __init__(self):
self.waveform = "Sine"
self.frequency = 1
self.amplitude = 1
self.offset = 0
self.phase = 0
self.x = 0
self.y = 0
self.Update()
def Update(self):
... |
# -*- coding: utf-8 -*-
# !/usr/bin/env python36
"""
tgshg/audio/api_audio_util.py
:model: API Audio Util
:copyright:facegood © 2019 by the tang.
url pyaudio: https://people.csail.mit.edu/hubert/pyaudio/
"""
from __future__ import print_function
import wave
import threading
import pyaudio
__author__ ... |
from jsmin import jsmin
import numpy as np
from scipy.sparse import csr_matrix
import datetime
from nltk.corpus import stopwords
from nltk.book import *
from sortedcontainers import SortedList
import re
import array
s=set(stopwords.words('english'))
BasePath = "F:\\HallmarksEngine\\Data\\SciGraph\\comp\\"
count = 0
all... |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 8 10:31:09 2019
@author: logiusti
"""
import random
import time
import pandas as pd
import numpy as np
import scipy.stats as ss
import matplotlib.pyplot as plt
from matplotlib.pyplot import *
#from astropy.convolution import Gaussian1DKernel, convolve
#from... |
# +
import numpy as np
import scipy.sparse as sp
from graphilp.imports import ilpsetsystem as ilpss
from graphilp.packing import set_packing as setp
def test_set_packing():
cover_matrix = np.array([[ 0., 0., 1],
[ 1, 0., 0.],
[ 0., 1, 1]])
A = sp.csr_matrix(cover_matrix)
s... |
<reponame>prasanna08/MachineLearning
import numpy as np
from scipy import linalg as LA
class LDA(object):
def __init__(self, data_inputs, data_labels):
self.data_inputs = np.array(data_inputs)
self.data_labels = data_labels
self.test_cases = self.data_inputs.shape[0]
self.labels = np.unique(data_labels)
sel... |
from sympy.solvers import solve
from sympy.abc import x
def getDeepDotQuality(func, arg, val, n = 3):
dy = func.diff(arg)
dyn = dy.subs(arg, val)
if (dyn == 0):
return getDeepDotQuality(dy, arg, val, n+1)
elif (n % 2 == 1):
return 'has an inflection point'
elif (dyn > 0):
return 'is min'
else:
... |
#!/usr/bin/env python
# coding: utf-8
"""clustering_plotting.py
This script explores of the distances obtained from the comparisons of each pi
to all other median PIs for each diagnostic category.
"""
import utils
import matplotlib.pyplot as plt
from matplotlib import rcParams
import dotenv
import numpy as np
impo... |
"""
Experiment with representation, simulation and conditioning of Gaussian fields
using the KL expansion.
Note: The eigenvalue problem on an adaptively refined mesh yields modes
that behave erratically near the local refinement.
"""
# Local imports
from mesh import Mesh
from fem import System, QuadFE
from ... |
#!/usr/bin/env python3
# Copyright 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""Rank documents with TF-IDF scores"""
import logging
import numpy as np
import scipy.sparse as sp
from mult... |
from ROOT import TH1F, TCanvas, gStyle, TLegend, TGraph
from sklearn.externals import joblib
from array import array
import cPickle as pickle
from scipy.stats import ks_2samp
import numpy as np
import datetime
import math
from sklearn.neural_network import MLPClassifier
from sklearn.preprocessing import StandardScaler... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.