text string |
|---|
<gh_stars>1-10
# Copyright (C) 2008 NIST Center for Neutron Research
# All rights reserved.
# See LICENSE.txt for details.
#author: <NAME>
#Documented: <NAME>
from numpy import sin, cos, arctan, arcsin, pi, log, sqrt
from numpy import array, zeros, ones, histogram2d, cumsum
from numpy import arange, linspace, meshg... |
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
import pymc3 as pm
import arviz as az
az.style.use('arviz-darkgrid')
# Visual diagnostics
We will discuss:
* Trace plots
* Autocorrelation plots
* Rank plots
## Trace plots
<br>
az.plot_trace()
MCMC samples should not be sensitive to... |
<gh_stars>1-10
import numpy as np
import os
import sys
import time
import pickle
import scipy
import scipy.stats
Figure_Path = os.path.split(os.path.realpath(__file__))[0] + "/../Figures/"
Data_Path = os.path.split(os.path.realpath(__file__))[0] + "/../Data/"
graphical_import = True
if graphical_import:
import m... |
import numpy as np
from scipy.signal import correlate
def self_correlate(time_series: np.ndarray) -> np.ndarray:
"""
Correlate a time series with itself, considering all possible offsets
Args:
time_series: time series to selfcorrelate
Returns: correlation value for each offset
"""
return correlate(time_series... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 25 14:23:46 2021
@author: dhulls
"""
import torch, time, sys
import autograd
import autograd.numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import scipy.integrate
solve_ivp = scipy.integrate.solve_ivp
from statsmodels.... |
# 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 in writing, software... |
import numpy as np
import random
from scipy.sparse import issparse
from numpy.linalg.linalg import norm
from numpy.random import randint
class SKMeans:
def __init__(self, no_clusters, iters=300):
'''
Constructor for the class.
PARAMETERS:
no_clusters (int): The nu... |
import numpy as np
from sympy import symbols
from sympy import Matrix
from sympy import simplify
from sympy import init_printing
from sympy.solvers import solve
def j_goodwin():
"""
Symbolic Jacobian for the Goodwin model.
:return:
"""
v, r, alpha, beta, delta, phil0, phil1 = symb... |
"""
Script to do the registation.
"""
class _Do_Registration_Nellix:
def __init__(self,ptcode,ctcode,basedir):
## Perform image registration
import os, time
import numpy as np
import visvis as vv
import pirt.reg # Python Image Registration Toolkit
... |
from __future__ import print_function
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import torchvision
import torchvision.transforms as transforms
from torch.autograd import Variable
import torchvision.models as models
import os
im... |
<gh_stars>10-100
#!/usr/bin/env python
'''
File name: utils.py
Author: <NAME>
'''
# ---------------------------------------------------------------------------
# Video Propagation Networks
#----------------------------------------------------------------------------
# Copyright 2017 Max Planck Society
# Distr... |
<reponame>NarutoOp/Movie-Master<filename>recommender.py<gh_stars>1-10
import pandas as pd
from scipy import sparse
import numpy as np
import eel
def on_close(page, sockets):
print(page, 'closed')
print('Still have sockets open to', sockets)
eel.init('web')
#Collaborative Filtering
ratings = pd.read_csv('d... |
"""Unittests"""
# pylint: disable=missing-function-docstring
import unittest
from unittest import mock
from typing import Any
import numpy
import ipyopt
import ipyopt.optimize
try:
import scipy
import scipy.optimize
have_scipy = True
except ImportError:
have_scipy = True
try:
from . import c_cap... |
<filename>spatial_two_mics/data_generator/source_position_generator.py
"""!
@brief Get some random sampling for the position of two sources
@author <NAME> {<EMAIL>}
@copyright University of illinois at Urbana Champaign
"""
import numpy as np
from scipy.spatial import distance as dst
from pprint import pprint
class... |
# The MIT License (MIT)
#
# Copyright (c) 2021
#
# 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, modify, merge, pu... |
<reponame>hmartiniano/GraRep
import argparse
import numpy as np
import pandas as pd
import networkx as nx
from scipy import sparse
from texttable import Texttable
def create_inverse_degree_matrix(edges):
"""
Creating an inverse degree matrix from an edge list.
:param edges: Edge list.
:return D_1: Inve... |
from __future__ import division
import tensorflow as tf
import numpy as np
from scipy.misc import imread, imresize, imsave
def conv2d(input_map, num_output_channels, size_kernel=5, stride=2, name='conv2d'):
with tf.variable_scope(name):
# stddev = np.sqrt(2.0 / (np.sqrt(input_map.get_shape()[-1].value * n... |
<reponame>mairaksi/PiENet
from __future__ import division
__author__ = "<NAME>, <EMAIL>"
import os
import sys
import numpy as np
import scipy.io.wavfile as wavfile
def load_noise_samples(noise_wav_scp='noiselist.scp'):
if noise_wav_scp == None:
return None
with open(noise_wav_scp) as wavlist:
... |
#!/usr/bin/env python
from traits.etsconfig.api import ETSConfig
ETSConfig.toolkit = 'wx'
from threading import Thread
from time import sleep
from traits.api import *
from traitsui.api import View, Item, Group, HSplit, Handler
from traitsui.menu import NoButtons
from code_snippet_8 import MPLFigureEditor
from matplot... |
"""This module implements a PDT distribution sub-class using a Gaussian mixture model
"""
import os
import sys
import numpy as np
from scipy.stats import rv_continuous
from scipy import integrate as sciint
from scipy import interpolate as sciinterp
from qp import sparse_rep
from qp.factory import add_class
from qp.inte... |
""" TODO: Break out these augmentations into submodules for easier reference.
TODO: Rewrite this code to be briefer. Take advantage of common python class structures
"""
import numpy as np
from scipy.sparse import csr_matrix
from deepneuro.utilities.util import add_parameter
class Augmentation(object):
de... |
from importlib import find_loader as module_exists
from numpy import inf, isinf, sign, nan, isnan, unique
from scipy import sparse
from typing import List, Tuple
class MILP_LP(object):
def __init__(self, *args, **kwargs):
allowed_keys = {'c', 'A_ineq','b_ineq','<KEY>','lb','ub','vtype',
... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
# Author: <NAME>(<EMAIL>)
# Make proposals that each consists of all possible keypoints.
import os
import math
import time
import numpy as np
import sys
import torch
import cv2
from scipy.spatial.distance import cosine
from scipy.ndimage.filters import gaussian_filter
cla... |
# TODO: Testing correls as list vs as pandas dataframe for speed
from __future__ import division
import os
import networkx as nx
from biom import load_table
from scipy.stats import spearmanr, pearsonr, kendalltau
from SCNIC import general
from SCNIC import correlation_analysis as ca
def within_correls(args):
... |
"""
Saha model
Scipt allows to calculate pressure using Saha model. All notation is taken from reference [1].
Statistical sums' cutoff technique are taken from reference [2].
See https://github.com/Koulb/pysaha/blob/master/README.md for more details.
This file can also be imported as a module and contains the follow... |
# -*- coding: utf-8 -*-
"""
@package stft.py
@brief
@author <NAME> (YCJ,RDD)
"""
import scipy as sp
import scipy.signal as spsig
from .fft import *
# def stft(x, framesize=512, hopsize=256, fs=44100, window="hann"):
# """
# Compute spectrogram
# Parameters:
# x: ndarray
# input signal... |
# coding: utf-8
# In[1]:
# Load dependencies
import pandas as pd
import numpy as np
from scipy.stats import gmean
import sys
sys.path.insert(0,'../statistics_helper/')
from fraction_helper import *
from CI_helper import *
from excel_utils import *
pd.options.display.float_format = '{:,.1e}'.format
# # Estimating t... |
<reponame>EthanWelsh/Flappy-Bird
import argparse
import math
import os
import pickle
import time
from collections import deque
from random import randint
import numpy as np
import pygame
from enum import IntEnum
from pygame.locals import *
from scipy.ndimage.filters import gaussian_filter
############################... |
<filename>mattonpy.py
from scipy.io import loadmat
import numpy as np
mat = loadmat("/home/sami/sami/Dataset/data/test2/test2.mat")
for k, v in (mat.items()):
if 'TD' in k:
matTD = mat['TD']
matX = mat['TD'][:,0]
matY = mat['TD'][:,1]
... |
import numpy as np
import math
from scipy.spatial.distance import euclidean
from pandas import DataFrame
from scipy import stats
from copy import copy
from utility import *
ZERO = 0.0000000001
SQRT2 = np.sqrt(2)
def findFD_Distance(data, bins):
n_attr = data.shape[1]
n_rec = data.shape[0]
col_index = rang... |
<filename>test/axbench/chkval_all_better.py
#!/usr/bin/env python3
import sys
import re
import os
import statistics
def ParseInput(filename):
out = []
with open(filename, 'r') as f:
f.readline() # discard table header
l = f.readline()
while l != '':
r = re.findall('[a-zA-Z0-9\.+-_]+', l)
... |
import os
from influence.dataset import DataSet
from tensorflow.contrib.learn.python.learn.datasets import base
import numpy as np
from influence.nlprocessor import NLProcessor
from scipy.io import savemat
import IPython
def init_lists(folder):
a_list = []
file_list = os.listdir(folder)
for a_file in f... |
import numpy as np
from mdp.common import StateIndex, wrap
from mdp.pole_base import PoleBase
from PIL import Image, ImageDraw
from scipy.integrate import solve_ivp
class PendulumMDP(PoleBase):
# goal range
goal_range = [-np.pi / 6, np.pi / 6]
# state range
angle_range = [-np.pi, np.pi]
angular_v... |
# Copyright 2020 MIT Probabilistic Computing Project.
# See LICENSE.txt
from fractions import Fraction
from math import log
import pytest
import numpy
from sppl.distributions import choice
from sppl.distributions import gamma
from sppl.distributions import norm
from sppl.math_util import allclose
from sppl.math_uti... |
<filename>solutions/mine/pearls_in_the_box.py
""" --- Pearls in the box --- Simple
To start the game, they put several black and white pearls in one
of the boxes. Each robots have Nth moves, then initial set are restored
for a next player. For each move, the robot take a pearl out of the box
and put one of the opposit... |
from collections import OrderedDict
import numpy as np
import xarray as xr
@xr.register_dataarray_accessor('xevents')
class AidaAccessorStatistics:
def __init__(self, xarray_obj):
self._obj = xarray_obj
def pvi(self, scale):
"""
Returns the PVI of a timeseries
.. math:: y = \f... |
<reponame>eoleedi/PyTorch-ECGAN
import numpy as np
from scipy.special import softmax
from scipy.stats import entropy
from tqdm import tqdm
from utils.sample import sample_latents
from utils.losses import latent_optimise
import torch
from torch.nn import DataParallel
from torch.nn.parallel import DistributedDataParall... |
import numpy as np
import pytest
from pyha import Hardware, simulate, sims_close, Complex, default_complex
from pyha.cores import DCRemoval, Windower, R2SDF, FFTPower, BitreversalFFTshiftAVGPool
from pyha.common.datavalid import NumpyToDataValid
def numpy_model(x, fft_size, avg_freq_axis, avg_time_axis, window_type=... |
<filename>PFlib/noise.py
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 29 14:15:08 2021
@author: Wojtek
"""
import numpy as np
from scipy.ndimage import zoom
import matplotlib.pyplot as plt
def pnoise(width, height, lim):
grid = np.random.randint(0,2,(width,height))
buff = grid.copy().astype(np.float32)
... |
<reponame>PeterJackNaylor/NucSeg
import os
from glob import glob
from scipy.io import loadmat
from class_data import options, BaseData
class consep(BaseData):
def generate_filename(self):
"""
Generator associating each raw/gt files
"""
files = glob(os.path.join(self.path, "Train"... |
<filename>neural_clbf/systems/utils.py
"""Defines useful constants and helper functions for dynamical systems"""
from typing import Dict, List
import numpy as np
import scipy.linalg
import cvxpy as cp
# Gravitation acceleration
grav = 9.80665
# Define a type alias for parameter scenarios
Scenario = Dict[str, float]... |
<filename>utils/preprocessing.py
import numpy as np
from scipy.signal import fftconvolve, detrend
from scipy.interpolate import interp1d
import copy
def __normxcorr2(template, image, mode="full"):
"""
Input arrays should be floating point numbers.
:param template: N-D array, of template or filter you are ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
encoding = "utf-8"
import os
import sys
import random
import datetime
import time
import gc
from future.builtins import input
import pickle as pickle
# import shelve
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import sent_tokenize
from textblob import TextB... |
"""
The MIT License (MIT)
Copyright (c) 2019 <NAME>
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import numpy as np
import scipy as scp
import logging
import json
logging.basicConfig(format='%(asctime)s %(levelname)s %(messag... |
import numpy as np
from eFFORT.utility import BGL_form_factor, z_var, PDG, w
import abc
import scipy.integrate
import functools
class BToD2SLNu:
def __init__(self, m_B: float, m_D2S: float, V_cb: float, eta_EW: float = 1.0066) -> None:
# Some of the following can be inherited from a parent class / initia... |
import copy
import logging
from typing import List
import numpy as np
import numpy.typing as npt
import scipy.stats # noqa: I201
from mot.common.normalize_log_weights import normalize_log_weights
from mot.common.state import Gaussian, GaussianMixture
from mot.measurement_models import MeasurementModel
from mot.motio... |
from itertools import permutations
from fractions import Fraction
OPERATOR = [' + ', ' - ', ' * ', ' ÷ ']
SAMPLE_LIST = [[2,2,2,9], [2,7,8,9], [1,2,7,7], [4,4,10,10],[6,9,9,10],
[1,5,5,5], [2,5,5,10], [1,4,5,6], [3,3,7,7], [3,3,8,8]]
def calc(L) -> list:
algorith... |
"""Transition matrix for spring packets example.
"""
import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse import kron as skron
from scipy.special import comb
def transition_matrix(N, m, p):
"""Markov chain transition matrix for chained spring packets.
Parameters
----------
N: int... |
<reponame>shanemc11/Yeast_actin_cables
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 26 14:29:57 2020
@author: Shane
"""
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
import scipy
import scipy.stats
import operator
from operator import truediv
import glob
import statsmode... |
<reponame>wmwilcox/mix-mind<filename>mixmind/util.py<gh_stars>1-10
""" Miscallanious util funcitons for the mix-mind project
"""
from functools import wraps
from fractions import Fraction
from collections import OrderedDict, namedtuple
import operator
import json
import csv
import inspect
import uuid
import pendulum
fr... |
<gh_stars>0
#!/usr/bin/python
import argparse as ap
import sys
import re
from scipy.stats import chisquare
from itertools import compress
gens_d = {'0/0':0, '0/1':1, '1/1':2, '1/2':3, '2/2':4, '0/0/0/0':0, '0/0/0/1':1, '0/0/1/1':2, '0/1/1/1':3, '1/1/1/1':4, '1/1/1/2':5, '1/1/2/2':6, '1/2/2/2':7, '2/2/2/2':8}
gens_tass... |
<filename>spam_code/asli_lpc.py
import matplotlib.pyplot as plt
import numpy as np
import wave
import scipy.io.wavfile as wav
from pip._vendor.distlib.compat import raw_input
from audiolazy.lazy_lpc import levinson_durbin
from scipy import signal
import scipy as sk
from audiolazy import *
from audiolazy import lpc
from... |
# -*- coding: utf-8 -*-
#%% NumPyの読み込み
import numpy as np
# SciPyのstatsモジュールの読み込み
import scipy.stats as st
# MatplotlibのPyplotモジュールの読み込み
import matplotlib.pyplot as plt
# 日本語フォントの設定
from matplotlib.font_manager import FontProperties
import sys
if sys.platform.startswith('win'):
FontPath = 'C:\\Windows\\Fonts\... |
<filename>simulation/aws-robomaker-sample-application-deepracer/simulation_ws/src/sagemaker_rl_agent/markov/environments/deepracer_racetrack_env.py
from __future__ import print_function
import bisect
import boto3
import json
import logging
import math
import os
import time
import gym
import numpy as np
from gym impor... |
<gh_stars>1-10
import os
import numpy as np
from scipy.linalg import pinv2
from gym import utils, spaces
from gym.envs.mujoco import mujoco_env
from enum import Enum
from mujoco_py import functions
import time, math
def body_index(model, body_name):
return model.body_names.index(body_name)
def body_pos(model, b... |
<filename>clustergb/bond_orientational_order.py
#####################################################
# This file is a component of ClusterGB #
# Copyright (c) 2018 <NAME> #
# Released under the MIT License (see distribution) #
#####################################################
"""
Sc... |
<reponame>hanl00/cythonised-retina
import numpy as np
import matplotlib.pyplot as plt
from scipy.spatial import KDTree, Delaunay
# Original code provided by <NAME>
def cartesian_to_polar(coordinates):
x = coordinates[:, 0]
y = coordinates[:, 1]
rho = np.sqrt(x**2 + y**2)
theta = np.arctan2(y, x)
... |
#!/usr/bin/env python
# Copyright 2020 <NAME>
# author: <NAME> <<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 at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... |
import numpy as np
import scipy.linalg as la
from matplotlib import pyplot as plt
from scipy import sparse as sp
from time import time
import scipy.sparse.linalg as spla
from math import sqrt
import streaming_subclass as stsb
#####################################################################
# Obtain the necessary ... |
from collections.abc import Iterable
import scipy.optimize as opt
from scipy.interpolate import PchipInterpolator
from scipy.sparse import dia_matrix
from src.Forward import _de_americanize_vol
from src.utils import *
CALL_PUT = {'call': 1, 'put': -1}
class Lognormal_mixture_model_curve:
def __init__(self, T, ... |
<reponame>katerinazuzana/sign-language-dictionary<filename>dictionary/drawing_canvas.py
import tkinter as tk
import math
import cmath
class DrawingCanvas(tk.Canvas):
"""A canvas used to select an eliptic area on the background picture.
An ellipse can be draw on the canvas. The ellipse can then be moved,
... |
"""Performs data fitting.
To generate test data, you ust first run the following scripts
simple_brownian_ccorr.py
simple_brownian_ccorr_multi.py
simple_brownian_acorr.py
"""
from cddm import k_select
import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import curve_fit
colors = ["C{}".format(i) f... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... |
<reponame>meganbkratz/neuroanalysis<gh_stars>1-10
import pyqtgraph as pg
from pyqtgraph.Qt import QtGui, QtCore
import pyqtgraph.parametertree as pt
from scipy.ndimage import gaussian_filter
from ..filter import remove_artifacts, bessel_filter
class SignalFilter(QtCore.QObject):
"""A user-configurable signal fil... |
# -*- coding: utf-8 -*-
import os
import numpy as np
import statsmodels.api as sm # recommended import according to the docs
import matplotlib.pyplot as plt
import pandas as pd
import scipy.stats.mstats as mstats
from common import globals as glob
from datetime import datetime, timedelta
import seaborn as sb
sb.set... |
'''
###############################################################################
"MajoranaNanowire" Python3 Module
v 1.0 (2020)
Created by <NAME> (2018)
###############################################################################
... |
<filename>compact_tree.py
# Author: <NAME>
# Contact: <EMAIL>
'''
Takes a cleaned up version of the Lichess Elite games database,
creates a move tree from a randomly sampled subset of the games,
and then calculates some statistics.
Outputs a csv file containing move sequences, as well as associated statistics
includi... |
<gh_stars>10-100
from typing import Dict
import numpy as np
import pytest
import scipy.sparse as sps
@pytest.fixture()
def test_interaction_data() -> Dict[str, sps.csr_matrix]:
X_small = sps.csr_matrix(
np.asfarray(
[[1, 1, 2, 3, 4], [0, 1, 0, 1, 0], [0, 0, 1, 0, 0], [0, 0, 0, 0, 0]]
... |
import torch
import torch_geometric.transforms as transforms
from torch_geometric.data import Data as OldData
from torch_geometric.data import InMemoryDataset
import os
import math
import numpy as np
from numpy.linalg import inv
from scipy.spatial.transform import Rotation as R
from utils.urdf2graph import yumi2graph,... |
import airsim
import time
import numpy as np
from PIL import Image
import gym
from gym.spaces import Box
from collections import OrderedDict
from scipy.spatial.transform import Rotation as R
import math
np.set_printoptions(precision=3, suppress=True)
class SubMemory():
def __init__(self):
self.x = []
... |
# ----------------------------------------------------------------------
# Copyright (c) 2014 <NAME>.
#
# See the LICENSE file for details
# ----------------------------------------------------------------------
#--------------------
# System wide imports
# -------------------
from __future__ import division, absolu... |
<filename>PoseFlow/test.py
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
import matplotlib.transforms as transforms
from scipy import random
from scipy.stats import wishart, chi2
# Generate Bi-Variate Gaussian Distribution samples
## MEAN IS 0
mean = [0,0]
cov = [[1,0],[0,36]... |
<filename>jetson_app/camera_inference.py
from camera_parameters import *
import torch
import numpy as np
import cv2, os, time, datetime
import random
import detectron2
from bt_server import BTServer
from predictor import MTSDPredictor
from detection_utils import *
from detectron2.config import get_cfg
import threading... |
import dash
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import Input, Output
import pandas_datareader.data as web
import datetime as dateT
import plotly.graph_objs as go
from headlines import generate_headline_bar, generate_link_table
from quotes import generate_top_bar... |
<reponame>ucsc-creativecoding/From-Drawings<gh_stars>0
import cv2
import numpy as np
import scipy.misc
import glob
file_list = glob.glob('river_resize/*.png')
for i,file_path in enumerate(file_list):
img = cv2.imread(file_path,0)
filename = file_path.split('\\')
edges = cv2.Canny(img,100,200)
scipy.m... |
<reponame>wmpg/Supracenter<gh_stars>1-10
import obspy
import numpy as np
from supra.Stations.Filters import butterworthBandpassFilter
import scipy.signal
from scipy.fft import fft
from obspy.signal.filter import bandpass as bandpassFunc
from scipy.signal import butter, lfilter
from scipy.signal import butter, sosfil... |
<reponame>rucmlcv/IEPT_FSL<filename>SSL/models/ssl_proto.py
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from SSL.utils import euclidean_metric, count_acc
from scipy.io import loadmat
from SSL.models.attention import *
import os
class SSL_boost(nn.Module):
def __init__(se... |
# -*- coding: utf-8 -*-
"""
Created on May 19 2019
author : <NAME>, PhD
email : <EMAIL>[<EMAIL>
affiliation: Baylor University
"""
import numpy as np
from numpy import sqrt, sin, cos, pi,power
from scipy.integrate import quad
###########
## constants
###########
# mass of the sun
MSun = 1... |
# Copyright (C) 2021 <NAME>, <NAME>, and Politecnico di Milano. All rights reserved.
# Licensed under the Apache 2.0 License.
import sys
sys.path = ['.'] + sys.path
import numpy as np
import scipy.stats as stats
# import open bandit pipeline (obp)
from obp.ope.utils import find_optimal_lambda, estimate_lambda
from pr... |
# Lock-in simulator
# <NAME>
# Importing required Libraries
import numpy as np
import math
import pandas as pd
import matplotlib.pyplot as plt
import statistics
from scipy import stats
from scipy.stats.mstats import gmean
from sklearn.metrics import mean_absolute_error
# Reading the values of Frequency, Amplitude of ... |
<filename>pyecog/ndf/ndfconverter.py
import sys
import struct
import os
import time
import logging
import pandas as pd
import h5py
import matplotlib.pyplot as plt
import numpy as np
from scipy import signal, stats
if sys.version_info < (3,):
range = xrange
try:
from line_profiler import LineProfiler
# dec... |
<gh_stars>1-10
import os, pickle
from g5lib import domain
from datetime import datetime
import scipy as sp
import HadISST
path=os.environ['NOBACKUP']+'/verification/HadISST'
ctl=HadISST.Ctl()
dates=(datetime(1950,1,1),datetime(2008,12,1))
var='sst'
sst=ctl(var,dates=dates)
sst.clim(12,anom=True); sst.detrend()
ss... |
import numpy as np
import scipy.sparse.linalg as sp
from .div1D import div1D
def weightsQ1D(k, m, dx):
"""Computes the m+2 weights of Q
Arguments:
k (int): Order of accuracy
m (int): Number of cells
dx (float): Step size
Returns:
:obj:`ndarray` containing weights of Q
... |
"""
# Title: Improving Image quality from illumination, contrast, noise, and color aspects.
# Detials: This extractor is designed to improve the RGB image (Gantry or UAS imaging systems)
quality in term of visualization from four different aspects: illumination, contrast, noise, and color.
... |
<reponame>Jetli100/SHRA_Chapter6_7_9
# Note: The codes were originally created by Prof. <NAME> in the MATLAB
import numpy as np
from scipy.stats import norm
from scipy.interpolate import interp1d
from gmpe_bjf97 import gmpe_bjf97
from gmpe_CY_2014 import gmpe_CY_2014
# Master function to call a relevant GMPE and get ... |
from pathlib import Path
from sqlite3 import OperationalError
import pandas as pd
import pytest
from scipy.sparse import csr_matrix
from asreview import ASReviewData
from asreview.project import ASReviewProject
from asreview.project import ProjectExistsError
from asreview.project import open_state
from asreview.setti... |
from numpy import *
from matplotlib import pyplot as plt
import scipy.linalg as la
def stochastic_subgradient(m,n, maxiter=10000000, t=0.005):
w = ones(n)
normw = 100
nlist = []
clist = []
for k in range(maxiter):
if k % 100000 == 0:
print(w)
print(normw)
... |
<reponame>trappitsch/rttools<filename>rttools/linreg.py
"""Linear fits with uncertainties in both axes according to Mahon et al. (1996)"""
import numpy as np
import scipy.stats as stats
from .utils import kron_delta
class Mahon:
def __init__(self):
# ### Loaded from calc
# fixed intercept
... |
# coding=utf-8
# main codes, call functions at stokes_flow.py
# <NAME>., and <NAME>. "Stokes flow due to a Stokeslet in a pipe." Journal of Fluid Mechanics 86.04 (1978): 727-744.
# the convergence of the series solution for the problem is bad around the stokeslet, i.e. z->0.
# thus, a numerical solution is given to fil... |
from subset import Subset
from database_creator import DatabaseCreator
from db_connect import DbConnect
from config_reader import ConfigReader
from subset_result_norm import SubsetResultNorm
from scipy.optimize import bisect
from result_tabulator import SubsetResultFunc
source_dbc = DbConnect('.source_db_connection_in... |
import numpy as np
import pandas as pd
import scipy.spatial.distance as ssd
from sklearn.utils import check_array
import logging
from time import time
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - ... |
from scipy.spatial import distance as dist
from collections import OrderedDict
import numpy as np
class CentroidTracker:
def __init__(self, max_disappeared=20, max_distance=80):
# Initialize the next unique object ID along with three ordered dictionaries used to keep track of mapping
# a given obj... |
import argparse
import os
import pickle as pkl
import numpy as np
import scipy.sparse as smat
from pecos.core.base import clib
from pecos.utils import smat_util
from pecos.utils.cluster_util import ClusterChain
from pecos.xmc import MLModel
from pecos.xmc.xlinear import XLinearModel
def parse_arguments():
parser... |
import numpy as np
import matplotlib.pyplot as plt
import sympy
from sympy import *
import sys
sys.path.append(r'C:\Users\elira\Google Drive\butools2\Python')
sys.path.append('/home/d/dkrass/eliransc/Python')
from tqdm import tqdm
from butools.ph import *
from butools.map import *
from butools.queues import *
from but... |
<reponame>daukantas/REACT-CODE-_ANALYZING-
# -*- coding: utf-8 -*-
import numpy as np
from scipy.sparse import csr_matrix
import networkx as nx
from scipy.optimize import brentq,bisect
from sys import version_info
from scipy import __version__ as vers_scipy
from warnings import warn
class NetworkFormatError(Except... |
"""
This script uses the Google News Word2Vec corpus to calculate
the average embeddings of each review in our dataset.
It stores them into sparse matrices that I can then reuse in another script
"""
import logging
import gensim
import numpy as np
import scipy as sp
import scipy.sparse
import glob
from bs4 import Beau... |
<gh_stars>1-10
import picamera
from picamera import mmal, mmalobj, exc
from picamera.mmalobj import to_rational
import time
import pigpio
import picamera.array
import os
import pickle
import numpy as np
from fractions import Fraction
from imageio import imwrite
# some gain parameters and corresponding functions
# sha... |
<reponame>cmougan/ExplanationShift<filename>ATC_opt.py
from functools import partial
import numpy as np
import scipy as sp
from sklearn.metrics import f1_score, accuracy_score
# original version
class OptimizedRounder(object):
def __init__(self):
self.coef_ = 0
def _fp_fn(self, coef, X, y):
fp... |
# Copyright (c) 2020 the original author or 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
<gh_stars>0
import os
import numpy as np
from glob import glob
from scipy import ndimage
from tifffile import imread, imsave
from skimage.morphology import remove_small_objects
from skimage.draw import line
from skimage.measure import regionprops_table
import matplotlib.pyplot as plt
import pdb
# params
max_matching_d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.