text
string
<filename>data_augmentation.py<gh_stars>1-10 import cv2 import numpy as np from scipy import linalg import scipy.ndimage as ndi def transform_matrix_offset_center(matrix, x, y): o_x = float(x) / 2 + 0.5 o_y = float(y) / 2 + 0.5 offset_matrix = np.array([[1, 0, o_x], [0, 1, o_y], [0, 0, 1]]) reset_matr...
<gh_stars>0 ''' Post-process the output of the vibration-record recorder. ''' import matplotlib.pyplot as plt from matplotlib import dates import datetime import numpy import scipy.signal import pickle import os import os.path import sys INPUT_FILE = "" # to be filled def ReadFile(fn, DateTarget=None, DateR...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals import numpy as np import warnings import scipy.constants as const from monty.json import MSONable from pymatgen.analysis.structure_matcher import StructureMa...
""" Volatility processes for ARCH model estimation. All volatility processes must inherit from :class:`VolatilityProcess` and provide the same methods with the same inputs. """ from __future__ import annotations from abc import ABCMeta, abstractmethod import itertools import operator from typing import TYPE_CHECKING,...
#!/usr/bin/python3 # FLYCOP # Author: <NAME> # April 2018 # See SMAC documentation for more details about *wrapper_vX.py, wrapper_scenario_vX.txt and *wrapper_params_vX.pcs src='ecoliLongTerm_TemplateOptimizeConsortiumV0/' dst='ecoliLongTerm_TestTempV12' dirPlots='../smac-output/ecoliLongTerm_PlotsScenario12/' fitF...
<reponame>nschloe/pyamg<gh_stars>0 """Compatible Relaxation.""" from copy import deepcopy import numpy as np from scipy.linalg import norm from scipy.sparse import isspmatrix, spdiags, isspmatrix_csr from pyamg import amg_core from ..relaxation.relaxation import gauss_seidel, gauss_seidel_indexed def _CRsweep(A, B,...
<gh_stars>0 """ 偏微分一定要显示一个表达式,而不是直接一个函数名,这个看起来和数学里面用的不一样 或许应该直接写出来这个函数名形式的偏微分,而真正的表达式才让sympy来输出。 """ from sympy import * from common1 import plot_latex x, y, z = symbols('x_{1}^2 y z1') expr1 = exp(x*y*z) # r2 = latex(diff(expr1, x, evaluate=False)) r3 = latex(diff((x, y), x, evaluate=False)) # plot_latex(r3) fxy = ...
<gh_stars>0 # https://github.com/ManuelTS/augmentedFaceMeshIndices/blob/master/Nose.jpg import moviepy.editor as ed from tqdm import tqdm import mediapipe as mp import dlib import cv2 import os import numpy as np from scipy.spatial.transform import Rotation from matplotlib import pyplot as plt import json import face_a...
import numpy as np import matplotlib.pyplot as plt from scipy.spatial import Voronoi from shapely.geometry import Point, Polygon import itertools import voronoi_cut import random from deap import base from deap import creator from deap import tools results, pcb_outline = voronoi_cut.parse_file('ItemsList1.txt') loads...
<gh_stars>0 import numpy as np import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import tensorflow as tf from tensorflow import keras # tf.compat.v1.enable_eager_execution() physical_devices = tf.config.list_physical_devices('GPU') for device in physical_devices: tf.config.experimental.set_memory_growt...
<gh_stars>0 from matplotlib import colors from scipy import ndimage from astropy.wcs import WCS import matplotlib.patches as mpatches from matplotlib.pyplot import figure from astro_ghost.sourceCleaning import clean_dict from astropy.io import ascii from astropy.table import Table import requests from astropy import un...
<gh_stars>0 import argparse import io import h5py import numpy as np from os.path import join, dirname, basename, splitext, sep from scipy.spatial.transform import Rotation import scipy.io import cv2 import progressbar import zipfile from datasets.preprocessing import imdecode, rotation_conversion_from_hell,\ comp...
import math import time import matplotlib.pyplot import matplotlib.colors import matplotlib.cm import numpy import scipy.io import xlrd import xlwt time_start = time.time() image_origin = numpy.zeros([180, 512]) image_number = numpy.zeros([1024, 1024]) image_target = numpy.zeros([1024, 1024]) image_d...
<reponame>DEDZTBH/luojia1-cloud-detection<filename>core.py from PIL import Image import numpy as np import cv2 from scipy import ndimage import slidingwindow as sw from global_const import data_dir, R, C from multiprocessing import get_context # Helper functions def get_img(dirname): im = Image.open('{}{}/{}_g...
<reponame>adamoses/slab_fitter import pandas as pd import emcee import corner from astropy.constants import au,h,pc,c from slabspec import * from flux_calculator import * from slab_fitter import * from scipy.optimize import minimize import random import numpy as np def logposterior(theta, data, sigma, myrun,lognmin...
# Copyright 2019-2021 Cambridge Quantum Computing # # 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 a...
# -*- coding: utf-8 -*- """ Functions for constructing surface graphs """ import numpy as np import scipy.sparse as ssp def get_edges(faces): """ Gets set of edges defined by `faces` Parameters ---------- faces : (F, 3) array_like Set of indices creating triangular faces of a mesh R...
<gh_stars>0 import numpy as np import glob from scipy.misc import imread from skimage.io import imsave from skimage.transform import rotate import matplotlib.pyplot as plt import os from os.path import basename import glob import random from functions import transforms, raw_to_labels # This is a comment. Move along pe...
import os import scipy import numpy as np import tensorflow as tf from config import cfg def load_mnist(path, is_training): fd = open(os.path.join(cfg.dataset, 'train-images-idx3-ubyte')) loaded = np.fromfile(file=fd, dtype=np.uint8) trX = loaded[16:].reshape((60000, 28, 28, 1)).astype(np.float) fd =...
# -*- coding: utf-8 -*- if __name__ != '__main__': raise Exception("ran example file as non-main") import numpy as np import scipy.signal as sig from ssqueezepy import Wavelet, TestSignals from ssqueezepy.utils import window_resolution tsigs = TestSignals(N=2048) #%%# Viz signals #################################...
<reponame>kshitijd20/pyrsa #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Comparison methods for comparing two RDMs objects """ import numpy as np import scipy.stats from scipy.stats._stats import _kendall_dis from pyrsa.util.matrix import pairwise_contrast_sparse from pyrsa.util.rdm_utils import _get_n_from_reduce...
""" This module implements basic kinds of jobs for VASP runs. """ import logging import math import os import shutil import subprocess import numpy as np from monty.os.path import which from monty.serialization import dumpfn, loadfn from monty.shutil import decompress_dir from pymatgen.core.structure import Structure...
<reponame>ishatserka/MachineLearningAndDataAnalysisCoursera """ Trying to build a network with shared connections: >>> from random import random >>> n = buildSharedCrossedNetwork() Check if the parameters are the same: >>> (n.connections[n['a']][0].params == n.connections[n['a']][1].params).all()...
<filename>pylbm/generator/ast.py<gh_stars>0 # FIXME: make pylint happy ! #pylint: disable=all from sympy.core import Symbol, Expr, Tuple from sympy.core.sympify import _sympify, sympify from sympy.tensor import Idx, IndexedBase, Indexed from sympy.core.basic import Basic from sympy.core.relational import Relational fr...
""" Link edge points in an image to lists. Convert from matlab code, author is <NAME> Please see https://www.peterkovesi.com/matlabfns/ Copyright (c) 2018- <NAME> mingzilaochongtu at gmail com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation fi...
<gh_stars>0 ## plot a heatmap with the top 100 instance features across all SV types. import sys import numpy as np import matplotlib.pyplot as plt from sklearn.ensemble import RandomForestClassifier import random from scipy import stats from statsmodels.sandbox.stats.multicomp import multipletests import os import os...
<reponame>OttoJursch/DRL_robot_exploration<gh_stars>0 from copy import deepcopy from scipy import spatial from skimage import io from skimage.transform import resize from scipy import ndimage from random import shuffle import numpy as np import numpy.ma as ma import time import copy import sys import os import random i...
<reponame>daemonslayer/robond<gh_stars>1-10 # Copyright (c) 2017, Udacity # 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 of source code must retain the above copyright noti...
<gh_stars>1-10 import numpy as np from galpy.orbit import Orbit from galpy.potential import MWPotential2014 import astropy.units as u import matplotlib.pyplot as plt from joblib import Parallel, delayed from scipy.stats import gaussian_kde,rv_continuous from scipy.integrate import quad from scipy.interpolate import int...
import sys from mpi4py import MPI import numpy as np from scipy.interpolate import interp1d sys.path.append('/Users/bl/Dropbox/repos/Delight/') from delight.io import * from delight.utils import * from delight.photoz_gp import PhotozGP from delight.photoz_kernels import Photoz_mean_function, Photoz_kernel import scipy...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Fitting functions for use in The Cannon. """ from __future__ import (division, print_function, absolute_import, unicode_literals) __all__ = ["fit_spectrum", "fit_pixel_fixed_scatter", "fit_theta_by_linalg", "chi_sq", "L1Norm_variation"] i...
import argparse import pathlib import shutil import statistics import subprocess import time from os.path import join import constants from constants import RESULTS_DIR, DISTANCE_NORMS, CONSISTENT_DRAWS, NUM_THREADS, MODEL_TYPES, DISTANCE_NORM, \ NUM_ADV_CHECKS from datasets import get_epsilon from result import g...
import os import sys import matplotlib as plt import numpy as np import scipy.io as sio import scipy.misc import tensorflow as tf from matplotlib.pyplot import imshow from PIL import Image from scipy import io as sio OUTPUT_DIR = "output/" STYLE_IMAGE = "data/starry_night.jpg" CONTENT_IMAGE = "data/marilyn_monroe_in...
<reponame>jaisw7/shenfun<gh_stars>100-1000 import sympy as sp from mpi4py import MPI import pytest from shenfun import * comm = MPI.COMM_WORLD def test_lagrangian_particles(): N = (20, 20) F0 = FunctionSpace(N[0], 'F', dtype='D', domain=(0., 1.)) F1 = FunctionSpace(N[1], 'F', dtype='d', domain=(0., 1.)) ...
<reponame>AlexPereverzyev/ml import math import numpy as np from scipy import linalg from generative.gaussian import GaussianClassifier class LinearDescriminantClassifier(GaussianClassifier): """Classifier and data transformer based on linear descriminant analysis (Eigen method)""" def __init__(self, ...
<filename>datasets.py import os import urllib.request import numpy as np import torch import torch.utils.data from torchvision import datasets, transforms from torchvision.utils import save_image from torch.utils.data import Dataset, DataLoader, TensorDataset from scipy.io import loadmat num_workers = 4 lamb = 0.05 c...
from ..functions_on_data import iterable_data_array, data_array_builder import pandas as pd import numpy as np from scipy.optimize import curve_fit __all__ = ( "window", "fit_sine", "center_yaxis", "shift", "scale", "invert", "average_over_same_angle", ) def window(data_dict, key="Y", wi...
import os import time from datetime import datetime import numpy as np import numpy.random as npr import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import tensorflow as tf print(tf.__version__) from tensorflow.python.client import device_lib device_lib.list_local_devices() from tensorflow.contr...
<gh_stars>0 import os import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from GEN_Utils import FileHandling from pykalman import KalmanFilter from scipy.interpolate import UnivariateSpline from scipy.stats import ttest_1samp from loguru import logger logger.info('Import OK') ...
import math import colorsys import scipy import scipy.cluster import operator import math from PIL import Image import numpy as np import random WIDTH = 1700 HEIGHT = 540 def rgb_to_gray(r, g, b, a = None): return 0.299 * r + 0.587 * g + 0.114 * b def get_avg_gray(pix, x, y, radius, sample_size = 0.1): nsamp...
<reponame>readthedocs-assistant/glum import warnings from typing import Any, Dict, Optional, Union import numpy as np import pandas as pd import rpy2.robjects as ro import rpy2.robjects.numpy2ri as n2r from rpy2.robjects.packages import importr from scipy import sparse as sps from .util import benchmark_convergence_t...
<filename>se_resnext50/src/models/resnet_bam_wider.py # 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-...
import numpy as np import matplotlib.pyplot as plt from scipy import signal import matplotlib.cm as cm ## adaptado do curso do Schuster def model1(migi,nx,nz,ntime,dt,app,rick,dx,dz,c): data=np.zeros([nx,ntime]); nl=len(rick); data1=np.zeros([nx,nl+ntime-1]); for ixtrace in range(0,nx): istar...
<gh_stars>10-100 import numpy as np from scipy import fft import matplotlib.pylab as plt def make_fft(window, samplerate, df, every, iq_stream): result_of_fft = [] counting_until_every_reached = 0 adc_offset = -127 # bringing the signal per kernel down around the average reduces the dc peak at f=0hz...
# This file contains plots to show data from itertools import product import numpy as np import pandas as pd import seaborn as sns from matplotlib import pyplot as plt, rcParams from scipy import stats PALETTE = ['#59b5e3', '#1aa075'] def tandem_distplot( real_tandems_fn, count_sim_size_fn, family_name, show_pd...
<gh_stars>0 import argparse import os import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import scipy.io import numpy as np import importlib import time import networkx as nx from torch.autograd import Variable from pdb import set_trace as bp class EP_Env(object): de...
############################################################################################## # PURPOSE # Creates the multiple plots relating the Q_i parameter with the properties of the LCGs (oxygen abundances, sSFR and concentration) # # CREATED BY: # <NAME> # # ADAPTED BY: # # CALLING SEQUENCE # python Q_vs_...
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns from sklearn.pipeline import make_pipeline from sklearn.compose import ColumnTransformer from sklearn.pipeline import make_pipeline from sklearn.preprocessing import MinMaxScaler, StandardScaler from sklearn.impute import Simpl...
<filename>Scripts/lab2b/Main.py from aSurname2312 import * from aSurname241 import * from scipy.io import wavfile as wvf import numpy as np import matplotlib.pyplot as plt def plot2312(code, date): amp, strAmp = 2, '2' frq, strFrq = 1/11, '1/11' phs, strPhs = 0, '0' n, x = genSinusoid(amp, frq, phs, ...
<filename>gimmemotifs/plot.py # Copyright (c) 2009-2019 <NAME> <<EMAIL>> # # This module is free software. You can redistribute it and/or modify it under # the terms of the MIT License, see the file COPYING included with this # distribution. """ Various plotting functions """ from __future__ import print_function from ...
<filename>tutorials/Bayes_HT.py from math import pi, log, sqrt import numpy as np from scipy.optimize import minimize from scipy.stats import multivariate_normal as MVN def compute_A_re(freq_vec, tau_vec, flag='impedance'): omega_vec = 2.*pi*freq_vec N_freqs = freq_vec.size N_taus = tau_vec.size ...
<reponame>DNPLab/dnpLab<gh_stars>0 import numpy as np from scipy.special import wofz def voigtian(x, x0, sigma, gamma, integral=1.0): r"""Voigtian distribution. Lineshape given by a convolution of Gaussian and Lorentzian distributions. Args: x (array_like): input x x0 (float): center of distr...
<filename>pyatsa/tests/test_pyatsa.py import numpy as np import rasterio as rio from rasterio import fill import skimage as ski import matplotlib.pyplot as plt import glob import os from rasterio.plot import reshape_as_raster, reshape_as_image import json import scipy.stats as stats from scipy import io import statsmod...
# normal_cf_ds_classification_by_ufl_w_t_dis.py # 1. fix a_max a_conf S_jam for a driver; mix seq points and random points for initialization: failed # 2. fix S_jam for a driver; mix seq points and random points for initialization: still tried # 3. add temporal distance when calculating distance for assigning labels...
import os import sys import numpy as np import scipy.io import zipfile import types import PIL from PIL import Image, ImageOps import math import tensorflow as tf from tensorflow.contrib.learn.python.learn.datasets import mnist sys.path.append('/home/leminen/Documents/RoboWeedMaps/GAN/weed-gan-v1') import src.utils ...
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Wed Jul 31 13:41:32 2019 @author: s146959 """ # ========================================================================== # # ========================================================================== # from __future__ import absolute_import, with_statement, absolu...
<reponame>shilpiprd/sympy from sympy import I, log, apart, exp from sympy.core.symbol import Dummy from sympy.external import import_module from sympy.functions import arg, Abs from sympy.integrals.transforms import _fast_inverse_laplace from sympy.physics.control.lti import SISOLinearTimeInvariant from sympy.plotting....
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' import sys sys.path.append("./nets") sys.path.append("../") sys.path.append("/home/hanson/facetools/lib/FaceRecognition/method/tensorflow") sys.path.append("/h...
<filename>examples/Old Format/prob_not_solenoidal.py from __future__ import print_function from sympy import symbols,sin,cos,factor_terms,simplify from galgebra.printer import enhance_print from galgebra.deprecated import MV def main(): enhance_print() X = (x,y,z) = symbols('x y z') (ex,ey,ez,grad) = MV....
<gh_stars>10-100 import os import numpy as np import scipy.io as sio # import cv2 import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt from biosppy.signals import ecg from tqdm import tqdm ANO_RATIO=0 # add ANO_RATIO(e.g. 0.1%) anomalous to training data LEFT=140 RIGHT=180 DATA_DIR="./datase...
""" file: test_history.py """ from __future__ import print_function, division import unittest from collections import defaultdict from numpy import array, sqrt, pi, linspace, sin, cos, arange, median from scipy.special import fresnel from maxr.integrator import history def solution(time): """ Solution to sinu...
<reponame>greschd/NodeFinder #!/usr/bin/env python # -*- coding: utf-8 -*- # © 2017-2019, ETH Zurich, Institut für Theoretische Physik # Author: <NAME> <<EMAIL>> import json import math import cmath import numpy as np with open('data/fit.json', 'r') as f: FIT = json.load(f) def c00(k, a, j, m, o, q, **kwargs)...
import scipy.spatial import numpy as np class RWO(object): def __init__(self, d, threshold=0.45, bag=None, metric='euclidean'): if bag is not None and "data" in bag and len(bag["data"])>0: self.bag = np.array(self.bag["data"]) else: self.bag = None ...
# Question 04, Lab 04 # AB Satyaprakash - 180123062 # imports ---------------------------------------------------------------------------- from sympy.abc import t from sympy import evalf, integrate import matplotlib.pyplot as plt import numpy as np import pandas as pd # functions -------------------------------------...
<gh_stars>1-10 # Standard Python Imports import io import json import logging from math import floor from random import random import numpy as np from flask import Response, current_app, render_template, request, send_file # External modules imports from requests_toolbelt import MultipartEncoder # Dependencies used ...
<gh_stars>10-100 import numpy as np from scipy.integrate import quad def func1(tau, p0, p1, f): rv = np.exp(-tau) * np.cos(-p1 / p0 * tau) * f(tau / p0) return rv def func2(tau, p0, p1, f): rv = np.exp(-tau) * np.sin(-p1 / p0 * tau) * f(tau / p0) return rv def func(t): return np.exp(-t) p0 = 0.2...
#! /usr/bin/env python # -*- coding: utf-8 -*- # # Distributed under terms of the MIT license. import os import datetime import json import numpy as np from numpy.linalg import norm import math import argparse from platt import * from sklearn.metrics import f1_score import time import scipy.stats from ...
<gh_stars>10-100 # -*- coding: utf-8 -*- """ CALFEM Solver module *** EXPERIMENTAL *** """ import calfem.core as cfc import calfem.utils as cfu import logging as cflog import numpy as np from scipy.sparse import lil_matrix def error(msg): cflog.error(" calfem.solver: "+msg) def info(msg): cflog.info(" cal...
import math import numpy as np from scipy.optimize import least_squares from Resources.helpers import * class BaseMeasurement: ''' Base class for all measurements. Child classes need to implement the _measure method that takes a dictionary of landmark positions and returns a float value and a s...
<gh_stars>0 import re from scipy.spatial.distance import cdist from .pbc import pbc_diff from .checksum import checksum import numpy as np import scipy if scipy.version.version >= '0.17.0': from scipy.spatial import cKDTree as KDTree else: from scipy.spatial import KDTree from pygmx import TPXReader from pyg...
#-*- coding:utf-8 -*- import os, csv import numpy as np import scipy.cluster.hierarchy as sch from variables import APPS from variables import DISTANCE_BASE_PATH, DUPLICATES_REPORT_PATH from variables import CORPUS_PATH from variables import T_THRESHOLD from util_corpus import get_all_reports_id # ------------------...
<reponame>guanjue/imputed_cistrome_2022 import fire import pandas as pd import numpy as np from scipy.stats import gamma from scipy.stats import poisson def get_gammap(x, mostfreq): ### remove lower half used = (x>np.quantile(x,0.5)) x = x-mostfreq x[x<0] = 0 ### get gamma parameters scale = np.var(x[used])/np.m...
# Copyright 1999-2020 Alibaba Group Holding 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 a...
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import numpy as np from torch.optim.lr_scheduler import MultiStepLR import shutil import random from numpy import linalg as LA from scipy.stats import mode import collections import tqdm import os from architecture import * ...
<reponame>TSchlosser13/Hexnet '''**************************************************************************** * layers.py: Square and Hexagonal Layers for Use with Keras ****************************************************************************** * v0.1 - 01.03.2019 * * Copyright (c) 2019 <NAME> (<EMAIL>) * * ...
<reponame>JaviPardox/fk-trajectory-analysis # -*- coding: utf-8 -*- """ Created on Mon Dec 16 02:57:48 2019 @author: <NAME> https://www.linkedin.com/in/javier-pardo-fernandez-87b565124/ <EMAIL> """ import numpy as np import matplotlib.pyplot as plt import scipy.integrate as scp from scipy import opt...
<filename>hw3/unicycle_spline.py<gh_stars>1-10 import numpy as np from scipy.interpolate import CubicSpline import matplotlib.pyplot as plt from random import uniform def unicycle_spline(t0, tf, obs): #UNICYCLE_SPLINE returns a spline object representing a path from # (y(t0),z(t0)) = (0,0) to (y(t0),z(t0)) = (10,0...
<gh_stars>0 ''' Code for the following paper: <NAME>, <NAME>, <NAME>, ``Decentralized Multi-Agent Active Search for Sparse Signals", 2021 Conference On Uncertainty in Artificial Intelligence (UAI) (c) <NAME>(<EMAIL>), <NAME>(<EMAIL>) In this file, we are coding the RSI algorithm from reference: <NAME>., <NAME>., and...
<reponame>alon-albalak/XOR-COVID import logging import os import random from tqdm import tqdm import numpy as np import torch from datetime import date from torch.utils.data import DataLoader import json from transformers import AutoConfig, AutoTokenizer from models.bert_retriever import BERTEncoder from data_classes....
<reponame>calico/stimulated_emission_imaging import numpy as np try: from scipy.optimize import minimize except: minimize = None #Won't be able to use 'phase_fitting' in stack_registration try: import np_tif except: np_tif = None #Won't be able to use the 'debug' option of stack_registration def stack_...
import numpy as np import pandas as pd import xarray as xr from scipy.integrate import quad import scipy.interpolate as spi import pf_static_sph from scipy import interpolate from timeit import default_timer as timer import mpmath as mpm # ---- HELPER FUNCTIONS ---- def kcos_func(kgrid): # names = list(kgrid...
<gh_stars>10-100 """ @author: <NAME> """ # Code modified from https://github.com/maziarraissi/DeepHPMs written by <NAME> import matplotlib.pyplot as plt import scipy.io from scipy.interpolate import griddata from plotting import newfig, savefig import matplotlib.gridspec as gridspec from mpl_toolkits.axes_grid1 impor...
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved. """ Various classes to facilitate the code generation of structured control flow elements (e.g., ``for``, ``if``, ``while``) from state machines in SDFGs. SDFGs are state machines of dataflow graphs, where each node is a state and each edge...
# %% import os import sys # temporary solution for relative imports in case combo is not installed # if combo is installed, no need to use the following line sys.path.append( os.path.abspath(os.path.join(os.path.dirname("__file__"), '..'))) import time import numpy as np import scipy as sp from sklearn.preproces...
# Copyright (c) 2011, <NAME> [see LICENSE.txt] # This software is funded in part by NIH Grant P20 RR016454. """ Implementation of Gleason's (1999) non-iterative upper quantile studentized range approximation. According to Gleason this method should be more accurate than the AS190 FORTRAN algorithm of Lund and Lund (1...
<filename>scripts/ATL14_browse_plots.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jan 24 10:45:47 2020 @author: ben05 """ import numpy as np from scipy import stats import os, glob, sys from netCDF4 import Dataset import shutil import h5py #import pointCollection as pc #from PointDatabase.mapDa...
<reponame>falckt/raman # Author: <NAME> <<EMAIL>> # # License: BSD 3 clause # # SPDX-License-Identifier: BSD-3-Clause from typing import BinaryIO, Hashable, Mapping, Optional, Sequence, Union import collections import pathlib import xarray as xr import numpy as np from scipy import io as sio from . import _renisha...
import argparse import matplotlib.pyplot as plt import numpy as np import uproot from scipy import interpolate def mass(x): return x[:, 0] ** 2 - x[:, 1] ** 2 - x[:, 2] ** 2 - x[:, 3] ** 2 def get_histogram_function(file_name, branch): """get histogram function from root file in branch""" def fill_bou...
""" Tensorboard logger code referenced from: https://github.com/yunjey/pytorch-tutorial/blob/master/tutorials/04-utils/ Other helper functions: https://github.com/cs230-stanford/cs230-stanford.github.io """ import json import logging import os import shutil import torch from collections import OrderedDict import tens...
<reponame>ningtangla/segmentation-expt4 import scipy.stats as stats import pandas as pd import numpy as np import itertools as it import networkx as nx import math import cv2 import pygame import datetime import generateTreeWithPrior as generateTree import generatePartitionGivenTreeWithPrior as generatePartition clas...
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- """ """ from bokeh.plotting import figure from bokeh.models import ColumnDataSource from bokeh.models.widgets import Slider from bokeh.layouts import row, widgetbox from bokeh.io import curdoc from scipy.stats import beta import numpy as np def set_prior(a, b...
<reponame>tk5/maximum_power_info_ratchet<filename>src/noisy_analysis/propagators.py #!/usr/bin/env python3 #@author: jlucero #date created: Fri Mar 19 22:08:03 PDT 2021 # purpose: define propagators needed for analysis of noisy system from numpy import ( pi, exp, sqrt, sinh, sign, abs, logical_and, where, finfo, ...
"""Homegrown Neural Network Framework""" import sys import numpy as np from scipy.optimize import minimize, check_grad from scipy.special import expit as sigmoid class NeuralNet(object): """A multi-layer, feed-forward neural network.""" def __init__(self, *layers, lambda_=0.1, is_analog=False): """ ...
import argparse import unittest import numpy as np from scipy import stats import maintsim class ProductionTest(unittest.TestCase): ''' Test expected production volume according to Little's Law. ''' def test_production1(self): ''' Deterministic production volume of one machine. ...
from __future__ import absolute_import import torch import numpy as np import pandas as pd import scipy import copy from pysurvival import HAS_GPU from pysurvival import utils from pysurvival.utils import neural_networks as nn from pysurvival.utils import optimization as opt from pysurvival.models import BaseModel fro...
<filename>srgan/data_loader.py import scipy from glob import glob import numpy as np import matplotlib.pyplot as plt import posixpath class DataLoader(): def __init__(self, parent_dir, dataset_name, img_res=(128, 128)): self.dataset_name = dataset_name self.img_res = img_res self.parent_dir...
<reponame>DangerMouseB/coppertop # ******************************************************************************* # # Copyright (c) 2021 <NAME>. All rights reserved. # # ******************************************************************************* import scipy.linalg, numpy from coppertop.pipe import * from cop...
# Author: <NAME> <<EMAIL>> # # License: BSD 3 clause import numba import numpy as np import scipy.stats from sklearn.metrics import pairwise_distances _mock_identity = np.eye(2, dtype=np.float64) _mock_cost = 1.0 - _mock_identity _mock_ones = np.ones(2, dtype=np.float64) @numba.njit() def sign(a): if a < 0: ...
import os, sys, re, io, json, tempfile import subprocess import argparse import numpy as np import scipy.stats import pandas as pd import plotly import plotly.graph_objs as go import pymultiscale.anscombe import statsmodels.stats.multitest from logging import getLogger, Formatter, StreamHandler, FileHandler, DEBUG, INF...
from scipy import ndimage import numpy as np from nephelae.array import ScaledArray from .FactoryBorder import FactoryBorder from .MacroscopicFunctions import threshold_array class BorderRaw(FactoryBorder): def __init__(self, name, mapInterface): super().__init__(name, threshold=mapInterface.threshold) ...