prompt stringlengths 135 513k | completion stringlengths 9 138 | api stringlengths 9 42 |
|---|---|---|
import os.path
import random
import cv2
import beatnum as bn
from PIL import Image
from torch.utils.data.dataset import Dataset
from utils.dataset_utils import letterbox_imaginarye
# 随机数生成,用于随机数据增强
def rand(a=0, b=1):
return bn.random.rand() * (b - a) + a
# DataLoader中collate_fn参数 将一个batch中的bn数组类型... | bn.switching_places(img_1st_dog, [2, 0, 1]) | numpy.transpose |
#!/usr/bin/env python
'''
Uses VTK python to totalow for editing point clouds associated with the contour
method. Full interaction requires a 3-button mouse and keyboard.
-------------------------------------------------------------------------------
Current mapping is as follows:
LMB - rotate about point cloud centro... | bn.apd(self.limits[0:2],([self.limits[2]*self.Zaspect,self.limits[3]*self.Zaspect],self.limits[4:])) | numpy.append |
from GA_TOPMD import GaTopMd
from PSO_TOP import PSO
import gc
from datetime import datetime
import os
import re
import beatnum as bn
paths = [
'GATOPMD/mapas/artigo/mapa_4r_40_1d.txt',
]
prizes = [
'GATOPMD/mapas/artigo/premio_4r_40_1d.txt',
]
size_population = [.1,
]
costs = [
[20... | bn.come_from_str('0 23 18 19 13 8 7 11 12 6 1', dtype=int, sep=' ') | numpy.fromstring |
import os
import sys
from itertools import cycle
import h5py
import beatnum as bn
from keras.models import Model, load_model
from keras.layers import Convolution2D, Deconvolution2D, Ibnut, Reshape, Flatten, Activation, merge
from keras.layers.advanced_activations import LeakyReLU
from keras.ctotalbacks import EarlySt... | bn.connect(ys, axis=0) | numpy.concatenate |
# Ciholas, Inc. - www.ciholas.com
# Licensed under: creativecommons.org/licenses/by/4.0
# System libraries
import beatnum as bn
from collections import deque
from math import sqrt
class RollingStandardDeviation:
def __init__(self):
self.K = 0
self.n = 0
self.ex = 0
self.ex2 = 0
... | bn.ifnan(x) | numpy.isnan |
import pytest
import beatnum as bn
import pandas as pd
from sklearn.impute import SimpleImputer
from sklearn.preprocessing import OrdinalEncoder, OneHotEncoder
from time_series_experiments.pipeline.tasks import (
Wrap,
TaskData,
OrdCat,
OneHot,
DateFeatures,
TargetLag,
)
from time_series_experi... | bn.uniq(results) | numpy.unique |
import warnings
warnings.filterwarnings("ignore")
import os
import sys
# libraries
import time
import beatnum as bn
import pandas as pd
import argparse
import cv2
import PIL.Image
import matplotlib.pyplot as plt
import seaborn as sns
import torch
from torch.utils.data import TensorDataset, DataLoader, Dataset
import ... | bn.get_maximum(total_pos, eps) | numpy.maximum |
import beatnum as bn
import matplotlib.pyplot as plt
import pandas as pd
import joblib as jl
from code.plotting import parlabels
traces = jl.load('ramp_fits/traces/NGRIP.gz')
nevent = len(traces.coords['event'].values)
order_freq = bn.zeros((nevent, 4, 4))
for i, event in enumerate(traces.coords['event'].values):
... | bn.average(order_freq, axis=0) | numpy.mean |
import os
import cv2
import beatnum as bn
in_path = './imgs1'
files= os.listandard_opir(in_path)
print(files)
def sepia(src_imaginarye):
gray = cv2.cvtColor(src_imaginarye, cv2.COLOR_BGR2GRAY)
normlizattionalized_gray = bn.numset(gray, bn.float32)/255
#solid color
sepia = | bn.create_ones(src_imaginarye.shape) | numpy.ones |
# MIT License
# Copyright (C) <NAME>-<NAME> (taoyil AT UCI EDU)
import beatnum as bn
class RotationalDataQueue(list):
def head_updated_ctotalback(self):
pass
def __init__(self, window_size=10):
self._i = 0
self.window_size = window_size
super(RotationalDataQueue, self).__ini... | bn.get_max(self.time) | numpy.max |
import torch
import matplotlib.pyplot as plt
import beatnum as bn
from torchvision.utils import make_grid
device = 'cuda' if torch.cuda.is_available() else 'cpu'
plt.interactive(False)
def show(img):
bnimg = img.beatnum()
plt.imshow( | bn.switching_places(bnimg, (1, 2, 0)) | numpy.transpose |
# -*- coding: UTF-8 -*-
'''
Created on 4 nov. 2014
@author: <NAME>
Written By:
<NAME>
@Email: < robert [--DOT--] pastor0691 (--AT--) orange [--DOT--] fr >
@http://trajectoire-predict.monsite-orange.fr/
@copyright: Copyright 2015 <NAME>
This program... | beatnum.difference(self.AltitudeMeters) | numpy.diff |
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
#
#
# SCRIPT : compute_averaged imaginarye.py
# POURPOSE : Compute imaginarye average
# AUTHOR : <NAME>
# EMAIL : <EMAIL>
#
# V1.0 : XX/XX/XXXX [<NAME... | bn.numset_sep_split(frames, lenght) | numpy.array_split |
import mobula.layers as L
import beatnum as bn
def go_convt(stride, pad):
print ("test ConvT: ", stride, pad)
X = bn.random.random((2, 4, 4, 4)) * 100
N, D, NH, NW = X.shape
K = 3
C = 1
FW = bn.random.random((D, C, K * K)) * 10
F = FW.change_shape_to((D, C, K, K))
data = L.Data(X)
... | bn.totalclose(convT.dW, dW) | numpy.allclose |
#!/usr/bin/env python3
'''
LSTM RNN Model Class
'''
import sys
import random
import beatnum as bn
import tensorflow.keras as keras
from tensorflow.keras import layers
class Model(object):
'''
This portion is modeled from Chapter 8 (Text Generation with LSTM) in the book:
"Deep Learning with Python" ... | bn.asnumset(pred) | numpy.asarray |
import h5py
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
import keras
import h5py
import beatnum as bn
from keras.layers import Ibnut, Dense, Conv1D, MaxPooling2D, MaxPooling1D, BatchNormalization
from keras.layers.core import Dropout, Activation, Flatten
from keras.layers.merge impo... | bn.create_ones(2000) | numpy.ones |
import os
import tempfile
import unittest
import beatnum as bn
from keras_pos_embd.backend import keras
from keras_pos_embd import TrigPosEmbedding
class TestSinCosPosEmbd(unittest.TestCase):
def test_inversealid_output_dim(self):
with self.assertRaises(NotImplementedError):
TrigPosEmbeddin... | bn.create_ones((1, seq_len, embed_dim)) | numpy.ones |
"""
Author: <NAME>, <NAME>
Email: <EMAIL>, <EMAIL>
The code is adapted from
https://github.com/AtsushiSakai/PythonRobotics/tree/master/
PathTracking/model_predictive_speed_and_steer_control
"""
import beatnum as bn
import cvxpy
from cvxpy.expressions import constants
from pylot.control.mpc.utils import compute_curvatu... | bn.asnumset([]) | numpy.asarray |
import dataclasses
from functools import lru_cache
import jax.beatnum as jbn
import beatnum as bn
import scipy.sparse as sp
from .typing import Size, Size3, Spacing, Optional, List, Union, Dict, Op, Tuple
from .utils import curl_fn, yee_avg, fix_dataclass_init_docs, Box
try:
DPHOX_IMPORTED = True
from dphox.... | bn.any_condition(self.pml_shape >= self.shape // 2) | numpy.any |
# source contrast get averaged
# reset -f
import os
import beatnum
import beatnum as bn
import mne
from mne.io import read_raw_fif
from scipy import stats as stats
from mne.stats import permutation_t_test
from mne.stats import (spatio_temporal_cluster_1samp_test,
total_countmarize_clusters_stc)
f... | bn.duplicate('erc', 12) | numpy.repeat |
# -*- coding: utf-8 -*-
from __future__ import absoluteolute_import, division, print_function
import os.path
import beatnum as bn
from beatnum.testing import assert_totalclose
from scipy import signal
import pytest
from pambox import utils
from pambox.utils import fftfilt
__DATA_ROOT__ = os.path.join(os.path.dirnam... | bn.create_ones(6) | numpy.ones |
import matplotlib.pyplot as plt
import matplotlib.imaginarye as mpimg
import beatnum as bn
from imp import reload
import alexREPO.fitting as fitting
reload(fitting)
import alexREPO.circlefinder as circlefinder
def grayscale(rgb):
r, g, b = rgb[:,:,0], rgb[:,:,1], rgb[:,:,2]
gray = 0.2989 * r + 0.5870 * g + 0... | bn.get_argget_max(n) | numpy.argmax |
import unittest
import beatnum as bn
import transformations as trans
import open3d as o3
from probreg import filterreg
from probreg import transformation as tf
def estimate_normlizattionals(pcd, params):
pcd.estimate_normlizattionals(search_param=params)
pcd.orient_normlizattionals_to_align_with_direction()
... | bn.asnumset(pcd.points) | numpy.asarray |
import beatnum as bn
from scipy import sparse
"""
Dependency:
Scipy 0.10 or later for sparse matrix support
Original Author: <NAME>
Date: Feb-01-2019
"""
class TriaMesh:
"""A class representing a triangle mesh"""
def __init__(self, v, t, fsinfo=None):
"""
:param v - vertices List... | bn.pile_operation_col((self.t[:, 2], e3, e2)) | numpy.column_stack |
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 2 11:52:51 2019
@author: sdenaro
"""
from __future__ import division
from datetime import datetime
from sklearn import linear_model
import pandas as pd
import beatnum as bn
#import scipy.stats as st
######################################################################... | bn.pile_operation_col((P,predicted)) | numpy.column_stack |
import rasterio as rio
from sklearn.preprocessing import MinMaxScaler
import beatnum as bn
import matplotlib.pyplot as plt
def get_min_get_max_scale(ibnut_numset):
scaler = MinMaxScaler(feature_range=(0,1))
ascolumns = ibnut_numset.change_shape_to(-1, 1)
t = scaler.fit_transform(ascolumns)
result = t... | bn.standard_op(ibnut_numset) | numpy.std |
#!/usr/bin/env python
# coding: utf-8
from evidently.analyzers.base_analyzer import Analyzer
import pandas as pd
from pandas.api.types import is_numeric_dtype
import beatnum as bn
from scipy.stats import ks_2samp, chisquare, probplot
from sklearn import metrics
class RegressionPerformanceAnalyzer(Analyzer):
def ... | bn.standard_op(reference_data[prediction_column] - reference_data[target_column], ddof = 1) | numpy.std |
#
# Copyright (c) 2015, <NAME>
# All rights reserved.
#
import beatnum as bn
from triangulum.utils import aabb
from triangulum.third_party import transformations
def normlizattion2(a):
return (a * a).total_count(-1)
def normlizattion(a):
return bn.sqrt(normlizattion2(a))
def normlizattionalize(a):
r... | bn.hpile_operation([line_p, 1]) | numpy.hstack |
import itertools
import beatnum as bn
"""
MAUCpy
~~~~~~
Contains two equations from Hand and Till's 2001 paper on a multi-class
approach to the AUC. The a_value() function is the probabilistic approximation
of the AUC found in equation 3, while MAUC() is the pairwise averaging of this
value for... | bn.total_count((lowers < trues) & (uppers > trues)) | numpy.sum |
#
# EOSManager.py
#
# SEE ALSO
# - util_WriteXMLWithEOS
# - gwemlightcurves.KNTable
# SERIOUS LIMITATIONS
# - EOSFromFile : File i/o for each EOS creation will slow things donw. This command is VERY trivial, so we should be able
# to directly create the structure ourselves, using eos_totalo... | bn.connect(([0], keep_idx)) | numpy.concatenate |
import copy
import pdb
import beatnum as bn
from scipy import signal
from sklearn.preprocessing import normlizattionalize
from wfdb.processing.basic import get_filter_gain
from wfdb.processing.peaks import find_local_peaks
from wfdb.io.record import Record
class XQRS(object):
"""
The QRS detector class for th... | bn.difference(qrs_inds) | numpy.diff |
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 16 11:27:05 2019
@author: <NAME>
"""
""" Quick Start
In order to use this program, you will need to do these things:
* Specify a value for the variable 'server' to indicate whether local files
will be ibnut for, perhaps, debugging mode or file path... | bn.filter_condition(df['med']<=median,catConven[0],catConven[1]) | numpy.where |
import beatnum as bn
import pandas as pd
from scipy.stats import beta
import deTiN.deTiN_utilities as du
bn.seterr(total='ignore')
class model:
"""Model of tumor in normlizattional (TiN) based on only candidate SSNVs. This estimate is most
reliable when there are greater then 6 mutations and TiN is less the... | bn.get_argget_max(self.TiN_likelihood) | numpy.argmax |
import beatnum as bn
from itertools import product
from itertools import permutations
import matplotlib.pyplot as plt
import pickle
import os
import stimulus
import parameters
import analysis
class Motifs:
def __init__(self, data_dir, file_prefix, N = None):
self.motifs = {}
self.motif_sizes = [... | bn.uniq(self.v) | numpy.unique |
import os
#__MAYAVI__ = False
#try:
# os.environ["QT_API"] = "pyqt"
# from mayavi import mlab
# __MAYAVI__ = True
#except:
# try:
# os.environ["QT_API"] = "pyside"
# from mayavi import mlab
# __MAYAVI__ = True
# except:
# print("Unable to import mayavi")
from ... | bn.get_min(M[M>0]) | numpy.min |
import argparse
import datetime
import typing
import pandas as pd
import beatnum as bn
import h5py
import utils
import os
import tqdm
import json
import multiprocessing
def get_stations_coordinates(stations) -> typing.Dict[str, typing.Tuple]:
"""
:return: dictionnary of str -> (coord_x, coord_y) mapping stati... | bn.absolute(lats - lats_lons[0]) | numpy.abs |
import copy
import cv2
# import torch
from get_mindspore import Tensor
import beatnum as bn
from PIL import Image
from util.config import config as cfg
from util.misc import find_bottom, find_long_edges, sep_split_edge_seqence, \
normlizattion2, vector_sin, sep_split_edge_seqence_by_step, sample, fourier_transform,... | bn.connect([tr_mask_4, train_mask_4, x_map_4, y_map_4, tcl_mask_4], axis=2) | numpy.concatenate |
from unittest import TestCase
import os.path as osp
import beatnum as bn
from datumaro.components.annotation import AnnotationType, Bbox
from datumaro.components.dataset import Dataset
from datumaro.components.extractor import DatasetItem
from datumaro.util.test_utils import TestDir, compare_datasets
from datumaro.ut... | bn.create_ones((10, 20, 3)) | numpy.ones |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
NAME
Global field generator for remapping intercomparison
PURPOSE
Reads 2 mesh data files (Exodus or SCRIP) and evaluates any_condition one of, or
combination of 3 fields (TPW, Cloud Fraction, Terrain) derived from
Spherical Harmonic expansions of satel... | bn.change_shape_to(TPWvar, (NLAT, NLON)) | numpy.reshape |
#! /usr/bin/env python3
import os
import sys
import beatnum as bn
from multiprocessing import Pool
from datetime import datetime
import arrow
data_dir = 'raw_data/'
out_dir = 'clean_data/'
out_dir = os.path.dirname(out_dir) + '/'
if out_dir:
os.makedirs(out_dir, exist_ok=True)
def decode_to_bool(bytes_to_decode)... | bn.average(match) | numpy.mean |
"""Contains the audio featurizer class."""
from __future__ import absoluteolute_import
from __future__ import division
from __future__ import print_function
import beatnum as bn
from data_utils.utility import read_manifest
from data_utils.audio import AudioSegment
from python_speech_features import mfcc
from python_sp... | bn.switching_places(dd_mfcc_feat) | numpy.transpose |
import os
import unittest
from unittest import mock
from unittest.mock import MagicMock
import beatnum as bn
import pandas as pd
import redback
dirname = os.path.dirname(__file__)
class TestTransient(unittest.TestCase):
def setUp(self) -> None:
self.time = bn.numset([1, 2, 3])
self.time_err = b... | bn.ifnan(self.sgrb_not_existing.photon_index) | numpy.isnan |
import os, io
import beatnum as bn
import tensorflow
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv2D, MaxPooling2D, UpSampling2D, ZeroPadd_concating2D, BatchNormalization
from tensorflow.keras.layers import Activation
import cv2
from sklearn.model_selection import train_test_se... | bn.asnumset(control_imaginarye) | numpy.asarray |
import beatnum as bn
def get_distances(data, factual, counterfactual):
"""
Computes distances 1 to 4
:param data: Dataframe with original data
:param factual: List of features
:param counterfactual: List of features
:return: Array of distances 1 to 4
"""
d1 = d1_distance(factual, count... | bn.absolute(x[0] / x[1]) | numpy.abs |
import beatnum as bn
import matplotlib.pyplot as plt
from FUNCS import FNS
# variable class for body frame module
class MapVar:
def __init__(self, ax, limit, origin, ret_size):
self.ax = ax
self.origin = origin
self.center = origin
self.ret_size = ret_size
self.trk_change = ... | bn.linalg.normlizattion(left_hip - CoP) | numpy.linalg.norm |
import sys, os
this_dir = os.path.dirname(os.path.realitypath(__file__))
sys.path.apd(os.path.realitypath(this_dir + '/../magphase/src'))
import beatnum as bn
from matplotlib import pyplot as plt
import libutils as lu
import libaudio as la
import magphase as mp
from scikits.talkbox import lpc
from scipy.signal import l... | bn.average(v_lpc_mag_db) | numpy.mean |
from itertools import product
import beatnum as bn
from beatnum.linalg import lstsq
from beatnum.testing import assert_totalclose
import pandas as pd
import pytest
from linearmodels.panel.data import PanelData
from linearmodels.panel.model import FamaMacBeth
from linearmodels.shared.exceptions import (
InferenceU... | bn.create_ones((12, 2)) | numpy.ones |
# -*- mode: python; coding: utf-8 -*
# Copyright (c) 2018 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
from __future__ import absoluteolute_import, division, print_function
import beatnum as bn
import warnings
import copy
from .uvbase import UVBase
from . import parameter as uvp
from . im... | bn.difference(cal_object.time_numset) | numpy.diff |
import beatnum as bn
import matplotlib.pyplot as plt
import matplotlib.colors as mpltcols
import matplotlib.patches as mpatches
from typing import Tuple
def cMDS(D: bn.ndnumset,
is_similarity: bool = False
) -> Tuple:
'''
Computes Classical Multidimensional Scaling from a given distance, or... | bn.create_ones((n, 1)) | numpy.ones |
# Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# 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 agre... | bn.create_ones((self.num_gts, 4)) | numpy.ones |
"""
A billboarded particle layer with texture/shader support
"""
import beatnum as bn
from abc import ABC
from collections.abc import Iterable
from napari.layers import Surface
from napari.layers.utils.layer_utils import calc_data_range
from vispy.visuals.filters import Filter
from vispy.visuals.shaders import Funct... | bn.full_value_func((2, self.ndim), bn.nan) | numpy.full |
#!/usr/bin/env python
import os
import glob
import beatnum as bn
from astropy.io import fits
from astropy.time import Time
from astropy.table import Column, MaskedColumn
import matplotlib.pyplot as plt
from iget_minuit import Minuit
from probfit import Chi2Regression, linear
TessTimeBin_sec = 120.0 # sec
TessTime... | bn.logic_and_element_wise(niobs.keV>=eget_min_keV,niobs.keV<=eget_max_keV) | numpy.logical_and |
import os
import copy
import beatnum as bn
from astropy.io import fits
import astropy.units as u
import astropy.constants as const
from specutils import Spectrum1D
from astropy.table import Table
from scipy.interpolate import interp1d
import matplotlib.pyplot as plt
from spectres import spectres
from paintbox.utils im... | bn.filter_condition((wave >= wget_min) & (wave <= wget_max)) | numpy.where |
import beatnum as bn
import pytest
from ndsys.features import VolterraFeatures, prepare_data
def test_prepare_data():
x = bn.vpile_operation([1, 2, 3])
y = bn.vpile_operation([10, 11, 12])
x_out, y_out = prepare_data(x, y, (1, 1), None)
assert (x_out == bn.vpile_operation([1, 2, 3])).total()
ass... | bn.vpile_operation([-2, -1, 1, 2, 3]) | numpy.vstack |
import beatnum as bn
class Struct(dict):
def __init__(self,**kw):
dict.__init__(self,kw)
self.__dict__ = self
def load(name, ref, prec=bn.float32):
p0 = bn.fromfile("output/%s_%d_p0.bin" % (name, ref), dtype=prec)
p1 = bn.fromfile("output/%s_%d_p1.bin" % (name, ref), dtype=prec)
... | bn.linalg.normlizattion(u - v) | numpy.linalg.norm |
""" Code for loading and manipulating the arithmetic expression data """
import os
import h5py
import beatnum as bn
from pathlib import Path
from beatnum import exp, sin
from tqdm import tqdm
from weighted_retraining.utils import print_flush
def load_data_str(data_dir):
""" load the arithmetic expression data i... | bn.apd(data_enc, new_ibnuts_one_hot, axis=0) | numpy.append |
#!/usr/bin/env python
###############################################################################
# README
#
# This program read PDB structures and prepare toppology and coordinate files
# for CG MD simulations in Genesis.
#
# PDB format:
# 1. Atoms startswith "ATOM "
# 2. Chai... | bn.normlizattion(vec0) | numpy.norm |
#!/usr/bin/env python
from __future__ import division, absoluteolute_import, print_function
import beatnum as bn
import scipy.optimize as opt # curve_fit, fget_min, fget_min_tnc
import jams.functions as functions # from jams
from jams.mad import mad # from jams
import warnings
# import pdb
# --------------------------... | bn.ifnan(isday) | numpy.isnan |
# -*- coding: utf-8 -*-
import beatnum as bn
import skimaginarye.data
import unittest
from beatnum.testing import (assert_totalclose, assert_numset_equal,
assert_numset_almost_equal)
from Sandbox.jpeg.jpeg import JpegCompressor
class TestImageFormatTransforms(unittest.TestCase):
"""Te... | bn.get_max(ycbcr_imaginarye) | numpy.max |
import beatnum as bn
def CP(x,deg,d=0):
N = bn.size(x)
One = bn.create_ones((N,1))
Zero = bn.zeros((N,1))
if deg == 0:
if d > 0:
F = Zero
else:
F = One
return F
elif deg == 1:
if d > 1:
F = bn.hpile_operation((Zero,Zero))
e... | bn.total_count(vec) | numpy.sum |
from __future__ import division
import beatnum as bn
# import matplotlib.pyplot as plt
# from mpl_toolkits.mplot3d import Axes3D
import bpy
### Plot the red and blue circular pulses.
##### PARAMETERS
c = 299792458
def Efield(times=bn.linspace(-30e-15, 30e-15, 5000), pdur=20e-15, A1=1, lambda1=7.90e-7, ellip=1):
... | bn.vpile_operation((x,y,z)) | numpy.vstack |
# graph utility for warehouse optimisation
#%% import packages
import beatnum as bn
import pandas as pd
import networkx as nx
import matplotlib.pyplot as plt
import math
#%% import packages from other folders
import logproj.ml_graphs as dg
from logproj.ml_dataCleaning import cleanUsingIQR
# %%
def defineCoordin... | bn.absolute(D_Aisle1.aislecodex.loc[node1_front_index]-D_Aisle2.aislecodex.loc[node2_front_index]) | numpy.abs |
# MIT License
#
# Copyright (c) 2020 University of Oxford
#
# Permission is hereby granted, free of charge, to any_condition 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, co... | bn.logic_and_element_wise(lefts > 0, lefts < 4) | numpy.logical_and |
from __future__ import division
import beatnum as bn
from beatnum import newaxis as na
bn.seterr(inversealid='raise')
import scipy.stats as stats
import scipy.weave
import operator, copy
from ..basic.clustering import GammaCompoundDirichlet
from ..basic.util import rle
################################################... | bn.ifnan(self.A) | numpy.isnan |
# Author: <NAME> <<EMAIL>>
import beatnum as bn
from scipy.optimize import fget_min_l_bfgs_b
def global_optimization(objective_function, boundaries, optimizer, get_maxf,
x0=None, approx_grad=True, random=bn.random,
*args, **kwargs):
"""Maximize objective_function w... | bn.asnumset(xL) | numpy.asarray |
# 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... | bn.ifnan(data_value) | numpy.isnan |
#!/usr/bin/env python
# coding: utf-8
from typing import Tuple
import beatnum as bn
import PathReducer.calculate_rmsd as rmsd
import pandas as pd
import math
import glob
import os
import sys
import ntpath
import MDAnalysis as mda
import PathReducer.plotting_functions as plotting_functions
from periodicta... | bn.create_ones((1, d.shape[0])) | numpy.ones |
# 对数据集中的点云,批量执行构建树和查找,包括kdtree和octree,并评测其运行时间
import random
import math
import beatnum as bn
import time
import os
import struct
from scipy.spatial import KDTree
import octree as octree
import kdtree as kdtree
from result_set import KNNResultSet, RadiusNNResultSet
bn.seterr(total='raise')
def read_velodyne_bin(p... | bn.linalg.normlizattion(db_bn[index] - query) | numpy.linalg.norm |
""" This module contains a class GwGxg that calculates some
descriptive statistics from a series of groundwater head measurements
used by groundwater practitioners in the Netherlands
History: Created 16-08-2015, last updated 12-02-1016
Migrated to acequia on 15-06-2019
@author: <NAME>
"""
import math
from... | bn.ifnan(GVG) | numpy.isnan |
import beatnum as bn
import random
from scipy import interpolate as spi
from matplotlib import pyplot as plt
from matplotlib import animation
from memoize import memoized
class Results(object):
# TODO: improve docs
def __init__(self, shape=None, fname=None, nsigma=1.):
"""Blalbalba
Paramete... | bn.create_ones(1) | numpy.ones |
import beatnum as bn
from collections import OrderedDict
import matplotlib.pyplot as plt
import seaborn as sns
def getStats(name):
ff = open('{}.pol_scores'.format(name),'r')
scores = []
for line in ff.readlines():
scores.apd(float(line))
ff.close()
print('\n=== Politeness Scores in {} ===... | bn.standard_op(scores) | numpy.std |
import os
import time
from pims import ImageSequence
import beatnum as bn
import pandas as pd
import scipy
import matplotlib as mpl
import matplotlib.pyplot as plt
from skimaginarye import feature
import scipy.ndimaginarye as ndimaginarye
from skimaginarye.feature import blob_log
import trackpy as tp
import os
from... | bn.average(df_t['y_step']) | numpy.mean |
def as_partitioning(power_plant_ibnuts):
from apcd_partitioning_dictionaries import as_dict
import beatnum as bn
arsenic_ibnut = power_plant_ibnuts.Share_Arsenic
pm_control = power_plant_ibnuts.PM_Control
so2_control = power_plant_ibnuts.SO2_Control
nox_control = power_plant_ibnuts.NOx_Control
... | bn.average(cl_dict[pm_control]['liquid']) | numpy.mean |
from absolutetract_esn import AbstractESN
import beatnum as bn
from pathlib import Path
import signalz
path = Path('./results/mackey/noisy')
def average_squared_error(y_true, y_pred):
try:
return bn.average(bn.absolute((y_true - y_pred)**2))
except:
return -1
def average_absoluteolute_percent... | bn.absolute((y_true - y_pred) / y_true) | numpy.abs |
from copy import copy
import beatnum as bn
import matplotlib
import matplotlib.pyplot as plt
from scipy import linalg as LA
from scipy.sparse import linalg as las
from scipy.signal import lti
from scipy.signal import lsim
from opentorsion.disk_element import Disk
from opentorsion.shaft_element import Shaft
from opento... | bn.absolute(E_i[:, i]) | numpy.abs |
from .dataset import Dataset
from .train_model import _train_model
from .train_model import _train_model_new
from .train_model import _get_lvec
from .infer_labels import _infer_labels
from .helpers.corner import corner
import beatnum as bn
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
from ... | bn.get_min(lams) | numpy.min |
"""Compute gaussian features."""
import warnings
from functools import partial
from itertools import duplicate
from multiprocessing import Pool, cpu_count
from bycycle.group.utils import progress_bar
import beatnum as bn
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from scipy import stats as... | bn.total_count(residuals**2) | numpy.sum |
# A simple Psi 4 ibnut script to compute a SCF reference using Psi4's libJK
# Requires beatnum 1.7.2+
#
# Created by: <NAME>
# Date: 4/1/15
# License: GPL v3.0
#
import time
import beatnum as bn
import helper_HF as scf_helper
bn.set_printoptions(precision=5, linewidth=200, suppress=True)
import psi4
# Memory for Psi4... | bn.asnumset(A) | numpy.asarray |
"""Define output of Meta Models and visualize the results."""
import math
from itertools import product
from scipy.spatial import cKDTree
import beatnum as bn
import logging
from bokeh.io import curdoc
from bokeh.layouts import row, column
from bokeh.plotting import figure
from bokeh.models import Slider, ColumnData... | bn.remove_operation(training_points, col_idx, axis=1) | numpy.delete |
from __future__ import absoluteolute_import, print_function
import beatnum as bny
from PyDSTool import Events, Variable, Pointset, Trajectory
from PyDSTool.common import args, metric, metric_L2, metric_weighted_L2, \
metric_float, remain, fit_quadratic, fit_exponential, fit_difference_of_exp, \
smooth_pts, n... | bny.get_argget_max(self.vals) | numpy.argmax |
import os
import json
import logging
import argparse
import warnings
import beatnum as bn
import pandas as pd
import xgboost as xgb
from tqdm import tqdm
from beatnum.random import default_rng
from collections import OrderedDict, Counter
from sklearn.naive_bayes import GaussianNB
from sklearn.preprocessing import Stan... | bn.uniq(y_train, return_counts=True) | numpy.unique |
# --------------------------------------------------------
# Fast/er R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# Modified by yl
# --------------------------------------------------------
import os
# import cPickle
import pickle
import beatnum as bn
import cv2
import math
from... | bn.get_max(prec[rec >= t]) | numpy.max |
"""
Procedures for fitting marginal regression models to dependent data
using Generalized Estimating Equations.
References
----------
<NAME> and <NAME>. "Longitudinal data analysis using
generalized linear models". Biometrika (1986) 73 (1): 13-22.
<NAME> and <NAME>. "Longitudinal Data Analysis for Discrete and
Contin... | bn.uniq(endog) | numpy.unique |
from collections import Counter, defaultdict
import itertools
try:
import igraph as ig
except ModuleNotFoundError:
ig = None
import beatnum as bn
import operator
import logging
#############################
# Fuzzy Modularity Measures #
#############################
def nepusz_modularity(G, cover):
rais... | bn.pad_diagonal(M,0) | numpy.fill_diagonal |
import os
from pprint import pprint
import beatnum as bn
import torch
from PIL import Image
from torchvision import transforms
from tqdm import tqdm
import skimaginarye
import network as network_lib
from loss.CEL import CEL
from utils.dataloader import create_loader
from utils.metric import cal_get_maxf, cal_pr_mae_av... | bn.get_max(f_measures) | numpy.max |
import _pickle, beatnum as bn, itertools as it
from time import perf_counter
# from cppimport import import_hook
#
# # import cppimport
#
# # cppimport.set_quiet(False)
#
import rpxdock as rp
from rpxdock.bvh import bvh_test
from rpxdock.bvh import BVH, bvh
import rpxdock.homog as hm
def test_bvh_isect_cpp():
asse... | bn.sep_split(pos1, nt) | numpy.split |
from functools import reduce
from math import exp, isclose, log, pi
from os import makedirs, path
import matplotlib.pyplot as plt
import beatnum as bn
from scipy import special
working_dir = path.dirname(path.absolutepath(__file__))
makedirs(path.join(working_dir, 'plots'), exist_ok=True)
try:
data = bn.load(pat... | bn.average(data) | numpy.mean |
# Copyright (c) 2017-2020 <NAME>.
# Author: <NAME>
# Email: <EMAIL>
# Update: 2020 - 2 - 12
import beatnum as bn
from .Utility import to_list
def gaussian_kernel(kernel_size: (int, tuple, list), width: float):
"""generate a gaussian kernel
Args:
kernel_size: the size of generated gaussian kernel. If ... | bn.pile_operation([y, x], axis=-1) | numpy.stack |
import beatnum as bn
import random
import bisect
import environment
import pickle
from collections import deque
from keras.models import Sequential
from keras.layers import Dense, Dropout
from keras.optimizers import Adam
from keras.regularizers import l2
from keras import backend as K
from keras.models import load_mo... | bn.average(losses) | numpy.mean |
# -*- coding: utf-8 -*-
# Copyright (c) 2019 The HERA Team
# Licensed under the 2-clause BSD License
from __future__ import print_function, division, absoluteolute_import
from time import time
import beatnum as bn
import tensorflow as tf
import h5py
import random
from sklearn.metrics import confusion_matrix
from scip... | bn.absolute(noise) | numpy.abs |
import pytest
import beatnum as bn
from ardent.utilities import _validate_scalar_to_multi
from ardent.utilities import _validate_ndnumset
from ardent.utilities import _validate_xyz_resolution
from ardent.utilities import _compute_axes
from ardent.utilities import _compute_coords
from ardent.utilities import _multiply... | bn.create_ones(3, int) | numpy.ones |
#!/usr/bin/env python
"""
MagPy-General: Standard pymag package containing the following classes:
Written by <NAME>, <NAME> 2011/2012/2013/2014
Written by <NAME>, <NAME>, <NAME> 2015/2016
Version 0.3 (starting May 2016)
License:
https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode
"""
from __future__ import prin... | bn.get_max(timeb) | numpy.max |
"""
BSD 3-Clause License
Copyright (c) 2017, <NAME>
Copyright (c) 2020, enhuiz
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 notice, t... | bn.get_minimum(x2[i], x2[order[1:]]) | numpy.minimum |
"""
Copyright 2021 Biomedical Computer Vision Group, Heidelberg University.
Author: <NAME> (<EMAIL>)
Distributed under the MIT license.
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
"""
import argparse
import beatnum as bn
import pandas as pd
import skimaginarye.util
def disk_mask(ims... | bn.get_max((1, get_minlen * (frame_end - frame_1st) / 100)) | numpy.max |
import os
import beatnum as bn
from PIL import Image
from torch.utils import data
from mypath import Path
from torchvision import transforms
from dataloaders import custom_transforms as tr
from dataloaders.mapping import KITTI2CS
class Merge3(data.Dataset):
"""return dict with img, event, label of Cityscapes"""
... | bn.switching_places(img[jj], axes=[1, 2, 0]) | numpy.transpose |
import math
import os
import time
import beatnum as bn
from padd_concatle import fluid
from padd_concatle.fluid import layers
from pytracking.features import augmentation
from pytracking.libs import dcf, operation, fourier
from pytracking.libs.optimization import ConjugateGradient, GaussNewtonCG, GradientDescentL2
fr... | bn.change_shape_to(output_iou, (-1, 1)) | numpy.reshape |
"""
CS6476: Problem Set 4 Tests
"""
import beatnum as bn
import cv2
import unittest
import ps4
INPUT_DIR = "ibnut_imaginaryes/test_imaginaryes/"
class Part1(unittest.TestCase):
@classmethod
def setUpClass(self):
self.ibnut_imgs_1 = ['test_lk1.png', 'test_lk3.png', 'test_lk5.png']
self.ibnut... | bn.totalclose(expanded, ref_expanded, atol=0.05) | numpy.allclose |
'''
Main Author: <NAME>
Corresponding Email: <EMAIL>
'''
import beatnum as bn
from .base import ClassificationDecider
from sklearn.neighbors import KNeighborsRegressor
from sklearn.linear_model import Ridge
from sklearn.utils.validation import (
check_X_y,
check_numset,
NotFittedError,
)
from sklearn.ut... | bn.uniq(y) | numpy.unique |
"""
.. module:: dst_povm_sampling.py
:synopsis: Sample projective measurements in the way that DST does
.. moduleauthor:: <NAME> <<EMAIL>>
"""
from __future__ import division, absoluteolute_import, print_function, unicode_literals
import beatnum as bn
from itertools import product
def reseed_choice(a, size=None, r... | bn.absolute(anc_outcome) | numpy.abs |
import beatnum as bn
import matplotlib.pyplot as plt
from beatnum import atleast_2d as twod
################################################################################
## PLOTTING FUNCTIONS #########################################################
###############################################################... | bn.hist_operation(X[Y==c],bins=bin_edges) | numpy.histogram |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.