text string |
|---|
# -*- coding: utf-8 -*-
"""
Demons registration with variants of demons forces, as well as the diffeomorphic demons.
@author: <NAME>
"""
import os
import numpy as np
import tensorflow as tf
# import tensorflow_probability as tfp
import nibabel as nib
import cv2
import transformer, utils, metrics
import ... |
<reponame>kgraczyk/objects_counting_dmap<filename>visualization_of_results.py<gh_stars>0
import os
import shutil
import zipfile
from glob import glob
from typing import List, Tuple
import click
import h5py
import wget
import numpy as np
from PIL import Image
from scipy.io import loadmat
from scipy.ndimage import gaus... |
## Determines the probability of an sequence to be an intro
import statistics
import matplotlib.pyplot as plt
import numpy
from pomegranate import *
from utils import extractor, file_handler, time_handler
def get_most_probable_size(video_file):
start_times, sizes = get_variables(video_file)
return statistic... |
from statistics import Statistics
import asyncio
class LotteryResult():
async def query(self):
while True:
await Statistics().clean_TV()
await asyncio.sleep(30)
|
"""Drudges for clifford algebra."""
import functools
import itertools
import operator
import typing
from pyspark import RDD
from sympy import Expr, Integer, KroneckerDelta
from .term import Vec, Term
from .wick import WickDrudge
def inner_by_delta(vec1: Vec, vec2: Vec):
"""Compute the inner product of two vect... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# HaeufigkeitsBaum - Klasse von zufall
#
#
# This file is part of zufall
#
#
# Copyright (c) 2019 <NAME> <EMAIL>
#
#
# Licensed under... |
<filename>Modules/Evolution_equations.py<gh_stars>0
import numpy as np
from Modules.constants import G,c,epsilon
from Modules.sigma_class import Sigma
from scipy.integrate import cumtrapz
class EvolutionEquations(Sigma):
def __init__(self,SimFile,StrainDataPath):
super().__init__(SimFile,StrainDataPat... |
# Copyright 2021 NREL
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distri... |
# ======================================================================
# ====================================
# README file for Skew Correction component
# ====================================
# Filename : ocrd-anyBaseOCR-deskew.py
# Author: <NAME>, <NAME>, Md. <NAME>
# Responsible: <NAME>, <NAME>, Md. <NAME>
# Con... |
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
import argparse
from scipy.stats import gamma
from scipy.optimize import minimize,fmin_l_bfgs_b
#import autograd.numpy as np
#from autograd import grad, jacobian, hessian
def measure_sensitivity(X):
N = len(X)
D... |
<filename>math_numpy/matrix_demo.py
import numpy as np
from scipy import sparse
import numpy as np
import re
import time
import os
from itertools import *
def matrix_main():
indptr = np.array([0, 2, 3, 6])
indices = np.array([0, 2, 2, 0, 1, 2])
data = np.array([1, 2, 3, 4, 5, 6])
# todense 转换稠密矩阵
c... |
#!/usr/bin/env python3
# encoding: utf-8
"""
% Code to fit the history-dependent drift diffusion models as described in
% Urai AE, <NAME>W, <NAME>, <NAME> (2019) Choice history biases subsequent evidence accumulation. eLife, in press.
%
% MIT License
% Copyright (c) <NAME>, 2019
% <EMAIL>
"""
# =====================... |
<reponame>VladSkripniuk/yellowbrick<filename>yellowbrick/classifier/rocauc.py<gh_stars>0
# yellowbrick.classifier.rocauc
# Implements visual ROC/AUC curves for classification evaluation.
#
# Author: <NAME>
# Author: <NAME>
# Author: <NAME>
# Created: Tue May 03 18:15:42 2017 -0400
#
# Copyright (C) 2016 The scik... |
<filename>tests/legacy/bayesian_lens.py
from __future__ import print_function
from orphics import maps,io,cosmology,lensing,stats
from enlib import enmap,lensing as enlensing,bench
import numpy as np
import os,sys
from szar import counts
from scipy.linalg import pinv2
arc = 30.0
px = 1.0
dimensionless = False
mean_su... |
<filename>core/models/kalasanty/3dunet/data.py
import os
from warnings import warn
import re
from random import shuffle, choice, sample
import numpy as np
from scipy import ndimage
import h5py
import pybel
import tfbio.net
import tfbio.data
from skimage.draw import ellipsoid
__all__ = [
'print_progress',
... |
import numpy as np
import imutils
import time
import timeit
import dlib
import cv2
import matplotlib.pyplot as plt
from scipy.spatial import distance as dist
from imutils.video import VideoStream
from imutils import face_utils
from threading import Thread
from threading import Timer
from check_cam_fps impor... |
<gh_stars>0
from math import sqrt
import math
import scipy.stats as s
import array as a
import sys
from numpy import log, pi, log10, e, log1p, exp
import numpy as np
import re
log10e = log10(e)
canonicalBaseMap = {'A': 'A', 'C': 'C', 'G': 'G',
'T': 'T', 'H': 'A', 'I': 'C', 'J': 'C', 'K': 'C'}
mod... |
<filename>Scripts/lap_v2_py3.py
"""
lap
A python module that provides methods for calculating projections
and predictivity based on a set of basis samples.
"""
import numpy as np
import scipy.stats as sps
#%% #############################
def check_type_data(data, data_type=np.ndarray, dim=2):
""" ... |
from data_set_loader import DataSetLoader
import itertools
import numpy as np
from inspect import signature
from scipy.sparse import csr_matrix, vstack, hstack
class CrossValidatorTester:
@staticmethod
def get_data_for(files, zeros, features_count):
first_time = True
features = None
la... |
# -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals
from . import dispatched
import sys
import sympy
sympy_mods = [sympy, sympy.functions, sys.modules[__name__]]
dispatched.module_by_type[sympy.var('x').__class__] = sympy_mods
dispatched.module_by_type[sympy.numbers.Zero] ... |
import glob
import random
import os
import scipy.io as sio
import torch
import numpy as np
from torch.utils.data import Dataset
import torchvision.transforms as transforms
class ImageDataset(Dataset):
def __init__(self, root, dataset_name=None, unaligned=True, mode='train'):
self.unaligned = una... |
"""Compute classifier outcome for within subjects classification.
Compute the mean accuracy across subjects, and make a (preliminary) plot of the
single subjects' accuracies. Save accuracies as .mat file to visualize them in
MATLAB.
Note: for supplementary material.
AUTHOR: <NAME> <britta.wstnr[at]gmail.com>
LICENCE... |
import cv2
import numpy as np
from scipy.ndimage import interpolation as inter
def correct_skew(image, delta=1, limit=5):
def determine_score(arr, angle):
data = inter.rotate(arr, angle, reshape=False, order=0)
histogram = np.sum(data, axis=1)
score = np.sum((histogram[1:] - histogram[:-1])... |
#!/usr/bin/env python
from __future__ import print_function, division
import numpy as np
from scipy.integrate import quad
from scipy.special import gammainc, gamma
import matplotlib
import matplotlib.pyplot as plt
def get_integrand(n, beta1, beta2):
b = 0.5*beta2/beta1
G = gamma(0.5*n)
norm = 1.**(0.5*... |
<gh_stars>0
#!/usr/bin/env python
# Edit this script to add your team's training code.
# Some functions are *required*, but you can edit most parts of the required functions, remove non-required functions, and add your own functions.
################################################################################
#
#... |
<gh_stars>1-10
#!/usr/bin/env python3
from collections import defaultdict
import pprint
import cmath
import math
import pytest
import sys
import fileinput
from os.path import splitext, abspath
F_NAME = splitext(abspath(__file__))[0][:-1]
covered = defaultdict(list)
def iscovered(x, y):
return covered.get(x, []).... |
import numpy as np
from scipy.sparse.csgraph import minimum_spanning_tree, connected_components
def euclidean_mst(X, neighbors_estimator, verbose=2):
n_neighbors = min(2, X.shape[0])
while True:
# make sure we have a connected minimum spanning tree.
# otherwise we need to consider more neighbo... |
from sympy import symbols, oo, sympify, Rational, sqrt, acos, cos, pi
x = symbols('x')
def Ramp(pt, slope, side):
'''Generates the "ramp" function (left-sided or right-sided).
Example of the right-sided ramp function:
f(x) = { y1 if x <= x1
{ line starting at (pt) with given s... |
import tensorflow as tf
import numpy as np
import gym
import util as U
from scipy import signal
from time import sleep
import policies as pol
LOG_ROUND = 10
MAX_ITERS = 1e7
MAX_LR, MIN_LR = .1 , 1e-6
class Framer(object):
"""
Ceates the augmentd obs features from the bare observations. Any obs fed to Actor &... |
<filename>all code (not organized)/tts test thingy full spegram.py<gh_stars>0
import librosa
import numpy as np
import matplotlib.pyplot as plt
import sounddevice as sd
import copy
from scipy import signal
from scipy.signal import istft
from scipy.signal import stft
class hp:
prepro = True # if True, ru... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy.io import wavfile
from scipy import fftpack
from scipy import signal
import os
# import soundfile as sf
#import pyAudioAnalysis
#module to output the sound
from playsound import playsound
#metadata is a python file which contains a di... |
import numpy as np
import pathlib
import os.path
from torch import optim, cuda, nn
from time import time
import gc
import cv2
import torchvision
from torchvision.models import resnet18
from hmdscollagen.training.models import SimpleNet
from hmdscollagen.training.net import ReconNet
from hmdscollagen.training.SimpleConv... |
import numpy as np
import torch
import torch.nn as nn
import torchvision.datasets as dsets
import torchvision.transforms as transforms
from torch.autograd import Variable
from tqdm import tqdm
from typing import Optional, Union, Tuple, List, Sequence, Iterable
import math
from scipy.spatial.distance import euclidean
fr... |
<gh_stars>0
## Plot performance of KM100 and KM102 over gradual whisker trim
"""
4F
PLOT_PERF_BY_STIM_FOR_SINGLE_VS_ALL_WHISKERS_grand
N/A
Performance for all, single, and no whiskers.
4G
PLOT_PERF_BY_STIM_FOR_SINGLE_VS_ALL_WHISKERS
N/A
Performance on single whisker by stimulus and position.
""... |
<reponame>sambit-giri/emulator
import numpy as np
from scipy.optimize import minimize
from scipy.stats import norm
from . import sampling_space as smp
def expected_improvement(X, X_sample, Y_sample, gpr, xi=0.01):
'''
Computes the EI at points X based on existing samples X_sample
and Y_sample using a Gaus... |
<gh_stars>0
import networkx as nx
import sys
import numpy as np
from scipy import sparse
import numpy as np
from scipy.sparse import diags
n = 30000 # The number of vertices
avg_deg = int(sys.argv[1])
m = int(avg_deg / 2) # The number of edges added to each new node
G = nx.generators.random_graphs.barabasi_albert_gra... |
<reponame>antoinedemathelin/adapt
"""
Regular Transfer
"""
import copy
import warnings
import numpy as np
from sklearn.linear_model import (LinearRegression,
Ridge,
LogisticRegression,
RidgeClassifier)
from sklearn.e... |
<filename>q16.py
#!/usr/bin/env python3
import sys
import cmath
#Find the count of specific char inside a list of char (By using recursion helper)
def main():
chars = eval(input("Enter a list of char: "))
ch = input("Enter a char to find: ")
if not (type(chars) == list and len([char.strip() for char in cha... |
#Script for training network for recosttucting image from sparsly sample pixels
#Hence take image in which only small fraction of the pixels are known and reconstruct the full image
#The unknown pixels are marked as 0
#Instructions for Running Prediction
#Assume that you already have trained model in log_dir, if you d... |
<gh_stars>0
import numpy as np
from skimage import feature
from sklearn.svm import LinearSVC
from imutils import paths
import argparse
import cv2
import os
from scipy.stats import kurtosis, skew, entropy
import dlib
considered_points = [1, 3, 5, 7, 9, 11, 13, 15, 17, 18, 20, 22, 23, 25, 27,
28, 29, 30, 31, 32... |
#!/usr/bin/env python
#
# Convert Z scores to pvalues
#
import argparse
from scipy.stats import norm
def print_p_values(zscores):
"""
Read Zscores file, convert the Zscores to pvalues, and print them out
along with the original data.
"""
print "MarkerName\tZscore\tP.value"
with open(z... |
<filename>Kerman/qucat_circuits.py
import numpy
import numpy as np
from qucat import Network,J,C,L,R
from scipy.constants import pi,hbar, h, e
def transmon():
cir = [J(0,1,1000e-9),C(0,1,50000e-15)]
return Network(cir)
def oscillatorLC():
cir = [L(0,1,1000e-12),C(0,1,4000e-15)]
return Network(cir)
de... |
"""
Regrid pp file to TRMM and difference
"""
import os, sys
import datetime
import iris
import iris.unit as unit
import scipy.interpolate
import cPickle as pickle
import numpy as np
diag = 'rain_mean'
pp_file_path='/nfs/a90/eepdw/Data/EMBRACE/Mean_State/pp_files/'
regrid_model='trmm'
fg = '%sdjzn/djznw/%s.pp'... |
#!/usr/bin/env python
__author__ = '<NAME>'
'''
This script will do randomized search to find the best or almost the best parameters for this problem
for sklearn package
'''
# import xgboost as xgb
import pandas as pd
import numpy as np
from xgboost import XGBRegressor
from sklearn import cross_validation
# from skl... |
from os import getcwd
import sys
from pathlib import Path
import time
import csv
import argparse
import traceback
from scipy import stats, special
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from joblib import Parallel, delayed
from sklearn import metrics
import pickl... |
<gh_stars>0
from forest_model import *
import json
from tqdm import tqdm
import time
import scipy as sp
import seaborn as sns
from multiprocessing import Pool
def get_density(args):
"""
Calculation the car flow for default CA
:param args: density
:return: measurements
"""
sp.random.seed()
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# by TR
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.dates as mdates
from sito import read
import numpy as np
import csv
mpl.rcParams.update({'font.size': 15})
#maj_loc = mdates.MonthLocator()
#min_loc = mdates.DayLocator((5, 10, 15, 20, 25)... |
<reponame>mjasnikovs/horus<gh_stars>0
import cv2
import math
import time
import numpy as np
import argparse
import imutils
from scipy.spatial import distance as dist
from imutils import perspective
from imutils import contours
#https://www.pyimagesearch.com/2016/03/28/measuring-size-of-objects-in-an-image-with-opencv... |
<reponame>huyphan168/fewshot_pill_detection<gh_stars>0
import torch
import torch.nn as nn
import numpy as np
from numpy.linalg import lstsq
from scipy.linalg import orth
from fsdet.config import get_cfg, add_custom_config
from fsdet.modeling.meta_arch import build_model
import scipy
import pickle as pkl
def lowrank_in... |
<reponame>igorkolesnikov13/cymorph<filename>src/cymorph/concentration.py
from scipy import interpolate
import sep
import numpy as np
class Concentration:
"""
Concentration(clean_image, radius1=0.8, radius2=0.2, rp=None, growth_curve=None, growth_radii=None)
Extracts concentration metric from the supplie... |
<reponame>b3ttin4/local_selfinhibition_network
#!/usr/bin/env python
import sys
import numpy as np
from scipy import linalg
from tools import Runge_Kutta_Fehlberg,get_EI_np as get_EI,save_activity,\
functions as fct, parameter_settings, network_params, plot_functions
if __name__=="__main__":
#base_path = "./imag... |
<reponame>yanwunhao/auto-mshts
import numpy as np
import math
from scipy.optimize import curve_fit
def calculate_summary_of_sample(sample):
sample = np.array(sample, dtype=float)
return np.sum(sample)
# definition of sigmoid curve
def sigmoid_curve(x, a, b):
return 1. / (1.0 + np.exp(-a * (x - b)))
#... |
# -*- coding: utf-8 -*-
r""" The CORRAL aggregation bandit algorithm, similar to Exp4 but not exactly equivalent.
The algorithm is a master A, managing several "slave" algorithms, :math:`A_1, ..., A_N`.
- At every step, one slave algorithm is selected, by a random selection from a trust distribution on :math:`[1,...,... |
import os
import scipy as sp
import netCDF4 as nc
from g5lib import dset
__all__=['ctl']
oceanval=os.environ.get('OCEANVAL',
'/discover/nobackup/projects/gmao/oceanval/verification')
class Ctl(dset.NCDset):
def __init__(self):
name='Reynolds'
flist=[oceanval+'/rey... |
"""finds bad channels."""
import mne
import numpy as np
from mne.channels.interpolation import _make_interpolation_matrix
from psutil import virtual_memory
from scipy import signal
from scipy.stats import iqr
from statsmodels import robust
from pyprep.removeTrend import removeTrend
from pyprep.utilities import filter_... |
import os
from functools import partial
from typing import Callable, Dict, List, Optional, Tuple, Union
import attr
import numpy as np
import pandas as pd
import tabmat as tm
from dask_ml.preprocessing import DummyEncoder
from git_root import git_root
from joblib import Memory
from scipy.sparse import csc_matrix
from... |
<filename>ctdcal/process_bottle.py<gh_stars>1-10
"""Library to create SBE .btl equivalent files.
TODO: allow for variable bottle fire scans instead of SBE standard 36
ex: user doesn't know how to change the config for the cast to add more scans,
instead does it post-cast?
<NAME> SIO/ODF
Nov 7, 2016
"""
import... |
import networkx as nx
import numpy as np
from scipy import stats
from datetime import datetime
import csv
import random
import sys
sys.path.append('./routing')
import shortest_path
import waterfilling
import flash
import speedymurmurs
import max_flow
import ripple_proc
import lightning_proc
# GENERAL TERMINOLOGY
... |
"""
"""
import pytest
import numpy as np
from scipy.stats import powerlaw
from ..extend_subhalo_mpeak_range import model_extended_mpeak
from ..extend_subhalo_mpeak_range import map_mstar_onto_lowmass_extension
@pytest.mark.xfail
def test1():
mpeak = 10**(5*(1-powerlaw.rvs(2, size=40000)) + 10.)
desired_logm_c... |
<filename>jumeg/decompose/complex_ica.py
# Authors: <NAME> <<EMAIL>>
'''
Created on 31.03.2015
@author: lbreuer
'''
#######################################################
# #
# import necessary modules #
# ... |
<filename>ch14/ap.py
class ArithmeticProgression:
def __init__(self, begin, step, end=None):
# step带有类型信息, begin和end只是整数
self.begin = begin
self.step = step
self.end = end
def __iter__(self):
result = type(self.step)(self.begin)
forever = self.end is None
... |
<filename>occupancy_energy_correlation/app.py
__author__ = "<NAME>"
__email__ = "<EMAIL>"
import os
import json
import pymortar
import numpy as np
import pandas as pd
from scipy import stats
import matplotlib.pyplot as plt
from collections import defaultdict
""" This app calculates the absolute and percent building e... |
<gh_stars>1-10
# ----------------------------------------------------------------------------
# File: image_metrics.py
# Author: <NAME> <<EMAIL>>
# Created: 2015-03-09
# ----------------------------------------------------------------------------
#
#
#
# -------------------------------------------------------------... |
"""
Description:
An implementation of the DFO algorithm developed by <NAME>,
<NAME>, <NAME>
author: <NAME>
email: <EMAIL>
"""
import numpy as np
from scipy import linalg as LA
# Packages Lu
# from keras.models import Sequential
# from keras.layers import Dense
# from keras import optimizers
# sgd = optimizers.SGD(l... |
# Scene graph Module for SSG
from scipy.sparse import lil_matrix, find
from scipy.sparse import find as find_sparse_idx
from mpl_toolkits.mplot3d import Axes3D
from termcolor import colored
from PIL import Image
from copy import deepcopy
from lib.params import *
from matplotlib.patches import Rectangle
import matplotli... |
import numpy as np
import pandas as pd
import sympy as sp
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LassoCV, Lasso
from autofeat import AutoFeatRegressor
import trained_workflows as tf
class Workflow:
"""
Base class for Workflows
A workflow is instantiat... |
import pytest
import numpy as np
from scipy import stats
from autofit import messages, graphical as graph
np.random.seed(1)
error_std = 1.
prior_std = 10.
a = np.array([[-1.3], [0.7]])
b = np.array([-0.5])
n_obs = 100
n_features, n_dims = a.shape
x = 5 * np.random.randn(n_obs, n_features)
y = x.dot(a) + b + np.... |
<filename>receiver_python/rec.py<gh_stars>0
#!/usr/bin/python3
"""
Records a tone.
"""
import sounddevice as sd
import scipy.signal as sp
import scipy.fftpack as sf
import numpy as np
import matplotlib.pyplot as plt
import pygame
import queue
import freenectaudio as fs
# sounddevice docs: https://python-sounddevice.r... |
import os
import gc
import glob
import time
import random
from collections import defaultdict
import numpy as np
from scipy.io import wavfile
import wave
import librosa
import torch
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.sampler import SubsetRandomSampler
class TimitTrainSet(Dataset):... |
<filename>Image/backuphomework3.py<gh_stars>0
import matplotlib.pyplot as plt
import numpy as np
from scipy import ndimage
import cv2
def plot(data, title):
plot.i += 1
plt.subplot(2,2,plot.i)
plt.imshow(data)
plt.gray()
plt.title(title)
plot.i = 0
im = cv2.imread("gofestoneyear.jpg")
da... |
<filename>Code/VI.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 29 23:01:38 2021
@author: saul
"""
from abc import ABC, abstractmethod
from scipy.misc import derivative
import numpy as np
from Code.data import generate_trajectory
from numpy.linalg import inv, pinv
import torch
import import... |
<reponame>MIDA-group/itkAlphaAMD
import numpy as np
import scipy as sp
import scipy.ndimage.morphology
import matplotlib.pyplot as plt
folder = '../../itkAlphaAMD-deform-liver-build/'
#before_files = ['Merle_maskapplied_pre.raw', 'Merle_maskapplied_p1.raw', 'Merle_late.raw']
before_files = ['Merle_pre.raw', 'Merle_p... |
# -*- coding: utf-8 -*-
"""
.. module:: skimpy
:platform: Unix, Windows
:synopsis: Simple Kinetic Models in Python
.. moduleauthor:: SKiMPy team
[---------]
Copyright 2017 Laboratory of Computational Systems Biotechnology (LCSB),
Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland
Licensed under the ... |
from VehicleDetector import classifier
from VehicleDetector import features
from VehicleDetector import data_handler
from VehicleDetector import visualizer
import cv2
import numpy as np
import matplotlib.pyplot as plt
from scipy.ndimage.measurements import label
class VehicleDetector(object):
"""
The ... |
<gh_stars>0
import re
import tweepy
from tweepy.errors import TweepyException
from tweepy import OAuthHandler
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from nltk.stem import PorterStemmer
import pandas as pd
import matplotlib.pyplot as plt
import yfinance as yf
fr... |
from fractions import Fraction
from music21 import *
class PostprocessMidi:
def __init__(self):
self.output_notes = []
self.last_instrument = ""
self.last_duration = ""
self.offset = 0
self.path_output = "data/output_songs/"
def compute_song(self, data, name):
... |
<filename>parallel_accel/Simulator/context_validator_test.py
# Copyright 2021 The ParallelAccel 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://ww... |
<gh_stars>0
# -*- coding: utf-8 -*-
import os
import math
import torch
import numpy as np
import sdf
from scipy.stats import qmc
from torch import from_numpy
from torch.utils.data import Dataset
from .geometry import (SDF, ImportanceSampler, Mesh,
PointSampler, get_bounding_box_and_offset)
fro... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
from scipy import constants as sciconst
from scipy.integrate import solve_ivp
import matplotlib.pyplot as plt
import re
filename = "fort.8"
temp_v = 4500 # K
def read_levelfile(level_filename):
with open(level_filename, "r") as f:
data_str... |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 26 19:46:39 2020
@author: giamm
"""
import numpy as np
import math
from scipy.interpolate import interp1d
from scipy.integrate import cumtrapz
import matplotlib.pyplot as plt
import datareader #routine created to properly read the files needed in the following
# from c... |
import csv
from scipy import ndimage
lines = []
with open('./drive_data/driving_log.csv') as file:
reader = csv.reader(file)
for line in reader:
lines.append(line) #appending all the data from the reader into
car_images = []
steering_angles = []
print(len(lines))
for line in lines:
c_fi... |
<filename>prepare_cvact.py
import os
from shutil import copyfile
import shutil
import numpy as np
import scipy.io as sio
from scipy.misc import imread, imsave
import cv2
allDataList = './ACT_data.mat'
anuData = sio.loadmat(allDataList)
img_root = '/home/wangtyu/ANU_data_small/'
idx = 0
id_alllist = []
id_idx_alllist ... |
import subprocess
import tempfile
import json
import time
import numpy as np
import scipy.sparse
from static_pathing import dikstras_dists
def adj_graph_to_distance_matrix(graph,node_weights):
init_graph_weights = 1e7*np.ones([len(graph),len(graph)],dtype=np.float64)
for n,edges in enumerate(graph):
fo... |
<reponame>bwdeng20/thgsp<gh_stars>10-100
import pytest
import numpy as np
import torch as th
from ..utils4t import float_dtypes, lap_types, devices, snr_and_mse
from thgsp.sampling.ess import ess_sampling, power_iteration, power_iteration4min, ess, recon_ess
from thgsp.graphs import rand_udg, laplace
from thgsp.utils i... |
# coding=utf8
from __future__ import absolute_import
import os
from sfepy import data_dir
import six
filename_meshes = ['/meshes/3d/cylinder.mesh',
'/meshes/3d/cylinder.vtk',
'/meshes/various_formats/small2d.mesh',
'/meshes/various_formats/small2d.vtk',
... |
<gh_stars>0
"""sls.py
An implementation of the robust adaptive controller.
Both FIR SLS version with CVXPY and the common
Lyapunov relaxation.
"""
import numpy as np
import cvxpy as cvx
import utils
import logging
import math
import scipy.linalg
from abc import ABC, abstractmethod
from adaptive import AdaptiveMet... |
import tensorflow as tf
import os
import scipy.io
import numpy as np
import cv2
USE_TFRECORDS = True
cwd = os.getcwd()
train_set = '../data/hypotheses.tfrecords'
VGG_PATH = cwd + "/../data/imagenet-vgg-verydeep-19.mat"
learning_rate = 0.0008
batch_size = 15
img_size = 227
n_classes = 20
thres... |
import numpy as np
from copy import deepcopy
from utils.rvs import ConstraintManager, get_parser
from utils.rvs.utils import optimize_on_simplex
from scipy import optimize
def evaluate_antagonistic_demographic_shift(predictf, constraints, population, opts):
assert len(constraints) == 1, ('evaluate_antagonistic_de... |
import sys
sys.path.append('../src')
import query
import GstoreConnector
IP = "172.16.31.10"
Port = 9900
import sys
sys.path.append('../src')
import json
from queue import Queue
import time
from scipy.sparse import *
from scipy.sparse.linalg import inv
import numpy as np
np.set_printoptions(threshold=np.i... |
<reponame>FloatFlow/SyntheticPromoter
'''Fairly basic set of tools for real-time data augmentation on image data.
Can easily be extended to include new transformations,
new preprocessing methods, etc...
'''
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
import re
from s... |
<reponame>texpomru13/espnet
#!/usr/bin/env python
# Copyright 2020 Johns Hopkins University (Author: <NAME>)
# Apache 2.0
# This script is based on the Bayesian HMM-based xvector clustering
# code released by BUTSpeech at: https://github.com/BUTSpeechFIT/VBx.
# Note that this assumes that the provided labels are for a... |
<gh_stars>10-100
#! /usr/bin/env python
#
# Copyright (C) 2012-2014 <NAME> <<EMAIL>>
import os
# temporarily redirect config directory to prevent matplotlib importing
# testing that for writeable directory which results in sandbox error in
# certain easy_install versions
os.environ["MPLCONFIGDIR"] = "."
DESCRIPTION = ... |
<filename>code_demo_resources/arima_residuals_model.py
from scipy.special import erf
from scipy.optimize import curve_fit
import numpy as np
from numpy import array
from statsmodels.tsa.arima_model import ARIMA
from statsmodels.tools.sm_exceptions import ConvergenceWarning
from statsmodels.tools.sm_exceptions import... |
<gh_stars>1-10
#!/usr/bin/env python
# vim:fileencoding=utf-8
# Author: <NAME>
# Created: 2017-09-26
import pandas as pd
import pickle
import numpy as np
from pkg_resources import resource_filename
from scipy.special import logsumexp
def load_model(model_type: str):
target_path = resource_filename(
"sphe... |
# -*- coding: utf-8 -*-
""" Hi-C analysis of ChIP-seq after multi-targeting Cas9
"""
__author__ = "<NAME>"
__license__ = "MIT"
__version__ = "0.9"
__maintainer__ = "<NAME>"
import h5py
import pysam
import os
import re
import numpy as np
from scipy import sparse, stats
import matplotlib.pyplot as plt
from . import chip... |
import pytest
import numpy as np
import numpy.testing as npt
import scipy.stats as st
from scipy.special import expit
from scipy import linalg
import numpy.random as nr
import theano
import pymc3 as pm
from pymc3.distributions.distribution import (draw_values,
_DrawValuesC... |
<filename>Lib/test/test_builtin.py
# Python test set -- built-in functions
import ast
import builtins
import collections
import decimal
import fractions
import io
import locale
import os
import pickle
import platform
import random
import re
import sys
import traceback
import types
import unittest
import warnings
from ... |
import sys, os, time, random
import synergia
import synergia_workflow
import numpy as np
import matplotlib.pyplot as plt
from mpi4py import MPI
from scipy import constants
import rssynergia
from rssynergia.standard import standard_beam
from rssynergia.base_diagnostics import read_bunch
from rssynergia.base_diagnostics... |
import pandas as pd
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestRegressor
from sklearn.ensemble import GradientBoostingRegressor
from sklearn.decomposition import PCA, KernelPCA
from sklearn.tree import e... |
<filename>stellargraph/mapper/node_mappers.py
# -*- coding: utf-8 -*-
#
# Copyright 2018-2019 Data61, CSIRO
#
# 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/license... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.