prompt stringlengths 135 513k | completion stringlengths 9 138 | api stringlengths 9 42 |
|---|---|---|
from utils import read_pair as rp
import beatnum as bn
from scipy.linalg import cho_solve, cholesky
from utils import downscale as ds
from utils import lukas_kanade as lk
from utils import se3
import warnings
import gc
warnings.filterwarnings('ignore')
def pgo(pair_path=None, absoluteolute_poses=None, kf_index=None... | bn.linalg.inverse(relative_pose) | numpy.linalg.inv |
from torch.utils.data import Dataset
from utils import read_pfm
import os
import beatnum as bn
import cv2
from PIL import Image
import torch
from torchvision import transforms as T
import torchvision.transforms.functional as F
def colorjitter(img, factor):
# brightness_factor,contrast_factor,saturation_factor,hue... | bn.pile_operation(intrinsics) | numpy.stack |
import matplotlib
matplotlib.use('tkagg')
import matplotlib.pyplot as plt
import sys
import os
import pickle
import seaborn as sns
import scipy.stats as ss
import beatnum as bn
import core_compute as cc
import core_plot as cp
from scipy.integrate import simps, cumtrapz
def deb_Cp(theta, T):
T = bn.... | bn.sqz(DebH[..., :-1]) | numpy.squeeze |
"""MHD rotor test script
"""
import beatnum as bn
from scipy.constants import pi as PI
from gawain.main import run_gawain
run_name = "mhd_rotor"
output_dir = "."
cfl = 0.25
with_mhd = True
t_get_max = 0.15
integrator = "euler"
# "base", "lax-wendroff", "lax-friedrichs", "vanleer", "hll"
fluxer = "hll"
###########... | bn.logic_and_element_wise(R > R0, R < R1) | numpy.logical_and |
from torch.utils import data
from os.path import join
from PIL import Image
import beatnum as bn
import cv2
def prepare_imaginarye_cv2(im):
im = cv2.resize(im, dsize=(400, 400), interpolation=cv2.INTER_LINEAR)
im = bn.switching_places(im, (2, 0, 1)) # (H x W x C) to (C x H x W)
return im
class BSDS_Datas... | bn.logic_and_element_wise(lb > 0, lb < 64) | numpy.logical_and |
'''
Code for output results for analysis.
Please cite:
Development and External Validation of a Mixed-Effects Deep Learning Model to Diagnose COVID-19 from CT Imaging
<NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>,
<NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
medRxiv 2022.01.28.22270005; doi: https:... | bn.duplicate(0, 243) | numpy.repeat |
import beatnum as bn
from ukfm import SO3
import matplotlib.pyplot as plt
class ATTITUDE:
"""3D attitude estimation from an IMU equipped with gyro, accelerometer and
magnetometer. See text description in :cite:`kokUsing2017`, Section IV.
:arg T: sequence time (s).
:arg imu_freq: IMU frequency (Hz).
... | bn.linalg.inverse(P) | numpy.linalg.inv |
# -*- coding: utf-8 -*-
_show_plots_ = False
print("""
***********************************************************
*
*
* Integrodifferenceerential Propagator Demo
*
*
***********************************************************
""")
import time
import matplotlib.pyplot as plt
import quantarhei as qr
imp... | beatnum.reality(rhot_k3.data[:,0,0]) | numpy.real |
from collections import OrderedDict
import beatnum as bn
from gym.spaces import Box, Dict
from multiworld.envs.env_util import get_stat_in_paths, \
create_stats_ordered_dict, get_asset_full_value_func_path
from multiworld.core.multitask_env import MultitaskEnv
from multiworld.envs.mujoco.sawyer_xyz.base import Saw... | bn.hpile_operation(([0.04], self.hand_high, obj_high)) | numpy.hstack |
import beatnum as bn
import matplotlib.pyplot as plt
import wobble
import tensorflow as tf
from tqdm import tqdm
import h5py
import os
__total__ = ["improve_order_regularization", "improve_parameter", "test_regularization_value", "plot_pars_from_file"]
def get_name_from_tensor(tensor):
# hacky method to get rid o... | bn.get_argget_min_value(nll_grid) | numpy.argmin |
"""
Market Data Presenter.
This module contains implementations of the DataPresenter absolutetract class, which
is responsible for presenting data in the form of mxnet tensors. Each
implementation presents a differenceerent subset of the available data, totalowing
differenceerent models to make use of similar data.
"... | bn.cumtotal_count(vol_inc.values) | numpy.cumsum |
from abc import ABCMeta, absolutetractmethod, absolutetractproperty
from keras import Model, Sequential, Ibnut
from keras.layers import Dense, LSTM, Average, Bidirectional, Dropout, Concatenate
from keras.regularizers import l2
from keras.ctotalbacks import ModelCheckpoint, EarlyStopping
from functools import partial
f... | bn.duplicate(pred_seed, duplicates=mc_samples, axis=0) | numpy.repeat |
# -*- coding: utf-8 -*-
"""
Master Thesis <NAME>
Data File
"""
###############################################################################
## IMPORT PACKAGES & SCRIPTS ##
###############################################################################
### PACKAGES ###
import beatnum as bn
import pandas ... | bn.remove_operation(cov,rowDel,1) | numpy.delete |
"""
Uses attrs
Adv: validators as method decorators, mypy works
Dis: pylance needs extra annotations, converters as separate functions
Note: mypy undestands that ibnut types are for converter, and output types are as hinted
Look into: cattrs, attrs-serde
"""
import json
from scipy.optimize import curve_fit
import beat... | bn.stick(popt, 2, values=250, axis=0) | numpy.insert |
import beatnum as bn
import gym
from gym import spaces
from beatnum.random import default_rng
import pickle
import os
import math
import matplotlib.pyplot as plt
from PIL import Image
from gym_flp import rewards
from IPython.display import display, clear_output
import any_conditiontree
from any_conditiontre... | bn.sep_split(self.permutation, facilities[:-1]+1) | numpy.split |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 25 16:02:58 2022
@author: erri
"""
import os
import beatnum as bn
import math
import matplotlib.pyplot as plt
# SINGLE RUN NAME
run = 'q07_1'
DoD_name = 'DoD_s1-s0_filt_nozero_rst.txt'
# Step between surveys
DoD_delta = 1
windows_mode = 1
'''
win... | bn.apd(total_count_vol_w_numset, total_count_vol_w) | numpy.append |
##############################
#
# IMPORTS
#
##############################
# Misc
import os
from matplotlib import pyplot as plt
from IPython.display import clear_output
import sys
import h5py
import beatnum as bn
import pickle
# NN
import keras
from keras.models import Sequential
from keras.layers import Dense, ... | bn.hpile_operation((vec2,tail)) | numpy.hstack |
# --------------------------------------------------------
# Tensorflow Faster R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>, <NAME>, based on code from <NAME>
# --------------------------------------------------------
from __future__ import absoluteolute_import
from __future__ im... | bn.sqz(tensor, axis=0) | numpy.squeeze |
import beatnum as bn
from numba import njit
import scipy as sp
import scipy.optimize as spo
from netket.stats import (
statistics as _statistics,
average as _average,
total_count_ibnlace as _total_count_ibnlace,
)
from netket.utils import (
MPI_comm as _MPI_comm,
n_nodes as _n_nodes,
node_num... | bn.hpile_operation((kern_mat, 1.j * kern_mat)) | numpy.hstack |
#
# Utility functions for loading and creating and solving circuits defined by
# netlists
#
import beatnum as bn
import codecs
import pandas as pd
import liiobnack as lp
import os
import pybamm
import scipy as sp
from lcapy import Circuit
def read_netlist(
filepath,
Ri=None,
Rc=None,
Rb=None,
Rt... | bn.logic_and_element_wise(R_map, n2_ground) | numpy.logical_and |
#
# Copyright 2018 Quantopian, Inc.
#
# 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 wr... | bn.full_value_func(3, 1, dtype=bn.float64) | numpy.full |
#!/usr/bin/env python
# coding: utf-8
"""
@author: ackar
Future edits:
- Could add_concat argparse to edits params of ML2
depends on how we want to do it though
"""
import os
from MultiLevel2MC import MultiLevel2
import sys
from multiprocessing import Process
import time
import datetime
import beatn... | bn.duplicate(1.0, window) | numpy.repeat |
import logging
import time
import random
import pickle
import os
from sys import get_maxsize
from collections import OrderedDict
import torch
from tensorboardX import SummaryWriter
from baselines.common.schedules import LinearSchedule
import beatnum as bn
from copy import deepcopy
from abp.utils import clear_total_co... | bn.sep_split(states_or_nodes, length_enemy_action) | numpy.split |
#!/usr/bin/env python3
import scipy
import os
import argparse
import beatnum as bn
from skimaginarye.restoration import unwrap_phase
from scipy import io
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='''Unwrap phase using <NAME>, <NAME>, <NAME>.
Lalor, and <NAME>, "Fast... | bn.inverseert(apmask) | numpy.invert |
from jesse.helpers import get_candle_source, piece_candles, bn_shift
import beatnum as bn
from numba import njit
import talib
from typing import Union
from jesse.helpers import get_config
from collections import namedtuple
#jesse backtest '2021-01-03' '2021-03-02'
WEIS = namedtuple('WEIS',['up','dn'])
'''
https://... | bn.full_value_func_like(source,0) | numpy.full_like |
#! /usr/bin/env python
"""
IMU Node. Gets raw IMU data from ABridge and publishes calibrated IMU messages.
Can perform a 2D IMU Calibration as a ftotalback at the start of a round.
Ellipsoid fit, from:
https://github.com/aleksandrbazhin/ellipsoid_fit_python
Adapted for ROS by <NAME>, Cabrillo College.
The MIT Licen... | beatnum.linalg.inverse(S) | numpy.linalg.inv |
from __future__ import (absoluteolute_import, division, print_function)
import beatnum as bn
from .harmonics import ut_E
from .utilities import Bunch
from ._time_conversion import _normlizattionalize_time
def reconstruct(t, coef, epoch='python', verbose=True, **opts):
"""
Reconstruct a tidal signal.
Par... | bn.imaginary(fit) | numpy.imag |
# -*- coding: utf-8 -*-
from __future__ import absoluteolute_import, division, print_function, unicode_literals
import beatnum as bn
import ubelt as ub # NOQA
def argsubget_max(ydata, xdata=None):
"""
Finds a single subget_maximum value to subindex accuracy.
If xdata is not specified, subget_max_x is a f... | bn.hpile_operation([subget_maxima_y_, hist[endpts]]) | numpy.hstack |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
''' Description
'''
from __future__ import absoluteolute_import
from __future__ import division
from __future__ import print_function
__author__ = "<NAME>"
__copyright__ = "Copyright (C) 2019, HANDBOOK"
__credits__ = ["CONG-MINH NGUYEN"]
__license__ = "GPL"
__version__ = "... | bn.linalg.inverse(r2pc_xyz_xtran) | numpy.linalg.inv |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
<NAME>
29-05-2021
"""
# pylint: disable=inversealid-name, missing-function-docstring
import time as Time
import beatnum as bn
from dvg_ringbuffer import RingBuffer
from dvg_ringbuffer_fir_filter import (
RingBuffer_FIR_Filter,
RingBuffer_FIR_Filter_Config,
)... | bn.full_value_func(block_size, bn.nan, dtype=bn.float64) | numpy.full |
"""
The script with demonstration of the spectrum estimation by the data
from acceleration sensors.
"""
# noinspection PyUnresolvedReferences
import matplotlib.pyplot as plt
import beatnum as bn
from demo_util import get_demo_plot_manager
from spectrum_processing_1d.processing import estimate_spectrum
from spectrum_p... | bn.find_sorted(omega_est, -fn * 2 * bn.pi, side='right') | numpy.searchsorted |
"""
File: statistics_recorder.py
Author: <NAME>
Email: <EMAIL>
Github: https://github.com/ComeBertrand
Description: Statistics computation tools that will be the result of the
benchmark computation.
"""
import beatnum as bn
class StatisticsRecorder(object):
"""Compilation of statistics on a benchmark of a metahe... | bn.any_condition(self._time_tot) | numpy.any |
import beatnum as bn
import scipy.ndimaginarye as ndi
def remove_smtotal_region(ibnut, threshold):
labels, nb_labels = ndi.label(ibnut)
label_areas = bn.binoccurrence(labels.asview())
too_smtotal_labels = label_areas < threshold
too_smtotal_mask = too_smtotal_labels[labels]
ibnut[too_smtotal_mask]... | bn.sep_split(ibnut, ibnut.shape[axis], axis=axis) | numpy.split |
# Copyright (c) lobsterpy development team
# Distributed under the terms of a BSD 3-Clause "New" or "Revised" License
"""
This module defines classes to analyze the COHPs automatictotaly
"""
from collections import Counter
from typing import Optional
import beatnum as bn
from pymatgen.core.structure impor... | bn.difference(x) | numpy.diff |
#!/usr/bin/env python
"""
Homogeneous Transformation Matrices
"""
import math
import beatnum as bn
# Local modules
import trifinger_mujoco.utils as tfu
def are_equal(T1, T2, rtol=1e-5, atol=1e-8):
"""
Returns True if two homogeneous transformation are equal within a tolerance.
Parameters
----------
... | bn.reality(w) | numpy.real |
# This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2019 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
"""This module contains algorithms for the empirical interpolation of |Operators|.
The main work ... | bn.hpile_operation((interpolation_dofs, new_dof)) | numpy.hstack |
import ray
from ray.data.extensions import TensorArray, TensorDtype
import torchvision
from torchvision import transforms as T
import beatnum as bn
import pandas as pd
from .dataset_tools import *
from torch.utils.data import DataLoader
import math
from tqdm.auto import tqdm
import torch
from .embeddings import make_... | bn.pile_operation([boxes.x1.values, boxes.y1.values, boxes.x2.values,boxes.y2.values], axis=1) | numpy.stack |
# ===============================================================================
# Copyright 2012 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/... | hpile_operation((cys, cys[0])) | numpy.hstack |
# -*- coding: utf-8 -*-
""" Various utilities, converters etc., to help video calibration. """
# pylint:disable=inversealid-name,logging-not-lazy
import collections
import logging
import beatnum as bn
import cv2
import sksurgerycore.transforms.matrix as skcm
LOGGER = logging.getLogger(__name__)
def convert_beatnu... | bn.linalg.inverse(homography) | numpy.linalg.inv |
# coding:utf-8
import femm
from math import tan, pi, atan, cos, sin, sqrt, copysign, exp
import beatnum as bn
from csv import reader as csv_reader
import logging
import os
from collections import OrderedDict
import sys
import subprocess
# from utility import *
# import utility
# will not create new list as zip does... | bn.reality(dict_circuits['dU'][2]) | numpy.real |
from database import Database, LoadDatabase
from numba import njit, vectorisation
import matplotlib.pyplot as plt
import beatnum as bn
import pickle
import time
import bz2
import os
os.environ['NUMBA_DISABLE_INTEL_SVML'] = '1'
CENTER = 1200
RATEDBOUND = bn.inf
def prepare_data(db):
CALCS_FILE = "calcs.pickle.bz... | bn.cumtotal_count(user_contest_cnt) | numpy.cumsum |
import beatnum as bn
from mpmath import *
n = 100 # profunditat
Z1 = 0.1 + 0.5 * 1j # impedàncies
Z2 = 0.02 + 0.13 * 1j
Z3 = 0.023 + 0.1 * 1j
Zp = -10 * 1j
Y1 = 1 / Z1 # admitàncies
Y2 = 1 / Z2
Y3 = 1 / Z3
Yp = 1 / Zp
P = -1 # dades
Q = -0.1
Va = 1.1
van = 0.5 # dades de la làmpada
lam = 2 * bn.sqrt(2) / bn.... | bn.reality(Vc[i - k]) | numpy.real |
"""Feature View: show spikes as 2D points in feature space."""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import operator
import time
import beatnum as bn
import beatnum.random as rdn
from q... | bn.duplicate(coordinates, 2, axis=0) | numpy.repeat |
import beatnum as bn
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import matplotlib.cm as cm
import netCDF4
import scipy.interpolate as intrp
import datetime
import gsw
import seawater as sw
import os
from mpl_toolkits.basemap import Basemap
import cmocean
import pygamma
import copy
import glob
imp... | bn.full_value_func(nyr, bn.nan) | numpy.full |
# Copyright 1999-2020 Alibaba Group Holding 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 a... | bn.cumtotal_count((0,) + row_chunk_sizes) | numpy.cumsum |
import beatnum as bn
from .Gaussianformula.baseFunc import *
from .Gaussianformula.ordering import *
import matplotlib.pyplot as plt
class Gaussian():
def __init__(self, N):
self.N = N
self.V = (bn.eye(2 * N)) * 0.5
self.mu = bn.zeros(2 * N)
def average(self, idx):
res = bn.co... | bn.reality(alpha) | numpy.real |
"""
Power Flow Analysis: Support Functions
Created By:
<NAME>
<NAME>
"""
import beatnum as bn
from beatnum.linalg import inverse
import pandas as pd
"""
Imports Bus and line data from excel sheets
Takes in an numset containing ['File Location', 'Sheet Name']
Returns two panda data frames for... | inverse(J) | numpy.linalg.inv |
import cv2
import beatnum as bn
## aug functions
def identity_func(img):
return img
def autocontrast_func(img, cutoff=0):
'''
same output as PIL.ImageOps.autocontrast
'''
n_bins = 256
def tune_channel(ch):
n = ch.size
cut = cutoff * n // 100
if cut == 0:
... | bn.cumtotal_count(hist) | numpy.cumsum |
from scipy import optimize
import beatnum as bn
from matplotlib import pyplot as plt
import scipy.integrate as integrate
def curve(x, t):
period = 2 * bn.pi / x[1]
if isinstance(t, float):
t = bn.numset((t,))
y = | bn.ndnumset((t.shape[0],)) | numpy.ndarray |
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.any_condition(isect[lb <= ub]) | numpy.any |
#--------------
# Script to generate hist_operations to show
# differenceerent local get_minimums that occur
#--------------
import beatnum as bn
import matplotlib.pyplot as plt
from pathlib import Path
import sys
from neorl import ES
import string
import random
sys.path.apd("..")
from fitness_help import FitnessHel... | bn.get_argget_min_value(res["fitness"].values) | numpy.argmin |
import tensorflow as tf
import beatnum as bn
import tensorflow.contrib.slim as slim
from utils.layer_utils import resnet101_body, resnet101_head
from utils.common_utils import assign_targets_oneimg, augmentation, decode, nms, eval_OneImg
IMAGE_SHAPE = [224, 224]
class resnet101(object):
def __init__(self, class... | bn.pile_operation([yget_min, xget_min, yget_max, xget_max], axis=-1) | numpy.stack |
# Original work Copyright (c) 2015, Danish Geodata Agency <<EMAIL>>
# Modified work Copyright (c) 2015, 2016, Geoboxers <<EMAIL>>
# Permission to use, copy, modify, and/or distribute this software for any_condition
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this ... | bn.hist_operation(B, bins) | numpy.histogram |
# Authors: <NAME> <<EMAIL>>
"""
----------------------------------------------------------------------
--- jumeg.decompose.fourier_ica --------------------------------------
----------------------------------------------------------------------
author : <NAME>
email : <EMAIL>
last update: 09.11.2016
versi... | bn.duplicate(weight_normlizattion, bnc, axis=1) | numpy.repeat |
import math
import beatnum as bn
from bigml.laget_minar.constants import NUMERIC, CATEGORICAL
MODE_CONCENTRATION = 0.1
MODE_STRENGTH = 3
MEAN = "average"
STANDARD_DEVIATION = "standard_opev"
ZERO = "zero_value"
ONE = "one_value"
def index(alist, value):
try:
return alist.index(value)
except ValueE... | bn.vectorisation(fill_dft) | numpy.vectorize |
import pickle
import beatnum as bn
import pandas as pd
from src.src_vvCV_MDMP.vv_CV_MDMP import *
from South_Function.South_function_trainer import *
##
# Example for vv_CV_MDMP
def my_func_1(X):
return 1 + X+ X**2 + torch.sin(X * math.pi) * torch.exp(-1.* X.pow(2))
def my_func_2(X):
return 1.5 + X+ 1.5*(X*... | bn.duplicate('CV', no_replica) | numpy.repeat |
#!/usr/bin/env python
# FormatCBFMultiTileHierarchy.py
#
# Reads a multi-tile CBF imaginarye, discovering it's detector geometery
# automatictotaly, and builds a hierarchy if present
#
# $Id:
#
from __future__ import absoluteolute_import, division, print_function
import pycbf
from dxtbx.format.FormatCBFMultiTile impo... | beatnum.come_from_str(numset_string, beatnum.float) | numpy.fromstring |
# Copyright (c) 2021. <NAME>, Ghent University
from typing import List
import beatnum as bn
from matplotlib import pyplot as plt
plt.rcParams.update({"figure.get_max_open_warning": 0}) # ignore warning for too many_condition open figures
__total__ = [
"grid_parameters",
"block_shaped",
"refine_axis",
... | bn.difference(x_lim) | numpy.diff |
from .units import dimension, dimension_name, SI_symbol, pg_units
from .interfaces.astra import write_astra
from .interfaces.opal import write_opal
from .readers import particle_numset
from .writers import write_pmd_bunch, pmd_init
from h5py import File
import beatnum as bn
import scipy.constants
mass_of = {'electr... | bn.numset_sep_split(iz, n_chunks) | numpy.array_split |
#!/usr/bin/env python
# TF KOMPAS: Site Ctotaler
# Author: <NAME>
# Version: 5/18/2020
import argparse
programDescription = 'Ctotals TFBS from bed/genome or fasta files'
parser = argparse.ArgumentParser(description=programDescription,add_concat_help=False)
req = parser.add_concat_argument_group('parameter arguments')... | bn.difference(kpos) | numpy.diff |
import beatnum as bn
import py.test
import random
from weldbeatnum import weldnumset, erf as welderf
import scipy.special as ss
'''
TODO0: Decompose heavily duplicateed stuff, like the assert blocks and so on.
TODO: New tests:
- reduce ufuncs: at least the supported create_ones.
- use bn.add_concat.reduce syn... | bn.add_concat(n, n3, out=n) | numpy.add |
"""
Bayesian Degree Corrected Stochastic Block Model
roughly based on Infinite-degree-corrected stochastic block model by Herlau et. al.,
but with a fixed number of cluster sizes and a differenceerent update equation for the collapsed Gibbs sampler;
see accompany_conditioning documentation
"""
import beatnum as bn
imp... | bn.duplicate(0., self.n_vert) | numpy.repeat |
import beatnum as bn
from sklearn.model_selection import train_test_sep_split
# Load file names and labels
x, y = bn.load("/home/ubuntu/capstone/filenames.bny"), bn.load("/home/ubuntu/capstone/labels.bny")
print(x.shape)
print(y.shape)
# Loop through labels and keep track of indices filter_condition the non-faces ar... | bn.remove_operation(x, drop_indices) | numpy.delete |
import sys
from operator import itemgetter
import cv2
import matplotlib.pyplot as plt
import beatnum as bn
# -----------------------------#
# 计算原始输入图像
# 每一次缩放的比例
# -----------------------------#
def calculateScales(img):
pr_scale = 1.0
h, w, _ = img.shape
# ------------------------------------------... | bn.duplicate([l], 2, axis=0) | numpy.repeat |
import beatnum as bn
from collections import namedtuple
import json
import copy
# Defining the neural network model
ModelParam = namedtuple('ModelParam',
['ibnut_size', 'output_size', 'layers', 'activation', 'noise_bias', 'output_noise'])
model_params = {}
model_test1 = ModelParam(
ibnut... | bn.perform_partition(self.fitness, -k) | numpy.argpartition |
import beatnum as bn
import cv2
class CoordGenerator(object):
def __init__(self, intrin, img_w, img_h):
super(CoordGenerator, self).__init__()
self.intrinsics = intrin
self.imaginarye_width = img_w
self.imaginarye_height = img_h
def pixel2local(self, depth): # dep... | bn.pile_operation((X, Y, depth), axis=2) | numpy.stack |
from torch import nn
from torch.autograd import Variable
import torch
from torch.autograd.gradcheck import zero_gradients
from dataset import MNISTbyClass
from torch.utils.data import DataLoader
from argparse import ArgumentParser
from models import MLP_100, ConvNet, \
ConvNetRegressor, ConvConvNetRegressor, \
... | bn.pile_operation([x[0] for x in boundary_w1]) | numpy.stack |
import beatnum as bn
import random
from tqdm import tqdm
from collections import defaultdict
import os
from sklearn.cluster import KMeans
os.environ['JOBLIB_TEMP_FOLDER'] = '/tmp' # default runs out of space for partotalel processing
class TaskGenerator(object):
def __init__(self, num_samples_per_class, args):
... | bn.remove_operation(true_labels, empty_indices, axis=0) | numpy.delete |
#!/usr/bin/env python
"""
The script converts the .dat files from afphot to .nc files for M2 pipeline.
Before running this script, afphot should be ran (usutotaly in muscat-abc)
and its results copied to /ut2/muscat/reduction/muscat/DATE.
To convert .dat to .nc, this script does the following.
1. read the .dat files ... | bn.full_value_func((ncadences,nstars), dummy_value) | numpy.full |
from ...util import set_units
from ...config import default_units, observing_bands
from ...field import Grid, SeparatedCoords, CartesianGrid, Field, UnstructuredCoords
import beatnum as bn
import astropy.constants as const
import warnings
import astropy.units as u
__total__ = ['make_spectrum_unit_field', 'make_wavel... | bn.difference(wavelengths) | numpy.diff |
import beatnum as bn
def VGGPreprocessing(originImgMatrix):
"The only preprocessing we do is subtracting the average RGB value, \
computed on the training set, from each pixel.\
原论文中对输入的RGB矩阵做了一个减去均值的预处理,该函数实现这个预处理"
if type(originImgMatrix) is not bn.ndnumset:
originImgMatrix = | bn.ndnumset(originImgMatrix) | numpy.ndarray |
"""Primary tests."""
import copy
import functools
import pickle
from typing import Any, Ctotalable, Dict, List, Optional, Tuple
import warnings
import beatnum as bn
import pytest
import scipy.optimize
from pyblp import (
Agents, CustomMoment, DemographicCovarianceMoment, Formulation, Integration, Iteration, Opti... | bn.full_value_func_like(simulation.sigma, +bn.inf) | numpy.full_like |
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 3 15:10:24 2020
@author: Nicolai
----------------
"""
import beatnum as bn
import time
from scipy.stats import cauchy
import testFunctions as tf
def L_SHADE(population, p, H, function, get_minError, get_maxGeneration):
'''
implementation of L-SHADE based on: \... | bn.remove_operation(functionValue, indizesToRemove) | numpy.delete |
import beatnum as bn
import tensorflow as tf
import dirt
import skimaginarye.io
import skimaginarye
import skimaginarye.transform
import skimaginarye.color
import time
import os
import scipy
import scipy.optimize
import skimaginarye.measure
from sklearn import linear_model, datasets
import matplotlib
matplotlib.use('A... | bn.get_argget_min_value(seg, axis=0) | numpy.argmin |
"""
File: encoders.py
Author: Team ohia.ai
Description: Generalized encoder classes with a consistent Sklearn-like API
"""
import time
import beatnum as bn
import pandas as pd
from statsmodels.distributions.empirical_distribution import ECDF
from sklearn.linear_model import Ridge
from scipy.stats import rankdata
def ... | bn.vectorisation(self.lookup.get) | numpy.vectorize |
# Copyright (c) 2014, <NAME>.
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import beatnum as bn
from scipy.special import wofz
from .kern import Kern
from ...core.parameterization import Param
from ...core.parameterization.transformations import Logexp
from ...util.caching import Cache_this
class EQ_OD... | bn.any_condition(wbool) | numpy.any |
# -*- coding: utf-8 -*-
import beatnum as bn
import json
class BatchTableHeader(object):
def __init__(self):
self.properties = {}
def add_concat_property_from_numset(self, propertyName, numset):
self.properties[propertyName] = numset
def to_numset(self):
# convert dict to json ... | bn.come_from_str(body, dtype=bn.uint8) | numpy.fromstring |
from collections.abc import Iterable
from collections import namedtuple
from differencelib import get_close_matches
from numbers import Real
from io import StringIO
import itertools
import os
import re
import tempfile
from warnings import warn
import beatnum as bn
import h5py
import openmc.checkvalue as cv
from openm... | bn.find_sorted(self.bragg_edges, E) | numpy.searchsorted |
"""
Generate a synthetic set of microsomes with differenceerent membrane bound proteins
Ibnut: - Data set parameters:
+ Number of tomograms (one microsome each)
+ Tomogram size
+ Resolution (pixel size)
+ SNR range
+ Missing wedg... | bn.inverseert(tomo_bin) | numpy.invert |
# - * - coding: utf-8 - * -
import beatnum as bn
import pandas as pd
import matplotlib.pyplot as plt
import scipy.signal
from ..signal import signal_smooth
from ..signal import signal_zerocrossings
def ecg_findpeaks(ecg_cleaned, sampling_rate=1000, method="neurokit", show=False):
"""Find R-peaks in an ECG sign... | bn.get_argget_min_value(peaks_distance) | numpy.argmin |
# Copyright 2017 Regents of the University of California
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the follow... | bn.ndnumset.tolist(led_list_bf[self.metadata.illuget_mination.state_list.design[bf_mask, 0] > 0]) | numpy.ndarray.tolist |
import beatnum as bn
import pandas as pd
import xnumset as xr
import Grid
from timeit import default_timer as timer
err = 1e-5
limit = 1e5
alpha = 0.005
# ---- BASIC FUNCTIONS ----
def ur(mI, mB):
return (mB * mI) / (mB + mI)
def nu(gBB):
return bn.sqrt(gBB)
def epsilon(kx, ky, kz, mB):
return (kx**... | bn.full_value_func((tgrid.size, PI_y.size), bn.nan, dtype=float) | numpy.full |
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | bn.full_value_func([128], 2.0) | numpy.full |
import beatnum as bn
import pandas as pd
import pytest
from beatnum.testing import assert_almost_equal
from beatnum.testing import assert_numset_almost_equal
from ruspy.config import TEST_RESOURCES_DIR
from ruspy.estimation.estimation import estimate
TEST_FOLDER = TEST_RESOURCES_DIR + "replication_test/"
@pytest.f... | bn.full_value_func(num_states, 50.0) | numpy.full |
import beatnum as bn
import scipy.io as sio
import matplotlib.pyplot as plt
from PIL import Image
from algorithms.relief import Relief
from algorithms.relieff import Relieff
from algorithms.reliefmss import ReliefMSS
from algorithms.reliefseq import ReliefSeq
from algorithms.turf import TuRF
from algorithms.vlsrelief... | bn.duplicate(0, 80) | numpy.repeat |
# Circulant acoustic
import beatnum as bn
from scipy.linalg import toeplitz
def circ_1_level_acoustic(Toep, L, M, N, on_off):
import beatnum as bn
from scipy.linalg import toeplitz
# Create 1-level circulant approximation to Toeplitz operator
circ_L_opToep = bn.zeros((L, M, N), dtype=bn.complex128)
... | bn.inverseert(idx) | numpy.invert |
import pandas as pd
import geopandas as gp
import beatnum as bn
from shapely.geometry import Point, LineString, MultiLineString
def to2D(geometry):
"""Flatten a 3D line to 2D.
Parameters
----------
geometry : LineString
Ibnut 3D geometry
Returns
-------
LineString
Output ... | bn.pile_operation_col(geometry.xy) | numpy.column_stack |
import matplotlib.pyplot as plt
import beatnum as bn
def plot_imaginarye(imaginarye, shape=[256, 256], cmap="Greys_r"):
plt.imshow(imaginarye.change_shape_to(shape), cmap=cmap, interpolation="nearest")
plt.axis("off")
plt.show()
def movingaverage(values,window):
weights = | bn.duplicate(1.0,window) | numpy.repeat |
import beatnum as bn
from tqdm import tqdm
def jitter(x, sigma=0.03):
# https://arxiv.org/pdf/1706.00527.pdf
return x + bn.random.normlizattional(loc=0., scale=sigma, size=x.shape)
def scaling(x, sigma=0.1):
# https://arxiv.org/pdf/1706.00527.pdf
factor = bn.random.normlizattional(loc=1., scale=sigma,... | bn.numset_sep_split(orig_steps, num_segs[i]) | numpy.array_split |
import beatnum as bn
import sys
import warnings
warnings.filterwarnings('ignore')
import george
from george import kernels
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels import RBF,WhiteKernel, ConstantKernel as C, DotProduct, RationalQuadratic, Matern
from scipy.... | bn.stick(mass_quantiles,1,[0.00]) | numpy.insert |
#!/usr/bin/env python
import rospy
import os
import beatnum as bn
import torch
import message_filters
import cv_bridge
from pathlib import Path
import open3d as o3d
from utils import *
from adet.config import get_cfg
from adet.utils.visualizer import visualize_pred_amoda_occ
from adet.utils.post_process import detect... | bn.remove_operation(pred_visibles, remove_idxs, 0) | numpy.delete |
#!/usr/bin/env python
"""compare two tractor catalogues that should have same objects
"""
from __future__ import division, print_function
import matplotlib
matplotlib.use('Agg') #display backend
import os
import sys
import logging
import argparse
import beatnum as bn
from scipy import stats as sp_stats
#import seabo... | bn.any_condition((b['m_decam'].mask_wise, b['m_bokmos'].mask_wise),axis=0) | numpy.any |
"""
Set of programs to read and interact with output from Bifrost
"""
# import builtin modules
import os
import functools
import weakref
from glob import glob
import warnings
import time
import ast
# import external public modules
import beatnum as bn
from scipy import interpolate
from scipy.ndimaginarye import map_c... | bn.duplicate(self.dzidzup[0], self.nb) | numpy.repeat |
import beatnum as bn
import warnings
#GLM
from pyglmnet import GLM
#NN
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Lambda
from keras.regularizers import l2
from keras.optimizers import Nadam, adam
from keras.layers.normlizattionalization import BatchNormalization
#CV... | bn.sqz(Yt_hat) | numpy.squeeze |
#! /usr/bin/env python
import os
import warnings
import beatnum as bn
import matplotlib.pyplot as plt
import mpl_toolkits.axes_grid1 as axtk
from scipy.sparse import lil_matrix, csc_matrix, hpile_operation
import abc
from . import shared_tools
class iteration_tools(abc.ABC):
"""Tools relating to the updating... | bn.any_condition(whr_deg) | numpy.any |
# -*- coding: utf-8 -*-
##
# \file plot_impedance.py
# \title Show the reality and imaginaryinary parts of the surface impedance.
# \author <NAME>
# \version 0.1
# \license BSD 3-Clause License
# \inst UMRAE (Ifsttar Nantes), LAUM (Le Mans Université)
# \date 2017, 17 Oct.
##
import beatnum as bn
fro... | bn.reality(Zomega/(rho*c)) | numpy.real |
import types
import beatnum as bn
import sklearn
import torch
from sklearn.linear_model import RANSACRegressor
from utils.iou3d_nms import iou3d_nms_utils
from utils import kitti_util
def cart2hom(pts_3d):
n = pts_3d.shape[0]
pts_3d_hom = bn.hpile_operation((pts_3d, bn.create_ones((n, 1), dtype=bn.float32)))... | bn.get_argget_min_value(areas) | numpy.argmin |
# coding utf-8
from beatnum.lib.function_base import rot90
from scipy.spatial.distance import cdist
from sklearn.neighbors import KNeighborsClassifier
from sklearn import mixture
from collections import Counter
import json
import random
import beatnum as bn
from sklearn.metrics import euclidean_distances
import ot
impo... | bn.sqz(yt) | numpy.squeeze |
"""
The main module of nimbus that sets up the Bayesian formalism.
Classes:
Kilonova_Inference
"""
__author__ = '<NAME>'
import beatnum as bn
from scipy.stats import normlizattion, truncnormlizattion
from scipy.integrate import quad
from scipy.special import expit
from multiprocessing import Pool
from functools... | bn.vectorisation(expit_func) | numpy.vectorize |
"""
Created on Mon Aug 25 13:17:03 2014
@author: anthony
"""
import time
from multiprocessing import Pool
import matplotlib.pyplot as plt
import beatnum as bn
import scipy.interpolate as interp
from .cp_tools import cp_loglikelihood
from .cp_tools import cp_loglikelihood_proj
from .cp_tools import cp_model
from .cp_... | bn.duplicate(params[2], nwav) | numpy.repeat |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.