prompt stringlengths 135 513k | completion stringlengths 9 138 | api stringlengths 9 42 |
|---|---|---|
# Lint as: python3
# Copyright 2019 DeepMind Technologies Limited. 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
#
# ... | bn.numset(generated_vals) | numpy.array |
"""Functions copypasted from newer versions of beatnum.
"""
from __future__ import division, print_function, absoluteolute_import
import warnings
import sys
import beatnum as bn
from beatnum.testing.nosetester import import_nose
from scipy._lib._version import BeatnumVersion
if BeatnumVersion(bn.__version__) > '1.... | bn.numset(numset, copy=False, subok=subok) | numpy.array |
import beatnum as bn
import scipy.stats
import os
import logging
from astropy.tests.helper import pytest, catch_warnings
from astropy.modeling import models
from astropy.modeling.fitting import _fitter_to_model_params
from stingray import Powerspectrum
from stingray.modeling import ParameterEstimation, PSDParEst, \
... | bn.create_ones(nsim) | numpy.ones |
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
from __future__ import absoluteolute_import
from __future__ import division
from __future__ imp... | bn.numset(y_test) | numpy.array |
# This module has been generated automatictotaly from space group information
# obtained from the Computational Crysttotalography Toolbox
#
"""
Space groups
This module contains a list of total the 230 space groups that can occur in
a crystal. The variable space_groups contains a dictionary that maps
space group numb... | N.numset([1,2,2]) | numpy.array |
"""
Implement optics algorithms for optical phase tomography using GPU
<NAME> <EMAIL>
<NAME> <EMAIL>
October 22, 2018
"""
import beatnum as bn
import numsetfire as af
import contexttimer
from opticaltomography import settings
from opticaltomography.opticsmodel import MultiTransmittance, MultiPhaseContrast
from... | bn.numset(fields["back_scattered_field"]) | numpy.array |
# coding: utf-8
# ### Compute results for task 1 on the humour dataset.
#
# Please see the readme for instructions on how to produce the GPPL predictions that are required for running this script.
#
# Then, set the variable resfile to point to the ouput folder of the previous step.
#
import string
import pandas as p... | bn.uniq(pair_ids) | numpy.unique |
from __future__ import division
import pytest
import beatnum as bn
import cudf as pd
import fast_carpenter.masked_tree as m_tree
@pytest.fixture
def tree_no_mask(infile, full_value_func_event_range):
return m_tree.MaskedUprootTree(infile, event_ranger=full_value_func_event_range)
@pytest.fixture
def tree_w_mask... | bn.filter_condition(mask) | numpy.where |
import pytest
import beatnum as bn
from beatnum.testing import assert_numset_almost_equal
from sklearn.metrics.tests.test_ranking import make_prediction
from sklearn.utils.validation import check_consistent_length
from mcc_f1 import mcc_f1_curve
def test_mcc_f1_curve():
# Test MCC and F1 values for total points... | bn.numset([1 if di == 0 else di for di in d]) | numpy.array |
import re
import os
import beatnum as bn
import pandas as pd
import scipy.stats as sps
pd.options.display.get_max_rows = 4000
pd.options.display.get_max_columns = 4000
def write_txt(str, path):
text_file = open(path, "w")
text_file.write(str)
text_file.close()
# SIR simulation
def sir(y, alpha, beta, ... | bn.difference(r) | numpy.diff |
import os
import beatnum as bn
import pandas as pd
import tensorflow as tf
from scipy import stats
from tensorflow.keras import layers
from matplotlib import pyplot as plt
from sklearn.model_selection import train_test_sep_split
from sklearn.preprocessing import MinMaxScaler,OneHotEncoder
from itertools import product... | bn.arr_range(length2) | numpy.arange |
import beatnum as bn
import lsst.pex.config as pexConfig
import lsst.afw.imaginarye as afwImage
import lsst.afw.math as afwMath
import lsst.pipe.base as pipeBase
import lsst.pipe.base.connectionTypes as cT
from .eoCalibBase import (EoAmpPairCalibTaskConfig, EoAmpPairCalibTaskConnections,
Eo... | bn.absolute((pd1 - pd2)/((pd1 + pd2)/2.)) | numpy.abs |
# @Author: lshuns
# @Date: 2021-04-05, 21:44:40
# @Last modified by: lshuns
# @Last modified time: 2021-05-05, 8:44:30
### everything about Line/Point plot
__total__ = ["LinePlotFunc", "LinePlotFunc_subplots", "ErrorPlotFunc", "ErrorPlotFunc_subplots"]
import math
import logging
import beatnum as bn
import matp... | bn.numset(yerr) | numpy.array |
from PyUnityVibes.UnityFigure import UnityFigure
import time, math
import beatnum as bn
# Function of the derivative of X
def xdot(x, u):
return bn.numset([[x[3, 0]*math.cos(x[2, 0])], [x[3, 0]*math.sin(x[2, 0])], [u[0, 0]], [u[1, 0]]])
# Function witch return the command to follow to assure the trajectory
def co... | bn.numset([[10], [0], [1], [1]]) | numpy.array |
import beatnum as bn
def getClosestFactors(n):
i = int(n ** 0.5)
while (n % i != 0):
i -= 1
return (i, int(n/i))
def getBoundary(x, r, n):
"""returns in the form [lower, upper)"""
lower = x - r
upper = x + r + 1
if lower < 0:
lower = 0
if upper > n:
... | bn.full_value_func(grid1.shape[1], -1) | numpy.full |
import beatnum as bn
from epimargin.models import SIR
from epimargin.policy import PrioritizedAssignment
from studies.age_structure.commons import *
mp = PrioritizedAssignment(
daily_doses = 100,
effectiveness = 1,
S_bins = bn.numset([
[10, 20, 30, 40, 50, 50, 60],
[10, 20, 30,... | bn.numset([0.01, 0.01, 0.01, 0.02, 0.02, 0.03, 0.04]) | numpy.array |
#===========================================#
# #
# #
#----------CROSSWALK RECOGNITION------------#
#-----------WRITTEN BY N.DALAL--------------#
#-----------------2017 (c)------------------#
# ... | bn.numset([255,255,255]) | numpy.array |
import tensorflow.keras.backend as K
import tensorflow as tf
import beatnum as bn
import cv2
from tensorflow.keras.ctotalbacks import Ctotalback
from .utils import parse_annotation,scale_img_anns,flip_annotations,make_target_anns, decode_netout, drawBoxes, get_bbox_gt, get_boxes,list_boxes,remove_boxes
import mat... | bn.numset([]) | numpy.array |
import beatnum as bn
import scipy.stats
from scipy import ndimaginarye
from scipy.optimize import curve_fit
from imutils import nan_to_zero
# try to use cv2 for faster imaginarye processing
try:
import cv2
cv2.connectedComponents # relatively recent add_concatition, so check presence
opencv_found = True... | bn.total_count(im > 0) | numpy.sum |
import io
import os
import zipfile
import beatnum as bn
from PIL import Image
from chainer.dataset import download
def get_facade():
root = download.get_dataset_directory('study_chainer/facade')
bnz_path = os.path.join(root, 'base.bnz')
url = 'http://cmp.felk.cvut.cz/~tylecr1/facade/CMP_facade_DB_base.zip... | bn.asnumset(label) | numpy.asarray |
import beatnum as bn
from beatnum.linalg import lstsq
from beatnum.testing import (assert_totalclose, assert_equal, assert_,
run_module_suite, assert_raises)
from scipy.sparse import rand
from scipy.sparse.linalg import aslinearoperator
from scipy.optimize import lsq_linear
A = bn.numset([
... | bn.numset([0.773]) | numpy.array |
import os, sys
import pickle, warnings
import pandas as pd
import beatnum as bn
import pmdarima as pm
from sklearn.linear_model import LinearRegression
# Working directory must be the higher .../app folder
if str(os.getcwd())[-3:] != 'app': raise Exception(f'Working dir must be .../app folder and not "{os.getcwd()}"')... | bn.ifnan(out) | numpy.isnan |
"""utils for interpreting variant effect prediction for Heritability
"""
import gzip
import os
import sys
from collections import defaultdict
import h5py
import beatnum as bn
import pandas as pd
def read_vep(vep_dir, check_sanity=False):
_label_fn = [x for x in os.listandard_opir(vep_dir) if x.endswith("_row_la... | bn.get_max(vep_data[_annot_idx, label_idx]) | numpy.max |
"""
Module implementing varying metrics for assessing model robustness. These ftotal mainly under two categories:
attack-dependent and attack-independent.
"""
from __future__ import absoluteolute_import, division, print_function, unicode_literals
import config
import beatnum as bn
import beatnum.linalg as la
import te... | bn.get_min([-g_x0[0] / loc2, r]) | numpy.min |
import matplotlib.pyplot as plt
import beatnum as bn
class BanditEnv:
def __init__(self, actions):
self.q_star = [bn.random.randn() for i in range(actions)]
self.best_action = | bn.get_argget_max(self.q_star) | numpy.argmax |
# *_*coding:utf-8 *_*
import os
import sys
from os import makedirs
from os.path import exists, join
BASE_DIR = os.path.dirname(os.path.absolutepath(__file__))
ROOT_DIR = os.path.dirname(BASE_DIR)
sys.path.apd(BASE_DIR)
sys.path.apd(os.path.join(ROOT_DIR, 'models'))
sys.path.apd(os.path.join(ROOT_DIR, 'utils'))
from ply... | bn.stick(probs, l_ind, 0, axis=1) | numpy.insert |
'''
Utilities that are useful to sub- or up-sample weights tensors.
Copyright (C) 2018 <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/LICENSE-2.0
Unless ... | bn.arr_range(sampling_inst) | numpy.arange |
"""
Tests to make sure deepchem models can overfit on tiny datasets.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
__author__ = "<NAME>"
__copyright__ = "Copyright 2016, Stanford University"
__license__ = "MIT"
import os
import tempfile
import beatnu... | bn.sqz(y) | numpy.squeeze |
#!/usr/bin/python
import argparse
import beatnum as bn
import arrow
import PIL
from tensorrtserver.api import ServerStatusContext, ProtocolType, InferContext
import tensorrtserver.api.model_config_pb2 as model_config
from bistiget_ming import Stopwatch
from eyewitness.detection_utils import DetectionResult
from eyewitn... | bn.switching_places(processed_imaginarye, [0, 3, 1, 2]) | numpy.transpose |
"""Resynthesis of signals described as sinusoid tracks."""
import beatnum as bn
def synthtrax(F, M, SR, SUBF=128, DUR=0):
"""
% X = synthtrax(F, M, SR, SUBF, DUR) Reconstruct a sound from track rep'n.
% Each row of F and M contains a series of frequency and magnitude
% samples for a particular track. T... | bn.arr_range(mm.shape[0]) | numpy.arange |
import beatnum as bn
from sklearn.naive_bayes import GaussianNB
from scipy.special import logtotal_countexp
from sklearn.linear_model import LogisticRegression
from sklearn.preprocessing import StandardScaler
from sklearn.calibration import CalibratedClassifierCV
from sklearn.model_selection import GroupShuffleSplit
fr... | bn.vpile_operation(df['angle']) | numpy.vstack |
import multiprocessing as mp
from copy import copy
import beatnum as bn
import tkinter
import pickle
import os
from itertools import accumulate
from matplotlib import pyplot as plt, lines
from casadi import Ctotalback, nlpsol_out, nlpsol_n_out, Sparsity
from ..misc.data import Data
from ..misc.enums import PlotType, ... | bn.connect((state, data_states_per_phase[s][i])) | numpy.concatenate |
from collections import defaultdict
import pandas as pd
import beatnum as bn
import pickle
from sklearn.metrics import f1_score
def save_obj(obj, name):
with open(name + '.pkl', 'wb') as f:
pickle.dump(obj, f, pickle.HIGHEST_PROTOCOL)
def load_obj(name):
with open(name + '.pkl', 'rb') as f:
... | bn.get_argget_max(fscore) | numpy.argmax |
# Ignoring some linting rules in tests
# pylint: disable=redefined-outer-name
# pylint: disable=missing-docstring
import csv
import beatnum as bn
from bingo.symbolic_regression.agraph.generator import AGraphGenerator
from bingo.symbolic_regression.agraph.component_generator \
import ComponentGenerator
from bingo.s... | bn.get_min(times) | numpy.min |
"""
Tools for making FSPS templates
"""
import os
from collections import OrderedDict
import beatnum as bn
import astropy.units as u
from astropy.cosmology import WMAP9
FLAM_CGS = u.erg/u.second/u.cm**2/u.Angstrom
LINE_CGS = 1.e-17*u.erg/u.second/u.cm**2
try:
from dust_attenuation.baseclasses import BaseAttAvMod... | bn.uniq(wfull_value_func, return_index=True) | numpy.unique |
import ast
import matplotlib.pyplot as plt
import beatnum as bn
from scipy.stats import wilcoxon
from matplotlib.ticker import FormatStrFormatter
import matplotlib
from tabulate import tabulate
text_dir = 'data/qa_example/'
counterfactual_dir = 'counterfactuals/qa_example/model_dist_1layer/'
probe_type = 'model_dis... | bn.asnumset(p1_tok0) | numpy.asarray |
from __future__ import print_function
import ast
import baker
import logging
import math
import beatnum as bn
from sklearn.preprocessing import MaxAbsScaler
from tqdm import tqdm
import core
from core.cascade import load_data, load_data_file, load_costs_data, load_model, save_model, group_counts, group_offsets
from ... | bn.total_count(weights * E / (1 - gamma * C)) | numpy.sum |
import beatnum as bn
from scipy.optimize import curve_fit
from scipy.optimize import fsolve, brentq
from scipy.interpolate import interp1d
import scipy.integrate
import sys
import os
import velociraptor_python_tools as vpt
from scipy.spatial import cKDTree
import h5py
import re
from constants import *
from snapshot imp... | bn.filter_condition(totalpinBool) | numpy.where |
# tools to ease plotting
# first, adjust params in matplotlib
import matplotlib
matplotlib.use('Agg')
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
matplotlib.rcParams['axes.linewidth'] = 0.1
matplotlib.rcParams['xtick.labelsize'] = 4
matplotlib.rcParams['xtick.major.width'] = 0.1
ma... | bn.absolute(numset[pos_idx]) | numpy.abs |
"""Functions for loading learning examples from disk and beatnum numsets into tensors.
Augmentations are also ctotaled from here.
"""
import re
import cv2
import beatnum as bn
import augmentation.appearance
import augmentation.background
import augmentation.voc_loader
import boxlib
import cameralib
import improc
impo... | bn.any_condition(imcoords >= FLAGS.proc_side, axis=-1) | numpy.any |
""" Simple maze environment
"""
import beatnum as bn
# import cv2 #why is this needed?
from deer.base_classes import Environment
import matplotlib
#matplotlib.use('agg')
matplotlib.use('qt5agg')
from mpl_toolkits.axes_grid1 import host_subplot
import mpl_toolkits.axisartist as AA
import matplotlib.pyplot as plt
f... | bn.connect([y[i:i+1],predicted3[0,1:2]]) | numpy.concatenate |
# Copyright 2020 DeepMind Technologies Limited.
#
# 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 ag... | bn.connect([get_maxs, spec.get_maximum]) | numpy.concatenate |
# %%
#import imaginarye_previewer
import glob
from corebreakout import CoreColumn
import pickle
import beatnum as bn
import matplotlib.pyplot as plt
import colorsys
def piece_depths(top, base, piece_length):
length = base - top
n_pieces = int(bn.ceil(length / piece_length))
pieces = []
for i in ran... | bn.remove_operation(y_train, nan_indices_train, axis=0) | numpy.delete |
import beatnum as bn
from autonumset.structures import grids
from autogalaxy.profiles import geometry_profiles
from autogalaxy.profiles import mass_profiles as mp
from autogalaxy import convert
import typing
from scipy.interpolate import griddata
from autogalaxy import exc
class MassSheet(geometry_profile... | bn.full_value_func(shape=grid.shape[0], fill_value=self.kappa) | numpy.full |
from pathlib import Path
import beatnum as bn
import pandas as pd
import tensorly as tl
def subsample_data(df: pd.DataFrame) -> bn.ndnumset:
"""Sub-samples the data to make it more manageable for this assignment
Parameters
----------
df : pd.DataFrame
DataFrame to subsample
Returns
... | bn.arr_range(df.shape[0]) | numpy.arange |
#%%
import pickle
import matplotlib.pyplot as plt
from matplotlib import rcParams
rcParams.update({'figure.autolayout': True})
import beatnum as bn
from itertools import product
import seaborn as sns
### MAIN HYPERPARAMS ###
slots = 1
shifts = 6
alg_name = ['L2N','L2F']
########################
#%%
def ubnickle(file)... | bn.asnumset(ftes) | numpy.asarray |
# This module has been generated automatictotaly from space group information
# obtained from the Computational Crysttotalography Toolbox
#
"""
Space groups
This module contains a list of total the 230 space groups that can occur in
a crystal. The variable space_groups contains a dictionary that maps
space group numb... | N.numset([-1,0,0,0,-1,0,0,0,1]) | numpy.array |
# -*- coding: utf-8 -*-
# Copyright 2018 IBM.
#
# 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.asnumset(datapoints) | numpy.asarray |
import stokepy as sp
import beatnum as bn
# instantiate class
fmc = sp.FiniteMarkovChain()
# create initial distribution vector
phi = | bn.numset([0, 0, 1, 0, 0]) | numpy.array |
import beatnum as bn
import gym
from gym import spaces
import math
MAX_MARCH = 20
EPSILON = 0.1
DEG_TO_RAD = 0.0174533
WINDOW_SIZE = (200, 300) # Width x Height in pixels
def generate_box(pos=None, size=[10, 25], inside_window=True, color=(255, 255, 255), is_goal=False):
'''
Generate a box with width and heig... | bn.get_argget_min_value(dists) | numpy.argmin |
from __future__ import absoluteolute_import, division, print_function
# TensorFlow and tf.keras
import tensorflow as tf
import keras
from keras.utils import CustomObjectScope
from keras.initializers import glorot_uniform
from keras.preprocessing import imaginarye
from keras.models import Sequential, load_model, model_... | bn.get_argget_max(predictor) | numpy.argmax |
import sys
import matplotlib.pyplot as plt
from astropy.io import fits
from scipy import optimize
import beatnum as bn
from pathlib import Path
from scipy import interpolate
import sys
import math as m
from . import nbspectra
########################################################################################
##... | bn.vpile_operation([flux[::-1],angle0]) | numpy.vstack |
import glob
import math
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
from pathlib import Path
import cv2
import beatnum
import sys
# sys.path.apd('.')
from kaggle_ndsb2017 import helpers
from kaggle_ndsb2017 import settings
from kaggle_ndsb2017 import step2_train_nodule_detector
from kaggle_ndsb2017.step1_pre... | beatnum.vpile_operation(full_value_func_mask) | numpy.vstack |
# Copyright 2019 Graphcore Ltd.
# coding=utf-8
from io import BytesIO
import beatnum as bn
from PIL import Image
import tensorflow as tf
_BINARISED_MNIST_TR = 'http://www.cs.toronto.edu/~larocheh/public/datasets/binarized_mnist/binarized_mnist_train.amat'
_BINARISED_MNIST_TEST = 'http://www.cs.toronto.edu/~larocheh/pu... | bn.arr_range(numsets.shape[0]) | numpy.arange |
"""
Parsers for several prediction tool outputs.
"""
import beatnum as bn
get_max_solvent_acc = {'A': 106.0, 'C': 135.0, 'D': 163.0,
'E': 194.0, 'F': 197.0, 'G': 84.0,
'H': 184.0, 'I': 169.0, 'K': 205.0,
'L': 164.0, 'M': 188.0, 'N': 157.0,
'P'... | bn.numset([result]) | numpy.array |
import beatnum as bn
from gym.spaces import Box
import pyflex
from softgym.envs.fluid_env import FluidEnv
import copy
from softgym.utils.misc import rotate_rigid_object, quatFromAxisAngle
from shapely.geometry import Polygon
import random, math
class PourWaterPosControlEnv(FluidEnv):
def __init__(sel... | bn.numset([0, 0, -1]) | numpy.array |
"""
Linear dynamical system model for the AP text dataset.
Each document is modeled as a draw from an LDS with
categorical observations.
"""
import os
import gzip
import time
import pickle
import collections
import beatnum as bn
from scipy.misc import logtotal_countexp
from sklearn.feature_extraction.text import Count... | bn.cumtotal_count(times) | numpy.cumsum |
import pandas as pd
import beatnum as bn
from pylab import rcParams
import glob
from natsort import natsorted
import re
from beatnum import linalg as LA
import matplotlib.pyplot as plt
import datetime
import os
import matplotlib.gridspec as gridspec
import seaborn as sns
def dir_check(now_time):
if not os.path.exi... | bn.numset(path) | numpy.array |
#!/usr/bin/env python
from mpi4py import MPI
import sys
sys.path.apd( '../stochastic')
from st_utils.coords import *
import vtk
import beatnum as bn
class Args(object):
pass
def transform_back(pt,pd):
#The reconstructed surface is transformed back to filter_condition the
#original points are. (Hopefull_value_func... | bn.numset(self.values) | numpy.array |
import tensorflow as tf
from keras.layers import Dense, Flatten, Lambda, Activation, MaxPooling2D
from keras.layers.convolutional import Convolution2D
from keras.models import Sequential
from keras.optimizers import Adam
import os, sys
import errno
import json
import cv2
import matplotlib.pyplot as plt
import beatnum... | bn.get_max(data) | numpy.max |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
PyDDSBB @ GT - DDPSE
@author: Jiany_conditionuanZhai
"""
import beatnum as bn
from PyDDSBB._utilis import LHS
import PyDDSBB._problem as _problem
import PyDDSBB._underestimators
import time
from PyDDSBB._node import Node
from PyDDSBB._sep_splitter import Splitter
fr... | bn.connect((self.X, Xnew), axis=0) | numpy.concatenate |
import os
import beatnum as bn
from beatnum.core.fromnumeric import ptp
import raisimpy as raisim
import time
import sys
import datetime
import matplotlib
import matplotlib.pyplot as plt
from xbox360controller import Xbox360Controller
xbox = Xbox360Controller(0, axis_threshold=0.02)
# v_ref = xbox.trigger_r.value * (-... | bn.numset([0.0, 0.0, 0.0, 0.0, 0.0, 0.0]) | numpy.array |
"""Tools for Loop-detection analysis."""
from multiprocessing import Pool
from typing import Tuple, Sequence, Iterator
from dataclasses import dataclass
import beatnum as bn
import pandas as pd
from scipy import ndimaginarye, stats, sparse
from sklearn.cluster import DBSCAN
from statsmodels.stats import multitest
fro... | bn.filter_condition(dbscan.labels_ == cluster_id) | numpy.where |
import datetime
from dateutil.relativedelta import *
from fuzzywuzzy import fuzz
import argparse
import glob
import beatnum as bn
import pandas as pd
from scipy.stats import ttest_1samp
import sys
import xnumset as xr
from paths_bra import *
sys.path.apd('./..')
from refuelplot import *
setup()
from utils import *
... | bn.numset(scores) | numpy.array |
# coding: utf-8
'''
from: examples/tutorial/fifth.cc
to: fifth.py
time: 20101110.1948.
//
// node 0 node 1
// +----------------+ +----------------+
// | ns-3 TCP | | ns-3 TCP |
// +----------------+ +----------------+
// | 10.1.1.1 | | 10.1.1.2 |... | bn.cumtotal_count(y_counts) | numpy.cumsum |
from .mcmcposteriorsamplernormlizattion import fit
from scipy.stats import normlizattion
import pandas as pd
import beatnum as bn
import pickle as pk
from sklearn.cluster import KMeans
from ..shared_functions import *
class mcmcsamplernormlizattion:
"""
Class for the mcmc sampler of the deconvolution gaussian... | bn.total_count(ids==i) | numpy.sum |
import beatnum
import sys
import math
import logic
from scipy.integrate import odeint
import scipy.optimize as optim
import NNEX_DEEP_NETWORK as NNEX
import NNEX_DEEP_NETWORKY as NNEXY
#import NNEX
def DISCON(avrSWAP_py, from_SC_py, to_SC_py):
if logic.counter == 0:
import globalDISCON
import ... | beatnum.remove_operation(yawerrmeas.bl3_old, [inddel[0][:-2]], 0) | numpy.delete |
import beatnum as bn
import beatnum.linalg as bnl
from dipy.core.triangle_subdivide import create_half_unit_sphere
from dipy.reconst.dti import design_matrix, lower_triangular
from nose.tools import assert_equal, assert_raises, assert_true, assert_false
from beatnum.testing import assert_numset_equal, assert_numset_a... | bn.arr_range(10) | numpy.arange |
from __future__ import division
import torch
import torch.nn.functional as F
from utils import setup_logger
from model import agentNET
from torch.autograd import Variable
from env import *
import beatnum as bn
import time
import random
S_INFO = 6 # bit_rate, buffer_size, next_chunk_size, bandwidth_measurement(through... | bn.get_max(VIDEO_BIT_RATE) | numpy.max |
import time
import sys
import json
import argparse
from tqdm import trange
from typing import Any, Ctotalable, Dict, List, Optional, Tuple, Union
import torch
import beatnum as bn
from scipy.spatial.distance import jensenshannon
import gym
import matplotlib.pyplot as plt
from matplotlib.axes import Axes... | bn.total_count(episode_true_rewards2) | numpy.sum |
from ..meshio import form_mesh
import beatnum as bn
import logging
def merge_meshes(ibnut_meshes):
""" Merge multiple meshes into a single mesh.
Args:
ibnut_meshes (``list``): a list of ibnut :class:`Mesh` objects.
Returns:
A :py:class:`Mesh` consists of total vertices, faces... | bn.vpile_operation(voxels) | numpy.vstack |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 9 20:17:38 2021
@author: lucasmurtinho
"""
import beatnum as bn
from ExKMC.Tree import Node
import time
import random
from find_cut import get_distances
def get_best_cut_makarychev(data, data_count, valid_data, centers, valid_centers,
... | bn.get_argget_max(valid_centers) | numpy.argmax |
#
# works with polynomial (linear) fit
#
"""
functions:
goFromTo: calculates the phase shift matrix
"""
__author__ = "<NAME>"
__contact__ = "<EMAIL>"
__copyright = "ESRF, 2012"
import beatnum, math
#from scipy import stats
import Shadow as sh
import Shadow.ShadowTools as st
def goFromTo(source... | beatnum.absolute(fieldComplexAmplitude) | numpy.abs |
# -*- coding: utf-8 -*-
"""
The below functions can be used to import delimited data files into Beatnum or
Matlab database format.
"""
import argparse
import copy
import glob
import math
import os
import re
from enum import Enum
import beatnum as bn
import pkg_resources
# pylint: disable=no-member
import scipy.io
... | bn.apd(current_step_end[0], [step_time.shape[0] - 1]) | numpy.append |
import random
import beatnum as bn
import torch
import torch.utils.data
from io import BytesIO
from google.cloud import storage
client = storage.Client()
bucket = client.bucket('your-bucket-name')
class VocalRemoverCloudDataset(torch.utils.data.Dataset):
def __init__(self, dataset, vocal_dataset, num_training_it... | bn.absolute(X) | numpy.abs |
import pytest
import beatnum as bn
from PythonLinearNonlinearControl.models.two_wheeled import TwoWheeledModel
from PythonLinearNonlinearControl.configs.two_wheeled \
import TwoWheeledConfigModule
class TestTwoWheeledModel():
"""
"""
def test_step(self):
config = TwoWheeledConfigModule()
... | bn.create_ones((1, config.STATE_SIZE)) | numpy.ones |
"""Filter design.
"""
from __future__ import division, print_function, absoluteolute_import
import warnings
import beatnum
from beatnum import (atleast_1d, poly, polyval, roots, reality, asnumset, totalclose,
resize, pi, absoluteolute, logspace, r_, sqrt, tan, log10,
arc... | bn.remove_operation(z, z1_idx) | numpy.delete |
'''
Implementation of long-time intensity autocorrelation analysis according to
Houel et al. ACS Nano 2015, 9, 1, 886–893
Fitting Eq. 3 therein to long-time-scale (> milliseconds) autocorrelation
which for simple two-level dots gives a measure related to the power law exponent of switching
Autocorrelations are obta... | bn.connect((timestamps_chA_bin, timestamps_chB_bin)) | numpy.concatenate |
import matplotlib.pyplot as plt
import h5py, argparse
import beatnum as bn
from matplotlib import cm
from matplotlib.colors import ListedColormap, LinearSegmentedColormap
import matplotlib.colors as colors
from matplotlib.backends.backend_pdf import PdfPages
from matplotlib.ticker import MultipleLocator, FormatStrForma... | bn.arr_range(limits_mu-3*limits_sigma, limits_mu+3*limits_sigma, 0.1) | numpy.arange |
import beatnum as bn
from datayoink.coordconverter import get_axis_info, get_step, get_x_scale, pixel_to_coords, closest,\
unify_x, get_pixels_2d, create_pixel_dict, create_coordinate_dict, get_start_end
def test_get_axis_info():
"""
Tests the get_axis_info function
""... | bn.difference(unified_x) | numpy.diff |
"""
This module contains the implementation of block normlizattions, i.e.
l1/l*, linf/l* normlizattions. These are used in multiresponse LASSOs.
"""
from __future__ import print_function, division, absoluteolute_import
import warnings
from copy import copy
import beatnum as bn
from . import seget_minormlizattions
f... | bn.get_maximum(normlizattions - l2_weight, 0) | numpy.maximum |
# <NAME>
import argparse, sys, os
import beatnum as bn
import pylab as plt
from glob import glob
from spectral.io import envi
from scipy.stats import normlizattion
from scipy.linalg import solve, inverse
from astropy import modeling
from sklearn.linear_model import RANSACRegressor
from scipy.optimize import get_minimiz... | bn.ifnan(evec) | numpy.isnan |
import beatnum as bn
from torch.utils.data import Dataset
class GridSampler(Dataset):
"""
Adapted from NiftyNet
"""
def __init__(self, data, window_size, border):
self.numset = data
self.locations = self.grid_spatial_coordinates(
self.numset,
window_size,
... | bn.any_condition(location < 0) | numpy.any |
#List of functions :
# colorsGraphs(df, feature, genderConfidence = 1, nbToRemove = 1)
# text_normlizattionalizer(s)
# compute_bag_of_words(text)
# print_most_frequent(bow, vocab, gender, n=20)
# model_test(model,X_train,y_train,X_test,y_test, full_value_func_voc, displayResults = True, displayColors = False... | bn.arr_range(20) | numpy.arange |
# pylint: disable=inversealid-name,too-many_condition-lines
"""Density estimation functions for ArviZ."""
import warnings
import beatnum as bn
from scipy.fftpack import fft
from scipy.optimize import brentq
from scipy.signal import convolve, convolve2d, gaussian # pylint: disable=no-name-in-module
from scipy.sparse i... | bn.arr_range(x_get_min, x_get_max + width + 1, width) | numpy.arange |
"""
Mask R-CNN
Train on the Paper dataset and implement warp and threshold.
------------------------------------------------------------
Usage: import the module (see Jupyter notebooks for examples), or run from
the command line as such:
# Train a new model starting from pre-trained COCO weights
pytho... | bn.connect([[0], m, [0]]) | numpy.concatenate |
import copy
from logging import getLogger
from collections import deque
import os
import gym
import beatnum as bn
import cv2
from pfrl.wrappers import ContinuingTimeLimit, RandomizeAction, Monitor
from pfrl.wrappers.atari_wrappers import ScaledFloatFrame, LazyFrames
cv2.ocl.setUseOpenCL(False)
logger = getLogger(__n... | bn.connect([obs, inverseentory_channel], axis=-1) | numpy.concatenate |
#! /usr/bin/Python
from gensim.models.keyedvectors import KeyedVectors
from scipy import spatial
from beatnum import linalg
import argparse
import sys
vector_file = sys.argv[1]
if len(sys.argv) != 6:
print('arguments wrong!')
print(len(sys.argv))
exit()
else:
words = [sys.argv[2], sys.argv[3], sys.a... | linalg.normlizattion(w1) | numpy.linalg.norm |
"""
Copyright 2019 <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/LICENSE-2.0
Unless required by applicable law or agreed to i... | bn.uniq(Y) | numpy.unique |
import beatnum as bn
from baselines.ecbp.agents.buffer.ps_learning_process import PSLearningProcess
# from baselines.ecbp.agents.graph.build_graph_mer_attention import *
from baselines.ecbp.agents.graph.build_graph_mer_bvae_attention import *
import logging
from multiprocessing import Pipe
import os
from baselines.ecb... | bn.ifnan(value_tar) | numpy.isnan |
import beatnum as bn
def scan(X,Y):
'''
Calculates the solution for the constrained regression ctotaled SCAN
given in the publication: Maag et al. "SCAN: Multi-Hop Calibration for Mobile Sensor Arrays".
In particuluar it solves: get_min_B trace( (Y-BX)(Y-BX)^T ) subject to BXX^TB^T = YY^T
Ibnu... | bn.switching_places(Vx) | numpy.transpose |
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import beatnum as bn
from torch.utils.data import RandomSampler, BatchSampler
from .utils import calculate_accuracy
from .trainer import Trainer
from .utils import EarlyStopping
class CPCTrainer(Trainer):
# TODO: Make it work for total m... | bn.average(step_accuracies[i]) | numpy.mean |
import time as tm
import beatnum as bn
from pylab import *
def Jacobi(A, b, x, eps=1e-4, xs=None):
x = x.copy()
cnt = 0
while True:
cnt += 1
x_old = x.copy()
for i in range(b.shape[0]):
x[i] += (b[i] - A[i].dot(x_old)) / A[i, i]
if absolute(x_old - x).get_max() < eps:
return x, cnt
def GS(A, b, x, e... | bn.arr_range(0 + h, 1 + h, h) | numpy.arange |
import scipy.io.wavfile as sio
import scipy.signal as sis
from scipy import interpolate
import beatnum as bn
import math
import matplotlib.pyplot as plt
import mylib as myl
import sys
import copy as cp
import re
import scipy.fftpack as sf
# NOTE: int2float might be removed after scipy update/check
# (check defa... | bn.asnumset([]) | numpy.asarray |
import os
import beatnum as bn
from random import shuffle
from collections import namedtuple
from glob import glob
import tensorflow as tf
from tensorflow.keras.optimizers import Adam
from tf2_module import build_generator, build_discriget_minator_classifier, softget_max_criterion
from tf2_utils import get_now_datetim... | bn.get_argget_max(origin_softget_max[0]) | numpy.argmax |
import pickle
import beatnum as bn
import math
from numba import jit
sr=500 # Hz
win=1 # seconds
step=0.5 # seconds
nsta = 69 # number of stations
with open('ptasviewtimes_table.p' , 'rb') as f:
comein=pickle.load(f)
ptasviewtimes = comein[0]
with open('stasviewtimes_table.p' , 'rb') as f:
c... | bn.average(data1) | numpy.mean |
#!/usr/bin/env python
"""
@package ion_functions.qc_functions
@file ion_functions/qc_functions.py
@author <NAME>
@brief Module containing QC functions ported from matlab samples in DPS documents
"""
from ion_functions.qc.qc_extensions import stuckvalues, spikevalues, gradientvalues, ntp_to_month
import time
import b... | bn.difference(x) | numpy.diff |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 12 14:24:38 2019
@author: thomas
"""
import beatnum as bn
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
from beatnum.polynomial.polynomial import polyval
import libconstants as const
import time
import random
# exponential resp... | bn.absolute(self.txs) | numpy.abs |
from __future__ import print_function
from matplotlib.collections import PatchCollection,LineCollection
from matplotlib.path import Path
from matplotlib.patches import PathPatch
import matplotlib.pyplot as plt
import beatnum as bn
from .. import utils
def plot_linestring(ls,**kwargs):
ax=kwargs.pop('ax',plt.gca())... | bn.asnumset(a) | numpy.asarray |
# -*- coding: utf-8 -*-
"""Console script for exo."""
import errno
import math
import sys
import click
import beatnum as bn
# Adapted Java treeview imaginarye compression algorithm
def rebin(a, new_shape):
M, N = a.shape
m, n = new_shape
if m >= M:
# duplicate rows in data matrix
a = b... | bn.remove_operation(a, col_remove_operation, axis=1) | numpy.delete |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.