text string |
|---|
"""Smolyak sparse grid constructor."""
from collections import defaultdict
from itertools import product
import numpy
from scipy.special import comb
import numpoly
import chaospy
def construct_sparse_grid(
order,
dist,
growth=None,
recurrence_algorithm="stieltjes",
rule="gaus... |
# Author: <NAME> at 14/02/2022 <<EMAIL>>
# Licence: MIT License
# Copyright: <NAME> (2018) <<EMAIL>>
from typing import Any, Sequence, Union
import numpy as np
from scipy.sparse import issparse
from reservoirpy.utils.validation import check_vector
def _check_values(array_or_list: Union[Sequence, np.ndarray], value:... |
from sympy import Matrix, Identity, DotProduct, eye
from sympy import sin, cos, sqrt, asin, acos
from sympy.matrices.expressions.vee import vee, Vee
from sympy.matrices.expressions.hat import hat, Hat
I3 = Matrix.eye(3)
v0 = Matrix([0,0,0])
def V(theta):
norm2 = (theta.T * theta)[0]
if norm2 == 0:
re... |
'''
a container of track
'''
import argparse
import sys
import os
import numpy as np
import pandas as pd
import scipy
from ..fileio import get_files, get_dirs, ts_indict
from ..utils import sort_dict, filename_data
from .track import Track
from ..eep.critical_point import CriticalPoint, Eep
max_mass = 1000.
min_ma... |
import audiovisualizer
import PIL.Image
import PIL.ImageDraw
import pylab
import scipy
import scipy.io
import scipy.signal
# The sample rate of the input matrix (Hz)
SAMPLE_RATE=44100
# Frequency range to display (audible is 16-16384Hz)
DISPLAY_FREQ=(16, 1000)
# FPS of output (Hz)
OUT_FPS = 30
# Size of the moving ave... |
<filename>factorio.py
import math
from collections import deque
from fractions import Fraction
TIME = "time"
PRODUCT_COUNT = "product count"
INGREDIENTS = "ingredients"
INGREDIENT = "ingredient"
SPEED = "speed"
MACHINE = "machine"
FURNACE = "furnace"
ASSEMBLER = "assembler"
CHEMICAL_PLANT = "chemical plant"
FLUID_CHEM... |
"""
Models for training Multilabel classification tasks.
"""
__author__ = "<NAME>"
__email__ = "<EMAIL>"
import numpy as np
from tqdm import tqdm
from scipy import sparse
import torch
import torch.nn as nn
import torch.nn.functional as F
# Faiss for MIPS (maximum inner product search)
import faiss
# Internal.
from ... |
<gh_stars>1-10
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as img
# from scipy.io import loadmat
from scipy import misc
import cv2
def read_image():
# loading the png image as a 3d matrix
img = cv2.imread('Original_assets/roi.jpg')
# uncomment the below code to view the loaded imag... |
<gh_stars>1-10
"""
Utility functions for all our codes.
"""
import os
from os.path import join as joinP
import logging
import cPickle as cpk
import collections
import re
from bioservices import KEGG
from Bio import SeqIO
from Bio.KEGG import Enzyme
import networkx as nx
import matplotlib.pyplot as plt
import numpy as... |
<filename>venv/lib/python3.6/site-packages/madmom/audio/stft.py
# encoding: utf-8
# pylint: disable=no-member
# pylint: disable=invalid-name
# pylint: disable=too-many-arguments
"""
This module contains Short-Time Fourier Transform (STFT) related functionality.
"""
from __future__ import absolute_import, division, pr... |
<filename>starvine/bvcopula/tests/test_t_copula_fit.py<gh_stars>10-100
#!/usr/bin/env python2
##
# \brief Tests for T- and Gaussian copula fitting
from __future__ import print_function, division
import unittest
from scipy.optimize import bisect
from scipy.stats.mstats import rankdata
from scipy.stats import kendalltau
... |
#!/usr/bin/env Python
# -*- coding: utf-8 -*-
'''
=====================================================================================
Copyright (c) 2016-2018 Université de Lorraine & Luleå tekniska universitet
Author: <NAME> <<EMAIL>>
<<EMAIL>>
This program is free software: you can redistri... |
# PLUG-FLOW REACTOR MODEL
# -------------------------
# import packages/modules
import math as MATH
import numpy as np
from scipy.integrate import solve_ivp
# internal
from PyREMOT.docs.rmtUtility import rmtUtilityClass as rmtUtil
from PyREMOT.docs.rmtThermo import *
from PyREMOT.docs.rmtReaction import reactionRateEx... |
<reponame>YuePengUSTC/AADR<gh_stars>1-10
try:
from scikits.sparse.cholmod import cholesky
factorized = lambda A: cholesky(A, mode='simplicial')
except ImportError:
print("CHOLMOD not found - trying to use slower LU factorization from scipy")
print("install scikits.sparse to use the faster cholesky facto... |
import os
import re
import functools
from itertools import chain
import attr
import logbook
from pathlib import Path
import pandas as pd
from ete3 import Tree
from common import config
from common.rename import *
genus = snakemake.config["genus"]
species = snakemake.config["species"]
taxid = snakemake.config["tax... |
<reponame>jsalvatier/Theano-1
import unittest
import theano
import theano.tensor as T
from theano import function, shared
from theano.tests import unittest_tools as utt
from theano.tensor.nnet.ConvTransp3D import convTransp3D
from theano.tensor.nnet.ConvGrad3D import convGrad3D
from theano.tensor.nnet.Conv3D import con... |
<filename>gurobi_sc.py<gh_stars>0
#!/usr/bin/env python
#
# A Python package for temporal consistency and scheduling.
#
# Copyright (c) 2015 MIT. All rights reserved.
#
# author: <NAME>
# e-mail: <EMAIL>
# website: people.csail.mit.edu/psantana
#
# Redistribution and use in source and binary forms, with or wit... |
#!/usr/bin/env python
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# --------------------------------------------------------
"""Train a Fast R-CNN network on a region of interest d... |
<reponame>tamnguyenvan/MTTS-CAN
import tensorflow as tf
import numpy as np
import scipy.io
import os
import sys
import argparse
sys.path.append('../')
from model import Attention_mask, MTTS_CAN
import h5py
import matplotlib.pyplot as plt
from scipy.signal import butter
from inference_preprocess import preprocess_raw_vi... |
<gh_stars>1-10
import os
import copy, math, sys, time, shutil, imageio
import numpy as np
import seaborn as sns
import scipy.stats
from tqdm.auto import tqdm
from tqdm.auto import trange
from time import perf_counter
from scipy.interpolate import make_interp_spline
import matplotlib.pyplot as plt
from mpl_toolkits impo... |
"""Module containing the ``Gate`` and ``GateFactory`` classes in addition to all
``Gate`` subclasses.
"""
from abc import ABC, abstractmethod
from cmath import exp
from functools import lru_cache
from math import cos, sin, sqrt
from typing import Callable, Dict, List, Optional, Sequence
import numpy as np
from thewalr... |
<filename>simulation_ws/src/sagemaker_rl_agent/markov/environments/deeprotor_env.py<gh_stars>1-10
from __future__ import print_function
import time
# only needed for fake driver setup
import boto3
# gym
import gym
import numpy as np
from gym import spaces
from PIL import Image
import os
import math
# Type of worker
... |
<filename>useful-scripts/prepare_stack_for_lmc.py
import numpy as np
from scipy.ndimage import zoom
from plantsegtools.utils.io import smart_load, create_h5
from skimage.segmentation import find_boundaries
from skimage.morphology import erosion
from plantsegtools.postprocess import LMC_CONFIG_PATH
import yaml
import os... |
<gh_stars>0
from collections import Counter
import scipy
import numpy as np
import pandas as pd
from sklearn import svm, datasets , neighbors
from sklearn.model_selection import train_test_split
from sklearn.metrics import average_precision_score, precision_score, recall_score
from sklearn.metrics import precision_reca... |
<reponame>echaussidon/LSS
import math
import numpy as np
from scipy import integrate
from matplotlib import pyplot
from scipy import interpolate
def H_z(z, H_0, omega_m, omega_l):
Hz = H_0*np.sqrt(omega_m*(1+z)**3 + omega_l)
return Hz
def r_comoving(z, H_0, omega_m, omega_l):
c= 299792.45 #km/s
try:
n=... |
from .BaseStep import BaseStep
from ..data.Posts import Posts
import tomotopy as tp
import pandas as pd
import numpy as np
import json
import csv
import random
import statistics
from collections import Iterable
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib import cm
from mat... |
#!/usr/bin/env python
# coding: utf-8
## Running a Multivariate Regression in Python
# *Suggested Answers follow (usually there are multiple ways to solve a problem in Python).*
# Let’s continue working on the file we used when we worked on univariate regressions.
# *****
# Run a multivariate regression with 5 independ... |
<gh_stars>1-10
#!/usr/bin/env python2.7
"""
make_model_cube.py
==================
Given a series of MFS images, extract spectra of specified
sources, optionally smooth across freq, and insert into a proper CASA
image cube and write to disk.
"""
import astropy.io.fits as fits
import argparse
import os
import sys
import... |
import argparse
import math
import os
import subprocess
import shutil
import numpy as np
import scipy.optimize
from JMLUtils import eprint
from StructureXYZ import StructXYZ
from typing import Sequence
DEFAULT_HWT = 0.4
DEFAULT_DIST = 4.0
DEFAULT_OUTFILE = 'probe'
DEFAULT_EXP = 6
DEFAULT_MIN_DIST = 4.0
DEFAULT_RESTR... |
import os
import re
from typing import List, Optional, Union
import numpy as np
from matplotlib import pyplot as plt
from pandas import DataFrame
from scipy.optimize import curve_fit
from sigfig import round
from sklearn.metrics import r2_score
class HillFit(object):
def __init__(
self,
x_data: U... |
from matplotlib import pyplot as plt
from scipy.stats import binned_statistic_2d
from ..formula.element_ratios import element_ratios
from ..formula.element_counts import element_counts
def van_krevelen_histogram (msTuple, x_ratio = 'OC', y_ratio ='HC', **kwargs):
"""
Docstring for function PyKrev.van_krevelen... |
<gh_stars>0
import numpy as np
from scipy import spatial
import open3d as o3d
from . import grasp
from . import util
def euclidean_distances(graspset1, graspset2):
"""
Computes the pairwise euclidean distances of the positions of the provided grasps from set1 and set2.
This is a vectorized implementation... |
<reponame>BlackPianoCat/simulating_non_gaussian_surfaces
##################################################################
#
# Coded in Python by <NAME> © 2021 (<EMAIL>)
# Original file in MATLAB by Dr. <NAME>
#
##################################################################
import numpy as np
import statistics a... |
<reponame>jessecusack/pytg<gh_stars>1-10
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.11.2
# kernelspec:
# display_name: pytg
# language: python
# name... |
<gh_stars>1-10
#!/usr/bin/env python
import scipy as sp
import scipy.stats
import pprint
import argparse
import csv
import re
import os
import MySQLdb
try:
import xlsxwriter
import xlrd
writeXLS = True
print 'yes XLS module imported'
except:
writeXLS = False
print 'No XLS module imported'
#... |
# Copyright (c) 2020 <NAME>
'''
File in order to compute an optimal LQR controller
x[k] = [theta , thetaDot]
'''
import numpy as np
import scipy.linalg
# Discrete-time LQR
def dlqr(A, B, Q, R):
"""Solve the discrete time lqr controller.
x[k+1] = A x[k] + B u[k]
cost = sum x[k].T*Q*x[k] + u... |
<reponame>EstebM/QRevPy
import numpy as np
from scipy.stats import t
class Uncertainty(object):
"""Computes the uncertainty of a measurement.
Attributes
----------
cov: float
Coefficient of variation for all transects used in dicharge computation
cov_95: float
Coefficient of varia... |
<gh_stars>0
import cv2
import numpy as np
import timeit
import logging
import os
import cPickle as pickle
from scipy import ndimage
import fli
import gzip
import scipy.ndimage.interpolation as scipint
from os import listdir
from os import remove
from os.path import isfile, join
path = '../data/custom/'
def shuffle_in... |
#!/usr/bin/env python
import sys, imp
import numpy as np
import pandas as pd
import xarray as xr
import matplotlib; matplotlib.use('AGG')
import matplotlib.pyplot as plt
import seaborn as sns; sns.set(style="white")
import cartopy.crs as ccrs
# Directories
basedir = str(sys.argv[5])
in__dir = str(sys.argv[6])
ou... |
#! /usr/bin/env python
import numpy as np
from scipy.optimize import leastsq
from leastsqbound import leastsqbound
def func(p, x):
"""model data as y = m*x+b """
m, b = p
return m * np.array(x) + b
def err(p, y, x):
return y - func(p, x)
# extract data
temp = np.genfromtxt("sample_data.dat")
x = ... |
<reponame>stevenshave/lagrange-binding-systems<gh_stars>0
"""
1:6 binding system solved using Lagrange multiplier approach
Modified Factory example utilising Lagrane multiplier to solve complex
concentration in a 1:6 protein:ligand binding system
"""
from timeit import default_timer as timer
from scipy.optimize import... |
<gh_stars>10-100
#!/usr/bin/env python
# encoding: utf-8
import argparse
import h5py
import os
import numpy as np
from sklearn.datasets import load_svmlight_file
from sklearn.preprocessing import MultiLabelBinarizer
import scipy.sparse as sp
import pickle
from sklearn.preprocessing import normalize
from tqdm import tq... |
import time, os.path as path
from sardana import State
from sardana.pool.controller import CounterTimerController, Type, Description, DefaultValue
import re
import warnings
import numpy as np
from scipy.stats import sem
import zhinst.ziPython as zh
import zhinst.utils as utils
class boxcars:
def __init__(self, i... |
<reponame>computervisionlearner/cycle_GAN<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 22 21:09:12 2017
@author: no1
"""
import tensorflow as tf
import numpy
import scipy.misc as misc
import os
import cv2
cwd = os.getcwd()
image=[]
for img_name in os.listdir(cwd):
img_path... |
<filename>Regression/SimpleLinearRegression/howItWorksLinearRegression.py<gh_stars>0
# -*- coding: utf-8 -*-
"""Linear regression for machine learning
This file demonstrate knowledge of linear regression. By building the algorithm
from scratch.The idea of linear regression is to take continuous data and find
the best ... |
<gh_stars>0
import numpy as np
from scipy.linalg import solve
import random
import binascii
import time
def decision(probability):
return random.random() < probability
def jam(codewords, noise):
jammed = []
for letter in codewords:
new = []
for bit_idx in range(len(letter)):
i... |
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 1 16:32:55 2020
IN DEVELOPMENT
atm - automated test measurements
Utility toolset that will eventually enable automated measurement of test structure devices.
Consists of a few important classes:
MeasurementControl - performs and analyses measurements according to a... |
import sys
import tensorflow as tf
import numpy as np
import time
from sklearn.cluster import KMeans
import scipy
import scipy.stats as stats
np.random.seed(1)
tf.set_random_seed(1)
jitter = 1e-3
class GPTF:
#self.tf_log_lengthscale: log of RBF lengthscale
#self.tf_log_tau: log of inverse variance
#self.... |
<reponame>Polirecyliente/SGConocimiento
#T# the following code shows how to apply the law of contrapositive from propositional logic
#T# to apply the law of contrapositive from propositional logic, the sympy package is used
import sympy
#T# create the symbols that represent the logical statements
p = sympy.Symbol('p'... |
<filename>Machine Learning/YOLOv3.py
#!/usr/bin/env python3
'''
MIT License
Copyright (c) 2017 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limit... |
"""
Preprocess dataset to fit the input
"""
import numpy as np
import scipy.sparse
import os
import sys
import argparse
def pp2adj(filepath, is_direct=True, delimiter='\t',
outfile=None):
"""
Convert (vertex vertex) tuple into numpy adj matrix
adj matrix will be returned.
If outfile is provided, al... |
<gh_stars>0
import sympy
import torch
from torch.distributions import kl_divergence
from ..utils import get_dict_values
from .losses import Loss
class KullbackLeibler(Loss):
r"""
Kullback-Leibler divergence (analytical).
.. math::
D_{KL}[p||q] = \mathbb{E}_{p(x)}[\log \frac{p(x)}{q(x)}]
Ex... |
'''
Created on Dec 5, 2012
@author: jason
'''
import pickle as pkl
import numpy as np
import os
from util.mlExceptions import *
from inspect import stack
from collections import Counter
from numpy.linalg import norm
from sklearn import mixture
from scipy.io import loadmat
from evaluation import evaluateClustering
d... |
#!/usr/bin/python3
"""
Tests the OpenCV and custom HOG implementaion descriptors for statistical differences in them.
Checks their mean, length and standard deviation.
"""
from Constants import *
import scipy.stats
import numpy as np
def main():
# Fills the global variables timesElapsedWithAR and timesElapsedWitho... |
<gh_stars>1000+
# Copyright 2020 DeepMind Technologies Limited.
#
# 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 appli... |
import sys
sys.path.append('../')
from pathlib import Path
import numpy as np
from importlib import import_module
import scipy.optimize
import time
import matplotlib.pyplot as plt
from tqdm import tqdm
import pickle
import os
from py_diff_stokes_flow.common.common import print_info, print_ok, print_error, print_warni... |
import numpy as np
from scipy.special import expit
import json
class Emulator(object):
def __init__(self, filebase, kmin=1e-3, kmax=1):
super(Emulator, self).__init__()
self.load(filebase)
self.n_parameters = self.W[0].shape[0]
self.n_components = self.W[-1].shape[-1]
se... |
import numpy as np
import scipy.linalg
import warnings
__all__ = ['QuadMetric', 'QuadMetricDiag', 'QuadMetricFull',
'QuadMetricDiagAdapt', 'QuadMetricFullAdapt']
# TODO: finish docstring of QuadMetricDiag and QuadMetricFull
# TODO: implement low-rank adaptive metric?
# https://github.com/pymc-devs/py... |
<filename>video_tracking.py
## Import the required modules
# Check time required
import time
time_start = time.time()
import sys
import os
import argparse as ap
import math
import imageio
from moviepy.editor import *
import numpy as np
sys.path.append(os.path.dirname(__file__) + "/../")
from scipy.misc import imr... |
<filename>PhloxAR/core/image.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function
from __future__ import unicode_literals, absolute_import
import numpy as np
from PhloxAR.core.color import ColorSpace, Color
from PhloxAR.core.dft import DFT
from PhloxAR.core.drawing_layer im... |
<reponame>LodeLand/nlcontrol<filename>nlcontrol/systems/system.py
import nlcontrol.signals as sgnls
from copy import deepcopy, copy
import warnings
import types
from sympy.physics.mechanics import dynamicsymbols
from sympy.matrices import Matrix
from sympy.tensor.array.ndim_array import NDimArray
from sympy.physics.m... |
import pytest, numbers, warnings
import numpy as np
from numpy.testing import assert_array_equal, assert_allclose, assert_equal
from scipy.sparse import rand as sprand
from scipy import optimize
from pyuoi import UoI_L1Logistic
from pyuoi.linear_model.logistic import (fit_intercept_fixed_coef,
... |
<filename>plot_clustering.py
import matplotlib.pyplot as plt
import numpy as np
from scipy import sparse
from mpl_toolkits.mplot3d import Axes3D
Axes3D
from sklearn.decomposition import RandomizedPCA
def plot_clustering(X, y=None, axes=None, three_d=False, forest=None):
if y is None and forest is None:
r... |
<reponame>AHrmnd/ASP-1
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 10
@author: jaehyuk
"""
import numpy as np
import scipy.stats as ss
import scipy.optimize as sopt
import pyfeng as pf
'''
MC model class for Beta=1
'''
class ModelBsmMC:
beta = 1.0 # fixed (not used)
vov, rho = 0.0, 0.0
sigma, intr, ... |
<filename>test/unit/Utilities/TopologyTest.py
import OpenPNM
from OpenPNM.Utilities import topology
import scipy as sp
topo = topology()
class TopologyTest:
def setup_class(self):
self.net = OpenPNM.Network.Cubic(shape=[5, 5, 5], spacing=1)
Ps = self.net.pores()
Ts = self.net.throats()
... |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 02 21:24:59 2016
@author: <NAME>
"""
import numpy as np
import os
from matplotlib import pyplot as pl
from scipy.optimize import curve_fit
from scipy.stats import binned_statistic
#Define the working directory
print(os.getcwd())
#os.chdir("Y:/... |
<filename>metpy/calc/thermo.py<gh_stars>1-10
# Copyright (c) 2008-2015 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import division
import numpy as np
import scipy.integrate as si
from ..package_tools import Exporter
from ..constan... |
import numpy as np
from scipy.spatial import cKDTree
def crossmatch(X1, X2, max_distance=np.inf):
"""Cross-match the values between X1 and X2
By default, this uses a KD Tree for speed.
Parameters
----------
X1 : array_like
first dataset, shape(N1, D)
X2 : array_like
second da... |
<reponame>rambam613/etna-ts<filename>tests/test_pipeline/conftest.py
from typing import Tuple
import pandas as pd
import pytest
import scipy
from numpy.random import RandomState
from scipy.stats import norm
from etna.datasets import TSDataset
from etna.models import CatBoostModelPerSegment
from etna.pipeline import P... |
<reponame>HanCamp/covid-19-rio-de-janeiro-Medium-article
import pandas as pd
import numpy as np
from os import path
import json
import matplotlib.pyplot as plt
from lmfit import Model, Parameters, minimize
from lmfit.printfuncs import report_fit
from scipy.optimize import curve_fit
from sird_models import *
def get_da... |
# 2019 4월 it works.
import numpy as np
import matplotlib.pyplot as plt
import random as rand
from scipy.spatial import Delaunay
colors = ['blue', 'green', 'red', 'cyan', 'magenta', 'yellow']
x = 0
y = 1
def orientation(p, q, r):
val = (float(all_point[q,y] - all_point[p,y]) * (all_point[r,x] - all_point[q,x])) ... |
import dgl
import time
import tqdm
import ipdb
import argparse
import pandas as pd
import seaborn as sns
import numpy as np
from sklearn.neighbors import NearestNeighbors
from scipy.stats import pearsonr
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings('ignore')
import torch
import torch.nn.func... |
'''
Preprocess STRING edge lists for use in deepNF.
This script reads the six STRING edge lists in $CEREVISIAEDATA/deepNF and
exports six adjacency matrices in `.mat` format for use by deepNF.
Code originally by <NAME>, adapted from
https://github.com/VGligorijevic/deepNF.
Usage:
python preprocessing.py --genes ... |
import argparse
import os
import pickle
import sys
from pathlib import Path
from collections import OrderedDict
from typing import Union
import numpy as np
import scipy.signal
import scipy.stats
from matplotlib import collections as collections
from matplotlib import pyplot as mpl
from matplotlib import rc
from matplo... |
<reponame>kingjr/jr-tools<gh_stars>10-100
# Author: <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import numpy as np
from sklearn.preprocessing import StandardScaler
def _stand_mad(a, median):
""" Fast sandard MAD
Parameters
----------
a : np.array, shape(n_samples, n_dims)
median : np.array, shap... |
"""
The microstructure module provide elementary classes to describe a
crystallographic granular microstructure such as mostly present in
metallic materials.
It contains several classes which are used to describe a microstructure
composed of several grains, each one having its own crystallographic
orientation:
* :py... |
# Copyright 2017 <NAME>. 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 required by applicable law or agree... |
<gh_stars>0
import numpy as np
from numpy import linalg as LA
import scipy.io
#import progressbar
import numba
from stge.fix_axis import fix_axis
import pickle
import numba
import progressbar
import pandas as pd
def load_obj(fname, dir_name='data/base_data/objs/'):
with open(dir_name + fname, mode='rb') as f:
... |
<gh_stars>0
# %%
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import image
from scipy import signal
from scipy.signal import convolve2d
from skimage import restoration
plt.gray()
# %%
img = image.imread("img.jpg")[..., 2]
plt.imshow(img)
# %%
def gaussian_kernel(siz... |
<reponame>BacterialCellBiologyLab/KymographsAngleMeasurement
import math
import numpy as np
import tkinter.filedialog as fd
from matplotlib import pyplot as plt
from skimage.io import imread
from skimage.filters import threshold_isodata
from skimage.color import gray2rgb
from skimage.util import img_as_float
from skima... |
"""Program za prepoznavanje govornih komandi koji simulira pametnu kuću ili bilo koji sustav koji vrši nekakve
komande ovisno o govoru. Princip je sličan kao Google-ov sustav na mobitelima gdje korisnik nakon naredbe "Hey google"
može narediti nekakvu radnju te ju sustav izvrši. Ovaj demonstrativni sustav ima 7 naredbi... |
import unittest
import numpy as np
from scipy import signal
import paderbox.testing as tc
from paderbox.testing.testfile_fetcher import get_file_path
from paderbox.io import load_audio
from paderbox.transform.module_stft import _biorthogonal_window
from paderbox.transform.module_stft import _biorthogonal_window_loopy... |
import re
import sys
sys.path.append('..')
import numpy as np
import scipy.special
import matplotlib.pyplot as plt
import matplotlib.colors
import palettable
import pandas as pd
import glob
import os.path
from lib import *
from lib.analytical import *
from lib.fitting import *
def growthlaw(T, d, t0, gamma):
retu... |
<filename>dash_app/generate_analysis.py
# This generates uncurl analyses as static HTML files.
# inputs: raw data (matrix or file), M (or file), W (or file), reduced_data (2d for vis)
import json
import os
import numpy as np
import scipy.io
from scipy import sparse
import uncurl
import uncurl_analysis
def generate_un... |
<reponame>ChanaRoss/Thesis
import numpy as np
from matplotlib import pyplot as plt
import sys
import pickle
import math
import copy
import time
# from UtilsShortestPath import *
from scipy.stats import truncnorm
sys.path.insert(0, '/home/chanaby/Documents/Thesis/aima-python')
from search import Problem,astar_search
cla... |
import numpy as np
from . import fitfuns
import scipy.interpolate as spinterp
import matplotlib.pyplot as plt
from .kernel import Kernel1D
class TemporalFilter(object):
def __init__(self, *args, **kwargs): pass
def imshow(self, t_range=None, threshold=0, reverse=False, rescale=False, **kwargs):
r... |
<reponame>RonnieGandhi/DLpaPers
import os
import random
import tensorflow as tf
import numpy as np
from scipy.io import loadmat
import cv2
################## TensorFlow standard operations wrappers ################
def weight(shape,name):
init = tf.truncated_normal(shape,stddev = 0.01)
w = tf.Variable(init,nam... |
import math
import os
import os.path
import time
import numpy as np
import scipy.misc
import cv2 as cv
import torch
import torch.nn as nn
import torch.nn.functional as F
import imageio
from PIL import ImageFont, ImageDraw, Image
from console_progressbar import ProgressBar
import inference
from utils import ScreenSpa... |
<reponame>landlab/pub_adams_etal_rainfallvar_jgr
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Figure 12 from Adams et al., "The competition between frequent and rare flood events:
impacts on erosion rates and landscape form"
Written by <NAME>
Updated April 14, 2020
"""
import numpy as np
from matplotlib import... |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import numpy as np
from ase import Atoms
from ase.visualize import view
from ase.io import write
from copy import copy
from scipy.spatial.distance import cdist
import pandas as pd
d = 14.07
seed = [float(x)/8 for x in range(0, 8, 2)]... |
<gh_stars>1-10
import numpy as np
from scipy.signal import chebwin
def bandwise_contraction(X_log, freq_ax_log, f_start=164, f_end=10548, n_bands=17, bandwith=240, bands_offset=30):
# get indices for frequency range E3 (164 Hz) to E9 (10548 Hz)
f_start_idx = np.argmin(np.abs(freq_ax_log - f_start))
... |
import random
import sys
import os
import string
import tkinter as tk
from tkinter import messagebox
import numpy as np
from scipy.signal import convolve2d
from scipy.misc import imsave, imread
def generate_minefield(rows, cols, num_mines, r, c):
# generate mines
mines = np.zeros((rows,cols), dtype=bool)
... |
#coding:utf8
'''
@auther : chenyun
@time: 2015/09/08
@refer http://ufldl.stanford.edu/wiki/index.php/%E5%8F%8D%E5%90%91%E4%BC%A0%E5%AF%BC%E7%AE%97%E6%B3%95
http://ufldl.stanford.edu/wiki/index.php/%E8%87%AA%E7%BC%96%E7%A0%81%E7%AE%97%E6%B3%95%E4%B8%8E%E7%A8%80%E7%96%8F%E6%80%A7
'''
import numpy as np
fro... |
import matplotlib
matplotlib.use("Agg")
import matplotlib.pylab as plt
import os
import librosa
import numpy as np
import torch
import argparse
from torch.utils.data import DataLoader
from reader import TextMelIDLoader, TextMelIDCollate, id2ph, id2sp
from hparams import create_hparams
from model import Parrot, lcm
f... |
#! /usr/bin/env python
# This script converts the fits files from the NIRCam CRYO runs
# into ssb-conform fits files.
# Before running it, make sure to set environment variables:
#
# export UAZCONVDIR='/grp/jwst/wit/nircam/nircam-tools/pythonmodules/'
# export JWSTTOOLS_PYTHONMODULES='$JWSTTOOLS_ROOTDIR/pythonmodules... |
<gh_stars>10-100
# -*- coding: utf-8 -*-
# Copyright (C) 2017-2018 <NAME> and <NAME>
# Copyright (C) 2017-2018 University of Southampton
# VISR Binaural Synthesis Toolkit (BST)
# Authors: <NAME> and <NAME>
# Project page: http://cvssp.org/data/s3a/public/BinauralSynthesisToolkit/
# The Binaural Synthesis Toolkit is... |
<filename>stages/identify_synthetic_y_model.py
# DEPRECATED - This was just a little experiment
import pandas as pd
import numpy as np
from scipy import optimize
import matplotlib.pyplot as plt
import pickle
df_y = pd.read_csv("data/target.csv")
df_y["t_days"] = (df_y.timestamp - df_y.timestamp[0]) / (24 * 3600)
df_y... |
import os
import collections
import json
import torch
import torchvision
import numpy as np
import scipy.misc as m
import scipy.io as io
import matplotlib.pyplot as plt
import cv2
import torchvision.transforms as transforms
from PIL import Image
from tqdm import tqdm
from torch.utils import data
def get_data_path(nam... |
<reponame>milo-lab/biomass_distribution
# coding: utf-8
# In[1]:
# Load dependencies
import pandas as pd
import numpy as np
from scipy.stats import gmean
from scipy.optimize import curve_fit
import sys
sys.path.insert(0, '../../../statistics_helper')
from CI_helper import *
# # Estimating the total biomass of bac... |
import numpy as np
from scipy.optimize import minimize_scalar, minimize # type: ignore
from py_sc_fermi.constants import kboltz
from py_sc_fermi.dos import DOS
from py_sc_fermi.defect_charge_state import FrozenDefectChargeState
import multiprocessing
import pandas as pd # type: ignore
class DefectSystem(object):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.