text string |
|---|
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
from sklearn.model_selection import LeaveOneGroupOut
from plot_with_PE_imputation import plot_with_PE_imputation
import matplotlib.colors as colo... |
"""Plotting functions for visualizing distributions."""
from numbers import Number
from functools import partial
import warnings
import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.transforms as tx
from matplotlib.colors import to_rgba
from matplotlib.colle... |
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 14 10:01:06 2020
@author: Larisa
"""
import numpy as np
import matplotlib.pyplot as plt
import sympy as sym
# Interpolare Spline Liniară
def SplineLiniar(X, Y, x):
n = len(X) - 1
a = np.zeros((n, 1))
b = np.zeros((n, 1))
for i... |
<filename>dataloader/dataset_raster_utils.py<gh_stars>10-100
# based on https://github.com/pytorch/examples/blob/master/super_resolution/
# dataset.py
# Instead of applying data augmentation to PIL.Image, apply to numpy (from AB and NA)
# custom dataset to store 2 images
# Expects that files are like:
# |- main_folder... |
<filename>tadpole_algorithms/models/cbig_rnn/cbig/Nguyen2020/dataloader.py<gh_stars>1-10
# Written by <NAME> and CBIG under MIT license:
# https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md
from __future__ import print_function, division
import numpy as np
from scipy.interpolate import interp1d
from tadpole_a... |
#****************************************************#
# This file is part of OPTALG. #
# #
# Copyright (c) 2019, <NAME>. #
# #
# OPTALG is released under the BSD 2-clause license. #
#*****... |
<filename>omnizart/chord/features.py
# pylint: disable=W0102,C0103
import math
import numpy as np
from scipy.ndimage import gaussian_filter1d
from omnizart.constants.feature import CHORD_INT_MAPPING, ENHARMONIC_TABLE
def extract_feature_label(feat_path, lab_path, segment_width=21, segment_hop=5, num_steps=100):
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
FELPY
__author__ = "<NAME>"
__credits__ = ["<NAME>"]
__license__ = "EuXFEL"
__version__ = "0.2.1"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Developement"
"""
import shutil
import numpy as np
import seaborn as sns
from matplotlib import pyplot as... |
<reponame>MSLNZ/GTC
"""
Defines :class:`UncertainReal` and implements the mathematical
operations on this class of objects.
"""
from __future__ import division
import math
import cmath
import numbers
import warnings
try:
from itertools import izip # Python 2
PY2 = True
except ImportError:
izip = zip
... |
<filename>logs/wztop_100p_test/train_kmeans.py<gh_stars>1-10
import argparse
import math
import subprocess
from datetime import datetime
import numpy as np
import tensorflow as tf
import socket
import importlib
import os,ast
import sys
from sklearn.cluster import KMeans
import h5py
np.set_printoptions(edgeitems=1000)
... |
#!/usr/local/bin/python2.7
#python generateSiftBow.py -t dataset/train/
import argparse as ap
import cv2
import numpy as np
import os
from sklearn.externals import joblib
from scipy.cluster.vq import *
from sklearn import preprocessing
import math
# check if parser argument exists
def is_valid_file(parser, arg):
... |
<gh_stars>1000+
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 7 23:03:28 2016
@author: yxl
"""
from sciapp.action import Simple
import scipy.ndimage as ndimg
import numpy as np
class Plugin(Simple):
title = 'Resize'
note = ['all']
para = {'kx':0.5, 'ky':0.5, 'kz':1,'order':3}
view = [(float, 'k... |
from config import cfg
from base_utils import PoseTransformer, read_pose, read_pickle, save_pickle
import os
import numpy as np
from transforms3d.quaternions import mat2quat
import glob
from PIL import Image
from scipy import stats
import OpenEXR
import Imath
from multiprocessing.dummy import Pool
import struct
import ... |
"""
A module of tools to work with SED, spectral, and filter operations.
"""
import stellarpop as sp
filterpath = sp.__path__[0]+'/filters/'
SEDpath = sp.__path__[0]+'/templates/'
import glob
filterList = glob.glob(filterpath+"*res")
filterList.sort()
filterList = [filter.split('/')[-1].split('.res')[0] for filter in ... |
# -*- coding: utf-8 -*-
import os
import numpy as np
import pandas as pd
import scipy.io as sio
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.colors import Normalize
'''################### Set direcotories and open files #####################'''
# set system type as macOS or linux; set pro... |
import numpy as np
import scipy.sparse as sp
from joblib import Memory
import os
memory = Memory(cachedir=os.path.expanduser("~/tmp/joblib"),
verbose=0)
def _get_coords(n_voxel, radial_cutoff=None, ndim=2):
if ndim==2:
yv, xv = np.meshgrid(np.arange(n_voxel)-(n_voxel)/2,
... |
from scipy import ndimage
from moisan2011 import per
import numpy as np
from PIL import Image
def getPSD1D(psd2D: np.ndarray) -> np.ndarray:
# Source: https://medium.com/tangibit-studios/2d-spectrum-characterization-e288f255cc59
h = psd2D.shape[0]
w = psd2D.shape[1]
wc = w // 2
hc = h // 2
# ... |
#!/usr/bin/python
#-------------------------------------------------------------------------------
#License GPL v3.0
#Author: <NAME> <<EMAIL>>
#Grupo de Inteligencia Computational <www.ehu.es/ccwintco>
#Universidad del Pais Vasco UPV/EHU
#Use this at your own risk!
#2012-01-15
#----------------------------------------... |
<reponame>karolmajek/observation_equations
from sympy import *
import sys
sys.path.insert(1, '..')
from rodrigues_R_utils import *
x_src_l, y_src_l, z_src_l = symbols('x_src_l y_src_l z_src_l')
x_trg_g, y_trg_g, z_trg_g = symbols('x_trg_g y_trg_g z_trg_g')
x_trg_ln, y_trg_ln, z_trg_ln = symbols('x_trg_ln y_trg_ln z_tr... |
<gh_stars>10-100
import os
import threading
import cv2
import numpy as np
from exception_handler import PrintGetExceptionDetails
from scipy import special
import onnxruntime
import logging
class YoloV4Model:
def __init__(self):
try:
self._lock = threading.Lock()
self._modelFileNam... |
from .context import assert_equal, get_simple_examples
import pytest
from sympy import Abs
examples = get_simple_examples(Abs)
delimiter_pairs = {
'|': '|',
'\\vert': '\\vert',
'\\lvert': '\\rvert'
}
@pytest.mark.parametrize('input, output, symbolically', examples)
def test_abs(input, output, symbolical... |
# -*- coding: utf-8 -*-
"""
aid_img
some functions for image processing that are essential for AIDeveloper
---------
@author: maikherbig
"""
import numpy as np
import os, shutil,h5py
import pandas as pd
rand_state = np.random.RandomState(117) #to get the same random number on diff. PCs
import aid_bin
from... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
# Copyright 2019, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
"""Tests for quantum synthesis methods."""
import unittest
import numpy as np
import scipy.linalg as la
from ... |
"""
Classes for streaming tokens/info from files/sparse files etc...
"""
from collections import Counter
from random import shuffle
import re
from functools import partial
import abc
import sys
import os
from scipy import sparse
from rosetta.parallel.parallel_easy import imap_easy, parallel_apply
from .. import commo... |
# License: BSD 3 clause
"""
This module contains a bunch of evaluation metrics that can be used to
evaluate the performance of learners.
:author: <NAME> (<EMAIL>)
:author: <NAME> (<EMAIL>)
:author: <NAME> (<EMAIL>)
:organization: ETS
"""
from __future__ import print_function, unicode_literals
import logging
import m... |
'''
Created on 29Jun.,2017
@author: uqdrange
'''
import sys
sys.dont_write_bytecode = True
import numpy as np
from scipy import special,stats,optimize
#===============================================================================
# Mixture model Bays (www.paulbays.com)
#==============================================... |
import numpy as np
import scipy.optimize
import sample_images
import sparse_autoencoder
import gradient
import display_network
import load_MNIST
##======================================================================
## STEP 0: Here we provide the relevant parameters values that will
# allow your sparse autoencoder... |
<filename>datasets/ToyARD2.py
'''
ToyARD2.py
Toy data from a first-order auto-regressive process.
'''
import numpy as np
import scipy.linalg
from bnpy.data import XData
def get_short_name():
''' Return short string used in filepaths to store solutions
'''
return 'ToyARD2'
def get_data_info():
retu... |
<filename>exercises/exercise10_free_undamped_vibration_truss.py
import numpy as np
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
from matplotlib import cm
from scipy.spatial import Delaunay
from scipy.linalg import cholesky, eigh
from truss2d import Truss2D, update_K_M
DOF = 2
lumped = Fa... |
#!/usr/bin/env python
from multiprocessing import Pool
from sys import breakpointhook
import numpy as np
import os
import matplotlib.pyplot as plt
from functools import partial
import copy
import pandas as pd
import pickle
import pyapprox
from scipy import stats
# from scipy.optimize import root
from scipy.optimize im... |
import numpy as np
import networkx as nx
from matplotlib import pyplot as plt
import scipy
import pickle
from sklearn import preprocessing
from sklearn.manifold import TSNE
from sklearn.decomposition import PCA
import os
import pandas as pd
import seaborn as sns
from scipy.spatial.distance import pdist, squareform
from... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
<filename>assignment-4/using_nn.py<gh_stars>0
#!/usr/bin/python
import numpy as np
from numpy import random, dot
from scipy.io import loadmat
#Sigmoid function
def sigmoid(z):
return 1.0/(1.0+np.exp(-z))
def softmax(x):
exps = np.exp(x)
return exps/np.sum(exps)
def colwise_softmax(A):
exps = np.exp(... |
<filename>python_bindings/tutorial/lesson_12_using_the_gpu.py<gh_stars>1-10
#!/usr/bin/python3
# Halide tutorial lesson 12.
# This lesson demonstrates how to use Halide to run code on a GPU.
# This lesson can be built by invoking the command:
# make tutorial_lesson_12_using_the_gpu
# in a shell with the current d... |
#!/usr/bin/python
#Author: <NAME>
#regression-based QTL mapping in extended families (Sham 2002)
from __future__ import division
import os
import re
import random
import copy
from zipfile import ZipFile
from ctypes import *
from itertools import repeat,product,permutations
from multiprocessing import Process, Value, M... |
<gh_stars>10-100
try:
import aesara
import aesara.tensor as aet
from aesara.graph.basic import Constant, Variable
from aesara.graph.fg import MissingInputError
from aesara.graph.op import Op
except ModuleNotFoundError:
import theano
import theano.tensor as aet
if hasattr(theano, "gof"):
... |
import tensorflow as tf
from scipy import stats
import matplotlib.pyplot as plt
class SENN(tf.Module):
def __init__(self, conceptizer, parameterizer, aggregator):
"""Represents a Self Explaining Neural Network (SENN).
(https://papers.nips.cc/paper/8003-towards-robust-interpretability-with-self-exp... |
import argparse
import json
from tqdm import tqdm
import soundfile as sf
import numpy as np
import os
import pyloudnorm
from scipy.signal import resample_poly
parser = argparse.ArgumentParser()
parser.add_argument("json")
parser.add_argument("librispeech_dir")
parser.add_argument('out_dir',help='output data dir of mix... |
<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# @Author: oesteban
# @Date: 2016-01-05 17:15:12
# @Email: <EMAIL>
# @Last modified by: oesteban
# @Last Modified time: 2016-11-21 18:41:13
"... |
<reponame>gefux/OQuPy
# Copyright 2022 The TEMPO Collaboration
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file 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 ... |
from __future__ import print_function
import numpy as np
from scipy.io import loadmat
from scipy.sparse.csc import csc_matrix
data = loadmat('MUTAG.mat')
# n = num of nodes
# N = num of graphs
# p = num of labels
A = data['A'] # n x n adjancy array (sparse matrix)
gr_id = data['graph_ind'] ... |
import PyCA.Core as ca
import PyCACalebExtras.SetBackend
plt = PyCACalebExtras.SetBackend.SetBackend('tkagg')
import numpy as np
import PyCACalebExtras.Common as cc
import PyCACalebExtras.Display as cd
import AppUtils.Config as Config
import PyCA.Common as common
import PyCABlakeExtras.Common as cb
import PointPicker2... |
<reponame>CandisZhao/SSF<filename>Python/upper_bound_test.py
from __future__ import division
from matplotlib import pyplot as plt
import networkx as nx
import numpy as np
from itertools import combinations
import math
import random
import operator
from preprocessing import *
from decimal import *
from operator import i... |
from __future__ import print_function
from fractions import Fraction as mpq
import functools
import math
import scipy.integrate
from sympy.functions.combinatorial.numbers import harmonic
import timeit
def memoize(obj):
cache = obj.cache = {}
@functools.wraps(obj)
def memoizer(*args, **kwargs):
if ... |
<filename>scripts/versions.py<gh_stars>1-10
"""Quickly check versions of installed tools."""
import platform
import keras
import numpy
import pygpu
import scipy
import sklearn
import theano
print("python: %s" % platform.python_version())
print("keras: %s" % keras.__version__)
print("theano: %s" % theano.__version__)
... |
import functools as ft
import sympy
import string
import random
# Special since need to reduce arguments.
MUL = 0
ADD = 1
_jnp_func_lookup = {
sympy.Mul: MUL,
sympy.Add: ADD,
sympy.div: "jnp.div",
sympy.Abs: "jnp.abs",
sympy.sign: "jnp.sign",
# Note: May raise error for ints.
sympy.ceiling... |
<gh_stars>1-10
#!/usr/bin/env python
# coding: utf-8
import numpy as np
import sys
import umap
import warnings
import networkx as nx
from sklearn import preprocessing
from sklearn.decomposition import PCA
from sklearn.preprocessing import normalize, scale
import numba
import igraph
import pandas as pd
import plotly.gr... |
<filename>examples/sentiment_analysis_test.py<gh_stars>10-100
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# __author__ = "Sponge"
# Date: 2018/7/11
import os
from examples import sif_embedding
import sklearn.datasets
import data_io, params, SIF_embedding
import numpy
from sklearn import svm
from sklearn import model... |
#!/usr/bin/env python3
"""Process an image with the trained neural network
Usage:
demo.py [options] <yaml-config> <checkpoint> <images>...
demo.py (-h | --help )
Arguments:
<yaml-config> Path to the yaml hyper-parameter file
<checkpoint> Path to the checkpoint
... |
#!/usr/bin/env python3
import glob
import pandas as pd
from statistics import mean
def get_network_traffic_by_requests(methodology, service):
network_traffic_by_requests = []
for ttl in [0, 0.1, 0.2, 0.5, 1, 2, 5, 10, 20]:
network_traffic_requests = []
for source in glob.glob('results/?-' + me... |
<filename>second-round-intreview/parcoord-brushing/backend/src/code/proghist/gausordering/AdaptableBinsGausingDataProducer.py
"""
Inferring a binomial proportion via exact mathematical analysis.
"""
import sys
import numpy as np
from scipy.stats import beta
from scipy.special import beta as beta_func
import matplotlib.... |
# Copyright 2019 The TensorNetwork Authors
#
# 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 ... |
<filename>pygrank/benchmarks/loader.py
import networkx as nx
import os
import numpy as np
from pygrank.core import to_signal
from pygrank.algorithms import call
from pygrank.benchmarks.download import download_dataset
from typing import Iterable, Union
def import_snap_format_dataset(dataset: str,
... |
<reponame>hprovyn/keras-experiments
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 18 20:12:52 2016
@author: Hunter
"""
from scipy import misc
from scipy import ndimage
import os
import numpy as np
def crop(img_array, size):
lx, ly, lz = img_array.shape
if lx > ly + 1:
crop_img... |
<reponame>ebressert/ScipyNumpy_book_examples
import numpy as np
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt
# Setting up fake data.
x = np.linspace(0, 10 * np.pi, 20)
y = np.cos(x)
# Interpolating data
fl = interp1d(x, y, kind='linear')
fq = interp1d(x, y, kind='quadratic')
# x.min and x.m... |
<reponame>pritchardlabatpsu/cga<filename>src/ceres_infer/models.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Models
@author: boyangzhao
"""
import numpy as np
import pandas as pd
from sklearn.linear_model import LinearRegression, ElasticNet, LogisticRegression
from sklearn.ensemble import RandomForestRegress... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 10 17:49:15 2012
@author: empeeu
"""
import scipy as sp
from scipy import sparse
import scipy.linalg as splinalg
from scipy.sparse import linalg as sparselinalg
import copy
from time import time
from src.pyutil import unique
from src.master.mk_basis impor... |
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import re
import numpy as np
from scipy import linalg
from ...io.pick import _picks_to_idx
from ...utils import fill_doc
@fill_doc
def source_detector_distances(info, picks=None):
r"""Determine the di... |
import os
import random
import torch
import torch.backends.cudnn as cudnn
import numpy as np
import scipy.sparse as sp
from itertools import chain
from sklearn.neighbors import NearestNeighbors, KNeighborsClassifier
def init_random_seed(manual_seed):
seed = None
if manual_seed is None:
seed = random.randint(1,100... |
r"""Backward-facing step.
Following the example :ref:`stokesex`, this is another example of the Stokes flow. The
difference here is that the domain has an inlet (with an imposed velocity) and
an outlet (through which fluid issues against a uniform pressure).
The geometry is taken from Barkley et al (2002); i.e. an e... |
<filename>app.py
import base64
from keras import backend
from keras.applications.vgg16 import VGG16
from scipy.optimize import fmin_l_bfgs_b
import numpy as np
import requests
from PIL import Image
from flask import Flask, jsonify
from flask import request
from io import BytesIO
from tensorflow.python.framework.ops imp... |
# <NAME> (jmm5kg)
# Canny Edge Detector
# Import some libraries
import numpy, skimage.io, pylab, math, sys, skimage.color
import scipy.ndimage.filters, scipy.signal, scipy.misc
def canny_edges(A):
# Convert image to float
A = skimage.img_as_float(A)
A = skimage.color.rgb2gray(A)
# Build Gaussian filte... |
<filename>python/paddle/fluid/tests/unittests/test_activation_op.py
# Copyright (c) 2018 PaddlePaddle 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
#
# h... |
"""
* MIT License
*
* Copyright (c) 2019 <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
* limitation the rights to use, copy, mo... |
# coding=utf-8
"""
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import numpy as np
from scipy import linalg
from pypint.integrators.node_providers.i_nodes import INodes
from pypint.utilities import assert_condition
class GaussLegendreNodes(INodes):
"""Provider for Gauss-Legendre integration nodes with variable count.... |
<reponame>adityavaishampayan/SFM_python
# -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2020 <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 l... |
'''
Contact : <EMAIL>
'''
import sys
import numpy as np
import pickle
import skimage.transform
import scipy
import theano
import theano.tensor as T
import matplotlib.pyplot as plt
import lasagne
from lasagne.utils import floatX
from lasagne.layers import InputLayer
from lasagne.layers.dnn import Conv2DDNNLayer ... |
import hyperparams as hp
import pandas as pd
from torch.utils.data import Dataset, DataLoader
import os
import librosa
import numpy as np
from text import text_to_sequence
import collections
from scipy import signal
import torch as t
import math
class LJDatasets(Dataset):
"""LJSpeech dataset."""
def __init__... |
import sys
import cv2
import numpy as np
import os
from scipy.ndimage.filters import gaussian_filter
def xdog(image, epsilon=0.01):
"""
Computes the eXtended Difference of Gaussians (XDoG) for a given image. This
is done by taking the regular Difference of Gaussians, thresholding it
at some value, an... |
# Copyright 2016 Princeton University
#
# 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... |
import os
import json
import pandas as pd
import numpy as np
from scipy.cluster.hierarchy import linkage, leaves_list
from installed_clients.DataFileUtilClient import DataFileUtil
from installed_clients.WorkspaceClient import Workspace
def get_statistics(df_metadata, result, wgs_dict, dist_col="containment_index",upa... |
<gh_stars>1-10
import os, inspect
from dolfin import *
import numpy
from scipy.sparse import coo_matrix, block_diag, hstack, tril, spdiags, csr_matrix, vstack
import ExactSol
# from scipy2Trilinos import scipy_csr_matrix2CrsMatrix
# from PyTrilinos import Epetra, ML, AztecOO, Teuchos
import MatrixOperations as MO
impor... |
<reponame>DanBerrebbi/AISHELL-4<filename>sd/VBx/vbhmm.py
# @Authors: <NAME>, <NAME>, <NAME>, <NAME>
# @Emails: <EMAIL>, <EMAIL>, <EMAIL>, <EMAIL>
#
# 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 ... |
import pdb
import copy
from six import string_types
import numpy
import scipy.io
import scipy.interpolate
import std_msgs.msg
import geometry_msgs.msg
import matplotlib.pyplot as plt
class RecordBase(object):
"""Base class for record objects
"""
def __init__(self, has_msg_time=False, interpolate=True):... |
<reponame>asampley/MangoByteTweak
import discord
from discord.ext import commands
from __main__ import settings, botdata, thinker, httpgetter
from cogs.utils import checks
from cogs.utils import helpers
from cogs.utils import drawdota
import asyncio
import async_timeout
import string
import datetime
import json
import ... |
import numpy as np;
import matplotlib.pyplot as plot
import math;
from scipy.optimize import curve_fit
# load csv
data = "Amaxdata.csv";
t, Amax, dAmax = np.loadtxt(data, skiprows=0, unpack = True, delimiter=',');
# this function comes straight from Intro to Python for Science
def LineFitWt(x, y, sig):
sig2 = sig... |
<reponame>swami1995/SimuRLacra
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Red... |
# <EMAIL>
# August 2020
import numpy as np
from scipy.io import netcdf
#from scipy import interpolate
import os.path
import wrf
import sys
#import pickle
import imp
import xarray as xr
#====================INPUT===================
loc_tag = ['W5F7R7T']
#loc_tag = [str(sys.argv[1])]
#=================end of input======... |
import scipy.special as sps
import scipy.linalg as spl
import numpy as np
from scipy.interpolate import interp1d
def e2t(N,dE):
return 2 * np.pi * np.fft.fftfreq(N,dE)
def gaussian_fun(fwhm):
prefac = np.sqrt(2 * np.sqrt(np.log(2))/(np.sqrt(np.pi) * fwhm))
alpha = 4.0 * np.log(2)/fwhm**2.0
def g(x):
... |
<reponame>SwirtaB/TKOM_Language-Interpreter<gh_stars>0
import fractions
import math
def std_print(args: list) -> None:
print(str(args[0]))
def build_frc(args: list) -> fractions.Fraction:
return fractions.Fraction(args[0], args[1])
def cast_frc(args: list) -> fractions.Fraction:
return fractions.Fract... |
"""# Cross-validation estimators
Examples
--------
```python
from fast_automl.cv_estimators import RandomForestClassifierCV
from sklearn.datasets import load_digits
from sklearn.model_selection import cross_val_score, train_test_split
X, y = load_digits(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_... |
<reponame>pawsen/pyvib<filename>pyvib/nnm.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
from scipy.linalg import eigvals, lstsq, norm, solve
from .common import modal_properties_MKC
from .helper.plotting import Anim
from .newmark import Newmark
class NNM():
def __init__(self, M, K, nonlin... |
<filename>create_spectogram_batch_process.py
#!/usr/bin/python
# cd /home/tegwyn/ultrasonic_classifier/ && python3 create_spectogram_batch_process.py
# cd /home/tegwyn/ultrasonic_classifier/ && chmod 775 create_spectogram_batch_process.py
# deploy_classifier_async_01.R ..... Edit line 430.
# process_audio_files.py ..... |
<reponame>rajegannathan/grasp-lift-eeg-cat-dog-solution-updated
import numpy
import scipy
###############################################################
# Basic Functions
###############################################################
def sqrtm(Ci):
"""Return the matrix square root of a covariance matrix define... |
<reponame>Electrostatics/osmolytes<filename>tests/test_energy.py
"""Test m-value prediction model."""
import logging
from pathlib import Path
import pandas as pd
import numpy as np
from scipy.stats import linregress
from osmolytes.main import main
_LOGGER = logging.getLogger(__name__)
PROTEIN_PATH = Path("tests/data/... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import glob
import json
from scipy.io import loadmat
from collections import defaultdict
all_obj = 0
data = defaultdict(dict)
for dname in sorted(glob.glob('/workspace/FairMOT/data/Caltech/annotations/set*')):
set_name = os.path.basename(dname)
data[set_... |
<filename>Python/statistics_with_Python/07_Regression/Script_Files/01_regression.py
#!/usr/bin/env python
# coding: utf-8
# In[28]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import scipy.stats as st
import statsmodels.api as sm
import pingouin as pg
# In[53]:
im... |
"""
ori_analys.py
This module contains functions to run analyses of ROI orientation selectivity
in the data generated by the Allen Institute OpenScope experiments for the
Credit Assignment Project
Authors: <NAME>
Date: October, 2018
Note: this code uses python 3.7.
"""
from joblib import Parallel, delayed
impor... |
# -*- encoding: utf-8 -*-
import pandas as pd # main data format
import networkx as nx # main data format
import numpy as np # log10
from scipy import stats as st # pearsonr and spearmanr
import copy # copy and deepcopy
def htbreak(adic, g=4):
alist = [ v for k,... |
import numpy as np
from scipy.spatial import distance
from ccdc import protein
def centroid(arr):
length = arr.shape[0]
sum_x = np.sum(arr[:, 0])
sum_y = np.sum(arr[:, 1])
sum_z = np.sum(arr[:, 2])
return sum_x/length, sum_y/length, sum_z/length
class Protein(protein.Protein):
... |
import numpy as np
from numpy import testing
from past.utils import old_div
from scipy.linalg.misc import norm
from ..datasource import DSNormal, DSIsotropicNormal
from ..density import IsotropicNormal, Normal
import scipy.stats as stats
from numpy.random import default_rng
import pytest
class TestIsotropicNormal:
... |
<reponame>joelphillips/pypyramid<filename>src/pypyr/physics/physics.py
'''
Created on Aug 28, 2010
@author: joel
'''
import numpy
import math
from pypyr.elements import H1Elements, HdivElements, L2Elements
from pypyr.mesh import buildcubemesh
from pypyr.utils import pyramidquadrature, squarequadrature, trianglequadr... |
<filename>thickness_prediction/thickness_map_utils.py<gh_stars>10-100
import pandas as pd
import os
import numpy as np
from sklearn.metrics import confusion_matrix
import matplotlib.pyplot as plt
import cv2
import gc
from scipy import ndimage
import matplotlib.colors as colors
class ThicknessMapUtils():
def __in... |
<gh_stars>0
#!/usr/bin/env python3
"""Utility functions to convert between values and units
for downstream analyses.
e.g. log(OR) -> effect_size
"""
__author__ = "<NAME>"
import re
import sys
import numpy
import pandas
import logging
from scipy import stats
from .constants import (EFFECT_SIZE, ODDS_RATIO, ZSCORE,
... |
import numpy as np
import os
from scipy.io import wavfile
import plot_settings
import matplotlib.pyplot as plt
duration = 0.5
ultrasound_freq = 30e3
ultrasound_alias = 48e3-ultrasound_freq
samp_freq, signal = wavfile.read(os.path.join(os.path.dirname(__file__), "speech_48k.wav"))
signal = signal[:int(duration*samp_f... |
import numpy as np
import tensorflow as tf
import numpy as np
import scipy.io
from tensorflow.python.keras.optimizers import Adam
from tensorflow.keras.models import model_from_json
# Disable eager execution
tf.compat.v1.disable_eager_execution()
tf.executing_eagerly()
# Run over a specific GPU
# os.e... |
<filename>tools/baselines/weak_predict.py
#!/usr/bin/python
"""Predict weakly-supervised localization cues.
Given a GAP-like model, obtain weakly-supervised signals and write masks.
What this script does:
for each image:
for each new_attribute (idx > 67):
append mask to existing masks
f... |
import argparse
import sys
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import multivariate_normal
from sklearn.mixture import BayesianGaussianMixture
from tensorflow.examples.tutorials.mnist import input_data
class MultivariateNormalDistribution(object):
def fit(self, x_k):
mean ... |
#!/usr/bin/env python
from __future__ import division
from __future__ import print_function
from builtins import map
from past.utils import old_div
from numpy import *
from scipy import optimize
# Coordinates of the 2D points
x = r_[ 9, 35, -13, 10, 23, 0]
y = r_[ 34., 10., 6., -14., 27., -10.]
#x = x... |
<gh_stars>1-10
import numpy as np
import pandas as pd
import math
import random
from scipy import stats as scipy_stats
from tensorforce.environments import Environment
class PortfolioTF(Environment):
def __init__(self,
date_from = '2008-01-01',
date_to = '2017-12-31',
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.