text
string
<reponame>jhabriel/mixdim-estimates import scipy.sparse as sps import numpy as np import porepy as pp # Disclaimer: Script copied or partially modified from 10.5281/zenodo.3374624 def run_flow(gb, partition, folder): grid_variable = "pressure" flux_variable = "flux" mortar_variable = "mortar_flux" ...
# -*- coding: utf-8 -*- """ This file contains MLTools class and all developed methods. """ # Python2 support from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from __future__ import print_function import numpy as np import pickle class MLTools(obje...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Copyright 2019 <NAME>, <NAME>, <NAME> Released under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Main clas...
import os import csv import sys import scipy.optimize as opt import scipy.stats as stat from operator import itemgetter import random import numpy as np import numpy.ma as ma import numpy.linalg as la import numpy.testing as npt from brain_diffusion.msd import fillin2, MSD_iteration, vectorized_MMSD_calcs def test_f...
<filename>spearmint/kernels/kernel_utils.py # -*- coding: utf-8 -*- # Spearmint # # Academic and Non-Commercial Research Use Software License and Terms # of Use # # Spearmint is a software package to perform Bayesian optimization # according to specific algorithms (the “Software”). The Software is # designed to automa...
<reponame>s2t2/tweet-analyzer-py<filename>app/ks_test/topic_analyzer.py import os from functools import lru_cache from pprint import pprint from dotenv import load_dotenv import numpy as np from scipy.stats import ks_2samp from pandas import DataFrame, read_csv, concat from app import DATA_DIR from app.decorators.da...
<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Oct 22 16:35:33 2019 @author: nico """ import sys sys.path.append('/home/nico/Documentos/facultad/6to_nivel/pds/git/pdstestbench') import os import matplotlib.pyplot as plt import numpy as np from scipy.fftpack import fft from pdsmodulos.sig...
<gh_stars>0 % % time # # Configure Jupyter so figures appear in the notebook # %matplotlib inline # # Configure Jupyter to display the assigned value after an assignment # %config InteractiveShell.ast_node_interactivity='last_expr_or_assign' # import functions from the modsim.py module from modsim import * from scip...
""" roc_w_tf-servimg.py Sending RGB image tiles to a running tf-serving POST for prediction and plotting ROC curve author: @DevelopmentSeed usage: python3 roc_w_tf-servimg.py --test_path=test \ --keyword1=not_school \ --keyword2=school \ --server_endpoint='http://localhost:8501/v1/models/2nd-...
#!/usr/bin/env python import sys import rospy from hybrid_control_api.srv import * import numpy as np import math from scipy import linalg from keras.models import load_model from keras.models import Model from utils import * # cartesian position of the end effector endEffectorPosition = ( ['end_arm_position_x', 0...
""" waveforms.py ------------ This module provides classes and functions for importing and saving ECG files. By: <NAME>, Ph.D., 2018 """ # Compatibility imports from __future__ import absolute_import, division, print_function # 3rd party imports import os import pickle import pandas as pd import scipy.io as sio # Lo...
#Edited 12/3/17 <NAME> #Functions used to set up the algorithm and perform checks on the given #variables import scipy import numpy import sys import random import QJMCAA import QJMCMath #TESTED def dimensionTest(H,jumpOps,eOps,psi0): #Compare all to the hamiltonian dim = H.get_shape() c = 0 for item in jumpOps:...
<reponame>kipkurui/gimmemotifs # Copyright (c) 2009-2010 <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. """ Odds and ends that for which I didn't (yet) find another place """ # ...
""" Collection of functions used for the stitching. IMPORTANT: The identification of the organization of the fovs in the composite image can be simplified if the (0,0) coords of the stage/camera will be set to the same position for all machine used in the analysis. In our case we started running experiments with the...
def denoise(im, U_init, tolerance=0.1, tau=0.125, tv_weight=100): """ 使用<NAME>(2005)在公式(11)中的计算步骤实现Rudin-Osher-Fatemi(ROF)去噪模型 输入:含有噪声的输入图像(灰度图像)、U 的初始值、TV 正则项权值、步长、停业条件 输出:去噪和去除纹理后的图像、纹理残留""" m, n = im.shape # 噪声图像的大小 # 初始化 U = U_init Px = im # 对偶域的x 分量 Py = im # 对偶域的y 分量 e...
<filename>tests/benchmark_performance_tests/benchmark_performance_report.py import statistics from typing import List, Tuple, TypedDict class BenchmarkPerformanceReportConfig: model_id: int model_name: str model_xml_path: str dataset_id: int dataset_name: int dataset_path: str device_name:...
<filename>Loan-Approval-Analysis/code.py # -------------- # Import packages import numpy as np import pandas as pd from scipy.stats import mode bank=pd.read_csv(path) print(bank) # code starts here categorical_var=bank.select_dtypes(include = 'object') print(categorical_var) numerical_var=bank.select_dtypes(in...
import numpy as np from scipy.ndimage.morphology import binary_dilation def postprocess_ilastik_predictions(prediction, dilation_iterations=1, threshold=.5): """ Postprocess ilastik predictions to get a prediction mask. Arguments: ...
import os import sys import time import pandas as pd import numpy as np from scipy.stats import kurtosis from scipy.stats import skew from statsmodels import robust columns_intermediate = ['frame_no', 'ts', 'ts_delta', 'protocols', 'frame_len', 'eth_src', 'eth_dst', 'ip_src', 'ip_dst', 'tcp_src...
<filename>darch/datasets.py import numpy as np import scipy as sp import tensorflow as tf try: import cPickle except ImportError: import pickle as cPickle import gc import os, sys, tarfile, urllib import scipy.io as sio from scipy.misc import * import argparse import glob from PIL import Image import random c...
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Aug 26 16:34:40 2020 @author: skyjones """ import os import re import shutil import pandas as pd from glob import glob import nibabel as nib import numpy as np import matplotlib.pyplot as plt from scipy import stats from sklearn.ensemble import Isola...
from sympy import ( Basic, Symbol, sin, cos, atan, exp, sqrt, Rational, Float, re, pi, sympify, Add, Mul, Pow, Mod, I, log, S, Max, symbols, oo, zoo, Integer, sign, im, nan, Dummy, factorial, comp, ...
import csv import random from timeit import default_timer as timer from datetime import timedelta import statistics as st Main_list=[] #a String list include alle the file's info with open('european_cities.csv', 'r') as csv_file: csv_file=csv.reader(csv_file) for line in csv_file: for e i...
<filename>facerec_camera/infer_facerec.py import tensorflow as tf k = tf.keras import sys sys.path.insert(0, '.') from facerec_camera.make_database import RetinaFace, FaceRec from scipy.special import softmax import numpy as np import cv2 from typing import List import argparse def main(): physical_devices = tf.con...
# (c) 2019 by Authors # This file is a part of centroFlye program. # Released under the BSD license (see LICENSE file) import argparse import os import subprocess import math import statistics import edlib from collections import defaultdict from utils.os_utils import smart_makedirs from ncrf_parser import NCRF_Report...
import numpy as np from scipy.optimize import curve_fit import matplotlib.pyplot as plt def func_log(x, a, b, c, d): temp = b*x + c return a * np.log(np.where(temp <= 0, 0.0001, temp)) + d def func_gp(x, a, b, c, d): return (a * (1 - np.power(b, x)) / (1 - b)) - c epochs = np.array([ 0.6175, 0.6461, 0.6828,...
<reponame>fhessman/pyFU #!/usr/bin/env python3 # pyfu/wavcal.py import bisect import logging import numpy as np import yaml from astropy.io import fits from astropy.table import Table from scipy import signal, optimize from matplotlib import pyplot as plt from numpy.polynomial.polynomial import polyfi...
<gh_stars>0 from random import randrange import sys from scipy.sparse.csgraph import dijkstra from scipy.sparse import csr_matrix def resolve(input): N, Q = map(int, input().split()) ab = [list(map(int, input().split())) for _ in range(N - 1)] cd = [list(map(int, input().split())) for _ in range(Q)] ...
<reponame>duttm/Octahedra_Nanoparticle_Project import numpy as np import scipy.special as ss from vecPBC import vecPBC def sl_local(self, l): # Define the box dimensions if self.pbc==True: Lx = self.boxBounds[0][1] - self.boxBounds[0][0] Ly = self.boxBounds[1][1] - self.boxBounds[1][0] if self.dim==...
<reponame>akleeman/xray from io import BytesIO import numpy as np import warnings from .. import Variable from ..conventions import cf_encoder from ..core.pycompat import iteritems, basestring, unicode_type, OrderedDict from ..core.utils import Frozen, FrozenOrderedDict from ..core.variable import NumpyArrayAdapter ...
# -*- coding: utf-8 -*- import numpy as np import scipy.io as scio from scipy.spatial.distance import pdist from scipy.spatial.distance import squareform from scipy.sparse import coo_matrix def bins(value): intervals = [(0,2), (2,2.5), (2.5,3), (3,3.5), (3.5,4), (4,4.5), (4.5,5), (5,5.5),...
<reponame>Woffee/deformer import collections from abc import ABC import numpy as np from scipy.special import softmax from sklearn.metrics import accuracy_score from sklearn.metrics import f1_score from common import tf from models import BaseModel class ClassifierModel(BaseModel, ABC): @staticmethod def g...
<filename>geoscilabs/seismic/syntheticSeismogram.py import numpy as np import matplotlib.pyplot as plt import scipy.io from ipywidgets import interact, interactive, IntSlider, widget, FloatText, FloatSlider def getPlotLog(d, log, dmax=200): d = np.array(d, dtype=float) log = np.array(log, dtype=float) dp...
#coding:utf-8 import os import torch import torch.utils.data as data from PIL import Image from scipy.io import loadmat import numpy as np import glob from torchvision import transforms import random import matplotlib.pyplot as plt def colormap(N=256, normalized=False): def bitget(byteval, idx): return ...
import abc import itertools import inspect import pandas as pd import numpy as np from skimage.measure import regionprops_table, perimeter from scipy.ndimage.measurements import labeled_comprehension from scipy.ndimage.morphology import distance_transform_edt from scipy.ndimage import find_objects # TODO test for 3D ...
<filename>dechorate/dechorate_pre2_defined_geometry.py import numpy as np import scipy as sp import pandas as pd import matplotlib.pyplot as plt import pyroomacoustics as pra from dechorate.utils.file_utils import load_from_matlab ## LOAD POSITIONS # load arrays' barycenters positions from file generated in excell #...
""" Aplicação do modelo COPPE-COSENZA. Este exemplo foi baseado na dissertação de mestrado de: MACHADO, <NAME>. Modelagem COPPE-Cosenza de Hierarquia Fuzzy em indicadores de sustentabilidade de distribuidoras de energia elétrica. <NAME>, orientador. Niterói, 2019. 78 f. : il. Fonte: <https:...
""" test: True """ from six.moves import range import numpy as np import sympy as sp import mpi4py.MPI as mpi import pylbm X, Y = sp.symbols('X, Y') rho, qx, qy, T, LA = sp.symbols('rho, qx, qy, T, LA', real=True) def init_T(x, y, Td, Tu, xmin, xmax, ymin, ymax): xmid = (xmax+xmin)/2 print((Tu-Td)*(x<1.2*xm...
from sklearn.ensemble import RandomForestClassifier import numpy as np import os from scipy.misc import imsave,imread from sklearn.grid_search import GridSearchCV from datetime import datetime import cPickle def load_subset(subset): images_labels = {} path_to_images = '/storage/hpc_anna/Kaggle_DRD/imag...
# ----------------------------------------FILTER FUNCTIONS MODULE----------------------------------- # # Module to filter the preprocessed raster stacks to minimize the influence of soil moisture a.s.o. # It is highly recommended to execute this module before analyzing the raster stack! # Make use of small filter size...
import numpy as np import matplotlib.pyplot as plt from scipy import ndimage import json import pytz from datetime import datetime by_mh = np.load('by_mh.npy') data = np.load('data_by_cams_filtered.npy') data[10, 6, 17:22] = 0 data_with_clouds = np.copy(data) for i in range(18): for frame in range(40): ho...
<filename>pandapower/pypower/dAbr_dV.py # Copyright (c) 1996-2015 PSERC. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. """Partial derivatives of squared flow magnitudes w.r.t voltage. """ from scipy.sparse import csr_matrix def dAbr_dV(dSf...
#!/usr/bin/python # -*- coding: utf-8 -*- #------------------------------------------------------------------------------- # Name: metabolicmodel.py # Purpose: MetabolicModel class in mfapy # # Author: Fumio_Matsuda # # Created: 12/06/2018 # Copyright: (c) Fumio_Matsuda 2018 # Licence: MIT li...
<gh_stars>1-10 import numpy as np from matplotlib import pyplot as plt import stat_tools as st from datetime import datetime,timedelta import pysolar.solar as ps from skimage.morphology import remove_small_objects from scipy.ndimage import morphology,sobel from scipy.ndimage.filters import maximum_filter import mncc, g...
<reponame>SFGLab/ChromoLooping<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- """ @author: zparteka """ from peak_stats.reader.peaks import Image, Group, Peak from scipy.spatial import ConvexHull from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np # Histograms glob...
<gh_stars>0 import sys, pickle sys.path.extend(["..","../networks","../simulations"]) from networkConstants import * from stimuliConstants import * from simset_odor import * from moose_utils import * from neuro_utils import * # has the dual exponential functions from data_utils import * from pylab import * # part of...
<filename>src/solvers/QAOA.py<gh_stars>10-100 # Copyright 2021 The QUARK 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/licen...
<reponame>Gibbsdavidl/GeneSignalProc # performing graph segmentation on the scale space import numpy as np import igraph as ig import copy from scipy import stats from sklearn.cluster import KMeans from sklearn.cluster import MiniBatchKMeans import sklearn.preprocessing def loadSignal(filename, header=1, column=1):...
import scipy.sparse as sps class Relation(object): def __init__(self, ot1, ot2, matrix, weight=1): self.matrix = matrix self.ot1 = ot1 self.ot2 = ot2 if matrix is not None: self.matrix = sps.csr_matrix(matrix) if not self.ot1.length or ot1.length <...
from collections import Counter from django.shortcuts import render from django.apps import apps from nltk import word_tokenize from nltk.util import ngrams from statistics import median import datetime import re def search (request): ''' This function renders the natural language data for the corporate t...
<filename>examples/full_gmm_procedure_simul_data.py import numpy as np import dill import pandas as pd from scipy import optimize as opt import time import sys sys.path.append('../') import src #GMM parameters maxiters = 50 #120. About 2 minutes per iteration # Simulation parameters \ ######################## σerror=...
import os import random import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.utils.rnn import PackedSequence from torch.nn.utils.rnn import pad_packed_sequence from torch.autograd import Variable from torch.utils.data import Dataset, DataLoader from sklearn.neighbors impor...
import networkx as nx import scipy import matplotlib.pyplot as plt from networkx.drawing.nx_agraph import write_dot from networkx.drawing.nx_agraph import to_agraph from IPython.display import Image import pygraphviz as pgv def graph(G, color="#cccccc", filename="/tmp/simple.png"): for u, v in G.edges: ...
<reponame>AIRI-Institute/DeepCT import functools import numpy as np import scipy.stats import sklearn.metrics as metrics # Metric helpers which convert float values to binary (0/1). # Regression metrics helper functions. def _to_binary(x: np.ndarray, threshold=0.5) -> np.ndarray: return np.where(x > threshold, ...
import numpy as np import scipy.interpolate as spinterp import scipy.optimize as spopt import vtk import recon #user supplied data #save_path="./20200922_120x60CrossPlyCFRPTestPlate" save_path = "./20201019_120x60CrossPlyCFRPTestPlate_FBH" data_path = "%s" % save_path file_root = "Output_at" data_to_process = "V2" t_...
<reponame>duken72/CV2_WS20_RWTH import argparse import scipy.io from glob import glob import cv2 import numpy as np import plot_utils as utils import pretty_print from tracker import Tracker if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("--input_path", type=str, default="....
<gh_stars>0 import ipdb import numpy as np import pandas as pd import os.path import scipy.spatial.distance as sd from skip_thoughts import configuration from skip_thoughts import encoder_manager from new_model import preprocess_news_df from new_model import clean_sentence def load_with_unidirectional_model(): v...
import scipy.io # mat = scipy.io.loadmat('105_label0.mat') # print(mat['time_stamps'].flatten()) mat = scipy.io.loadmat('categories.mat') print(mat['categories'].flatten())
""" based on https://github.com/xunzheng/notears """ import igraph as ig import matplotlib.pyplot as plt import numpy as np import scipy.linalg as slin import scipy.optimize as sopt from scipy.special import expit as sigmoid def is_dag(W): G = ig.Graph.Weighted_Adjacency(W.tolist()) return G.is_dag() def s...
import torch import numpy as np from scipy.optimize import linear_sum_assignment from pcdet.utils import common_utils from pcdet.ops.iou3d_nms import iou3d_nms_utils from pcdet.models.model_utils.model_nms_utils import class_agnostic_nms def consistency_ensemble(gt_infos_a, gt_infos_b, memory_ensemble_cfg): """ ...
"""Some functions to generate simulated data""" try: from os import link except ImportError: # Hack for windows from shutil import copy2 def link(src, dst): copy2(src, dst) from numpy.random import randn, rand, permutation, randint, seed from numpy import where, nonzero, sqrt, real from numpy ...
<gh_stars>0 #!/usr/bin/env python3 # To run script install libraries using command: # pip install pyabf import numpy as np import matplotlib.pyplot as plt import pyabf import pyabf.tools.memtest from statistics import mean from math import sqrt # Список імен abf файлів без росширення, в лапках, розділені комами FI...
"""Core tensor network tools. """ import copy import functools from operator import add import contextlib import numpy as np import scipy.sparse.linalg as spla import opt_einsum as oe from opt_einsum.contract import parse_backend, _tensordot, _transpose from autoray import conj from ...utils import (oset, valmap, chec...
import numpy as np import scipy import os from scipy.stats import t from yass.template import align_get_shifts_with_ref, shift_chans def connected_components(img, x, y, cc): pixel = [x, y] if (pixel in cc) or (x < 0) or (x >= img.shape[0]) or (y < 0) or (y >= img.shape[1]) or (img[x,y] == 0): return c...
<reponame>lfzarazuaa/LiderSeguidor #!/usr/bin/env python2 # encoding: utf-8 import numpy as np import os import path_parser from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt from matplotlib import cm from matplotlib.ticker import LinearLocator, FormatStrFormatter from scipy.spatial import KDTree ...
<filename>project.py import nltk import random import os from nltk.corpus.reader import CategorizedPlaintextCorpusReader corpusdir = 'txt_sentoken/' # Directory of corpus. mycorpus = nltk.corpus.reader.CategorizedPlaintextCorpusReader(r"C:\Users\amanb_2jhwatd\Desktop\Machine Learning\txt_sentoken",r'(?!\.).*\....
import numpy as np from scipy.stats import linregress import matplotlib.pyplot as plt import bisect def find_ge(a, x): """Find leftmost item greater than or equal to x""" i = bisect.bisect_left(a, x) if i != len(a): return i raise ValueError def mean_clone_size_fit(times, rlam): """For th...
<gh_stars>1-10 #!/usr/bin/env python #----------------------------------------------------------------------------- # Title : pysmurf tune module - SmurfTuneMixin class #----------------------------------------------------------------------------- # File : pysmurf/tune/smurf_tune.py # Created : 2018-08-31...
<reponame>SimoKorkolainen/TrafficDataScienceProject #!/usr/bin/env python3 from PIL import Image Image.MAX_IMAGE_PIXELS = 1000000000 from scipy import misc import numpy as np import math north = 8388608.00 west = -548576.00 tile_size = 1024 #zoom_level = 7 #source_files = ['Taustakartta_320'] #zoom_level = 8 #so...
<gh_stars>0 from numpy import array, linalg, dot from scipy.linalg import lu # System of Equations A = array([[3, -.1, -.2], [.1, 7, -.3], [.3, -.2, 10]], float) B = array([10.3, 33.6, 60.2], float) # Linalg.Solve Function: X = linalg.solve(A, B) print("linalg.solve(A, B) = ", X, end='\n\n'...
import streamlit as st import pandas as pd import pylab as plt import seaborn as sns import datetime as dt import altair as alt import numpy as np from scipy.stats import pearsonr #import geopandas as gpd st.write('hello') df = pd.read_csv('data/df_india_may9.csv') df.ds = pd.to_datetime(df.ds) df = df.set_index('ds'...
<reponame>NumEconCopenhagen/projects-2019-bcg #The OLG Model #%% # 1. Setup #importing the necessary packages import numpy as np import sympy as sm import matplotlib.pyplot as plt import ipywidgets as widgets # 2. Symbolic solution of the Household's (i) and Firm's (ii) problems # (i) Household's problem #%% # Acti...
<reponame>eduardagoulart/my_anime_playlist from pre_processing import DataProcessing import numpy as np from scipy.spatial import distance obj = DataProcessing() type_animes = obj.anime_type() qt_ep = obj.ep() grades = obj.rating() num_members = obj.members() gender = obj.gender() id_anime = obj.id_anime() nodes = op...
# low mass transit lens, no animation. # import modules import numpy as np import matplotlib.pyplot as plt from PIL import Image import scipy from scipy import integrate import project.lensing_function as lensing import matplotlib.widgets as widgets from scipy.signal import find_peaks import timeit # %% # start the ...
""" quakestats Computes some basic statistics for earthquakes in a USGS data feed. The desired feed is specified using severity level and period. Severity level can be "significant", "4.5", "2.5", "1.0", "all". Period can be "hour", "day", "week", "month". Usage: quakestats [options] <level> <period> Options: -h ...
import numpy as np import joblib from scipy.optimize import fmin_bfgs from sklearn.datasets import load_digits from sklearn.linear_model import LogisticRegression from sklearn.model_selection import cross_val_score # Set random seed for reproducibility np.random.seed(1000) nb_unlabeled = 150 # Create a training Lo...
# noinspection PyPackageRequirements import datawrangler as dw import numpy as np import pandas as pd import scipy.interpolate as interpolate from .common import Manipulator from ..core import get def fitter(data, **kwargs): def listify_dicts(dicts): if len(dicts) == 0: return {} ld ...
# -*- coding: utf-8 -*- """ Regularization path OT solvers """ # Author: <NAME> <<EMAIL>> # License: MIT License import numpy as np import scipy.sparse as sp def recast_ot_as_lasso(a, b, C): r"""This function recasts the l2-penalized UOT problem as a Lasso problem. Recall the l2-penalized UOT problem defin...
# Explanations here about what this file does: # https://github.com/guillaume-chevalier/python-signal-filtering-stft # However our signal here is sampled and processed differently. # See function filter_opportunity_datasets_accelerometers below. __author__ = 'gchevalier' import numpy as np from scipy import signal ...
from scipy.io import loadmat import numpy as np import torch import matplotlib.pyplot as plt from models.clstm import cLSTM, train_model_accumulated_ista import argparse import random, os parser = argparse.ArgumentParser() parser.add_argument("-seed", "--seed", help = "0, 1") parser.add_argument("-lam", "--lam", help ...
<filename>FinsterTab/W2020/DataForecast.py # import libraries to be used in this code module import pandas as pd from statsmodels.tsa.arima_model import ARIMA from sklearn.ensemble import RandomForestRegressor from sklearn.svm import SVR from math import sqrt from statistics import stdev import numpy as np import xgboo...
<filename>dannce/engine/generator.py """Generator module for dannce training. """ import os import numpy as np from tensorflow import keras from dannce.engine import processing as processing from dannce.engine import ops as ops from dannce.engine.video import LoadVideoFrame import imageio import warnings import time im...
<reponame>daniel-weisse/irreducible_polynom """ Generate a list of irreducible polynoms over GF(2^n) by testing all possibles """ from pyGF2 import gf2_mul, gf2_div, gf2_add from numpy import array, append, binary_repr, flip, uint8, pad from sympy import mobius, divisors from datetime import datetime from mult...
<reponame>benbokor/secat import pandas as pd import numpy as np import scipy as sp import click import sqlite3 import pickle import os import sys try: import matplotlib matplotlib.use('Agg') from matplotlib.backends.backend_pdf import PdfPages import matplotlib.pyplot as plt except ImportError: plt...
<gh_stars>0 from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import math import random from time import time import numpy as np from scipy.stats import truncnorm import torch import torch.nn as nn import torch.nn.functional as F from open_...
# Collection of small helper functions import numpy as np import pyaudio from scipy.fftpack import fft from .codec import audio_read import logging import decimal import math class _error(Exception): pass def linlin(x, smi, sma, dmi, dma): """Linear mapping Parameters ---------- x : float ...
<filename>src/openeo_processes/cubes.py<gh_stars>0 from datetime import datetime from os.path import splitext from typing import Any, Dict, List import numpy as np import odc.algo import rioxarray # needed by save_result even if not directly called import xarray as xr from openeo_processes.extension.odc import write_...
<reponame>msk-mind/luna # General imports import os, logging, sys import click from luna.common.custom_logger import init_logger init_logger() logger = logging.getLogger('extract_stain_texture') from luna.common.utils import cli_runner _params_ = [('input_slide_image', str), ('input_slide_mask', str), ('output_di...
""" This script contains the main slise functions, and classes """ from __future__ import annotations from typing import Union, Tuple, Callable, List from warnings import warn from matplotlib.pyplot import Figure import numpy as np from scipy.special import expit as sigmoid from slise.data import ( DataScaling...
<gh_stars>0 import numpy as np from sklearn.metrics.pairwise import pairwise_distances from tqdm import tqdm import scipy.ndimage as ndi from .utils import decompose from torchlib import post_processing_func class PQ(object): def __init__(self): pass def iou(self,obj1,obj2): obj1=obj1....
from io import FileIO import numpy as np from scipy import ndimage from matplotlib import pyplot as plt import yaml import csv from PIL import Image import ReferenceModification.LibFunctions as lib class TrackMap: def __init__(self, map_name) -> None: self.map_name = map_name # map info ...
<reponame>WenyinWei/wagglepy<gh_stars>0 from sympy import sin, sinh, pi, symbols a = symbols("a", positive=True) b, t = symbols("b, t", real=True) find_all_trig_period(sin((b**2)*t)+sin(b*t), t)
from __future__ import absolute_import, division, print_function import numpy as np import tensorflow as tf import tensorflow.contrib.keras.api.keras.backend as K from scipy.fftpack import idct from scipy.linalg import pinv from tensorflow.contrib.keras.api.keras.models import Model from tensorflow.contrib.keras.api.ke...
<reponame>ansobolev/PseudoGenerator<filename>pseudogen/generate.py #!/usr/bin/env python """ generate.py contains classes and functions needed to generate and test pseudopotential """ import os import shutil import subprocess import numpy as np from scipy.optimize import minimize orbitals = [(1, 0),(2, 0),(2, 1), ...
<reponame>nuthanmunaiah/xloc import csv import os import sys import statistics from optparse import make_option, OptionValueError from django.conf import settings from django.core.management.base import BaseCommand from app.lib import logger from app.models import Function, File class Command(BaseCommand): opti...
<gh_stars>0 #!/usr/bin/env python3 from typing import List from fractions import Fraction import pathlib import json import shutil import glob import os import argparse import subprocess import re import time def get_files(f, args) -> List[str]: """ given a folder will return all the files that are not txt, ...
<reponame>chenqim/Python3<filename>example/sqrt.py<gh_stars>1-10 # 计算实数和复数平方根 # 导入复数数学模块 import cmath num = int(input("请输入一个数字: ")) num_sqrt = cmath.sqrt(num) print('{0} 的平方根为 {1:0.3f}+{2:0.3f}j'.format(num, num_sqrt.real, num_sqrt.imag))
<reponame>lee-jingu/SSMOECHS<filename>SSMOECHS/main.py import numpy as np import config as cf import networkx as nx import matplotlib.pyplot as plt from network import Energy from network import Network from network import Node from Optimizer import LEACH, PSOECHS, SSMO_MH, SSMO, BSMO, LEACH_C, SSMO2,PSO_C from...
import dolfin as df import numpy as np import scipy.integrate.ode as scipy_ode import matplotlib.pyplot as plt import time from finmag.drivers.llg_integrator import llg_integrator from llb import LLB from finmag.energies import Zeeman from test_exchange import BaryakhtarExchange def cross_times(a,b): assert(...