text string |
|---|
<reponame>stormi/tsunami
# -*-coding:Utf-8 -*
# Copyright (c) 2015 <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright noti... |
<filename>tracking/test/testCustomTracking.py
import statistics
import time
import cv2 as cv
import tracking.tracker as tr
from detection.yolov3.yolov3 import YoloV3Net, IMAGE_W, IMAGE_H
# from detection.tinyYolo.tinyYoloV3 import TinyYoloV3Net, IMAGE_W, IMAGE_H
from tracking.pairingFunctions import pairWithHistogr... |
<reponame>Oscar015/Ncuerpos
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 24 10:12:42 2021
@author: oscar
"""
import numpy as np
from scipy.constants import astronomical_unit as UA
DictC = {
'sol': {
'masa': 1.9891E30,
'x_0': [0., 0, 0],
'v_0': [0., 0, 0.],
'color': 'yellow'},
... |
from imageai.Detection import ObjectDetection
import warnings
warnings.filterwarnings('ignore')
import cv2
import numpy as np
import os
from scipy import ndimage,misc
import DetectChars
import DetectPlates
import PossiblePlate
from PIL import Image
numbers = {}
# module level variables ###############... |
import scipy.stats
for n in [3030, 1000, 500, 200, 100, 50, 10] :
p = scipy.stats.binom.pmf(n/2, n, 0.5)
p = round(p*100, 2)
print n, " : ", p, " %"
|
"""
Script plots monthly climatology of various climate variables in reanalysis
and the WACCM experiments. These variables are averages over the polar cap.
Notes
-----
Author : <NAME>
Date : 25 February 2019
"""
### Import modules
import datetime
import numpy as np
import matplotlib.pyplot as plt
import cmo... |
<filename>scripts/marker.py
#!/usr/bin/env python
#Code for detecting markers in an image
import cv2
from numpy import mean, binary_repr, zeros
from numpy.random import randint
from scipy.ndimage import zoom
#Set marker size
MARKER_SIZE = 5
class HammingMarker(object):
def __init__(self, id, contours=None):
... |
<gh_stars>0
#!/usr/bin/env python
# coding: utf-8
# In[5]:
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import re
import anndata
from scipy.stats import chi2
from scipy.sparse import issparse
import statsmodels.stats.multitest as multi
import statsmodels.api as sm
import warnings
try:
... |
"""
Abstract conv interface
"""
from __future__ import absolute_import, print_function, division
import logging
from six import reraise, integer_types
import sys
import theano
from theano.tensor import as_tensor_variable, patternbroadcast
from theano.tensor import get_scalar_constant_value, NotScalarConstantError
fr... |
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.optim.lr_scheduler import ExponentialLR
from torchvision import datasets, transforms
from torch.autograd import Variable
from torch import nn
import torch.nn.functional as F
from tqdm.notebook impor... |
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.13.7
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---
# %% [ma... |
#!/usr/bin/env python3
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from scipy.stats import poisson
def quantile_normalize(df):
"""
input: dataframe with numerical columns
output: dataframe with quantile normalized values
"""
df_sorted = pd.DataFra... |
"""
Computes Lx and it's derivative, where L is the graph laplacian on the mesh with cotangent weights.
1. Given V, F, computes the cotangent matrix (for each face, computes the angles) in pytorch.
2. Then it's taken to NP and sparse L is constructed.
Mesh laplacian computation follows <NAME>'s gptoolbox.
"""
from __f... |
from builtins import zip
from builtins import map
from builtins import range
from .rakeld import RakelD
import copy
import numpy as np
import random
from scipy import sparse
class RakelO(RakelD):
"""Overlapping RAndom k-labELsets multi-label classifier"""
def __init__(self, classifier=None, model_count=None,... |
<reponame>satr-cowi/DynSys<gh_stars>0
# -*- coding: utf-8 -*-
"""
Classes used to implement pedestrian dynamics analyses
@author: rihy
"""
from __init__ import __version__ as currentVersion
# Std imports
import numpy
import os
import scipy
import pandas
import matplotlib.pyplot as plt
import matplotlib.gridspec as g... |
# Classify MNIST digits using a SVM implemented from a quadratic programming
# package.
#
# Author: <NAME>
# Date: 4/20/2018
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import argparse
import sys
import tensorflow as tf
from scipy.sp... |
import numpy as np
import pandas as pd
import xarray as xr
import dask.array as dsar
import scipy.signal as sps
import scipy.linalg as spl
import pytest
import numpy.testing as npt
import xarray.testing as xrt
import xrft
@pytest.fixture()
def sample_data_3d():
"""Create three dimensional test data."""
pas... |
#!/usr/bin/env python3
import sys
from scipy.io import loadmat
def main(session_path, scores_path):
"""Print listing of neighborhoods and attributes with worst correlations
between MATLAB result and given score file.
"""
minimumDelta = 0.05
# Neighborhood score text file only has 3 significant ... |
<filename>tests/experiments/linkages/badge.py<gh_stars>1-10
# %%
import sys
sys.path.append("../../..")
from scipy.linalg import null_space
import copy
import numpy as np
from numpy.linalg import matrix_rank, matrix_power, cholesky, inv
import torch
from torch.optim import Adam
from torch.utils.tensorboard import Sum... |
<reponame>dimasad/aviation-2019-code
"""Output error method estimation of the longitudinal parameters of an HFB-320.
The parameters are estimated from several random starting values for the
nonlinear optimization.
This example corresponds to the test case #4 of the 4th chapter of the book
Flight Vehicle System Ident... |
import os
import numpy as np
from scipy.spatial.distance import cdist
from tqdm import tqdm
from utils.TripletLoss import TripletLoss
import torch
from torch.optim import lr_scheduler
from opt import opt
from data import Data
from network import REID_NET
from loss import Loss
from utils.get_optimizer import get_opti... |
<gh_stars>1-10
"""
Script to load the datasets created by the Matlab (hologram dataset and points dataset),
reshape, normalize and split them in train and test dataset for the classification or
regression problem.
"""
import os
import time
import logging
from datetime import datetime as dt
from pathlib import Path
imp... |
#!/usr/bin/env python
# <NAME>
# Created: 31 July 2017
# Framework for analysing gem5 stats
# This script creates new stats by applying formulae to existing stats
import pmcs_and_gem5_stats
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
import pandas as pd
pd.options.mo... |
"""
从荔枝新闻关于新冠疫情的搜索结果中的新闻全文中利用textrank算法筛选关键词
注意到stage0和stage1由于部分日期内荔枝新闻检索无结果,因而用当日的新浪新闻标题中提取的关键词代替
"""
from jieba import analyse
from pyecharts import options as opts
from pyecharts.charts import WordCloud
import math
import os
import re
import Date
import time
import json
from scipy.optimize ... |
<filename>texturesynth/analyzer.py<gh_stars>0
from warnings import warn
import numpy
import scipy
import pyrtools as pyr
from .util import pyrBand, pyrBandIndices, expand, shift, vectify, pyrLow
from .fakesfpyr import FakeSFPyr
from .psstat import PSStat
def analyze(img, Nsc=4, Nor=4, Na=7, preview=False):
"""
... |
<reponame>kwierman/dl_data_validation_toolset
import os
import logging
from .base import BaseReport
import numpy as np
import h5py
from scipy.stats import threshold
from scipy.misc import imsave
class FileReport(BaseReport):
logger = logging.getLogger("ddvt.rep.file")
def __init__(self, file, temp_dir):
self... |
import numpy as np
import torch
# from tensorboardX import SummaryWriter
from torch.utils.tensorboard import SummaryWriter
try :
from utils.plotting import spec2plot,MFCC2plot
except ImportError:
from utils.plotting import spec2plot,MFCC2plot
from scipy import signal
import pdb
# https://pytorch.org/docs/sta... |
<reponame>duc90/marvin
# !usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under a 3-clause BSD license.
#
# @Author: <NAME>
# @Date: 2017-08-21 17:11:22
# @Last modified by: <NAME>
# @Last Modified time: 2018-02-26 13:46:30
from __future__ import print_function, division, absolute_import
from marvin import... |
"""
This code implements a K-means and EM Gaussian mixture models per week 8 assignment of the machine learning module part of Columbia University Micromaster programme in AI.
Written using Python 3.7 for running on Vocareum
Execute as follows:
$ python3 hw3_clustering.py X.csv
"""
# builtin modules
import sys
impor... |
<reponame>avinashsc/Lipspeak<gh_stars>10-100
import argparse
import time
import torch
import random
from tqdm import tqdm
import math
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import os
import numpy as np
import data_loader.datasets as module_data
import model.loss as mod... |
<reponame>AngelosGuan/ECE470FinalProj<gh_stars>0
import vrep
import time
import numpy as np
import scipy.linalg as sla
def skew3(arr):
a=arr[0]
b=arr[1]
c=arr[2]
mat = np.array([[0,-c,b],[c,0,-a],[-b,a,0]])
return mat
... |
<reponame>matthewSorensen/plotterstuff
from scipy.spatial import KDTree
import numpy as np
import math
from burin.types import pointwise_equal
def clean_paths(paths, link = True, reverse = True, deduplicate = True, merge = True):
if deduplicate:
paths = list(remove_duplicates(paths))
if link:
... |
<gh_stars>1-10
import numpy as np
import torch
from os import walk
import pickle
from torch.utils.data.dataloader import DataLoader
from torchvision import transforms
import cv2
import time
from scipy.spatial.distance import cdist
import matplotlib.pyplot as plt
# Our own libraries
import fastercnn
import stat_interpre... |
<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
##
# \author <NAME> <<EMAIL>>
# \date 2017-12-12
#
###############################################################################
# This script provides functions which are used to visualize the ProSeCo data
##############################################... |
<filename>sr_test.py
import torch, os
import numpy as np
import scipy.stats
import matplotlib
matplotlib.use('Agg')
from torch.utils.data import DataLoader
from torch.optim import lr_scheduler
import random, sys, pickle
import argparse
from meta import Meta
from dataloader import dataloader as dl
import u... |
<filename>tools/data_gen/prnet.py
import numpy as np
import os, sys
sys.path.append('.')
import scipy
from skimage.transform import estimate_transform, warp
import cv2
# from imageio import imread, imsave
# from cv2 import imwrite
from glob import glob
import scipy.io as sio
from time import time
import argparse
impor... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Get/preprocess Google mobility data for the Netherlands.
Created on Sat Feb 6 21:31:20 2021
@author: @hk_nien
"""
import zipfile
import io
import urllib.request
import pandas as pd
import matplotlib.pyplot as plt
import scipy.signal
import tools
def download_g_mob... |
<reponame>amirdel/dispersion-continua
# Copyright 2017 <NAME>, <EMAIL>
#
# Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee
# is hereby granted, provided that the above copyright notice and this permission notice appear in all
# copies.
#
# THE SOFTWARE IS PROVIDED "A... |
import os
##################################################################
# Limit the number of threads used by numpy #
# This is needed to make it compatible with multiprocessing #
# see https://github.com/numpy/numpy/issues/11826 for more info! #
#########################################... |
<filename>Engine/opt.py
import nlopt
import numpy as np
from scipy.interpolate import splrep,splev #, interp1d
from Engine.classes import fitobjs,inparams
from Engine.rotint import rotint
from Engine.macbro_dynamic import macbro_dyn
from Engine.rebin_jv import rebin_jv
# import time
import sys
#--------------------... |
import os.path
import numpy as np
import itertools
import Tools
from scipy.interpolate import interp1d,interp2d,CubicSpline
# Those patterns are used for tests and benchmarks.
# For tests, there is the need to add tests for saturation
# Get lists of points in row order for use in CMSIS function
def getLinearPoints(x,... |
<filename>test/nn/test_initializers.py
# Copyright 2021 The NetKet Authors - All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... |
import os
import glob
import cc3d
from skimage import io, transform
from torch.utils.data import Dataset
from copy import copy
from voxelgrid.voxelgrid import Voxelgrid
from scipy.ndimage.morphology import binary_dilation
from utils.data import *
from dataset.binvox_utils import read_as_3d_array
class ModelNet(D... |
import numpy as np
import matplotlib.pyplot as plt
from scipy import optimize
data = np.genfromtxt('data.txt')
def gaussian(x, height, center, width, offset):
return height*np.exp(-(x - center)**2/(2*width**2)) + offset
def three_gaussians(x, h1, c1, w1, h2, c2, w2, h3, c3, w3, offset):
return (gaussian(x, h1,... |
<gh_stars>0
"""
Visual computational geometry and viewpoint path constrained optimization.
<NAME>, <NAME>, <NAME>
University of Nevada Reno
CS791 Special Topics (Robotics)
Instructor: <NAME>
Fall 2020
"""
# Imports
from os.path import exists
import os
import numpy as np
from scipy.spatial.transform.rotation import Rot... |
################ BASIC ################
import os
import sys
import traceback
import io
import shutil
import subprocess
import sqlite3
import logging
import re
import copy
from collections import OrderedDict, defaultdict, Counter
import time
from datetime import datetime
import threading
from threading import T... |
<reponame>scivision/power-harvesting-voltage-multiplier
#!/usr/bin/env python
import pandas
import io
import subprocess
from matplotlib.pyplot import figure, show
from scipy.interpolate import interp1d
# %% brightness from XHP50 datasheet
B = [.2, .4, .6, .8, 1, 1.2]
I = [.1, .25, .4, .55, .7, .85]
f = interp1d(I, B, '... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
This module contains scripts for image manipulation including denoising, enhancement and cropping functions
"""
import numpy as np
def uint16_2_uint8(vidstack):
""" Casts any input image to be of uint8 type.
Note: Though named uint16, converts any input to... |
<gh_stars>1-10
# coding=utf-8
# Copyright 2020 The Google Research 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 requi... |
"""Transformations which operate on ForcData objects."""
from typing import Any, Callable, List, Union
import numpy as np
import scipy.interpolate as si
import scipy.ndimage as sn
import scipy.optimize as so
from .config import Config
from .ingester import ForcData
def interpolate(
data: ForcData,
config: C... |
<reponame>TerenceChen95/Bladder-Cancer-Stage-Detection<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 8 12:02:59 2019
@author: tians
"""
import numpy as np
import scipy.misc as misc
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import cv2
def rgb2gray(rgb):
retur... |
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.4.2
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---
# # VIP This ... |
import os
import argparse
import itertools
import glob
from typing import Any, Dict, List
import numpy as np
from numpy import inf
from itertools import compress
import pandas as pd
from sklearn.preprocessing import minmax_scale
from scipy.stats import wasserstein_distance
from sklearn.metrics import auc
from dgl.d... |
<gh_stars>0
#!/usr/local/bin/python3.9
'''
Module for descriptive statistics
Change Log
==========
0.0.1 (2021-04-08)
----------
Initial commit
'''
from scipy import stats
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import kurtosis, skew, skewnorm
# Generate random normal sample
data = np.rand... |
<reponame>kirchhausenlab/incasem
import copy
import logging
import numpy as np
import scipy
import gunpowder as gp
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
class Softmax(gp.BatchFilter):
"""Apply a softmax operation on the 0th dimension of the ar... |
<gh_stars>0
import numpy as np
import math as m
from scipy.misc import derivative
import sympy as sy
def diff_uni(f, x_bar, h=10**(-6)):
value = (f(x_bar + h)-f(x_bar - h))/((x_bar+h)-(x_bar-h))
return value
# example:
# f = lambda x: x**2
#v = diff_uni(f,1)
def exact_diff(f, xbar,order):
x =... |
import numpy as np
import math
from winning.lattice import cdf_to_pdf, pdf_to_cdf, state_prices_from_densities, five_prices_from_five_densities
from winning.normaldist import normcdf, invnormcdf, normpdf
from winning.scipyinclusion import using_scipy
if using_scipy:
from scipy.integrate import quad_vec
def sa... |
<reponame>bmorris3/caos<filename>mrspoc/star.py
# Licensed under the MIT License - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import matplotlib.pyplot as plt
import numpy as np
from scipy.integrate import quad
import astropy.units as u
... |
<reponame>david-zwicker/sensing-normalized-results
#!/usr/bin/env python2
from __future__ import division
import sys, os
sys.path.append(os.path.join(os.getcwd(), '../src'))
import time
import pickle
from collections import OrderedDict
import numpy as np
from scipy import optimize, special
import matplotlib.pyplot ... |
<filename>.ipynb_checkpoints/human_parser-checkpoint.py<gh_stars>0
from __future__ import print_function
import argparse
from datetime import datetime
import os
import sys
import time
import scipy.misc
import scipy.io as sio
import cv2
from glob import glob
import imutils
from matplotlib import pyplot as plt
os.environ... |
"""
journal.py: Defines an abstraction for a ledger journal and common operations
on them
"""
from collections import defaultdict
from fractions import Fraction
from dataclasses import dataclass, field
from typing import List, Set, Tuple, Iterator, Dict
from ledgeroni import parser
from ledgeroni.types import (Transact... |
#!python
# coding=utf-8
from __future__ import division # always return floats when dividing
import os
import math
import errno
import warnings
import subprocess
from io import StringIO
from collections import namedtuple
import numpy as np
import pandas as pd
from scipy.signal import boxcar, convolve
from pocean.me... |
<filename>relabel_noisy_data.py
import os
import gc
import argparse
import json
import math
from functools import partial
from scipy.sparse import csr_matrix
from scipy.stats import rankdata
import pandas as pd
import numpy as np
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpForm... |
<reponame>marcoancona/DASP
import numpy as np
from itertools import chain, combinations
import scipy.special
fact = scipy.special.factorial
def f_max(inputs):
return np.max(inputs)
def f_linear_relu(x, w, b):
y = np.sum(x*w, -1) + b
return np.maximum(0, y)
def powerset(iterable):
"""
powerset(... |
#!/usr/bin/env python3
#
# Takes a set of pixel images tagged with ages and calculates all
# derived persistence-based concepts for them.
import argparse
import collections
import os
import re
import statistics
import sys
import skeleton_to_segments as skel
parser = argparse.ArgumentParser()
parser.add_argument('--w... |
# PYTHON_ARGCOMPLETE_OK
import argparse
import os
import logging
import ast
import random
import mpmath
from sympy import (nsolve, symbols, Mul, Add, chebyshevt, exp, simplify,
chebyshevt_root, Tuple, diff, N, solve, Poly, lambdify, sign, fraction,
sympify, Float, srepr, Rational, log, GoldenRatio)
from sympy... |
<reponame>xavigiro/saliency-360salient-2017
# (c) Copyright 2017 <NAME>. All Rights Reserved.
__author__ = "<NAME>"
__version__ = "1.0"
import keras
keras.backend.set_image_dim_ordering("th")
from keras.models import load_model
from scipy import ndimage
import scipy.io as io
import numpy as np
import utils
def ge... |
from hopenet_estimator.HopenetEstimatorImages import HopenetEstimatorImages
from Utils.yaml_utils.ConfigParser import ConfigParser
import pandas as pd
import os
from scipy.spatial.transform import Rotation as R
import numpy as np
import csv
from Utils.path_utils import path_leaf
def compare(ground_df, r... |
__author__ = 'richard'
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 7 23:07:31 2015
@author: richard
"""
from scipy import stats
import numpy as np
from matplotlib import pyplot as plt
# load csv values
csv = np.genfromtxt('data/distributions/accelerationmag_raw.csv', delimiter=",")
csv = csv.T
bin_edges = csv[... |
<reponame>GastonMazzei/Music-AI-experiment
#________INDEX____________.
# |
# 3 functions |
# (6=3+2+1) |
# |
# -4 auxiliary |
# -1 main) |
# |
# (if __name__==__main__) |
#________________________... |
<filename>porousmedialab/richardsmodel.py
import numpy as np
from scipy.integrate import odeint
import porousmedialab.vg as vg
def thetaFun(psi, pars):
if psi >= 0.:
Se = 1.
else:
Se = (1 + abs(psi * pars['alpha'])**pars['n'])**(-pars['m'])
return pars['thetaR'] + (pars['thetaS'] - pars['t... |
<reponame>cosmicoder/isoclassify
#! /usr/bin/env python
# --------------------------------------------------------------
# The asfgrid is a python module to compute asteroseismic
# parameters for a star with given stellar parameters and vice versa.
# Copyright (C) 2015 <NAME>, <NAME>
# This ... |
<filename>Absolute_Integrator/peak_finding/ranger.py
import numpy as np
import scipy.signal
from scipy.ndimage.morphology import binary_erosion
from scipy.ndimage.morphology import white_tophat
from scipy.ndimage.filters import gaussian_filter
# dictionary describing options available to tune this algorithm
options = ... |
import numpy as np
from scipy.io import loadmat
from scipy.optimize import fmin_cg
def sigmoid( z ):
return ( 1.0 / ( 1.0 + np.exp( -z ) ) )
def sigmoidGradient( z ):
return np.multiply( sigmoid( z ) , ( 1.0 - sigmoid( z ) ) )
def recodeLabel( y, num_labels ):
y = np.matrix(y)
m = y.shape[0]
ry =... |
"""Plotting util."""
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import PPoly
from being.block import Block
from being.clock import Clock
from being.constants import ONE_D
from being.resources import add_callback
DEFAULT_COLORS = [
dct['color'] for dct in plt.rcParams['axes.prop_cy... |
from numpy import pi
import numpy as np
import math
#from sympy import Matrix
import pylab
#import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
#from scipy.interpolate import Rbf
import pickle
from scipy.sparse import csr_matrix
from scipy.sparse import lil_matrix
from scipy.sparse.linalg import sps... |
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 13 16:53:11 2017
@author: <NAME>
"""
# -*- coding: utf-8 -*-
# coding: utf-8
# In[1]:
import numpy as np
import scipy.io
import keras
from keras.layers import Input, Activation, Dense, Flatten,Dropout
from keras.layers.normalization import BatchNormalizat... |
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 4 10:27:55 2021
@author: Raj
"""
import numpy as np
from .mechanical_drive import MechanicalDrive
from .utils.load import params_from_experiment as load_parm
from .utils.load import simulation_configuration as load_sim_config
from ffta.pixel_utils.load import configura... |
"""
Supplementary code for the paper:
Bayesian CMA-ES
"""
import numpy as np
import pandas as pd
import random
import math
import sys
import seaborn as sns; sns.set()
import cma.purecma as pcma
from scipy.stats import multivaria... |
from textwrap import wrap
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import kstest, uniform
# data collected on pi day 2022, March 14th
# 29 people participated
x_list = [
14, 12, 17, 5, 56, 39, 21, 67,
4, 42, 6, 7, 47, 13, 14, 73,
51, 57, 76, 1, 4, 8, 13, 19,
77, 17, 98, 33,... |
# Class: TimeSeriesDEM(np.ndarray)
# Func: Resample_Array(UtilRaster.SingleRaster, UtilRaster.SingleRaster)
# used for dhdt
# by <NAME>, Jul 27 2016
# last edit: Jun 22 2017
import numpy as np
from numpy.linalg import inv
import os
import sys
import gdal
from datetime import datetime
from shapely.geometry import Polyg... |
from __future__ import absolute_import, division, print_function
from vivarium.library.units import units
from scipy import constants
nAvogadro = constants.N_A
COUNTS_UNITS = units.mmol
VOLUME_UNITS = units.L
MASS_UNITS = units.g
TIME_UNITS = units.s
CONC_UNITS = COUNTS_UNITS / VOLUME_UNITS
def molar_to_counts(fl... |
<reponame>cdagnino/LearningModels
import src
import numpy as np
from scipy.stats import entropy
from scipy.special import expit
from numba import njit
def my_entropy(p):
return entropy(p)
@njit()
def force_sum_to_1(orig_lambdas):
"""
Forces lambdas to sum to 1
(although last element might be negativ... |
<gh_stars>0
from datetime import datetime, timedelta
from timely_beliefs.beliefs.utils import load_time_series
from scipy.special import erfinv
from bokeh.palettes import viridis
from bokeh.io import show
from bokeh.models import ColumnDataSource, FixedTicker, FuncTickFormatter, LinearAxis
from bokeh.plotting import fi... |
import operator
from dataclasses import replace
from fractions import Fraction
from typing import Callable, List, TypedDict, Optional, Protocol, Dict, Tuple, Iterable, Any, cast, Sequence, Set
from more_itertools import first_true
from z3 import z3 # type: ignore
import sys
from mockdown.constraint import IConstrai... |
<reponame>gregpr07/FMF-Essentials
# made with heart by <NAME>
from sympy import *
import matplotlib.pyplot as plt
from decimal import Decimal
import pandas as pd
from IPython.display import display, Latex, HTML
# todo
# adding custom latex names
class Negotovost:
def __init__(self, data, function, floating_poin... |
<filename>planning_python/environment_interface/env_2d.py
#!/usr/bin/env python
""" @package environment_interface
Loads an environment file from a database and returns a 2D
occupancy grid.
Inputs : file_name, x y resolution (meters to pixel conversion)
Outputs: - 2d occupancy grid of the environment
- abil... |
import pandas as pd
import os
import csv
import copy
from pprint import pprint
import math
import dgl
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
import torch.nn.functional as F
import scipy.sparse as sp
from dgl.nn import SAGEConv
import itertools
from sk... |
<reponame>scotthlee/enriched_rnns
import pandas as pd
import numpy as np
import h5py
import GPy, GPyOpt
from keras import regularizers
from keras.callbacks import ModelCheckpoint, EarlyStopping
from keras.models import load_model
from sklearn.model_selection import train_test_split
from scipy.sparse import load_npz
i... |
import collections
import sys
import pickle
import math
import logging
import numpy as np
import scipy.stats.distributions as dists
from sklearn.linear_model import LinearRegression
"""
Classes in the module implement trend detection techniques.
For uniform interface, all classes must implement the following function... |
from scipy import optimize,arange
import numpy as np
import matplotlib.pyplot as plt
#matplotlib inline
#basic cournot vectorised
#vectorize... check?
#add second period...
def price(x,b):
#x is an array [x1, x2]
return 1-x[0]-b*x[1]
def cost(x,c):
if x == 0:
cost = 0
else:
cost = c*x
ret... |
# Post processing scripts: interpolation, dithering, resampling and output
from scipy import signal
import numpy as np
from scipy.interpolate import interp1d
import wavio
from dataclasses import dataclass
@dataclass
class Downsampler:
output_fs: int = 48000
output_br: int = 32
def write_wav(self, wave_f... |
# Copyright 2020 Makani Technologies LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
""" A 3D mesh representing a stoma """
from __future__ import print_function
import collections
import logging as lg
import numpy as np
from scipy import sparse
from sortedcontainers import SortedDict
from stomasimulator.geom import point as p
import stomasimulator.stomata.stoma_config as sc
from . import element... |
<gh_stars>1-10
"""
test_util_cf2ps.py
Author: <NAME>
Affiliation: McGill University
Created on: Wed 16 Dec 2020 16:16:41 EST
Description:
"""
import time
import micro21cm
import numpy as np
from scipy.interpolate import interp1d
def test(rtol=1e-2):
R = np.logspace(-2, 3, 1000)
z = 8.
k = 1. / R
... |
<filename>2019/tracking-game/part2.py
#!/usr/bin/env python
import math
import statistics
from collections import Counter, defaultdict
import binascii
import json
def solve(input):
words = input.split()
decoded = ""
for word in words:
n = int(word, 2)
decoded += n.to_bytes((n.bit_length(... |
<reponame>LocalGround/localground<filename>apps/lib/image_processing/processor.py
#!/usr/bin/env python
import traceback, sys
from PIL import Image, ImageDraw, ImageChops, ImageMath
import os, stat, urllib, StringIO, cv, math
from datetime import datetime
from django.conf import settings
from localground.apps.site impo... |
<filename>src/gan/contextencoder/filler.py
from __future__ import print_function, division
from keras.models import load_model
import keras.backend as K
import sys
import numpy as np
class ContextEncoder():
def __init__(self):
self.img_rows = 576#8*64//2#32
self.img_cols = 720#8*64//2#32
s... |
# -*- encoding: utf-8 -*-
"""
@Author : zYx.Tom
@Contact : <EMAIL>
@site : https://zhuyuanxiang.github.io
---------------------------
@Software : PyCharm
@Project : deep-learning-with-python-notebooks
@File : ch0802_deep_dream.py
@Version : v0.1
@Time : 2019-11-28 14... |
<reponame>lucas-leme/bot-investing-bi<gh_stars>1-10
import investpy as inv
from datetime import date
import pandas as pd
import scipy.cluster.hierarchy as shc
import numpy as np
from pypfopt.hierarchical_portfolio import HRPOpt
import json
import matplotlib.pyplot as plt
import os
def get_assets_env_var(env_var):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.