text string |
|---|
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 16 16:13:39 2021
@author: ruizca
"""
import matplotlib.pyplot as plt
import numpy as np
from astropy import units as u
from astropy.coordinates import SkyCoord, FK5
from astropy.table import Table, unique, join
from astropy.utils.console import color_print
from astropy_he... |
<filename>gisele/Spiderman.py
import math
import time
import networkx as nx
from scipy import sparse
from gisele.functions import *
from gisele import dijkstra
def spider(geo_df, gdf_cluster_pop, line_bc, resolution, gdf_roads,
roads_segments,Roads_option,Rivers_option,roads_weight, branch_points=None):
... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# 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/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
<filename>dpmeans/dpmeans.py
"""
DP-means clustering
"""
import numpy as np
from .clustering import Clustering
from scipy import ndimage
from scipy.spatial import cKDTree
from sklearn.neighbors import BallTree
class DPMeans(object):
batch_size = 1000
eps = 1e-100
@property
def cutoff(self):
... |
<reponame>rameshnair007/SR-cycleGAN
# -*- coding: utf8 -*-
import nibabel as nib
import os
import random
import math
from skimage.measure import block_reduce
import scipy
from scipy.ndimage.interpolation import zoom
from scipy.ndimage.filters import gaussian_filter
import numpy as np
import cv2
#import pa... |
<reponame>shipci/sympy
from sympy import Rational
from sympy.polys.domains import ZZ, QQ
from sympy.polys.rings import ring
from sympy.polys.ring_series import (_invert_monoms, rs_integrate,
rs_trunc, rs_mul, rs_square, rs_pow, _has_constant_term,
rs_series_inversion, rs_series_from_list, rs_exp, rs_log, rs_newton,... |
"""
Original code:
Mask R-CNN
Train on the toy Balloon dataset and implement color splash effect.
Copyright (c) 2018 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by <NAME>
------------------------------------------------------------
Adapted by <NAME>, <NAME> and <NAME> for m... |
import os
import copy
import time
import pickle
import random
import logging
import argparse
from collections import deque, defaultdict
from heapq import heappop, heappush, heapify
from functools import reduce
from itertools import product
from tqdm import tqdm, trange
import numpy as np
import scipy.sparse as sp
from... |
import igl
import numpy as np
import scipy
import scipy.io
import torch
import trimesh
def random_rotation_matrix():
"""Generate a random 3D rotation matrix."""
Q, _ = np.linalg.qr(np.random.normal(size=(3, 3)))
return Q
def random_scale_matrix(max_stretch):
"""Generate a random 3D anisotropic scali... |
<reponame>rsampaths16/ReRes
import numpy
import scipy
import cv2
from scipy import misc
from matplotlib import pyplot
from numpy import random
from keras.layers import Input, LeakyReLU, BatchNormalization, concatenate
from keras.layers import Conv2D, Conv2DTranspose, MaxPooling2D
from keras.layers import Flatten, Dense... |
<reponame>mjjjjm/helmholtz
import os, sys, time
import numpy as np
import dolfin as df
from HelmholtzSolver import *
from scipy.special import hankel1
#import matplotlib.pylab as plt
#from mpl_toolkits.mplot3d import Axes3D
#from matplotlib import cm
## ===============================================================... |
import os
import re
import statistics
def find_all_key_files_path(directory, keyfile_name):
fn = re.compile(".*"+keyfile_name+".*txt")
path=[]
for root, dirs, files in os.walk(directory):
for file in files:
if fn.match(file) is not None:
#print(file)
path... |
<gh_stars>1-10
"""
@title: titration_class.py
@author: <NAME>
This file can be used to simulate titration curves.
First, use the Compound class to create a titrant and an analyte.
Second, pass in the analyte and titrant to the Titration class,
along with the concentrations and volumes of the analyte and titrants... |
import math
import numpy as np
from scipy.spatial.transform import Rotation as R
from sample_script import BresenhamInt3D
def BresenhamVec3D(vec1: list, vec2: list):
return BresenhamInt3D(vec1[0], vec1[1], vec1[2], vec2[0], vec2[1], vec2[2])
def get_points(origin, distance, angle, min_clip, max_clip):
point... |
<gh_stars>0
import numpy as np
import pydart2 as pydart
import math
import IKsolver
import QPsolver
import IPC_1D
from scipy import interpolate
class MyWorld(pydart.World):
def __init__(self, ):
pydart.World.__init__(self, 1.0 / 1000.0, './data/skel/cart_pole_blade.skel')
# pydart.World.__init__(se... |
# ===========================================
#
# mian Analysis Alpha/Beta Diversity Library
# @author: tbj128
#
# ===========================================
#
# Imports
#
#
# ======== R specific setup =========
#
import logging
import rpy2.robjects as robjects
import rpy2.rlike.container as rlc
from rpy2.robjects... |
#!/usr/bin/env python3
import argparse
import os
import sys
import re
import math
import warnings
import time
import struct
from collections import defaultdict
import pandas as pd
import numpy as np
import hicstraw
import cooler
from scipy.stats import expon
from scipy.ndimage import gaussian_filter
from scipy.ndimag... |
<filename>Project1 - Linear Regression/main.py
import numpy
from scipy.stats import norm
#import matplotlib.pyplot as plot1
from math import log1p, pi
import xlrd
def log_like(y, x):
x0 = 1
a11 = 0
a12 = 0
a21 = 0
a22 = 0
for i in range(49):
a11 = a11 + (x0 * x0)
a12 = a12... |
# Copyright 2019 United Kingdom Research and Innovation
# Author: <NAME> (<EMAIL>)
'''
RALEIGH (RAL EIGensolvers for real symmetric and Hermitian problems) core
solver.
For advanced users only - consider using more user-friendly interfaces in
raleigh/interfaces first.
Implements a block Conjugate Gradient algorith... |
<reponame>liyuan9988/IVOPEwithACME
# pylint: disable=bad-indentation,missing-function-docstring
import functools
from acme.tf import networks
import tensorflow as tf
import numpy as np
from scipy.spatial.distance import cdist
import sonnet as snt
def get_bsuite_median(environment_spec, dataset):
data = next(iter(... |
<gh_stars>0
"""
Module defining oncentration-mass relations.
This module defines a base :class:`CMRelation` component class, and a number of specific
concentration-mass relations. In addition, it defines a factory function :func:`make_colossus_cm`
which helps with integration with the ``colossus`` cosmology code. With... |
<reponame>AxelGard/university-projects
import numpy as np
from scipy import signal, misc, ndimage
import cv2
from matplotlib import pyplot as plt
plt.rcParams['image.interpolation'] = 'nearest'
import jpeglab as jl
class Error: # Also exists in preamble
def __init__(self, original, altered):
self.mse = np.... |
<reponame>svenpruefer/astrodynamics
##########################################
# Import necessary classes and libraries #
##########################################
from celestial_object import *
from kepler import *
import numpy as np
from scipy.optimize import fsolve
import matplotlib.pyplot as plt
from mpl_toolkits... |
<gh_stars>0
"""
-----------------------------
Author: <NAME>
Email: <EMAIL>
-----------------------------
Functions for testing whether an object can be searched
"""
import matplotlib.pyplot as plt
from scipy.stats import chisquare, kstest
from tabulate import tabulate
def is_array_correct_format(
array: list, ... |
# coding: utf-8
# In[7]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
get_ipython().run_line_magic('matplotlib', 'inline')
import seaborn as sns
from sklearn import datasets
from sklearn.ensemble import RandomForestRegressor
from sklearn.model_selection import train_test_split
# In[8]:
... |
<gh_stars>0
import scipy
from scipy.sparse import csr_matrix
from sklearn.metrics import accuracy_score, precision_recall_fscore_support
X_train = scipy.sparse.load_npz('X_train.npz')
Y_train = scipy.sparse.load_npz('Y_train.npz')
X_test = scipy.sparse.load_npz('X_test.npz')
Y_test = scipy.sparse.load_npz('Y_... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import numpy as np
import tensorflow as tf
from scipy import misc
app_path = os.environ['APP_PATH']
for p in app_path.split(';'):
sys.path.append(p)
import os
import co... |
<reponame>GrumpySapiens/scikit-elm
"""
High-level Extreme Learning Machine modules
"""
from __future__ import annotations
import numpy as np
import warnings
from scipy.special import expit
from typing import Protocol, Iterable, cast, Optional
from numpy.typing import ArrayLike
from sklearn.base import BaseEstimator,... |
import numpy as np
import scipy.integrate
import scipy.interpolate
def ddeint(func, y0, t, tau, args=(), y0_args=(), n_time_points_per_step=None):
"""Integrate a system of delay differential equations defined by
y' = f(t, y, y(t-tau1), y(t-tau2), ...)
using the method of steps. All tau's are assumed c... |
<filename>term_structures/surface.py
from scipy import interpolate
# pylint: disable=too-few-public-methods
# pylint: disable=invalid-name
class Surface:
def __init__(self, first_axis: list, second_axis: list, values: list):
self.first_axis = first_axis
self.second_axis = second_axis
self.... |
from textbrewer.distiller_utils import *
from textbrewer.distiller_basic import BasicDistiller
from pyemd import emd_with_flow
from scipy.special import softmax
class EMDDistiller(BasicDistiller):
"""
BERT-EMD
Args:
train_config (:class:`TrainingConfig`): training configuration.
distill_c... |
<reponame>aounleonardo/intrinsicImageDecomposition<gh_stars>1-10
import numpy as np
from scipy import misc
import os
FLAG = '/cvlabdata1/cvlab/datasets_aoun/flag_2/'
IMAGES = 'images/'
ALBEDOS = 'albedos/'
SHADINGS = 'shadings/'
SYNTHS = 'synths/'
TYPE = 'b31_tl_tr-cotton'
NAME = f'sh-{TYPE}_t-cat_flowers_'
TYPE += '... |
# -*- coding: utf-8 -*-
# evaluate registration error and write into csv
import pandas as pd
import skimage.io as skio
import skimage.transform as skt
import scipy.io as sio
from tqdm import tqdm
import os, cv2, argparse
import numpy as np
from glob import glob
from sklearn.decomposition import PCA
from skim... |
import numpy
from numpy import copy
import matplotlib.pyplot as plt
import scipy.integrate as integrate
def solve(aa, bb, cc, dd):
""" Thomas Algorithmus zum Loesen eines tridiagonalen Gleichungssystems
aa -- N-1 Eintraege der unteren Nebendiagonale: (2,1) ... (N, N-1)
bb -- N Eintraege der Hauptdiagona... |
<gh_stars>0
# Script to fit dissociation data to Morse curve
import numpy
import scipy
import matplotlib
import matplotlib.pyplot
from scipy import optimize
# Function to fit:
def morse_curve(Rf, kf, Def, Ref):
E = Def * ( numpy.exp(-2.0*numpy.sqrt(kf/Def)*(Rf-Ref)) - 2.0*numpy.exp(-numpy.sqrt(kf/Def)*(Rf-Ref)) )... |
<reponame>BGU-CS-VIL/JA-POLS<filename>2_learning/Alignment/train.py
from __future__ import division, print_function
import copy
import time
import cv2
import numpy as np
import torch
from scipy.linalg import expm, logm
from utils.image_warping import warp_image
from utils.Plots import *
def train_model(model, dataloa... |
from fractions import gcd
a, b, c, d = raw_input().split(' ')
a = int(a)
b = int(b)
c = int(c)
d = int(d)
mem = {}
done_numbers = set()
count = 0
for i in range(a, b + 1):
for j in range(c, d + 1):
if j in done_numbers:
pass
if (str(j) + " " + str(i)) in mem:
result = mem[str(j) + " " + str(i)... |
import numpy as np
from scipy.spatial import HalfspaceIntersection, ConvexHull
from pano import pano_connect_points
def np_coorx2u(coorx, coorW=1024):
return ((coorx + 0.5) / coorW - 0.5) * 2 * np.pi
def np_coory2v(coory, coorH=512):
return -((coory + 0.5) / coorH - 0.5) * np.pi
def np_coor2xy(coor, z=50... |
import numpy as np
import scipy.sparse as sp
def nonzero_mean(X, axis=0):
"""Compute the mean of non-zero values in a given matrix.
Parameters
----------
X: array_like
axis: int
Returns
-------
np.ndarray
"""
if sp.issparse(X):
if axis == 0:
X = X.tocsc()... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: <NAME>
"""
license = '''
Copyright 2017,2018 <NAME> (Language Technology, Universität Hamburg, Germany)
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... |
import statistics
# This code demonstrates that we have a mode value.
values = [8, 11, 9, 14, 9, 15, 18, 6, 9, 10]
mode = statistics.mode(values)
print(mode)
# This code demonstrates that we cannot calculate mode value because there
# are more then one mode.
values = [8, 9, 10, 10, 10, 11, 11, 11, 12, 13]
mod... |
import numpy
import pytest
from scipy.spatial import Delaunay
import helpers
import optimesh
from meshes import pacman, simple1
@pytest.mark.parametrize(
"mesh, ref1, ref2, refi",
[
(simple1, 4.9863354526224510, 2.1181412069258942, 1.0),
(pacman, 1.9378501813564521e03, 7.5989359705818785e01, ... |
<reponame>jstac/yale_class_2016<filename>main2.py<gh_stars>1-10
"""
Computes equilibrium price and quantities, take 2.
"""
from numpy import exp
from scipy.optimize import bisect
def supply(price, b):
return exp(b * price) - 1
def demand(price, a, epsilon):
return a * price**(-epsilon)
def compute_equilibrium(... |
<gh_stars>0
from dataclasses import dataclass
import numpy as np
import zarr
from dask import array as da
from scipy.spatial.transform import Rotation as R
from create_data import CreateData
from utils.cli import read_args
from utils.logger import logger
from utils.timer import timer
@dataclass
class LinearSearch:
... |
<gh_stars>1-10
#!/usr/bin/env python
from __future__ import division
import os, sys, argparse
import datetime
import gzip
import model
import neural
import scorer
import numpy as np
from sklearn.feature_extraction import DictVectorizer
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import ... |
<filename>src/svm/spam_detector.py
import numpy as np
import matplotlib.pyplot as plt
from scipy.io import loadmat
from sklearn.svm import SVC
from svm import *
from process_email import *
from get_vocab_dict import *
import codecs
def main():
# DATA PREPROCESSING
vocab_dick = getVocabDict()
dick_size = l... |
'''
Name: color_segmentation.py
Version: 1.0
Summary: K-means color clustering based segmentation. This is achieved
by converting the source image to a desired color space and
running K-means clustering on only the desired channels,
with the pixels being grouped into a desired number
... |
<gh_stars>0
# Class that implements isotropic spherical DFs computed using the Eddington
# formula
import numpy
from scipy import interpolate, integrate
from ..util import conversion
from ..potential import evaluateR2derivs
from ..potential.Potential import _evaluatePotentials, _evaluateRforces
from .sphericaldf import... |
import numpy as np
from scipy import constants
from scipy.optimize import curve_fit
import os
from numpy.polynomial import polynomial as poly
from scipy.special import lambertw
# use absolute file path so tests work
path_const = os.path.join(os.path.dirname(__file__), '..', 'constants')
def AM15G_resample(wl):
'... |
# datasets.py
# B11764 Chapter 11
# ==============================================
import os
import numpy as np
import scipy.ndimage as nd
import scipy.io as io
import torch
from torch.utils.data import Dataset
def getVoxelFromMat(path, cube_len=64):
voxels = io.loadmat(path)['instance']
voxels = np.pad(voxe... |
import numpy as np
import csv
from scipy.optimize import minimize
from scipy.spatial.transform import Rotation as R
ID = np.array([
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]
])
def random_unit_vector():
"""Generate a random 3D unit vector
Returns:
np.array: a random 3D un... |
<reponame>aasensio/DeepLearning<gh_stars>0
import numpy as np
import h5py
import scipy.io as io
import sys
import scipy.special as sp
import pyfftw
from astropy import units as u
import matplotlib.pyplot as pl
from ipdb import set_trace as stop
from soapy import confParse, SCI, atmosphere
def progressbar(current, tota... |
<gh_stars>100-1000
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import os, time
import numpy as np
import torch
import json
from log_utils import print_log
from collec... |
<reponame>marchdf/ppm-analysis
#!/usr/bin/env python3
# ========================================================================
#
# Imports
#
# ========================================================================
import numpy as np
import argparse
import matplotlib.pyplot as plt
from matplotlib import rcParams
im... |
import csv
from biosppy.signals import tools as st
from biosignals.BioSignal import BioSignal
from scipy.signal import butter, lfilter
import numpy as np
#from scipy.fftpack import rfft, irfft
class ECG(BioSignal):
# CONSTRUCTORS--------------------------------------------------------------
def __init__(self,... |
import glob
import os
import sys
from deep_utils import dump_pickle, load_pickle
import time
from itertools import chain
from argparse import ArgumentParser
import torch
from pretrainedmodels.utils import ToRange255
from pretrainedmodels.utils import ToSpaceBGR
from scipy.spatial.distance import cdist
from torch.utils.... |
<filename>baseline_fasttext.py<gh_stars>0
import pandas as pd
import fasttext
from scipy.spatial import distance
from itertools import product
import sys
import numpy as np
model = fasttext.load_model("embedding/wiki.en/wiki.en.bin")
#Return sentence embeddings for a list of words
def get_word_embedding(list_of_words... |
<reponame>ayyu/amq-encoding
__all__ = [
'vp9_settings',
'resolutions',
'probe_dimensions',
'encode_webm'
]
from os import devnull
from fractions import Fraction
import subprocess
from typing import Dict
import ffmpeg
from . import common
vp9_settings = {
'c:v': 'libvpx-vp9',
'b:v': 0,
'g': 119,
'... |
import numpy as np
import sys
import math
import sqlite3
import scipy
from scipy.sparse.linalg.isolve import _iterative
from scipy.sparse.linalg.isolve.utils import make_system
import scipy.sparse.linalg
import random
def cgr(A, b, k, eps):
A = np.matrix(A)
b = np.matrix(b)
n = length(b)
residuals = np.zeroes(k,1... |
import matplotlib
matplotlib.use('Agg')
import keras
import numpy as np
import tensorflow as tf
import os
from matplotlib import pyplot as plt
from scipy.cluster.hierarchy import dendrogram
from sklearn.cluster import AgglomerativeClustering
class Cluster():
"""
A class for conducting an cluster study on a trained ... |
import os
import sys
import numpy as np
from scipy.io import wavfile
from time import *
import torch
import utils
from models import SynthesizerTrn
def save_wav(wav, path, rate):
wav *= 32767 / max(0.01, np.max(np.abs(wav))) * 0.6
wavfile.write(path, rate, wav.astype(np.int16))
# define mod... |
<gh_stars>100-1000
import cv2
import numpy as np
from scipy import ndimage
def dog(img, size=(0,0), k=1.6, sigma=0.5, gamma=1):
img1 = cv2.GaussianBlur(img, size, sigma)
img2 = cv2.GaussianBlur(img, size, sigma * k)
return (img1 - gamma * img2)
def xdog(img, sigma=0.5, k=1.6, gamma=1, epsilon=1, phi=1):
... |
import sys
import copy
from pathlib import Path
import fnmatch
import numpy as np
from scipy.interpolate import interp1d, interp2d
import matplotlib.dates as mdates
from matplotlib.offsetbox import AnchoredText
import gsw
from netCDF4 import Dataset
from .. import io
from .. import interp
from .. import unit
from .... |
<gh_stars>0
import sys
import math
import numpy as np
#from sklearn.cluster import KMeans
import cv2
from scipy import ndimage
def mse(imageA, imageB):
# the 'Mean Squared Error' between the two images is the
# sum of the squared difference between the two images;
# NOTE: the two images must have the same dimens... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------
# Filename: trigger.py
# Purpose: Python trigger/picker routines for seismology.
# Author: <NAME>, <NAME>
# Email: <EMAIL>
#
# Copyright (C) 2008-2012 <NAME>, <NAME>
# ------------------------------... |
<reponame>moonieann/welib<gh_stars>10-100
import unittest
import numpy as np
import os
MyDir=os.path.dirname(__file__)
from scipy.integrate import solve_ivp
from welib.airfoils.Polar import Polar
from welib.airfoils.DynamicStall import *
# ----------------------------------------------------------------------------... |
<reponame>CalvinRoth/PriceDiscriminationNewtorks
from __future__ import annotations
import numpy as np
import numpy.linalg as lin
import networkx as nx
import scipy
import scipy.sparse.linalg as slin
import matplotlib.pyplot as plt
# Linear algebra
def specNorm(A: np.matrix) -> float:
return lin.norm(A, ord=2)
... |
<reponame>frederickayala/lbsn_group_recsys
import random
import pandas as pd
import io
import json
from dateutil import parser
from collections import OrderedDict, deque
import time
import csv
import difflib
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
import os
import sys, traceback
from matplo... |
# PyZX - Python library for quantum circuit rewriting
# and optimization using the ZX-calculus
# Copyright (C) 2018 - <NAME> and <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
#... |
<reponame>yoon-gu/chaospy
"""
Algorithm 3.4 of 'Numerical Optimization' by <NAME> and <NAME>
This is based on the MATLAB code from <NAME> <<EMAIL>>:
http://cs.nyu.edu/overton/g22_opt/codes/cholmod.m
"""
import numpy
import scipy.sparse
def gill_king(mat, eps=1e-16):
"""
Gill-King algorithm for modified chol... |
#!/usr/bin/env python
# coding: utf-8
# # BCG Gamma Challenge
# # Libraries
# In[1]:
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from scipy import stats
# In[2]:
pd.set_option('display.max_rows', 500)
pd.set_option('display.max_columns', 500)
# # Dataset
# In... |
'''
This is a set of utility funcitons useful for analysing POD data. Plotting and data reorganization functions
'''
#Plot 2D POD modes
def plotPODmodes2D(X,Y,Umodes,Vmodes,plotModes,saveFolder = None):
'''
Plot 2D POD modes
Inputs:
X - 2D array with columns constant
Y - 2D array with rows ... |
<reponame>tallamjr/fink-filters<filename>fink_filters/filter_rate_based_kn_candidates/filter.py<gh_stars>0
# Copyright 2019-2021 AstroLab Software
# Authors: <NAME>, <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 ob... |
import pickle
import sympy as sym
import numpy as np
from functools import reduce
from itertools import groupby
def lie_bracket(element_1, element_2):
"""
Unfolds a Lie bracket. It is assumed that the second element is homogeneous (the bracket grows to the left).
Returns a string encoding the result of un... |
<gh_stars>0
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.interpolate import CubicHermiteSpline as cbs
from matplotlib.gridspec import GridSpec
from numpy import trapz
import matplotlib as mpl
from scipy.ndimage.filters import uniform_filter1d
mpl.rcParams["axes.spines.top"] = True... |
# -*- codiEEG_dsddsdsng: utf-8 -*-
"""
Created on Mon Jun 29 20:08:11 2020
@author: mahjaf
"""
#%% Import libs
#####===================== Importiung libraries =========================#####
import mne
import numpy as np
from scipy.integrate import simps
from numpy import loadtxt
import h5py
import time
import os
#... |
# Copyright (c) 2018 UAVCAN Consortium
# This software is distributed under the terms of the MIT License.
# Author: <NAME> <<EMAIL>>
# pylint: disable=consider-using-in,protected-access,too-many-statements
import fractions
from . import _any, _primitive, _container, _operator
# noinspection PyUnresolvedReferences,P... |
<filename>dsatools/_base/_imf_decomposition/_emd.py
import numpy as np
import scipy
import scipy.signal
import scipy.interpolate #import Akima1DInterpolator, Rbf, InterpolatedUnivariateSpline, BSpline
def emd(x, order,method = 'cubic', max_itter = 100, tol = 0.1):
'''
Emperical Mode Decomposition (EMD).
... |
<gh_stars>0
import os, fnmatch, sys
import dill as pickle
import scipy.interpolate as interp
import scipy.optimize as opti
import scipy.constants as constants
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import bead_util as bu
import configuration as config
import transfer_func... |
import tensorflow as tf
from hamiltonian import Hamiltonian
import itertools
import numpy as np
import scipy
import scipy.sparse.linalg
class HeisenbergJ1J2(Hamiltonian):
"""
This class is used to define Heisenberg J1-J2 model.
Nearest neighbor interaction along x-, y- and z-axis with magnitude J_1,
n... |
import struct
import cmath
from array import array
# DONE co.w defines if is movable, set 1 for root
# DONE increase sintel scale
# TODO wmtx?
# TODO check if conversion to mesh is required
# TODO remove tmp object
HEADER_SIZE_BYTES = 160
def debug(*argv):
print('[DEBUG]', ' '.join([str(x) for x in argv]))
def to... |
"""
legacyhalos.integrate
=====================
Code to integrate the surface brightness profiles, including extrapolation.
"""
import os, warnings, pdb
import multiprocessing
import numpy as np
from scipy.interpolate import interp1d
from astropy.table import Table, Column, vstack, hstack
import legacyhalos.io
... |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from scipy.integrate import solve_ivp
import math
plt.style.use('ggplot')
def plot_analytical(numerical=False,num_result=None):
if numerical:
z_position= num_result.altitude #altitude
else:
z_position=np.linspace(0,100000,10... |
# Copyright (C) 2020 Denso IT Laboratory, Inc.
# All Rights Reserved
# Denso IT Laboratory, Inc. retains sole and exclusive ownership of all
# intellectual property rights including copyrights and patents related to this
# Software.
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functi... |
<reponame>subond/cloud-radiative-kernels<gh_stars>1-10
#!/usr/bin/env cdat
"""
# This script demonstrates how to compute the cloud feedback using cloud radiative kernels for a
# short (2-year) period of MPI-ESM-LR using the difference between amipFuture and amip runs.
# One should difference longer periods for more ro... |
# srun --mpi=pmi2 -p VI_UC_TITANXP -n1 --gres=gpu:4 python test.py
import os
from os.path import join as opj
import numpy as np
from scipy.spatial.distance import cdist
from tqdm import tqdm
import sys
import re
from sklearn import preprocessing
import multiprocessing
import torch
from torch.optim import lr_schedu... |
#! /usr/bin/env python
from math import ceil, log10, cos, sin, tan, sqrt, pi
from fractions import Fraction
import matplotlib.pyplot as plt
from matplotlib.patches import Arc
from matplotlib import cm
from matplotlib.lines import Line2D
class Lamination:
def __init__(self, period=1, degree=2):
self.degree... |
<reponame>Vivek9Chavan/DeepLearning.AI-TensorFlow-Developer-Professional-Certificate<gh_stars>0
"""
This is is a part of the DeepLearning.AI TensorFlow Developer Professional Certificate offered on Coursera.
All copyrights belong to them. I am sharing this work here to showcase the projects I have worked on
Cour... |
<gh_stars>10-100
from _hashlib import new
import pickle
import random
from scipy.special import expit
import matplotlib.pyplot as plt
import numpy as np
from tentacle.board import Board
from tentacle.dfs import Searcher
from tentacle.dnn3 import DCNN3
from tentacle.game import Game
from tentacle.mcts import MonteCarl... |
<filename>arpym_template/estimation/flexible_probabilities.py
from collections import namedtuple
import pandas as pd
import numpy as np
from scipy.stats import norm
class FlexibleProbabilities(object):
"""
Flexible Probabilities
"""
def __init__(self, data):
self.x = data
self.p = np.on... |
<reponame>ethank5149/PurduePHYS580<filename>Labs/Lab08/integrands.py
from numpy import asarray, sin, cos, pi, cross, sqrt
from numpy.linalg import norm
from scipy.integrate import quad
from functools import partial
def biot_savart(pos, path, dpath, I):
x = quad(partial(lambda s, pos, path, dpath, I : I * ((pos[2] ... |
<filename>pyplan_core/classes/PyplanFunctions.py
import importlib
import ntpath
import os
import re
import subprocess
import time
import numpy as np
import pandas as pd
import xarray as xr
from openpyxl import load_workbook
from .ws.settings import NotLevels
try:
from StringIO import StringIO as BytesIO
except I... |
# -*- coding: utf-8 -*-
"""
Generating the CF-FM synthetic calls
====================================
Module that creates the data for accuracy testing horseshoe bat type calls
"""
import h5py
from itsfm.simulate_calls import make_cffm_call
import numpy as np
import pandas as pd
import scipy.signal as signal
from t... |
import sys, glob, os, scipy
import numpy as np
import pandas as pd
from scipy.optimize import least_squares
from scipy.io import loadmat
import costFunctions
import choiceModels
import penalizedModelFit
base_dir = 'yourprojectfolderhere'
# Arguments
sub = int(sys.argv[1]) # This takes the subject number
niter = int(... |
# Copyright (C) 2013 <NAME>, <NAME>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed i... |
#envio4
# -*- coding: utf-8 -*-
"""
Created on Fri May 31 10:52:39 2019
@author: Leon
"""
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import scipy
from scipy import stats
import pandas as pd
import random
bw = []
with open('bodyweight.txt') as inputfile:
for line in inputfile:
... |
# exercise 11.2.2
import numpy as np
from matplotlib.pyplot import figure, subplot, hist, title, show, plot
from scipy.stats.kde import gaussian_kde
# Draw samples from mixture of gaussians (as in exercise 11.1.1)
N = 1000; M = 1
x = np.linspace(-10, 10, 50)
X = np.empty((N,M))
m = np.array([1, 3, 6]); s = np.array([1... |
<reponame>agonzs11/Polinomio-del-caos
"""Generalized half-logistic distribution."""
import numpy
from scipy import special
from ..baseclass import Dist
from ..operators.addition import Add
from .deprecate import deprecation_warning
class generalized_half_logistic(Dist):
"""Generalized half-logistic distribution.... |
#! /usr/bin/env python
# Author: <NAME> (srinivas . zinka [at] gmail . com)
# Copyright (c) 2014 <NAME>
# License: New BSD License.
import numpy as np
import matplotlib.pyplot as plt
from scipy import special as sp
from scipy import optimize
a = 111e-3
b = 74e-3
e = np.sqrt(1 - b ** 2 / a ** 2)
z = np.arccosh(1 / ... |
<filename>ctdcal/process_ctd.py
import logging
import warnings
from datetime import datetime, timezone
from pathlib import Path
import gsw
import numpy as np
import pandas as pd
import scipy.signal as sig
from . import get_ctdcal_config, io, oxy_fitting
cfg = get_ctdcal_config()
log = logging.getLogger(__name__)
wa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.