text string |
|---|
#!/usr/bin/python
import numpy as np
from numpy import pi, cos, sin, exp, conj
from warnings import warn
import epg
import time
import sys
import scipy.io
class PulseTrain:
def __init__(self, state_file, T, TE, TR, loss_fun, loss_fun_prime, angles_rad=None, phase_rad=None, verbose=False, step=.01, max_iter=100):... |
from big_ol_pile_of_manim_imports import *
from old_projects.eoc.chapter8 import *
import scipy.special
class IllustrateAreaModelErf(GraphScene):
CONFIG = {
"x_min" : -3.0,
"x_max" : 3.0,
"y_min" : 0,
"y_max" : 1.0,
"num_rects": 400,
"y_axis_label" : "",
"x... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 18 08:06:13 2020
@author: aymanjabri
"""
# %% Libraries_Data
import numpy as np
import sys
from scipy.stats import multivariate_normal
## temp libraries and functions
from sklearn.datasets import make_blobs,make_classification
import matplotlib.py... |
<filename>src/Python/pandasDynamo/pandamo/api/statistics/stats.py
import json
import pandas as pd
import sys
from flask import Blueprint
from flask import current_app as app
from flask import request
from flask import jsonify
from scipy import stats
from utillities.exceptions import ExceptionHelpers
from sklearn.naive_... |
<reponame>nyuvis/explanation_explorer
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import division
import os
import csv
import sys
import json
import math
import time
import random
import numpy as np
from sklearn.tree import DecisionTreeClassifier
from scipy.spa... |
<filename>GFPy/Ocean.py
# -*- coding: utf-8 -*-
"""
This module contains functions that read (and plot) various
oceanographic instrument data. This includes:
- CTD (incl. mini CTD)
- ADCP
- drifter
- mooring
The functions are optimized for the file formats typically used
in student cruises at the Geophysical Institute... |
<reponame>TimurDzhumakaev/retailhero-recommender-workspace
import itertools
import json
import os
from collections import defaultdict
from typing import List, Set
import numpy as np
import torch
from scipy import sparse as sp
from torch import nn
from tqdm import tqdm
import config as cfg
from nn_models import ItemMo... |
<filename>source/03_scattering_pu_probe/porous_jcal.py
# ------------------------------------------------------------------ #
# ╦═╗╔═╗╔╦╗╔═╗╔═╗╔═╗
# ╠╦╝║ ║║║║╚═╗║ ║║
# ╩╚═╚═╝╩ ╩╚═╝╚═╝╚═╝
# Reduced Order Modelling, Simulation, Optimization of Cou... |
import numpy as np
# import numba
import scipy as sp
from scipy import stats
from scipy.special import loggamma
import math
# import ipdb
# @numba.jit
def numba_inv(A):
return np.linalg.inv(A)
def faster_inverse(A):
n = A.shape[0]
b = np.eye(n)
_, _, x, _ = sp.linalg.lapack.dgesv(A, b, 0, 0)
... |
#!/usr/bin/env python3
"""Command-line interface."""
from __future__ import annotations
import argparse
import logging
import os
import re
import shutil
import sys
import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import minimize_scalar
import overreact as rx
from overreact import _constants ... |
<filename>Generative/CONDITIONALMOMENTS/scitools/filters.py<gh_stars>1-10
import tensorflow as tf
import numpy as np
from scipy import ndimage
from parallel import printRoot
def verifyNxVal(Nx):
if Nx<4:
printRoot('WARNING: Nx found to be:',Nx)
return
def boxFilter2D(field,boxSizeH, boxSizeW):... |
'''
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
What is the 10 001st prime number?
'''
from sympy import prime
def main_body(limit):
return prime(limit)
def time_test(limit, count = 1000):
import timeit
return str(timeit.timeit(stmt = ... |
<filename>scripts/plots_preprocessing.py
import numpy as np
import dicom
import glob
from matplotlib import pyplot as plt
import os
import cv2
from common import plot_3d
from sklearn.metrics import confusion_matrix
import pandas as pd
from sklearn import cross_validation, metrics
import xgboost as xgb
import scipy.... |
# Copyright (c) 2012-2015, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
from . import Tango
from .base_plots import gpplot, x_frame1D, x_frame2D,gperrors
from ...models.gp_coregionalized_regression import GPCoregionalizedRegression
from ...models.sparse_... |
<filename>main.py
from random import *
from telnetlib import *
import itertools
import re
import time
import numpy as np
import scipy.sparse.csgraph as ng
server_encoding = 'UTF-8'
def log(*messages):
print(name, ": ", *messages)
class ServerConnection:
def __init__(self, host, port):
self.telnet = ... |
<gh_stars>0
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
""" Computation of the canonical HRF used in fMRIstat, both the 2-term
spectral approximation and the Taylor series approximation, to a shifted
version of the canonical Glover HRF.
References
-... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: <NAME>
# @Date: 2014-02-28 11:04:16
# @Last Modified by: <NAME>
# @Last Modified time: 2014-02-28 11:19:29
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: <NAME>
# @Date: 2014-01-17 16:38:15
# Script to find the average ICP alignment error
impo... |
<gh_stars>1-10
import logging
import numpy
import pandas
from scipy.special._ufuncs import inv_boxcox
from scipy.stats import boxcox
from statsmodels.tsa.holtwinters import ExponentialSmoothing
from statsmodels.tsa.statespace.sarimax import SARIMAX
from hts.core.exceptions import InvalidArgumentException
from hts._t ... |
<reponame>tchakravarty/PythonExamples
"""Plot the performance of a AdaBoost classifer with two data formats.
Charts the trainning time of a AdaBoost classifier on 20newsgroups data
represented in both sparse and dense format as the number of features
used in the data grows.
"""
from scipy import sparse
import time
imp... |
import sys
import os
import scipy.constants as co
import numpy as np
from matplotlib import pyplot as plt
import h5py
from scipy.interpolate import interp1d
plt.rc('text', usetex=True)
plt.rc('text.latex', preamble=r'\usepackage[varg]{txfonts}')
plt.rc('axes', titlesize=54)
plt.rc('font', family='serif', size=12)
FO... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy import stats
pd.set_option('display.width', 100)
pd.set_option('precision', 3)
import statsmodels.api as sm
from statsmodels.stats.stattools import durbin_watson
from statsmodels.sandbox.regression.predstd import wls_prediction_std
from ... |
<reponame>motazsaad/face-count
# coding: utf-8
import numpy as np
import os
import warnings
import logging
#import xml.etree.ElementTree as ET
import scipy.io
import chainer
from chainercv.utils import read_image
class WIDERFACEDataset(chainer.dataset.DatasetMixin):
def __init__(self, data_dir, label_mat_file... |
"""
Vector and application class for the 2D heat equation
Time integration methods:
Forward Euler
Backward Euler
Crank-Nicolson
"""
from typing import Callable, Union
import numpy as np
from scipy.sparse import diags
from scipy.sparse import identity
from scipy.sparse.linalg import spsolve
from pymgrit.core... |
<gh_stars>1-10
#!/usr/bin/env python
# encoding: utf-8
'''
@author: <NAME>
@license:
@contact: <EMAIL>
@time: 2020-01-10
@desc:
'''
import warnings
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
import os, datetime
import numpy as np
from scipy import ndimage as nd... |
<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 4 02:01:23 2018
@author: Kazuki
"""
import numpy as np
import pandas as pd
import os
from glob import glob
from scipy.stats import kurtosis
from multiprocessing import cpu_count, Pool
import sys
argvs = sys.argv
from itertools imp... |
import numpy as np
import time
import os
from scipy import special
def tuning_update_inhomo(tuning, weight, sigma_vec, alpha = 2, eta = 1, beta = 0, Lambda = 1,
elastic_term = 'sum',# other options: 'exp', 'expweight', 'rand'
elastic_term_periodic = True, # use closed ... |
<reponame>mikarubi/segmentation
def process_volumes(parameters):
'''process original volumes and save into nifti format'''
import os
from scipy import interpolate
from types import SimpleNamespace
from voluseg._tools.load_volume import load_volume
from voluseg._tools.save_volume import save_vol... |
import numpy as np
import skimage
import logging
import random
import warnings
import scipy
from distutils.version import LooseVersion
############################################################
# Bounding Boxes
############################################################
def extract_bboxes(mask):
"""Comput... |
<filename>REMOD-Text/utils.py<gh_stars>10-100
import os
import random
import numpy as np
import torch
import torch.nn as nn
from scipy import stats
from sklearn.metrics import (accuracy_score, classification_report,
confusion_matrix)
def set_all_seed(seed):
random.seed(seed)
np.r... |
"""
Rectangular off-axis aperture for a w-q mapping in a TEM.
The slit is defined by the width dqy in the energy-dispersive
direction and the bin width dqx for each spectrum; q0 denotes
the center of the aperture.
USAGE
The angular correction function for w-q mapping can be
calculated as ... |
import numpy as np
import os
import matplotlib.pyplot as plt
import cv2
from imageio import imread
from scipy.spatial import distance
from keras.models import load_model
import pandas as pd
from tqdm import tqdm
import dlib
from model import create_model
from align import AlignDlib
import glob
import imutils
import fla... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import division
import collections
from functools import wraps
import sys
import warnings
# pylint: disable=wrong-import-position
warnings.simplefilter(action="ignore", category=FutureWarning)
from textwrap import dedent
import numpy as n... |
import warnings
warnings.filterwarnings("ignore")
import json, matplotlib
s = json.load( open("../styles/bmh_matplotlibrc.json") )
matplotlib.rcParams.update(s)
from IPython.core.pylabtools import figsize
import numpy as np
from matplotlib import pyplot as plt
import scipy.stats as stats
figsize(11, 9)
dist = sta... |
# coding:utf-8
# 实现KPCA
from sklearn.datasets import load_iris
from sklearn.decomposition import KernelPCA
import numpy as np
import matplotlib.pyplot as plt
from scipy.spatial.distance import pdist, squareform
'''
author: heucoder
email: <EMAIL>
date: 2019.6.13
'''
def sigmoid(x, coef = 0.25):
x = np.dot(x, x.... |
<filename>dev/mod/graph.py
# -*- coding: utf-8 -*-
##
# @author Pr Magoules HPC Research Group, CentraleSupelec, France
# @author <NAME>
# @author <NAME>, IS1260-PC01, CentraleSupelec, France [DONE]
# @date 2015-12-11, 2016-02-08
# @date 2016-12-13, 2016-12-13
# @date 2016-12-13, 2017-02-23 [DONE]
# @version ... |
#!/usr/bin/env python
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm, ListedColormap,BoundaryNorm
import numpy as np
import datetime as dt
import sys, os, pickle, time
from scipy.ndimage.filters import gaussian_filter
import pandas as pd
from mpl_toolkits.... |
'''
Author: <NAME>
Model script to define and instantiate
residual network models
'''
import csv
import os
import numpy as np
from math import floor, ceil
import scipy.ndimage as ndimage
import torch
import torchvision
import torchvision.transforms as transforms
from torch.utils.tensorboard import SummaryWriter
impo... |
import os,sys
import pytest
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
import graphenemodeling.graphene.monolayer as mlg
import graphenemodeling.graphene._constants as _c
from scipy import constants as sc
import numpy as np
class TestHamiltonian:
def test_Hamiltonian_LowEnergy(self):
eF = 0.4 ... |
__author__ = ('<NAME>, <EMAIL>',
'<NAME>, <EMAIL>')
import scipy
import logging
from pybrain.optimization.optimizer import ContinuousOptimizer
def fullyConnected(lst):
return dict((i, lst) for i in lst)
def ring(lst):
leftist = lst[1:] + lst[0:1]
rightist = lst[-1:] + lst[:-1]
return ... |
<reponame>XiaoguTech/rta-simulator
from kapacitor.udf.agent import Agent, Handler
from scipy import stats
import math
import kapacitor.udf.udf_pb2 as udf_pb2
import sys
class TTestHandler(Handler):
"""
Keep a rolling window of historically normal data
When a new window arrives use a two-sided t-test to det... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
import time
from collections import OrderedDict
import cv2
import dlib
import numpy as np
from scipy.spatial import distance
class ObjectTracker():
def __init__(self, max_disapp... |
import rpy2.robjects.numpy2ri
#rpy2.robjects.numpy2ri.activate() # nodig bij nieuwere rpy2 versie
import rpy2.robjects as robjects
from osgeo import gdal
import matplotlib
import matplotlib.pyplot as plt
import scipy
import scipy.stats
import numpy
import matplotlib
import pil
import netcdf
import openopt
... |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distribu... |
<gh_stars>0
# -*- coding: utf-8 -*-
import numpy as np
import scipy
import matplotlib.pyplot as plt
import math
def sigmoid(x):
return np.array([(1. - math.exp(-a))/(1. + math.exp(-a)) for a in x])
def sigmoid_rev(x):
return np.array([-math.log((1. - a) / (a + 1.)) for a in x])
class Network(object):
d... |
"""Objects for image simulation with."""
from scipy.signal import chirp
from .conf import config
from .mathops import engine as e, jinc
from .convolution import Convolvable
from .coordinates import cart_to_polar, polar_to_cart
class Slit(Convolvable):
"""Representation of a slit or pair of slits."""
def __... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# BCDI: tools for pre(post)-processing Bragg coherent X-ray diffraction imaging data
# (c) 07/2017-06/2019 : CNRS UMR 7344 IM2NP
# (c) 07/2019-present : DESY PHOTON SCIENCE
# authors:
# <NAME>, <EMAIL>
try:
import hdf5plugin # for P10, should be im... |
"""Test sampling."""
import statistics
from typing import Any, Dict, List, Optional, Union
import aiohttp
import numpy as np
import pytest
import helpers
headers = {"content-type": "application/json"}
program_code = "parameters {real y;} model {y ~ normal(0, 0.0001);}"
@pytest.mark.asyncio
async def test_fits(api_... |
import sympy as sym
import sympy.utilities.codegen as cgen
import sympy.codegen.rewriting as copt
import numpy as np
import re
'''
Computes the gradient of f w.r.t. the given variables.
'''
def gradient(f, v):
return sym.Matrix([f]).jacobian(v)
'''
Computes the hessian of f w.r.t. the given variables.
'''
def hes... |
<reponame>Europium-152/isttok-tomography<filename>Archive/reconstructions_fisher.py
import numpy as np
import matplotlib.pyplot as plt
from skimage.draw import ellipse
import sys
from scipy.ndimage.measurements import center_of_mass
from numpy import unravel_index
import scipy
plt.close("all")
plt.rcParams.update({... |
""" Functions to compute Spatial-Spectral Decompostion (SSD).
Reference
---------
<NAME>, <NAME>, <NAME>.: A novel method for reliable and fast
extraction of neuronal EEG/MEG oscillations on the basis of
spatio-spectral decomposition. Neuroimage. 2011 Apr 15;55(4):1528-35.
doi: 10.1016/j.neuroimage.2011.01.057. Epub 2... |
<filename>src/lagt/train/train.py
import os
import tensorflow as tf
import numpy as np
import scipy
import glob
from tensorflow.keras.optimizers import Adam, SGD
from callbacks.callbacks import create_callbacks
from callbacks.warmup_cosine_decay_scheduler import WarmUpCosineDecayScheduler
from lagt.train.video_clip_fe... |
<filename>test/test_LightModel/test_light3d.py
__author__ = 'sibirrer'
import pytest
import numpy.testing as npt
import numpy as np
import scipy.integrate as integrate
class TestNumerics(object):
"""
tests the second derivatives of various lens models
"""
def setup(self):
pass
def assert... |
# given a histogram of p(E,N) at mu0,beta0, reweight it and return an estimate of p(N) at mu1,beta1
#however, we want (T-Tc)/Tc to be the same for all sequences, so we provide betaC=1/Tc
import sys
import numpy as np
import pandas as pd
import scipy.optimize
import matplotlib
matplotlib.use('Agg')
import matplotlib.... |
#!/usr/bin/env python
"""
dnolivieri 11-enero-2016
- For making maps of the loci.
"""
import collections
import itertools
import sys
import re
import cPickle as pickle
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio import SeqFeature
from Bio.Blast.Applications impor... |
<reponame>shuaib7860/Trophic-Analysis-Toolbox<filename>Python_files/MackayTL.py
from scipy.sparse.linalg import spsolve, cg
from scipy.sparse import diags, lil_matrix
import networkx as nx
import matplotlib.pyplot as plt
import numpy as np
#The functions below are able to handle sparse matrices and so they are a muc... |
import numpy as np
import itertools
import sys
import os
import random
import copy
import scipy
import time
import pandas as pd
import sklearn as skl
sys.path.append("/home/bf16951/QMD")
import qmla
import qmla.model_building_utilities
__all__ = ["GeneticAlgorithmQMLA", "GeneticAlgorithmFullyConnectedLikewisePauliTer... |
<reponame>npeschke/cellfinder-core
import numpy as np
from scipy.ndimage.filters import gaussian_filter, laplace
from scipy.signal import medfilt2d
def enhance_peaks(img, clipping_value, gaussian_sigma=2.5):
type_in = img.dtype
filtered_img = medfilt2d(img.astype(np.float64))
filtered_img = gaussian_filt... |
from obspy.core import read
sta1 = 'http://escience8.inf.ed.ac.uk:8080/laquila/SAC/A25A.TA..BHZ.2011.025.00.00.00.000-2011.026.00.00.39.000.rm.scale-AUTO.SAC'
sta2 = 'http://escience8.inf.ed.ac.uk:8080/laquila/SAC/BMN.LB..BHZ.2011.025.00.00.00.023-2011.026.00.00.38.998.rm.scale-AUTO.SAC'
from dispel4py.base import Sim... |
import numpy as np
from scipy.sparse import csr_matrix
__version__ = '0.1.1'
def normalize_csr_matrix(x, meanarr=None, stdarr=None, ixnormed=None, threshold_to_clip=2000, verbose=True):
""" Normalizes a CSR matrix only based on non-zero values, without turning it into dense array.
In the CSR matrix, rows c... |
<gh_stars>1-10
import pandas as pd
import matplotlib.pyplot as plt
import os
import numpy as np
import pytz as tz # better alternatives -> Apache arrow or pendulum
from scipy.spatial import Voronoi
from datetime import datetime
from PIL import Image
import urllib
import urllib.request
# import wget
class DataProcesso... |
<filename>src/means/approximation/mea/closure_scalar.py
"""
Scalar moment closure
------
This part of the package provides the original
(and default) closure :class:`~means.approximation.mea.closure_scalar.ScalarClosure`
as well as the base class for all closers.
"""
import sympy as sp
from means.util.sympyhelpers ... |
import os
import sys
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib import colors as mcolors
import argparse
import glob
import numpy as np
import seaborn as sns
import scipy
from scipy.signal import savgol_filter
# Convert the nasty stdout files to CSV files
def main(fnames)... |
<reponame>Syler1984/seismo-performer
import obspy.core as oc
from scipy.signal import find_peaks
import numpy as np
import matplotlib.pyplot as plt
import os
from time import time
from obspy.core.utcdatetime import UTCDateTime
def pre_process_stream(stream, no_filter = False, no_detrend = False):
"""
Does pre... |
<reponame>cover-me/qtplot
# pieces of code taken from project qtplot
import os
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
from scipy import ndimage
plt.rcParams['figure.facecolor'] = 'white'
def create_kernel(x_dev, y_dev, cutoff, distr):
distributions = {
'gaussi... |
<filename>_build/jupyter_execute/gps_soln.py
# Bite Size Bayes
Copyright 2020 <NAME>
License: [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
## Fixing GPS
The Globa... |
import os
import pandas as pd
import numpy as np
import scipy.stats as stats
from scipy.stats import fisher_exact
from scipy.io import mmread
cl2ct = {4:'LMPP',
5:'CLP',
1:'HSC_MPP',
2:'MEP',
3:'CMP_BMP',
8:'GMP',
6:'Pro-B',
9:'MDP',
10:'pDC',
7:'Pre-B',
21:'Naive CD4 T1',
22:'Naive CD4 T2',
20:'Mature NK2',
1... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
from PIL import Image
import torch
from torch.utils import data
import numpy as np
from torchvision import transforms as T
import torchvision
from sklearn import metrics
from scipy.optimize ... |
<reponame>omidsakhi/tpu_glow
import ops
import numpy as np
import tensorflow as tf
import memory_saving_gradients
def codec(cfg):
def encoder(z, objective):
eps = []
for i in range(cfg.n_levels):
z, objective = revnet2d(i, str(i), z, objective, cfg)
if i < cfg.n_levels-1:
... |
import shutil
import util.util as util_
import os
import cv2
import open3d as o3d
import pickle
import numpy as np
from scipy.optimize import linear_sum_assignment
import trimesh
from skimage import measure
import scipy
from sklearn.neighbors import KDTree
from scipy.ndimage.measurements import label
import data_augmen... |
<filename>Python/rpgm_core.py
__author__ = "<NAME>"
__date__ = "Mar 30, 2016"
__version__ = "v3.0"
# This file is based on the network creation algorithm published in:
#
# A Random Growth Model for Power Grids and Other Spatially Embedded Infrastructure Networks
# <NAME>, <NAME>, and <NAME>
# Eur. Phys. J. Special Top... |
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 2 23:22:40 2020
@author: lul
"""
import numpy as np
from random import random
from scipy.optimize import minimize
import qiskit
from qiskit.circuit.library.standard_gates import U2Gate
from qiskit.aqua.operators import WeightedPauliOperator
from qiskit.aqua.algorithms... |
# coding: utf-8
import fractions
import copy
solids = ("flour", "sugar", "salt", "shortening")
liquids = ("water", "spice")
large_items = ("apples", "eggs")
class IngredientBase:
" Base class for common functionality "
target = ()
def __init__(self, ingredient_str):
self.original_in... |
<reponame>godlovesdavid/Impulcifer
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from matplotlib.mlab import specgram
from matplotlib.ticker import LinearLocator, FormatStrFormatter, FuncFormatter
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unus... |
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 4 18:14:29 2016
@author: becker
"""
import numpy as np
import numpy.linalg as linalg
from simfempy import fems
from simfempy.meshes.simplexmesh import SimplexMesh
import scipy.sparse as sparse
#=================================================================#
class Fe... |
import os
import errno
import numpy as np
from skimage import io
import scipy
import scipy.misc
from skimage.transform import resize
from skimage.measure import compare_psnr , compare_ssim
import matplotlib.pyplot as plt
plt.switch_backend('agg')
import matplotlib
import utils_mnist as utils
import pdb
def normalize(i... |
from tkinter import filedialog
import tkinter as tk
from tkinter import ttk
from tkinter import messagebox
import warnings
import math
from point2d import Point2D
from PIL import Image, ImageTk
import os
import errno
from message_box import *
import shutil
import cv2
import numpy as np
import sys as sys
import re as re... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 28 11:35:01 2016
@author: tomas
"""
import numpy as np
from scipy.spatial import distance as di
def average_precision(ils, t):
'''
Computes the average precision
Thanks for a fast mAP implementation!
https://github.com/ssudholt/phocnet... |
"""
This module of SYMORO package provides geometric models' computation.
The core symbolic library is sympy.
Needed modules: symoro.py
ECN - ARIA1 2013
"""
from sympy import Matrix, zeros, eye, sin, cos
from symoro import Symoro, Init, hat
Z_AXIS = Matrix([0, 0, 1])
class Transform():
@classmethod
def s... |
<gh_stars>1-10
from scipy.signal import savgol_filter
# from peakutils import baseline
import numpy as np
import pandas as pd
from scipy.interpolate import interp1d
from scipy import integrate
import helpers as hlp
# the 'deriv' parameter in savgol_filter() is used in conjuction with the
# `delta` parameter... |
#!/usr/bin/env python
__doc__ = """binaryBHexp
========
The binary Black Hole explorer.
Generates visualizations of a precessing binary black hole merger and the
final remnant black hole.
Example usage:
./binaryBHexp --q 2 --chiA 0.2 0.7 -0.1 --chiB 0.2 0.6 0.1
By clicking and dragging on the movie as it plays, you... |
<filename>solardatatools/algorithms/time_shifts.py
""" Time Shift Algorithm Module
This module contains the algorithm for detecting time shifts in an unlabeled PV
power production data sets. These occur because of the local clock on the data
logging system being changed or by incorrect handling of daylight savings.
Th... |
<reponame>rpl-cmu/leo
#!/usr/bin/env python
import sys
sys.path.append("/usr/local/cython/")
import numpy as np
import math
import os
import hydra
import json
import csv
from attrdict import AttrDict
from datetime import datetime
import gtsam
from leopy.utils import tf_utils, dir_utils
from leopy.eval import quant_... |
<reponame>BouchardLab/ReachMaster
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import
from software.preprocessing.video_data.DLC.Reconstruction import dlt_reconstruct
from mpl_toolkits.axes_grid1 import make_axes_locatable
from sklearn.metrics import me... |
from load import ROOT as R
import gna.constructors as C
import numpy as N
from collections import OrderedDict
from gna.bundle import *
from scipy.interpolate import interp1d
class reactor_anu_spectra_v01(TransformationBundleLegacy):
short_names = dict( U5 = 'U235', U8 = 'U238', Pu9 = 'Pu239', Pu1 = 'Pu241' )
... |
import sys
import csv
from datetime import datetime
import random
import numpy as np
import scipy.spatial
import math
from itertools import combinations
# CONSTS
MAX_ITERATIONS = 15
TYPE_FIXED_NUMBER_OF_ITERATIONS = 99
TYPE_RANDOM_CHOICE = 100
METHOD_C_INDEX = 500
METHOD_DUNN_INDEX = 501
# CONFIGURATION OF PROGRAM
T... |
<reponame>Sikerdebaard/PREDICTFastr<filename>build/lib/WORC/classification/fitandscore.py
#!/usr/bin/env python
# Copyright 2016-2019 Biomedical Imaging Group Rotterdam, Departments of
# Medical Informatics and Radiology, Erasmus MC, Rotterdam, The Netherlands
#
# Licensed under the Apache License, Version 2.0 (the "L... |
<filename>examples/wareham_query.py
#!/usr/env/python
'''
The main file for creating and analyzing JetYak missions.
Maintainer: vpreston-at-{whoi, mit}-dot-edu
'''
import numpy as np
import jetyak
import jviz
import sensors
import shapefile
import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
import... |
<filename>clustring/em.py
from clustring.pca import transform_dataset_into_2_d
import numpy as np
from scipy.stats import multivariate_normal as mvn
from clustring.helper import readFile
import random
import matplotlib.pyplot as plt
class EMAlgorithm:
def __init__(self, items, k, max_iter=100, eps=1e-7):
... |
from __future__ import print_function
import argparse
import os
import time
import model
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.optim.lr_scheduler as lr_scheduler
from datasets.mnist import getmnist, NUM_TRAIN
from torchvision import datasets, trans... |
<reponame>jmark/turbubox<gh_stars>0
#!/usr/bin/env python3
import sys
from matplotlib import pylab as plt
from mpl_toolkits.mplot3d import axes3d
import numpy as np
import imp
import gausslobatto
import flash, flexi, hopr
import flash_to_flexi as flfl
import scipy.misc
import ulz
import interpolate
import glob
sys.ar... |
<filename>tools/demo_detection_kaist_color.py
#!/usr/bin/env python
"""
Demo script showing detections in sample images.
See README.md for installation instructions before running.
"""
import matplotlib
#matplotlib.use('Agg')
import cPickle
import _init_paths
from fast_rcnn.config import cfg
from fast_rcnn.test imp... |
"""Sinogram preparation"""
import numpy as np
from scipy.stats import mode
from skimage.restoration import unwrap_phase
def align_unwrapped(sino):
"""Align an unwrapped phase array to zero-phase
All operations are performed in-place.
"""
samples = []
if len(sino.shape) == 2:
# 2D
... |
import itertools as it
from typing import Dict, Iterator, List, Set, TypeVar
import numpy as np
from scipy.spatial.distance import pdist
from graphrole.graph.graph import AdjacencyDictGraph
from graphrole.types import DataFrameDict, DataFrameLike, VectorLike
T = TypeVar('T', int, str)
def vertical_log_binning(arr:... |
<reponame>zhiqiangdon/autogluon
import numpy as np
from typing import Dict, Optional
import logging
from .meanstd_acqfunc import MeanStdAcquisitionFunction, AcquisitionWithMultiModelCurrentBest, HeadWithGradient
from scipy.stats import norm
from ..tuning_algorithms.base_classes import OutputSurrogateModel, SurrogateMo... |
# UQpy is distributed under the MIT license.
#
# Copyright (C) 2018 -- <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# rights t... |
import numpy as np
import scipy.fft as fft
def IRIS_SG_deconvolve(data_in, psf,
iterations=10,
fft_div=False):
'''
<NAME>
July 2020
NAME: IRIS_SG_Deconvolve.py
PURPOSE: Deconvolves IRIS SG data using the PSFs from Courrier et al 2018.
... |
#!/usr/bin/env python
# Trying to make inference work on big data without running out of
# memory. The big new idea is adaptive jitter window size.
# <NAME>, 10/4/2011
import sys
import numpy as np
import scipy.optimize as opt
from scipy.io import loadmat
from math import factorial
from utility import unlog, fast_a... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
import numpy as np
from delight.sedmixture import *
from scipy.misc import derivative
relative_accuracy = 0.01
def test_PhotometricFilter():
def f(x):
return np.exp(-0.5*((x-3e3)/1e2)**2)
x = np.linspace(2e3, 4e3, 1000)
y = f(x)
aFilter = PhotometricFil... |
<filename>calctop.py
#!/usr/bin/env python
import numpy as np
import os, sys
import os.path
sys.path.append("/home/dkoes/git/gninascripts/")
sys.path.append("/net/pulsar/home/koes/dkoes/git/gninascripts/")
import train, predict
import matplotlib, caffe
import matplotlib.pyplot as plt
import glob, re, sklearn, collect... |
<reponame>Lmy0217/PyTorch-GAN
import torch.nn as nn
import torch.nn.functional as F
import torch
def weights_init_normal(m):
classname = m.__class__.__name__
if classname.find('Conv') != -1:
torch.nn.init.normal_(m.weight.data, 0.0, 0.02)
elif classname.find('BatchNorm2d') != -1:
torch.nn.i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.