text
string
<filename>AnalysisCurlDemo/testdemo.py # coding: utf-8 import xlrd import matplotlib.pyplot as plt import numpy as np from scipy.interpolate import spline def readDataFromExcelFile(fileName, start, end): workbook = xlrd.open_workbook(fileName) sheetNames = workbook.sheet_names() sheetName = sheetNames[0] ...
# -*- coding: utf-8 -*- """Main module.""" ### Libraries ### import pandas as pd from datetime import datetime import croissance from croissance import process_curve from croissance.estimation.outliers import remove_outliers import re import os import matplotlib.pyplot as plt import matplotlib import numpy as np from...
<filename>scripts/score_links4.py #!/usr/bin/env python3 # # Copyright 2015 Dovetail Genomics LLC # # from __future__ import print_function from builtins import str from builtins import map import sys import networkx as nx import chicago_edge_scores as ces import numpy as np from scipy.stats import poisson import mat...
import argparse import json import os from typing import List import nltk import numpy as np import pandas as pd import spacy from allennlp.data.tokenizers.word_splitter import SpacyWordSplitter from scipy import sparse from sklearn.feature_extraction.text import CountVectorizer from spacy.tokenizer import Tokenizer f...
# This file is part of the pyMOR project (https://www.pymor.org). # Copyright pyMOR developers and contributors. All rights reserved. # License: BSD 2-Clause License (https://opensource.org/licenses/BSD-2-Clause) import os import tempfile import numpy as np import pytest import scipy.io as spio import scipy.sparse as...
<filename>supervised_learning/test_attention.py<gh_stars>0 import argparse # Data Loading from tensorflow.python.keras import Model from tensorflow.keras.backend import squeeze from global_utils import read_sample import numpy as np import matplotlib.pyplot as plt from supervised_learning.config import * import rand...
<filename>krysztalki/workDir/tests/test matrices/test_matrices_like_hex_m6_00z.py import matrices_new_extended as mne import numpy as np import sympy as sp from equality_check import Point x, y, z = sp.symbols("x y z") Point.base_point = np.array([x, y, z, 1]) class Test_Axis_hex_m6_00z: def test_matrix_hex_m6_...
<filename>basis_sparsity.py import numpy as np import spams from scipy.spatial import distance from scipy.stats import spearmanr, entropy from union_of_transforms import double_sparse_nmf,smaf import sys THREADS = 5 MAX_BASIS = 1000 MIN_BASIS = 10 ERROR_THRESH = 0.005 MIN_FIT = 0.90 if __name__ == "__main__": inpath...
<filename>rating.py #!/usr/bin/env python3 # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is...
<reponame>callumparr/TALON-paper-2020<gh_stars>1-10 import pandas as pd import scipy.stats as stats import argparse def get_args(): parser = argparse.ArgumentParser() parser.add_argument('-sim_files', dest='sim_files', help='Comma-separated list of simulated fasta header files') parser.add_argument('-sim_name', d...
<filename>paperII/abundace_evolution.py from galaxy_analysis.plot.plot_styles import * import numpy as np import matplotlib.pyplot as plt import deepdish as dd import h5py, glob, sys from galaxy_analysis.utilities import utilities from galaxy_analysis.analysis import Galaxy from mpl_toolkits.axes_grid1 import make_a...
from collections import namedtuple import cv2 import numpy as np import pandas as pd from collections import defaultdict import math from scipy import ndimage from torch.utils.data import Dataset import skimage.color import skimage.io from tqdm import tqdm import utils import glob import pickle import enum import s...
<gh_stars>10-100 # Copyright (c) Microsoft Corporation # Copyright (c) <NAME> Laboratory # All rights reserved. # # MIT 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 restric...
import numpy as np from numpy.testing import run_module_suite from skimage import filter, data, color from skimage import img_as_uint, img_as_ubyte class TestTvDenoise(): def test_tv_denoise_2d(self): """ Apply the TV denoising algorithm on the lena image provided by scipy """ ...
<gh_stars>10-100 import unittest import tempfile import shutil from unittest import mock import numpy as np import scipy.stats import torch from torch.utils.data import Subset import model import dataset import trainer class TestTrainer(unittest.TestCase): def setUp(self): seed = 42 torch.manual...
<gh_stars>0 from estimation import least_squares as least_squares_estimation from estimation import weighted_least_squares as weighted_least_squares_estimation from registration import apply_tensor_trf from scalars import ( axial_diffusivity, fractional_anisotropy, mean_diffusivity, radial_diffusivity) from st...
<gh_stars>0 from __future__ import division import torch from torch import nn import torch.nn.functional as F from tool.torch_utils import * from tool.yolo_layer import YoloLayer from tool.utils import load_class_names, plot_boxes_cv2 from tool.torch_utils import do_detect import pathlib from fnmatch import fnmatch imp...
<reponame>lime-lang/lime<gh_stars>1-10 from error import RuntimeError import fractions class AST: pass class BinaryOperation(AST): def __init__(self, left, operation, right): self.left = left self.token = operation self.operation = operation self.right = right class Equalit...
from numpy import * from scipy.constants import c import scipy.stats as stats from numpy.linalg import lstsq, norm from matplotlib.pyplot import * from matplotlib.mlab import find from least_squares_linear import * from least_squares_non_linear import * #Assignment 09,2 as a test (GPS) def gn(x, F, J, tol=1e-6, maxi...
from types import ModuleType from scipy.sparse import csr_matrix, csc_matrix import numpy as np from scanpy._utils import descend_classes_and_funcs, check_nonnegative_integers from anndata.tests.helpers import assert_equal, asarray import pytest def test_descend_classes_and_funcs(): # create module hierarchy ...
# Original filename: dewarp.py # # Author: <NAME> # Email: <EMAIL> # Date: March 2011 # # Summary: Dewarp, recenter, and rotate an image. # import re import pyfits as pyf import scipy.ndimage import time import warnings def distortion_interp_flux(flux, y, x): flux[:, :] = scipy.ndimage.map_coordinates(flux,...
<filename>python/sklearn/sklearn/neighbors/classification.py """Nearest Neighbor Classification""" # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # Sparseness support by <NAME> <<EMAIL>> # # License: BSD, (C) INRIA, University of Amsterdam import numpy as np from scipy im...
# -*- coding: utf-8 -*- from scipy.spatial.distance import cdist from torchvision import transforms from market1501 import Market1501 from __init__ import DEVICE, cmc, mean_ap, creat_test_data_set_loader from pyrmaid import Pyramid, load_ckpt import os import torch from torch import nn, optim import numpy as np import ...
""" This program provides various functions to correct data or to to process data. All of these functions have been translated from the 'Data Proccessing' section of the manual. Many values are interpretations and are bound to be incorrrect. Please read through the manual to modify these functions based on your needs....
import pandas as pd import numpy as np import datetime as dt import dateutil from retention import utils import logging from scipy import stats from scipy.optimize import minimize from scipy.special import beta logger = logging.getLogger(__name__) class ShiftedBetaGeom(): """ Implementation of shifted-beta-geomet...
<gh_stars>1-10 import gpflow from gpflow import Parameter import tensorflow as tf import scipy from scipy import sparse import networkx as nx from . import utils from . import kernels def get_adj_matrix(graph): element = list(graph.nodes())[0] if nx.is_weighted(graph): return sparse.csr_matrix(nx.l...
import numpy as np from tqdm import tqdm import scipy.io as sio import os import pkg_resources # cosmology assumption from astropy.cosmology import FlatLambdaCDM cosmo = FlatLambdaCDM(H0=70, Om0=0.3) from .priors import * from .gp_sfh import * import fsps mocksp = fsps.StellarPopulation(compute_vega_mags=False, zcon...
<filename>evaluation/niqe.py from __future__ import division """ Video Quality Metrics Copyright (c) 2015 <NAME> <<EMAIL>> 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 Lic...
import pdb import numpy as np from collections import defaultdict #from sklearn.cross_validation import KFold from sklearn.model_selection import KFold from sklearn.metrics import precision_recall_curve, roc_curve, accuracy_score from sklearn.metrics import auc from scipy import sparse import scipy.io as sio ...
# -*- coding: utf-8 -*- """ pytest @author: chris Test values against references. """ import os import sys import pytest import numpy as np from numpy.testing import assert_allclose from scipy.io import loadmat import spaudiopy as spa current_file_dir = os.path.dirname(__file__) sys.path.insert(0, os.path.abspath(...
# LVDSim.py """ A suite of tools for running LotkaVolterraSND simulations.""" # from LotkaVolterraND import LotkaVolterraND from eugene.src.virtual_sys.LotkaVolterraND import LotkaVolterraND from eugene.src.virtual_sys.LotkaVolterraSND import LotkaVolterraSND from eugene.src.virtual_sys.LotkaVolterra2OND import Lotka...
import numpy as np from numba import jit import math from turbofats.Base import Base from scipy.optimize import minimize, minimize_scalar @jit(nopython=True) def iar_phi_kalman_numba(x, t, y, yerr, standarized): n = len(y) Sighat = np.float(1.0) if not standarized: Sighat = np.var(y) * Sighat ...
import numpy as np from math import cos, sin, pi import math import cv2 from scipy.spatial import Delaunay def softmax(x): x -= np.max(x,axis=1, keepdims=True) a = np.exp(x) b = np.sum(np.exp(x), axis=1, keepdims=True) return a/b def draw_axis(img, yaw, pitch, roll, tdx=None, tdy=None, size = 100): ...
<reponame>YasmeenVH/growspace mport gym import numpy as np from scipy.spatial import distance import os import cv2 #env = gym.make("GrowSpaceEnv-Images-v0") from itertools import chain from scripts.save_img_movie import save_file_movie_oracle, filter, natural_keys #from growspace.envs.growspaceenv import GrowSpaceEnv ...
<gh_stars>0 import math import numpy as np import scipy.misc import PIL.Image import sys import csv import matplotlib as mpl mpl.use('WebAgg') import matplotlib.pyplot as plt import matplotlib.axes as pltax # from functools import reduce # plt.ion() # plt.close('all') # plt.show() N = int(sys.argv[1]) amin = (float('...
<gh_stars>1-10 from libs.effects.effect import Effect # pylint: disable=E0611, E0401 from scipy.ndimage.filters import gaussian_filter1d import numpy as np import random class EffectTwinkle(Effect): def __init__(self, device): # Call the constructor of the base class. super().__init__(device) ...
<filename>becpy/physics/hartree_fock.py<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- # # Create: 12-2018 - <NAME> <carmelo> <<EMAIL>> """Module docstring """ import matplotlib.pyplot as plt import sys import numpy as np from uncertainties import unumpy as unp from scipy.integrate import cumtrapz, quad fro...
<reponame>TahaEntezari/ramstk # pylint: skip-file # type: ignore # -*- coding: utf-8 -*- # # tests.analyses.statistics.exponential_unit_test.py is part of The RAMSTK Project # # All rights reserved. # Copyright since 2007 Doyle "weibullguy" Rowland doyle.rowland <AT> reliaqual <DOT> com """Test class for the Expo...
<filename>src/aleatoire/io.py<gh_stars>0 import json import numpy as np import scipy.stats import scipy.special from scipy.special import gamma as gamma_func def _weibull_mean(shape,scale): r""" \mathrm{E}(X)=\lambda \Gamma\left(1+\frac{1}{k}\right) """ return scale*gamma_func(1+1/shape) def _weibull_...
<gh_stars>0 import os import subprocess import warnings from datetime import datetime from functools import partial import numpy as np import pop_tools import scipy.sparse as sps import xarray as xr regrid_dir = f"{os.environ['TMPDIR']}/regridding" os.makedirs(regrid_dir, exist_ok=True) class grid(object): """g...
<reponame>EgorOrachyov/MachineLearning import numpy as np import scipy.sparse as ss a = np.zeros((5,1)) b = np.zeros((5,2)) print(a.transpose().dot(b)) print(a.transpose() + 1) a[1][0] = 10 b[1][0] = 2 b[1][1] = 4 aa = ss.csc_matrix(a) bb = ss.csc_matrix(b) cc = aa.multiply(bb) print(np.asarray([[1,1]])) print(b ...
# -*- coding: utf-8 -*- # Copyright 2021 Huawei Technologies Co., Ltd # # 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 app...
<reponame>hvanwyk/atomic_data_uncertainties #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Apr 21 11:09:08 2021 @author: loch """ import numpy as np import sys import matplotlib.pyplot as plt import emcee import corner import scipy.stats as stats import math from recombination_methods import State...
<reponame>iTitus/factorio_balancers import random from fractions import Fraction from factorio_balancers.graph import Splitter, Belt from factorio_balancers import Balancer from tests.test_blueprint import TestBase def random_priority(allow_off=False): choices = [Splitter.Priority.left.value, Splitter.Priority....
<filename>ion_functions/data/prs_functions.py #!/usr/bin/env python """ @package ion_functions.data.prs_functions @file ion_functions/data/prs_functions.py @author <NAME>, <NAME> @brief Module containing calculations related to instruments in the Seafloor Pressure family. """ import pkg_resources import numexpr as ...
<reponame>Avanish14/smartModem<filename>sciKitScript.py import scipy, pickle import numpy as np from scipy import stats from scipy import signal import pytest pytest.importorskip('sklearn') from sklearn import svm def setup(fileName): Xd = pickle.load(open(fileName, 'rb')) snrs, mods = map(lambda j: sorted(list(set(...
# SPDX-FileCopyrightText: Copyright 2021, <NAME> <<EMAIL>> # SPDX-License-Identifier: BSD-3-Clause # SPDX-FileType: SOURCE # # This program is free software: you can redistribute it and/or modify it # under the terms of the license found in the LICENSE.txt file in the root # directory of this source tree. # ======= #...
# Copyright 2017 <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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
from os.path import join, isdir, exists from os import listdir, mkdir from shutil import rmtree import gc from copy import deepcopy import pandas as pd import numpy as np from scipy.ndimage import binary_erosion import matplotlib.pyplot as plt from matplotlib.path import Path from collections import Counter from ..vis...
#!/usr/bin/env python3 import argparse import h5py import pandas as pd import numpy as np from ogb.graphproppred import DglGraphPropPredDataset #from ogb.graphproppred.mol_encoder import AtomEncoder, BondEncoder from scipy import sparse as sp from rdkit.Chem import MolFromSmiles def read_smiles(): smiles = pd.read_...
<filename>algorithms/HC/hc.py import gym import sys sys.path.insert(0, '../../benchmarking') from model_tester import TesterAgent import numpy as np import scipy.ndimage as snd from PIL import Image def rgb_to_gray(img): return img[:, :, 0] * 0.299 + img[:, :, 1] * 0.587 + img[:, :, 2] * 0.114 def detect_edge(img...
from bs4 import BeautifulSoup import re from os import listdir from os.path import isfile, join import numpy as np from scipy.optimize import curve_fit # Initialise some arrays for analyses later exam_difficulties = [] master_questions_arr = [] # Allow user to choose which folder to ultimately extract conv...
<reponame>Anirban166/tstl<gh_stars>10-100 import sys import sut import random import inspect import time import scipy def traceLOC(frame,event,arg): global lastLOCs,lastFuncs,verbose if event != "call": return traceLOC co = frame.f_code n = co.co_name if (n, co.co_filename) in lastFuncs: ...
<filename>src/forward_term.py #!/usr/bin/env python import numpy as np import pandas as pd import scipy.stats from scipy.linalg import cholesky from scipy.linalg import sqrtm from pars import Inp_Pars from fit_simpars import Fit_Simpars from forward_rates import Forward_Rates class Forward_Term(object): """ ...
<gh_stars>1-10 import os import numpy as np import scipy from data_structures import * if 'jobfile.py' in os.listdir(): from jobfile import * from read_vec_file import * import yaml def check_str_bool(s): return s in ['True' ,'true', '1', 't', 'y','YES' ,'Yes','yes', 'yeah','Yeah', 'yup', 'certainly', 'uh-huh...
#!/usr/bin/env python # coding: utf-8 import argparse parser = argparse.ArgumentParser('Vox2Vox training and validation script', add_help=False) ## training parameters parser.add_argument('-g', '--gpu', default=0, type=int, help='GPU position') parser.add_argument('-nc', '--num_classes', default=4, type=int, help='n...
from collections import defaultdict import math import numpy import re from scipy.stats import norm from scipy.optimize import curve_fit from fitting import gaussian from wrappers import samtools def calculate_bias_distribution(_iter, ref_fn, output): ''' For an iterable, create a histogram of s...
<reponame>DLarisa/FMI-Materials-BachelorDegree<filename>Calcul Numeric (CN)/Teme/Tema 4/ex 1 + 2.py import numpy as np import sympy as sym from math import e def f1(x): return e ** x def CuadraturaNewton(func, a, b,): """ Calculeaza Formula de cuadratura Newton pentru o diviziune de n = 3 sub...
import cv2 import scipy.io as sio import os from centerface import CenterFace # 顔認識器の設定 landmarks = True centerface = CenterFace(landmarks=landmarks) # 編集ファイルを開く path_r = '/home/babaamata/workspace/Cat-faces-dataset/dataset-part3/' # カウント変数 image_count = 0 face_count = 0 files = os.listdir(path_r) for file in files...
import math import numpy as np import matplotlib.pyplot as plt from scipy.optimize import minimize from scipy.stats import norm from scipy.special import comb def process_data(D,M_os): ''' Function to generate the data in the format convenient for optimization procedure ''' # Number of elemnts ...
<reponame>chbrown/topic-sentiment-authorship<filename>tsa/science/numpy_ext.py import time import scipy import numpy as np def _type_raise(prototype_array, force_dtype=None): ''' For integer inputs, the default is float64; for floating point inputs, it is the same as the input dtype. ''' if force_...
<reponame>mdd423/wobble_jax<filename>jabble/plottings.py import numpy as np import matplotlib; #matplotlib.use("Agg") import matplotlib.pyplot as plt import astropy.table as at import jax.numpy as jnp import pickle import model as wobble_model import dataset as wobble_data import scipy.constants as const import...
<reponame>JulianPL/Non-Rectangular_Convolution #!/usr/bin/python3 from fractions import Fraction import unittest import nrconv import sympy class TestEdgeCase(unittest.TestCase): def test_non_rectangular_convolution_edge_diagonal1(self): list1 = [1, 1, 1, 1, 1, 1, 1, 1] list2 = [1, 1, 1, 1, 1,...
import logging import warnings import numpy as np from scipy.sparse.linalg import lsqr from scipy.signal import filtfilt from pylops import Diagonal, Identity, Transpose from pylops.signalprocessing import FFT, Fredholm1 from pylops.utils import dottest as Dottest from pylops.optimization.solver import cgls from pylo...
import numpy as np from scipy.optimize import fminbound from scipy.special import expit from girth.utilities import (validate_estimation_options, get_true_false_counts, create_beta_LUT, INVALID_RESPONSE) from girth.utilities.utils import _get_quadrature_points from girth.unidimensional.dichotomous.partial_inte...
#Multivariate kernel density estimate using a normal kernel import numpy as np from scipy.linalg import expm #KDE multivariate def p_mkde_M(x,X,h): X = np.asmatrix(X) x = np.asmatrix(x) N,d = X.shape X = X.T x = x.T Sxy = np.cov(X) invS = np.linalg.inv(Sxy) detS...
<filename>multi_agents/metrics/plot_data.py import json import os import statistics import numpy as np import scipy.stats as st import plotly.graph_objects as go from multi_agents import config BASE_DIR = "/home/matias/Desktop/HFO/matias_hfo/models/4vs5/metrics/tese" RESULT_FILE_PATH = os.path.join(BASE_DIR, "{teamm...
<gh_stars>0 #!/usr/bin/env python # coding: utf-8 # <center> # <h1><b>Lab 3</b></h1> # <h1>PHYS 580 - Computational Physics</h1> # <h2>Prof<NAME></h2> # </br> # <h3><b><NAME></b></h3> # <h4>https://www.github.com/ethank5149</h4> # <h4><EMAIL></h4> # </br> # </br> # <h3><b>September 17, 2020</b></h3> # </center> # ###...
<filename>ihna/kozhukhov/imageanalysis/gui/mapfilterdlg/basicwindow.py<gh_stars>0 # -*- coding: utf-8 import numpy as np from scipy.stats import linregress import wx from ihna.kozhukhov.imageanalysis.tracereading import TraceReader from ihna.kozhukhov.imageanalysis.accumulators import MapFilter from ihna.kozhukhov.ima...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This file is part of series of experiments trying to reproduce the results in quantum chemistry using quantum computing. Contributions, corrections and clarifications welcome! Author : <NAME> Copyright : Copyright 2019 - <NAME> License : MIT Ver...
""" """ import sys, os, argparse, logging,random sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from utils.io_parameters import read_and_set_parameters from utils.io_trajectories import read_and_filter from utils.io_trajectories import partition_train_test from utils.manip_trajectori...
<gh_stars>1-10 from __future__ import division from __future__ import print_function import argparse import time import numpy as np import scipy.sparse as sp import torch from torch import optim import warnings import os from model import GCNModelVAE from optimizer import loss_function from utils impo...
# Copyright (c) <NAME>. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory. # The gbea TopTrump benchmark is a carefully designed real world benchmark. # Both its single objective and multi-objective fitness functions reflect the requirements of # a real world To...
## Imports import numpy as np import statsmodels import seaborn as sns from matplotlib import pyplot as plt import pandas as pd import pystan from sklearn.kernel_ridge import KernelRidge import os import xlrd os.chdir('C:\\Users\\lakshd5\\Dropbox\\Heteroscedasticity\\Final Data') import statsmodels import r...
<reponame>siboles/pyCellAnalyst from __future__ import print_function from __future__ import division from builtins import zip from builtins import map from builtins import str from builtins import range from past.utils import old_div import febio import pickle import subprocess import os import tkinter.filedialog impo...
<filename>pydy/viz/camera.py from sympy.matrices.expressions import Identity from .visualization_frame import VisualizationFrame __all__ = ['PerspectiveCamera', 'OrthoGraphicCamera'] class PerspectiveCamera(VisualizationFrame): """ Creates a Perspective Camera for visualization. The camera is inherited f...
# Copyright (c) 2020 <NAME> import os os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" import sparsechem as sc import scipy.io import scipy.sparse import numpy as np import pandas as pd import torch import argparse import os import sys import os.path import time import json import functools import csv #from apex import amp...
<reponame>johnbachman/bayessb from texttable import Texttable import TableFactory as tf from inspect import ismodule from bayessb.multichain import MCMCSet import cPickle import inspect import scipy.cluster.hierarchy from matplotlib import pyplot as plt from matplotlib import cm from matplotlib.figure import Figure fro...
import os import pandas as pd import anndata as ad import scipy.sparse import numpy as np def load(data_dir, sample_fn, **kwargs): fn = [ os.path.join(data_dir, f"GSE114374_Human_{sample_fn}_expression_matrix.txt.gz"), os.path.join(data_dir, f"{sample_fn.lower()}_meta_data_stromal_with_donor.txt")...
""" Numerical integration of the SIR disease model """ import numpy as np import matplotlib.pyplot as plt from scipy.integrate import odeint # right hand side of the equation def compute_SIR_rhs(y, t, N, beta, gamma): S, I, R = y dSdt = - beta * I * S / N # number of uninfected people dIdt = beta * I * S ...
<filename>gpflux/architectures/constant_input_dim_deep_gp.py # # Copyright (c) 2021 The GPflux Contributors. # # 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/lice...
#!/usr/bin/env python # encoding: utf-8 from __future__ import division, print_function from collections import defaultdict import numpy as np import pandas as pd from sympy.parsing.mathematica import mathematica try: from tqdm import tqdm except ImportError: tqdm = lambda iterator: iterator def parse_ct...
<gh_stars>1-10 import cv2 import numpy as np import pylab from keras.models import Sequential from keras.layers import Dense from keras.models import model_from_json import skimage from skimage import io import matplotlib.pyplot as plt from skimage import transform from skimage.morphology import skeletonize_3d import ...
<gh_stars>0 #!/usr/bin/env python __author__ = "<NAME>" __copyright__ = "Copyright 2014, The Materials Project" __version__ = "1.0" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" __status__ = "Development" __date__ = "Aug 22, 2016" import os import csv from math import log import numpy as np from scipy import integ...
<filename>predictor.py<gh_stars>1-10 """CNN for predicting activity of a guide sequence: classification and regression. """ import argparse from collections import defaultdict import gzip import os import pickle import fnn import parse_data import numpy as np import scipy import sklearn import sklearn.metrics import...
import pandas as pd import matplotlib.pyplot as plt import numpy as np import random as r from sklearn.model_selection import train_test_split from sklearn.svm import SVR from sklearn.model_selection import KFold from sklearn.decomposition import PCA import csv from sklearn.metrics import mean_squared_error, m...
from copy import deepcopy from keras import Sequential, activations, initializers, regularizers, constraints from keras.engine import Layer from keras.layers import Dense, Conv2D, Flatten from keras.datasets import mnist import numpy as np import tensorflow as tf import keras from scipy.linalg import block_diag from s...
import os import numpy as np import tensorflow as tf import shutil, sys from datetime import datetime import h5py from xsleepnet import XSleepNet from xsleepnet_config import Config from sklearn.metrics import f1_score from sklearn.metrics import accuracy_score from sklearn.metrics import cohen_kappa_score from dat...
<reponame>chriskirchner/RoboND-Kinematics from sympy import * from time import time from mpmath import radians import tf ''' Format of test case is [ [[EE position],[EE orientation as quaternions]],[WC location],[joint angles]] You can generate additional test cases by setting up your kuka project and running `$ rosla...
<reponame>BYUCamachoLab/autogator # -*- coding: utf-8 -*- # # Copyright © Autogator Project Contributors # Licensed under the terms of the MIT License # (see autogator/__init__.py for details) import os os.environ['PATH'] = "C:\\Program Files\\ThorLabs\\Kinesis" + ";" + os.environ['PATH'] import atexit import math fr...
<gh_stars>1-10 #Python program for continuous and discrete sine wave plot import numpy as np import scipy as sy from matplotlib import pyplot as plt t = np.arange(0,1,0.01) #frequency = 2 Hz f = 2 #Amplitude of sine wave = 1 PI = 22/7 a = np.sin(2*PI*2*t) #Plot a continuous sine wave fig, axs = plt.subplot...
<filename>inpainting/model/coords6d.py import numpy as np import scipy import scipy.spatial # calculate dihedral angles defined by 4 sets of points def get_dihedrals(a, b, c, d): b0 = -1.0*(b - a) b1 = c - b b2 = d - c b1 /= np.linalg.norm(b1, axis=-1)[:,None] v = b0 - np.sum(b0*b1, axis=-1)[:,N...
from utils.audio_feature_cluster import * import pandas as pd import numpy as np from tqdm import tqdm import scipy.sparse as sp from utils.definitions import ROOT_DIR from utils.datareader import Datareader """ This file is used to generate the hybrid icm for cat8 and cat10. """ import sys arg = sys.argv[1:] #arg ...
# Copyright 2021 Huawei Technologies Co., Ltd # # 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...
import pydicom #for loading dicom import SimpleITK as sitk #for loading mhd/raw import os import numpy as np import scipy.ndimage #DICOM: send path to any *.dcm file where containing dir has the other slices (dcm files), or path to the dir itself #MHD/RAW: send path to the *.mhd file where containing die has the coori...
"""Cosmological merger rates of gravitational-wave sources and detection rates. Usage: See results_class.py and plot_collated_detection_rate.py for how the detection rates and calculated and the plots are created. License: BSD 3-Clause License Copyright (c) 2022, <NAME>. All rights reserved except fo...
"""Refactor file directories, save/rename images and partition the train/val/test set, in order to support the unified dataset interface. """ from __future__ import print_function import sys sys.path.insert(0, '.') from zipfile import ZipFile import os.path as osp import sys import h5py from scipy.misc import imsav...
""" imsize map_coordinates fourier_shift 50 0.016211 0.00944495 84 0.0397182 0.0161059 118 0.077543 0.0443089 153 0.132948 0.058187 187 0.191808 0.0953341 221 0.276543 0....
# init # from scipy import io as sio import matplotlib import numpy as np import os,sys import matplotlib.pyplot as plt from scipy import io as sio import h5py from PIL import Image # load data # data = sio.loadmat('/home/enhaog/GANCS/srez/dataset_MRI/image_phantom_array.mat') filename='/home/enhaog/GANCS/srez/dataset_...
import sys import numpy as np import SimpleITK as sitk from skimage import filters, measure from scipy.stats import truncnorm, uniform import random from math import pi from .utils import get_study_uid, one_hot_encode class Compose(object): def __init__(self, transformers): self.transformers = transform...