text
string
<gh_stars>100-1000 from __future__ import division import numpy as np import scipy.sparse as ssp def top_k(values, k, exclude=[]): ''' Return the indices of the k items with the highest value in the list of values. Exclude the ids from the list "exclude". ''' # Put low similarity to viewed items to exclude them f...
import pandas as pd import numpy as np import itertools import os from scipy import interpolate from matplotlib import pyplot as plt import matplotlib.ticker as ticker from mpl_toolkits.mplot3d import Axes3D ''' Get directory ''' dir_config = '/home/hector/ros/ual_ws/src/upat_follower/config/' dir_data = '/home/hector...
#!/usr/bin/env python # -*- coding: utf8 -*- from __future__ import division, print_function from builtins import input import argparse import threading import sys from astropy.io import fits as pyfits from scipy import signal import numpy as np from .tools import io, version log = io.MyLogger(__name__) __autho...
import argparse import torch import torch.nn as nn import torchvision.transforms as transforms from PIL import Image import cv2 import datetime from model_final_mv3 import DABLNet import statistics as stat from visualize import get_color_pallete import os parse = argparse.ArgumentParser() parse.add_argument( '...
# Jack12 import os import pathlib from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter import numpy as np import torch from scipy import linalg from torch.nn.functional import adaptive_avg_pool2d from PIL import Image import pickle from .inception import InceptionV3 from .fid_score import calculate_...
<gh_stars>0 import numpy as np import meshio from gdist import compute_gdist as geo_dist from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D import open3d as o3d from scipy import sparse from scipy.stats import uniform #o3d.geometry.TriangleMesh.compute_vertex_normals # write mesh to obj def ...
<reponame>letaylor/limix # Copyright(c) 2014, The LIMIX developers (<NAME>, <NAME>, <NAME>) # #Licensed under the Apache License, Version 2.0 (the "License"); #you may not use this file except in compliance with the License. #You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #U...
<gh_stars>1-10 from glob import glob from os.path import dirname, join import os from scipy.misc import imread from masque.utils import read_landmarks import masque def interactive(fn): def wrapped(*args, **kwargs): if os.environ.get('INTERACTIVE'): return fn(*args, **kwargs) else: ...
#################################################################################################### # File: sp.py # Purpose: Signal processing tools (including spectrogram plotting). # # Author: <NAME> # # Location: Kent, 2021 #####################################################################################...
<reponame>jsleb333/hypergeometric_tail_inversion<filename>hypergeo/hypergeometric_distribution.py import numpy as np from scipy.special import comb, gammaln from scipy.stats import hypergeom import math import warnings warnings.filterwarnings('error') from hypergeo.utils import close_to, close_to_or_less_than def ...
<reponame>discardthree/PyQPECgen<gh_stars>1-10 # pylint: disable=E1101 # # qpecgen/helpers.py # # Copyright (c) 2016 <NAME> # # This software is released under the MIT License. # # http://opensource.org/licenses/mit-license.php # import scipy import scipy.linalg import numpy as np try: from numba import jit except...
<reponame>fjcasti1/src_PhD import glob,natsort import multiprocessing as mp import pandas as pd import sys,os from numpy import * from pylab import * from scipy.signal import blackman as blk NPROCS = 10 PLOT_THRESHOLD = 1e-25 LEGEND_THRESHOLD = 1e-30 titlesize = 18 legendfontsize = 12 labelsize = 20 labelpadx = 6 labe...
import pyaudio import math import scipy.io.wavfile import numpy as np class Player: def __init__(self, sr, buffer_size, input_op, all_output_operators): self.input_op = input_op self.all_output_operators = all_output_operators self.current_offset = 0 self.stream = None self...
<filename>hera_cal/vis_clean.py # -*- coding: utf-8 -*- # Copyright 2019 the HERA Project # Licensed under the MIT License import numpy as np from collections import OrderedDict as odict import datetime from uvtools import dspec import argparse from astropy import constants import copy import fnmatch from scipy import...
# Third-party import astropy.units as u from astropy.utils.misc import isiterable from astropy.constants import G import numpy as np # Project from .utils import format_doc __all__ = ['a_P_to_m', 'a_m_to_P', 'P_m_to_a', 'get_m2_min'] doc_a = """a : quantity_like [length] Semi-major axis. """ doc_P = """P ...
<filename>deprecated/Time-Series/dataset.py import torch from torch.utils.data import Dataset, DataLoader from torchvision import transforms, utils import cv2 from scipy import signal, stats import matplotlib from matplotlib import pyplot as plt from tqdm import tqdm # Displays a progress bar import pandas as pd impo...
<gh_stars>10-100 import os import numpy as np import matplotlib.pyplot as plt import scipy.integrate as integ '''All meshes are 2 dimensional. The first dimension is the membrane potential v, in whatever units you chose to deliver them. In order for these scripts to work you need to provide a two dimensional vector fi...
<reponame>n-longuetmarx/tbip """PyTorch implementation of the text-based ideal point model (TBIP). Let y_{dv} denote the counts of word v in document d. Let x_d refer to the ideal point of the author of document d. Then we model: theta, beta ~ Gamma(alpha, alpha) x, eta ~ N(0, 1) y_{dv} ~ Pois(sum_k theta_dk beta_kv...
<filename>src/benchmark.py import numpy as np import pandas as pd import os import subprocess import scipy.special from sklearn.metrics.cluster import adjusted_rand_score from sklearn.metrics.cluster import normalized_mutual_info_score from sklearn.metrics.cluster import silhouette_samples, silhouette_score from skle...
<filename>mlmodels/model_tf/misc/tf_nlp/Classification Comparison/NB-SVM/NB-SVM.py #!/usr/bin/env python # coding: utf-8 # In[1]: import re import numpy as np import sklearn.datasets from scipy import sparse from sklearn import metrics from sklearn.base import BaseEstimator, ClassifierMixin from sklearn.cross_valid...
<filename>data_recording_software/pulse_recorder.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Script for recording pulses of the DIY Particle Detector connected to an audio input. A live view of triggering pulses is provided via an oscilloscope plot if the pulse amplitude is larger than the threshold level. ...
<gh_stars>1-10 import torch import torchaudio import torchaudio.functional as F import torchaudio.transforms as T from torch import nn from torch.utils.data import Dataset, DataLoader import io import os import math import glob import tarfile import multiprocessing import scipy import librosa import librosa.display i...
import time, sys, cv2, json from datetime import date from datetime import datetime from detection import detection import numpy as np import scipy.spatial.distance as scipydist from munkres import Munkres from tracks import track from simulation import SimulationEngine #initalize tracking strikelimit = 6 threshold =...
<reponame>wutobias/collection #!/usr/bin/env python ''' ################################################################# # # # mapconv.py is written by <NAME> and comes # # with no warrenty. This python-script can do different # # opera...
<reponame>Spacebody/MCM-ICM-2018-Problem-C #! usr/bin/python3 import pandas as pd import re import numpy as np import os import sys from collections import OrderedDict, defaultdict import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns from scipy import stats, integrate from exp_es_data import ...
from jax import lax import numpy as np from scipy.integrate import solve_ivp from sklearn.preprocessing import StandardScaler from .utils import generate_diff_kernels __all__ = ["generate_dataset"] def generate_dataset(dt=1e-2, tmax=None, num_visible=2, num_der=2, raw_sol=False): if tmax is None: tmax =...
#!/usr/bin/env python from __future__ import print_function from __future__ import absolute_import from __future__ import division from builtins import next from builtins import hex from builtins import str from builtins import zip from builtins import range from builtins import object # standard lib import glob impor...
<filename>drlhp/utils.py import queue import random import socket import time import gym import numpy as np import pyglet import pdb import sys from drlhp.deprecated.a2c.common.atari_wrappers import wrap_deepmind from drlhp.deprecated.a2c.common.misc_util import set_global_seeds from drlhp.deprecated.a2c.common.vec_e...
""" Unit Testing for LaTeX Parser """ # Author: <NAME> # Email: ksible *at* outlook *dot* com # pylint: disable=import-error,protected-access # import sys; sys.path.append('..') from latex_parser import Tensor, OverrideWarning from latex_parser import Parser, parse_expr, parse from sympy import Function, Symbol, Matr...
<gh_stars>10-100 """ .. Copyright (c) 2014-2017, Magni developers. All rights reserved. See LICENSE.rst for further information. Module providing fast linear operations wrapped in matrix emulators. Routine listings ---------------- get_DCT(shape, overcomplete_shape=None) Get the DCT fast operation dic...
<gh_stars>0 # Karoo GP Base Class # Define the methods and global variables used by Karoo GP # by <NAME>, MSc; see LICENSE.md # Thanks to <NAME> and <NAME> for support during 2014-15 devel; TensorFlow support provided by <NAME> # version 2.1.2 ''' A NOTE TO THE NEWBIE, EXPERT, AND BRAVE Even if you are highly experien...
''' Created on Jan 4, 2017 @author: safdar ''' import numpy as np import scipy.misc as smp import cv2 # Create a 1024x1024x3 array of 8 bit unsigned integers data = np.zeros( (1024,1024,3), dtype=np.uint8 ) data[512,512] = [254,0,0] # Makes the middle pixel red data[512,513] = [0,0,255] # Makes the next ...
from pyrep import PyRep from pyrep.objects import VisionSensor from pyrep.const import Verbosity import multiprocessing as mp import os from pathlib import Path from collections import defaultdict from custom_shapes import TapShape, ButtonShape, LeverShape, Kuka import numpy as np from contextlib import contextmanager ...
from utils.utils import change_ds_transform, get_label_dist, get_random_idx, get_unique_counts, timer from sampler.ranking import get_items_idx_of_min_segment, get_norm_subset_idx from utils.log import Log import torch from torch.utils.data import Dataset, Subset from modeling.feature_extractor import FeatureExtractor ...
<filename>devito/passes/clusters/blocking.py from sympy import sympify from devito.ir.clusters import Queue from devito.ir.support import (AFFINE, PARALLEL, PARALLEL_IF_ATOMIC, PARALLEL_IF_PVT, SEQUENTIAL, SKEWABLE, TILABLE, Interval, IntervalGroup, Iterati...
"""Author: J.H.Cao Computational Biology group Biomedical Engineering Eindhoven University of Technology""" import pandas as pd import numpy as np import matplotlib.pyplot as plt from kf_filter_seird import kf_filtering_seird, plot_seirdmodel, seird_model_test from estimating_compmod_params import read_data, ...
<filename>imputer.py<gh_stars>0 import itertools import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from scipy.sparse import csgraph class Imputer(nn.Module): """Impute missing data based on type.""" def __init__(self, impute_type, n_nodes, n_dim, seq_len=12, ...
<reponame>phunc20/dsp import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, triang, blackmanharris import sys, os, functools, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import sineModel as SM import stft as STFT import util...
<reponame>ZendriXXX/predict-python import statistics from collections import defaultdict, OrderedDict from pm4py.objects.log.log import EventLog TIMESTAMP_CLASSIFIER = "time:timestamp" NAME_CLASSIFIER = "concept:name" def events_by_date(log: EventLog) -> OrderedDict: """Creates dict of events by date ordered by...
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2016 <NAME> and <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 l...
<reponame>LinXueyuanStdio/MyTransE import math import random import pickle from time import sleep import numpy as np import sys from scipy import spatial # lang = sys.argv[1] # w = float(sys.argv[2]) lang = 'fr_en' # w = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9] # # w = [0.1, 0.2, 0.5, 0.7, 0.75, 0.8, 0.85, 0....
""" Dissimilarity measures for clustering """ import numpy as np def matching_dissim(a, b, **_): """Simple matching dissimilarity function""" return np.sum(a != b, axis=1) def jaccard_dissim_binary(a, b, **__): """Jaccard dissimilarity function for binary encoded variables""" if ((a == 0) | (a == 1...
import numpy as np import numpy.random as rnd from scipy import stats rng = rnd.default_rng(0) x = np.ones([30, 50]) mu, sigma = 0, 1 mu_biased, sigma_biased = 0.5, 1 noise = rng.normal(mu, sigma, x.shape) print(noise) bias_bits = np.array([0, 5, 10, 15, 20, 25]) n, n_trials = x.shape for i in range(len(bias_bits...
<gh_stars>0 """ convenience.py Define constant mappings and lookup tables and other simple shortcuts """ import re import os import pickle import pandas as pd import numpy as np from statistics import StatisticsError from scipy.stats import tmean, tstd from pygest.rawdata import miscellaneous # A list of the data f...
<filename>server/enums/trim_size.py from enum import Enum from fractions import Fraction class TrimSize(Enum): """ A simple enum class representing the different trim sizes """ THIRD = Fraction(1, 3) HALF = Fraction(1, 2)
<gh_stars>1-10 import torch import time import matplotlib.pyplot as plt import scipy as sp sp_version = sp.__version__.split('.') if (int(sp_version[0]) >= 1) and (int(sp_version[1]) >= 3): from imageio import imread else: from scipy.misc import imread from lib_stereo import compute_terms class MRFParams(): def...
# import the necessary packages from scipy.spatial import distance as dist from imutils.video import VideoStream from imutils import face_utils from threading import Thread import numpy as np import imutils import time import dlib import cv2 #initializing dlib's shape_predictor_68_face_landmarks.dat and then create th...
<reponame>bgallag6/specFit # -*- coding: utf-8 -*- """ Created on Tue Dec 20 22:30:43 2016 @author: <NAME> Usage: python paramPlot.py --processed_dir DIR [--save_fig [True]|False] """ import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.axes_grid1 import make_axes_locatable from scipy.stats import ...
## Python class for estimates of Shapley population variable importance ## compute estimates and confidence intervals, do hypothesis testing ## import required libraries import numpy as np from scipy.stats import norm from .predictiveness_measures import cv_predictiveness, compute_ic from .spvim_ic import shapley_infl...
<filename>src/plot_geo.py import numpy as np import matplotlib.pyplot as plt import seaborn as sns from scipy.spatial import voronoi_plot_2d DEFAULT_GEO_ARGS = { 'lng_bound': (121.44, 121.64), 'lat_bound': (24.95, 25.15), 'lng_granularity': 0.02, 'lat_granularity': 0.02, } DEFAULT_PLOT_ARGS = { 'a...
#!/usr/bin/python """This is a short description. Replace this with a more detailed description of what this file contains. """ import json import time import pickle import sys import csv import argparse import os import os.path as osp import shutil import numpy as np import matplotlib.pyplot as plt from PIL import ...
import numpy as np import scipy.misc import tensorflow as tf from keras.layers import Input, Dense from keras.models import Model import NeuralNet """ This script loads mnist data, then trains a simple autoencoder using first NeuralNet.py (using Numpy as back end), then using Keras with TensorFlow as back end as ben...
import argparse import pandas as pd import rdkit import scipy from rdkit import Chem from sklearn.metrics import mean_absolute_error, mean_squared_error def add_args(parser): parser.add_argument( "--prediction", type=str, required=True, help="The path to prediction result to be ev...
<reponame>bio-ontology-research-group/deeppheno<filename>mp_evaluate.py<gh_stars>1-10 #!/usr/bin/env python import numpy as np import pandas as pd import click as ck from sklearn.metrics import classification_report from sklearn.metrics.pairwise import cosine_similarity import sys from collections import deque import ...
<gh_stars>1-10 __copyright__ = """ Copyright (C) 2020 <NAME> Copyright (C) 2020 <NAME> """ __license__ = """ 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 ...
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/00_io.ipynb (unless otherwise specified). __all__ = ['dicom_dataframe', 'get_plane', 'is_axial', 'is_sagittal', 'is_coronal', 'is_fat_suppressed', 'load_mat', 'load_h5'] # Cell from fastscript import call_parse, Param, bool_arg from scipy import ndimage impo...
# allows to import own functions import sys import os import re root_project = re.findall(r'(^\S*TFM)', os.getcwd())[0] sys.path.append(root_project) from sklearn.pipeline import Pipeline from sklearn.impute import SimpleImputer from src.utils.help_func import get_model_data from sklearn.feature_selection import RFECV...
import random from math import inf from matplotlib import pyplot as plt from statistics import median REPRODUCTION_AGE = (15,60) PARTNER_AGE_DEVIATION = 15 REPRODUCTION_BREAK = 10 MAX_BABIES = inf SIM_STEPS = 10000 SIM_BLOBS = 1000 death_rate = lambda age: 10/1000 step = 0 id = 0 def roundTo(n, num): # Smal...
#!/usr/bin/env python # this script: # 1) outputs each TE insertion call into new files based on family # 2) collapses TEs of same famly within 50 base pairs of one another # 3) outputs all the unqiue TE positions to a new file # 4) calculates the coverage for each sample at each insertion postion +/- 25 base pairs # 5...
from __future__ import division import matplotlib.pyplot as plt from scipy.interpolate import interp1d import numpy as np from numpy import linalg import sympy def ajuste(X,Y): #Ordem da matriz ordem = n[0]+1 A = np.zeros((ordem,ordem)) for i in range(ordem): for j in range(ordem): ...
<reponame>Xiaoming94/TIFX05-MScThesis-HenryYang import utils import ANN as ann import keras.losses as klosses import matplotlib.pyplot as plt import numpy as np from scipy.stats import entropy import gc ensemble_size = 100 chunksize = 20 trials = 5 network_model2 = ''' { "input_shape" : [28,28,1], "layers" :...
<reponame>zsyOAOA/VIRNet<filename>demo_test_denoising_real.py<gh_stars>1-10 #!/usr/bin/env python # -*- coding:utf-8 -*- # Power by <NAME> 2019-05-16 16:20:01 import torch import numpy as np from utils import imshow from skimage import img_as_float from scipy.io import loadmat from networks.VIRNet import VIRNetU prin...
<reponame>tracijo32/lensing ''' lensing.py author: <NAME> date: 3/17/2016 Library of useful lensing functions ''' import numpy as np from astropy.cosmology import FlatLambdaCDM from scipy import interpolate def dlsds(zl,zs,Om0=0.3,H0=70): # computes the lensing ratio for a lens redshift and source redshift # ...
import os.path import os.path as osp import sys sys.path.append(osp.dirname(osp.dirname(osp.abspath(__file__)))) import numpy as np from scipy import stats from sklearn.metrics import average_precision_score from sklearn.metrics import roc_auc_score from . import anom_utils def eval_ood_measure(conf, pred, seg_label...
<reponame>charlesblakemore/opt_lev_analysis import numpy as np import bead_util as bu import matplotlib.pyplot as plt import os import scipy.signal as sig import scipy import glob from scipy.optimize import curve_fit data_dir1 = "/data/20180529/imaging_tests/p0/xprofile" def spatial_bin(xvec, yvec, bin_size = .13): ...
<filename>apps/chisquare.py from typing import ClassVar import streamlit as st import pandas as pd import scipy as sp import numpy as np from plotnine import * def app(): # title of the app st.markdown("Chi-Square") t_choice = st.sidebar.radio("Chi-Square Test",["Chi-Square Test","Goodness of Fit"]) ...
from sympy.solvers import solve from sympy import symbols x, y = symbols('x, y') result = solve(x**3 - y, x) print(result)
import sys, os from io import BytesIO import sympy from PIL import Image, ImageOps, ImageChops rootdir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) srcdir = os.path.join(rootdir, 'src') sys.path.insert(0, srcdir) latexsources = [] import fitfunctions for name in fitfunctions.__all__: cls = geta...
# Copyright 2016 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Jun 6 14:40:17 2020 @author: lukepinkel """ import numpy as np import scipy as sp def fo_fc_fd(f, x, eps=None, args=()): if eps is None: eps = (np.finfo(float).eps)**(1.0/3.0) n = len(np.asarray(x)) g, h = np.zeros(n), np.zeros(n)...
<reponame>cagrell/HAL # Optimization functions # ADD TO /Utils/Optimize.. from scipy import random from scipy.optimize import minimize from .div import scale_to_bounds def gopt_min(fun, bounds, n_warmup = 1000, n_local = 10): """ Global optimization (minimization) based on: 1. Sampling 'n_warmup' uni...
import numpy as np from scipy import signal import matplotlib.pyplot as plt import matplotlib.cm as cm from pyatac.tracks import InsertionTrack #import pyximport; pyximport.install(setup_args={"include_dirs":np.get_include()}) from pyatac.fragments import makeFragmentMat class ChunkMat2D: """Class that stores frag...
""" @author: MatteoRaso """ from math import pi, sqrt from random import uniform from statistics import mean from typing import Callable def pi_estimator(iterations: int): """ An implementation of the Monte Carlo method used to find pi. 1. Draw a 2x2 square centred at (0,0). 2. Inscribe a circle withi...
<reponame>grst/diffxpy import abc try: import anndata except ImportError: anndata = None import batchglm.api as glm import logging import numpy as np import patsy import pandas as pd from random import sample import scipy.sparse from typing import Union, Dict, Tuple, List, Set from .utils import split_x, dmat_...
<gh_stars>0 import copy from collections import namedtuple from fractions import gcd Position = namedtuple("Position", "x y z") Velocity = namedtuple("Velocity", "x y z") X = 0 Y = 1 Z = 2 POS = 1 VEL = 2 x_states = set([]) y_states = set([]) z_states = set([]) states = [x_states, y_states, z_states] def lcm(a, ...
import argparse from typing import Dict, Iterator, Tuple, Union from typing import * from asapp.ml_common.embedders import FastTextEmbedder from asapp.ml_common.embedders import IndexBatchEmbedder, WordBatchEmbedder from asapp.ml_common.interfaces import Embedder, Preprocessor from tqdm import tqdm, trange impor...
# -*- coding: utf-8 -*- """ Speaker Stuff Calculator main module. hosted on "github.com/kbasaran/Speaker-Stuff-Calculator" """ import os import sys import numpy as np import pandas as pd from scipy import signal from dataclasses import dataclass import pickle from PySide2.QtCore import SIGNAL, SLOT, QObject, Qt # Qt i...
<filename>VOE.py<gh_stars>1-10 import numpy as np import SimpleITK as sitk import itk import SimpleITK as sitk import pandas as pd import quandl, math import numpy as np from sklearn import preprocessing, svm from sklearn.model_selection._validation import cross_validate from sklearn.linear_model import LinearRegres...
# python3 # 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 agreed to in...
import os import argparse import random from statistics import mean import xml.etree.ElementTree as ET random.seed(42) # # config # parser = argparse.ArgumentParser() parser.add_argument('--train-dir', action='store', dest='train_dir', help='train directory location', required=True) ...
<reponame>ablavatski/draw from __future__ import print_function, division import logging import theano import theano.tensor as T import cPickle as pickle import numpy as np import scipy as sc from PIL import Image, ImageDraw from svhn import SVHN from fuel.streams import DataStream from fuel.schemes import SequentialS...
<gh_stars>0 import math import logging from itertools import product import mahotas as mt import numpy as np from scipy import linalg from skimage.feature.texture import greycomatrix from skimage.util.shape import view_as_windows from enum import Enum, IntEnum logger = logging.getLogger('collageradiomics') def _svd_d...
<reponame>nsabine/openshift-batch-demo<gh_stars>1-10 #!/usr/bin/env python import numpy as np import scipy.special as spc import scipy.fftpack as sff import scipy.stats as sst def sumi(x): return 2 * x - 1 def su(x, y): return x + y def sus(x): return (x - 0.5) ** 2 def sq(x): return int(x) ** 2 def logo(x): return x...
from flask import current_app as app from .product import Product import io import matplotlib.pyplot as plt from scipy import stats import base64 class ProductReview: def __init__(self, reviewer_id, rating, review, product_id, seller_id, time_posted, upvotes, reports): self.reviewer_id = reviewer_id ...
<filename>cgp/functions/mathematics.py import numpy as np import scipy.stats from cgp.functions.support import is_scalar from cgp.functions.support import is_np from cgp.functions.support import min_dim FUNCTIONS = [] FUNCTION_NAMES = [] def add(x, y, p): if is_np(x) and is_np(y): new_dim = min_dim(x, y...
import time import numpy as np from scipy.sparse import csr_matrix from scipy.sparse.csgraph import connected_components import pandas as pd from rdkit import Chem from . import chem class BlockMoleculeData: def __init__(self): self.blockidxs = [] # indexes of every block self.blocks = [] ...
import linvpy as lp import mestimator_marta as marta import generate_random as gen import numpy as np import matplotlib.pyplot as plt import optimal as opt from scipy.sparse.linalg import lsmr import toolboxutilities as util import toolboxinverse as inv import copy import random gen.gen_noise(2,3) #genA, geny = g...
<reponame>ohannuks/lenstronomy<gh_stars>0 import numpy as np import lenstronomy.Util.util as util import lenstronomy.Util.image_util as image_util from scipy.optimize import minimize from lenstronomy.LensModel.Solver.epl_shear_solver import solve_lenseq_pemd from lenstronomy.LensModel.Solver.lens_equation_solver import...
<filename>scripts/matcher.py import pickle import numpy as np import scipy import torch from scipy import spatial import operator from auto_encoder.lstm_network import AutoLSTM from configs.config import get_config from tools.utils import extract_video_features class Matcher(object): def __init__(self): self.c...
import matplotlib.pyplot as plt import numpy as np import math from PIL import Image from scipy import misc def greyAvg(image): gray = np.zeros((image.shape[0], image.shape[1]), dtype= np.float) gray = (image[...,0]+image[...,1]+image[...,2])/3 return gray def luminanceGrey(image): gray = np.zeros((im...
<filename>propnet/core/models.py """ Module containing classes and methods for Model functionality in propnet code. """ import os import re import logging from abc import ABC, abstractmethod from itertools import chain import six from monty.serialization import loadfn from monty.json import MSONable, MontyDecoder imp...
# -*- coding: utf-8 -*- # Copyright (C) 2016-2017 by <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # All rights reserved. BSD 3-clause License. # This file is part of the SPORCO package. Details of the copyright # and user license can be found in the 'LICENSE.txt' file distributed # with the package. ...
<gh_stars>0 import numpy as np import scipy as sp from quaternion import from_rotation_matrix, quaternion from rlbench.environment import Environment from rlbench.action_modes import ArmActionMode, ActionMode from rlbench.observation_config import ObservationConfig from rlbench.tasks import * from pyrep.const import ...
import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn import linear_model from matplotlib.pyplot import figure from scipy import stats def homoscedasticity_test(X, y, threshold = 0.05): """This function recieves a linear regression model and outputs a scatter plot figure of residu...
<filename>python/testing/covariance_test.py # Copyright(c) 2014, The LIMIX developers (<NAME>, <NAME>, <NAME>) # #Licensed under the Apache License, Version 2.0 (the "License"); #you may not use this file except in compliance with the License. #You may obtain a copy of the License at # # http://www.apache.org/licens...
import numpy as NP import scipy as sp import scipy.linalg as LA import numpy.linalg as nla import os import sys import glob sys.path.append("./../../pyplink") from fastlmm.pyplink.plink import * from pysnptools.util.pheno import * from fastlmm.util.mingrid import * #import pdb import scipy.stats as ST import fastlmm.ut...
<gh_stars>0 # Authors: # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD 3 clause """ Module for LBM boundary conditions """ import collections import logging import types import numpy as np from sympy import symbols, IndexedBase, Idx, Eq from .storage import Array log = logging.getLogger(__name__) #py...
<reponame>galizia-lab/pyview<filename>log2list_examples/log2settings_VTK2021_old_for_reference.py # -*- coding: utf-8 -*- """ Program to read Till vision .log files and write .settings.csv files the program works like this (not all implemented yet): - set flag settings that are default values - read .log files and par...
# ======================================================================== # # # Copyright (c) 2017 - 2020 scVAE authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apac...
<reponame>PeterChenYijie/MachineLearningZeroToALL<gh_stars>1-10 #-*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt import scipy.io as spio from scipy import optimize from matplotlib.font_manager import FontProperties font = FontProperties(fname=r"c:\windows\fonts\simsun.ttc", size=14) # 解决wind...