text
string
#!/usr/bin/python # -*- coding: utf-8 -*- """ Implement the explicit finite difference method to calculate the price of various options @author: ucaiado Created on 07/03/2016 """ # import libraries import matplotlib.pylab as plt import math import numpy as np import pandas as pd from scipy import stats import seabor...
#!/usr/bin/python import numpy as np import random import rospy from rbpf_mtt.msg import GMMPoses, ObjectMeasurement #from rbpf_mtt.rbpf_filter import RBPFMTTFilter from geometry_msgs.msg import Pose, PoseArray, PoseStamped, PoseWithCovariance, PoseWithCovarianceStamped from visualization_msgs.msg import Marker, Marke...
<reponame>jgoodknight/spectroscopy<gh_stars>1-10 # -*- coding: utf-8 -*- #Gone through for release 10 Feb 2017 import copy import time import matplotlib.pyplot as plt import scipy.integrate try: from matplotlib import animation except: animation = object() #allows this to still run on clusters without the anim...
import numpy as np import pylab as plt from scipy.special import hankel1 from born_rime.fourier import fourier, ifft_freqs, inv_fourier def _get_dx(X, i): i0 = [0] * len(X.shape) i0[i] = 0 i1 = [0] * len(X.shape) i1[i] = 1 return X[tuple(i1)] - X[tuple(i0)] def two_dim_g(k0, X, Y): r = np.sqr...
''' This module contains analysis for a growing network. ''' import numpy as np import scipy.optimize as sco import scipy.stats as scs import matplotlib as mat import matplotlib.pylab as plt import matplotlib.cm as cm from graph import Graph import logbin as lb font = {'size' : 20} mat.rc('font', **font...
<gh_stars>1-10 #!/usr/bin/env python2 # -*- coding: utf-8 -*- # %% [markdown] # # Process the raw mooring data # # Contents: # * <a href=#raw>Raw data reprocessing.</a> # * <a href=#corrected>Interpolated data processing.</a> # * <a href=#ADCP>ADCP processing.</a> # * <a href=#VMP>VMP processing.</a> # # Import the nee...
import json import numpy as np import scipy.io.wavfile as wf with open('../ml_data/12.json', 'r') as f: freqs = json.loads(f.read()) tones = [ ('G5', 1.5), ('A5', 0.5), ('G5', 1.5), ('E5', 0.5), ('D5', 0.5), ('E5', 0.25), ('D5', 0.25), ('C5', 0.5), ('A4', 0.5), ('C5', 0.75)] ...
# TEST ON BATCH GRADIENT DESCENT ALGORITHM # <NAME>, July 2020 import batch_gradient_descent import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy import stats import os def get_data(): # Lets try to import our own dataset (otherwise create a default one) try: # Current fo...
import os import random import numpy as np import scipy.io as sio from tensorflow.keras.utils import to_categorical def load_data(dataset_dir, subject_n=32, img_size=(8, 9, 8), number_of_inputs=1, features_type='multi', num_classes=2, frames_per_subject=4800, seed=7): img_rows, img_cols, num_chan ...
<reponame>l-modolo/midr #!/usr/bin/python3 """Compute the Irreproducible Discovery Rate (IDR) from NarrowPeaks files This section of the project provides facilitites to handle NarrowPeaks files and compute IDR on the choosen value in the NarrowPeaks columns """ from scipy.stats import rankdata def benjamini_hochbe...
<gh_stars>1000+ import copy import sys if sys.version_info < (3,): range = xrange import numpy as np import pandas as pd import scipy.stats as ss from .. import families as fam from .. import tsm as tsm from .. import data_check as dc from .kalman import * class LLT(tsm.TSM): """ Inherits time series method...
from time import time import numpy as np from scipy import ndimage as ndi from skimage import color, filters, morphology from sklearn.cluster import dbscan def intensity_func(img_slice): norm_gray = np.array(rgb2gray(img_slice / 255.0)) scaled_gray = norm_gray * 255.0 scaled_gray.astype("uint8") retu...
<reponame>youbaji/outlier import numpy as np import networkx as nx from scipy.spatial import KDTree #import pdb # # # implement algorithms in "Outlier Dection Using k-Nearest Neighbour Graph" # # class KnnGraph(object): def __init__(self, k): self.k = k def fit(self, x): tree = KDTree(x) ...
<reponame>jna29/SymGP<gh_stars>1-10 import sys # Add the symgp folder path to the sys.path list module_path = r'/Users/jaduol/Documents/Uni (original)/Part II/IIB/MEng Project/' if module_path not in sys.path: sys.path.append(module_path) from symgp import SuperMatSymbol, utils, MVG, Variable, SuperDiagMat, Kernel...
#!/usr/bin/env python # -*- coding: utf-8 -*- import pytest import dask_image.ndinterp as da_ndinterp import numpy as np import dask.array as da from scipy import ndimage def validate_rotate(n=2, axes=(0,1), reshape=False, input_output...
""" Module for the feature map class :References: - <NAME>, <NAME>, <NAME>, <NAME>. Kernel-based Active Subspaces with application to CFD problems using Discontinuous Galerkin Method. 2020. arxiv: https://arxiv.org/abs/2008.12083 """ from functools import partial import numpy as np from scipy.o...
<gh_stars>0 """ 2015-2016 <NAME> <EMAIL> """ import numpy as np import scipy as sp from scipy import linalg, sparse from scipy.sparse import coo_matrix, csr_matrix, csc_matrix, lil_matrix def csvd(a, r=None): if r is None or r > min(a.shape): r = min(a.shape) u, s, v = np.linalg.svd(a, full_matrice...
<reponame>dhfbk/ai4eu-competences from transformers import AutoTokenizer, AutoModel import torch from sklearn.metrics.pairwise import cosine_similarity import tqdm import time import argparse import pandas as pd import fasttext import scipy.spatial import json from http.server import BaseHTTPRequestHandler, HTTPServer...
<filename>main_node/repeater/acceptable_error_based.py from math import exp, sqrt from core_entities.configuration import Configuration from core_entities.experiment import Experiment from repeater.repeater import Repeater from scipy.stats import t class AcceptableErrorBasedType(Repeater): """ Repeats ea...
import functions as f import numpy as np import cv2 from scipy import ndimage as ndi #all the video names and the zstack ranges vidnames = ["040417E10_5_VH5_Het_pos1_tiffseries","04082016_VH5_Het_E10_5_pos2_tiffseries","13012017_E10_5_VH5Het_pos5_tiffseries","16122016_VH5Het_E10_5_pos5_tiffseries","26072016_VH5_Het_E1...
<filename>pysymoro/robot.py # -*- coding: utf-8 -*- # This file is part of the OpenSYMORO project. Please see # https://github.com/symoro/symoro/blob/master/LICENCE for the licence. """ This module of SYMORO package provides description of the robot parametrizaion container and symbol replacer class. """ import r...
<gh_stars>0 """ Functions used for distorting images for training """ # Import the necessary libraries import numpy as np import torch from scipy.ndimage.filters import gaussian_filter from PIL import Image # Import the necessary source codes from Preprocessing.utils import dct_2d from Preprocessing.utils import...
<gh_stars>10-100 import json import os import argparse import scipy.stats as stats import numpy as np import pandas as pd import torch import random import sys import matplotlib.pyplot as plt import torch import torch.nn as nn import time import torch.utils.data as data from sklearn.model_selection import StratifiedK...
<reponame>y-jeong/RET-SLR<filename>src/1DNPSLR.py<gh_stars>0 # For each given array geometry, this program calculates the extinction cross section, differential scattering cross section (partially driven array), or multi donor-multi acceptor resonance energy transfer (RET) rate import numpy as np import matplotlib.pyp...
#!/usr/bin/env python3 import numpy as np import scipy.interpolate import math import bdsim import unittest import numpy.testing as nt class BlockTest(unittest.TestCase): pass class BlockDiagramTest(unittest.TestCase): pass class WiringTest(unittest.TestCase): def test_connect_1(self): bd = ...
<filename>app/main.py import math from tkinter import * from tkinter import messagebox, filedialog from tkinter.font import Font from tkinter.ttk import Progressbar import geopandas as gpd import numpy as np import shapefile from descartes import PolygonPatch from geopandas import GeoDataFrame, points_from_xy from matp...
import argparse import json import logging import os import os.path as osp import random import sys import time from collections import Counter from collections import defaultdict from collections import namedtuple import cvxpy as cp import matplotlib.pyplot as plt import numpy as np import torch from scipy.sparse imp...
<gh_stars>100-1000 import pdb import cv2 import torch import torch.nn.functional as F import numpy as np import scipy from scipy.spatial.distance import cdist import lap from cython_bbox import bbox_overlaps as bbox_ious from core.motion import kalman_filter import time def merge_matches(m1, m2, shape): ...
<gh_stars>0 #!/usr/bin/env python # coding: utf-8 # In[ ]: #!/usr/bin/env python # coding: utf-8 # In[ ]: #!/usr/bin/env python # coding: utf-8 # In[ ]: #Requirements from __future__ import division from __future__ import print_function from operator import itemgetter from itertools import combinations from IP...
<filename>napari_plugin_test/widgets/data_preprocessing.py #!/usr/bin/env python3 # coding: utf-8 import numpy as np from magicgui import magic_factory, widgets from scipy import ndimage from napari.types import ImageData @magic_factory def make_data_preprocessing( viewer: "napari.viewer.Viewer", input: ImageD...
try: import alpaca_trade_api except: print("!pip install PyYAML==5.4.1 --ignore-installed") print("!pip install alpaca_trade_api") try: import stldecompose except: print("!pip install scipy==1.2.1") print("!pip install statsmodels==0.10.2") print("!pip install stldecompose==0.0.5") try: ...
from joblib import Parallel, delayed from numba import jit import numpy as np import openturns as ot from anastruct.fem.system import SystemElements, Vertex from scipy.interpolate import CubicSpline N = ot.Normal(2, 1) pts_normal_reversed = np.arange(2, 0, -1*(2/50)) pts_normal = np.array(list(map(N.computeCDF, pts_...
import numpy as np from scipy.linalg import block_diag import math from dynamics import Dynamics class Quadrotor14D(Dynamics): def __init__(self, mass, Ix, Iy, Iz, time_step=0.05): self._mass = mass self._Ix = Ix self._Iy = Iy self._Iz = Iz super(Quadrotor14D, self).__init_...
"""Setup component of the game.""" import audioop import cmd import socket import statistics from collections import namedtuple from configparser import ConfigParser from typing import Any, Optional import cv2 import pyaudio import serial from serial.tools.list_ports import comports from .utils import elicit_float, ...
<filename>VevoLab Data Extraction Helper.py # -*- coding: utf-8 -*- """ VevoLab Data Extraction Helper @author: <NAME> (C) 2021 This program will ask the user for exported data from VevoLab as well as metadata and analysis settings information inputs... report_path : a list of the paths to all VevoLab files that con...
<reponame>GuoshenLi/Machine-Learning-From-Zero-to-Hero<filename>pca/eign_faces.py import os from scipy.io import loadmat import matplotlib.pyplot as plt import numpy as np import seaborn as sns def pca(X): """ Run principal component analysis. Parameters ---------- X : array_like The data...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import json import pandas as pd import matplotlib.pyplot as plt import numpy as np from collections import defaultdict from scipy.stats import spearmanr def req(api_method, renew=False): try: if renew: raise with open(f'./cache/{api_meth...
<reponame>voxie-viewer/voxie #!/usr/bin/python3 # # Copyright (c) 2014-2022 The Voxie Authors # # 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 limitati...
<filename>scripts/calibrate.py # Copyright: 2021, <NAME>, Berlin . All rights reserved. import pathlib import argparse import datetime as dt import json from collections import defaultdict from bokeh.plotting import figure from bokeh.layouts import column, row from bokeh.models.annotations import Label from bokeh.io i...
# coding: utf-8 import numpy as np import h5py import yaml import yamlloader import os from collections import OrderedDict from collections import abc from sympy import Integer from sympy.core.singleton import Singleton from sympy.core.compatibility import with_metaclass, is_sequence from sympy.core import Basic, sy...
#!/usr/bin/env python import rospy import numpy as np from geometry_msgs.msg import PoseStamped from styx_msgs.msg import Lane, Waypoint from scipy.spatial import KDTree from std_msgs.msg import Int32 import math ''' This node will publish waypoints from the car's current position to some `x` distance ahead. As ment...
''' Classes for modeling slowness on a 3-D voxel grid as a function of some number of parameters. ''' import numpy as np from scipy.sparse import csr_matrix, coo_matrix, eye as speye import re from itertools import product as iproduct class Slowness(object): ''' A class representing an unconstrained slowness on a ...
<reponame>jmfrancklab/proc_scripts """ Phasing and Timing Correction Using a Varied Tau Experiment =========================================================== Take real data with varying echo times, and demonstrate how we can automatically find the zeroth order phase and the center of the echo in order to get data th...
# UQpy is distributed under the MIT license. # # Copyright (C) 2018 -- <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated # documentation files (the "Software"), to deal in the Software without restriction, including without limitation the # rights t...
<filename>scripts/aero/Functions/Models/wind_model.py # Author : <NAME> # Last update : 16 October 2020 # EPFL Rocket Team, 1015 Lausanne, Switzerland import numpy as np from scipy import interpolate def wind_model(t, I, V_inf, Model, h_alt): t_wind_ = [] wind_ = [] if Model == 'None': U = V_inf...
<filename>CT_PET_preprocessing/compare_matrix.py from scipy.io import loadmat from math import fabs def compare_3D_matrix(python_array, matlab_array, max_count_num=100, diff_threshold=0): A = python_array B = matlab_array assert A.shape == ...
import pandas as pd import numpy as np import yfinance as yf from sklearn.linear_model import LinearRegression import statsmodels import statsmodels.api as sm import statsmodels.tsa.stattools as ts import datetime import scipy.stats import math import openpyxl as pyxl from scipy import signal from scipy import stats...
<gh_stars>1-10 from __future__ import division, print_function, absolute_import ### THIS SCRIPT IS BASED ON PyTran, WHICH IS PART OF THE COURSEWARE IN ### Pierrehumbert, 2010, Principles of Planetary Climate ### ### MODIFIED BY dkoll #-------------------------------------------------------- #Description: # [...] # #N...
<reponame>mroberto166/RadiativeTransportPinns<filename>EquationModels/RadTrans3D.py from ImportFile import * from pyevtk.hl import gridToVTK pi = math.pi space_dimensions = 3 time_dimensions = 0 output_dimension = 1 extrema_values = None parameters_values = torch.tensor([[0, 2 * pi], # phi ...
from cgbind.log import logger from scipy.spatial import distance_matrix import networkx as nx import numpy as np import pickle import os from cgbind.exceptions import CgbindCritical from cgbind.input_output import mol2file_to_atoms from cgbind.bonds import get_bond_list_from_atoms from cgbind.geom import calc_com from ...
from scipy.spatial.distance import cosine, cityblock, jaccard, canberra, euclidean, minkowski, braycurtis class Word2vecModel(object): def __init__(self, data, corpus, model): ''' :param data: :param corpus: segment doc, dict type :param model: word2vec ''' self.dat...
<filename>Tools/Gaussian_fit.py import numpy as np from scipy import optimize import matplotlib.pyplot as plt #For GUI import tkinter as tk from matplotlib.figure import Figure from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg,NavigationToolbar2Tk) #amplitude,mean,stddev=gaussian_fit(x,data,manual=Fals...
<filename>unrolr/core/pca.py #!/usr/bin/env python # -*- coding: utf-8 -*- # # <NAME> 2016-2020 # Unrolr # # Principal Component Analysis # Author: <NAME> <<EMAIL>> # # License: MIT from __future__ import division from __future__ import print_function from __future__ import absolute_import import numpy as np from sc...
<gh_stars>10-100 # -*- encoding: utf-8 -*- # @Author: <NAME> # @Time: 2021/08/29 21:49:07 # @File: stack_machine.py import sympy import torch class OPERATIONS: def __init__(self, out_symbol2idx): self.NOOP = -1 self.GEN_VAR = -2 self.PAD = out_symbol2idx['<PAD>'] self.ADD = out_sy...
from Provider import Provider from foundation.FoundationException import FoundationException from ProviderAgentException import ProviderException from foundation.Agent import AgentServerHandler from foundation.DecisionVariable import DecisionVariable import logging import numpy as np from scipy.cluster.vq import kmeans...
#!/usr/bin/env python from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import cPickle as pickle import glob import os import os.path as osp import re import fcn import matplotlib.pyplot as plt import numpy as np import scipy.ndimage as ndi i...
""" <NAME> This module computes contract fixpoints induced by the realizability relation between the assumption and guarantee sets California Institute of Technology April 16, 2019 """ import os, sys import numpy as np if __name__ == '__main__': sys.path.append('..') # for import from contracts.compute_refinement ...
<reponame>vihari/crossgrad # Copyright 2016 The TensorFlow Authors. 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 # # Unl...
<gh_stars>1-10 """ .. deprecated:: 1.6 sympy.utilities.benchmarking has been renamed to sympy.testing.benchmarking. """ from sympy.utilities.exceptions import sympy_deprecation_warning sympy_deprecation_warning("The sympy.utilities.benchmarking submodule is deprecated. Use sympy.testing.benchmarking instead.", ...
''' Notes ------ Available keys in annotation: dict_keys(['__header__', '__version__', '__globals__', 'sequence', 'clipNo', 'source', 'bg', 'gender', 'light', 'stride', 'camDist', 'camLoc', 'joints2D', 'joints3D', 'pose', 'zrot', 'cloth', 'shape']) ''' import os import scipy.io as sio from tqdm import tqdm import numpy...
import numpy as np from PIL import Image from scipy.ndimage import convolve import matplotlib.pyplot as plt from utils import greyscale_convert def sobel_filter_x(image): g_x = np.array([[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]]) return convolve(image, g_x) def sobel_filter_y(image): g_y = np.array([[1, 2, 1]...
<filename>neurophox/helpers.py from typing import Optional, Callable, Tuple import numpy as np import tensorflow as tf try: import torch except ImportError: # if the user did not install pytorch, just do tensorflow stuff pass from scipy.stats import multivariate_normal from .config import NP_FLOAT def ...
<filename>mandelbulb_raytrace.py import numpy as np from power3d import pow3d import matplotlib.pyplot as plt import scipy.optimize IMAGE_WIDTH = 100 IMAGE_HEIGHT = IMAGE_WIDTH BAILOUT = 64 ORDER = 5 MAX_ITERS = 6 PATIENCE = 120 ACCURACY = 0.02 MIN_DISTANCE = 2.9 CAMERA_POS = np.array([-0.1, 0.2, -4]) LOOK_XS = np....
<gh_stars>0 """ Copyright 2017 <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, soft...
'''This script contains all of the functions used in our study''' from __future__ import print_function import math import numpy as np import scipy as sp from scipy import special as spsp from scipy import sparse as sparse from scipy import stats as stats from scipy import optimize as opt from scipy import interpolate...
<filename>scripts/python/plot_sound_eeg.py<gh_stars>1-10 """ * Smartphone Brain Scanner 2 License Agreement (MIT License) * * Copyright (c) 2012 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>. * Technical University of Denmark, DTU Informatics, Cognitive Systems Section. http://code.google.com/p/smartphonebrainscanner2 * * Pe...
""" Utility methods for handling complex numbers in networks, converted from TF """ import numpy as np import scipy.signal import torch import torch.nn as nn import torch.nn.functional as F def compute_psnr(predictions, ground_truths, maxpsnr=100): """Compute PSNR.""" ndims = len(predictions.get_shape().as_li...
import matplotlib.pyplot as plt from matplotlib import cm from mpl_toolkits.mplot3d import Axes3D import sys, os, time, glob, collections from argparse import ArgumentParser import numpy as np import scipy.sparse as sp from scipy.sparse import csr_matrix from scipy.sparse.csgraph import reverse_cuthill_mckee from _i...
<reponame>shreysrins/bond-calculator<gh_stars>1-10 #!/usr/bin/env python """Bond Calculator with associated functions. This script allows the user to calculate the Yield-to-Maturity, Price, Duration, or Convexity of a bond. It is operated purely through a Command Line Interface (CLI). """ from pyfiglet import Figlet ...
<filename>examples/domain_adaptation/segmentation/data/data_prep.py # -*- coding: utf-8 -*- """ @author: <NAME> """ from __future__ import print_function import numpy as np #import cv2 from scipy import ndimage from skimage.restoration import denoise_nl_means,estimate_sigma # from skimage import data, util from skimag...
<reponame>jnietol/DVH-Analytics #!/usr/bin/env python # -*- coding: utf-8 -*- # tools.stats.py """ Take numerical data from main app and convert to a format suitable for statistical analysis in Regression and Control Chart tabs """ # Copyright (c) 2016-2019 <NAME> # This file is part of DVH Analytics, released under ...
<filename>growth_modeling/growth.py<gh_stars>0 r"""The growth.py module implements the Growth base class. This module implements the Growth class: a parent class that will be inherited by the different specific growth modules. It allows to encapsulate at a shared level most of the general behaviors of the different ...
<reponame>Yongbinkang/ExpFinder<filename>src/controller/generator.py<gh_stars>1-10 import pandas as pd import numpy as np from sklearn.feature_extraction.text import CountVectorizer from sklearn.preprocessing import normalize from sklearn.metrics.pairwise import cosine_similarity from scipy.sparse import csr_matrix fr...
################################################################################ # Copyright 2019-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the LICENSE file for details. # SPDX-License-Identifier: MIT # # Fusion models for Atomic and molecular STructures (FAST) # Evaluatio...
<reponame>JakeMaeker/utk-fusion<filename>misc/lams/SIMMS.py<gh_stars>1-10 import numpy as np import scipy.interpolate as sinter import pandas as pd def doALL(EFfileNAM="AU02_dict.csv", RBSfileNAM="A02_RminRsep_data.csv", FOLDpath='/.', simmBG=0.0435, HDFdump=0): efFOLDpath = FOLDpath+'CP_LAMS_Dictionar...
#!/usr/bin/env python import rospy import tf import cv2 import yaml import numpy as np from std_msgs.msg import Int32 from geometry_msgs.msg import PoseStamped, Pose from styx_msgs.msg import TrafficLightArray, TrafficLight from styx_msgs.msg import Lane from sensor_msgs.msg import Image from cv_bridge import CvBridge...
"""The WaveBlocks Project This file contains code to represent linear combinations of compatible Hagedorn wavepackets in a more efficient and storage friendly way than the general linear combination class. @author: <NAME> @copyright: Copyright (C) 2013, 2014 <NAME> @license: Modified BSD License """ from numpy impor...
from abc import ABCMeta, abstractmethod import numpy as np from scipy.signal import lfilter import matplotlib.pyplot as plt #import scipy.signal.ltisys, scipy.signal.dltisys class DynamicalSystem(object): """ The DynamicalSystem class serves as the base for all Dynamical System specializations and defines...
import math import random from typing import List, Tuple, Callable import numpy as np import scipy.misc from clustering_system.clustering.ClusteringABC import CovarianceType from clustering_system.clustering.GibbsClusteringABC import GibbsClusteringABC from clustering_system.clustering.mixture.GaussianMixtureABC impo...
<reponame>MilesCranmer/bnn_chaos_model #!/usr/bin/env python # coding: utf-8 # %matplotlib inline import sys sys.path.append('../') import os os.environ['XLA_PYTHON_CLIENT_PREALLOCATE'] = 'false' # import jax # import jax.numpy as jnp # from jax.random import PRNGKey, normal import numpy as np # + import numpy a...
<filename>main copy 3.py import plotly.figure_factory as ff import plotly.graph_objects as go import statistics import random import pandas as pd import csv df = pd.read_csv("data.csv") data = df["temp"].tolist() population_mean = statistics.mean(data) std_deviation = statistics.stdev(data) print("population mean:- ",...
<reponame>alsuren/robokite #!/usr/bin/env python # -*- coding: utf8 -*- # # Copyright (c) 2013 Nautilabs # # Licensed under the MIT License, # https://github.com/baptistelabat/robokite # Authors: <NAME> from SimpleCV import Camera, Image, VirtualCamera, Display, DrawingLayer, Color, JpegStreamCamera, JpegStreamer imp...
# -*- coding: utf-8 -*- """ Created on Sun Nov 22 21:08:04 2020 @author: franklin https://aaronschlegel.me/black-scholes-formula-python.html """ import numpy as np import scipy.stats as si import itertools def euro_vanilla(S, K, T, r, sigma, option = 'call'): #S: spot price #K: strike p...
<reponame>novasush/computer-vision-plant-disease-classification import tensorflow as tf # Default graph is initialized when the library is imported import os from tensorflow.python.platform import gfile from PIL import Image import numpy as np import scipy from scipy import misc import matplotlib.pyplot as plt import ...
''' Script to test simple functionality of radiation models. It is recommended to run this in IPython. ''' import numpy as np import matplotlib.pyplot as plt plt.ion() from omfit_classes import omfit_eqdsk, omfit_gapy import sys, os from scipy.interpolate import interp1d # Make sure that package home is added to sys...
import numpy as np import os from scipy.stats import norm import matplotlib.pyplot as plt from collections import Counter from parameter import element_dict, amino_acid_dict, common_dict_create, h2o_mass, proton_mass def mass_diff_list_compute(lines, mass, common_dict=None): mass_diff_list = [] ...
<reponame>JunCEEE/hummingbird # -------------------------------------------------------------------------------------- # Copyright 2016, <NAME>, <NAME>, <NAME>, <NAME> # Hummingbird is distributed under the terms of the Simplified BSD License. # ------------------------------------------------------------------------- ...
<filename>scripts/2d_spde_prob/generate_data/generate_data_multiple_ellxs_a=e^GRF_var0.75/heateqsolver.py #!/usr/bin/env python """ We define a class ``SteadyStateHeat2DSolver'' which solves the steady state heat equation in a two-dimensional square grid. For now we don't add any forcing function and the boundary cond...
"""Module for solving different master equations.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import scipy as sp import scipy.sparse.linalg import copy from qmeq.mytypes import doublenp from qmeq.mytypes import complexnp from qmeq...
import numpy as np import random from numpy.random import * from itertools import combinations import numpy as np from sympy.utilities.iterables import multiset_permutations def unit_vector(vec): """ Returns unit vector """ return vec / np.linalg.norm(vec) def cos_sim(v1, v2): """ Returns ...
<gh_stars>0 import mnist import scipy.misc import matplotlib.pyplot as plt import tensorflow as tf # Importing the required Keras modules containing model and layers from keras.models import Sequential from keras.layers import Dense, Conv2D, Dropout, Flatten, MaxPooling2D if __name__ == '__main__': images = mnist....
#! /usr/bin/python3 ############################################################## ## User-centric QoS-based pricing model ## ## Authors: <NAME>, <NAME> ## ## Year: November, 2019 ## ############################################################## from pyes.base i...
import numpy as np from scipy.optimize import least_squares import matplotlib.pyplot as plt from tqdm import tqdm from flex.flex import FlexFile from scipy.ndimage.filters import gaussian_filter1d from astropy import units as u from petitRADTRANS import Radtrans from petitRADTRANS import nat_cst as nc from ..pysysr...
<filename>src/pml.py from .constants import * import numpy as np import scipy.sparse as sp class PML: ''' the PML is actually a preconditioner, not a boundary BoundaryCondition ''' def __init__(self, N, Npml, omega): self.lnR = -16; #-12; self.m = 4; #3.5; self.sigma_max ...
<reponame>colour-science/sample_code # -*- coding: utf-8 -*- """ Countdown動画を作るクラスの定義 =============================== """ # import standard libraries from typing import NamedTuple # import third-party libraries import numpy as np import cv2 from sympy import symbols from colour import RGB_COLOURSPACES # import my l...
<reponame>Fernandez-Trincado/DataReductionPy #!/usr/bin/python # Created by: <NAME> # Date: 2013 June 25 # Program: This program generate the Master Bias # 1 m Reflector telescope, National Astronomical Observatory of Venezuela # Mode f/5, 21 arcmin x 21 arcmin # Project: Omega Centauri, Tidal Tails. # The program As...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jan 10 00:01:20 2021 @author: afo """ import asyncio import json import traceback from os.path import abspath from inspect import getsourcefile import os import aiohttp import pandas as pd from datetime import datetime import itertools as it import sta...
<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Sep 5 10:39:04 2017 @author: BallBlueMeercat """ # zombie apocalypse modeling import numpy as np import matplotlib.pyplot as plt from scipy.integrate import odeint plt.ion() P = 0 # birth rate d = 0.0001 # natural death percent (per...
<reponame>founture123/LSAFGCMR import torch import torch.nn as nn import scipy.spatial class CenterLoss(nn.Module): """Center loss. Reference: Wen et al. A Discriminative Feature Learning Approach for Deep Face Recognition. ECCV 2016. Args: num_classes (int): number of clas...
import scipy.signal import numpy as np import random import tensorflow as tf def set_global_seeds(env, seed): tf.set_random_seed(seed) np.random.seed(seed) random.seed(seed) env_seeds = np.random.randint(low=0, high=1e6, size=env.num_envs) env.set_random_seed(env_seeds) class RunningMeanStd(obje...