text string |
|---|
<reponame>haonguyen1107/style_transfer
from scipy.misc import imread, imresize, imsave
import numpy as np
def load_image(image, size, crop):
#image = imread(image, mode='RGB')
#image=np.array(image)
if crop=='store_true':
image = central_crop(image)
if size:
image = scale_image(image, ... |
<filename>volumes/rnamining-front/assets/scripts/model_train.py
import argparse
import numpy as np
import pandas as pd
from scipy.io import arff
from xgboost import XGBClassifier
import imp
from counters import arff_creator
import os
import _pickle as pkl
from sklearn.utils import shuffle
def process_inputfile(filenam... |
<filename>plot_fig07ab_theoretical_eval.py
########################################
# plot_fig07ab_theoretical_eval.py
#
# Description. Script used to plot Figs. 7a and 7b of the paper.
#
# Author. @victorcroisfelt
#
# Date. December 27, 2021
#
# This code is part of the code package used to generate the nume... |
from sympy import Rational as frac
from sympy import sqrt
from ..helpers import article, fsd, pm, untangle, z
from ._helpers import NCubeScheme
_citation = article(
authors=["<NAME>", "<NAME>", "<NAME>"],
title="Numerical quadrature in n dimensions",
journal="Comput J",
year="1963",
volume="6",
... |
<gh_stars>1-10
"""
Copyright (c) 2010-2018 CNRS / Centre de Recherche Astrophysique de Lyon
Copyright (c) 2019 <NAME> <<EMAIL>>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions o... |
<filename>dmsky/utils/stat_funcs.py<gh_stars>1-10
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Utilities for statistical operations
"""
from __future__ import absolute_import, division, print_function
import numpy as np
import scipy.stats as stats
def norm(x, mu, sigma=1.0):
""" Scipy norm ... |
<reponame>behavioral-data/multiverse
import click
import os
import numpy as np
from transformers import (BartForConditionalGeneration, DataCollator,
RobertaTokenizerFast, Trainer, TrainingArguments,
BartTokenizerFast, BartConfig, BartForSequenceClassification,
... |
<reponame>karempudi/narsil<filename>narsil/fish/datasets.py
from scipy.ndimage.morphology import distance_transform_edt
import torch
import torch.nn.functional as F
import numpy as np
import glob
import os
from skimage.io import imread
from skimage.measure import label, regionprops
from skimage.transform import rotate
... |
"""@package binary_classification_example
This package implements the binary classification with nonconvex loss example.
Copyright (c) 2019 <NAME>, Department of Statistics and Operations Research, University of North Carolina at Chapel Hill
Copyright (c) 2019 <NAME>, Department of Statistics and Operations Research... |
import numpy
import numpy.typing
import typing
import scipy.stats
from hphmm.model import (CSRMatrix, make_csr_matrix_from_dense)
class Model(typing.NamedTuple):
n: int # number of states
transition_matrix: CSRMatrix # shape (n, n) compressed sparse row
signal_matrix: numpy.typing.NDArray[numpy.float64] ... |
<gh_stars>1-10
# fitsedprobs is now deprecated because I changed fitsedfamily
# a lot and it's easier to just optionally return the probability
# array from fitsedfamily. 5/31/2016
# Given a (large) set of SED models and a single object's set of
# flux data points and redshift, find the best fit SED by calling
# fit... |
<reponame>kristinmg/mne-hfo
import collections
from typing import Tuple, Union
import mne
import numpy as np
from joblib import Parallel, delayed, cpu_count
from mne.utils import warn
from scipy.signal import hilbert
from tqdm import tqdm
from mne_hfo.base import Detector
from mne_hfo.config import ACCEPTED_BAND_METH... |
<gh_stars>1-10
#!/usr/bin/python3
import numpy as np
from scipy import signal
from scipy.io import loadmat
import holoviews as hv
from bokeh.plotting import show
from bokeh.io import output_notebook, reset_output
from src.waveform_parser.lecroy_waveform_parser import LecroyWaveformBinaryParser
from src.trace_conta... |
<filename>Examples/classymidi_classifier_and_songs_names_generator.py
# -*- coding: utf-8 -*-
"""ClassyMIDI_Classifier_and_Songs_Names_Generator.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1f_hJexCbstm1wucfIV86kmew5Ev6N-9J
# ClassyMIDI (Ver 1... |
from pixyz.distributions import Normal
from pixyz.losses import KullbackLeibler, Parameter
from pixyz.models import VAE
from torch import optim
import torch
from scipy.special import logsumexp
class JMVAE(object):
def __init__(self, z_dim, optimizer_params, q_x, q_y, p_x, p_y, q=None, q_star_y=None, q_star_x=None... |
<filename>stereo/algorithm/statistics.py
#!/usr/bin/env python3
# coding: utf-8
"""
@author: <NAME> <EMAIL>
"""
import pandas as pd
import numpy as np
from scipy import stats
from statsmodels.stats.multitest import multipletests
from .mannwhitneyu import mannwhitneyu
def corr_pvalues(pvals, method, n_genes):
"... |
<filename>docs/notebooks/00_scipy.py
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: ipynb,py,md
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.13.3
# kernelspec:
# display_name: Python 3 (ipykernel)
# ... |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 7 19:14:22 2022
@author: aoust
"""
import pandas
import matplotlib.pyplot as plt
import scipy.stats
import numpy as np
def aux_histogram(serie):
serie = list(serie)
serie.sort()
L = len(serie)
return serie, list(range(1,1+L))
d_3_RH = panda... |
from sympy import poly, symbols
from collections import deque
import Crypto.Random.random as random
from Crypto.Util.number import getPrime, bytes_to_long, long_to_bytes
def build_poly(coeffs):
x = symbols('x')
return poly(sum(coeff * x ** i for i, coeff in enumerate(coeffs)))
def encrypt_msg(msg, poly, e, N)... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 29 18:20:38 2018
@author: <NAME> <<EMAIL>>
"""
import h5py, os
from numpy import where, isin, nan, arange, ones, isnan, isfinite, ndarray
from numpy import array, mean, unique, hstack, vstack, ma, meshgrid, linspace
from datetime import datetime, t... |
<filename>qem.py
try: # See if CuPy is installed. If false, continue without GPU.
import cupy as xp
print('CuPy installation found, continuing using GPU acceleration.')
GPU=True
except ImportError:
print('No CuPy installation found, continuing without GPU acceleration.')
import numpy as xp
GPU=F... |
<reponame>Yash621/jax
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
<reponame>18F/census-similarity
"""Distance metrics"""
import distance
from scipy import spatial
def cosine(left, right):
elements = set(left) | set(right)
elements = list(sorted(elements))
left = [int(el in left) for el in elements]
right = [int(el in right) for el in elements]
return spatial.dis... |
<reponame>yuchen93/hlpr_perception
#!/usr/bin/env python
import os
import sys, time, math, cmath
from std_msgs.msg import String
import numpy as np
import cv2
import roslib
import rospy
import pdb
from Tkinter import *
from hlpr_feature_extraction.msg import PcFeatureArray
pf = None
display = None
initX = None
def g... |
<gh_stars>1-10
#Program to find Discrete Fourier Transform
#Plotting magnitude and phase response
import numpy as np
import math
from numpy.fft import fft,ifft
import scipy as sy
from matplotlib import pyplot as plt
#input sequences
x = eval(input('Enter the input sequence x[n]='))
N = len(x)
X = fft(x,N)... |
<gh_stars>10-100
from mpi4py import MPI
import sys
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
size = comm.Get_size()
import pandas as pd
import numpy as np
from .pylspm import PyLSpm
import random
from scipy.stats.stats import pearsonr
from .boot import PyLSboot
def PyLSmpi(mode, br, cores, dados, ... |
# --------------
import pandas as pd
import scipy.stats as stats
import math
import numpy as np
import warnings
warnings.filterwarnings('ignore')
#Sample_Size
sample_size=2000
#Z_Critical Score
z_critical = stats.norm.ppf(q = 0.95)
# path [File location variable]
#Code starts here
data = ... |
#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
"""
Python module with all utils and functions for analysing CESM output on cheyenne
"""
# --------------------------------------------------------------------
# Import modules
# -------------------------------------------------------------------
import os
import matplotlib.pyplot as plt
import matplotlib as mpl
impo... |
<filename>data/medical-city-dallas-hospital/parse.py<gh_stars>10-100
#!/usr/bin/env python
import os
from glob import glob
from statistics import mean
import json
import pandas
import datetime
here = os.path.dirname(os.path.abspath(__file__))
folder = os.path.basename(here)
latest = '%s/latest' % here
year = datetim... |
import numpy as np
import matplotlib.image as mpimg
from skimage.feature import hog
from scipy.ndimage.measurements import label
from collections import deque
import cv2
color_space = 'YUV' # Can be RGB, HSV, LUV, HLS, YUV, YCrCb
orient = 15 # HOG orientations
pix_per_cell = 8 # HOG pixels per cell
cell_per_block =... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import stats
import warnings
warnings.filterwarnings("ignore")
from math import *
from sklearn.preprocessing import LabelEncoder
from sklearn import preprocessing
from sklearn.model_selection import KFold, ... |
<reponame>avdosev/optimization_methods
import random
import math
import numpy as np
from scipy.stats import cauchy
from stochastic.simulated_annealing import simulated_annealing
def boltzmann_method(x0, t0, function, N=2500):
"""
алгоритм имитации отжига
метод Больцмана
"""
annealing = lambda k: t0... |
#!/usr/bin/env python
"""
ththmod.py
----------------------------------
Code for handling theta-theta transformation by <NAME>
"""
import numpy as np
import astropy.units as u
from scipy.sparse.linalg import eigsh
def chi_par(x, A, x0, C):
"""
Parabola for fitting to chisq curve.
"""
return A*(x - x... |
<gh_stars>10-100
import pytest
import numpy as np
from scipy.linalg import expm
from pathlib import Path
from msdsl.templates.channel import ChannelModel, S4PModel
from msdsl.templates.saturation import SaturationModel
from msdsl.templates.lds import LDSModel, CTLEModel
THIS_DIR = Path(__file__).resolve().parent
TOP_... |
import numpy as np
import cv2, serial, time, os, sys, pickle
from scipy import stats
from PyQt4 import QtCore, QtGui, QtOpenGL
from OpenGL import GL
from ScannerFunction import *
from ScannerThread import *
class DentalGLWidget(QtOpenGL.QGLWidget):
def __init__(self, parent=None):
super(Denta... |
<gh_stars>10-100
import scipy.spatial
import bob.io.base
import numpy
from bob.bio.base.algorithm import Algorithm
from bob.bio.base.database import BioFile
_data = [5., 6., 7., 8., 9.]
class DummyAlgorithm (Algorithm):
"""This class is used to test all the possible functions of the tool chain, but it does basicall... |
<filename>python-packages/pyRiemann-0.2.2/pyriemann/utils/distance.py
import numpy
from scipy.linalg import eigvalsh
from .base import logm
###############################################################
# distances
###############################################################
def distance_euclid(A, B):
"""Ret... |
<filename>examples/cifar3/inference.py
import caffe
import lmdb
import numpy as np
from caffe.proto import caffe_pb2
import scipy
from scipy import io
import csv
import sys, getopt
# mean_file = '/Users/riya/Downloads/mean.binaryproto' #'/Users/riya/caffe/examples/cifar3/mean.binaryproto'
# model = "/Users/riya/Downlo... |
<gh_stars>0
import sys
from pathlib import Path
import numpy as np
import pandas as pd
from plotnine import *
from scipy.stats import norm
def main(incsv, outplot, add_approximation=False):
df = pd.read_csv(incsv)
print(df.columns)
print(df)
df["accuracy"] = df["accuracy_percent"] / 100.0
df["r... |
<reponame>KappaEtaKappa/Sound-To-Disco
import pyaudio
import wave
import sys
import BeatHandlers
import LightController
from scipy import *
# PyAudio Constants
SAMPLE_SIZE = 1024;
FORMAT = pyaudio.paInt16;
CHANNELS = 2;
RATE = 22050;
# Beat Detection Constants
NUM_BANDS = 512;
NUM_AVGS = 22;
TRIGGER_LEVEL = 1.4; #... |
<filename>sarepy/prep/stripe_removal_improved.py
#============================================================================
# Copyright (c) 2018 <NAME>. 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.
# Y... |
<filename>wntr/sim/solvers.py
import numpy as np
import scipy.sparse as sp
import warnings
import logging
warnings.filterwarnings("error",'Matrix is exactly singular', sp.linalg.MatrixRankWarning)
np.set_printoptions(precision=3, threshold=10000, linewidth=300)
logger = logging.getLogger(__name__)
class NewtonSolve... |
import rebound
import numpy as np
from scipy.optimize import fsolve
#import cPickle as pickle
import pickle
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.colors import LogNorm
import sys
#conversion constants
yr = (2.0*np.pi)
mj = 0.00095458 #m_J in m_Sun
dtr = np.pi/180.0
... |
<filename>jupylet/audio/sound.py
"""
jupylet/audio/sound.py
Copyright (c) 2020, <NAME> - <EMAIL>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the abo... |
<gh_stars>0
#!/usr/bin/python
#####################################
### CIS SLOT FILLING SYSTEM ####
### 2014-2015 ####
### Author: <NAME> ####
#####################################
import sys
from scipy.io import mmread
import numpy as np
from sklearn.svm import LinearSVC
from sklea... |
<gh_stars>1-10
from math import comb
from scipy.special import factorial
stirling_dict = {}
def stirling(n, k):
if (n, k) in stirling_dict:
return stirling_dict[(n, k)]
else:
stirling_number = 0
for i in range(k + 1):
stirling_number += ((-1) ** i) * comb(k, i) * ((k - i) ... |
<reponame>AedynLadd/sysc4906-termProject<filename>src/models/X-correlation.py
import json
import numpy as np
import pandas as pd
from pathlib import Path
import logging
from matplotlib import pyplot as plt
from scipy import signal
from scipy import stats
import statsmodels.tsa.stattools as ts
from statsmodels.tsa.vect... |
<reponame>ucl-tbr-group-project/regression
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import interpn
def set_plotting_style(dark=False):
params = {'backend': 'ps',
'text.latex.preamble': ['\\usepackage{gensymb}'],
'axes.labelsize': 16, # fontsize for x a... |
<filename>coreml/cml/molext.py
from __future__ import print_function
import scipy.spatial.distance as ssd
import itertools as itl
import numpy as np
T, F = True, False
class MolPBC(object):
def __init__(self, zs, coords, cell, rcut=9.0):
"""
a mol obj with pbc
"""
na = len(zs... |
<reponame>qing3peng/Stress-Strain<gh_stars>1-10
#!/usr/bin/python
# --------------- readme plot_tensile_stress_strain.py -----------------------------------
# This python3 script plot_tensile_stress_strain.py is a post-processing code
# for tensile simulation. The main tasks are following:
#
# 1. plot the stre... |
"""Example of model code generation."""
import functools
import importlib
import numpy as np
import sympy
from sym2num import model, function, printing, utils, var
# Reload dependencies for testing
for m in (var, printing, function, model):
importlib.reload(m)
class ExampleModel(model.Base):
genera... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 27 01:42:06 2018
@author: <NAME>
"""
from sklearn.svm import SVC
from sklearn.cross_validation import train_test_split, cross_val_score, KFold
from sklearn.datasets import fetch_olivetti_faces
from sklearn import metrics
import numpy as np
import matplotli... |
<reponame>CameronTaylorFL/stam
import numpy as np
from scipy.stats import wasserstein_distance
from sklearn.metrics import pairwise_distances
import ctypes
from functools import partial
def l2_dist(x, y):
xx = np.sum(x**2, axis = 1)
yy = np.sum(y**2, axis = 1)
xy = np.dot(x, y.transpose((1,0)))
... |
import matplotlib.pyplot as plt
from matplotlib.patches import Ellipse
from matplotlib.ticker import FormatStrFormatter, LogLocator
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
from scipy.stats import chi2
import tensorflow as tf
def plot_3d_surface(
fitness_fn,
xlim,
ylim,
zlim=None,
... |
<reponame>Yokeshthirumoorthi/python-poetry-docker-example
#!/usr/bin/python3
import base64
import pickle
import time
from collections import Counter
from dataclasses import dataclass
from datetime import datetime
from pathlib import Path
import cv2
import grpc
import implicit
import numpy as np
import requests
from PI... |
import json
import torch
import numpy as np
from scipy import stats
from torch.utils import data
from causal_bald.library import datasets
from causal_bald.library import plotting
from causal_bald.library import acquisitions
from causal_bald.application.workflows import utils
import seaborn as sns
import matplotlib... |
<filename>code/main.py
import pandas as pd
import os
from collections import Counter, defaultdict
import re
import json
import math
import matplotlib.pyplot as plt
import time
import csv
import pickle
from tqdm import tqdm
import numpy as np
import datetime
import pickle
import os.path
from scipy.stats.stats import pe... |
import os, re
import numpy as np
import scipy
from scipy.misc import logsumexp
from scipy.special import gammaln, beta
from scipy.integrate import simps
from numpy import newaxis as na
import scipy.sparse
from scipy.sparse import csr_matrix, csc_matrix, lil_matrix
import pypolyagamma as ppg
from pgmult.internals.d... |
import os, sys
import h5py
import rdkit.Chem as Chem
import rdkit.Chem.AllChem as AllChem
import random
import numpy as np
from multiprocessing import Pool, cpu_count, Process, Manager, Queue, JoinableQueue
from scipy import sparse
import cPickle as pickle
'''
This script is used to generate an .h5 file... |
<gh_stars>0
# --------------
# Import packages
import numpy as np
import pandas as pd
from scipy.stats import mode
# Create dataframe bank by passing the path of the file
read = pd.read_csv(path)
bank = pd.DataFrame(read)
# Check all categorical values
categorical_var = bank.select_dtypes(include = 'object')
print... |
<gh_stars>0
import numpy
from crystalpy.diffraction.GeometryType import BraggDiffraction, LaueDiffraction
from crystalpy.diffraction.DiffractionSetup import DiffractionSetup
from crystalpy.diffraction.Diffraction import Diffraction
import scipy.constants as codata
from crystalpy.util.Vector import Vector
from cryst... |
"""
Note: joblib 0.12.2 restarts workers when a memory leak is detected.
"""
import re
import os
import csv
import nrrd
import shutil
import operator
import numpy as np
import pandas as pd
import scipy.io as sio
from pathlib import Path
from joblib import Parallel, delayed
from collections import OrderedDict
from ... |
<reponame>bigphoton/arch<filename>arch/blocks/sources.py
"""
Functions and objects describing single photon sources
"""
from arch.block import Block
import arch.port as port
from arch.models.model import SourceModel
from sympy import sqrt, exp, I
class LaserCW(Block):
reference_prefix = "CW"
def define(self):... |
<gh_stars>0
"""Functions for loading graphs from files and storing them in files."""
import dask.dataframe as dd
from dask.diagnostics import ProgressBar
from scipy.sparse import csr_matrix, dok_matrix
import pandas as pd
import numpy as np
from .graph import Graph
from .convert import nodelist_from_edgelist
from .uti... |
<gh_stars>1-10
import warnings
warnings.filterwarnings("ignore")
import logging
logging.getLogger('tensorflow').setLevel(logging.ERROR)
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
from models.LSTM.LSTM_Model import *
from scipy import spatial
from statistics import *
def run_lstm_model(X_train, y_train, l_s=... |
from statistics import linear_regression
import numpy as np
from PIL import Image
import sys
from pathlib import Path
import os
import math
PATH = Path(sys.argv[1])
tileSize = int(sys.argv[2])
designDBUs = {
"8t1" : ((0, 390800), (0, 383040)),
"8t2" : ((0, 1301600), (0, 1148360)),
"8t3" : ((0, 1977170), (0, 141002... |
<filename>gempy/library/astromodels.py<gh_stars>1-10
# Copyright(c) 2019-2020 Association of Universities for Research in Astronomy, Inc.
#
# astromodels.py
#
# This module contains classes and function to interface with the
# astropy.modeling module.
#
# New Model classes to aid with image transformations:
# Pix2Sky: ... |
<reponame>urojony/shiroin
from shiroin import *
from sympy import powdenest
shiroSeed=1
# ~ ###https://www.imomath.com/index.php?options=593&lmm=0
# ~ #Problem 1
# ~ prove('(a^2+b^2+c^2-a*b-a*c-b*c)*2')
# ~ #Problem 2
# ~ formula,values=Sm('(a^2+b^2+c^2+d^2-a(b+c+d))'),'2,1,1,1'
# ~ prove(formula,values)
# ~ #Problem 3... |
#!bin/env python
import os
from functools import partial
import copy
import numpy as np
from numpy import sqrt, tanh
from scipy import optimize
import matplotlib.pyplot as plt
__author__ = '<NAME>'
__copyright__ = 'Copyright 2015'
__license__ = 'MIT'
__version__ = '0.95'
__email__ = '<EMAIL>'
__statu... |
#!/usr/bin/env python3
from scipy.stats import binom
import matplotlib.pyplot as plt
#k = 1 # number of successes
#p = 0.985 # probability of non-infection
#n=70 # samples drawn with replacement from population of size N N>>n approx is OK
#n=20
#for k in range(0,20,1):
# prob = binom.pmf(k=k,n=n,p=0.5)
# pr... |
from energyOptimal.performanceModel import performanceModel
from scipy.optimize import least_squares, nnls
import _pickle as pickle
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import pyplot as plt
parsecapps=['completo_black_5.pkl','completo_canneal_2.pkl','completo_dedup_3.pkl',
... |
<gh_stars>1-10
#Data
import pandas as pd
import numpy as np
#Date
import datetime as dt
#Stats
from statistics import mean, median
###Optimizepackage
import pulp
#Packagefile
#from DK_TeamBuilder import DK_TeamBuildermod
#from DK_Optimization_Function import teamoptmizer |
<filename>preprocessing/pp_pymi3.py<gh_stars>0
import os
import numpy as np
from scipy.spatial.distance import euclidean
from scipy.io import loadmat
from paths import *
from pymi3_utils import MpiiSeqInfo, mpii_get_sequence_info
# Threshold to consider poses "different" in mm
# Current: 40 mm
#JOINT_DIFF_THRESHOLD=... |
<filename>learning/clustering/lsh_tree_test.py<gh_stars>1000+
# Copyright 2021 Google LLC.
#
# 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
... |
<filename>analyze_foldamers/parameters/angle_distributions.py
import os
import numpy as np
import mdtraj as md
from simtk import unit
from cg_openmm.cg_model.cgmodel import CGModel
from analyze_foldamers.utilities.plot import plot_distribution
from analyze_foldamers.parameters.bond_distributions import *
import ... |
<gh_stars>10-100
import os
import numpy as np
import scipy
import sys
import tensorbayes as tb
from codebase.args import args
from scipy.io import loadmat
from itertools import izip
from utils import u2t
def get_info(domain_id, domain):
train, test = domain.train, domain.test
print '{} info'.format(domain_id)
... |
""" models module """
import numpy as np
import scipy.integrate as sci
import itertools
from core import utils
from core import fitting
class Model(object):
""" Parent Class for the charge carrier recombination models """
def __init__(self, ids, units, units_html, factors, fvalues, gvalues, gvalues_range, ... |
<filename>buffer.py
import os
import statistics
import json
import numpy as np
import copy
from LBO import single_optimize
class Buffer:
# Class for a buffer of data frames
def __init__(self, frame_list=None, msg=None):
self.data_ptrs = []
self.index = []
self.value = []
self.c... |
<filename>demo/demo.py
from scipy.io import loadmat
import matplotlib.pyplot as plt
import soinn
data = loadmat("train.mat")['train']
print('Load data with shape', data.shape)
ax=plt.subplot(121)
ax.set_title('origin data')
plt.plot(data[:,0], data[:,1], '.')
clus = soinn.learn(data)
print('soinn learned clusters wi... |
# standard libraries
import warnings
import argparse
import pathlib
import yaml
# dependent packages
import decode as dc
import numpy as np
from scipy.signal import argrelmax, argrelmin
import matplotlib.pyplot as plt
from astropy import table
from astropy.modeling import models, fitting
# original package
from utils... |
from deeplab3.config.defaults import get_cfg_defaults
from deeplab3.evaluators.segmentation_evaluator import SegmentationEvaluator, ImageSegmentationEvaluator
import numpy as np
import scipy.io as sio
import torch
import argparse
import os
from dataloaders import make_data_loader
from deeplab3.modeling.sync_batchnorm.... |
# Baby Advantage Actor-Critic | <NAME> | October 2017 | MIT License
from __future__ import print_function
import torch, os, gym, time, glob, argparse, sys
import numpy as np
from scipy.signal import lfilter
from scipy.misc import imresize # preserves single-pixel info _unlike_ img = img[::2,::2]
import torch.nn as nn... |
from interactions import ParticipantType
from sims4.tuning.tunable import TunableList
from statistics.statistic_ops import TunableStatisticChange
class Party:
RALLY_FALSE_ADS = TunableList(description=' \n A list of false advertisement for rallyable interactions. Use this\n tunable to entice Sims to ... |
# -*- coding: utf-8 -*-
from scipy.interpolate import CubicSpline, PPoly
import numpy as np
def add_anchor_point(x, y):
"""Auxilliary function to create stepping potential used by energy_model.peq_models.jump_spline2 module
Find additional anchoring point (x_add, y_add), such that x[0] < x_add < x[1], and ... |
"""Coupled Metropolis-Hastings implementation."""
import numpy as np
import scipy.stats as st
from .maximal_couplings import ReflectionMaximalCoupling
from .coupled_data import CoupledData
__all__ = ["metropolis_hastings", "unbiased_estimator"]
def _metropolis_accept(log_prob, proposal, current, current_log_prob, ... |
# -*- coding: utf-8 -*-
import os
from collections import Counter
import numpy as np
import scipy.io.wavfile as wav
from python_speech_features import mfcc
from config import Config
def get_wavs_lables():
conf = Config()
wav_files, text_labels = do_get_wavs_lables(conf.get("FILE_DATA").wav_path,
... |
import numpy as np
import torch
import pytest
import scipy.stats as st
import scmodes
import scmodes.lra.vae
@pytest.fixture
def simulate():
np.random.seed(0)
l = np.random.normal(size=(100, 3))
f = np.random.normal(size=(3, 200))
eta = l.dot(f)
eta *= 5 / eta.max()
x = np.random.poisson(lam=np.exp(eta))
... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 14 09:54:37 2018
@author:<NAME>
Website: www.onkarmumbrekar.co.in
"""
import pandas as pd
from scipy.spatial.distance import pdist, squareform
from sklearn.model_selection import train_test_split
import numpy as np
import Prediction_model as pm
data_file = 'data.csv'
... |
from scipy.stats import multivariate_normal, beta
import numpy as np
def u2D(X, m1, v1, m2, v2, off):
"""
Synthetic thermal utility for 2D features
Multivariate Gaussian Distribution
Operating temp. and relative humidity
"""
mean_vec = np.array([m1, m2])
cov_mat = np.array([[v1, off],[off, ... |
import argparse
import os
import sys
import numpy as np
np.set_printoptions(threshold=sys.maxsize)
import PIL
from PIL import Image
from scipy.ndimage import label
from typing import Dict, List, Any
import pandas as pd
from tqdm import tqdm
def load_results(results_root: str, gt_class_dirs=('pos', 'neg')):
"""L... |
import logging
import math
import numpy as np
import scipy.stats as stats
from dash.exceptions import PreventUpdate
from dash.dependencies import Input, Output, State
from dash import html, dcc
from plotly.subplots import make_subplots
import plotly.graph_objects as go
from visdex.timing import timing
from visdex.ca... |
<gh_stars>0
"""
Last Updated: 08/12/2021
------------------------
Sang: Dissecting this code to understand the paper : https://pubs.acs.org/doi/pdf/10.1021/acs.jctc.1c00322
- How can I add this as part of the functionality of the MDNPPackage?
"""
#!/usr/bin/env python
import os
import numpy as np
import itertoo... |
<filename>scripts/icmecat_maker.py
'''
icmecat_maker.py
makes the ICMECATv2.0
Author: <NAME>, I<NAME>, Austria
twitter @chrisoutofspace, https://github.com/cmoestl/heliocats
last update March 2020
python > 3.7, install a conda environment to run this code, see https://github.com/cmoestl/heliocats
current status:
wo... |
import logging
import multiprocessing
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy as sp
import seaborn as sns
from sklearn import (
cross_validation, ensemble, grid_search, learning_curve, linear_model,
metrics, naive_bayes, pipeline, preprocessing)
from imblearn.metri... |
<filename>ModelEstimation/model_estimation.py
# Copyright <NAME>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# ... |
import numpy as np
from frm_modulations import linear_mod_list,linear_mod_const
from commpy.filters import rrcosfilter
from scipy.signal import upfirdn
import scipy
from commpy.filters import rrcosfilter
from functools import lru_cache
from scipy.signal import filtfilt, firwin,lfilter, welch
max_sps = 64
(t,ps) = rr... |
import unittest
import numpy as np
import mock
from activepipe import ActivePipeline
from corpus import Corpus
from featureforge.vectorizer import Vectorizer
from scipy.sparse import csr_matrix
from sklearn.preprocessing import normalize
testing_config = {
'features': Vectorizer([lambda x : x]),
'em_adding_i... |
# Setting up all folders we can import from by adding them to python path
import sys, os, pdb
curr_path = os.getcwd();
sys.path.append(curr_path+'/..');
# Importing stuff from all folders in python path
import numpy as np
from focusfun import *
# TESTING CODE FOR FOCUS_DATA Below
import scipy.io as sio
from scipy.sig... |
<filename>batch.py
#import scipy.io as sio
from hyper_parameters import *
from scipy import signal
import numpy as np
import csv
import random as rd
# Set the path to directory "data" containing .csv files
data_path = '../../data/'
'''Call this function in main to create train and test .csv files from heart... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.