text string |
|---|
'''
Add custom augmentations as standalone functions here to be utilized
when specified in the NIfTIImageGenerator arguments
Or pass them in during the generator param function
TODO: figure out best API
Rotation code taken from: http://nbviewer.jupyter.org/gist/lhk/f05ee20b5a826e4c8b9bb3e528348688
'''
from mpl_tool... |
import datetime
import enum
import pandas
from numpy import nan, array, isnan, full, nanmean, mean
from sklearn.base import clone
from sklearn.model_selection import KFold
from hydromet_forecasting.timeseries import FixedIndexTimeseries
from hydromet_forecasting.evaluating import Evaluator, SeasonalEvaluator
from sk... |
from pathlib import Path
from scipy.io import loadmat
from numpy.testing import assert_array_equal
from ..oof import eigenvalue_field33, ifft_shifted_coordinates_matrix, OOF
fixtures_dir = Path(__file__).parent / 'fixtures'
fixture_path = fixtures_dir / 'oof.mat'
fixture_dict = loadmat(str(fixture_path))
def test_e... |
<filename>gewittergefahr/gg_utils/interp.py
"""Interpolation methods."""
import copy
import os.path
import numpy
import pandas
import scipy.interpolate
from gewittergefahr.gg_io import grib_io
from gewittergefahr.gg_io import nwp_model_io
from gewittergefahr.gg_utils import general_utils
from gewittergefahr.gg_utils i... |
<filename>SliceData.py<gh_stars>1-10
import numpy as np
from Utility import timer, deprecated
from numba import njit
from scipy.interpolate import griddata
import os
import PostProcess_AnisotropyTensor
class SliceProperties:
def __init__(self, time='latestTime', casedir='/media/yluan/Toshiba External Drive', casen... |
import numpy as np
import fetchmaker
from scipy.stats import binom_test, f_oneway,chi2_contingency
from statsmodels.stats.multicomp import pairwise_tukeyhsd
import pandas as pd
#mean and standard deviation of rottweiler tail lengths
rottweiler_tl = fetchmaker.get_tail_length("rottweiler")
print(np.mean(rottweiler_tl),... |
from future.utils import iteritems
from builtins import range
import numpy as np
from numpy.polynomial.polynomial import polyval3d
from numpy.polynomial.legendre import legval
from numpy.polynomial.chebyshev import chebval
import scipy.optimize as opt
from collections import OrderedDict
from operator import add, mul
... |
# Para visualizar gráficos en la terminal interactiva
from IPython import get_ipython
get_ipython().run_line_magic('matplotlib', 'ipympl')
"""
# Actividad en clases: Análisis de señales no estacionarias con espectrogramas
Objetivos:
- Obtener espectrogramas usando Python
- Estudiar la influencia del tamaño de la v... |
import numpy as np
import scipy.stats as stats
import matplotlib.pyplot as plt
from m2py.utils import config
"""
This module contains functions for sorting and grouping labels resulting
from the GMM segmentation and clustering workflows. Labels and their
descriptive statistics are dynamically sorted into dictionaries... |
<filename>magichour/validate/consistencyCheck.py
# ************************************
# Analyze template order and time duration for observed events
# Input - List of TimedEvents namedtuples, Threshold for Median Absolute Deviation, Boolean value for verbose display output
# Output - List of named tuples, each contai... |
<filename>src/services/ccboost/TFBooster.py
# -*- coding: utf-8 -*-
"""
Author: @gabvaztor
StartDate: 04/03/2017
This file contains the next information:
- Libraries to import with installation comment and reason.
- Data Mining Algorithm.
- Sets (train,validation and test) information.
- ANN Arquitectu... |
import os
import random
import pydicom as dicom
import numpy as np
import cv2
import matplotlib.pyplot as plt
import skimage.transform
import nibabel as nib
import h5py
import scipy
img1 = nib.load("/home/jiangl/Documents/python/ct to tumor identifier project/raw ct files/Pre-operative_TCGA_LGG_NIfTI_and_Segmentation... |
import numpy as NP
import warnings
from astropy import constants as FCNST
from astropy import units
import scipy.special as SPS
import rrlines as RRL
###############################################################################
def bohr_radius(atomic_number=1, n=1, atomic_mass=1):
"""
---------------------... |
import numpy as np
from Model import VGG16Model
from keras.datasets import mnist
from scipy.ndimage import zoom
# as per mnist dataset we have 10 classes (0 to 9)
num_classes = 10
train_images = []
test_images = []
# loading data from keras datasets
print("Loading data..")
(train_X, train_labels), (test_X, test_label... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 25 11:33:55 2020
@author: User
"""
import sys
from pathlib import Path
import functools
# import collections
from collections import Counter
import pickle
# import types
# import post_helper
# import plotting
import matplotlib.pyplot as plt
import matp... |
<filename>cylinter/components.py
import logging
import functools
import os
import re
import glob
import yaml
import math
import pickle
from ast import literal_eval
import gc
import hdbscan
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from magicgui import magicgui
from ... |
from .AbstractGenerator import AbstractGenerator
from .MultivariateGaussianGenerator import MultivariateGaussianGenerator
import numpy as np
import scipy.linalg as la
class InverseWishartGenerator(AbstractGenerator):
def __init__(self, number_of_assets, number_of_samples, kappa, number_of_iterations, normalize_... |
<reponame>dtrifuno/all-of-stats-solutions<gh_stars>0
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as stats
bs = [0.25, 0.5, 1, 5]
xs = np.linspace(-15, 15, 1000)
fig, ax = plt.subplots(1, figsize=(14, 12))
ax.set(xlabel="x", ylabel="Probability")
wald_p = 2 * stats.norm.cdf(-np.abs(xs))
ax.p... |
<filename>linreg_experiment.py
from linlearn import Regressor
import numpy as np
import logging
import pickle
from datetime import datetime
from scipy.optimize import minimize
import sys
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
from collections import namedtuple
import os
from noise_gen... |
<reponame>jodsche/recsys2018-1<gh_stars>0
import os
os.environ['OPENBLAS_NUM_THREADS'] = '1'
os.environ['OMP_NUM_THREADS'] = '1'
import os
# import json
import joblib
import numpy as np
import pandas as pd
import scipy.sparse as sp
# from sklearn.preprocessing import LabelEncoder
from lightfm import LightFM
os.makedi... |
"""
GLM fitting utilities based on NeuroGLM by <NAME>, <NAME>:
https://github.com/pillowlab/neuroGLM
<NAME>
International Brain Lab, 2020
"""
import numpy as np
import pandas as pd
from sklearn.metrics import r2_score
from scipy.special import xlogy
from brainbox.processing import bincount2D
from .utils import neglo... |
from flask import Flask, render_template, url_for, request, jsonify, Response
from waitress import serve
import aiohttp
import asyncio
import async_timeout
import sqlalchemy
import logging
import sys
import os
import datetime
from scipy.special import softmax
import torch
from torch.utils.data import (DataLoader, Seq... |
<filename>src/test.py
import os
import scipy.io
import numpy as np
import pickle
import cv2
import torch
import time
from torch.utils.data import DataLoader
# Import Datasets
from src.Datasets.ITOP import ITOP
# Import Model
from src.models.refinement import LinearModel
from src.models.refine_patch_2d import Patch_2... |
<filename>Website/evaluation/PredictionModel/model.py
import csv
import collections
import scipy
import numpy as np
from sklearn.feature_extraction import DictVectorizer
from sklearn.linear_model import LinearRegression
from sklearn.linear_model import Lasso
def most_frequent_model(dataFile):
#print the most frequ... |
<filename>src/utils.py
import matplotlib
import numpy as np
from PIL import Image
from scipy.signal import convolve2d
matplotlib.use('agg')
if __name__ == '__main__':
file = 'images/histeq.png'
img = Image.open(file)
img = img.convert('L')
# im = np.array(img, dtype=np.float64)
# im = im[:, 15:6... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 4 16:29:08 2020
@author: L.I.Vazquez-Salazar
@email: <EMAIL>
Class to compute the KL divergency for two distributions.
"""
import numpy as np
import pandas as pd
from scipy import stats
from scipy import integrate
class Metrics:
def __i... |
<filename>lib/analysis.py
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.constants as const
import lib.constants as c
from lib.parse_plot_data import import_dict
from lib.util import get_nearest_in_dataframe
from scipy.optimize import curve_fit
from scipy.special import erf
def co... |
<filename>symb_diffs/heston.py<gh_stars>0
from itertools import chain
from sympy import I, log, exp, sqrt, symbols
from sympy_utils import tree_constr, tree_codeblock, chain_rule_tree, diffs
from sympy.printing import fcode
fcode_opts = dict(standard=2008, source_format="free")
u = symbols('u')
t, kappa, a = symbols... |
<reponame>trungnghiahoang96/RobustPython
import copy
from dataclasses import dataclass
from fractions import Fraction
from typing import List
@dataclass
class Ingredient:
name: str
amount: Fraction
units: str
def adjust_proportion(self, factor: Fraction):
self.amount *= factor
@dataclass
cla... |
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 15 22:51:16 2020
@author: haolinl
"""
import copy
import os
import numpy as np
import scipy.io
def forceFieldInterpolation(force_field_1, force_field_2, alpha):
"""
Level set linear interpolation of two force fields.
Two force fields mu... |
<reponame>killua4564/2019-Crypto-CTF<gh_stars>0
import sys
import string
import hashlib
import itertools
from pwn import *
from sympy import invert, gcd
sys.setrecursionlimit(2047)
# conn = remote("172.16.58.3", "14559")
def proof():
conn.recvuntil("such that ")
hashfunc = conn.recvuntil("(X)").replace(b"(X)", b""... |
import sys, os
sys.path.insert(1, os.path.join(sys.path[0], '..'))
import multiprocessing as mp
import utils
import random
import config
import matplotlib.pyplot as plt
import numpy as np
import pickle
import math
from scipy.stats import beta
from functools import reduce
from hyperopt import hp, space_eval
import hyper... |
# coding: utf-8
from os import path as op
import numpy as np
from scipy import stats
import statsmodels.api as sm
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
import pandas as pd
import seaborn as sns
import mne
from mne import read_evokeds
from badbaby.return_dataframes import return_simms_mmn... |
<reponame>andresmasegosa/PRML-CoreSets<gh_stars>0
import matplotlib.pyplot as plt
import numpy as np
from sklearn.cluster import KMeans
import inferpy as inf
from sklearn import metrics
from datareduction.variational_gaussian_mixture_DR import VariationalGaussianMixture_DR
from prml.rv import VariationalGaussianMixtur... |
import random
import numpy as np
from rust_scc import scc
from scipy.sparse.csgraph import connected_components
from scipy.sparse import csr_matrix
def run_scc(m):
indptr = m.indptr[:-1]
indices = m.indices
return rust(indptr, indices)
@profile
def rust(indptr, indices):
return scc(indptr, indices)
... |
#!/usr/bin/env python2
import os
import json
import sympy
from sage import all as sage_all
def rsa_keys():
prime1, prime2 = gen_prime(), gen_prime() # or 65537
modulus = prime1 * prime2
phi = (prime1 - 1) * (prime2 - 1)
# public_exponent = 65537
public_exponent = sympy.randprime(65537, phi)
... |
# Compatibility imports
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
import time
import tensorflow as tf
import scipy.io.wavfile as wav
import numpy as np
from six.moves import xrange as range
try:
... |
<reponame>eglxiang/Med<gh_stars>1-10
import numpy as np
import os
import sys
import scipy.io as sio
import operator
import math
from matplotlib import pyplot as plt
import time
#######################################################################
#This code generates the false positive patches from the score cands t... |
<gh_stars>10-100
from networks import googlenet
import tensorflow as tf
import scipy.io as sio
import numpy as np
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
BATCH_SIZE = 50
def get_feature():
inputs = tf.placeholder("float", [None, 64, 64, 1])
is_training = tf.placeholde... |
import csv
import numpy as np
import pickle
import random
import tensorflow as tf
from keras.models import Sequential
from keras.layers import Dense
import scipy.io as sio
from dg import DataGenerator
from tensorflow.python.platform import flags
from keras.layers.normalization import BatchNormalization
from keras.laye... |
<filename>theano/gans/BGAN/old/DISC-MNIST/mnist_nvil.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''Binary MNIST with BGAN.
'''
from __future__ import print_function
import argparse
import cPickle
import datetime
import gzip
import logging
import os
from os import path
import sys
import time
from collections i... |
<reponame>nhutnamhcmus/pykeen<gh_stars>100-1000
# -*- coding: utf-8 -*-
"""Tests for leakage analysis."""
import itertools as itt
import unittest
import numpy
import numpy as np
import scipy.sparse
import torch
from pykeen.datasets import Nations
from pykeen.triples import TriplesFactory
from pykeen.triples.leakage... |
"""
Create a boolean mask for if the pixels of a texture is constrained, True, or
free, False.
Written by <NAME>
"""
from __future__ import print_function
import pdb
import numpy
import scipy
import scipy.sparse
import itertools
from math import floor, ceil
from collections import deque
from seam_intervals import ... |
<filename>pysumstats/sumstats.py
import pandas as pd
import os
import pickle
import numpy as np
from collections.abc import Iterable
from scipy.stats import norm
from .base import _BaseSumStats, _H5SSConnection
from .utils import _MultiWindowPlot, _recompute_maf
from .plot import (manhattan, qqplot, afplot, zzplot, pzp... |
from __future__ import division
import timeit
import pycuda.compiler
import pycuda.gpuarray as gpuarray
import pycuda.autoinit
import pycuda.curandom
from pycuda import cumath
from pycuda.cumath import exp as pycuda_exp
from pycuda.compiler import SourceModule
import matplotlib.pyplot as plt
from kabuki.distributions... |
from os.path import join
import numpy as n
import astropy.io.fits as fits
import os
import sys
from scipy import linalg
import lib_functions_1pt as lib
import astropy.cosmology as co
cosmo = co.Planck13
import astropy.units as uu
import matplotlib
matplotlib.use('pdf')
matplotlib.rcParams['font.size']=14
import matp... |
def no_repeat(lista):
unico = set()
for m in lista:
if m not in unico:
unico.add(m)
return unico
#from libpydock.util.Table import Table
#from numpy import array
#import matplotlib.pyplot as plt
import os
import sys
import scipy
#import pylab
#import scipy.cluster.hierarchy as sch
import numpy as np
#import sc... |
#computes necessary pre-processing for CT imaging
# 1) creates CT body mask
# 2) resamples images to 1x1x5
# 3) creates windowed/normalized imaging
#FIX ITK PARALLELIZATION!
import os
import itk
import numpy as np
import nibabel as nib
import multiprocessing
from skimage import filters
from joblib impo... |
from cmath import inf
from collections import defaultdict
from dis import dis
import heapq
class HeapNode:
def __init__(self, x, y, pid):
self.x = x
self.y = y
self.pid = pid
def __lt__(self, other):
return self.x + self.y < other.x + other.y
def __gt__(self, other):
... |
<filename>plot-distance.py
#!/usr/bin/env python
''' Plots heatmap from distance matrix in plain format.'''
import sys, os
from scipy import stats
import numpy as np
from optparse import OptionParser
import matplotlib.pyplot as plt
def loadsimple(fh):
''' Basic one-column-header, one-row-header data table loader ... |
from __future__ import print_function
import os
import random
import sys
import numpy
from scipy import misc
from ..model import sliding_window_model
from ..train.common_train_features import train_and_save
# A script for training a small CNN for use as a sliding window on a set of wide images
# Created by brendon... |
import numpy as np
import matplotlib.pyplot as plt
import sys
import os
import galsim
import scipy
from cosmos_params import *
from astropy.io import fits
import photutils
from photutils.centroids import centroid_com
import utils
rng = galsim.BaseDeviate(None)
############ PARAMETER MEASUREMENTS
def get_fit_data... |
import statistics
print(str(11.8381-6.8118))
list=[10,6]
mean_list = statistics.mean(list)
print(str(mean_list))
sd = statistics.stdev(list)
print(int(sd))
"""
@app.route("/anomalies/")
def index():
return render_template('anomalies/index.html')
@app.route("/anomalies/input")
def get_input():
return ... |
<filename>non_linear_optimization/gekko/results/process_solvers_results.py
#!/usr/bin/env python
__author__ = "<NAME>"
__copyright__ = "Copyright 2019, QoS-aware WiFi Slicing"
__license__ = "GPL"
__version__ = "1.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Prototype"
''' Python script for parsing ... |
from flask import Flask, request
from nltk.stem import WordNetLemmatizer
from nltk.corpus import stopwords
import re
import numpy as np
from collections import Counter
from scipy.spatial.distance import cosine
import gensim.downloader as api
model = api.load("glove-wiki-gigaword-100")
app = Flask(__name__)
stop = sto... |
<filename>sympy/physics/quantum/tests/test_commutator.py<gh_stars>0
from sympy import symbols, Integer
from sympy.physics.quantum.dagger import Dagger
from sympy.physics.quantum.commutator import Commutator as Comm
from sympy.physics.quantum.operator import Operator
a, b, c = symbols("a,b,c")
n = symbols("n", intege... |
<gh_stars>0
from decimal import *
from fractions import *
class Poly(object):
def __init__(self, c):
self.c = c
def add(self, other):
rev_poly = []
rev_self_coeffs = self.c[::-1]
rev_other_coeffs = other.c[::-1]
for n in range(len(rev_self_coeffs)):
if n <= l... |
<reponame>yulkang/2D_Decision<gh_stars>1-10
# Copyright (c) 2020 <NAME>. hk2699 at caa dot columbia dot edu.
from typing import Union, Iterable
import numpy as np
from matplotlib import pyplot as plt
from pprint import pprint
from copy import deepcopy
from scipy.io import loadmat
import os
import torch
from lib.pyl... |
<filename>4 - Accuracy testing.py<gh_stars>1-10
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.2.4
# kernelspec:
# display_name: Python 3
# language: python
# ... |
<filename>src/process_plane.py
import random
from ellipse import Ellipse, Orientation
from allpositions import AllPositions
from scipy.spatial import distance
from shapely.geometry import Point
from shapely import affinity
from src.common.process_basic_data_structure import get_random_item_from_list
from src.common.pr... |
# Copyright 2021 The Fraud Detection Framework Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... |
<reponame>HJReachability/learning_feedback_linearization<filename>sandbox/quadrotor_12d.py
import torch
import numpy as np
from scipy.linalg import block_diag
import math
from dynamics import Dynamics
class Quadrotor12D(Dynamics):
def __init__(self, mass, Ix, Iy, Iz, time_step=0.05):
self._mass = mass
... |
import errno
import itertools as it
import json
import numpy as np
import os
import scipy.linalg as LA
import torch
from torch import nn
import torch.nn.functional as _F
class EnergyExtractor(nn.Module):
def __init__(self, F, F_, linear=False):
super(EnergyExtractor, self).__init__()
self.Q = nn... |
<reponame>Tejas-26/holmuskTest<filename>src/modules/reportMaker/writeT2.py
from logs import logDecorator as lD
import jsonref
import pprint
import statistics as stats
from psycopg2.sql import SQL, Identifier, Literal
from lib.databaseIO import pgIO
from collections import Counter
from tqdm import tqdm
from multiproces... |
<filename>notebooks/_helpers.py
import sys, os, cv2
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from PIL import Image
from torch.utils.data import Dataset
from scipy.stats.mstats import pointbiserialr
from skimage.transform import resize
import torchvision.transforms as tf
from... |
import _init_path
import numpy as np
import os
import argparse
import lib.utils.calibration as calibration
from lib.config import cfg, cfg_from_file, cfg_from_list
from PIL import Image
import scipy.io as sio
from sklearn.cross_decomposition import CCA
from sklearn.decomposition import PCA
import joblib
parser = argp... |
import os
import numpy as np
from PIL import Image
import tensorflow as tf
from tensorflow.python.platform import gfile
from scipy.misc import imsave
## Convert BAIR robot pushing data to numpy to use with PyTorch
## Based on <NAME>'s script: https://github.com/edenton/svg/blob/master/data/convert_bair.py
def convert... |
##############################################################
# #
# <NAME> and <NAME> (2017) #
# Machine Learning for the Quantified Self #
# Springer #
# Chapter 3 ... |
from flat.raw import RawLoop
import os, pickle, math, statistics, array
if __name__ == "__main__":
# execute only if run as a script
dir = os.path.dirname(os.path.abspath(__file__))
fname = os.path.join(dir, "flat_save.p")
raw = pickle.load( open(fname, "rb"))
for loop in raw:
print("loop ... |
<reponame>vztu/VIDEVAL<gh_stars>10-100
# -*- coding: utf-8 -*-
"""
Author: <NAME>
"""
# Load libraries
import warnings
import time
import pandas
import math
import random as rnd
import matplotlib.pyplot as plt
from matplotlib import rc
import scipy.stats
import scipy.io
from scipy.optimize import curve_fit
from sklearn... |
<gh_stars>1-10
import pandas as pd
from scipy.spatial import ConvexHull
data = pd.read_table(snakemake.input[0], index_col=0)
def get_area(rnas):
hull = ConvexHull(rnas[["x", "y"]])
return hull.area
def get_first(rnas):
return rnas.iloc[0]
cells = data.groupby(level=0)
area = cells[["x", "y"]].aggregat... |
<reponame>jdschoneman/c19_plotting
# -*- coding: utf-8 -*-
"""
Compare Sweden to various US states
IHME data per IHME:
https://covid19.healthdata.org/united-states-of-america
IHME data stored here in the "..\data\ihme" directory for each release
that was obtained.
Country data per COVID-19 Githu... |
from fractions import Fraction
class Pair():
def __init__(self,a,b,c,d):
self.first=Fraction(a,b)
self.second=Fraction(c,d)
def display(self):
print(str(self.first.numerator)+"/"+str(self.first.denominator))
print(str(self.second.numerator)+"/"+str(self.second.denominator))
d... |
import sklearn
import sqlite3 as lite
import string
from nltk.corpus import stopwords
from scipy import io
from collections import Counter
from itertools import dropwhile
from nltk.tokenize import word_tokenize
from submission import Submission
from comment import Comment
### define constants
DB_NAME = "data/raw_subr... |
# Part of Spatial Math Toolbox for Python
# Copyright (c) 2000 <NAME>
# MIT Licence, see details in top-level file: LICENCE
"""
This modules contains functions to operate on special matrices in 2D or 3D, for
example SE(n), SO(n), se(n) and so(n) where n is 2 or 3.
Vector arguments are what numpy refers to as ``array_... |
#------------------------------------------------------------------------------
# Copyright (C) 1996-2010 Power System Engineering Research Center (PSERC)
# Copyright (C) 2007-2010 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 21 20:36:20 2017
testear
@author: sebalander
"""
# %% imports
import numpy as np
import scipy.linalg as ln
import cv2
import matplotlib.pyplot as plt
from copy import deepcopy as dc
# %%
def plotPointsRefFrame(xm, ym, xc, yc, zc, xi, yi):
pl... |
<reponame>janmejaya-nanda/tpu
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... |
''' A module for representing and manipulating maps between Triangulations. '''
from fractions import Fraction
import operator
import numpy as np
import curver
from curver.kernel.decorators import memoize, ensure
NT_TYPE_PERIODIC = 'Periodic'
NT_TYPE_REDUCIBLE = 'Reducible' # Strictly this means 'reducible and no... |
<reponame>ys1998/tactile-shape-recognition
# -*- coding: utf-8 -*-
'''
#-------------------------------------------------------------------------------
# NATIONAL UNIVERSITY OF SINGAPORE - NUS
# SINGAPORE INSTITUTE FOR NEUROTECHNOLOGY - SINAPSE
# Singapore
# URL: http://www.sinapseinstitute.org
#----------------... |
<filename>pen_geom_tests.py
# MIT-licensed; see LICENSE for details
from unittest import TestCase, skip
import pen_geom as g
from fractions import Fraction as Q
from pen_num import Number as Y, phi, inv_phi, sqrt5, alpha
from itertools import zip_longest
class PenGeomSanityCheck(TestCase):
'''Quick way to make sure... |
from __future__ import division, print_function, absolute_import
from scipy.ndimage.filters import gaussian_filter1d
from scipy import stats
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import numpy as np
import matplotlib.pyplot as plt
import streamlit as st
import pandas as pd
impo... |
<reponame>perlinm/rey_research<gh_stars>0
#!/usr/bin/env python3
##########################################################################################
# FILE CONTENTS:
# makes the 2-D squeezing figures for the SOC/squeezing paper
####################################################################################... |
<gh_stars>100-1000
import numpy as np
from PIL import Image
import pickle
import json
import os
import scipy.io as scio
def load_pickle(url):
with open(url,'rb') as loading_file:
data = pickle.load(loading_file)
return data
def load_json(url):
with open(url) as loading_file:
... |
<gh_stars>1-10
import os
import glob
import torch
import random
import numpy as np
from scipy.io import loadmat, savemat
from models.resnet_50 import resnet50_use
from load_data import transfer_BFM09, BFM, load_img, Preprocess, transfer_UV
from reconstruction_mesh import reconstruction, transform_face_shape, estimate_i... |
# Copyright (c) Microsoft. All rights reserved.
from sklearn.metrics import matthews_corrcoef
from sklearn.metrics import accuracy_score, f1_score
from scipy.stats import pearsonr, spearmanr
from torch.nn.functional import cross_entropy
def compute_acc(predicts, labels):
return 100.0 * accuracy_score(labels, predi... |
from __future__ import absolute_import, division, print_function
import sys
import re
import logging
import numpy
import pandas as pd
import scipy.stats
from scipy.sparse import block_diag, diags
from scipy.sparse.linalg import eigsh
from scipy.ndimage.measurements import label
from scipy.ndimage.morphology import dis... |
<gh_stars>10-100
from __future__ import print_function
import os
import numpy as np
import SimpleITK as sitk
import scipy.misc
from skimage.transform import resize
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import scipy.ndimage
import cv2
import time
from decimal import Decimal
import skimage.io a... |
<reponame>QvAI/huspacy
import json
from pathlib import Path
from statistics import mean
from typing import Dict, Any
import typer
app = typer.Typer()
@app.command()
def main(parser_results: Path, ner_results: Path, output: Path):
with parser_results.open() as f1, ner_results.open() as f2, output.open() as outf:... |
import numpy as np
import os
import scipy.io
import pandas as pd
import ipdb
import sys
# various functions for loading or simulating data.
# data always returned as numpy arrays with dimension (n_observations, n_features)
def standardize(x, y, x_test=None, y_test=None):
# rescale
xbias = x.min()
xscale ... |
from scipy.stats import truncnorm
# Use precomputation otherwise it is really slow
class TruncatedNormal:
def __init__(self):
self.dist = truncnorm(-4.0, 4.0, loc=0, scale=1.0)
self.data = None
self.count = 0
self.precompute()
def precompute(self):
self.data = self.d... |
""" Python script for testing low-rank networks with caffe
must run this in corsair before running:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/jose/Documents/code/anaconda2/lib/
export PYTHONPATH=/home/jose/Documents/code/caffe3/python/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/jose/Documents/code/anaconda2/pkg... |
<reponame>MezerLab/age-pred-r1
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 11 09:31:43 2019
@author: asier.erramuzpe
"""
import numpy as np
from src.data.make_dataset import (load_cort,
load_dataset,
load_cort_areas,
... |
<reponame>nagam11/NiB<gh_stars>0
import glob
import tensorflow as tf
from tensorflow.python.client import device_lib
print(f"Available: {[x.name for x in device_lib.list_local_devices()]}")
import numpy as np
import os
from scipy.io.wavfile import read
from sklearn.model_selection import train_test_split
from util ... |
import numpy as np
import scipy.io as spio
# Depth Intrinsic Parameters
fx_d = 5.8262448167737955e+02
fy_d = 5.8269103270988637e+02
px_d = 3.1304475870804731e+02
py_d = 2.3844389626620386e+02
# Rotation
R = [9.9997798940829263e-01, 5.0518419386157446e-03,
4.3011152014118693e-03, -5.0359919480810989e-03,
9.9... |
## PRODUCE MEAN PLOTS
from __future__ import print_function
#path = '/home/mkloewer/python/swm/'
path = '/network/aopp/cirrus/pred/kloewer/swm_superhr/'
import os; os.chdir(path) # change working directory
import numpy as np
from scipy import sparse
from scipy.integrate import cumtrapz
import matplotlib as mpl
mpl.use(... |
<gh_stars>1-10
# ### Interface cuSOLVER PyCUDA
from __future__ import print_function
import pycuda.gpuarray as gpuarray
import pycuda.driver as cuda
import pycuda.autoinit
import numpy as np
import scipy.sparse as sp
import ctypes
from scipy.sparse import rand
from scipy.sparse.linalg import spsolve
from scipy.sparse ... |
"""
Defense submission for team Stanford & Suns for NIPS 2017 Adversarial Examples Competition
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import csv
import pickle
import numpy as np
from scipy.misc import imread
from scipy.stats import m... |
<reponame>demansou/meshcut_python3<filename>examples/1_stl_sphere_cut.py<gh_stars>1-10
"""
This demonstrates cutting on a .stl mesh, which requires some pre-processing
because STL stores 3 vertices for each face (so vertices are duplicated).
The merge_close_vertices is a naive implementation of this pre-processing
tha... |
<reponame>sharad23/test123456
from __future__ import division
import sys
import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
from scipy.ndimage.filters import maximum_filter
from scipy.ndimage.morphology import (generate_binary_structure,
iterate_struc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.