text
string
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2012 <NAME> <<EMAIL>> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html # # HDP inference code is adapted from the onlinehdp.py script by # <NAME> (chongw at cs.princeton.edu). # http://www.cs.princeton.edu/~chongw/software/onlineh...
""" # ============================================================================= # Creates the stiffness matrix as requested, using the material properties # provided in the TPD file (for v2020 files). # # Author: <NAME>, <NAME> # Copyright (C) 2008, 2015, <NAME>. # Copyright (C) 2020, 2021, <NAME> # =============...
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import torch import theseus as th import theseus.utils.examples as theg import logging import hydra from scipy.io import savemat # Logger l...
import statistics import VegetationModel import math import numpy as np import json from ECAgent.Core import * from ECAgent.Decode import IDecodable from ECAgent.Environments import PositionComponent, discreteGridPosToID from ECAgent.Collectors import Collector, FileCollector from VegetationModel import SoilMoistureC...
import math import random import numpy as np import linecache from scipy import sparse def queryMechanism(S,delta,Ycardinality,dict,dimension): n=len(S) # print(Ycardinality) # print(dimension) tau=Ycardinality gamma=math.sqrt(math.log(2*tau/float(delta))/float(n)) sigma=math.ceil...
''' .. currentmodule:: skrf.constants ======================================== constants (:mod:`skrf.constants`) ======================================== This module contains constants, numerical approximations, and unit conversions .. data:: INF A very very large value (1e99) .. data:: ONE 1 + epsilon...
<reponame>sernamar/python3-oop-book from grader import Assignment class IntroToPython: def lesson(self): return f"""Hello, {self.student}. Define two variables: an integer named a with value 1 and a string named b with value 'hello'.""" def check(self, code): return code == "a = 1\nb ...
"""Construction of nodes and weights for integration.""" import functools import itertools from typing import Iterable, List, Optional, Tuple import numpy as np import scipy.special import scipy.stats from ..utilities.basics import Array, Options, StringRepresentation, format_options class Integration(StringRepres...
<filename>graphgallery/functional/tensor/tensorflow/tensor.py import tensorflow as tf import numpy as np import scipy.sparse as sp import graphgallery as gg from typing import Any from graphgallery import functional as gf from .ops import sparse_adj_to_sparse_tensor _TYPE = { 'float16': tf.float16, ...
<gh_stars>10-100 # From Python # It requires OpenCV installed for Python and OpenPose built with Python API support. # Tested for OpenPose ~1.4.0 import argparse import glob import json import os import sys import time from sys import platform import cv2 import matplotlib.pyplot as plt from scipy.io import savemat fr...
<reponame>dburkhardt/neurips2021_multimodal_viash # Dependencies: # pip: scikit-learn, anndata, scanpy # # Python starter kit for the NeurIPS 2021 Single-Cell Competition. # Parts with `TODO` are supposed to be changed by you. # # More documentation: # # https://viash.io/docs/creating_components/python/ import logging...
<gh_stars>1-10 """Helper functions for TIE. An assortment of helper functions that load images, pass data, and generally are used in the reconstruction. Additionally, a couple of functions used for displaying images and stacks. Author: <NAME>, ANL, Summer 2019. """ import matplotlib.pyplot as plt import matplot...
import numpy as np import matplotlib.pyplot as plt from scipy.stats import chi2 from matplotlib.patches import Ellipse from scipy.special import erf from astroML.plotting.mcmc import convert_to_stdev as cts from scipy.optimize import curve_fit def draw_ellipse(pos, cov, nsig=None, ax=None, label="temp", ...
import os import numpy as np import jax.numpy as jnp import jax from jax import random from flax import linen as nn from flax.training import train_state import optax import tensorflow as tf import tensorflow_datasets as tfds from scipy.stats import truncnorm from flax.training import checkpoints from utils import sav...
<reponame>uoguelph-mlrg/cnn-moth-detection from pipeline import proc_config, load_initial_data_wrap, load_misclf_data_wrap from fileop import loadfile import matplotlib.pylab as plt import numpy as np import random from scipy.misc import imsave import os from config import FigExt def concatenate_images(x_in, pad_size...
<filename>splat/euclid.py<gh_stars>0 from __future__ import print_function, division """ .. note:: These are functions related to the EUCLID analysis based on SPLAT tools """ #import astropy #import copy #from datetime import datetime #import os #import re #import requests #from splat import SPLAT_PATH, SPL...
<gh_stars>0 from statistics import mean import numpy as np import matplotlib.pyplot as plt from matplotlib import style style.use('fivethirtyeight') xs = np.array([1, 2, 3, 4, 5, 6], dtype=np.float64) ys = np.array([5, 4, 6, 5, 6, 7], dtype=np.float64) def best_fit_slope_and_intercept(xs, ys): m = (((mean(xs) * me...
import random import scipy from sklearn import svm from sklearn.base import BaseEstimator from sklearn.ensemble import RandomForestRegressor from sklearn.metrics import make_scorer from sklearn.model_selection import GridSearchCV from utils.dataset import * from utils.stratification import * def set_seed(seed: int ...
<reponame>nd7141/deepr """Build MovieLens dataset as TFRecords.""" import logging from dataclasses import dataclass import numpy as np import deepr as dpr try: import pandas as pd except ImportError as e: print(f"Pandas needs to be installed for MovieLens {e}") try: from scipy import sparse except Impo...
<filename>q2_diversity_lib/beta.py # ---------------------------------------------------------------------------- # Copyright (c) 2018-2020, QIIME 2 development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # -------------...
import numpy as np import matplotlib.pyplot as plt from scipy.optimize import curve_fit import uncertainties as unc from uncertainties import ufloat nSS,startPosSS,endPosSS,medPosSS,nSS,xSS,low_xSS,high_xSS = np.loadtxt(r"2021.11.18 Diffraction - Computing/a-single-slit.csv",delimiter=",",skiprows=1,unpack=True) nDS,s...
<gh_stars>10-100 from __future__ import absolute_import from __future__ import unicode_literals from __future__ import division from __future__ import print_function import numpy as np import os from os.path import join import torch import pandas as pd import scipy.sparse as sp from scipy.sparse import coo_matrix from...
import copy import argparse import time import numpy as np from io import StringIO import itertools import os import sys from timemachine.integrator import langevin_coefficients from jax.config import config as jax_config # this always needs to be set jax_config.update("jax_enable_x64", True) from scipy.stats import...
<reponame>renatkh/cytokinesis<filename>fitEllipse.py """ 2D Ellipse fitting Fits an ellipse to a set of points (x_i, y_i) using the canonical representation: a * x^2 + b * x * y + c * y^2 + d * x + e * y + f = 0 (1) Provided features ----------------- The module provides sev...
# -*- coding: utf-8 -*- """NewsSentiment.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1abfT7VJ4iSrQ38urJdgawlHz79Y4wi4N """ # Commented out IPython magic to ensure Python compatibility. import pandas as pd import numpy as np from scipy.sparse ...
<gh_stars>0 # coding: utf-8 from __future__ import division import cv2 import numpy as np from scipy.spatial import Delaunay def get_aabb(pts): """axis-aligned minimum bounding box""" x, y = np.floor(pts.min(axis=0)).astype(int) w, h = np.ceil(pts.ptp(axis=0)).astype(int) return x, y, w, h def get...
<gh_stars>1-10 # emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the NiBabel package for the # copyright and license terms. ...
from math import * import numpy as np import random from scipy.integrate import odeint from models.agent import * from math import * import numpy as np from numpy.linalg import inv, norm class AUV(Agent): def __init__(self, size, velocity, k): self.size = size self.velocity = velocity self...
<reponame>swami1995/SimuRLacra # Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and # Technical University of Darmstadt. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Red...
<reponame>alorenzo175/pandas # coding=utf-8 # pylint: disable-msg=E1101,W0612 from inspect import getargspec from itertools import product from distutils.version import LooseVersion import nose import random from numpy import nan import numpy as np import pandas as pd from pandas import (Index, Series, DataFrame, i...
import cv2 import numpy as np import os import pickle import sys import argparse from math import floor, pi from matplotlib import pyplot as plt from scipy import interpolate from skimage import transform from hpf import hpf gt="SR_testing_datasets\\Set14_SR\\Set14\\image_SRF_2\\img_014_SRF_2_HR.png" gt=cv2.cvtColor(c...
<gh_stars>1-10 from fractions import Fraction import math from typing import List, Tuple, Union # Last modified by <NAME>. 8/4/2021. Removed RationalBernolli and RationalDiscreteUniform, inlining appropriate rng.integer calls. Removed application of limit_denominator to sigma_sq # Last modified by <NAME>. 29/3/2021. R...
<filename>hmc/applications/fitzhugh_nagumo/fitzhugh_nagumo.py<gh_stars>0 from typing import Callable, Tuple import numpy as np import scipy.linalg as spla import scipy.stats as spst from scipy.integrate import odeint def generate_data( state: np.ndarray, t: np.ndarray, sigma: float, a...
''' pip install python_speech_features ''' from python_speech_features import mfcc from python_speech_features import delta from python_speech_features import logfbank import scipy.io.wavfile as wav (samplerates, signal) = wav.read('mask-100-550.wav') mfccfeatures = mfcc(signal, samplerates) dmfccfeature = delta(mfcc...
<reponame>oskarikerppo/simulated-tomography import matplotlib.pyplot as plt import numpy as np from pathlib import Path import pickle import os from scipy import stats import plot_settings #Initialize plot settings PlotSettings = plot_settings.PlotSettings() plt.rcParams.update(PlotSettings.tex_fonts) fig_size = Pl...
'''This example uses a convolutional stack followed by a recurrent stack and a CTC logloss function to perform optical character recognition of generated text images. I have no evidence of whether it actually learns general shapes of text, or just is able to recognize all the different fonts thrown at it...the purpose ...
import timeit import numpy as np import numpy.linalg from scipy.linalg import cho_factor, cho_solve # We are trying to solve the following system # (A.T * A) * x = A.T * b # Where x are the polynomial coefficients and b is are the input points # First we build A deg = 3 x = np.arange(50 * 1.0) A = np.vstack(tuple(x*...
""" Main implementation of parcel model. """ from __future__ import print_function from __future__ import absolute_import from builtins import zip from builtins import range from builtins import object import os from scipy.optimize import bisect # Parcel model imports from . import constants as c from . import outpu...
<reponame>terrencetec/kontrol """Tests for kontrol.sensact.calibration submodule""" import numpy as np import scipy.special import kontrol.sensact def test_calibrate(): """Tests for kontrol.sensact.calibration.calibrate""" # Test method="linear" xdata = np.linspace(-1, 1, 1000) m = np.random.random()...
<reponame>xieshentoken/Capacitance-contribution-fit import re import sys from collections import OrderedDict from tkinter import * from tkinter import colorchooser, filedialog, messagebox, simpledialog, ttk # MacOS下使用这两行,Win下可以注释掉———————————————————— import matplotlib matplotlib.use("TkAgg") #————————————————...
<reponame>CuriBio/mantarray-waveform-analysis<gh_stars>0 # -*- coding: utf-8 -*- """Detecting peak and valleys of incoming Mantarray data.""" from functools import partial from typing import Any from typing import Dict from typing import Iterable from typing import List from typing import Optional from typing import T...
''' GSAlg.py Implementation of Gibbs Sampling for bnpy models For more info, see the documentation [TODO] ''' import numpy as np import scipy.sparse as sp from collections import defaultdict from LearnAlg import LearnAlg class GSAlg(LearnAlg): def __init__(self, **kwargs): ''' Create GSAlg, subtype of ...
<reponame>ZedThree/tokamesh from numpy import linspace, array, zeros, sqrt, sinc from scipy.sparse import csc_matrix from numpy.random import multivariate_normal from scipy.integrate import quad, simps from tokamesh.construction import equilateral_mesh from tokamesh import TriangularMesh from tokamesh.geometry import...
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright (c) 2020 <NAME> <<EMAIL>> # # Distributed under terms of the MIT license. """ Utilities """ import torch import yaml import numpy as np from pathlib import Path import soundfile as sf import librosa import logging import matplotlib as mpl ...
''' <NAME> Assignment: Fantastic Landscape ''' from cmath import log import random #Commands of Program Commands = ("walk", "end", "log") #First Halves of Location Names Locations_Partone = ("Xialtha", "Saintsteel", "Ecclesia", ...
<gh_stars>1-10 import warnings warnings.filterwarnings('ignore') import matplotlib matplotlib.use("Agg") import matplotlib.pylab as plt import os import sys import time import numpy as np from scipy.io.wavfile import write sys.path.insert(0, 'tacotron2') import numpy as np import torch from hparams import create_hp...
#!/bin/env python3 """Main executable for running puppetmaster.""" import bisect import json import os import random import statistics from argparse import ArgumentParser, Namespace from multiprocessing import Pool from pathlib import PurePath from typing import Dict, List, Sequence, Set try: import matplotlib.pyp...
<gh_stars>0 from path import Path import numpy as np import sys import matplotlib.pyplot as plt from scipy.signal import savgol_filter skeleton_name = ["Bip001", 'Bip001 Pelvis', 'Bip001 Spine', 'Bip001 Spine1', 'Bip001 Spine2', 'Bip001 Neck', 'Bip001 Head', 'Bip001 HeadNub', 'Bip001 L Clavicle', 'Bip...
<reponame>caos21/ndust<gh_stars>1-10 # -*- coding: utf-8 -*- """ Created on Tue Nov 22 21:10:56 EST 2016 @author: ben """ # Using encoding # -*- coding: utf-8 -*- __author__ = "<NAME>" __copyright__ = "Copyright 2017, <NAME>" __license__ = "Apache v2.0" __version__ = "0.1.0" __email__ = "<EMAIL>" __status__ = "Develop...
# Copyright 2020 The PGDL Competition organizers. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
#!/usr/bin/env python # coding: utf-8 # # Lotka-Volterra in Drug Discovery # The Lotka-Volterra Model is not limited to predator-prey models. It has been applied over the past few decades to # the study of evolutionary biology. When treating humans or animals with drugs that aim to rid the body # of pathogens ...
<filename>Naive Bayes Classifier - Vocabulary data/src/subset_selector.py<gh_stars>0 #!/usr/bin/env python from sklearn.datasets import fetch_20newsgroups from sklearn.feature_extraction.text import CountVectorizer from scipy.stats import entropy import vocabulary_io DATA_HOME = "../data/"; def calculateWordInforma...
<reponame>raamana/hiwenet<filename>hiwenet/more_metrics.py """ Module implementing additional metrics for edge weights. """ from sys import version_info if version_info.major > 2: from hiwenet.utils import check_array else: raise NotImplementedError('hiwenet supports only Python 3 or higher!') __all__ = ['d...
<filename>qiskit/opflow/gradients/derivative_base.py # This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/license...
from abc import ABC, abstractmethod import numpy as np import scipy.stats class normaliser(ABC): @abstractmethod def normalise(self, y_true, y_pred, *args, **kwargs): """ Normalises predicted values, e.g. to account for things like: "Had I known at day x that so many people had died alr...
<gh_stars>0 import allel, scipy, keras, pickle from keras import backend as K import numpy as np from siamese_nucvar import SiameseNetwork from sklearn import manifold import pandas as pd #from matplotlib import pyplot as plt cor = lambda a,b: np.corrcoef(a,b)[1][0] spearman = lambda a,b: scipy.stats.spearmanr(a,b)[0]...
<reponame>weijiawu/Unconstrained-Text-Detection-with-Box-Supervisionand-Dynamic-Self-Training import os import sys import torch cur_path = os.path.abspath(os.path.dirname(__file__)) root_path = os.path.split(cur_path)[0] sys.path.append(root_path) from torchvision import transforms from PIL import Image from segmentr...
<reponame>griffin-h/floyds_pipeline #!/usr/bin/env python import os import matplotlib matplotlib.use('Agg') import pyfits import numpy import scipy import pylab import sys import math import logging import glob import string # New style plotting import plot_xmlguideinfo as plot_guideinfo from pyfits import open as po...
# -*- coding: utf-8 -*- """ File Name: dicom_utils Description : dicom处理工具类 Author : mick.yi date: 2019/4/4 """ import os import numpy as np import pydicom as dicom from matplotlib import pyplot as plt from scipy import ndimage as ndi from skimage.segmentation import clear_border from s...
<gh_stars>1-10 # -*- coding: utf-8 -*- """ Created on Thu Mar 29 11:39:05 2018 @author: garvit """ import scipy.stats as ss from decimal import Decimal import math as m import numpy as np from datetime import date,timedelta from mibian import BS def call_bsm (S0,K,r,T,Otype,sig): d1 = Decimal(m.lo...
import json import os import warnings import cv2 import numpy as np import scipy from common import utils from tensorflow import cast from tensorflow.keras.utils import Sequence class SegmentationDataset: def __init__(self, images_dir=None, class_key='object', augmentation=None, preprocess_tran...
<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jan 17 12:37:58 2017 @author: weir """ import numpy as _np import os as _os import matplotlib.pyplot as _plt from scipy import signal as _sig #import scipy.signal.correlate as xcorr from FFT.fft_analysis import fftanal, butter_lowpass #fro...
<filename>post_proc/errors_calc2_geospr.py<gh_stars>0 # -*- coding: utf-8 -*- ## # \file errors_calc2_geospr.py # \title Calculation of the errors and norms for the case1: # geometrical spreading. # \author <NAME> # \version 0.1 # \license BSD 3-Clause License # \inst UMRAE (Ifsttar Nantes), LA...
from typing import Any import os import pytest import numpy as np from scipy import sparse from jina import Flow, Document, DocumentArray, requests, Executor from tests import validate_callback cur_dir = os.path.dirname(os.path.abspath(__file__)) TOP_K = 3 @pytest.fixture(scope='function') def num_docs(): ret...
<filename>grama/mutate_helpers.py __all__ = [ "abs", "sin", "cos", "log", "exp", "sqrt", "pow", "floor", "ceil", "round", "as_int", "as_float", "as_str", "as_factor", "fct_reorder", "fillna", "qnorm", "pnorm", "dnorm", "pareto_min", ] from...
<gh_stars>0 from satlasaddon import RateModelDecay, RateModelPolar, convolve_with_gaussian import satlas as sat sat.set(['standard']) import numpy as np import matplotlib.pyplot as plt import scipy.constants as csts import copy EV_TO_MHZ = csts.physical_constants['electron volt-hertz relationship'][0] * 1e-6 model_de...
<gh_stars>0 import numpy from ase.io.cube import read_cube_data from ase.build import make_supercell from ase.visualize.plot import plot_atoms import os, os.path from os.path import exists, join, dirname import matplotlib.pyplot as plt plt.style.use("science") from scipy.interpolate import griddata img_path = join...
# -*- coding: utf-8 -*- """ Created on Thu Sep 28 13:49:12 2017 @author: ekrupczak on LaVision Check time separation between frames from UTC file """ import pandas as pd import datetime as dt from fractions import Fraction if __name__ == "__main__": # camera = "tower_EO_12mm" # camera = "pier_EO_08mm" cam...
#!/usr/bin/env python #Bodies at Rest: Code to visualize real dataset. #(c) <NAME> #Major updates made for CVPR release: December 10, 2019 import numpy as np import random import copy import sys import os sys.path.append(os.path.abspath('..')) sys.path.insert(0, '../lib_py') import lib_pyrender_basic as libPyRender...
<reponame>Carlosriosch/BrucellaMelitensis # -*- coding: utf-8 -*- from __future__ import division import numpy as np from scipy import stats from operator import itemgetter import glob # para una comunidad def etapa_4(numero_de_comunidades, size_comunidad): path_input = "./4/" #input_files = ["./4/communit...
#! /usr/bin/env python from test.fail import As_fail, Y_fail from scipy.stats import ortho_group import unittest import numpy as np import os, sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from functools import reduce from src.operations import invert from src.kronprod import KronPro...
''' Schema of virus ''' import re import os from datetime import datetime import numpy as np import scipy.io as sio import datajoint as dj import h5py as h5 from . import reference, subject, utilities, stimulation schema = dj.schema(dj.config['custom'].get('database.prefix', '') + 'virus') @schema class VirusSourc...
<reponame>scottbreitenstein/laserbeamsize<gh_stars>0 # pylint: disable=invalid-name # pylint: disable=too-many-locals # pylint: disable=too-many-arguments # pylint: disable=too-many-statements # pylint: disable=too-many-lines # pylint: disable=protected-access # pylint: disable=consider-using-enumerate """ A module fo...
<reponame>hiroyasuakada/ros_start from PIL import Image from pathlib import Path import os, glob, argparse import numpy as np import cv2 import matplotlib.pyplot as plt from skimage.measure import compare_mse, compare_psnr, compare_ssim import csv from statistics import mean, median, variance, stdev from natsort import...
import argparse import h5py import numpy as np import scipy.sparse as sp def import_class(name): try: components = name.split('.') module = __import__(components[0]) for c in components[1:]: module = getattr(module, c) except AttributeError: module = None retur...
from scipy.stats import randint as sp_randint from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier, ExtraTreesClassifier from sklearn.neural_network import MLPClassifier from sklearn.linear_model import LogisticRegression from sklearn.svm import SVC from sklearn.neighbors import KNeighborsCla...
<filename>ccyclegan_t20.py from __future__ import print_function, division import scipy from keras.datasets import mnist from keras_contrib.layers.normalization.instancenormalization import InstanceNormalization from keras.layers import Input, Dense, Reshape, Flatten, Dropout, Concatenate from keras.layers import Batc...
import matplotlib.pyplot as plt import numpy as np import scipy.interpolate from functions import * ##### Plot basic spline ###### x = np.array([0, 0.1, 0.2, 0.5, 0.7, 1.0]) spline = cubic_spline( x, x**3, 0, 3 ) x = np.linspace(0,1,50) y = x**3 + 0.1 yhat = spline(x) plt.plot(x, y, label='x^3 + 0.1') plt.plot...
<gh_stars>0 #!/usr/bin/env python3 from argparse import ArgumentParser from typing import List, Dict, Sequence import numpy as np import pandas as pd import matplotlib.pyplot as plt import scipy.stats as st from blau import BlauState, BlauAgent def main(): ap = ArgumentParser() ap.add_argument('--num_players...
import numpy as np import pickle import matplotlib.pyplot as plt from scipy.interpolate import griddata def get_barycentric_coords(tensor): """ :param tensor: 3x3 anisotropic Reynolds stress tensor :return: x and y barycentric coordinates """ # Compute barycentric coordinates from the eigenvalues ...
import matplotlib.text as text import pandas as pd import numpy as np import pylab as pl import scipy as sp import re #from IPython.core.debugger import set_trace import rpy2 from rpy2.robjects.packages import importr from rpy2.robjects import pandas2ri,FloatVector,ListVector from rpy2.rinterface import NULL import s...
<filename>test_net.py<gh_stars>1-10 # -------------------------------------------------------- # Tensorflow Faster R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by <NAME>, <NAME>, based on code from <NAME> # -------------------------------------------------------- from __future__ import abs...
<filename>rlapy/utils/sketching.py<gh_stars>1-10 import warnings import numpy as np import scipy.linalg as la import scipy.sparse as spar from scipy.fft import dct import scipy.sparse.linalg as sparla def orthonormal_operator(n_rows, n_cols, rng): if n_rows < n_cols: return orthonormal_operator(n_cols, n_...
import sympy from einsteinpy.symbolic.tensor import Tensor class MetricTensor(Tensor): """ Class to define a metric tensor for a space-time """ def __init__(self, arr, syms, config="ll"): """ Constructor and Initializer Parameters ---------- arr : ~sy...
<filename>econpizza/shooting.py<gh_stars>1-10 #!/bin/python # -*- coding: utf-8 -*- import sys import time import numpy as np import scipy.optimize as so from numba import njit, prange def solve_current(model, shock, XLag, XLastGuess, XPrime, tol): func = model["func"] pars = np.array(list(model["parameters...
# coding=utf-8 # Copyright 2021 The Uncertainty Baselines Authors. # # 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 ap...
import numpy as np import pandas as pd import xarray as xr import Grid import pf_dynamic_sph from scipy.io import savemat, loadmat import os from timeit import default_timer as timer import sys from copy import deepcopy if __name__ == "__main__": start = timer() # ---- INITIALIZE GRIDS ---- (Lx, Ly, Lz)...
#!/usr/bin/env python3 import os import tensorflow as tf import cv2 from deepgaze.head_pose_estimation import CnnHeadPoseEstimator from pathlib import Path import json import argparse import tqdm from scipy.spatial.distance import cosine as cosineDS os.environ["CUDA_VISIBLE_DEVICES"] = "1" PARSER = argparse.ArgumentPa...
<filename>crys3d/hklview/cmdlineframes.py from __future__ import absolute_import, division, print_function # TODO: # - prompt user for missing symmetry # - cached scenes r""" Load mtz file for viewing reflections in a webbrowser using NGL. Webbrowser input is a javascript file that together with ngl.js displays ...
import numpy as np import pandas as pd from datetime import datetime import time import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.tree import DecisionTreeClassifier from sklearn.neural_network import MLPClassifier from sklearn.svm import LinearSVC from sklearn.n...
<reponame>shilpiprd/sympy<filename>sympy/sets/handlers/intersection.py from sympy import (S, Dummy, Lambda, symbols, Interval, Intersection, Set, EmptySet, FiniteSet, Union, ComplexRegion, Mul) from sympy.multipledispatch import dispatch from sympy.sets.conditionset import ConditionSet from sympy.set...
<gh_stars>0 ''' Course_eval : “Course overall” teaching evaluation score, on a scale of 1 (very unsatisfactory) to 5 (excellent) Beauty: Rating of instructor physical appearance by a panel of six students, averaged across the six panelists, shifted to have mean zero ''' import matplotlib.pyplot as plt import panda...
<filename>src/ramp_systems/decomposition.py<gh_stars>0 """ Functions for decomposing a RampSystem at a loop characteristic cell. """ import DSGRN import numpy as np from ramp_systems.cyclic_feedback_system import CyclicFeedbackSystem import dsgrn_utilities.graphtranslation as Gtrans import itertools import sympy from ...
<reponame>frico21/ferpy #!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Sun Jun 3 13:27:06 2018 @author: frico python 3.7.1 """ version = '2' """ He comentado las lineas 79-82 de colis/hc3n_h2_faure16.f """ from ferpy import radtrasf_hc3n_runner_v6 as radtransf_hc3n from ferpy import radtransf_modelp...
import numpy as np import matplotlib.pyplot as plt from scipy.optimize import brenth, root, brentq, bisect from scipy.constants import c, pi from scipy.special import jv, kv, jvp, kvp from scipy.interpolate import interp1d from scipy.integrate import simps import sys import warnings from pprint import pprint from math...
<filename>gravity/gravity7_exp_reshape.py # https://stackoverflow.com/questions/47295473/how-to-plot-using-matplotlib-python-colahs-deformed-grid """ 仍然有缺陷 1. 靠近边缘变化太剧烈 2. 靠近边缘的侵占而不是挤压后面的图形 3. 1 1 这个格点绘制的很奇怪 4. 靠近两个坐标轴的,坐标轴方向压缩了,另一个坐标轴方向却放大了。这感觉好像不太对呀。应该是各个方向都压缩 但如果是各个方向都压缩,那要如何绘制呢?如果一个区域,各个单元格都缩小了,那就会产生空隙,这感觉也不对。 或者是...
import shutil import subprocess import tempfile from pathlib import Path from typing import Union from zipfile import ZipFile import zipfile from io import RawIOBase import numpy as np from scipy.spatial.transform import Rotation from d3d.abstraction import (ObjectTag, ObjectTarget3D, Target3DArray, ...
import numpy as np from scipy.stats import norm import pandas from models import ClassificationModel import tensorflow as tf mnist = tf.keras.datasets.mnist (x_train, y_train),(x_test, y_test) = mnist.load_data() x_train, x_test = x_train / 255.0, x_test / 255.0 def reshape_img(a): flat = a.reshape((a.shape[0],a....
<filename>flownet.py import os os.environ['TF_CPP_MIN_LOG_LEVEL']='2' from keras.engine.topology import Layer from keras.models import Model, Sequential from keras import activations from keras.layers import Activation, Input, Reshape, merge, Lambda, Dropout, Flatten, Dense,LSTM from keras.layers.merge import add,conca...
<filename>instagram_aauto_account_liker/content processing/aspect_ratio_change.py import cv2 import os from pathlib import Path from fractions import Fraction as frac from moviepy.editor import * def correct_size(height,width): new_width ,new_height = 0,0 if height <= width: new_height = heigh...