text string |
|---|
import os
import numpy as np
import matplotlib.pyplot as plt
import cv2
import pickle
from architecture import get_model, get_facenet
from tensorflow.keras.models import load_model
from tensorflow.keras.preprocessing.image import ImageDataGenerator
from tensorflow.keras import optimizers
from sklearn.preprocessing impo... |
import numpy as np
from scipy.stats import norm
from .base import TimeSeries
class GaussianModel(TimeSeries):
"""
Class defines a collection of dynamic trajectories with a gaussian model fit to them.
Attributes:
norm (scipy.stats.norm) - gaussian fit to dynamic trajectories
bandwidth ... |
<gh_stars>1-10
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 6 08:50:07 2017
@author: shenda
"""
import numpy as np
from scipy import stats
from scipy import signal
from scipy import fftpack
#import matplotlib.pyplot as plt
# from statsmodels.tsa import arima_model
import ReadData
from sampen... |
# Copyright 2019-2021 Cambridge Quantum Computing
#
# 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... |
import numpy as np
import scipy as sp
from scipy.sparse.linalg import inv
from pylops import LinearOperator
from pylops.utils.backend import get_array_module
class MatrixMult(LinearOperator):
r"""Matrix multiplication.
Simple wrapper to :py:func:`numpy.dot` and :py:func:`numpy.vdot` for
an input matrix :... |
import numpy as np
from reachy import Reachy, parts
from scipy.spatial.transform import Rotation as R
import time
import math
class RobotMode:
REAL = 'real'
SIM = 'sim'
def get_origin_position(part):
name = part.name
origin_position_map = {
# left arm:
'left_arm.shoulder_pitch': 20.637... |
<reponame>salammemphis/DeepBrainIPP
import numpy as np
from numpy import double
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
from PIL import Image
import time
from matplotlib.pyplot import figure
import PIL
from datetime import datetime
import matplotlib.patches as mpatches
from matplotlib.ba... |
import pandas as pd
import numpy as np
import torch
import pickle
import math
import matplotlib.pyplot as plt
from scipy.interpolate import make_interp_spline, BSpline
df = pd.read_csv("/home/presage3/vlads/gintingt/68_data_sorted_new.csv")
vlad = pd.read_csv("/home/presage3/vlads/gintingt/68_vladmatched_new.csv", hea... |
<gh_stars>0
import pandas as pd
import numpy as np
import os
import time
import matplotlib.pyplot as plt
import matplotlib.backends
from matplotlib.backends.backend_pdf import PdfPages
from sklearn import linear_model
import anndata as an
import scipy
import feather
# Input file - table containing sample names, locati... |
<gh_stars>0
from __future__ import division
from numpy import *
import random as rd
from scipy.stats import pearsonr
from dl_simulation import *
from analyze_predictions import *
from run_smaf import smaf
import spams
THREADS = 4
def compare_results(A, B):
results = list(correlations(A, B, 0))[:-1]
results +=... |
#!/usr/bin/python
import numpy as np
import features
import scipy.io.wavfile as wav
def wav2mfcc(filepath):
(sr,sig) = wav.read(filepath)
sigmono = sig[:, 0]
#print (sigmono)
sig_mfcc= features.mfcc(sigmono,sr, winlen=0.01, winstep=0.01, numcep=12, nfilt=22)
#sig_mfcc= features.mfcc(sigmono,sr, winlen=0.01, ... |
<filename>V46 Faraday/plots/plot.py
# coding=utf-8
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
import uncertainties.unumpy as unp
from uncertainties import ufloat
z, B = np.genfromtxt('data/B.txt', unpack=True)
l, th1, th2, th3 = np.genfromtxt('data/GaAs.txt', unpack=True)
d... |
<filename>f2_symbol_sync/__init__.py
# f2_symbol_sync class
# Last modification by initentity generator
#Simple buffer template
import os
import sys
import numpy as np
import scipy.signal as sig
from thesdk import *
from verilog import *
from verilog.testbench import *
from verilog.testbench import testbench as vtb
... |
<reponame>Saluev/pyfgb<filename>examples/multiplicative_complexity.py
from pyfgb import FGB
from sympy import symbols, Poly, groebner
def _make_sum(prefix, variables):
return reduce(lambda a, b: a + b, (
symbols("{prefix}_{variable.name}".format(prefix=prefix, variable=variable)) * variable
for va... |
""" Non-physics convenience and mathematical functions.
"""
import numpy as np
from scipy.interpolate import RegularGridInterpolator
def arrays_equal(ndarray_list):
"""Checks if a list of arrays are all equal.
Parameters
----------
ndarray_list : sequence of ndarrays
List of arrays to compa... |
<filename>python-version/rds_funcs.py<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 3 22:38:24 2020
@author: Kyle
"""
"""This file holds supporting functions for the
rope drag simulator series of files"""
import parameters
import math
import scipy
from scipy.optimize import fsolve
... |
from pathlib import Path
import scipy.signal
import numpy as np
from ibllib.io import spikeglx
from ibllib.dsp import voltage
from ibllib.ephys import neuropixel
from oneibl.one import ONE
from easyqc.gui import viewseis
from viewspikes.plots import plot_insertion, show_psd, overlay_spikes
from viewspikes.data impor... |
<reponame>DevStarSJ/algorithmExercise
from fractions import Fraction
import functional as F
result = []
result2 = []
for a in range(11, 99):
for b in range(a + 1, 100):
A = a / b
if a//10 == b%10 and a * (b//10) == b * (a%10):
result.append((a,b))
result2.append((a%10, b//10... |
#!/usr/bin/env python3
import adventofcode
import functools
import re
import scipy.optimize
def day1(s, n=2020):
s = set(map(int, s.split('\n')))
def find(collection, desired_sum):
return [x for x in collection if desired_sum - x in collection]
for ans in find(s, n), [x for x in s if find(s - {x}, n - x)]:
yie... |
<gh_stars>1-10
import numpy as np
from scipy.spatial import distance
class measurementError():
'''
Requires repeated measurements at single position (no rotation).
Takes a set of solver.axis instances as input.
'''
def __init__(self, axes):
self.axes = axes
def calculate_angle_error_at_z(... |
# Authors: <NAME>
# License: BSD 3 Clause
"""
PyMF Non-negative Matrix Factorization.
NMF: Class for Non-negative Matrix Factorization
[1] <NAME>. and <NAME>. (1999), Learning the Parts of Objects by Non-negative
Matrix Factorization, Nature 401(6755), 788-799.
"""
import numpy as np
import logging
im... |
<reponame>THU-DA-6D-Pose-Group/mx-DeepIM
# Author: <NAME> (<EMAIL>)
# Center for Machine Perception, Czech Technical University in Prague
# Implementation of the pose error functions described in:
# Hodan et al., "On Evaluation of 6D Object Pose Estimation", ECCVW 2016
# -----------------------------------------------... |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import bruges as b
from scipy.interpolate import interp1d
import os
topbox = dict(boxstyle='round', ec='none', fc='w', alpha=0.6)
format_tops={'fontsize':10, 'color':'blue', 'ha':'right', 'bbox':topbox}
format_title={'fontsize':14, 'weight':'bold'}... |
<filename>src/hatchet/utils/SNPCaller.py<gh_stars>0
#!/usr/bin/python3
import os, sys
import os.path
import argparse
import shlex
import subprocess as pr
from multiprocessing import Process, Queue, JoinableQueue, Lock, Value
from scipy.stats import beta
# from statsmodels.stats.proportion import *
from . import ArgPa... |
<reponame>gitrymt/qgm
import numpy as np
from scipy import integrate, special
from numba import jit
@jit(cache=True)
def gaussian(x, y, *p):
"""[summary]
Arguments:
xy_mesh {[type]} -- [description]
Returns:
[type] -- [description]
"""
# Parameters
A, x0, sigmax, y0, s... |
import numpy as np
import pytest
import scipy
import torch
from thgsp.convert import (
SparseTensor,
coo_matrix,
from_cpx,
get_array_module,
get_ddd,
spmatrix,
to_cpx,
to_np,
to_scipy,
to_torch_sparse,
to_xcipy,
)
from .utils4t import devices, float_dtypes, sparse_formats
... |
<filename>graph-measures/features_infra/graph_features.py
import os
import pickle
from multiprocessing import Process, Queue
from features_infra.feature_calculators import FeatureCalculator
from loggers import PrintLogger, EmptyLogger
import networkx as nx
import numpy as np
from scipy import sparse
from ... |
#
# Copyright <NAME> 2006
#
import cPickle, os, math, scipy.stats.distributions
from binding_hit import *
from families import *
from graph import *
from paralogs import *
from remo import *
class Bunch( object ):
"""Holds a bunch of objects as attributes"""
def __init__(self, **kwds):
"""Takes named... |
# -*- coding: utf-8 -*-
'''iCSD toolbox demonstration script'''
import matplotlib.pyplot as plt
import numpy as np
import icsd
from scipy import io
import neo
import quantities as pq
#patch quantities with the SI unit Siemens if it does not exist
for symbol, prefix, definition, u_symbol in zip(
['siemens', 'S', 'm... |
<filename>repytah/example.py<gh_stars>0
import scipy.io as sio
import numpy as np
import pkg_resources
import pandas as pd
from .utilities import create_sdm, find_initial_repeats
from .search import find_complete_list
from .transform import remove_overlaps
from .assemble import hierarchical_structure
"""
example.py
... |
<gh_stars>1-10
# TERM-FREQUENCY INVERSE DOCUMENT FREQUENCY CODEMASTER
# CODE WRITTEN BY MILK
from players.codemaster import codemaster
from nltk.stem import WordNetLemmatizer
from nltk.stem.lancaster import LancasterStemmer
from nltk.corpus import gutenberg
import nltk
from numpy.linalg import norm
from numpy import... |
# -*- coding: utf-8 -*-
from autograd import numpy as np
from autograd.scipy.stats import norm
from scipy.special import erfinv
import pandas as pd
from lifelines.utils import _get_index
from lifelines.fitters import ParametericAFTRegressionFitter
class LogNormalAFTFitter(ParametericAFTRegressionFitter):
r"""
... |
<gh_stars>0
#!/usr/bin/env python3
#afNFC_write_params.py
"""
Read geometry data from binary data file, carry-out non-dimensionalization.
Collect input arguments, geometric information, and write to a formatted text
file that will be read by the tLBM executable.
"""
import scipy.io
import math
import argpa... |
# -*- coding: utf-8 -*-
import pandas as pd, numpy as np, datetime
from scipy import stats
inFile = 'C:/Users/tkpme/OneDrive/Documents/GSoC projects/Textbook/Chapter 18/Volatility and IR of Treasury Nominal yield curve.xlsx'
def main():
IRdaily = pd.read_excel(inFile, sheet_name='Interest Rates for P... |
#!python3
"""
Tries to automatically find pixeps in the case of 3 goods and 2 additive identical agents.
"""
import symbolic_picking_sequences, sys, logging
if len(sys.argv)<2 or sys.argv[1]!="quiet":
symbolic_picking_sequences.logger.setLevel(logging.INFO)
from symbolic_picking_sequences import analyze_sequenc... |
import numpy as np
import scipy as sp
import matplotlib as mpl
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
__all__ = ("plot_feature_distribution",)
def plot_feature_distribution(data, num_bins=100):
fig, axes = plt.subplots(2, 1, sharex=True)
fig.subplots_adjust(hspace=0)
gs = mpl.gri... |
<gh_stars>1-10
from fractions import Fraction
import itertools
def matrix_formatter(matrix):
return '\n'.join(''.join(f"{str(item):11}" for item in row) for row in matrix)
def is_list_contains_only_zeroes(lst):
return lst.count(0) == len(lst)
def jordan_elimination(matrix, x, y):
matr[x] = [elem / mat... |
<gh_stars>10-100
# (c) Copyright IBM Corporation 2020.
# LICENSE: Apache License 2.0 (Apache-2.0)
# http://www.apache.org/licenses/LICENSE-2.0
import logging
import os
import pickle
import shutil
import uuid
import numpy as np
import tensorflow as tf
from itertools import repeat
from scipy.special import softmax
fr... |
import os
import wave
import time
import pickle
import pyaudio
import warnings
import numpy as np
import pandas as pd
from sklearn import preprocessing
from scipy.io.wavfile import read
import python_speech_features as mfcc
from sklearn.mixture import GaussianMixture
from datetime import datetime
from date... |
<reponame>mathischeap/mifem
import numpy as np
from screws.freeze.main import FrozenOnly
from scipy.sparse import csc_matrix
class TraceMatrix(FrozenOnly):
"""This is the trace matrix.
The N matrix will select from the cochain.local and get the cochain on the element boundary. And also the positive
out-w... |
import numpy as np
from scipy.stats import norm
from scipy.stats import uniform
from scipy.stats import truncnorm
def lba_logpdf(rt, response, b, A, v, s, t0):
def fptpdf(z,x0max,chi,driftrate,sddrift):
if x0max<1e-10:
out = (chi/np.power(z,2)) * norm.pdf(chi/z,loc=driftrate,scale=sddri... |
import os
import json
import glob
import pandas as pd
from scipy.io import loadmat
import xml.etree.ElementTree as ET
class Metadata(object):
def __init__(self, tree):
root = tree.getroot()
metadata_node = root.findall("metadata")[0]
node = metadata_node.findall("current_time")[0]
... |
<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 9 11:09:54 2020
@author: lordano
"""
import numpy as np
from scipy.optimize import curve_fit
from optlnls.constants import *
def wrap_phase(phase_2D, phase_shift=1.0):
wrapped_phase = (phase_2D + pi - phase_shift) % (2*pi)
... |
<gh_stars>0
import logging
from typing import Any, Dict, List, Sequence
import numpy as np
import sklearn
from scipy.stats import pearsonr
from sklearn.metrics import f1_score as skl_f1_score
from seqeval.metrics import f1_score as ner_f1_score
from seqeval.scheme import IOB2
from klue_baseline.data.klue_mrc import K... |
<reponame>ashander/opty
"""This solves the simple pendulum swing up problem presented here:
http://hmc.csuohio.edu/resources/human-motion-seminar-jan-23-2014
A simple pendulum is controlled by a torque at its joint. The goal is to
swing the pendulum from its rest equilibrium to a target angle by minimizing
the energy... |
<filename>python/experiments/SVGD/targetGMM.py
from time import time
import numpy as np
import autograd
from scipy.stats import multivariate_normal
from experiments.lnpdfs.create_target_lnpfs import build_GMM_lnpdf_autograd
from sampler.SVGD.python.svgd import SVGD as SVGD
import os
num_dimensions = 20
[tmp_lnpdf, ... |
from skimage import (
color, feature, filters, measure, morphology, segmentation, util
)
import os
import pandas as pd
import numpy as np
import skimage.color
from scipy.sparse import coo_matrix
from scipy.sparse import load_npz, save_npz
from skimage.measure import label, regionprops
import scanpy as sc
import m... |
from models.sppnet import get_model
from torchvision import transforms
import cv2
import torch
from torch.nn.functional import softmax
from scipy.stats.mstats import gmean
import numpy as np
from itertools import islice
from facenet_pytorch import MTCNN
from glob import glob
import os
from PIL import Image
import rando... |
from __future__ import print_function, unicode_literals, absolute_import, division
import numpy as np
import os
import collections
import warnings
from tifffile import imsave
from scipy.ndimage.morphology import distance_transform_edt, binary_fill_holes
from scipy.ndimage.measurements import find_objects
try:
fro... |
<filename>flexCE/calc_yields/limongi_chieffi_yields.py
"""Generate finely spaced grid of SN II isotopic yields.
Use a combination of the Chieffi & Limongi (2004) & Limongi & Chieffi (2006).
Chieffi & Limongi (2004): M = 13--35 Msun; Z = 0--solar
Limongi & Chieffi (2006): M = 11--120; Z = solar
Mass cut = 0.1 Msun Ni... |
'''
Biax Analysis: Get HTM, LTM and Transition Stress/Strain Points for E11 and E22 in Biax txt file
Inputs: - 'path_name' = path where biax stress strain txt file is
- 'output_csv' = where analysis csv file will go
Ouptuts:- parameter outputs --> biax analysis output Parameters
- plot of truncated data... |
<filename>Fourier/FourierSeries.py
import scipy
import matplotlib.pyplot as plt
import scipy.integrate as integrate
#enter a periodic signal and output a its fourier representation
class FourierSeries:
def __init__(self, function, period, startval):
#making assumption this is all I need
self.functi... |
<reponame>iamnives/AA-remotesensing-artificial-structures
"""
Created on Thu May 30
@author: <NAME>
"""
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import matplotlib.pyplot as plt
import scipy.signal
import gdal
from utils import visualization as viz
import time
from datetime ... |
import numpy as np
import torch
from scipy.io import loadmat
class BCIDataset(torch.utils.data.Dataset):
"""
Loads the BCI dataset. It loads trimmed signals from a .mat file.
Update when the new dataset is ready.
"""
def __init__(self, root, transforms, min_size=500):
super().__init__()
... |
"""
Class for Hinode/EIS instrument. Holds information about spectral, temporal, and spatial resolution
and other instrument-specific information.
"""
from dataclasses import dataclass
import json
import pkg_resources
import numpy as np
from scipy.ndimage.filters import gaussian_filter
from sunpy.map import Map
import... |
<filename>homing_search/data.py
from sklearn.model_selection import train_test_split
from pandas import DataFrame
import tensorflow as tf
from tensorflow.keras.optimizers import schedules
from .utils import add_to_log, moving_average
from statistics import median
class AbstractAdaptor():
def __init__(self, data, l... |
<filename>sympy/geometry/tests/test_util.py
from __future__ import division
from sympy import Symbol, sqrt, Derivative
from sympy.geometry import Point, Polygon, Segment, convex_hull, intersection, centroid
from sympy.geometry.util import idiff
from sympy.solvers.solvers import solve
from sympy.utilities.pytest import... |
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 27 11:07:18 2019
@author: DaniJ
"""
import PB_coup_fourlayer_3try as flmPB3
import PB_coup_four_layer_2try_2v as flmPB_v2
import PB_coup_four_layer_2try as flmPB
import four_layer_model_2try_withFixSpeciesOption_Scaling_2surface as flm1
import numpy as np
import scipy as... |
<gh_stars>1-10
import math
from skdesign.power import (PowerBase,
is_numeric,
is_positive,
is_boolean)
from skdesign.power.means import OneSample
from scipy.optimize import brenth
import scipy.stats as stats
class MultiSampleWilliams(... |
<filename>helpers/thesis-plots.py
from apertools import utils
import matplotlib.pyplot as plt
import matplotlib as mpl
from scipy.stats import rayleigh
import numpy as np
# print(plt.style.available)
# ['Solarize_Light2', '_classic_test_patch', 'bmh', 'classic', 'dark_background', 'fast',
# 'fivethirtyeight', 'ggplot'... |
<filename>pysigview/widgets/signal_display.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 21 10:09:46 2017
Ing.,Mgr. (MSc.) <NAME>
Biomedical engineering
International Clinical Research Center
St. Anne's University Hospital in Brno
Czech Republic
&
Mayo systems electrophysiology lab
Mayo Clin... |
<filename>scripts/adaptivecontrol/figure7.py
'''
This file is part of the Repeatability Evaluation submission for the ACM HSCC'16.
Paper title: Adaptive Decentralized MAC for Event-Triggered Networked Control Systems
Contact:
<NAME>
<EMAIL>
Copyright (c) Chair of Communication Networks, Technical University of Munic... |
<filename>ibllib/ephys/ephysqc.py
"""
Quality control of raw Neuropixel electrophysiology data.
"""
from pathlib import Path
import logging
import numpy as np
import pandas as pd
from scipy import signal
from scipy.ndimage import gaussian_filter1d
import alf.io
from brainbox.core import Bunch
from brainbox.processing... |
<reponame>johnnydevriese/wsu_courses
import math
import numpy
import scipy
import pylab
import scipy.optimize
def f(x):
y = ( ( 0.965 + 1.0 ) / ( 0.2588 ) ) * x + numpy.log( 1 - ( x / 0.2588 ) )
return y
def y(x):
y = ( ( 0.9659258263 + 1.0 ) / ( 0.2588190451 ) ) + ( 1 / ( 1 - (x / 0.2588190451)) ) * (-... |
<gh_stars>1-10
import sympy as sp
import numpy as np
from sympy import Matrix, linsolve
import math
# solve integral equation
# x(t) - \lambda \int_l^r ker * x(s) ds = f
# with approx kernel with degenerate kernel
def get_chebyshev_points(l, r, count, ker):
Y = []
for k in np.arange(1, count + 1):
ch... |
#!/bin/sh
# Script.py
#
#
# Created by <NAME> on 4/30/19.
# http://scipy-lectures.org/intro/scipy/auto_examples/plot_curve_fit.html
# https://www.math.arizona.edu/~tgk/541/chap1.pdf
# https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.curve_fit.html
# https://www.researchgate.net/figure/Correlati... |
import json
from pathlib import Path
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import iqr
from astropy.io import fits
from desispec.preproc import preproc
class ExpUtils:
"""Produce preprocessed stacks and other statistical fquantities of CCD exposures
Args:
file_list (str)... |
<reponame>JonasKemmer/AliasFinder<filename>aliasfinder/af_calc.py
import numpy as np
from scipy.signal import find_peaks
import aliasfinder.af_utils as af_utils
def get_phase_info(gls_obj,
power_threshold=None,
sim=False,
frequency_array=None):
""" Get inf... |
<filename>hera_sim/tests/test_adjustment.py
"""Test the various simulation adjustment tools."""
import copy
import itertools
import logging
import os
import pytest
from astropy import units
from scipy import stats
import numpy as np
from hera_sim import adjustment
from hera_sim import antpos
from hera_sim import int... |
#!/usr/bin/env python3
from sentence_transformers import SentenceTransformer, util
model = SentenceTransformer('paraphrase-multilingual-mpnet-base-v2') # try en_roberta_large_nli_stsb_mean_tokens
import csv
import sys
from typing import List
# import gensim
from scipy import spatial
from sent2vec.vectorizer... |
<filename>pak/datasets/Hands.py
from pak.datasets.Dataset import Dataset
import numpy as np
import zipfile
import tarfile
import urllib.request
import shutil
from os import makedirs, listdir
from os.path import join, isfile, isdir, exists, splitext
from scipy.ndimage import imread
from scipy.misc import imresize
from s... |
<gh_stars>1-10
import json
import os
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from collections import OrderedDict
from functools import reduce
from itertools import product
import numpy as np
from scipy import optimize
from pytorch_acdc.layers import StackedLinea... |
<reponame>IntelligentBehaviourUnderstandingGroup/end-to-end-multiview-lipreading
# Preprocessing scripts for AV Letters Dataset
import math
import numpy as np
import numpy.matlib as matlab
import scipy.signal as signal
import scipy.fftpack as fft
from scipy.misc import imresize
def test_delta():
a = np.array([[1... |
import cv2
import numpy as np
from scipy.signal import gaussian
def get_state_dict(filter_size=5, std=1.0, map_func=lambda x:x):
generated_filters = gaussian(filter_size, std=std).reshape([1, filter_size
]).astype(np.float32)
gaussian_filter_horizontal = ge... |
<reponame>jjhenkel/dockerizeme
#!/usr/local/bin/python
# coding: utf-8
import cv2
import sys
import numpy
from matplotlib import pyplot as plt
from scipy.spatial import distance
"""
OpenCV program to extract ticket stub images from photographs,
via automatic perspective correction for quadrilateral objects.
Intended ... |
import math
import numpy
import matplotlib
matplotlib.use('TkAgg')
from skimage import io
from skimage import feature
from skimage import draw
from skimage import util
from skimage import color
from skimage import morphology
from skimage import filters
from skimage import measure
from skimage import transform
from sk... |
<reponame>Tomev-CTP/BoSS
__author__ = "<NAME>"
import math
from copy import deepcopy
from typing import List, Iterable
from numpy import ndarray
from scipy import special
from ..boson_sampling_utilities.boson_sampling_utilities import generate_lossy_inputs, generate_possible_outputs
from ..boson_sampling_utilities.p... |
import networkx as nx
import numpy as np
import scipy
import matplotlib.pylab as plt
import itertools
import random
import functools
from numpy import linalg as LA
"""
variation of delta deg and delta gap with lattice dimension
"""
def remove_random_nodes(A,N):
rs = random.sample(A.nodes, N)
A.remove_nodes_... |
<gh_stars>0
"""Render a project as a Panda3D scene with orthographic camera."""
import math
import os
import pickle
import numpy as np
import scipy.spatial
from props import getNode
from scipy.interpolate import LinearNDInterpolator
from tqdm import tqdm
from . import camera, panda3d, project
from .logger import log
... |
<reponame>ImOsMa/pytorch-dc-tts
import os
import re
import codecs
import unicodedata
from scipy.io.wavfile import read
import numpy as np
import decimal
import librosa
from torch.utils.data import Dataset
from warnings import warn
import struct
from scipy.ndimage.morphology import binary_dilation
try:
import webrt... |
import numpy as np
import pandas as pd
import tensorflow as tf
import scipy.misc
from keras.utils import plot_model
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Model, Sequential
from keras.layers import Input, Dropout, Activation, LSTM, Conv2D, Conv2DTranspose, Dense, TimeDistribu... |
<gh_stars>0
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import scipy.signal as signal
#D2008=pd.read_csv("clean_transacciones2008.txt",delimiter=";")
#D2009=pd.read_csv("clean_transacciones2009.txt",delimiter=";")
#D2010=pd.read_csv("clean_transacciones2010.txt",delimiter=";")
#
#D2008["date... |
<gh_stars>0
'''
Вводится строка — формула некоторой функции от x. В следующей строке вводятся
через запятую два числа, A и B, такие что f(x) на [A,B] непрерывна,
дифференцируема и имеет ровно один корень, будучи разных знаков на концах
отрезка (проверять не надо). Найти и вывести этот корень с точностью 0.000001
(предс... |
<filename>src/plasticorigins/tracking/trackers.py
import matplotlib.patches as mpatches
import numpy as np
from pykalman import AdditiveUnscentedKalmanFilter, KalmanFilter
from scipy.stats import multivariate_normal
from plasticorigins.tracking.utils import (
GaussianMixture,
exp_and_normalise,
in_frame,
)... |
<gh_stars>10-100
import os
import scipy
import random
import numpy as np
import tensorflow as tf
from scipy.misc import imread
from tensorpack import DataFlow
class DatasetMetadata(object):
"""Helper class which loads and stores dataset metadata."""
def __init__(self, filename):
import csv
""... |
import numpy as np
import scipy.stats as st
import matplotlib.pyplot as plt
import chaos_basispy as cb
def f(xi, a, b, c, W):
assert xi.shape[0] == 10
assert W.shape[0] == 10
return a + b * np.dot(W.T, xi) + c * np.dot(xi.reshape(1,xi.shape[0]), np.dot(np.dot(W, W.T) , xi))
dim = 10
np.random.seed(1234... |
<gh_stars>10-100
# Copyright 2018 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... |
#!/usr/bin/env python2
import numpy
import cPickle
import scipy.misc
import os
from sklearn.cluster import MeanShift, estimate_bandwidth
from sklearn.datasets.samples_generator import make_blobs
from itertools import cycle
import data
from data.hdf5 import taxi_it
from data.transformers import add_destination
print "G... |
import scipy as sp
from scipy.interpolate import splrep,splev
class Bspline(object):
"""A class to wrap around scipy bspline fits
"""
def __init__(self,x,y,order=3):
self.x = x
self.y = y
self._order = order
self.tck = splrep(self.x,self.y, k = self._order)
@pr... |
#!/usr/bin/env python
import numpy as np
from scipy import optimize
import matplotlib.pyplot as plt
np.random.seed(0)
# Our test function
def f(t, omega, phi):
return np.cos(omega * t + phi)
# Our x and y data
x = np.linspace(0, 3, 50)
y = f(x, 1.5, 1) + .1*np.random.normal(size=50)
# Fit the model: the parame... |
<filename>experiments/utils/utils_canonicalize_amass.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os, sys, glob
import numpy as np
from tqdm import tqdm
import torch
import smplx
from scipy.spatial.transform import Rotation as R
import json
'... |
<reponame>jswoboda/PlaneProcessing
#!/usr/bin/env python
"""
Created on Wed Dec 30 16:11:56 2015
@author: <NAME>
"""
import os, glob,inspect,getopt,sys
import shutil
import pdb
import scipy as sp
import numbers
import matplotlib
import pickle
matplotlib.use('Agg')
from SimISR.IonoContainer import IonoContainer, MakeT... |
<filename>BCI/BCI/RCNN_2nd.py
import CSP, scipy.io, BCI
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
import numpy as np
def cnt_to_epo(cnt, mrk, ival=3000):
epo = []
for v in mrk:
epo.append(np.array(cnt[v : v + ival]))
epo = np.array(epo)
return epo
def make_data(sub):
cnt = scip... |
<filename>learning_DAN/RF/RF.py
import scipy.io as sio
import numpy as np
from sklearn.ensemble import RandomForestRegressor
data = []
data = sio.loadmat('RF_2.mat')
x_train = data['x_train']
y_train = data['y_train']
x_test = data['x_test']
y_test = data['y_test']
y_train = np.reshape(y_train, [np.shape(y_train)[0]... |
<reponame>aragilar/astroML
"""
Regularized Regression Example
------------------------------
This performs regularized regression on a gaussian basis function model.
"""
# Author: <NAME> <<EMAIL>>
# License: BSD
# The figure is an example from astroML: see http://astroML.github.com
import numpy as np
from matplotlib ... |
# -*- coding: utf-8 -*
"""
---------------------
SOFTWARE DESCRIPTION:
---------------------
Written October 2018 -- <NAME>
Typeset in Python 3
This python class is specifically made for the spectroscopic data reduction of the Shelyak eShel spectrograph
which is installed at the Hertzsprung SONG node telescope at Ten... |
import random
import logging as log
import numpy as np
import sklearn.manifold
import sklearn.metrics.pairwise
from scipy.spatial.distance import cdist
from scipy.sparse import issparse
# --------------------------------------------------------------
class SphericalKMeans:
"""
Basic implementation of Spherica... |
<reponame>jmnel/simulated-annealing<filename>zoo/rosenbrock.py
import sympy as sym
from .benchmark import Benchmark
class Rosenbrock(Benchmark):
def __init__(self):
super().__init__()
self.name = 'Rosenbrock'
self.name_short = 'RB'
self.dims = 2
x = sym.IndexedBase('x')
... |
<filename>bovy_coords/__init__.py
###############################################################################
#
# bovy_coords: module for coordinate transformations between the equatorial
# and Galactic coordinate frame
#
#
# Main included functions:
# radec_to_lb
# lb_to... |
# By <NAME> for "Balancing sensitivity and specificity in
# distinguishing TCR groups by CDR sequence similarity"
# See README for license information
from matplotlib import pyplot as plt
from scipy.cluster.hierarchy import dendrogram, linkage, fcluster
from Bio import motifs
from Bio.Seq import Seq
from Bio.Alphabet... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.