text string |
|---|
import os
import sys
from tqdm import tqdm
from tensorboardX import SummaryWriter
import shutil
import argparse
import logging
import time
import random
import numpy as np
import torch
import torch.optim as optim
from torchvision import transforms
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
fr... |
<filename>pcdet/utils/box_utils.py
import numpy as np
import scipy
import torch
from scipy.spatial import Delaunay
from ..ops.roiaware_pool3d import roiaware_pool3d_utils
from . import common_utils
def in_hull(p, hull):
"""
:param p: (N, K) test points
:param hull: (M, K) M corners of a box
:return (... |
import os.path
from typing import Any, Callable, Optional, Tuple
import numpy as np
from PIL import Image
from .utils import download_url, check_integrity, verify_str_arg
from .vision import VisionDataset
class SVHN(VisionDataset):
"""`SVHN <http://ufldl.stanford.edu/housenumbers/>`_ Dataset.
Note: The SVHN... |
<reponame>ProsperoThePrince/Pepe
import numpy as np
import scipy.linalg
import scipy.sparse.linalg
class Decomposition(object):
"""
This is general interface for all classes that describe tensor decompositions and provides a brief summary of
the general attributes and properties
"""
def __init__(... |
<reponame>bilgetutak/pyroms
import pyroms
import netCDF4 as nc
import numpy as np
import matplotlib.pylab as plt
from scipy.ndimage import morphology as morph
import scipy.interpolate as scipyint
import mpl_toolkits.basemap as bmap
class iron_coastal():
def __init__(self,domain):
self.grd = pyroms.grid.ge... |
import pandas as pd
import numpy as np
from surprise import NormalPredictor
from surprise import Dataset
from surprise import Reader
from surprise.model_selection import cross_validate
from surprise import KNNBasic , KNNWithMeans , KNNWithZScore , KNNBaseline
from surprise import accuracy
from surprise.model_selection... |
# -*- coding: utf-8 -*-
"""Proximity Forest time series classifier
a decision tree forest which uses distance measures to partition data.
<NAME> and <NAME>, <NAME>, <NAME>, <NAME>, <NAME>,
<NAME> and <NAME>
Proximity Forest: an effective and scalable distance-based classifier for
time series,
Data Mining and Knowledge ... |
from models import DCGAN_64_Discriminator, DCGAN_64_Generator, StandardCNN_Discriminator, StandardCNN_Generator, InceptionV3
from torch.utils.data import Dataset as dst
from glob import glob
import torch
import torch.nn as nn
from torch.cuda import FloatTensor as Tensor
from torch import clamp
from torch.autograd impor... |
<reponame>NunoEdgarGFlowHub/PyBaMM<gh_stars>1-10
#
# Finite Element discretisation class which uses scikit-fem
#
import pybamm
from scipy.sparse import csr_matrix, csc_matrix
from scipy.sparse.linalg import inv
import numpy as np
import skfem
class ScikitFiniteElement(pybamm.SpatialMethod):
"""
A class which... |
<filename>benchmarks/benchmarks/sparse_csgraph_djisktra.py
"""benchmarks for the scipy.sparse.csgraph module"""
import numpy as np
import scipy.sparse
try:
from scipy.sparse.csgraph import dijkstra
except ImportError:
pass
from .common import Benchmark
class Dijkstra(Benchmark):
params = [
[30, ... |
<gh_stars>100-1000
# Copyright 2018-2021 Xanadu Quantum Technologies Inc.
# 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 re... |
<filename>tutorials/stats-sensor-space/40_cluster_1samp_time_freq.py
# -*- coding: utf-8 -*-
"""
.. _tut-cluster-one-samp-tfr:
===============================================================
Non-parametric 1 sample cluster statistic on single trial power
===============================================================
... |
# -*- coding: utf-8 -*-
"""
European call option by Monte Carlo simulation
test for vectorized calculation
@author: <NAME>
"""
import time
import numpy as np
from math import exp, sqrt, log
from scipy import stats
def exc_call(S0, E, T, r, sig):
d1 = (log(S0/E) + (r + 0.5*sig**2)*T) / (sig*sqrt(T));
d2 = d1 ... |
from __future__ import absolute_import, print_function, division
"""
Tensor optimizations addressing the ops in basic.py.
"""
# TODO: intelligent merge for mul/add
# TODO: 0*x -> 0
import logging
import itertools
import operator
import sys
import time
import traceback
import warnings
import numpy
from six import inte... |
<filename>faster_rcnn/utils/blob.py
import scipy
import cv2
import numpy as np
def prep_im_for_blob(im, im_means, target_size, max_size):
im = scipy.single(im)
im_means4 = cv2.resize(im_means, (scipy.size(im, 1), scipy.size(im, 0)),
interpolation=cv2.INTER_LINEAR)
im_means = i... |
import numpy as np
import matplotlib.pyplot as plt
import itertools
from scipy import interp
from itertools import cycle
import sklearn
from sklearn.naive_bayes import GaussianNB
from sklearn.svm import SVC
from sklearn.datasets import load_digits
from sklearn.model_selection import learning_curve
from sklearn.model_se... |
#!/usr/bin/env python
# coding: utf-8
# ## Overview
# It is a follow-up notebook to "Fine-tuning ResNet34 on ship detection" (https://www.kaggle.com/iafoss/fine-tuning-resnet34-on-ship-detection/notebook) and "Unet34 (dice 0.87+)" (https://www.kaggle.com/iafoss/unet34-dice-0-87/notebook) that shows how to evaluate th... |
# ============================================================================
# ============================================================================
# Copyright (c) 2021 <NAME>. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compli... |
# filter, normalization,
from __future__ import division, print_function
import pyedflib
import numpy as np
from scipy import signal
from scipy.signal import butter, lfilter, sosfilt, sosfreqz
import matplotlib.pyplot as plt
from pylab import figure,show,setp
import matplotlib.cbook as cbook
import matplotlib.cm as cm
... |
<filename>OscarOchoa_ejercicio10.py
import urllib
from io import StringIO
from io import BytesIO
import csv
import numpy as np
from datetime import datetime
import matplotlib.pylab as plt
import pandas as pd
import scipy.signal as signal
Inicio = '20080201'
Final = '20080201'
datos9=pd.read_csv('https://hub.mybinder... |
import numpy as np
import pytest
from scipy import sparse as sp
from numpy.testing import assert_array_equal
from sklearn.base import BaseEstimator
from sklearn.feature_selection._base import SelectorMixin
from sklearn.utils import check_array
class StepSelector(SelectorMixin, BaseEstimator):
"""Ret... |
#!/usr/bin/env python
import argparse
import pandas as pd
import json
import sys
import numpy as np
import requests
import os
import uuid
import csv
from scipy import stats
from itertools import islice
#requires 2.7.9 or greater to deal with https comodo intermediate certs
if sys.version_info < (2, 7):
raise ... |
<filename>encode_quantification/plot_func/plot_util_multi_method.py
import plotly.graph_objects as go
import plotly.io as pio
import numpy as np
import pandas as pd
import math
from static_data import ARR_ranges, on_plot_shown_label,fig_size,color_schemes,themes,K_value_ranges,condition_number_ranges
from preprocess_u... |
<filename>mne/viz/utils.py
# -*- coding: utf-8 -*-
"""Utility functions for plotting M/EEG data."""
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMA... |
<reponame>ehsankharazmi/PINN-COVID<filename>ModelUncertainty-MIData/Model3_training.py
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 21 13:18:35 2020
@author: Administrator
Solve the inverse problem of the coupled integer-order ODE system
#S = N-E-P-I-A-D-H-Q-R
dSdt = - (BetaI(t)*(I+eps*A+eps*P)/N) * S
d... |
"""Decode the MsCelebV1 dataset in TSV (tab separated values) format downloaded from
https://www.microsoft.com/en-us/research/project/ms-celeb-1m-challenge-recognizing-one-million-celebrities-real-world/
"""
# MIT License
#
# Copyright (c) 2016 <NAME>
#
# Permission is hereby granted, free of charge, to any person ob... |
<gh_stars>0
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
import matplotlib.pyplot as plt
from utilities3 import *
import operator
from functools import reduce
from functools import partial
import time
from timeit import default_timer
import scipy.io
from temperatureModel.tempera... |
<filename>JPS_DES/python/system.py
import numpy as np
from scipy.optimize import *
import math
from commercial import commercial
from residential import residential
from industrial import industrial
from solarRadiation import solar
def rotate(lst, h):
return (lst[h:] + lst[:h])
def system(AirTemp, Radiation, alpha_s... |
import re
import os
import argparse
import json
import random
import numpy as np
import torch
import torch.utils.data
from scipy.io.wavfile import read
from scipy.stats import betabinom
from audio_processing import TacotronSTFT
from text import text_to_sequence, cmudict, _clean_text, get_arpabet
def beta_binomial_pri... |
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
import os
import math
import warnings
import numpy as np
from cntk import Value
fro... |
<filename>misc_code/fast_energy_laplacian.py
'''
NOTE: This code came from recovery.py, which can be found on GitHub:
https://github.com/yig/harmonic_interpolation
'''
from numpy import *
def gen_symmetric_grid_laplacian2( rows, cols, cut_edges = None ):
'''
The same as 'gen_symmetric_grid_la... |
import bisect
from copy import deepcopy
from fractions import Fraction
from functools import reduce
import heapq as hq
import io
from itertools import combinations, permutations
import math
from math import factorial
import re
import sys
#from numba import njit
import numpy as np
_INPUT_1 = """\
0 1
"""
_INPUT_2 = ""... |
<reponame>happys2333/DL-2021-fall
# nohup python -u pred_STTransformer.py > pred_STTransformer.log 2>&1 &
import sys
import os
import shutil
import math
import numpy as np
import pandas as pd
import scipy.sparse as ss
from sklearn.preprocessing import StandardScaler, MinMaxScaler
from datetime import datetime
... |
import numpy as np
import scipy.io as sio
from gridlod.world import World
from gridlod import util, fem, lod, interp
import algorithms, build_coefficient, lod_periodic
NFine = np.array([256])
NpFine = np.prod(NFine+1)
Nepsilon = np.array([256])
NList = [8,16,32,64]
k=0
NSamples = 500
dim = np.size(NFine)
boundaryCon... |
# -*- coding: utf-8 -*-
"""Implementation of ranked based evaluator."""
import itertools as itt
import logging
from collections import defaultdict
from dataclasses import dataclass, field, fields
from typing import DefaultDict, Dict, Iterable, List, Optional, Sequence, Tuple, Union
import numpy as np
import pandas a... |
import numpy as np
import scipy as sp
from pyabc.distance import (
PercentileDistance,
MinMaxDistance,
PNormDistance,
AdaptivePNormDistance,
AggregatedDistance,
AdaptiveAggregatedDistance,
NormalKernel,
IndependentNormalKernel,
IndependentLaplaceKernel,
BinomialKernel,
Poisso... |
from datetime import datetime, timedelta
import pandas as pd
import os
from scipy import optimize
import numpy as np
import json
CWD = os.path.dirname(os.path.abspath(__file__))
DATADIR = os.path.join(CWD, '../data')
def run():
# load the Paraguay dataset from MSPBS
covpy = pd.read_csv(os.path.join(DATADIR, ... |
<filename>src/hvc/features/extract.py
import os
import warnings
from glob import glob
import evfuncs
import numpy as np
from scipy.io import wavfile
import joblib
import hvc.utils
import hvc.utils.annotation
import hvc.audiofileIO
from .feature_dicts import single_syl_features_switch_case_dict
from .feature_dicts imp... |
<reponame>tebandesade/Detectron.pytorch
# -*- coding: utf-8 -*-
'''
Date : January 2017
Authors : <NAME> from the University of Sherbrooke
Description : code used to parse the MIO-TCD localization dataset, localize
each image and save results in the proper csv format. Please see
http://tcd.mi... |
import cv2
import numpy as np
import scipy.misc
from PIL import Image, ImageEnhance
from matplotlib import pyplot as plt
image = cv2.imread("crop0.jpg", cv2.IMREAD_GRAYSCALE)
image = cv2.bilateralFilter(image,9,75,75)
th2 = cv2.adaptiveThreshold(image,255,cv2.ADAPTIVE_THRESH_GAUSSIAN_C,\
cv2.THR... |
<filename>sympy/series/gruntz.py
"""
Limits
======
Implemented according to the PhD thesis
http://www.cybertester.com/data/gruntz.pdf, which contains very thorough
descriptions of the algorithm including many examples. We summarize here
the gist of it.
All functions are sorted according to how rapidly varying they a... |
<gh_stars>1-10
"""
Statistical functions and tests, following scipy.stats.
Some differences
- We don't handle missing values at all
"""
# This is lightly adapted from scipy.stats 0.19
# https://github.com/scipy/scipy/blob/v0.19.0/scipy/stats/stats.py
# The original copyright notice follows:
# Copyright 2002 <NAME>.... |
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 12 12:37:58 2022
@author: gojja och willi
"""
import pandas as pd
from datetime import datetime
import matplotlib.pyplot as plt
from statsmodels.graphics.tsaplots import plot_acf, plot_pacf
from statsmodels.tsa.api import VAR
from scipy.stats import pearsonr
import numpy... |
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from scipy import interpolate
mpl.rcParams['text.usetex'] = True
def get_info(pers_pairs):
b_c = pers_pairs[:,0]
d_c = pers_pairs[:,1]
b_c_uni, b_counts = np.unique(b_c, return_counts = True)
b_c_cumcounts = np.cum... |
import os
import click
import cv2
from imutils.perspective import four_point_transform
import numpy as np
from PIL import Image
from PIL import ImageDraw
from scipy.ndimage.measurements import center_of_mass
from skimage.morphology import remove_small_objects
import tensorflow as tf
from tensorflow import keras
from t... |
# -*- coding: utf-8 -*-
#
# Copyright 2019-2020 Data61, CSIRO
#
# 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 applicabl... |
<gh_stars>1-10
import numpy as np
import matplotlib.pyplot as plt
from scipy.fftpack import fft, ifft, fftfreq
def diff(x, f, n):
k = fftfreq(x.size, x[1] - x[0]) * 2 * np.pi
return np.real(ifft((1j * k)**n * fft(f)))
def solve_heat_eq_pseudo_spectral(x, psi0, Delta_T, D):
"""
D_t psi = D nabla^2 psi
... |
#!/usr/bin/env python
# encoding: utf-8
from collections import defaultdict
from css_html_js_minify import html_minify
from functools import lru_cache
from jinja2 import Environment, FileSystemLoader
from operator import itemgetter
from pathlib import Path
from pyvis.network import Network
import codecs
import json
im... |
###########################################################################
# TSP
###########################################################################
import csv
import googlemaps
import math
import pandas as pd
import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import m... |
'''
This script creates target ground truth chips and random clutter chips of 40x80 size for all frames and scenarios.
* Change w and h in the script to generate 20x40 chips or crop 40x80 chips at center.
* create chips40x80/targets/ and chips40x80/clutter/ in data folder.
'''
import pickle
from scipy.io import loadma... |
from matplotlib.pyplot import *
from numpy import *
from scipy.stats import norm, chisquare, poisson, chi2
from scipy.optimize import curve_fit
class analyse:
def __init__(self,data,dbm = False):
self.data = data
if (dbm):
self.data = 10**(self.data/10)
self.norm_fittting()
... |
<filename>utils.py
# %%
import os
import glob
import numpy as np
import torch
from PIL import Image, ImageDraw
from skimage import draw
from skimage.io import imread
from matplotlib import pyplot as plt
from scipy.ndimage.filters import gaussian_filter
from torch.utils.data import Dataset, DataLoader
from to... |
"""Functions to plot M/EEG data on topo (one axes per channel)."""
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: Simplified BSD
from copy import deepcopy
from functools import partial
from itertools import cycle
import numpy as np
from .... |
<reponame>d-sel/DSCI522_group_12
# author: <NAME>
# date: 2020-11-26
'''Fits pre-processed data on baseline, Decision Tree and Logistic Regression models.
Saves results in output file.
Usage: src/fit_predict_default_model.py --train_data=<train_data> --test_data=<test_data> --hp_out_dir=<hp_out_dir> --prelim_results_... |
<gh_stars>1-10
import numpy as np
# import pandas as pd
# import scipy.io
from scipy.signal import resample
import stft
# from myio.save_load import save_pickle_file, load_pickle_file, \
# save_hickle_file, load_hickle_file
# from utils.group_seizure_Kaggle2014Pred import group_seizure
from pyst import read_edf
... |
<reponame>BuildJet/siconos
#!/usr/bin/env python
# Siconos is a program dedicated to modeling, simulation and control
# of non smooth dynamical systems.
#
# Copyright 2021 INRIA.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You... |
<reponame>rgga-16/DISN<filename>preprocessing/create_point_sdf_fullgrid.py
import create_file_lst
import h5py
import os
import numpy as np
from joblib import Parallel, delayed
import trimesh
from scipy.interpolate import RegularGridInterpolator
import time
CUR_PATH = os.path.dirname(os.path.realpath(__file__))
def ge... |
from scipy.stats import linregress
def calc_calib_line(x_shift, y_shift, k_px_um, Il, Iz, Isum=None, normalization=False, shift_vs_sig=True):
"""
Calculate coefficient of calibration line shift to signal of signal to shift.
Calculations done only on lateral axis (LR signal)
Shifts taken in nm units.
... |
<gh_stars>1-10
# Copyright 2020 The TensorFlow Probability 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 a... |
<filename>imputation/impute_one_batch.py
''' Imputation of a single batch of patients'''
import gc
import timeit
import os.path
import sys
import os
import os.path
import datetime
import random
import gc
import psutil
import multiprocessing as mp
import concurrent.futures as conc_futures
import time
import csv
import ... |
<reponame>agb94/sbfl<filename>sbfl/utils.py
import numpy as np
import math
from scipy.stats import rankdata
from sklearn.preprocessing import binarize
def filtering_mask(X, y):
return np.sum(X[y==0, :], axis=0) == 0
def ranking(l, method='max'):
return rankdata(-np.array(l), method=method)
def matrix_to_inde... |
import pytest
import numpy as np
from scipy.stats import uniform, weibull_min
import matplotlib.pyplot as plt
from SOSAT import StressState
from SOSAT.constraints import DITFConstraint
# depth in meters
depth = 1228.3
# density in kg/m^3
avg_overburden_density = 2580.0
# pore pressure gradient in MPa/km
pore_pressure... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
import scipy as sp
from scipy import sparse
from scipy.sparse import linalg
def pr_master_cg(A,b,x0,max_iter,variant='',callbacks=[],**kwargs):
'''
master template for predict-and-recompute conjugate gradients
'''
# get size of pro... |
<filename>scripts/run_experiments.py
#!/usr/bin/env python3
import argparse
import datetime
import git
import logging
import math
import os
import random
import shlex
import shutil
import signal
import subprocess
import statistics
import sys
import time
import yaml
import pdb
#########################################... |
<filename>ockre.py<gh_stars>10-100
# -*- coding: utf8 -*-
'''
This is a Morgan-customized version of Keras' image_ocr generalised to
handle real-world data fields, especially long numbers.
The original description, which is outdated in some senses, follows:
This example uses a convolutional stack followed by a recu... |
<reponame>jiafeng5513/BinocularNet<gh_stars>10-100
import argparse
import scipy.misc
import numpy as np
from pebble import ProcessPool
import sys
from tqdm import tqdm
from path import Path
parser = argparse.ArgumentParser()
parser.add_argument("dataset_dir", metavar='DIR',
help='path to original d... |
<gh_stars>1-10
import numpy as np
from polytrack.general import cal_dist, check_sight_coordinates
# import polytrack.bg_subtraction as polytrack_bgs
import itertools as it
from scipy.optimize import linear_sum_assignment
from polytrack.deep_learning import detect_deep_learning
from polytrack.config import pt_cfg
m... |
import numpy as np
import networkx as nx
from graph import *
import random
import time
import math
import numpy
import scipy
import networkx as nx
import matplotlib
import pylab
import matplotlib.pyplot as plt
class Community:
""" Data structure to hold community information and calculate modularity """
def... |
#Email <EMAIL> <NAME> in case of questions
import torch
import torch.nn as nn
import torch.nn.functional as F
#from lenet import LeNet5
from lenet_5 import LeNet5_5
from torchvision.datasets.mnist import MNIST
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
import torch.optim as opti... |
<reponame>vlad-user/parallel-tempering
import os
import sys
cwd = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(cwd)
import gc
import numpy as np
import matplotlib.pyplot as plt
from scipy.ndimage.filters import gaussian_filter1d
from simulator import read_datasets
from simulator.simulat... |
<filename>binary_eight_queens.py
import random
import math
import statistics
class BinaryEightQueens:
def __init__(self, populationSize, entireFit=False):
'''
inicializa a classe.
@params populationSize o tamanho da população.
'''
self.populationSize = populationSize
... |
import torch
from torch.autograd import Variable
import torch.nn.functional as F
from torch.utils import data
from torch.utils.data import SequentialSampler
from torch import nn
from tqdm import tqdm
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from time import time
from sklearn.metrics impo... |
<reponame>ShimShim46/HFT-CNN<gh_stars>10-100
import pdb
import chainer
import chainer.functions as F
import chainer.links as L
import numpy as np
import scipy.sparse as sp
import six
from chainer import cuda
from chainer import optimizer as optimizer_module
from chainer import reporter, training
from chainer.dataset i... |
# author: viaeou
#sys.path
import sys
sys.path.append('../')
import numpy as np
import matplotlib.pyplot as plt
import h5py
import scipy
from PIL import Image
from scipy import ndimage
import utils.lr_utils as lr_utils
train_set_x_orig, train_set_y_orig, test_set_x_orig, test_set_y_orig, classes = ... |
<gh_stars>10-100
from scipy.sparse import save_npz, load_npz
from scipy.sparse import csr_matrix
from tqdm import tqdm
import ast
import numpy as np
import os
import pandas as pd
import pickle
import stat
import yaml
def save_dataframe_csv(df, path, name):
df.to_csv(path+name, index=False)
def load_dataframe_c... |
import os
import cv2
import png
import json
import mdai
import glob
import numpy as np
import pandas as pd
import pydicom as PDCM
from PIL import Image
from scipy.ndimage.interpolation import zoom
from pydicom.pixel_data_handlers.util import apply_voi_lut
def Dicom_to_Image(Path):
DCM_Img = PDCM.read_file(Path)
... |
<filename>data_analysis/check_embeddings.py
import argparse
import logging
import numpy as np
from scipy.spatial import distance
from preprocessing.fasttext import FastText
if __name__ == '__main__':
"""##### Parameter parsing"""
parser = argparse.ArgumentParser(description='Train the emoji task')
parser... |
<gh_stars>1-10
"""Create coordinate transforms
"""
# Author: <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import numpy as np
from scipy import linalg
from ...transforms import combine_transforms, invert_transform
from ...utils import logger
from ..constants import FIFF
from .constants import CTF
def _make_transfor... |
# -*- coding: utf-8 -*-
# Spearmint
#
# Academic and Non-Commercial Research Use Software License and Terms
# of Use
#
# Spearmint is a software package to perform Bayesian optimization
# according to specific algorithms (the “Software”). The Software is
# designed to automatically run experiments (thus the code name
... |
#-----------------------------------------------------------------------------
# Name: SParameter.py
# Purpose: Tools to analyze SParameter Data
# Author: <NAME>
# Created: 4/13/2016
# License: MIT License
#-----------------------------------------------------------------------------
""" Sparamet... |
"""
Main functions to run scripts from.
"""
from __future__ import print_function
from .version import __version__
import sys
import os
import docopt
import math
import pandas as pd
from pandas import DataFrame
from pandas import Series
from scipy import stats
from .scrape import *
from .helper import *
def get_... |
# -*- coding: utf-8 -*-
#
# partition.py
#
# Copyright 2020 Amazon.com, Inc. or its affiliates. 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.... |
<gh_stars>100-1000
"""Output of PerturbedStepSolver."""
from typing import List, Optional
import numpy as np
from scipy.integrate._ivp import rk
from probnum import _randomvariablelist, randvars
from probnum.diffeq import _odesolution
from probnum.typing import FloatArgType
class PerturbedStepSolution(_odesolution... |
<filename>daal4py/sklearn/cluster/_k_means_0_22.py
#
#*******************************************************************************
# Copyright 2014-2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may o... |
<reponame>samtx/pyapprox
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import numpy as np, os
from pyapprox.orthonormal_polynomials_1d import \
jacobi_recurrence, hermite_recurrence, gauss_quadrature
from pyapprox.utilities import beta_pdf, beta_pdf_de... |
<filename>train/features/ri_hog.py
import numpy as np
import math
from .base_feature import BaseFeature
import cv2
from scipy.ndimage.filters import gaussian_filter as gf
def _norm_and_mult(cx, cy, x, y, magnitude, result):
result[cy + y, cx + x] = result[cy + y, cx + x] / magnitude
result[cy + y, cx + x] *= 255
... |
"""
Copyright 2013 <NAME> and <NAME>, 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 ... |
<filename>object/N2DCEX_target.py<gh_stars>10-100
import argparse
import os, sys
import os.path as osp
import torchvision
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torchvision import transforms
import network, loss
from torch.utils.data import DataLoader
from data... |
<reponame>J-Moravec/pairtree
# Use instances where the maximum likelihood estimate of phi are implausibly
# large (i.e., well over 1) to indicate that uncalled copy-number losses of the
# normal allele occurred, which highlight instances where we should increase
# `omega.`
import argparse
import numpy as np
import scip... |
#!/usr/bin/env python3
import sys
import numpy as np
import sympy as sp
from selfdrive.locationd.models.constants import ObservationKind
from rednose.helpers import KalmanError
from rednose.helpers.ekf_sym import EKF_sym, gen_code
from rednose.helpers.sympy_helpers import euler_rotate, quat_matrix_r, quat_rotate
EAR... |
<gh_stars>0
import numpy as np
from scipy import stats, optimize
# calcola la sezione a mu fissato della banda,
# cioè trova il kmin massimo tale che:
# \sum_{kmin=0}^\infty poisson(k;mu) >= CL
def kmin(mu, CL):
coverage = 1 # partiamo con tutti i k, quindi la somma è 1
kmin = -1
while coverage >= CL: # an... |
import numpy as np
from scipy.io import loadmat
from utils.utils import convert_label_10_to_0
###############################################################################
def load_svhn():
'''
load svhn dataset
input: N/A
output:
svhn_train_im = training images; (7... |
<gh_stars>1-10
import numpy as np
from warp.field_solvers.generateconductors import XPlane, YPlane, ZPlane, Box, Sphere
from scipy.stats import gaussian_kde
import scipy.linalg
import scipy.constants
class Conductor(object):
"""
Handles plotting of characteristics of different types of conductor objects in Wa... |
<reponame>dlakaplan/RACS-tools
#!/usr/bin/env python
""" Convolve ASKAP images to common resolution """
__author__ = "<NAME>"
import os
import sys
import numpy as np
import scipy.signal
from astropy import units as u
from astropy.io import fits, ascii
import astropy.wcs
from astropy.convolution import convolve, convol... |
<reponame>ulisespereira/map-ephys
import logging
import numpy as np
import pandas as pd
import datajoint as dj
import pathlib
import scipy.io as scio
import nrrd
from . import InsertBuffer
from . import get_schema_name
schema = dj.schema(get_schema_name('ccf'))
log = logging.getLogger(__name__)
@schema
class CCF... |
<reponame>chernika158/sktime
#!/usr/bin/env python3 -u
# -*- coding: utf-8 -*-
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file).
"""Implements ensemble forecasters.
Creates univariate (optionally weighted)
combination of the predictions from underlying forecasts.
"""
__author__ = ["mloning", "G... |
from __future__ import division
import numpy as np
from joblib import Parallel, delayed
from scipy.special import wofz
from scipy.optimize import curve_fit
from scipy.sparse import spdiags
from scipy.sparse import lil_matrix
from scipy.sparse.linalg import spsolve
from scipy.interpolate import interp1d
from scipy.s... |
<filename>scatter.py
import sys,json,math
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import numpy as np
from scipy import stats
from nltk.tokenize import wordpunct_tokenize
training_count = int(sys.stdin.next())
training_data = [ json.loads(sys.stdin.next()) for _ in xrange(train... |
<filename>dace/transformation/interstate/loop_unroll.py<gh_stars>1-10
""" Loop unroll transformation """
import copy
import sympy as sp
import networkx as nx
from typing import List, Optional, Tuple
from dace import dtypes, registry, sdfg as sd, symbolic
from dace.properties import Property, make_properties
from dace... |
import tkinter as tk
import numpy as np
from tkinter.filedialog import askopenfilenames
from os import getcwd
import sys
from scipy.io import loadmat
from scipy.ndimage.interpolation import shift
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import scipy.fft as fft
from scipy.signal import fftcon... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.