text
string
#!/usr/bin/env python3 #python import time from os import mkdir, listdir from os.path import isdir, isfile from itertools import chain #from pickle import load #external import numpy as np np.set_printoptions(precision=10, threshold=np.inf) from scipy.optimize import least_squares from matplotlib import pyplot as plt...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.4' # jupytext_version: 1.2.1 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # # s_bo...
import gensim import smart_open from scipy import spatial import numpy as np from paragraph_similarity.common.paragraph import Paragraph from paragraph_similarity.common.result import Result from paragraph_similarity.common.similarity_model import SimilarityModel class Doc2VecSimilarityModel(SimilarityModel): d...
<gh_stars>1-10 import pandas as pd from scipy import stats from .. import distributions from . import utilities # Fit the pareto distribution to Levy-Stable data DESIRED_ALPHA = stats.uniform.rvs(1, 2, 1)[0] BETA = 1.0 # forces rvs to be strictly positive STABLE_RVS = stats.levy_stable.rvs(DESIRED_ALPHA - 1, BETA, s...
<gh_stars>0 # =======IF======= from statistics import mean # média importada n1 = float(input('Digite sua primeira nota: ')) n2 = float(input('Digite sua segunda nota: ')) n3 = float(input('Digite sua terceira nota: ')) m = mean([n1, n2, n3]) print('Sua média é: {:.2f}' .format(m)) if m >= 7: # se a média for maio...
<reponame>decabyte/vehicle_core #!/usr/bin/env python # -*- coding: utf-8 -*- # Software License Agreement (BSD License) # # Copyright (c) 2014, Ocean Systems Laboratory, Heriot-Watt University, UK. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are pe...
import gym #from gym import ... #! /usr/bin/env python import copy from copy import deepcopy import rospy import threading import quaternion import numpy as np from geometry_msgs.msg import Point from visualization_msgs.msg import * #from franka_interface import ArmInterface #from panda_robot import PandaArm import ma...
<reponame>mcmahon-lab/error_mitigation_vqe import numpy as np from copy import deepcopy from scipy.optimize import minimize import csv import os import re import os.path from os import path from math import isnan import time from library import * from datetime import datetime # if you use a gpu, change this to set wh...
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2021 <NAME> <<EMAIL>> # # Distributed under terms of the MIT license. """ This file is for automatic modified bases signal extraction. The overall idea is to first find the correct current level for polyA tail with kde, ...
<reponame>bradkav/imripy import numpy as np from scipy.integrate import quad hubble_const = 2.3e-10 # in 1/pc Omega_0_m = 0.3111 Omega_0_L = 0.6889 def HubbleLaw(d_lum): """ The simple Hubble Law relating the luminosity distance to the redshift Parameters: d_lum : float or array_like ...
# Naive Bayes and Hyperparameter Optimization *<NAME>, May 5th, 2021* # Importing our libraries import pandas as pd import altair as alt import numpy as np from sklearn.tree import DecisionTreeClassifier from sklearn.dummy import DummyClassifier, DummyRegressor from sklearn.neighbors import KNeighborsClassifier, KNei...
from __future__ import division import numpy as np import matplotlib.pyplot as plt import sys import scipy unit_M = 1 unit_D = 1 unit_E = 1 unit_t = 1 e_charge = 1 initialized = False def __init__(): """ Initialize module """ pass def init(unit_M_, unit_D_, unit_E_): """ Initialize units ...
<reponame>neonnnnn/pyrfm<filename>pyrfm/random_feature/tests/test_scrk.py import numpy as np from scipy.sparse import csr_matrix from sklearn.utils.testing import assert_allclose_dense_sparse from pyrfm import anova, SignedCirculantRandomKernel import pytest # generate data rng = np.random.RandomState(0) X = rng.ran...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Neural Network Verification Model Translation Tool (NNVMT) @author: <NAME>(<EMAIL>) <NAME> (<EMAIL>) """ from __future__ import division, print_function, unicode_literals import numpy as np import os from src.NeuralNetParser import NeuralNetParser import scipy....
# -*- coding: utf-8 -*- from math import prod from statistics import mean class Calc: def add(self, *s): return sum(s) def subtract(self, a, b): return a - b def multiply(self, *s): if 0 in s: raise ValueError return prod(s) def divide(self, a,...
# Program 02e: Numerical and truncated series solutions. # See Figure 2.6. from scipy.integrate import odeint import matplotlib.pyplot as plt import numpy as np def ODE2(X, t): x = X[0] y = X[1] dxdt = y dydt = x - t ** 2 * y return [dxdt, dydt] X0 = [1, 0] t = np.linspace(0, 10, 1000) sol = ode...
<filename>_build/jupyter_execute/notebooks/math/03 Major Distribution CDFs and PDFs.py #!/usr/bin/env python # coding: utf-8 # # Major Distribution CDFs and PDFs # # **<NAME>, PhD** # # This demo is based on the original Matlab demo accompanying the <a href="https://mitpress.mit.edu/books/applied-computational-econ...
import argparse import csv import numpy import logging from pathlib import Path from scipy.optimize import linear_sum_assignment logger = logging.getLogger(__name__) def assign2groups(file_path: Path, bad_assignment_cost=255): if not file_path.exists(): raise FileNotFoundError(file_path) with file...
<filename>Fancy_aggregations/supervised_MPA.py # -*- coding: utf-8 -*- """ Created on Wed Dec 30 13:30:43 2020 @author: javi- """ import numpy as np import sklearn.linear_model from . import penalties as pn from . import binary_parser as bp # ========================================================================...
''' # This is an 80 character line # Read in: -file name -bin size Output (for each timestep): -histogram of local density (number density, area fraction) -need to process this into text file that gives just the one-two-three? ''' import sys # Run locall...
<reponame>Goodpaster/QSoME<filename>qsome/custom_diis.py #Implement EDIIS+DIIS and ADIIS+DIIS #By <NAME> import scipy import numpy as np from pyscf import lib, scf DEBUG = False class EDIIS(scf.diis.EDIIS): def update(self, s, d, f, elec_e): if self._head >= self.space: self._head = 0 ...
<gh_stars>1-10 """ CCT 建模优化代码 COSY 扩展代码 作者:赵润晓 日期:2021年6月3日 """ import multiprocessing # 多线程计算 import time # 统计计算时长 from typing import Callable, Dict, Generic, Iterable, List, NoReturn, Optional, Tuple, TypeVar, Union import matplotlib.pyplot as plt import math import random # 随机数 import sys import os # 查看CPU核心数 ...
<reponame>eliottkalfon/evolution_opt #!/usr/bin/env python # coding: utf-8 ''' This module is a Python implementation of a genetic algorithm with a regularized evolution process. It was inspired by the following paper: Saltori, Cristiano, et al. "Regularized Evolutionary Algorithm for Dynamic Neural Topology Sear...
#!env python3 # AUTHOR INFORMATION ########################################################## # file : bernstein_bijector.py # brief : [Description] # # author : <NAME> # created : 2020-09-11 14:14:24 # changed : 2020-12-07 16:29:11 # DESCRIPTION ################################################################# #...
<filename>evaluate_model.py import argparse import logging import os import numpy as np import scipy.io as sio import tensorflow as tf import utils parser = argparse.ArgumentParser() parser.add_argument('-g', '--gpu', help='gpu device ID', default='0') parser.add_argument('-m', '--model_dir', help='model directory',...
<reponame>NeTatsu/video-diff<filename>Python/Clustering.py """ The most efficient would be to use OpenCV's cv::flann::hierarchicalClustering . But we do NOT have Python bindings to it. See if you have the time: http://opencvpython.blogspot.ro/2013/01/k-means-clustering-3-working-with-opencv.html Other idea...
<reponame>dfm/turnstile # -*- coding: utf-8 -*- from __future__ import division, print_function __all__ = ["FP"] import numpy as np from scipy.linalg import cho_factor, cho_solve try: from astropy.io import fits from astropy.wcs import WCS except ImportError: fits = None from ..pipeline import Pipeline...
import numpy as np import pandas as pd from scipy.stats import binom_test data = pd.read_csv(r'C:\Users\william\OneDrive\Desktop\Second Paper\Code\qualitative_results.csv') total = len(data) total_pm = len(data[data.Chosen == 'PixelCNN']) print() print('Overall PixelMiner percent:', str(total_pm/total)) chosen_ln ...
import math import pybullet as p import numpy as np import copy import sys sys.path.append("../") #sys.path.append("/HPS/Shimada/work/rbdl37/rbdl/build/python") import rbdl from scipy.spatial.transform import Rotation as Rot from scipy.spatial.transform import Slerp class KinematicUtil(): def motio...
import pandas as pd import scipy.stats as stats import matplotlib.pyplot as plt import numpy as np my_dataset = pd.read_excel('USGS_BCR2G.xls', sheet_name='Sheet1') fig, ax = plt.subplots() ax.hist(my_dataset.La, bins='auto', density=True, edgecolor='#000000', color='#c7ddf4', label="USGS BCR2G") ax.set_xlabel("La [p...
<gh_stars>0 from scipy.spatial.distance import cityblock from sklearn.metrics import roc_curve import pandas import numpy as np np.set_printoptions(suppress = True) class ManhattanVerifier: def __init__(self, subjects): self.user_scores = [] self.imposter_scores = [] self.mean_vector = [...
import numpy as np from numpy import genfromtxt import random from scipy import signal import datetime import os from scipy.ndimage.interpolation import zoom import tensorflow as tf import tensorflow.contrib.eager as tfe class spectral_autoencoder(tf.keras.Model): def __init__(self, model_features): super(...
<reponame>BastiHz/epicycles<gh_stars>1-10 import math import cmath import pygame import pygame.gfxdraw from src import constants from src import transform class Epicycles: def __init__(self, points, n, fade, reverse, surface_center, debug): self.angular_velocity = constants.DEFAULT_ANGU...
<filename>Max2SAT_pysat/rc2_runtime_histogram.py import matplotlib.pyplot as plt import numpy as np from scipy.stats import binned_statistic def average_data(data): num_repeats = len(data[:, 0]) num_x_vals = len(data[0, :]) y_av = np.zeros(num_x_vals) y_std_error = np.zeros(num_x_vals) for x in r...
<reponame>StalinMazaEpn/ejercicios_python<filename>imagenes/edicion_imagen.py<gh_stars>0 #ALGORITMOS FUNDAMENTALES #AUTOR: <NAME> #VERSION 2.3 #TRATAMIENTO DE IMAGENES EN PYTHON - edicion_imagen.py #2016-Ene-09 #DOCENTE: Ing. <NAME> #MODULO DE LIBRERIAS from scipy import misc from scipy import * import numpy...
<gh_stars>1-10 import numpy as np import scipy.signal as signal import scipy.interpolate as ip from typing import List, Tuple def sgolay(order : int, framelen : int) -> Tuple: """ Parameters ---------- order : int The order of the polynomial used to fit the samples. polyorder must be ...
import os import tqdm import soundfile as sf import pandas as pd import numpy as np from scipy import stats from utils.path_utils import project_root from utils.get_librispeech_paths import get_librispeech_paths from frequency_feats import freq_feats from utils.fund_estiamtion.yin import compute_yin def extract_feat...
<filename>level_17/level_17.py #!/usr/bin/python from scipy.misc import comb from itertools import combinations TARGET = 150 MIN_BATCH = 2 bottles = [] with open('in.txt', 'r') as f: for line in f: bottles.append(int(line)) """ test case """ #bottles = [20, 15, 10, 5, 5] #TARGET = 25 if(sum(bottles) == TARGET): ...
<filename>common/z_table.py # Import all libraries for this portion of the blog post from scipy.integrate import quad import numpy as np import matplotlib.pyplot as plt import pandas as pd def print_normal_distribution(): # print standard normal distribution x = np.linspace(-4, 4, num=100) constant = 1.0...
<filename>supg/datasource/csv_source.py from collections import defaultdict import pandas as pd import numpy as np import scipy.special import feather from supg import datasource def load_jackson_source(probs_fname, csv_fname, obj_name): # y_true df_csv = pd.read_csv(csv_fname) df_csv = df_csv[df_csv['o...
import numpy as np from scipy.stats import chi2 import sophus as sp import time from collections import namedtuple from utils import * from feature import Feature # Gravity vector in the world frame g = np.array([0., 0., -9.81]) class IMUState(object): # id for next IMU state next_id = 0 ...
""" In this example we use the pysid library to estimate a MIMO armax model """ #Import Libraries from numpy import array, convolve, concatenate, zeros from numpy.random import rand, randn #To generate the experiment from scipy.signal import lfilter #To generate the data from pysid import armax #...
import pandas as pd import numpy as np import zipfile import os import scipy as sp import matplotlib.pyplot as plt import plotly.express as px import zipfile import pathlib #literature component def literature_component(LC_component, max_comp_reported): """ function to compute the literature component based on t...
<filename>presentation/training_graphs.py import numpy as np import matplotlib.pyplot as plt from scipy.spatial import Delaunay import seaborn as sns from matplotlib.colors import ListedColormap def plot_points_with_noise(px, py, nx, ny): fig = plt.figure(figsize=(4, 2), dpi=1000) plt.tight_layout() plt....
<gh_stars>0 import sympy from ..helpers import article, pm, untangle from ._helpers import DiskScheme _citation = article( authors=["<NAME>", "<NAME>"], title="Zur numerischen Auswertung mehrdimensionaler Integrale", journal="ZAMM", volume="38", number="1-2", year="1958", pages="1–15", ...
<reponame>CaramelCake/compimg """ Image processing using kernels. Includes several ready to be used kernels and convolution routines. """ import numpy as np import compimg from scipy import ndimage from compimg.exceptions import ( KernelBiggerThanImageError, KernelShapeNotOddError, KernelNot2DArray, ) BO...
import dask import datetime import logging import time import numpy as np from ml4chem.utils import convert_elapsed_time, get_chunks from collections import OrderedDict from scipy.linalg import cholesky logger = logging.getLogger() class KernelRidge(object): """Kernel Ridge Regression Parameters -------...
<gh_stars>0 from fractions import gcd from random import randint def description(): return 'Find the Greated Common Divisor' def question(): a = randint(1, 999) b = randint(0, 999) d = gcd(a, b) return ('(%d,%d)' % (a, b), str(d))
<filename>old_scripts/hand_pose_estimation.py<gh_stars>0 import numpy as np import matplotlib import matplotlib.pyplot as plt import mpl_toolkits.mplot3d.axes3d as p3 import scipy.io as sio import os from sklearn.manifold import Isomap from scipy.spatial import Delaunay from scipy.stats import special_ortho_group # D...
<reponame>kidrabit/Data-Visualization-Lab-RND<gh_stars>1-10 from scipy.fft import fft, ifft x = np.array([1.0, 2.0, 1.0, -1.0, 1.5]) y = fft(x) y
import numpy as np import pandas as pd import matplotlib.pyplot as plt import torch from scipy.interpolate import griddata from shapely.geometry import Polygon, Point from stpy.borel_set import HierarchicalBorelSets, BorelSet from stpy.point_processes.poisson_rate_estimator import PoissonRateEstimator from stpy.kernels...
<gh_stars>10-100 from typing import Iterable import numpy import pandas import scipy.sparse as spsparse def categorical_encode_series_to_sparse_csc_matrix( series: Iterable, reduced_rank: bool = False ) -> spsparse.csc_matrix: """ Categorically encode (via dummy encoding) a `series` as a sparse matrix. ...
import sys import os from scipy.interpolate import InterpolatedUnivariateSpline as interp import numpy import matplotlib.pyplot as plt from astropy.io import fits as pyfits from astropy import units, constants from astropy import units, constants from telfit import TelluricFitter, Modeler, DataStructures, FittingUtili...
import time import numpy as np import torch from utils import * from params import * from reconstruction import * import scipy import cv2 import skimage.measure from itertools import compress def lpf_detection(holo,mask,erode_size=20, dilate_size=60, threshold=10, A_min = 1, show_plot=False): # mask for low pass f...
<reponame>Kiminwoo/Machine-Running-Exercises import numpy as np import scipy as sp import matplotlib.pyplot as plt import pandas as pd import mglearn # 데이터셋 만들기 # 인위적으로 만든 이진 분류 데이터셋 X, y = mglearn.datasets.make_forge() # 산점도 그리기 mglearn.discrete_scatter(X[:, 0], X[:, 1], y) plt.legend(["Class 0", "Class ...
<filename>baselineUtils.py from torch.utils.data import Dataset import os import pandas as pd import numpy as np import torch import random import scipy.spatial import scipy.io def create_dataset( dataset_folder, dataset_name, val_size, gt, horizon, delim="\t", train=True, eval=False, ...
<filename>python/sklearn/examples/linear_model/plot_sparse_recovery.py<gh_stars>1-10 """ ============================================================ Sparse recovery: feature selection for sparse linear models ============================================================ Given a small number of observations, we want to...
"""This module contains the alpha-s calculation.""" import numpy from scipy import stats from pygaps import logger from pygaps.characterisation.area_bet import area_BET from pygaps.characterisation.area_lang import area_langmuir from pygaps.core.adsorbate import Adsorbate from pygaps.core.baseisotherm import BaseIsot...
import scipy.io as sio import math import statistics matfile = sio.loadmat('changed_param_2.mat') old_mat = sio.loadmat('learned_all_param_2.mat') #for i in range(15): #print matfile['p'][[11 ,67 ,225,336,357,444,635,679],0],old_mat['p'][[11 ,67 ,225,336,357,444,635,679],0] count = 0 mea_ceil = [] mea_floor = [] mea_...
# # SPDX-License-Identifier: Apache-2.0 # # Copyright 2020 <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 app...
# -*- coding: utf-8 -*- """ *Module* ``project.generator`` This module provides some classes to generate and handle different types of data during running the application. This can be used outside the application as it works independently. """ from statistics import stdev from collections import Counter from random ...
<reponame>ameya30/IMaX_pole_data_scripts #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Dec 15 11:31:16 2017 @author: prabhu """ from matplotlib import pyplot as plt import matplotlib as mpl import cmocean import numpy as np from astropy.io import fits from matplotlib import pyplot as plt from sc...
<reponame>aimalz/justice<filename>test/datasets/sharded_plasticc_test.py # -*- coding: utf-8 -*- """Sharded plasticc dataset test.""" import collections import itertools import pytest import scipy.stats from justice.datasets import sharded_plasticc def test_id_split_distribution(): for distribution in [(0.1, 0....
<reponame>IIRM/EnergyMetering<filename>main.py<gh_stars>0 import itertools import pathlib import pandas as pd import numpy as np import statistics as stat import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from date_and_time import getFullDateInfo from date_and_time import get_time_shift_forward_dat...
import numpy as np import time import argparse import os from scipy.optimize import least_squares import math import tensorflow as tf import PNS import itk import glob import json print("Tensorflow version:", tf.__version__) parser = argparse.ArgumentParser(description='Run PNS on encoded images that live on spher...
import os from data import common import numpy as np import scipy.misc as misc import torch import torch.utils.data as data class LRHRDataset(data.Dataset): def name(self): return 'LRHRDataset' def __init__(self, opt): super(LRHRDataset, self).__init__() # self.args = args s...
from numpy.lib.shape_base import expand_dims import pandas as pd import numpy as np import cvxpy as cp import numpy as np from scipy import sparse import time from emm.solvers import * import emm from sklearn.preprocessing import StandardScaler class marginal: def __init__(self, feature, fun, loss, standardize=Fa...
<gh_stars>1-10 from get_data import * import numpy as np from scipy.ndimage.filters import gaussian_filter from PIL import Image # Main function to build a heatmap def build_map(positions, status, resolution=0.00025, oob=0.005, min_free=10, min_busy=10, max_dist=0.001): ...
import jax.numpy as np from sklearn.tree import DecisionTreeRegressor from sklearn.linear_model import LinearRegression, Ridge from scipy.interpolate import UnivariateSpline class ConstantLearner(object): def fit(self, x, y): self.const = 1 def predict(self, x): return self.const tree_lear...
''' Copyright 2022 Airbus SAS 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, software dis...
<reponame>aashishyadavally/storyteller<gh_stars>1-10 """Contains important utilities which assist query procesing pipeline. """ import sys import json import heapq import subprocess from pathlib import Path import numpy as np import scipy from scipy.spatial.distance import cosine, euclidean import spacy import dotp...
<gh_stars>0 from astropy.io import fits import numpy as np import os, fnmatch from scipy import interpolate from scipy import ndimage def writefits(obj, varname, snap=None, instrument = 'MURaM', name='ar098192', origin='HGCR ', z_tau51m = None): if varname[:2] == 'lg': varnamefits='lg('+var...
<reponame>rollends/red-prism<gh_stars>1-10 #!env python3 # import argparse from functools import partial from itertools import chain import json import logging import matplotlib import numpy as np import pickle import redis import scipy ...
<reponame>ExaScience/smurff #!/usr/bin/env python import unittest import numpy as np import scipy.sparse as sp import smurff def matrix_with_explicit_zeros(): matrix_rows = np.array([0, 0, 1, 1, 2, 2]) matrix_cols = np.array([0, 1, 0, 1, 0, 1]) matrix_vals = np.array([0, 1, 0, 1, 0, 1], dtype=np.float6...
import collections from nltk.tokenize import RegexpTokenizer import nltk import pandas as pd import subprocess import os import re from scipy.stats import truncnorm from typing import List, Dict, Set, Union, Tuple, OrderedDict nltk.download('stopwords') from nltk.corpus import stopwords import pickle def substitute_n...
from pyamg.testing import * import numpy from numpy import ones, eye, zeros, bincount, empty, asarray, array from numpy.random import seed from scipy import rand from scipy.sparse import csr_matrix, csc_matrix, coo_matrix from pyamg.gallery import poisson, load_example from pyamg.graph import * from pyamg import amg_...
#!/usr/bin/env python ############################################################################### # binning.py - A binning algorithm spinning off of the methodology of # Lorikeet ############################################################################### # ...
<reponame>alexrobomind/diagmap import scipy.interpolate import scipy.spatial import multiprocessing.pool import networkx as nx import numpy as np from tqdm.auto import tqdm, trange def _calculate_distances(points, ax, single_section=False): """Actual function implementation""" n_surfs = points.shape[1] n...
<gh_stars>10-100 import numpy as np from scipy.optimize import fminbound class AttrDict(dict): def __init__(self, *args, **kwargs): super(AttrDict, self).__init__(*args, **kwargs) self.__dict__ = self def __str__(self): return self.__repr__() def __repr__(self): s = '' ...
<reponame>likun-stat/scalemixture_spline<filename>scratch.py import os os.chdir("/Users/LikunZhang/Desktop/PyCode/") import scalemixture_py.integrate as utils import scalemixture_py.priors as priors import scalemixture_py.generic_samplers as sampler import numpy as np import cProfile import matplotlib.pyplot as plt f...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed May 10 10:52:22 2017 @author: jakobg """ from __future__ import division, print_function import glob import os import numpy as np import clusterbuster.iout.misc as iom from scipy.stats import logistic def AddFilesTo...
""" 3D Animation ~~~~~~~~~~~~ Example of creating a 3D animation of the Cox et al. (2013) torsional oscillations. """ import numpy as np import scipy.interpolate import matplotlib.pyplot as plt import sys sys.path.append('../') #So taco_vis.py is visible to import from taco_vis import FLOW #########################...
# -*- coding: utf-8 -*- import os import moojoos as mj import numpy as np from pylab import * from PIL import Image from scipy.ndimage import filters # target files for comparison files = [ 'rena_sharp.jpg', 'rena_gaussian_10.jpg' ] cd = os.path.dirname(os.path.abspath(__file__)) # gray-scaled images ...
# --------------------------------------------------- # code credits: https://github.com/CQFIO/PhotographicImageSynthesis # --------------------------------------------------- import numpy as np import scipy from config import * import tensorflow as tf def read_image(file_name, resize=True, fliplr=False): image...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ pysilsub.problem ================ Help solving silent substitution problems with linear algebra and optimisation. @author: jtm, ms """ # Here are the cases that we want to have in the silent substitution module: # Single-direction modulations # Max. contrast within...
############################################################################## # imports import numpy as np import matplotlib.pyplot as plt from scipy import signal ############################################################################## ############################################################################...
<gh_stars>1-10 from __future__ import print_function import unittest import numpy as np import scipy.sparse as sp from SimPEG import ( Mesh, DataMisfit, Maps, Utils, Regularization, InvProblem, Optimization, Directives, Inversion ) from SimPEG.EM.Static import DC np.random.seed(82) class DataMisfitTest(un...
import pandas as pd import numpy as np import swifter from collections import Counter import statistics from statistics import mode import pickle import time import math import matplotlib.pyplot as plt from sklearn.metrics import roc_auc_score, roc_curve from keras.callbacks import ReduceLROnPlateau, TensorBoard, Early...
# coding: utf-8 ## Load, Visualize MCMC Results # 5]: ## get_ipython().magic(u'matplotlib inline') import pyfits import numpy as np import matplotlib matplotlib.rcParams['font.size'] = 15 from matplotlib import pyplot as plt import sys sys.path.append('../') import photPack2 from astropy.time import Time import emc...
<reponame>cmcuervol/Estefania<filename>Dias_Desp_Nub.py #!/usr/bin/env python # -*- coding: utf-8 -*- import pandas as pd from datetime import datetime, timedelta import numpy as np from scipy.stats import pearsonr from scipy import stats # from mpl_toolkits.axes_grid1 import host_subplot # import mpl_toolkits.axisarti...
<reponame>BrancoLab/BehaviourAnalysis # %% import sys sys.path.append('C:\\Users\\Federico\\Documents\\GitHub\\BehaviourAnalysis') from Utilities.imports import * import statsmodels.api as sm from pandas.plotting import scatter_matrix from scipy.optimize import curve_fit from scipy import signal from sklearn.model_sel...
<filename>micemag/fbutils/fbfit.py import pickle import sys import os import scipy as sp import numpy as np import iminuit as minuit import fbutils as _fb import micemag.utils as _paths class FBfitClass: def __init__(self, field, coil, magnet, zmax=1.8, rmax=0.15, n=2, l=20, m=10, \ verbose=Tru...
""" Mask R-CNN Display and Visualization Functions. Copyright (c) 2017 Matterport, Inc. Licensed under the MIT License (see LICENSE for details) Written by <NAME> """ import math import pickle import random import itertools import colorsys import numpy as np import IPython.display from scipy import interpolate import...
import os import glob import pickle import socket import pandas as pd from scipy.stats import spearmanr import tensorflow as tf from tensorflow.keras.models import load_model print(f'Tensorflow version: {tf.__version__}') # Custom imports from werdich_cfr.models.Modeltrainer_Inc2 import VideoTrainer from werdich_cfr....
<reponame>KeshavAdityaRP/coronaryHeartDiseasePredictor # from sklearn.datasets import load_digits # from sklearn.manifold import MDS # X, _ = load_digits(return_X_y=True) # print (X.shape) # embedding = MDS(n_components=2) # X_transformed = embedding.fit_transform(X[:10]) # print (X_transformed) from scipy.spatial im...
<gh_stars>0 import time import numpy as np from numpy.random import RandomState, SeedSequence, MT19937 import scipy.sparse as sp from scipy.linalg import norm from scipy.sparse.linalg import splu import scipy.io from PCG import PCG from BasicPreconditioner import * from string import Template from KrylovUtils import * ...
<gh_stars>1-10 #============================================================ # File solver.py # # QMINOS as generic LP solver # - including DQQ of Ma et al. # # <NAME>, SBRG, UCSD # # 27 Apr 2016: first version # 05 May 2016: ported from polytope.py from cobrame # 10 May 2016: standalone version # 11 Oct 2018: por...
<filename>feature-generation/calculate_edgeDensity.py ''' Edge Density calculation Detect edges using Canny Edge Detection @author: <NAME>/kkgadiraju Source: http://docs.opencv.org/3.1.0/da/d22/tutorial_py_canny.html ''' import cv2 import struct import random import gdal, ogr, osr from gdalconst import * import numpy ...
<reponame>puyamirkarimi/quantum-walks import numpy as np import matplotlib.pyplot as plt from scipy.stats import binom from scipy import linalg import math from matplotlib.ticker import MultipleLocator N = 60 # number of random steps timesteps = 40 P = 2*N+1 # number of positions gamma = 0.5 # hoppin...
<filename>src/InstPyr/Control/SysId.py # class SysID: # def __init__(self): # pass # # @classmethod # import numpy as np from scipy import signal as sig from scipy import optimize as opt import pandas as pd import matplotlib.pyplot as plt from gekko import GEKKO import math MODELPATH='C:\\Users\\soods\...