text string |
|---|
<reponame>faisalsikder/PersonReidentification<gh_stars>0
########################################
# <NAME>
# University of Miami
# Dept of Computer Science
########################################
#!/usr/local/bin/python2.7
import argparse as ap
import cv2
import imutils
import numpy as np
import os
from sklearn.svm... |
import pandas
import scipy
import numpy
import csv
import os
import sklearn.preprocessing
def rescaleData(X, Y):
# Rescale the input data to a range between 0 to 1
scaler = sklearn.preprocessing.MinMaxScaler(feature_range=(0,1))
rescaledX = scaler.fit_transform(X)
return rescaledX
def stardardizeData(... |
<filename>helpers/result_formatter.py
"""
This file contains code used to format the results, mainly for the thesis report.
"""
import numpy as np
import matplotlib.pyplot as plt
import json
import os
import scipy.stats
from helpers import read_from_json
from helpers.paths import RUNS_INFO_PATH
def confusion_to_sco... |
<reponame>EgorBEremeev/influx-anomaly
from kapacitor.udf.agent import Agent, Handler
from scipy import stats
import math
from kapacitor.udf import udf_pb2
import sys
import os
#Imports for the ADS model
import numpy as np
from sklearn.ensemble import IsolationForest
import joblib
import logging
logging.basicConfig(le... |
_id__ = "$Id: arnoldiDTM.py 397 2008-10-13 21:06:07Z jlconlin $"
__author__ = "$Author: jlconlin $"
__version__ = " $Revision: 397 $"
__date__ = "$Date: 2008-10-13 15:06:07 -0600 (Mon, 13 Oct 2008) $"
import math
import copy
import time
import os
import scipy
import scipy.linalg
import scipy.stats
import... |
<gh_stars>0
from typing import Union, Tuple, Iterable, Optional
import numpy as np
import scipy.interpolate
from shapely.geometry import Polygon, LineString
from pyroll.core.grooves import GrooveBase
class SplineGroove(GrooveBase):
"""Represents a groove defined by a linear spline contour."""
def __init__(... |
import pickle
import numpy as np
from scipy import stats
import argparse
def main(score_dict_a, score_dict_b, k_list, tag_list):
for tag in tag_list:
for k in k_list:
f1_np_array_a = np.array(score_dict_a['f1_score@{}_{}'.format(k, tag)])
f1_np_array_b = np.array(score_dict_b['f1_s... |
<reponame>mit-ccrg/ml4c3-mirror<gh_stars>0
# pylint: disable=wrong-import-order, wrong-import-position
# Imports: standard library
import os
import re
import math
import hashlib
import logging
import argparse
from typing import Dict, List, Tuple, Union, Callable, Optional
from datetime import datetime
from collections ... |
<filename>feature_generation/eyetracking/generate_eye_tracking_features.py
from numpy.lib.function_base import percentile
import math
import pandas as pd
import numpy as np
from scipy.stats import entropy
from scipy.special import softmax
def generate_eye_tracking_features(data):
return pd.concat([generate_featur... |
import colorname
import glob
import os
import re
import numpy
from loadseg import AbstractSegmentation
from scipy.io import loadmat
from scipy.misc import imread
from collections import namedtuple
class AdeSegmentation(AbstractSegmentation):
def __init__(self, directory=None, version=None):
# Default to v... |
from sklearn.pipeline import make_pipeline
from scipy.stats.distributions import uniform, randint
from .hyperband import Hyperband
from .preprocessing import simple_proc_for_tree_algoritms
from lightgbm import sklearn as lgbmsk
train_ = lgbmsk.train
def newtrain(params, *args, **kwargs):
if '_Booster' in params:
... |
#!/usr/bin/env python
import os
import sys
import datetime
from pathlib import Path
from functools import partial
import numpy as np
import pandas as pd
from tqdm import tqdm
from scipy import optimize
from tqdm.contrib import concurrent
from lib.io import read_file
from lib.utils import ROOT
def _get_outbreak_mas... |
import os
import pickle
import json
import numpy as np
from sklearn.metrics.pairwise import pairwise_distances
from sklearn.preprocessing import Binarizer
from sklearn.preprocessing import FunctionTransformer # normalize
from sklearn import preprocessing
from scipy import sparse
import argparse
import tqdm
def show_si... |
<filename>tot_ss_comp.py
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 13 15:23:16 2017
@author: Kiri
"""
import numpy as np
import scipy
def numSolutions(N, fN, bN=0):
"""
Computes total number of possible solutions given the number of
total/floating/boundary species.
:param N: Number of tota... |
import pytest
import sympy
import BondGraphTools as bgt
import BondGraphTools.sim_tools as sim
@pytest.mark.use_fixture("rlc")
def test_build(rlc):
assert len(rlc.state_vars) == 2
assert len(rlc.ports) == 0
def test_build_rlc():
r = bgt.new("R", value=1)
l = bgt.new("I", value=1)
c = bgt.new("C",... |
<reponame>8sukanya8/SCD_CLEF_2019
from src.algorithms.window_merge_clustering.feature_selection import calculate_window_distance_with_selected_words
import re
import preprocess_NLP_pkg
from statistics import mean, stdev
from src.algorithms.preprocessing import paragraph_tokenizer
from src.algorithms.window_merge_clust... |
import morphs
import numpy as np
import scipy as sp
import matplotlib.pylab as plt
import seaborn as sns
def _cf_4pl(x, A, K, B, M):
return A + (K - A) / (1 + np.exp(-B * (x - M)))
def _4pl(x, y, color=None, **kwargs):
data = kwargs.pop("data")
popt, pcov = sp.optimize.curve_fit(
_cf_4pl, data[... |
#!/usr/bin/env python3
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
import numpy as np
import numpy.random as npr
import scipy as sc
from scipy import stats
from sds.models import RecurrentAutoRegressiveHiddenMarkovModel
from sds.utils.envs import sample_env
from joblib import Parallel, delayed
import multiprocessing
nb_cores = multiprocessing.cpu_count()
def create_job(train_obs... |
from networkx import MultiDiGraph
from pyformlang.cfg import CFG
from scipy.sparse import dok_matrix, identity
from project.cfg_utils import cfg_to_ecfg
from project.finite_automaton_utils import BoolFiniteAutomaton
from project.graph_utils import graph_to_nfa
from project.rsm import MatrixRSM
def tensor(cfg: CFG, g... |
import os
import shutil
import sys
import random
from random import shuffle
from PIL import Image
# import tensorflow as tf
import io
import scipy.io as sio
import numpy as np
from sklearn.metrics.pairwise import cosine_similarity
# FUNCTION DEFINITION
def normalize_data(data):
mean_vec = np.mean(dat... |
<gh_stars>0
import read_file
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from scipy.stats import pearsonr
from collections import defaultdict
from matplotlib.ticker import ScalarFormatter
def get_all_data():
data = read_file.load_data()
data = read_file.filter... |
r"""
Main algorithms for recovering weights as eigenvalues from mixed moment matrices.
************************************************************
Example: Three circles on a line
************************************************************
Imports::
sage: from momentproblems import moment_functionals
sage... |
<gh_stars>1-10
import numpy as np
import itertools
import math
from scipy.sparse.csgraph import connected_components
from ase.calculators.calculator import all_changes
from sitator.util import PBCCalculator
from sitator.util.progress import tqdm
from sitator.network.merging import MergeSites
import logging
logger ... |
import gym
from scipy.interpolate import griddata
from scipy.stats import multivariate_normal
import time
import math
import random
import numpy as np
import matplotlib.pyplot as plt
class BeliefSpace():
OBSERVATION_CONFIDENCES = 0.95
ENTROPY_PER_SECOND = 0.003
def __init__(self, xdim, ydim):
x,y =... |
<filename>uuv_control/uuv_trajectory_control/src/uuv_trajectory_generator/path_generator/cs_interpolator.py
# Copyright (c) 2020 The Plankton Authors.
# All rights reserved.
#
# This source code is derived from UUV Simulator
# (https://github.com/uuvsimulator/uuv_simulator)
# Copyright (c) 2016-2019 The UUV Simulator A... |
<filename>data/amplitude_normalization.py
# -*- coding: utf-8 -*-
import os
import scipy as sp
from sklearn.preprocessing import MaxAbsScaler
path = 'audiomat/'
filenames = os.listdir(path)
newsig = {}
for i in range(len(filenames)):
sig = sp.io.loadmat(path+filenames[i],appendmat = False)
au = sig... |
import numpy as np
from scipy.interpolate import splrep, splev
from scipy.signal import convolve2d
# spline-based blur kernel simulation
# Python implementation of the kernel simulation method in "<NAME>, “A neural approach to blind motion deblurring,” in European Conference on Computer Vision (ECCV), 2016".
def kerne... |
import sys
sys.path.append("..")
import numpy as np
from env.grid_world import GridWorld
from scipy.io import loadmat
def test_gridworld():
# load the test data
grid_world = loadmat('../data/test_data/gridworld.mat')['model']
# specify world parameters
num_cols = 12
num_rows = 9
obstructions =... |
<filename>lm_sim.py
from scipy import stats
import numpy as np
import datetime
import time
import random
class lm_sim():
"""
lmstat -a output data.
https://media.3ds.com/support/simulia/public/flexlm108/EndUser/chap7.htm#wp895655
:returns user, user_host, display, version, server_host, port... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# BernoulliKette - Klasse von zufall
#
#
# This file is part of zufall
#
#
# Copyright (c) 2019 <NAME> <EMAIL>
#
#
# Licensed under t... |
<filename>dataset.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Dataset wrappers, transforms and related funcions.
a text file with the 3D voxel coordinates of the centre of mass of the aneurysms and the maximum radius of the aneurysm
a label image with labels:
0 = Background
1 = Untreated, unruptured aneurys... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import eospac as eos
import numpy as np
from numpy.testing import assert_allclose
from scipy.constants import physical_constants
R_CST = physical_constants['molar gas constant'][0]*1e7 # erg.K⁻¹.mol⁻¹
def setup():
global tables_list, material
global eosmat
globa... |
<filename>PyMetrics/code/test_metrics_3.py
# -*- coding: utf-8 -*-
import os
import cv2
from tqdm import tqdm
from PIL import Image
# pip install pysodmetrics
from py_metrics import MAE, Emeasure, Fmeasure, Smeasure, WeightedFmeasure, IoU, CC
import numpy as np
from skimage import io
import scipy.misc
import imageio
... |
'''
@Author: <NAME>
@Date: 2020-12-14 18:50:39
@Description: 计算 pcap 文件的 26 个统计信息
@LastEditTime: 2021-02-05 12:56:54
'''
import os, statistics
from scapy.all import *
class FeaturesCalc():
def __init__(self, min_window_size=10):
self.min_window_size = int(min_window_size)
assert self.min_window_s... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 5 13:06:40 2020
@author: jac
"""
import sys
import pickle
import datetime as dt
import numpy as np
import scipy.stats as ss
from scipy import integrate
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from victoriaepi import p... |
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
# import argparse
# parser = argparse.ArgumentParser(description='load metric.')
# parser.add_argument('--ResNet', default=False, type=bool, help='ResNet or not.')
# parser.add_argument('--MM', default=False, type=bool, help='Mixup + MoEx or no... |
<filename>python/psychofit.py
'''
The psychofit toolbox contains tools to fit two-alternative psychometric
data. The fitting is done using maximal likelihood estimation: one
assumes that the responses of the subject are given by a binomial
distribution whose mean is given by the psychometric function.
The data can be ... |
# Import smorgasbord
import os
import sys
sys.path.append( str( os.path.join( os.path.split( os.path.dirname(os.path.abspath(__file__)) )[0], 'CAAPR', 'CAAPR_AstroMagic', 'PTS') ) )
import gc
import pdb
import time
import re
import copy
import warnings
import numbers
import random
import shutil
import nump... |
<gh_stars>1-10
# Copyright 2021 AIPlan4EU project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
<filename>scope/client_util/calibrate.py
# This code is licensed under the MIT License (see LICENSE file for details)
import contextlib
import time
import numpy
from scipy import ndimage
from zplib.scalar_stats import mcd
def image_order_statistic(image, k):
return numpy.partition(image, k, axis=None)[k]
class ... |
<gh_stars>0
from scipy.interpolate import InterpolatedUnivariateSpline
from numpy import exp, angle
from . import unroll_phase
arg = lambda x: unroll_phase(angle(x))
def interp_cmplx(x,y,*args,absarg=True,interpolator=InterpolatedUnivariateSpline,**kwargs):
if absarg:
return interp_cmplx_absarg(interpolat... |
<filename>models/default.py
from functools import partial
import theano
import theano.tensor as T
import numpy as np
import lasagne as nn
import scipy.misc
from glob import glob
from lasagne.layers import dnn
import utils
""" The twitter login keys """
#""" #toggle this comment to use test or live version
#test-versi... |
import numpy as np
import scipy.interpolate
def invert(f, x, kind='linear', vectorized=False):
"""
Invert a function numerically
Args:
f: Function to invert
x: Domain to invert the function on
kind: Specifies the kind of interpolation as a string ('linear', 'spline', 'nearest', 'ze... |
<reponame>SimonBolducBeaudoin/SBB<gh_stars>0
#!/bin/env/python
#! -*- coding: utf-8 -*-
import numpy
from SBB.Utilities.General_tools import *
from scipy import constants as const
_e = const.e # Coulomb
_h = const.h # Joule second
_kb = const.Boltzmann # J/K (joules per ke... |
<reponame>linea-it/ic-cluster-<gh_stars>0
# Funções para o notebook de Object Selection
import os
import numpy as np
import healpy as hp
from astropy.table import Table
from collections import OrderedDict
#from gavodb import DBManager
import sqlalchemy
import pylab as pl
import seaborn as sns
import pandas as pd
fro... |
<gh_stars>10-100
from python_speech_features import mfcc
import scipy.io.wavfile as wav
def wav_to_mfcc(wav_filename, num_cepstrum):
""" extract MFCC features from a wav file
:param wav_filename: filename with .wav format
:param num_cepstrum: number of cepstrum to return
:return: MFCC features for wa... |
import numpy as np
from scipy.spatial import distance
glossary = {}
glossary_vector = []
path = None
model = None
# name_list and near_vector should be same length, indexed / second match exclude current name from list
def most_sim_names(name_list, near_vectors, cur_vector, cur_name=None, second_match=False, max_num... |
<reponame>dzitkowskik/TwitterSentimentAnalysis<gh_stars>1-10
import inspect
from django import forms
import enum
from TwitterSentimentAnalysis.ai import AIEnum
from statistics import StatisticEnum
from models import ArtificialIntelligence
class ActionEnum(enum.Enum):
"""An enum indicating whether creation of ne... |
# coding: utf-8
# ## Crawl in the directory, load data in
# In[38]:
## The InLight col we have in the count csv files and count tab in the tdms file is based on cX data. Meaning that we're doing
## head tracking but not using in the PI calculation.
## Here, I wrote a function to generate InLight column for a given... |
import numpy as np
from scipy.optimize import minimize
class TwoPhaseLandauPolynomial(object):
"""Class for fitting a Landau polynomial to free energy data
:param float c1: Center concentration for the first phase
:param float c2: Center concentration for the second phase
:param np.ndarray init_guess:... |
<gh_stars>10-100
import numpy as np
import scipy.ndimage as ndimage
import scipy.signal
def bahorich_coherence(data, zwin):
ni, nj, nk = data.shape
out = np.zeros_like(data)
padded = np.pad(data, ((0, 0), (0, 0), (zwin//2, zwin//2)), mode='reflect')
for i, j, k in np.ndindex(ni - 1, nj - 1, nk - 1):
... |
<gh_stars>0
# coding=utf-8
import os
import shutil
import sys
import time
import math
import cv2
import numpy as np
import tensorflow as tf
import pyarabic.araby as araby
import string
from keras.callbacks import ModelCheckpoint
from keras.utils import to_categorical
import keras.backend as K
from keras.models import l... |
import inspect
import numpy as np
import scipy.stats as stats
import numba
from math import gamma, erf
dist_names = ['uniform', 'normal', 'lognormal', 'beta', 'generalized_normal',]
__all__ = ['sample_{:s}'.format(d) for d in dist_names]
__all__ += ['sample_multivar_normal','sample_one_minus_rayleigh']
__all__ += ['e... |
<reponame>jmlipman/RatLesNetv2<filename>lib/metric.py
import numpy as np
from skimage import measure
from scipy import ndimage
def _border_np(y):
"""Calculates the border of a 3D binary map.
From NiftyNet.
"""
return y - ndimage.binary_erosion(y)
def _border_distance(y_pred, y_true):
"""Distanc... |
<filename>python/GBDT.py
"""
Trains gradient boosting regression trees, boosting decision trees and lambdamart using xgboost
allows for parameter exploration using cross validation
roi blanco
"""
from __future__ import print_function
import ast
import baker
import logging
import math
import numpy as np
import scipy.s... |
# This file is loading the Pre-trained GloVe word Vectors model.
# Wikipedia 2014 + Gigaword 5 vectors (6B tokens, 400K vocab, uncased, 300d vectors, 822 MB download)
# Download link: https://github.com/stanfordnlp/GloVe
import configparser
import os
import numpy as np
from scipy import spatial
import matplotlib.pyplo... |
<gh_stars>1-10
import numpy
from scipy import interpolate
from scipy import spatial
import matplotlib.pylab as plt
import matplotlib as mpl
# from scipy.spatial import Delaunay
# from scipy.interpolate import griddata
def load_comsol_file(filename,nx=300,ny=100,xmax=None,ymax=None,four_quadrants=2,do_plot=False):... |
import warnings
import numpy as np
import pandas as pd
import cvxpy as cp
import pytest
import scipy.optimize as sco
from pypfopt import EfficientFrontier
from pypfopt import risk_models
from pypfopt import objective_functions
from pypfopt import exceptions
from tests.utilities_for_tests import get_data, setup_efficie... |
print("Program Started")
from statistics import mean, fmean, median, median_grouped,mode
import csv
import matplotlib.pyplot as plt
from tqdm import tqdm
import sys
import time
import pickle
import random
USEPICKLE = False # Set this to true if you want to use saved data
PICKLENAME = "clusters.p" # name of file to sa... |
<filename>decompose/distributions/tests/test_exponentialAlgorithms.py
import pytest
import numpy as np
import scipy as sp
import scipy.stats
import tensorflow as tf
from decompose.distributions.exponentialAlgorithms import ExponentialAlgorithms
@pytest.mark.slow
def test_exponential_sample():
"""Test if the mean... |
import numpy as np
import matplotlib.pylab as plt
import matplotlib.gridspec as gridspec
from scipy import stats
################################################################
import matplotlib
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
matplotlib.rcParams.update(
{'text.uset... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 17 14:36:43 2019
@author: timok
"""
#import numpy as np
#import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from scipy.stats import spearmanr
import pandas as pd
import xarray as xr
import os
#Domain for the West... |
<reponame>xianqiu/PurchaseSchema
import time
import statistics
import numpy as np
import scipy.stats as ss
import matplotlib.pyplot as plt
def generate_sale_data(mu, sigma, size):
""" Sales data generates from N(mu, sigma^2).
:param mu: mean of the normal distribution
:param sigma: standard error of norm... |
# model8-3-logのベクトル化
# vector化はサンプリング部分、つまり"~"の部分を記述できればそれでよい。
# transformed parameters などでも用いられる代入演算では、
# ほとんど計算時間の短縮に寄与しない。
# 統計をとった計測の仕方はしていないが、今回のベクトル化で
# 書籍のデータを使うと、0.5秒程度の高速化となった。
# 非線形モデルの階層モデルを構築する
import numpy as np
import seaborn as sns
import pandas
import matplotlib.pyplot as plt
from matplotlib.figure imp... |
<reponame>xyt2008/frcnn
## Transfer cifar10 lmdb data to mat
import sys
import lmdb
import numpy as np
from array import array
import scipy.io as sio
import os
if os.path.exists('./python/caffe'):
sys.path.append('./python')
else:
print 'Error : caffe(pycaffe) could not be found'
sys.exit(0)
import caffe
fr... |
<reponame>ahmedengu/Lean
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect 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... |
<filename>butyrate_model.py
import numpy as np
import math
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
from scipy.integrate import odeint
import pickle
from butyrate_model_constants import *
result = []
output = []
for i in range(Nc):
def diff(x,T):
# Di... |
<reponame>shibaji7/sd_rio_sluggishness<filename>analysis.py<gh_stars>1-10
import os
import datetime as dt
import pandas as pd
from scipy import stats, signal
import numpy as np
from timezonefinder import TimezoneFinder
from dateutil import tz
from scipy import signal
import traceback
from PyIF import te_compute as te
... |
#!/usr/bin/python
import sys
import os
import re
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
from matplotlib.lines import Line2D
import matplotlib
#Colors to plot in...
COLORS = ["b", "g", "r", "c", "m", "y", "k"]
MARKERS = ["o", "s", "^", "v", "o"]
#Location of the legend
LEGEND_LO... |
# -*- coding: utf-8 -*-
"""
===============================================================================
Voronoi --Subclass of GenericGeometry for a standard Geometry created from a
Voronoi Diagram Used with Delaunay Network but could work for others (not tested)
=====================================================... |
<reponame>https-seyhan/Legal-Analytics
import warnings; warnings.filterwarnings(action='once')
import pandas as pd
import numpy as np
import operator
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import seaborn as sb
import pandas as pd
import io
import os
import spacy
from collections import Cou... |
<reponame>eriknw/sympy
"""Implementation of :class:`MPmathRealDomain` class. """
from sympy.polys.domains.realdomain import RealDomain
from sympy.polys.domains.groundtypes import MPmathReal
class MPmathRealDomain(RealDomain):
"""Domain for real numbers based on mpmath mpf type. """
dtype = MPmathReal
ze... |
#!/usr/bin/python3
# <NAME> (<EMAIL>)
# Description: TensorFlow implementation of "Texture-Synthesis Using Convolutional Neural Networks"
import argparse
import custom_vgg19 as vgg19
import logging
import numpy as np
import os
import tensorflow as tf
import time
import utils
from functools import reduce
from scipy.mis... |
<reponame>zergulaydin/Performance-Analysis-of-XGBoost-Classifier-with-Missing-Data<gh_stars>0
from scipy.stats import wilcoxon, friedmanchisquare, rankdata, wilcoxon
import numpy as np
import pandas as pd
import scikit_posthocs as sp
df=pd.read_excel("xgboost-results.xlsx",sheet_name='fscore')
print(df)
Model_names... |
from .context import assert_equal, _Pow
import pytest
from sympy import Integral, sin, Symbol, Mul, Integer, Pow
from latex2sympy.latex2sympy import process_sympy
a = Symbol('a', real=True)
b = Symbol('b', real=True)
x = Symbol('x', real=True)
theta = Symbol('theta', real=True)
def test_bracket_none():
assert_eq... |
<filename>Glomeruli Mask/Glomeruli_Mask.py
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 1 20:26:06 2020
@author: yash1
"""
import numpy as np
import pandas as pd
from scipy import fftpack
import skimage.io as sk
import cv2
import matplotlib.pyplot as plt
import json
from PIL import Image
import numpy as np ... |
<reponame>myinxd/cavdet
# Copyright (C) 2017 <NAME> <<EMAIL>>
"""
Detection cavities in X-ray astronomical images using concolutional neural networks.
The script aims to segment cavity regions in the X-ray astronomical images with the help of CNN, and it is designed under the example of Lasagne.
References
=========... |
<filename>code/ReID_net/Forwarding/ClusteringForwarder_old.py<gh_stars>100-1000
#from twisted.application.internet import _AbstractClient
import tensorflow as tf
import numpy
import os
from scipy.misc import imsave, imread, imresize
import pickle
import time
from sklearn.externals.joblib import Memory
from sklearn.dec... |
import os
from scipy.misc import imread
import json
from opendatalake.simple_sequence import SimpleSequence
from opendatalake.utils import crop_center
class UnlabeledImageFolder(SimpleSequence):
def __init__(self, hyperparams, phase, preprocess_fn=None, augmentation_fn=None):
super(UnlabeledImageFolder, ... |
<filename>example/spatial_aliasing.py
"""
Spatial aliasing in continuous measurements
* point source in a free-field
* omnidirectional microphone moving on a circle at a constant speed
* captured signal computed by using fractional delay filters + oversampling
* system identification based on spatial interpolation of ... |
<filename>DIU_Lab/Basic Statistics Warmup.py<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 13 21:32:04 2020
@author: Imam
"""
import pandas as pd
import numpy as np
from scipy import stats
fir = int(input())
se = np.array(input().split())
se = se.astype(np.int)
mean = np.mean(se)
sigm... |
<filename>spatial_lda/primal_dual.py
import logging
import numpy as np
from scipy.special import gammaln, digamma, polygamma
import scipy.sparse
import scipy.sparse.linalg
# Line-search parameters
ALPHA = 0.1
BETA = 0.5
MAXLSITER = 50
# Primal-dual iteration parameters
MU = 1e-3
MAXITER = 500
TOL = 1e-2
def make_g... |
<gh_stars>0
from .linearize import *
from scipy.optimize import minimize, fmin
from .colorspace import *
from .color import *
from .utils import *
from .distance import *
import cv2
import numpy as np
class CCM_3x3:
def __init__(self, src, dst, colorspace,
distance,
linear, gamma, deg,
sa... |
<reponame>Agentvm/icp-pointcloud<gh_stars>0
"""
Copyright 2019 <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 appli... |
from fractions import gcd as find_GCF
|
import csv
import numpy as np
from tabulate import tabulate
from scipy.stats import f_oneway, chi2_contingency
def read_csv(csv_table, col_name):
content = []
with open(csv_table, 'r') as f:
reader = csv.DictReader(f)
for row in reader:
content.append(row[col_name])
return conte... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from itertools import product
from tqdm import tqdm_notebook
from scipy.stats import norm, laplace
from fbprophet import Prophet
from IPython.core.debugger import set_trace
import logging
logging.getLogger('fbprophet').setLevel(logging.WARNING)
fr... |
#!/usr/bin/env python
from collections import deque
from geometry_msgs.msg import Pose, PoseStamped, TwistStamped
import math
import rospy
from scipy.spatial import KDTree
from std_msgs.msg import Int32
from styx_msgs.msg import Lane, Waypoint
import sys
import tf
'''
This node will publish waypoints from the car's c... |
# syms =['["2_x00"]', '["2_0y0"]', '["2_00z"]',
# '["2_xx0"]', '["2_x0x"]', '["2_0yy"]',
# '["2_xmx0"]', '["2_mx0x"]', '["2_0myy"]',
#
# '["3_xxx"]', '["3_xmxmx"]',
# '["3_mxxmx"]', '["3_mxmxx"]',
#
# '["m3_xxx"]', '["m3_xmxmx"]',
# '["m3_mxxmx"]', '["m3_mxmxx"]',
#
# '["4_x00"]', '["4_0y0"]', '["4_00z"]',
#
# '["-4_x0... |
'''
Created on 17.03.2014
@author: afedynitch
'''
import numpy as np
from impy.common import MCRun, MCEvent
from impy import impy_config, base_path
from impy.util import standard_particles, info
class QGSJETEvent(MCEvent):
"""Wrapper class around QGSJet HEPEVT converter."""
def __init__(self, lib, event_kine... |
# -*- coding: utf-8 -*-
"""
Contain the implementation of the CSP algorithm. Developed for the train part of dataset IV-1-a of BCI competition.
This version (V2) implement the algorithm for data with two classes.
@author: <NAME> (Jesus)
@organization: University of Padua (Italy)
"""
#%%
import numpy as np
import mat... |
#
# Copyright (c) 2020 The rlutils authors
#
# This source code is licensed under an MIT license found in the LICENSE file in the root directory of this project.
#
from unittest import TestCase
class TestUniformRandomPolicy(TestCase):
def test(self):
import rlutils as rl
import numpy as np
... |
<reponame>drgmk/eccentric-width
# coding: utf-8
# # Fomalhaut A's vertical structure
# Multiple pointings... See splits.py for splits, statwt, and uv table creation
# In[1]:
import os
import numpy as np
import emcee
import scipy.optimize
import scipy.signal
import matplotlib.pyplot as plt
import corner
import pymu... |
import collections
from os.path import abspath, dirname, join
import sys
import matplotlib
# Must stay right after import matplotlib to avoid backend errors.
matplotlib.use("TkAgg")
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, \
NavigationToolbar2Tk as Navigati... |
# coding: utf-8
import numpy as np
from itertools import groupby
from collections import OrderedDict
#from sympy.core.sympify import sympify
from sympy.simplify.simplify import simplify
from sympy import Symbol
from sympy import Lambda
from sympy import Function
from sympy import bspline_basis
from sympy import lambd... |
<reponame>das-ankur/Sklearn-genetic-opt
import numpy as np
from scipy.stats import rankdata
def select_dict_keys(dictionary, keys):
return {key: dictionary[key] for key in keys}
def crete_cv_results_(logbook, space, return_train_score):
cv_results = {}
n_splits = len(logbook.chapters["parameters"].selec... |
<gh_stars>0
import os, sys, psutil, time
import numpy as np
import dask.array as da
import SimpleITK as sitk
import CircuitSeeker.utility as ut
from CircuitSeeker.transform import apply_transform
from CircuitSeeker.transform import compose_displacement_vector_fields
from CircuitSeeker.quality import jaccard_filter
impo... |
<filename>mcmc/trappist1.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
TRAPPIST-1 constraints and prior distributions
"""
import numpy as np
from scipy.stats import norm
from trappist import utils
__all__ = ["kwargsTRAPPIST1", "LnPriorTRAPPIST1", "samplePriorTRAPPIST1",
"LnFlatPriorTRAPPIST1"]
# Ob... |
# License: BSD 3 clause
import unittest
import numpy as np
from scipy.sparse import csr_matrix
from tick.linear_model import SimuLogReg, ModelQuadraticHinge
from tick.base_model.tests.generalized_linear_model import TestGLM
class ModelQuadraticHingeTest(object):
def test_ModelQuadraticHinge(self):
""".... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.