text string |
|---|
<reponame>behinger/etcomp
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 15 19:47:14 2018
@author: kgross
"""
import functions.add_path
import functions.et_preprocess as preprocess
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from scipy.... |
<reponame>dalia1992/heatmap<gh_stars>10-100
import heatmap
from scipy import ndimage
from skimage import io
import numpy as np
# read image
image_filename = '../data/face.png'
image = io.imread(image_filename)
# create heat map
x = np.zeros((101, 101))
x[50, 50] = 1
heat_map = ndimage.filters.gaussian_filter(x, sigm... |
import torch
import torch.nn as nn
import scipy.sparse as sp
from time import perf_counter
from utils import sparse_eye
# preprocessing stage
def dgc_precompute(features, adj, T, K):
# integration with the forward Euler scheme by default
if K == 0 or T == 0.:
return features, 0.
delta = T / K
t... |
<reponame>MadsJensen/agency_connectivity
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 27 13:53:50 2016
@author: au194693
"""
import numpy as np
import scipy.io as sio
import pandas as pd
from my_settings import (tf_folder, subjects_ctl)
data = sio.loadmat("/Volumes/My_Passport/agency_connectivity/" +
... |
<reponame>takuya-ki/wrs<gh_stars>10-100
import numpy as np
from scipy.interpolate import RBFInterpolator
from scipy.linalg import lstsq
from scipy.optimize import curve_fit
import modeling.collision_model as cm
import basis.trimesh as trm
class Surface(object):
def __init__(self, xydata, zdata):
self.xy... |
from __future__ import division
import _init_paths
from fast_rcnn.config import cfg
from fast_rcnn.test import im_detect
from fast_rcnn.nms_wrapper import nms
from utils.timer import Timer
import matplotlib.pyplot as plt
import numpy as np
import scipy.io as sio
import caffe, os, sys, cv2
import argparse
import sys
# ... |
import anndata
import dask.array
import numpy as np
import pandas as pd
import scipy.sparse
from typing import Dict, List, Union
from sfaira.data.store.batch_schedule import BATCH_SCHEDULE
def split_batch(x):
"""
Splits retrieval batch into consumption batches of length 1.
Often, end-user consumption ba... |
<filename>datasets/radar_dataset.py
import copy
import os
import scipy
import warnings
from enum import Enum
import torch
import numpy as np
from torch.utils.data import Dataset
import scipy.io as spio
from data_models.scaler import Scaler
from run_scripts import print_
from utils.rd_processing import calculate_velocit... |
from flask import Flask, render_template,flash,request
import json
from minepy import MINE
import numpy as np
np.set_printoptions(suppress=True)
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.metrics import mean_squared_error,r2_score
from sklearn.preprocessing import MinMaxScaler
from scipy.stats im... |
#!/bin/env python
#
# Script name: new_IDP_gen.py
#
# Description: Script to generate new IDPs for a subject.
#
## Author: <NAME>
import numpy as np
import sys
from scipy.stats import zscore
import matplotlib.pyplot as plt
import matplotlib
import os
import copy
import glob
import scipy
from numpy import inf
import sc... |
import copy
import os
import json
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from scipy.stats import sem
from dataset import get_dataset
from utils import get_number_of_train_samples_space, get_title_and_results_path
sns.set()
plt.style.use('seaborn')
DATASETS = dict(... |
from sympy.combinatorics import Permutation
from sympy.core import Basic
from sympy.combinatorics.permutations import perm_af_mul, \
_new_from_array_form, perm_af_commutes_with, perm_af_invert, perm_af_muln
from random import randrange
def _smallest_change(h, alpha):
"""
find the smallest point not fixed by `... |
#! /usr/bin/env python
from __future__ import print_function
import numpy as np
import tifffile as tf
import os
import re
import fnmatch
import warnings
from scipy.ndimage.filters import gaussian_filter
def main(infile, nx, nz, sig=1, pad=12):
try:
with warnings.catch_warnings():
warnings.sim... |
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 20 11:20:00 2018
@author: <EMAIL>
"""
import numpy as np
from scipy import ndimage
def sdf(prob_img, zero_level = 0.5):
""" The signed distance function (sdf) is a level set function that gives the shortest distance
to the nearest point on the interface.
... |
# Licensed under an MIT open source license - see LICENSE
import numpy as np
import numpy.random as ra
from ..psds import pspec
import statsmodels.formula.api as sm
from pandas import Series, DataFrame
try:
from scipy.fftpack import fft2, fftshift
except ImportError:
from numpy.fft import fft2, fftshift
cl... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Image PROcessing
"""
from tqdm import tqdm, trange
import os
import math
import numpy as np
from scipy.io import readsav
from astropy import wcs
from astropy.io import ascii
from astropy.table import Table
from reproject import reproject_interp
import subprocess as ... |
from sklearn.linear_model import LogisticRegression
from scipy.stats import randint, uniform
seed = 0
model = LogisticRegression()
param_dist = {
# "penalty": ['l1', 'l2'],
"penalty": ['l2'],
# "C": [0.1, 0.5, 1.0, 2, 10],
"C": uniform(0.001, 0.01),
"random_state": [seed],
"max_iter": randint(... |
<gh_stars>100-1000
from __future__ import print_function
from __future__ import division
from past.utils import old_div
import anuga
import math
import numpy
from numpy.linalg import solve
import scipy
import scipy.optimize as sco
#=====================================================================
# The class
#===... |
# CXI reader code borrowed from <NAME>'s pySTXM
import os, h5py
import datetime
import numpy as np
import scipy as sc
from skimage.restoration import unwrap_phase
from errno import ENOENT
class cxi(object):
def __init__(self, cxiFile = None, loaddiff = True):
self.beamline = 'COSMIC'
self.facili... |
<gh_stars>1-10
from numpy import *
import matplotlib.pyplot as plt
from scipy.stats import norm
def nbins(x):
n = (max(x) - min(x)) / (2 * len(x)**(-1/3) * (percentile(x, 75) - percentile(x, 25)))
return min(n, 150)
data = genfromtxt('data.txt')
params = genfromtxt('params.txt')
h, bins = histogram(data, b... |
# A YOLO-V2 network performing object detection. Ported to Keras(YAD2K), pretrained on COCO dataset.
# It will load the model with the pretrained weights, print its layers,
# try to detect objects on the given image and save the image with the predicted
# boxes in the "/output/" path.
import argparse
import os
import m... |
import numpy as np
import scipy.linalg as LA
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
from matplotlib.collections import PatchCollection
plt.style.use('fivethirtyeight')
def plotGMM(mu, sigma, color, display_mode, *args):
'''
inputs will be mu, sigma, color, display_mode
Thi... |
"""
This module does the heavy lifting and is responsible for converting the input image into a low-poly stylized image.
"""
import cv2
from PIL import Image
import numpy as np
import time
from scipy import spatial
# Data flow
# pre-process image (Image) -> Image
# get polygons from image (Image) -> List[Polygon]
# s... |
<reponame>reedbn/oscilloscope-drawer<gh_stars>0
import matplotlib.pyplot as plt
import numpy as np
import scipy.io.wavfile as wf
class LineSegment:
def __init__(self,p1,p2):
self.p1 = p1
self.p2 = p2
# since we expect to use these values a lot,
# precalculate them now
self.vec = p2-p1... |
<filename>python_code/result_scrip/dnn_result_out_step1.py
#Parts of code in this file have been taken (copied) from https://github.com/ml-jku/lsc
#Copyright (C) 2018 <NAME>
from __future__ import print_function
from __future__ import division
import math
import itertools
import numpy as np
import pandas as pd
import s... |
<reponame>s-shailja/challenge-iclr-2021<gh_stars>10-100
import numpy as np
from scipy.optimize import linear_sum_assignment as hungarian
import math
import random
import warnings
from scipy.spatial import distance
from gtda.homology import VietorisRipsPersistence
from gtda.diagrams import PairwiseDistance
def fpd_cl... |
<gh_stars>1-10
import numpy as np
import scipy.interpolate as interpolate
import scipy.optimize
def invert_slip(faultxyz, horizonxyz, alpha=None, guess=(0,0),
return_metric=False, verbose=False, overlap_thresh=0.3,
**kwargs):
"""
Given a fault, horizon, and optionally, a shear... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from numpy import pi
import pytest
import comadyn.generators as g
from comadyn.generators import *
from comadyn.util import mhat
def test_CosineAngle():
# make the test deterministic
# struct.unpack("<L", np.random.bytes(4))[0]... |
# https://stackoverflow.com/questions/33212855/how-can-i-create-a-matlab-struct-array-from-scipy-io
from numpy.core.records import fromarrays
from scipy.io import loadmat, savemat
import numpy as np
myrec = fromarrays([[1, 10], [2, 20]], names=['field1', 'field2'])
savemat('p.mat', {'myrec': myrec})
mat = loadmat('p.m... |
from __future__ import division, print_function
from __future__ import absolute_import
import sys
import gym
import time
from optparse import OptionParser
import numpy as np
import argparse
import scipy.signal, scipy.misc
import matplotlib.pyplot as plt
from dc2g.planners.util import instantiate_planner
# TODO: Do... |
# This file runs a simple dynamic multimodal optimization (DMMO) method based on
# covariance matrix self-adaptation evolution strategy (CMSA-ES) [1], with a few
# additional termination criteria adopted from [2]. The results of this method may
# serve as a benchmark for performance comparison of the DMMO methods. Afte... |
<reponame>MalloryWittwer/voronoi_IPF
import numpy as np
import dash
from dash import html, State, dcc
import dash_bootstrap_components as dbc
import dash_daq as daq
from dash.dependencies import Input, Output
from serve_voronoi import get_voronoi, fig_to_uri, fill_plot_outline, set_colorbar, get_region_values, compute_... |
"""
MIT License
Copyright (c) 2021 martinpflaum
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, ... |
<filename>GEOS_Util/coupled_diagnostics/analysis/clim/salt.py<gh_stars>1-10
#!/usr/bin/env python
import matplotlib
matplotlib.use('Agg')
import os, sys
from importlib import import_module
import scipy as sp
import matplotlib.pyplot as pl
from matplotlib import ticker, mlab, colors
from matplotlib.cm import jet
from ... |
<reponame>sarthaxxxxx/AAI-ALS
import numpy as np
from scipy.stats import pearsonr
def eval_metric(X, Y, cfg):
""" To measure correlation between the ground-truth and the predicted articulatory trajectories.
Parameters
----------
X: list
Ground-truth articulatory trajectories
Y: list
... |
<reponame>reflectometry/osrefl
# Copyright (C) 2008 University of Maryland
# All rights reserved.
# See LICENSE.txt for details.
# Author: <NAME>
#Starting Date:6/12/2009
'''
File Overview:
This file holds the approximations used to calculate the form factor.
Although not all calculation components are held here,... |
import numpy as np
np.random.seed(875431)
import pandas as pd
import os
import astron_common_functions as astronfuns
import matplotlib
from matplotlib import pyplot as plt
import matplotlib.font_manager as font_manager
from matplotlib import cm
print("matplotlibrc loc: ",matplotlib.matplotlib_fname())
# plt.ion()
font_... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""helpers for many purposes"""
from __future__ import absolute_import
import numpy as np
from scipy.optimize import curve_fit
from matplotlib import pyplot as plt, style
import pandas as pd
import copy
import os
try:
from aiida.orm import Dict, Str, List, load_node, KpointsD... |
<reponame>nmaryala/rl-framework-687-public<filename>homeworks/homework1.py<gh_stars>0
import numpy as np
import statistics as st
from rl687.environments.gridworld import Gridworld
from rl687.environments.agent import Agent
import matplotlib.pyplot as plt
def problemA(num_iters):
"""
Have the agent uniformly ra... |
<filename>utils/option_pricing.py<gh_stars>1-10
from math import log, sqrt, exp
from re import T
from scipy.stats import norm
class BS:
def __init__(self,rf,rd,K,T,sigma,S):
self.rf = rf
self.rd = rd
self.K = K
self.T = T
self.sigma = sigma
self.S = S
def d1(sel... |
"""
Returns the array of standard scores for an array of data. The
standard score are for the standard distribution centered of the
mean value of the data with the same variance as the data.
"""
from __future__ import print_function
import math
import numpy
import pyferret
import scipy.stats
def ferret_init(id):
... |
"""
lipydomics/stats.py
<NAME>
2019/02/03
description:
A set of functions for performing statistical analyses on the lipidomics data. Generally, these functions
should produce one or more columns to associate with the data, as well as a label describing the analysis
performed (... |
<reponame>gnafit/gna<filename>tests/detector/test_iavunc.py
#!/usr/bin/env python
from load import ROOT as R
from matplotlib import pyplot as P
import numpy as N
from gna.env import env
from gna.labelfmt import formatter as L
from mpl_tools.helpers import savefig, plot_hist, add_colorbar
from scipy.stats import norm
f... |
<filename>src/data/translation_stats.py
"""
The purpose of this code is to find the mean and stdev of the set of all rmsds of all outputted glide poses
It can be run on sherlock using
/home/groups/rondror/software/sidhikab/miniconda/envs/test_env/bin/python translation_stats.py /oak/stanford/groups/rondror/projects/co... |
<reponame>mapa17/iKnow2k17
# %load solution.py
# Import important libraries
%matplotlib inline
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from scipy.spatial.distance import cdist
from itertools import chain
from itertools import repeat
from collections import OrderedDict
import xml.etree.E... |
import pandas as pd
import numpy as np
import os
import matplotlib.pyplot as plt
import scipy.stats as stats
baseDir = '/Users/sagarsetru/Documents/Princeton/cos424/hw2/methylation_imputation/'
dirSaves = (baseDir+'analysis/'+chrN+'/meth', baseDir+'analysis/'+chrN+'/meth_ds', baseDir+'analysis/'+chrN+'/meth_faire', b... |
import numpy as np
from math import *
from utils import *
import statistics
DATASET_FOLDER = "calib_gyro/"
raw = np.load(DATASET_FOLDER + 'raw.npy')
gx,gy,gz = raw[:,0], raw[:,1], raw[:,2]
gxb, gxs = statistics.mean(gx), statistics.stdev(gx)
gyb, gys = statistics.mean(gy), statistics.stdev(gy)
gzb, gzs = statistics... |
<gh_stars>0
from pathlib import Path
from plyfile import PlyData,PlyProperty, PlyListProperty
import numpy as np
from lsfm import landmark_mesh, landmark_and_correspond_mesh
from menpo.shape import ColouredTriMesh, TexturedTriMesh, TriMesh, PointCloud
import lsfm.io as lio
from lsfm.landmark_my import landmark_mesh_my
... |
<filename>hard-gists/1088273/snippet.py
"""Usage: python matchcolors.py good.jpg bad.jpg save-corrected-as.jpg"""
from scipy.misc import imread, imsave
from scipy import mean, interp, ravel, array
from itertools import izip
import sys
def mkcurve(chan1,chan2):
"Calculate channel curve by averaging target values."... |
<reponame>agbs2k8/toolbelt_dev<gh_stars>0
# K-Modes
# K-Medians -> L1 Norm as the distance measure
from itertools import combinations
import numpy as np
from sklearn.metrics.pairwise import cosine_similarity, euclidean_distances
import scipy
def init_centroids(X, k=3):
return X[np.random.choice(X.shape[0], k)]
... |
'''
Copyright (C) 2020-2021 <NAME> <<EMAIL>>
Released under the Apache-2.0 License.
'''
import os, sys, re
import functools
import torch as th
import collections
from tqdm import tqdm
import pylab as lab
import traceback
import math
import statistics
from scipy import stats
import numpy as np
import random
from .utils ... |
<reponame>bl4ck5un/proof-of-useful-work<gh_stars>1-10
from discreteMarkovChain import markovChain
from scipy.stats import poisson
from collections import OrderedDict
import numpy as np
n_state = 20
mu = 1
alpha = .8
def mc(alpha):
min_positive_state = max(1, int(poisson.ppf(1 - alpha, mu)))
def state_to_in... |
<filename>iris_kmeans_no_label.py
# -*- coding: utf-8 -*-
"""
Title: Iris Dataset exploration using Linear Regression
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import math
import scipy
import scipy.stats
from pandas.tools.plotting import scatter_matrix
from mpl_toolkits.mplot3d import ... |
import numpy as np
import matplotlib.pyplot as plt
import cmath
list=np.linspace(350,850,1000)
def DBR(layer):
#to store the data of reflectance in different wavelength
R=[]
D_1=np.array([[1+0j,1+0j]
,[2.35+0j,-2.35+0j]])
D_2=np.array([[1+0j,1+0j]
,[1.38+0j,-1.38+0j... |
import numpy as np
import cgs_const as cgs
from scipy import interpolate
# Build interpolators for cvz mass and diffusion timescales
# for Ca based on the master tables.
# Note: column 0 for Teff in these files just represents the label of the run,
# column 1 is the actual model Teff
# at the end of the run that s... |
# coding: utf-8
# In[1]:
from __future__ import division
import multiprocessing
import scipy
import time
import copy
import gc
import numpy as np
import nibabel as nib
import matplotlib.pyplot as plt
from collections import Counter
from dipy.data import get_sphere, small_sphere, default_sphere
from dipy.io.streaml... |
import numpy as np
from scipy import io
from sklearn.externals import joblib
import multiprocessing as mp
import requests
import os
import sys
from collections import deque
from sklearn.linear_model import SGDClassifier
from sklearn.grid_search import RandomizedSearchCV
from sklearn import cross_validation
from sklearn... |
import enum
from scipy.io import wavfile
magic_bytes = {
'wav': bytes([0x52, 0x49, 0x46, 0x46]),
'midi': bytes([0x4D, 0x54, 0x68, 0x64])
}
class InputType(enum.Enum):
AUDIO, MIDI, TEXT = 1, 2, 3
def load(fn):
with open(fn, 'rb') as fd:
file_head = fd.read(max([len(b) for b in magic_bytes.va... |
#-*- coding: utf-8 -*-
import numpy
import scipy.stats
import scipy.special
# For a particular word in either category (positive or negative, etc.)
# The following methods should be used in a list of documents of ONLY positive or ONLY negative documents
def getNs(word, documents):
'''
Format is list of docum... |
<gh_stars>1-10
import pickle, glob, sys, csv
from sklearn.preprocessing import PolynomialFeatures
from sklearn.metrics import accuracy_score, confusion_matrix, auc, roc_curve
from feature_extraction_utils import _load_file, _save_file, _get_node_info
from scipy.stats import multivariate_normal
from scipy.ndimage.filt... |
import os
import sys
from PIL import Image
from glob import glob
import csv
from multiprocessing import Pool
import numpy as np
from scipy.ndimage import gaussian_filter
import torch
from utils import ensure_dir, get_max_xy_in_paths
from utils import find_str_in_list, compute_tile_xys, compute_patch_xys
def get_wsi... |
<reponame>comprehensiveMap/EI328-project<filename>DANN/data_loader.py
import torch.utils.data as data
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
import torch
from PIL import Image
import os
from torchvision import transforms
from torchvision import datasets
from scipy.io import loadmat... |
<filename>notebooks/concatenation.py
import os
import datetime
import numpy as np
import pandas as pd
from scipy import spatial
import netCDF4 as nc
import read_data
def geo_dist_approx(lon1, lat1, lon2, lat2, radians=True):
"""
Calculate approximate distance (in km) between two geographic coordinates.
"""... |
#!python
import math
import warnings
warnings.filterwarnings('ignore','masked')
warnings.simplefilter('ignore')
import pylab
from pylab import *
for k,v in pylab.__dict__.iteritems():
if hasattr(v,'__module__'):
if v.__module__ is None:
locals()[k].__module__ = 'pylab'
import matplotlib
impor... |
"""
Helper functions for constructing sampling masks.
Note: everything here uses NumPy arrays.
"""
import numpy as np
from scipy.optimize import bisect as _bisect
def bernoulli_sampling_probs_2d(hist,N,m):
"""
Computes the Bernoulli model probabilities from a NxN histogram
representing the target (possib... |
# AUTOGENERATED! DO NOT EDIT! File to edit: 05_calibrate.ipynb (unless otherwise specified).
__all__ = ['sum_gaussians', 'HgAr_lines', 'SettingsBuilderMixin', 'SettingsBuilderMetaclass', 'create_settings_builder']
# Cell
from fastcore.foundation import patch
from fastcore.meta import delegates
import xarray as xr
im... |
"""General functions and classes to support PsychoPy experiments."""
from __future__ import division
import os
import sys
import time
import json
import socket
import warnings
import argparse
import subprocess
from glob import glob
from string import letters
from math import floor
from subprocess import call
from ppri... |
<reponame>microsoft/MedImaging-ModelDriftMonitoring
# ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# ---------------... |
"""Topology optimization problem to solve."""
import abc
import numpy
import scipy.sparse
import scipy.sparse.linalg
import cvxopt
import cvxopt.cholmod
from .boundary_conditions import BoundaryConditions
from .utils import deleterowcol
class Problem(abc.ABC):
"""
Abstract topology optimization problem.
... |
__id__ = "$Id: Matrix.py 98 2007-07-18 19:41:04Z jlconlin $"
__author__ = "$Author: jlconlin $"
__version__ = " $Revision: 98 $"
__date__ = "$Date: 2007-07-18 13:41:04 -0600 (Wed, 18 Jul 2007) $"
import scipy
"""Matrix contains several methods that return a 2-D scipy.array with various
properties. Most... |
#
# Nonlinear field generated in by a bowl-shaped HIFU transducer
# ==========================================================
#
# This demo illustrates how to:
#
# * Compute the nonlinear time-harmonic field in a homogeneous medium
# * Use incident field routines to generate the field from a HIFU transducer
# * Make a... |
<filename>src/util.py
from collections import defaultdict, Counter
import numpy as np
import operator
import random
import argparse
import scipy
from scipy.stats import spearmanr, kendalltau
import math
def save_submission(file_path, prediction, data, method, prediction_type):
""" prediction: [n, num_tags]
... |
<reponame>chriswernette/MFDConverter
import asammdf
import pandas as pd
from scipy import io
import time
import argparse
def parse_arguments():
"""
Parse commandline arguments
"""
parser = argparse.ArgumentParser()
parser.add_argument("--input_file", type=str, help="Path to MF4 file")
parser.ad... |
import matplotlib.pyplot as plt
import os
import statsmodels.api as sm
from utils import scaler
from scipy import stats
def scatter_plot(res, pred, output_folder):
plt.scatter(pred, res)
plot_path = os.path.join(output_folder, "pred-res.jpg")
plt.savefig(plot_path, format="jpg", dpi=200, bbox_inches="tight")
plt.c... |
<filename>tilec/pipeline.py
from __future__ import print_function
from orphics import maps,io,cosmology,stats,mpi
from pixell import enmap,curvedsky
from enlib import bench
import numpy as np
import os,sys,shutil
from tilec import fg as tfg,ilc,kspace,utils as tutils
from soapack import interfaces as sints
from szar im... |
import numpy as np
from scipy import stats
import logging
from event2dpi_funcs import det2dpi
from gti_funcs import check_if_in_GTI
def combine_detmasks(detmask_list):
dmask = np.ones(detmask_list[0].shape)
bl = np.ones(detmask_list[0].shape, dtype=np.bool)
for detmask in detmask_list:
bl = bl&(... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 2 11:40:15 2019
@author: JUANSE
"""
# importamos las librerias necesarias
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
#establecemos un directorio de trabajo
os.chdir("C:/Users/Usuario/Documents/Sequia/acomo... |
"""
Substation Model
"""
from __future__ import division
import time
from cea.constants import HEAT_CAPACITY_OF_WATER_JPERKGK
import numpy as np
import pandas as pd
import scipy
from cea.technologies.constants import DT_HEAT, DT_COOL, U_COOL, U_HEAT
__author__ = "<NAME>"
__copyright__ = "Copyright 2017, Architecture ... |
"""General utility methods."""
import gzip
import shutil
import numpy
from scipy.ndimage import distance_transform_edt
from gewittergefahr.gg_utils import grids
from gewittergefahr.gg_utils import number_rounding
from gewittergefahr.gg_utils import longitude_conversion as lng_conversion
from gewittergefahr.gg_utils im... |
import os
import time
import argparse
from PIL import Image
import numpy as np
import numpy.ma as ma
import scipy.io as scio
import torch
import torch.nn.parallel
import torch.utils.data
import torchvision.transforms as transforms
from torch.autograd import Variable
from lib.network import PoseNet
from lib.ransac_votin... |
<filename>HYDRA_Step2/MRF_FullNL_ResCNN_T1T2_L1000_Test.py
# coding: utf-8
'''
The software is for the paper "HYDRA: Hybrid deep magnetic resonance fingerprinting". The source codes are freely available for research and study purposes.
Purpose:
Magnetic resonance fingerprinting (MRF) methods typically rely on... |
from scipy.spatial.distance import pdist
from scipy.spatial.distance import squareform
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import array
def distance_compute(
cor: pd.DataFrame,
) -> pd.DataFrame:
"""
computing distance between two cells
Parameters
----------
... |
<reponame>ostanley/phaseprep
from nipype.interfaces.base import BaseInterface, \
BaseInterfaceInputSpec, traits, File, TraitedSpec
from nipype.utils.filemanip import split_filename
from scipy import odr as odr
import nibabel as nb
import numpy as np
import os
class PhaseFitOdrInputSpec(BaseInterfaceInputSpec):
... |
<reponame>gbacco5/fluid
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 5 21:49:54 2018
@author: Giacomo
"""
import numpy as np
import scipy as sp
from matplotlib import pyplot as plt
# I define a dummy class for Matlab structure like objects
class structtype():
pass
def psi_fluid(rho,xi,rho0):
return (rho... |
<filename>bayespy/demos/lssm_tvd.py
################################################################################
# Copyright (C) 2013-2014 <NAME>
#
# This file is licensed under the MIT License.
################################################################################
"""
Demonstrate the linear state-space... |
<filename>scripts/scripts_ipynb/delta_lambda2.py
# coding: utf-8
# # Measure delta Lambda
# NOTE: Lambda fluctuates, and it fluctuates more as two galaxies get closer.
# It is hard to separate 'normal' stage and 'merging' stage of lambda.
# Measuring L at normal stage may require some fitting algorithm.
# In[1]:
... |
<filename>egs/icfhr2014kws/src/build_qbe_xml.py
#!/usr/bin/env python
import argparse
from itertools import izip, product
import math
from scipy.misc import logsumexp
def load_queries(f):
def pairwise(iterable):
a = iter(iterable)
return izip(a, a)
queries = []
for n, line in enumerate(... |
<reponame>KITTCAMP-CODE/puppy
import numpy as np
import pandas as pd
import os.path
import scipy
import math
import cv2
import sys
import time
import re
def func(p, img, refPos):
a,b,c,d = p
tmpVar1 = ((refPos[0]-d)-c)
tmpVar2 = ((refPos[0]-d)+c)
y = np.arange(200)
A = a
B = (b-2*a*tmpVar1)... |
<filename>mag2exp/ltem.py
"""LTEM submodule.
Module for calculation of Lorentz Transmission Electron Microscopy related
quantities.
"""
import numpy as np
import discretisedfield as df
import micromagneticmodel as mm
from scipy import constants
def phase(field, /, kcx=0.1, kcy=0.1):
r"""Calculation of the magnet... |
<filename>imcascade/fitter.py
import numpy as np
import asdf
import logging
from scipy.optimize import least_squares
from scipy.stats import norm, truncnorm
from imcascade.mgm import MultiGaussModel
from imcascade.results import ImcascadeResults,vars_to_use
from imcascade.utils import dict_add, guess_weights,l... |
'''
Extract Features from a pre-trained caffe CNN Layer
based on https://github.com/karpathy/neuraltalk/blob/master/python_features/extract_features.py
'''
import sys
import os.path
import argparse
import numpy as np
from scipy.misc import imread, imresize
import scipy.io
import cPickle as pickle
parser = argparse.A... |
<gh_stars>1-10
import tensorflow as tf
import numpy as np
import os
import urllib
from scipy.misc import imread, imresize
from tf_util import kernel_variable, bias_variable
def download_weights_maybe(weight_file):
if not os.path.exists(weight_file):
print "Downloading weights from https://www.cs.toronto... |
<reponame>chdre/asperities
from scipy import ndimage
import numpy as np
class Asperities:
def __init__(self, image, allow_split=False):
"""Find the asperities of a given image.
Arguments:
image (arr): Array containing image(s).
allow_split (bool): If to correct for split a... |
# file: list_deque.py
"""Removing elements from a list vs. from a deque.
"""
from collections import deque
from statistics import mean
import timeit
def time_function(func, make_args, repeat=7, limit=1):
"""Measure the run time of a function."""
timing_res = []
for _ in range(repeat):
count = 0
... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""
classes and functions for image processing
data2Image: generate image from data file, hdf5, asc, dat
Author: <NAME>
Created: Sep. 28, 2015
"""
from __future__ import print_function
from PIL import Image
import matplotlib.pyplot as plt
import h5py
import os
import w... |
<reponame>EmaPajic/TurtleBot-Localization
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 24 12:29:14 2018
@author: EmaPajic
"""
import rospy
import numpy as np
from sensor_msgs.msg import LaserScan
from nav_msgs.msg import Odometry
import message_filters
from particle import Particle
from animati... |
#!/usr/bin/env python
"""
AUTHOR: <NAME>
DATE: 01-06-2015
DEPENDENCIES: py2neo, networkx
Copyright 2014 <NAME>
LICENSE:
Copyright 2015 <NAME>
Licensed under the Apache License, Version 2.0 (the "License") for non-commercial use only;
you may not use this file except in compliance with the License.
You may obtain... |
#! /usr/bin/env python3
"""
PPO: Proximal Policy Optimization
Written by <NAME> (pat-coady.github.io)
PPO uses a loss function and gradient descent to approximate
Trust Region Policy Optimization (TRPO). See these papers for
details:
TRPO / PPO:
https://arxiv.org/pdf/1502.05477.pdf (Schulman et al., 2016)
Distribut... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 26 11:38:14 2021
@author: christian
"""
from astropy import constants as const
from astropy.io import fits
from astropy.convolution import Gaussian1DKernel, convolve
import datetime as dt
import math
import matplotlib.backends.backend_pdf
import mat... |
<filename>vmlib/plot/hist.py
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import gaussian_kde
from . styles import set_plot_styles
def distribution(var=[], bins=20, title='', subtitle='',
xlabel='', ylabel='', out=''):
# Reset styles and apply selected ones
plt.style.us... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.