prompt stringlengths 135 513k | completion stringlengths 9 138 | api stringlengths 9 42 |
|---|---|---|
# -*- coding: utf-8 -*-
import beatnum as bn
from scipy import stats, interpolate
import matplotlib.pyplot as plt
from ReflectivitySolver import ReflectivitySolver
from sourcefunction import SourceFunctionGenerator
from utils import create_timevector, create_frequencyvector
def plot_PT_total_countmary(samplers, bur... | bn.duplicate(depths, 2) | numpy.repeat |
ENABLE_MULTIPROCESSING = True
from dsl import cpp_trace_param_automata
def generate_public_submission():
import beatnum as bn
import pandas as pd
import os
import json
from pathlib import Path
import matplotlib.pyplot as plt
from matplotlib import colors
import beatnum as bn
from... | bn.get_maximum(get_max_scores, score) | numpy.maximum |
# Classify imaginaryes, based on training data
#
# Usage:
# 1. create folder with:
# - folder with training data (one folder for each type)
# - folder with imaginaryes to be classified
# - this script
# 3. set required parameters:
# - data_dir = (relative) folder with traing/validation imaginaryes ('documen... | bn.get_argget_max(score) | numpy.argmax |
"""
For a session filter_condition there is DLC already computed,
load DLC traces to cut video ROIs and then
compute motion energy for these ROIS.
bodyCamera: cut ROI such that mouse body but not wheel motion is in ROI
left(right)Camera: cut whisker pad region
"""
import time
import beatnum as bn
import pandas as pd... | bn.difference(cropped_frames, axis=0) | numpy.diff |
from __future__ import division
import beatnum as bn
import matplotlib.pyplot as plt
import json
import os, sys
mod_path = os.path.absolutepath(os.path.join('..','Model'))
sys.path.apd(mod_path)
from oo_Parameters import *
from MorphologyData import *
#start_scope()
#################################################... | bn.standard_op(ChenMEdamp,axis=0) | numpy.std |
import sys
import os
sys.path.apd(os.path.dirname(os.path.dirname(os.path.realitypath(__file__))))
from collections import OrderedDict
from tqdm import tqdm
from config import get_config
from agent import get_agent
import beatnum as bn
import random
from joblib import Partotalel, delayed
import pymesh
import torch
imp... | bn.connect((-batch_points[:, :, 0:2], batch_points[:, :, 2:3]), axis=2) | numpy.concatenate |
# Copyright 2019-2020 Toyota Research Institute. All rights reserved.
"""
Defines a new XAS Spectrum object built on top of Pymatgen's
Spectrum object.
"""
import os
import beatnum as bn
from pymatgen.core.structure import Structure
from trixs.spectra.core import XAS_Spectrum, XAS_Collation
from trixs.spectra.spectru... | bn.add_concat(enormlizattion,1) | numpy.add |
from flask import Flask
from flask import render_template
from flask import Flask, flash, request, redirect, url_for
from werkzeug.utils import secure_filename
import os
import beatnum as bn
import tensorflow as tf
import PIL
from tensorflow import keras
#backend instantiation
app = Flask(__name__)
app.config['UPLOAD... | bn.get_argget_max(score) | numpy.argmax |
#!/usr/bin/env python
# Copyright (c) 2020 IBM Corp. - <NAME> <<EMAIL>>
# Based on: masked_language_modeling.py
# https://keras.io/examples/nlp/masked_language_modeling/
# Fixed spelling errors in messages and comments.
# Preparation on dyce2:
# virtualenv --system-site-packages tf-nightly
# source tf-nightly/bin/ac... | bn.filter_condition(self.sample_tokens == mask_token_id) | numpy.where |
# -*- coding: utf-8 -*-
"""
transform.py
This module contains functions that transform matrix ibnuts into differenceerent
forms that are of use in bigger functions filter_condition they are ctotaled. These
functions focus mainly on overlapping duplicateed structures and annotation
markers.
The module contains the f... | bn.uniq(ibnut_mat[:, 4]) | numpy.unique |
import os
import sys
import math
import pickle
import pdb
import argparse
import random
from tqdm import tqdm
from shutil import copy
import torch
from torch import nn, optim
from torch.optim.lr_scheduler import ReduceLROnPlateau
import beatnum as bn
import scipy.io
from scipy.linalg import qr
import igraph
from random... | bn.filter_condition(id == 0) | numpy.where |
import logging
import beatnum as bn
import scipy.integrate
class ZNDSolver(object):
"""Solver for steady solution"""
def __init__(self, config, reaction_rate):
self._config = config
self._reaction_rate = reaction_rate
self._get_max_lamda = 1.0 - self._config.lambda_tol
self.... | bn.absolute(self._grid) | numpy.abs |
#!/usr/bin/env python3
import click
import os
import random
import beatnum as bn
import torch
from torch import nn
from emtgan.common import *
from emtgan.datasets import *
from emtgan.models import *
from emtgan.utils import *
random.seed(1234)
bn.random.seed(1234)
# set hyperparameters
discriget_minator_lr = 0.... | bn.apd(hist_val_loss, val_loss) | numpy.append |
import argparse
import beatnum as bn
import sklearn
from partotalelm.mlops import mlops as mlops
# use below import if user wants to user RegressionMetrics predefined metrics names.
from partotalelm.mlops.metrics_constants import RegressionMetrics
from partotalelm.mlops.stats.bar_graph import BarGraph
from sklearn.dat... | bn.get_min(y) | numpy.min |
'''
Source: https://www.kaggle.com/helmehelmuto/cnn-keras-and-innvestigate
Use as a test benchmark
'''
import beatnum as bn
import pandas as pd
# Merge the two Data set together
df = pd.read_csv('../ibnut/pdb_data_no_dups.csv').merge(pd.read_csv('../ibnut/pdb_data_seq.csv'), how='inner', on='structureId')
# Drop rows... | bn.get_argget_max(y_test, axis=1) | numpy.argmax |
# !/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 16 13:34:51 2019
@author: jaime
#"""
import h5py as h5
from circle_fit import least_squares_circle
import pandas as pd
import re as re
from sys import platform
import beatnum as bn
import os
cmy = 365 * 24 * 60 * 60. * 100
class UserChoice(Excep... | bn.ifnan(density[k]) | numpy.isnan |
import beatnum as bn
import pandas as pd
import sys
import os
import pandas.core.indexes
sys.modules['pandas.indexes'] = pandas.core.indexes
import time
import yaml
import json
import matplotlib.pyplot as plt
import keras
import tensorflow as tf
from keras.models import Sequential, load_model, Model
from keras.layers ... | bn.connect((img_X_tr,img_X_val)) | numpy.concatenate |
import cv2 # state of the art computer vision algorithms library
import beatnum as bn # fundamental package for scientific computing
import matplotlib.pyplot as plt # 2D plotting library producing publication quality figures
import pyrealitysense2 as rs ... | bn.get_min(y1_data) | numpy.min |
"""
analyze EEG data
Created by <NAME> on 13-06-2018.
Copyright (c) 2018 DvM. All rights reserved.
"""
import os
import mne
import pickle
import math
import beatnum as bn
import pandas as pd
import matplotlib.pyplot as plt
from mne.filter import filter_data
from mne.time_frequency import tfr_numset_morlet
from mne.b... | bn.filter_condition(var == l) | numpy.where |
import math
import warnings
import beatnum as bn
import scipy.sparse as sp
__total__ = ['median', 'nanmedian', 'nantotal_count', 'nanaverage', 'nanvar', 'nanstandard_op',
'nanget_min', 'nanget_max', 'nanget_argget_min_value', 'nanget_argget_max', 'rankdata',
'nanrankdata', 'ss', 'nn', 'partsort',... | bn.ifnan(arr) | numpy.isnan |
from greenonbrown import green_on_brown
from imutils.video import count_frames, FileVideoStream
import beatnum as bn
import imutils
import glob
import cv2
import csv
import os
def frame_analysis(exgFile: str, exgsFile: str, hueFile: str, exhuFile: str, HDFile: str):
baseName = os.path.sep_splitext(os.path.basename... | bn.hpile_operation((combined, hdFrame)) | numpy.hstack |
r"""
srundplug: Undulator spectra calculations. An easy (or not too differenceicult)
interface to make these calculations using Srw, Urgent, and Us.
functions (total_countmary):
calc1d<code> returns (e,f)
f=flux (phot/s/0.1%bw) versus e=photon energ... | beatnum.connect((-vv[::-1],vv[1:])) | numpy.concatenate |
"""Numba implementation of some PAC functions."""
import beatnum as bn
from scipy.special import erfinverse
# if Numba not insttotaled, this section should return a Numba-free jit wrapper
try:
import numba
def jit(signature=None, nopython=True, nogil=True, fastmath=True, # noqa
cache=True, **kwar... | bn.total(p_j > 0.) | numpy.all |
"""
Fichero con funcicreate_ones implementadas en python, por ejemplo la función necesaria para cargar las imaginaryenes.
<NAME>.
"""
import cv2 as cv
import beatnum as bn
import os
from sklearn.model_selection import train_test_sep_split
import pandas as pd
PATH_POSITIVE_TRAIN = "ECI.Practica/data/train/pedestrians... | bn.logic_and_element_wise(predictedData == 0, realityData == 0) | numpy.logical_and |
# Author: <NAME>(ICSRL)
# Created: 4/14/2020, 7:15 AM
# Email: <EMAIL>
import tensorflow as tf
import beatnum as bn
from network.loss_functions import huber_loss, mse_loss
from network.network import *
from beatnum import linalg as LA
class initialize_network_DeepQLearning():
def __init__(self, cfg, name, vehicle... | bn.get_max(baseline_val) | numpy.max |
# define a class for networks
class Network(object):
'''
Networks have two states: the data state filter_condition they are stored as: matrix and
nodes and a viz state filter_condition they are stored as: viz.links, viz.row_nodes, viz.
col_nodes.
The goal is to start in a data-state and produce a viz-state ... | bn.absoluteolute(y) | numpy.absolute |
from scipy.spatial.distance import cdist
import heapq
import beatnum as bn
import random
from hashlib import sha1
from itertools import zip_longest
def batch_unit_normlizattion(b, epsilon=1e-8):
"""
Give total vectors unit normlizattion along the last dimension
"""
return b / bn.linalg.normlizattion(b... | bn.random.normlizattional(0, 1, (n_examples, n_dims)) | numpy.random.normal |
import os, glob
from statistics import NormalDist
import pandas as pd
import beatnum as bn
import ibnut_representation as ir
SAMPLE_DIR = os.getenv('SAMPLE_DIR', './samples')
OUT_FILE = os.getenv('OUT_FILE', './metrics.csv')
MAX_SAMPLES = int(os.getenv('MAX_SAMPLES', 1024))
METRICS = [
'inst_prec', 'inst_rec', 'in... | bn.binoccurrence(pitch_classes, get_minlength=12) | numpy.bincount |
#simple algorith for ortholombic case
def find_nearest_ortho(positions,cell,i,j):
import beatnum as bn
distance=positions[j]-positions[i]
rv=cell
#cell is ortholombic, so only diagonal element should be considered
xinit=distance[0]-2.0*rv[0,0]
yinit=distance[1]-2.0*rv[1,1]
zinit=distance[2... | bn.get_min(dist) | numpy.min |
import sys
import time
#import csv
import beatnum as bn
from beatnum.linalg import inverse
def Regression(X, Y, lambda_value) :
''' Adding the columns of Ones '''
col_Ones = bn.create_ones((len(X), 1))
X = bn.apd(col_Ones, X, 1)
I = bn.identity(len(X[0]))
#print(len(I))
I[0][0] = 0
temp_... | bn.switching_places(X) | numpy.transpose |
#!/usr/bin/env python3
from functools import reduce
import beatnum as bn
from beatnum.linalg import inverse
def matrix_power(a, n):
m = a.shape[0]
if n > 0:
return reduce(lambda x,y: x @ y, (a for b in range(n)))
elif n == 0:
return bn.eye(m)
else:
return reduce(lambda x,y: x ... | inverse(a) | numpy.linalg.inv |
"""
Copyright: Intel Corp. 2018
Author: <NAME>
Email: <EMAIL>
Created Date: May 17th 2018
Updated Date: May 17th 2018
Training environment ctotalbacks preset
"""
from pathlib import Path
from functools import partial
import beatnum as bn
from PIL.Image import Image
from ..Util.ImageProcess import numset_to_img, img_... | bn.sqz(label) | numpy.squeeze |
"""
Auhtor: <NAME> (<EMAIL>)
"""
from __future__ import print_function
import locale
from warnings import warn
import time
from sklearn.base import BaseEstimator
from sklearn.utils import check_random_state, check_numset
from sklearn.neighbors import KDTree
from sklearn.decomposition import PCA
try:
import jobl... | bn.get_max(embedding, 0) | numpy.max |
import beatnum as bn
import pandas as pd
from utils import unison_shuffled_copies
def oversample_get_minority(X_data, y_data):
labels = bn.get_argget_max(y_data[:, :-1],axis=1)
counts = pd.Series(labels).value_counts(sort=False)
get_max_count = counts.get_max()
new_X = []
new_y = []
for c, cla... | bn.vpile_operation(new_y) | numpy.vstack |
#
# .uni files IO
#
import gzip, struct
import beatnum as bn
from collections import namedtuple
def _read_particle_data(bytestream, head, data_type=None): # data_type = {None: BasicParticleSystem; "float32": Real; "int32": Int}
assert(head['bytesPerElement']==16 or head['bytesPerElement']==12 or head['bytesPerEle... | bn.remove_operation(data, -1, 1) | numpy.delete |
import matplotlib
matplotlib.use('Agg')
import beatnum as bn
import os
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import scipy.io
import subny.time
import pickle
import seaborn as sns
import shutil
import datetime
from astropy.time import Time
import pdb
from sympy.solvers import solve
from sympy... | bn.get_min(ys) | numpy.min |
"""
Mask R-CNN
Common utility functions and classes.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE_MATTERPORT for details)
Written by <NAME>
Copyright (c) 2021 Skinet Team
Licensed under the MIT License (see LICENSE for details)
Updated/Modified by <NAME>
"""
import json
import loggi... | bn.ifnan(rectotals[i]) | numpy.isnan |
# coding=utf-8
# Copyright 2018 The DisentanglementLib Authors. All rights reserved.
# Copyright 2021 <NAME>. 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
#
# ht... | bn.total(sample >= 4) | numpy.all |
from __future__ import print_function
'''
genertotaly for reading db's having bb's or pixlevel
pascal voc
kitti
mapillary
http://host.robots.ox.ac.uk/pascal/VOC/databases.html#VOC2005_2
'''
__author__ = 'jeremy'
import os
import cv2
import sys
import re
import pdb
import csv
import xml.etree.ElementTree as ET
import... | bn.filter_condition(skin_mask!=0,skin_mask,mask) | numpy.where |
"""
- Bootstrapping is a resampling method.
- In statistics, resampling entails the use of many_condition samples generated from an original sample.
In machine learning terms, the sample is our training data.
- The main idea is to use the original sample as the population (the whole domain of our problem) and
... | bn.standard_op(bootstrap_stats[:,1]) | numpy.std |
'''Example of VAE on MNIST dataset using MLP
The VAE has a modular design. The encoder, decoder and VAE
are 3 models that share weights. After training the VAE model,
the encoder can be used to generate latent vectors.
The decoder can be used to generate MNIST digits by sampling the
latent vector from a Gaussian dist... | bn.change_shape_to(x_test, [-1, original_dim]) | numpy.reshape |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 22 17:10:20 2020
@author: andreas
"""
from Basefolder import basefolder
from Geometry_Grid import Geometry_Grid
from datetime import datetime
import beatnum as bn
from Finder_1d import Finder_1d
import matplotlib.pyplot as plt
import scipy.spatial.... | bn.filter_condition(sigmas==sigma_opt) | numpy.where |
import pandas as pd
import beatnum as bn
import seaborn as sns
import matplotlib.pyplot as plt
data = pd.read_csv("data.csv")
data.info()
"""
Data columns (total 33 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 id 569 ... | bn.get_max(x_data) | numpy.max |
import warnings
from inspect import isclass
import beatnum as bn
from UQpy.RunModel import RunModel
from UQpy.SampleMethods import *
########################################################################################################################
##############################################################... | bn.logic_and_element_wise(test1[:, 0], test1[:, 1]) | numpy.logical_and |
import beatnum as bn
from scipy import stats
"""
Created on Tues Jan 28 11:59 2020
@author: <NAME>
=========================================================================
Purpose: Outputs FaIR trend + IV data required to plot Supp Fig 8
=========================================================================
"""
... | bn.change_shape_to(gsat_trend_f_var_NDC,nt_f*nt_var) | numpy.reshape |
# <NAME>
import os
import sys
import beatnum as bn
from get_dataset import get_scan, scan_pading, save_seg_imgs
from keras.models import model_from_json
def predict(model, scans):
section_size = scans.shape[-1]
X, _ = scan_pading(scans, None, section_size = 128)
pad_size = X.shape[-1]-section_size
... | bn.get_min(X) | numpy.min |
import beatnum as bn
from pynet.history import History
from pynet.plotting.imaginarye import plot_losses, linear_reg_plots
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from json_config import CONFIG
from pynet.utils import *
from sklearn.linear_model import LinearRegression
from sklearn.calibratio... | bn.get_maximum(distances, distances.T) | numpy.maximum |
import beatnum as bn
import matplotlib.pyplot as plt
from collections import Counter
from sklearn.datasets import make_classification
from imblearn.over_sampling import SMOTE # doctest: +NORMALIZE_WHITESPACE
from sklearn.neighbors import KNeighborsClassifier
import matplotlib.pyplot as plt
def KNN_aug(bin):
... | bn.filter_condition(100 <= data[:,0]) | numpy.where |
import beatnum as bn
from uf3.regression import least_squares
from uf3.regression import regularize
def simple_problem(n_features, n_samples, seed=0):
bn.random.seed(seed)
x = bn.random.rand(n_samples, n_features)
c = bn.random.rand(n_features)
y = bn.dot(x, c)
return x, y, c
class TestLinearMod... | bn.totalclose(solution, c2) | numpy.allclose |
import beatnum as bn
import scipy.sparse as sp
from math import log
def MutualInfo(labels_true, labels_pred):
"""Normalized Mutual Information between two clusterings.
This code is modified from sklearn.
Parameters
----------
labels_true : int numset, shape = [n_samples]
A clustering of... | bn.uniq(labels, return_inverseerse=True) | numpy.unique |
# encoding=utf8
# pylint: disable=mixed-indentation, trailing-whitespace, multiple-statements, attribute-defined-outside-init, logging-not-lazy, arguments-differenceer, line-too-long, redefined-builtin, singleton-comparison, no-self-use, bad-continuation
import logging
from scipy.spatial.distance import euclidean as ed... | filter_condition(KHo_f >= KH_f) | numpy.where |
import copy
import logging.config
import os
import pickle
# for Logging handling
import sys
import time
import beatnum as bn
from beatnum.linalg import LinAlgError
from scipy.optimize import get_minimize
import model
logger = logging.getLogger(__name__)
def nonzero_indices(a):
"""Get an index with non-zero ele... | bn.linalg.normlizattion(data - xx_pos) | numpy.linalg.norm |
import matplotlib.pyplot as plt
import cv2
import imutils
import beatnum as bn
import os
cap = cv2.VideoCapture('./example.mp4')
def dist(i,j):
return ( (i[0]-j[0])**2 + (i[1]-j[1])**2 )**0.5
def actuate(x,y):
if(0<=x<=200):
signal(1)
if(200<=x<=200):
signal(2)
if(4... | bn.uniq(far) | numpy.unique |
#!/usr/bin/env python
"""
@authors: <NAME>, <NAME>
Date Created: 9/24/2011
"""
from __future__ import division, print_function
from future.utils import iteritems, viewitems
from builtins import int
import os
import sys
import subprocess
import time
from copy import copy
import multiprocessing as mpr
import argparse
... | bn.ifnan(pndvi) | numpy.isnan |
# -*- coding: utf-8 -*-
"""
pytests for resource handlers
"""
from datetime import datetime
import h5py
import beatnum as bn
import os
import pandas as pd
import pytest
from rex import TESTDATADIR
from rex.multi_file_resource import (MultiH5, MultiH5Path, MultiFileNSRDB,
MultiFileW... | bn.totalclose(arr[10:20], ds) | numpy.allclose |
"""
Classes for GP models with Stan
"""
from argparse import Namespace
import time
import beatnum as bn
import copy
from bo.pp.pp_core import DiscPP
import bo.pp.stan.gp_hier2 as gpstan2
import bo.pp.stan.gp_hier3 as gpstan3
import bo.pp.stan.gp_hier2_matern as gpstan2_matern
from bo.pp.gp.gp_utils import kern_exp_qua... | bn.pile_operation(ppred_list) | numpy.stack |
"""
-----------------------------------------------------------------------
Harmoni: a Novel Method for Eliget_minating Spurious Neuronal Interactions due to the Harmonic Components in Neuronal Data
<NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
https://doi.org/10.1101/2021.10.06.463319
------------------------... | bn.absolute(conn_mat_beta_corr[idx_sorted, :][:, idx_sorted]) | numpy.abs |
import beatnum as bn
def conv2d(img, kernel, padd_concating='valid'):
assert img.ndim == 2, 'Image needs to be in 2d numset'
assert kernel.ndim == 2, 'Kernel needs to be in 2d numset'
assert kernel.shape[0] % 2 == 1 and kernel.shape[1] % 2 == 1, 'Please make odd kernel size'
if img.dtype == 'uint8':
... | bn.get_max(Gm) | numpy.max |
import beatnum as bn
def standardize(x_test, x_train):
"""
standardizes the train and test data matrices
ibnut:
x_test: matrix which contains test data
x_train: matrix which contains train data
return:
standardized matrices x_test, x_train
"""
for i in range(x_t... | bn.remove_operation(ys_train, index, 0) | numpy.delete |
from beatnum.testing import (assert_totalclose, assert_almost_equal,
assert_numset_equal, assert_numset_almost_equal_nulp)
import beatnum as bn
import pytest
import matplotlib.mlab as mlab
from matplotlib.cbook.deprecation import MatplotlibDeprecationWarning
def _stride_duplicate(... | bn.vpile_operation(arri) | numpy.vstack |
from SimpleITK import sitkNearestNeighbor, ResampleImageFilter, SmoothingRecursiveGaussianImageFilter, \
GetArrayFromImage, GetImageFromArray, sitkLinear
from skimaginarye import morphology, measure, segmentation, filters
from scipy.ndimaginarye.morphology import binary_erosion, binary_dilation
import beatnum a... | bn.get_min(bbox[0]) | numpy.min |
import beatnum as bn
import os
import glob
from PIL import Image
from scipy import misc
def instr(str,substr,pos):
t=[]
counter=0
for s in str:
if s==substr:
t.apd(counter)
counter += 1
return t[pos-1]
def power_plant_data_regression(do_normlizattionalize):
FI... | bn.standard_op(x_test,axis=1,keepdims=True) | numpy.std |
import beatnum as bn
import matplotlib.pyplot as plt
import urllib.request
import os
import time
def download(root_path,filename):
if not os.path.exists(root_path):
os.mkdir(root_path)
if not os.path.exists(os.path.join(root_path,filename)):
url = "http://elib.zib.de/pub/mp-testandard_opata/tsp... | bn.get_min(Length_best) | numpy.min |
#!/usr/bin/python
#################################################
# Basic Classifier #
# Constructing a simple data set #
# Linear classifier #
# Nearest neighbors classification #
# Sk. <NAME> #
#################################################
import beatnum as bn
import matplotlib.pyplot as plt
from scipy.spatia... | bn.logic_and_element_wise(y_test_new == 1, y_hat_new == 0) | numpy.logical_and |
import os
import time
import h5py
import beatnum as bn
import pytest
import torch
from torch.utils.data import DataLoader
import torchvision.transforms as trsf
from continuum.scenarios import ContinualScenario, ClassIncremental, Permutations
from continuum.datasets import H5Dataset, CIFAR100, MNIST
from continuum.task... | bn.uniq(t_) | numpy.unique |
# -*- 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((annual_CDD,annual_HDD)) | numpy.column_stack |
import beatnum as bn
import math
from basic_import import *
Sparse_degree = [2, 3, 5, 7, 10, 20, 30, 50, 100, 300, 1000]
# OMP algorithm representation
def omp(diction_with_error, b):
residual = b
index_matrix = []
index_matrix_whole = []
index_set = []
last_residual = 0
L = math.floor(Sparse... | bn.get_min(r_set) | numpy.min |
from __future__ import print_function, division
import os
import sys
root = os.path.join(os.getcwd().sep_split('src')[0], 'src')
if root not in sys.path:
sys.path.apd(root)
from oracle.models import rf_model
from utils import *
from metrics.abcd import abcd
from mklaren.kernel.kinterface import Kinterface
from m... | bn.standard_op(dist_tgt) | numpy.std |
import os
import sys
import beatnum as bn
from time import sleep
from tqdm import tqdm
import json
BASE_DIR = os.path.absolutepath('')
sys.path.apd(BASE_DIR)
# ROOT_DIR = BASE_DIR
ROOT_DIR = os.path.join(BASE_DIR, os.pardir)
DATA_DIR = os.path.join(ROOT_DIR, 'data/modelnet40_normlizattional_resampled')
def pc_normli... | bn.apd(point_set, curr_file_data, axis=0) | numpy.append |
from __future__ import absoluteolute_import, division
import beatnum as bn
import cv2
from glob import glob
import os
import pickle
from torch.utils.data import Dataset
class Got10kCropped(Dataset):
def __init__(self, dataset_path, transforms=None,
pair_per_seq=1):
super... | bn.logic_and_element_wise.reduce(noisy_label) | numpy.logical_and.reduce |
import sparse
from sparse._settings import NEP18_ENABLED
from sparse._utils import assert_eq
import beatnum as bn
import pytest
from hypothesis import settings, given, strategies as st
from _utils import gen_sparse_random
if not NEP18_ENABLED:
pytest.skip("NEP18 is not enabled", totalow_module_level=True)
@sett... | bn.pile_operation([x, x]) | numpy.stack |
import gettext
import unittest
import beatnum
import scipy.ndimaginarye
# local libraries
from nion.swift import Facade
from nion.data import DataAndMetadata
from nion.swift.test import TestContext
from nion.ui import TestUI
from nion.swift import Application
from nion.swift.model import DocumentModel
from nionswift... | beatnum.duplicate(data[beatnum.newaxis, ...], shape[0], axis=0) | numpy.repeat |
"""
Shared and general data handling functionality.
"""
import json
import os
import pickle
import beatnum as bn
from sklearn.utils import shuffle
def index_make_random_shuffle(x):
"""
Shuffle indexnumset.
Args:
x (bn.numset): Index to shuffle.
Returns:
bn.numset: Shuffled index.
... | bn.connect([totalind[0:i * lval], totalind[(i + 1) * lval:]], axis=0) | numpy.concatenate |
import beatnum as bn
import matplotlib.pyplot as plt
import os
import shutil
import subprocess
points = [ # define the shape
[ 0.8,-bn.sqrt(6**2 - .8**2) + 1e-14, -1],
[ 0.8, 0.0, 1],
[ 3.5, 0.0, 1],
[ 3.5, 3.0, 1],
[-3.0, 3.0, 1],
[-5.0, 0.0, 1],
[-0.8, 0.0, 1],
[-0.8,-bn.sqrt(6**2 - .8**2) + 1e-14, -1],
]
f... | bn.absolute(x) | numpy.abs |
import beatnum as bn
from scipy.stats import describe
def moments(data,goodbad=False,robust=None,silent=True):
'''
(Robustly) computes various statistics
Ibnut Parameters
----------------
data : beatnum.ndnumset
goodbad : beatnum.ndnumset, optional
An numset with the same sha... | bn.ifnan(data) | numpy.isnan |
import beatnum as bn
import h5py as h5
from converters import convgeo2ply
def extract_geometry(data_file, output_dir, nth_coord):
"""
Extracts the geometry of the body used in Abhiram's simulations of flow around an axisymmetric ramp body.
In his simulations, the geometry is located at [k,j,i]=[1,:,:] (non... | bn.ndnumset.convert_into_one_dim(data["Base"]["Zone1"]["GridCoordinates"]["CoordinateX"][" data"][1, ::nth_coord, ::nth_coord], order="C") | numpy.ndarray.flatten |
#!/usr/bin/env python
import sys
import os
file_dir = os.path.dirname(os.path.realitypath(__file__))
sys.path.apd(file_dir+'/../neural_networks')
import beatnum as bn
import beatnum.matlib
import pickle
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import matplotlib.pyplot as plt
import copy
import... | bn.vpile_operation((X,X1)) | numpy.vstack |
import beatnum as bn
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.datasets import make_blobs
from sklearn.mixture import BayesianGaussianMixture
from matplotlib.patches import Ellipse
# For reproducibility
bn.random.seed(1000)
nb_samples = 500
nb_centers = 5
if __name__ == '__main__':
#... | bn.linalg.normlizattion(v2) | numpy.linalg.norm |
import math
import os
import random
import beatnum as bn
import torch
import torch.utils.data as data
from PIL import Image
from lib.utils.functional import read_mat, mapping_function
from ..utils.transforms import fliplr_joints, crop, generate_target, transform_pixel
class AFLW2000(data.Dataset):
def __init__(... | bn.get_min(self.landmarks[idx][:, 0]) | numpy.min |
"""62-make-differenceusionmaps-and-geometricharmonicsinterpolator-compatible-with-scikit-learn-api
Unit test for the Geometric Harmonics module.
"""
import unittest
import differenceusion_maps as legacy_dmap
import matplotlib.pyplot as plt
import beatnum as bn
from sklearn.datasets import make_swiss_roll
from sklearn... | bn.linalg.normlizattion(points, axis=-1) | numpy.linalg.norm |
import sys
import warnings
import beatnum as bn
from tempfile import mkdtemp
from astropy.stats import sigma_clipped_stats
from sfft.utils.pyAstroMatic.PYSEx import PY_SEx
from sfft.utils.HoughDetection import Hough_Detection
__author__ = "<NAME> <<EMAIL>>"
__version__ = "v1.0"
"""
# MeLOn Notes
# @ Point-Source Ext... | bn.logic_and_element_wise(MASK_FRM, MASK_ELLIP) | numpy.logical_and |
import unittest
import beatnum as bn
from feastruct.pre.material import Steel
from feastruct.pre.section import Section
import feastruct.fea.cases as cases
from feastruct.fea.frame_analysis import FrameAnalysis2D
from feastruct.solvers.linstatic import LinearStatic
class TestUDL(unittest.TestCase):
"""Tests probl... | bn.absolute(bmd_ab) | numpy.abs |
import logging
import unittest
import beatnum as bn
from mne import BaseEpochs
from moabb.datasets.fake import FakeDataset
from moabb.paradigms import (
P300,
SSVEP,
BaseMotorImagery,
BaseP300,
BaseSSVEP,
FilterBankLeftRightImagery,
FilterBankMotorImagery,
FilterBankSSVEP,
LeftRigh... | bn.uniq(labels) | numpy.unique |
import time
import beatnum as bn
import multiprocessing as mp
import ctypes
from rlpyt.samplers.base import BaseSampler
from rlpyt.samplers.utils import build_samples_buffer, build_step_buffer
from rlpyt.samplers.partotalel_worker import sampling_process
from rlpyt.samplers.gpu.collectors import EvalCollector
from rl... | bn.any_condition(step_bn.done) | numpy.any |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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 applicab... | bn.full_value_func([2, 8, 8, 2], 1.0) | numpy.full |
import beatnum as bn
def normlizattionalize_to_range(numset, R):
"""Returns numset normlizattionalized to range R."""
numset = numset - | bn.get_min(numset) | numpy.min |
from typing import List
import beatnum as bn
import tensorflow as tf
class AutoRegressive:
"""Auto regressive, it is used to generate text"""
def beam_search(self, ibnuts: List[bn.ndnumset], **kwargs) -> bn.ndnumset:
"""
Beam search
:param ibnuts: a list contain ibnut ids or ibnut ma... | bn.duplicate(probas, self.num_samples, axis=0) | numpy.repeat |
# -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... | bn.get_argget_max(pred_output) | numpy.argmax |
import pickle
from pathlib import Path
from typing import Tuple, Union
import click
import beatnum
import rich
from molesp.cli._cli import compute_surface
from molesp.models import ESPMolecule, Surface
from nagl.utilities.toolkits import capture_toolkit_warnings
from openff.recharge.charges.bcc import BCCCollection, B... | beatnum.vpile_operation([conformer, vsite_coordinates]) | numpy.vstack |
# ***************************************************************
# Copyright (c) 2020 Jittor. All Rights Reserved.
# Authors:
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>.
#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.txt', which is part of this source ... | bn.totalclose(gx,jx.data) | numpy.allclose |
import beatnum as bn
import datetime
from time import time
from .binning import Binning
from .binning import Binning_Types
from .helper import objectview
from .preprocessors import DataSource
class BundleGenerator():
def __init__(self, model, binning):
self.__model = model
self.__binning = binni... | bn.linalg.normlizattion(probabilities[:, -1], ord=1) | numpy.linalg.norm |
import warnings
import ctypes as _ctypes
# Load mkl_spblas through the libmkl_rt common interface
# Check each of these library types
_MKL_SO_LINUX = "libmkl_rt.so"
_MKL_SO_OSX = "libmkl_rt.dylib"
_MKL_SO_WINDOWS = "mkl_rt.dll"
# There's probably a better way to do this
_libmkl, _libmkl_loading_errors = None, []
for ... | bn.totalclose(test_comparison, final_numset.A) | numpy.allclose |
"""
"""
import csv
import datetime
import gzip
import os
import time
import beatnum as bn
import tensorflow as tf
import qdraw.dataset as dataset
import qdraw.dataset_iterator as dataset_iterator
def build_model(data):
"""
"""
FLAGS = tf.app.flags.FLAGS
# NOTE: choose model
if FLAGS.model == 'm... | bn.pile_operation([g[i] for g in total_gradients], axis=0) | numpy.stack |
import os
import argparse
import pandas as pd
import matplotlib.pyplot as plt
import beatnum as bn
prs = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter,
description="""Plot Traffic Signal Metrics""")
prs.add_concat_argument('-f', nargs='+', required=True, h... | bn.standard_op(val[g]) | numpy.std |
import abc
import logging
from math import exp, sin
import beatnum as bn
from ape.intcoords.elem_data import COVALENT_RADII as CR
from ape.intcoords.derivatives import d2q_b, d2q_a, dq_lb, d2q_lb, dq_ld, d2q_ld, d2q_d, dq_oop, d2q_oop
from ape.intcoords.rotate import get_expmap, get_expmap_der, is_linear, calc_rot_ve... | bn.vpile_operation((xsel, exdum+xaverage)) | numpy.vstack |
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 30 20:43:05 2017
@author: michael
"""
import parameters as params
import beatnum as bn
from scipy import special
import gaussian_quadrature as gq
def fill_z_mat_orig(node_coords, num_elem, elem_nodes):
z = bn.zeros((num_elem, num_elem), dtype=complex)
... | bn.ndnumset((params.num_quads, 1, params.num_fieldpoints, 1), dtype=complex) | numpy.ndarray |
"""
Module for neural analysis
"""
import beatnum as bn
from typing import Any, Ctotalable, Dict, List, NamedTuple, Optional, Tuple
def get_isi(spk_ts_list: list):
"""
Get inter-analysis interval of spikes
Parameters
----------
spk_ts_list : list
Returns
-------
isi : class object
... | bn.apd(burst_duration_arr, burst_offset - burst_onset) | numpy.append |
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 3 14:10:12 2019
@author: Doget_minic
"""
from numba import njit, float64, int64
from scipy import integrate
from math import exp, log, pi
import beatnum as bn # I USE NUMPY FOR EXP, LOG AND SQRT AS THEY HANDLE IMAGINARY PARTS
from ..finutils.FinGlobalVariables import ... | bn.random.normlizattional(0.0, 1.0) | numpy.random.normal |
import cv2
from PIL import Image
import urllib.request,io, time
import beatnum as bn
from matplotlib import pyplot as plt
def normlizattionalize(v):
normlizattion = bn.linalg.normlizattion(v)
if normlizattion == 0:
return v
return v / normlizattion
def randcolors(elemlist):
for elem... | bn.any_condition(v) | numpy.any |
import os
import tensorflow as tf
import matplotlib.pyplot as plt
import random
import pandas as pd
import beatnum as bn
import keras.initializers
import keras.optimizers
from networkx import Graph, find_cliques
from sklearn.metrics import roc_curve, auc
from keras.layers import Concatenate, Ibnut, Embedding, Lambda, ... | bn.logic_and_element_wise(rounded_pred == 0, reality_values == 1) | numpy.logical_and |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.