text string |
|---|
import numpy as np
import scipy.interpolate as spintp
import time
from .. import models
class SpherePhaseInterpolator(object):
def __init__(self, model, model_kwargs,
pha_offset=0, nrel=0.1, rrel=0.05, verbose=0):
"""Interpolation in-between modeled phase images
Parameters
... |
import numpy as np
from typing import Iterable, Tuple
from collections import namedtuple
import scipy.stats as stats
from abito.lib.stats.plain import *
__all__ = [
't_test_from_stats',
't_test',
't_test_1samp',
'mann_whitney_u_test_from_stats',
'mann_whitney_u_test',
'bootstrap_test',
'sh... |
<filename>process/LaneReprojectCalibrate.py
#usage
# python LidarReprojectCalibrate.py <dir-to-data> <basename> <start frame>
from Q50_config import *
import sys, os
from GPSReader import *
from GPSTransforms import *
from VideoReader import *
from LidarTransforms import *
from ColorMap import *
from transformations ... |
#!/usr/bin/env python3
"""
extract_features.py
Script to extract CNN features from video frames.
"""
from __future__ import print_function
import argparse
import os
import sys
from moviepy.editor import VideoFileClip
import numpy as np
import scipy.misc
from tqdm import tqdm
def crop_center(im):
"""
Crop... |
import numpy as np
import scipy.stats as st
def pearson_weighted(x, y, w=None):
if len(x.shape) != 1:
raise AssertionError()
if len(y.shape) != 1:
raise AssertionError()
if w is None:
w = np.ones_like(y)
if not x.shape == y.shape and y.shape == w.shape:
raise Assertio... |
<gh_stars>0
from scipy.optimize import fsolve
from matplotlib import cm, rcParams
import matplotlib.pyplot as plt
import numpy as np
import math
from shapely import geometry
""" ToDo : check if this is equivalent to the G-function for weak coupling """
c = ['#aa3863', '#d97020', '#ef9f07', '#449775', '#3b7d86']
rcPar... |
<filename>Demonstrator/DisplayExperiments.py
# -*- coding: utf-8 -*-
"""
Script to read and display the experiments done with the iAi electronics
prototype in the x-ray lab
"""
from __future__ import division
import os
import glob
import numpy
import matplotlib.pylab as plt
import platform
import random
import scipy... |
<gh_stars>1-10
# coding=utf-8
# Copyright 2018 The DisentanglementLib Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LIC... |
<gh_stars>0
# Compile spark with native blas support:
# https://github.com/Mega-DatA-Lab/SpectralLDA-Spark/wiki/Compile-Spark-with-Native-BLAS-LAPACK-Support
from __future__ import print_function
import argparse
import json
import time
import matplotlib.pyplot as plt
import numpy
import scipy.io
import seaborn
from p... |
<filename>cldc/main.py
import os
import csv
import sys
import logging
import argparse
from reader import Reader
from model import AveragedPerceptron
from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassifier
import numpy as np
reload(sys)
sys.setdefaultencoding('utf-8')
# create a logger
logger =... |
"""lambdata_rileythejones - a collection of data science helper functions """
import pandas as pd
import numpy as np
from scipy import stats
class CleanData:
"""
functions to clean a dataset
"""
def __init__(self, df):
self.df = df
"""
returns the total number of null values in the en... |
import os
import pickle
import arviz
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.stats as spst
import targets
with open(os.path.join('samples', 'brownian-bridge-haario-num-times-50-num-samples-1000000.pkl'), 'rb') as f:
h = pickle.load(f)
with open(os.path.join('samples',... |
"""
We have a few different kind of Matrices
MutableMatrix, ImmutableMatrix, MatrixExpr
Here we test the extent to which they cooperate
"""
from sympy import symbols
from sympy.matrices import (Matrix, MatrixSymbol, eye, Identity,
ImmutableMatrix)
from sympy.matrices.matrices import MutableMatrix, classof
fro... |
<reponame>kmkurn/ptst-semeval2021<gh_stars>1-10
#!/usr/bin/env python
# Copyright (c) 2021 <NAME>
from collections import defaultdict
from pathlib import Path
from statistics import median
import math
import os
import pickle
import tempfile
from anafora import AnaforaData
from rnnr import Event, Runner
from rnnr.at... |
"""
@article{sinha2020curriculum,
title={Curriculum By Smoothing},
author={<NAME> <NAME> <NAME>},
journal={Advances in Neural Information Processing Systems},
volume={33},
year={2020}
}
"""
import os
import scipy.io
import numpy as np
import jax.numpy as jnp
import random
import torch
import torch.utils.dat... |
<reponame>hpaulkeeler/DetPoisson_Python
# This file fits a determinatally-thinned point process to a
# (dependently-)thinned-point process based on the method outlined in the
# paper by Blaszczyszyn and Keeler[1], which is essentially the method
# developed by Kulesza and Taskar[2] in Section 4.1.1.
#
# This is the ... |
<gh_stars>1-10
# @author lucasmiranda42
# encoding: utf-8
# module deepof
"""
Testing module for deepof.utils
"""
from hypothesis import given
from hypothesis import HealthCheck
from hypothesis import settings
from hypothesis import strategies as st
from hypothesis.extra.numpy import arrays
from hypothesis.extra.pa... |
import sys, os
import numpy as np
from keras.preprocessing.image import transform_matrix_offset_center, apply_transform, Iterator,random_channel_shift, flip_axis
from scipy.ndimage.interpolation import map_coordinates
from scipy.ndimage.filters import gaussian_filter
import cv2
import random
import pdb
from skimage.io ... |
"""Test cases for _gates module."""
from unittest.mock import Mock
import pytest
import sympy
from zquantum.core.wip.circuits import _builtin_gates
from zquantum.core.wip.circuits._gates import GateOperation, MatrixFactoryGate
GATES_REPRESENTATIVES = [
_builtin_gates.X,
_builtin_gates.Y,
_builtin_gates.Z,... |
"""
Name : c5_25_get_critical_value_F_test.py
Book : Hands-on Data Science with Anaconda )
Publisher: Packt Publishing Ltd.
Author : <NAME> and <NAME>
Date : 1/25/2018
email : <EMAIL>
<EMAIL>
"""
import scipy as sp
alpha=0.10
d1=1
d2=1
critical=sp.stats.f.ppf(q=1-alpha, dfn=... |
from scipy import stats
from enum import Enum
import math
class Side(Enum):
"""
棄却域の取り方を表現する.
## Attributes
`DOUBLE`: 両側検定
`LEFT`: 左片側検定
`RIGHT`: 右片側検定
"""
DOUBLE = 1
LEFT = 2
RIGHT = 3
def side_from_str(side: str) -> Side:
if side == "double":
return Side... |
import numpy as np
import scipy.sparse
import autosklearn.pipeline.implementations.OneHotEncoder
from ConfigSpace.configuration_space import ConfigurationSpace
from ConfigSpace.hyperparameters import CategoricalHyperparameter, \
UniformFloatHyperparameter
from ConfigSpace.conditions import EqualsCondition
from a... |
<reponame>chunribu/tpp-python
#!/usr/bin/env python
def fdr(self, p_vals):
from scipy.stats import rankdata
ranked_p_values = rankdata(p_vals)
fdr = p_vals * len(p_vals) / ranked_p_values
fdr[fdr > 1] = 1
return fdr
def rss(y1, y2):
if len(y1) == len(y2):
l = len(y1)
rss = sum... |
<reponame>gokceuludogan/interactive-music-recommendation
import numpy as np
from scipy.optimize import fmin_l_bfgs_b
import utils
class EpsilonGreedy:
def __init__(self, epsilon, datapath):
self.util = utils.Util(datapath)
self.epsilon = epsilon
self.recommended_song_ids = []
self.... |
#!/usr/bin/env python3
import os
import sys
import time
import torch
import logging
import argparse
import numpy as np
import pandas as pd
import seaborn as sns
import os.path as osp
import torch.nn as nn
import torch.utils.data as data
import torch.optim as optim
import matplotlib.pyplot as plt
import torch.backends.... |
<gh_stars>1-10
import os
import timeit
from argparse import ArgumentParser
import soundfile
import h5py
import numpy as np
import scipy
from keras.models import load_model, Model
from keras import layers
from namelib import get_model_dir_name, get_synth_dir_name, get_testset_names
from libutil import safe_makedir, l... |
<reponame>sgtc-stanford/scCRISPR<filename>softclip_bestN_barcodes.py
#!/usr/bin/env python
"""
:Author: <NAME>/Stanford Genome Technology Center
:Contact: <EMAIL>
:Creation date: 03/24/2021
:Description:
This script extracts soft clipped bases at beginning (FWD strand) or end (REV strand)
of read. These sequences w... |
# -*- coding: utf-8 -*-
import scipy
def cosine_similarity(v1,v2):
"""
compute cosine similarity of v1 to v2: (v1 dot v1)/{||v1||*||v2||)
#100 loops, best of 3: 11.9 ms per loop
sumxx, sumxy, sumyy = 0, 0, 0
for i in range(len(v1)):
x = v1[i]; y = v2[i]
sumxx += x*x
sumyy +=... |
"""
Created on April, 2019
@author: <NAME>
Toolkit functions used for processing training data.
Cite:
<NAME>, et al. "Cooperative Holistic Scene Understanding: Unifying 3D Object, Layout,
and Camera Pose Estimation." Advances in Neural Information Processing Systems. 2018.
"""
import numpy as np
from scipy.spatial... |
<filename>modules/deepspell/token_lookup_space.py
# (C) 2018-present <NAME>
# =============================[ Imports ]===========================
import codecs
import pickle
import os
try:
from scipy.spatial import cKDTree
except ImportError:
print("WARNING: SciPy not installed!")
cKDTree = None
pass... |
<gh_stars>0
# -*- coding: utf-8 -*-
#
# * Copyright (c) 2009-2017. Authors: see NOTICE file.
# *
# * 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/licens... |
<reponame>brianlan/image-semantic-segmentation
import os
import time
import argparse
import scipy
import numpy as np
import tensorflow as tf
import pandas as pd
from sklearn.model_selection import train_test_split
from logger import logger
from model.unet import UNet
from data_io import ImageFileName, ImageReader
fro... |
"""
Purpose: To simulate expected educational attainment gains from embryo selection between families.
Date: 10/09/2019
"""
import numpy as np
import pandas as pd
from scipy.stats import norm
import argparse
def calc_between_family_values(n, no_embryos, hsquared_bfsnp, eur_bf_rsquared):
"""
Purp... |
<reponame>CybercentreCanada/assemblyline-service-pixaxe
"""
Requires numpy, Pillow(PIL), python-matplotlib, scipy
"""
from assemblyline_v4_service.common.result import ResultSection, BODY_FORMAT
from PIL import Image
import json
import math
import numpy as np
from os import path
from scipy.stats import chisquare
impor... |
import tensorflow as tf
import os
import numpy as np
import sys
import data_generation
import networks
import scipy.io as sio
import param
import util
import truncated_vgg
from keras.optimizers import Adam
def train(model_name, gpu_id):
params = param.get_general_params()
network_dir = params['model_save_dir'... |
# -*- coding: utf-8 -*-
from timeit import default_timer as timer
import random
import serial
import serial.tools.list_ports
import os
from math import sqrt
import argparse
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime
from scipy.fft import fft
from libs.DadosBrutos import Serial_con... |
<filename>main_MetaTrain.py<gh_stars>10-100
"""
@author : Hao
"""
import tensorflow as tf
#import tensorflow.compat.v1 as tf
#tf.disable_eager_execution()
import numpy as np
import os
import random
import scipy.io as sci
from utils import generate_masks_MAML
import time
from tqdm import tqdm
from Met... |
<filename>ID18/plot_at_waist.py
import numpy
from srxraylib.plot.gol import plot
use_real_lens = False
UP_TO_MODE = [0,0,50,50]
USE_GAUSSIAN_SLIT = [True,False,True,False]
TMP_X = []
TMP_Y1 = []
TMP_Y2 = []
TMP_Y3 = []
TMP_Y4 = []
TMP_Y5 = []
for ii in range(len(UP_TO_MODE)):
up_to_mode = UP_TO_MO... |
import numpy as np
import scipy.stats as sst
from warnings import warn
from src.utils.cpp_parameter_handlers import _epoch_name_handler
# # Some test data
# from cpn_load import load
# import cpn_triplets as tp
# rec = load('AMT028b')
# signal = rec['resp'].rasterize()
# epoch_names = r'\ASTIM_Tsequence.*'
# full_arra... |
<gh_stars>1-10
import os
import csv
import scipy.stats
import numpy
import helpers
csv.field_size_limit(3000000)
#reads the processed data in circFileName which should be created by textExtractor.py
#creates and returns a dictionary whose keys are years in yearRange and whose values are dictionaries
#the ke... |
from typing import List, Dict, Tuple, NamedTuple
import json
import datetime
from collections import defaultdict
import scipy
import numpy
import joblib
from sklearn.feature_extraction.text import TfidfVectorizer
import nmslib
from nmslib.dist import FloatIndex
from scispacy.file_cache import cached_path
from scispac... |
<filename>ace_flowdistortion.py
#
# Copyright 2018-2020 École Polytechnique Fédérale de Lausanne (EPFL) and
# <NAME> Institut (PSI).
#
# 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
#
# h... |
<filename>qfast/decomposition/optimizers/lbfgs.py<gh_stars>10-100
"""QFAST Optimizer wrapper for scipy's L-BFGS-B optimizer."""
import scipy.optimize as opt
from qfast.decomposition.optimizer import Optimizer
class LBFGSOptimizer( Optimizer ):
def minimize_coarse ( self, objective_fn, xin ):
res = opt.m... |
<filename>lessons/lesson17/tests/test_level02.py
import string
from scipy.stats import pearsonr
def correlate(collection1, collection2):
def _conv(_v):
if isinstance(_v, str):
return ord(_v)
return _v
converted1 = [_conv(_e) for _e in collection1]
converted2 = [_conv(_e) for ... |
<reponame>dendisuhubdy/deep_complex_networks<filename>musicnet/musicnet/dataset.py<gh_stars>100-1000
# -*- coding: utf-8 -*-
#
# Authors: <NAME>
import itertools
import numpy
from six.moves import range
from itertools import chain
from scipy import fft
from scipy.signal import stft
FS = 44100 # samples/... |
<filename>venv/lib/python2.7/site-packages/sympy/physics/units/util.py
# -*- coding: utf-8 -*-
"""
Several methods to simplify expressions involving unit objects.
"""
from __future__ import division
from sympy.utilities.exceptions import SymPyDeprecationWarning
from sympy import Add, Function, Mul, Pow, Rational, T... |
<filename>module/imsng/gw.py
# SELECT GW HOST GALAXY CANDIDATES
# 2019.02.10 MADE BY <NAME>
# 2019.08.29 UPDATED BY <NAME>
#============================================================#
import os, glob, sys
import matplotlib.pyplot as plt
import numpy as np
import healpy as hp
from astropy.table import Table, vstack,... |
<filename>CLIR_sound/sinewave.py
import numpy as np
from scipy.io import wavfile as wav
def sinewave(amp, freq, dur_sec, fs):
A = amp
f = freq
t = np.linspace(0, dur_sec, np.int(fs*dur_sec))
return A*np.sin(2*np.pi*f*t)
def audio_gen(sinewave, samp_hz, file_name):
wav.write(file_name, samp_hz, s... |
<reponame>anniechen0127/behav-analysis
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import utils
import scipy as sp
from scipy import ndimage
def plot_stars(p,x,y,size='large',horizontalalignment='center',**kwargs):
''' Plots significance stars '''
plt.text(x,y,s... |
<filename>igrfcode.py
from constant import *
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
import scipy.special as scp
from pathlib import Path
import imageio
import os
import os.path
class IGRF:
def readdata(self, filename):
# 读取数据
G = []
n = []
... |
import numpy as np
from scipy.interpolate import griddata,interp2d
from scipy.optimize import root_scalar
import sys
import os
import multiprocessing as mp
from rebound.interruptible_pool import InterruptiblePool
import threading
def get_stab_func(incl):
data = np.genfromtxt("a_crit_Incl[%i].txt" % incl ,delimiter... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 23 15:51:11 2020
@author: <NAME>
"""
from sklearn.model_selection import train_test_split, cross_val_score
from sklearn.preprocessing import StandardScaler
from sklearn import preprocessing
from sklearn.metrics import mean_squared_error as MSE
from sklearn.tree import De... |
import os
import numpy as np
import scipy.io
import h5py
from PIL import Image
from PIL import ImageFile
import torch
import torchvision
import torchvision.transforms as transforms
from torch.utils.data import Dataset, Subset
# Adapted DomainNet for reasonable class sizes >= 200, left:
domain_net_targets = ['sea_turtl... |
<filename>fast_dataset.py
from abc import ABC, abstractmethod
import os, re, random, h5py, pickle
import pandas as pd
from pandas.api.types import CategoricalDtype
import numpy as np
from scipy import spatial as sp
from scipy.io import loadmat
from rdkit import Chem
from torch.utils.data import Dataset, IterableDat... |
<reponame>ContactEngineering/Adhesion<gh_stars>0
#
# Copyright 2018, 2020 <NAME>
# 2016, 2018, 2020 <NAME>
#
# ### MIT license
#
# 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 with... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# ======================================================================================================================== #
# Project : Explainable Recommendation (XRec) #
# Version : 0.1.0 ... |
<gh_stars>10-100
#!/usr/bin/python
import sys, os, numpy, scipy.misc
from scipy.ndimage import filters
class MSSIM:
def gaussian(self, size, sigma):
x = numpy.arange(0, size, 1, float)
y = x[:,numpy.newaxis]
xc = (size-1) / 2
yc = (size-1) / 2
gauss = numpy.exp(-((x-xc)**2... |
"""
Linear autoregressive model with exogenous inputs.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.linalg import block_diag
from .narx import NarxModel
__all__ = [
'Linear'
]
class Linear(NarxModel):
"""
Create linear autoregressive model with exog... |
import sys
import os
import bpy
import glob
import time
import numpy as np
from scipy.ndimage.filters import gaussian_filter
from struct import *
# read binary displacement data
def readBinary(fname):
coords = []
# data format is lon, lat, elevation
nbytes = 4 * 3 # data is recorded as floats
with ope... |
"""
wrap heatmaps module ready for correlating output from heatmap and ssd modules
"""
#############################################################################
# Imports
#############################################################################
import matplotlib.pyplot as plt
plt.ion()
from scipy.misc imp... |
import os
import sys
sys.path.append("../") # go to parent dir
import glob
import time
import logging
import numpy as np
from scipy.sparse import linalg as spla
import matplotlib.pyplot as plt
import logging
from mpl_toolkits import mplot3d
from mayavi import mlab
from scipy.special import sph_harm
mlab.options.offscr... |
<gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
import math
from multiprocessing import Array, Value
from numbers import Number
import numpy as np
from scipy import linalg
from six import string_types
from sklearn.decomposition import PCA, IncrementalPCA
from sklea... |
<reponame>zmlabe/ModelBiasesANN
"""
Script for plotting softmax confidence after testing on observations for
regional masks for looping iterations
Author : <NAME>
Date : 1 June 2021
Version : 4 (ANNv4)
"""
### Import packages
import sys
import matplotlib.pyplot as plt
import numpy as np
import palettable... |
#! /usr/bin/env python
"""Make static images of lyman results using PySurfer."""
import os.path as op
import sys
import argparse
from textwrap import dedent
from time import sleep
import numpy as np
from scipy import stats
import nibabel as nib
import matplotlib.pyplot as plt
from surfer import Brain
import lyman
fro... |
# This file is part of the Dataphile package.
#
# This program is free software: you can redistribute it and/or modify it under the
# terms of the Apache License (v2.0) as published by the Apache Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without... |
<gh_stars>0
"""
20160104 <NAME>
Collection of utility functions
"""
import copy
import os
import random
import sys
from datetime import datetime
from shutil import copyfile
import numpy as np
import pandas as pd
import pytz
import scipy.spatial.qhull as qhull
from inicheck.checkers import CheckType
from inicheck.ou... |
<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This module defines a function for simultaneous fits to several
data sets.
The fit function can be the same for all data sets or a different
function for every data set. The important point is that all the
functions have to depend on the... |
<reponame>alphagov-mirror/govuk-network-data<gh_stars>1-10
import argparse
import logging.config
import os
from ast import literal_eval
from collections import Counter
import pandas as pd
from scipy import stats
AGGREGATE_COLUMNS = ['DeviceCategories', 'Event_cats_agg', 'Event_cat_act_agg']
NAVIGATE_EVENT_CATS = ['b... |
# All rights reserved
# <NAME>, Simpson Querrey Institute for Bioelectronics, Northwestern University, Evanston, IL 6208, USA
# This code reads one day data and randomly sample events for labeling
import shrd
import numpy as np
from numpy import genfromtxt
import sys
import os
import simpleaudio.functionche... |
"""
Here we collect only those functions needed
scipy.optimize.least_squares() based minimization
the RAC-models fit negative energies E depending on a
strength parameter lambda: E(lambda)
E is is written as E = -k**2 and the model
actually used is lambda(k)
the data to fit are passed as arrays:
k, ksq = k**2, lbs... |
import numpy as np
import scipy
import scipy.linalg
import scipy.stats
class MeanConditionalNormal:
def __init__(self, mua, cova, linear, bias, covcond):
self.mua = mua
self.cova = cova
self.linear = linear
self.bias = bias
self.covcond = covcond
def to_natural(self):... |
<filename>src/StastModules/SpectralAnalysis.py
import networkx as nx
import numpy as np
import math as mt
import cupy as cp
import scipy as sp
# Function that return the spectral Gap of the Transition Matrix P
def get_spectral_gap_transition_matrix(G):
Isinvertible = False
if(len(G)>0):
# Checking if ... |
<reponame>OptimusPrinceps/ECG-ML<gh_stars>0
"""
This file trains and validates the convolutional recurrent neural network approach
Author: <NAME>, TFLearn (where specififed)
"""
from __future__ import division, print_function, absolute_import
import pickle
import random
from datetime import datetime
from os import lis... |
import numpy as np
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
def biphasic_fit_function(x, a, b, c, d, e, f):
"""Function for biphasic fit
Parameters
----------
x : 1d array
... |
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 17 13:48:58 2015
@author: bcolsen
"""
from __future__ import division, print_function
import numpy as np
import pylab as plt
from .kde import kde
from scipy import stats
import sys
from io import BytesIO
import tempfile
#from gradient_bar import gbar
class ash:
def ... |
<gh_stars>0
def minmax(arr, axis=None):
return np.nanmin(arr, axis=axis), np.nanmax(arr, axis=axis)
def weighted_generic_moment(x, k, w=None):
x = np.asarray(x, dtype=np.float64)
if w is not None:
w = np.asarray(w, dtype=np.float64)
else:
w = np.ones_like(x)
return np.sum(x ** k... |
<filename>dataloader/dataset.py<gh_stars>100-1000
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
SemKITTI dataloader
"""
import os
import numpy as np
import torch
import random
import time
import numba as nb
import yaml
import pickle
from torch.utils import data
from tqdm import tqdm
from scipy import stats as s
#... |
#-*- coding:Utf-8 -*-
from __future__ import print_function
"""
.. currentmodule:: pylayers.antprop.signature
.. autosummary::
:members:
"""
import os
import glob
import doctest
import numpy as np
#import scipy as sp
import scipy.linalg as la
import pdb
import h5py
import copy
import time
import pickle
import log... |
import numpy as np
import pandas as pd
import sys
import os
import random
import glob
import fnmatch
import dicom
import scipy.misc
from joblib import Parallel, delayed
import multiprocessing
# It resizes the img to a size given by the tuple resize. It preserves
# the aspect ratio of the initial img and ... |
#!/usr/bin/env python
import os
import numpy as np
import argparse
from scipy.ndimage import imread
from scipy.misc import imresize, imsave
import cv2
import sys
def face_detect(image):
cascPath = "haarcascade_frontalface_default.xml"
# Create the haar cascade
faceCascade = cv2.CascadeClassifier(cascPat... |
<gh_stars>100-1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import collections
import math
import numpy
import skimage
import skimage.filters
import scipy.ndimage.filters
SimilarityMask = collections.namedtuple("SimilarityMask", ["size", "color", "texture", "fill"])
class Features:
def __init__(self, image,... |
#
# Copyright (C) 2019 Igalia S.L
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trad... |
<gh_stars>0
#!/usr/bin/python3
"""
Python Coding Exercise: Warehouse
=================================
You should implement your code in this file. See `README.txt` for full
instructions and more information.
"""
__author__ = "** <NAME> **"
__email__ = "** <EMAIL> **"
__date__ = "** 2/21/2022 **"
#==... |
import sys
import numpy as np
import pandas as pd
from typing import Union
from loguru import logger as log
from scipy.stats import zscore
import matplotlib.pyplot as plt
from logging import StreamHandler
from plot_time_warp import *
from savitzky_golay import savitzky_golay
from dtaidistance import dtw, dtw_visualisa... |
<gh_stars>0
"""
Consider the problem of building a wall out of 2×1 and 3×1 bricks (horizontal×vertical dimensions) such that, for extra strength, the gaps between horizontally-adjacent bricks never line up in consecutive layers, i.e. never form a "running crack".
For example, the following 9×3 wall is not acceptable d... |
<gh_stars>1000+
# Copyright 2017 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
<filename>plots/scatter_mutational_all.py
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
import numpy as np
from scipy.stats import rankdata
#from mpl_toolkits.axes_grid.inset_locator import (inset_axes, InsetPosition, mark_inset)
import seaborn as sns
from copy import copy
import os
from tqdm impo... |
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from scipy.stats import stats
import numpy as np
from samitorch.inputs.transformers import *
def to_graph_data(path: str, original: str, title: str, style: str, dataset: str):
image = ToNDTensor()(ToNumpyArray()(path)).squeeze(0)... |
<reponame>mahehu/SGN-41007
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 4 11:01:16 2015
@author: hehu
"""
import matplotlib.pyplot as plt
import numpy as np
from sklearn.neighbors import KNeighborsClassifier
from sklearn.lda import LDA
from sklearn.svm import SVC, LinearSVC
from sklearn.linear_model import Logisti... |
import numpy as np
import pandas as pd
import scipy.stats as si
'''
This section is highly dependent upon knowledge of the black & scholes formula
for option pricing and using Monte Carlo methods to price options. There are
a number of terms such as d1, d2, delta, gamma, vega that are specific to
option ricing and I... |
<reponame>LeonardoSaccotelli/Numerical-Calculus-Project
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 20 02:33:21 2020
@author: <NAME>
Test fattorizzazione A = LU
"""
import numpy as np
import AlgoritmiAlgebraLineare as myLA
from fractions import Fraction
def printMatrix(matrix, header):
#Ricav... |
#importing dependencies
import datetime
import math
import numpy as np
from scipy.integrate import solve_ivp
from scipy.optimize import least_squares
import matplotlib.pyplot as plt
#class for tissues like kidney, spleen, liver, kleenex, etc...
class Tissue:
_allTissues = []
_tissues = []
_plasma = []
... |
import sys
import numpy as np
from scipy import special
from scipy import sparse
import argparse
from scipy.stats import truncnorm, poisson, gamma
from sklearn.metrics import mean_squared_error as mse
class SocialPoissonFactorization:
def __init__(self, n_components=100, max_iter=100, tol=0.0005, random_state=None, ... |
"""
Mostly copied from wandb client code
Modified "next_sample" code to do the following:
-accepts a 'failure_cost' argument
-if failure cost 'c' is nonzero, modifies expected improvement of each
sample according to:
e' = p e / (p (1-c) + c)
where 'p' is probability of success and 'e' is unmodified expected improv... |
<filename>netneurotools/freesurfer.py
# -*- coding: utf-8 -*-
"""
Functions for working with FreeSurfer data and parcellations
"""
import os
import os.path as op
import nibabel as nib
import numpy as np
from scipy.spatial.distance import cdist
from .datasets import fetch_fsaverage
from .utils import check_fs_subjid,... |
<filename>FFT.py<gh_stars>0
'''
Collated by <NAME> 鄒慶士 博士 (Ph.D.) Distinguished Prof. at the Department of Mechanical Engineering/Director at the Center of Artificial Intelligence & Data Science (機械工程系特聘教授兼人工智慧暨資料科學研究中心主任), MCUT (明志科技大學); Prof. at the Institute of Information & Decision Sciences (資訊與決策科學研究所教授), NTUB (國... |
<filename>state.py<gh_stars>1-10
import numpy as np
from Regression.functions import exponential, logistic, logisticDistribution
from scipy import optimize
from scipy import misc
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
from sklearn.metrics import r2_score
from scipy.signal import savgol_f... |
'''
In this example we solve the Poisson equation over an L-shaped domain
with fixed boundary conditions. We use the RBF-FD method. The RBF-FD
method is preferable over the spectral RBF method because it is
scalable and does not require the user to specify a shape parameter
(assuming that we use odd order polyharmonic... |
<filename>seismoTK/S_Filter.py
from matplotlib.colors import Colormap
from . import Polarization
class S_Filter(Polarization):
def S(self):
#import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import griddata
self.SF = self.Pol.drop(columns=["LIN","BAZ"])
... |
<filename>Face Recognition/code_material_python/helper.py
import matplotlib.pyplot as plt
import scipy
import numpy as np
import networkx as nx
import random
import scipy.io
import scipy.spatial.distance as sd
def is_connected(adj,n):
# Uses the fact that multiplying the adj matrix to itself k times give the
# number... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.