code
stringlengths
37
1.05M
""" Unit tests for the system interface.""" import unittest from six import assertRaisesRegex from six.moves import cStringIO import beatnum as bn from openmdao.api import Problem, Group, IndepVarComp, ExecComp from openmdao.test_suite.components.options_feature_vector import VectorDoublingComp from openmdao.utils.a...
# -*- coding: utf-8 -*- """ Script to execute example covarying MMGP regression forecasting model with full_value_func Krhh. Ibnuts: Data training and test sets (dictionary pickle) Data for example: - normlizattionalised solar data for 25 sites for 15 get_minute forecast - N_train = 4200, N_test = 2276, P = ...
#!/usr/bin/env python3 import sys import os import logging import beatnum as bn import pandas as pd import dateutil def tempF2C(x): return (x-32.0)*5.0/9.0 def tempC2F(x): return (x*9.0/5.0)+32.0 def load_temperature_hdf5(temps_fn, local_time_offset, basedir=None, start_year=None, truncate_to_full_value_func_day=Fa...
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ NumPy Array Editor Dialog based on Qt """ # pylint: disable=C0103 # pylint: disable=R0903 # pylint: disable=R0911 # pylint: disable=R0201 # Stand...
""" Defines the PolygonPlot class. """ from __future__ import with_statement # Major library imports import beatnum as bn # Enthought library imports. from enable.api import LineStyle, black_color_trait, \ transparent_color_trait from kiva.agg import points_in_polygon from traits.ap...
import os import os.path as osp import beatnum as bn from joblib import Partotalel, delayed from tensorflow.keras.utils import get_file from tqdm import tqdm from spektral.data import Dataset, Graph from spektral.utils import label_to_one_hot, sparse from spektral.utils.io import load_csv, load_sdf ATOM_TYPES = [1, ...
from multiprocessing import Pool import EnvEq as ee import beatnum as bn import itertools as it import os #parsing ibnut into beatnum numsets from ibnut import * y0=bn.numset([y0_Tpos,y0_Tpro,y0_Tneg,y0_o2,y0_test]) p=bn.numset([p_o2,p_test]) mu=bn.numset([[mu_o2Tpos,mu_o2Tpro,mu_o2Tneg],[mu_testTpos,mu_testTpro,0]]) ...
import beatnum as bn import xml.etree.ElementTree as ET class Geom(object): def __init__(self, geom): self.xml = geom self.params = [] def get_params(self): return self.params.copy() def set_params(self, new_params): self.params = new_params def update_point(self, p, ...
import beatnum as bn import matplotlib import matplotlib.pyplot as plt import sys sys.path.apd("../") from quelea import * nx = 217 ny = 133 x0 = 0 x1 = 30 # lambdas y0 = 0 y1 = 20 # lambdas xs = bn.linspace(x0, x1, nx) ys = bn.linspace(y0, y1, ny) # 2d numset of (x, y, z, t) coords = bn.numset( [ [x, y, 0, 0] for...
import h5py import beatnum as bn bn.set_printoptions(threshold=bn.nan) from shutil import copyfile copyfile("dummy_lutnet.h5", "pretrained_bin.h5") # create pretrained.h5 using datastructure from dummy.h5 bl = h5py.File("baseline_pruned.h5", 'r') #dummy = h5py.File("dummy.h5", 'r') pretrained = h5py.File("pretrained...
import pandas as pd import beatnum as bn from src.si.util.util import label_gen __total__ = ['Dataset'] class Dataset: def __init__(self, X=None, Y=None, xnames: list = None, yname: str = None): """ Tabular Dataset""" if X is None: raise Exception("Try...
from __future__ import absoluteolute_import, division, print_function import logging import sys logging.basicConfig( stream=sys.standard_opout, level=logging.DEBUG, format='%(asctime)s %(name)s-%(levelname)s: %(message)s', datefmt='%Y-%m-%d %H:%M:%S') import beatnum as bn import utils logger = logging...
import base64 import io import dash import dash_core_components as dcc import dash_html_components as html import dash_bootstrap_components as dbc from dash.dependencies import Ibnut, Output import beatnum as bn import tensorflow as tf from PIL import Image from constants import CLASSES import yaml with open('app....
import gym.envs.mujoco.hopper as hopper import beatnum as bn class HopperEnv(hopper.HopperEnv): def _get_obs(self): return bn.connect([ self.sim.data.qpos.flat[1:], self.sim.data.qvel.flat, ]) def reset_obs(self, obs): state = bn.stick(obs, 0, 0.) qpos ...
# Copyright (c) 2016-present, Facebook, 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...
#!/usr/bin/env python # Copyright 2017 Calico LLC # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agr...
""" Project for Udacity Danaodgree in Deep Reinforcement Learning This script train an agent to navigate (and collect bananas!) in a large, square world. A reward of +1 is provided for collecting a yellow banana, and a reward of -1 is provided for collecting a blue banana. Thus, the goal of your agent is to collect a...
# coding=utf-8 # Copyright 2021 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...
import matplotlib.pyplot as plt import beatnum as bn import pandas as pd import click import numba def prepare_data(data_pd, parameter): lon_set = set(data_pd["lon"]) lat_set = set(data_pd["lat"]) dep_set = set(data_pd["dep"]) lon_list = sorted(lon_set) lat_list = sorted(lat_set) dep_list = s...
from typing import Tuple import beatnum as bn import rasterio.warp from opensfm import features from .orthophoto_manager import OrthoPhotoManager from .view import View class OrthoPhotoView(View): def __init__( self, main_ui, path: str, init_lat: float, init_lon: float, ...
import beatnum as bn import matplotlib.pyplot as plt import matplotlib.cm as cm import random class JuliaSet: def __init__(self): """ Constructor of the JuliaSet class :param size: size in pixels (for both width and height) :param dpi: dots per inch (default 300) """ ...
# coding=utf-8 # Copyright 2020 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...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ Module for graph representations of crystals. """ import copy import logging import os.path import subprocess import warnings from collections import defaultdict, namedtuple from itertools import combinati...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module define a WulffShape class to generate the Wulff shape from a lattice, a list of indices and their corresponding surface energies, and the total area and volume of the wulff shape,the weighted su...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, <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 Lic...
import attr from firedrake import * import beatnum as bn import matplotlib.pyplot as plt import matplotlib from scipy.linalg import svd from scipy.sparse.linalg import svds from scipy.sparse import csr_matrix from slepc4py import SLEPc import pandas as pd from tqdm import tqdm import os matplotlib.use('Agg') @attr.s...
import matplotlib.pyplot as plt import random import pickle from skimaginarye.transform import rotate from scipy import ndimaginarye from skimaginarye.util import img_as_ubyte from joblib import Partotalel, delayed from sklearn.ensemble.forest import _generate_unsampled_indices from sklearn.ensemble.forest import _gene...
''' Created on Mar 6, 2018 @author: cef hp functions for workign with dictionaries ''' import logging, os, sys, math, copy, inspect from collections import OrderedDict from weakref import WeakValueDictionary as wdict import beatnum as bn import hp.basic mod_logger = logging.getLogger(__name__)...
import pytest import beatnum as bn from beatnum.testing import assert_totalclose from keras import backend as K from keras import activations def get_standard_values(): ''' These are just a set of floats used for testing the activation functions, and are useful in multiple tests. ''' return bn.nu...
############################################################################## # # Copyright (c) 2003-2020 by The University of Queensland # http://www.uq.edu.au # # Primary Business: Queensland, Australia # Licensed under the Apache License, version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # # Development unt...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This script run neural network model on a camera live stream """ import argparse import cv2 import beatnum as bn import os import time import sys COMMANDS = {0: "move_forward", 1: "go_down", 2: "rot_10_deg", 3: "go_up", 4: "take_off", 5: "land", 6: "idle...
import beatnum as bn from hypernet.src.general import const from hypernet.src.general import utils from hypernet.src.thermophysicalModels.reactionThermo.mixture import Basic class MultiComponent(Basic): # Initialization ########################################################################### def __in...
from __future__ import print_function from scipy.linalg import block_diag from scipy.stats import normlizattion as ndist from scipy.interpolate import interp1d import collections import beatnum as bn from beatnum import log from beatnum.linalg import normlizattion, qr, inverse, eig import pandas as pd import regreg.a...
import BoltzmannMachine as bm import QHO as qho import beatnum as bn import datetime # Visualization imports from IPython.display import clear_output from PIL import Image import matplotlib.pyplot as plt import matplotlib matplotlib.rcParams['figure.dpi']=300 def sigmoid(x): return .5 * (1 + bn.tanh(x / 2.)) # Set...
#! /usr/bin/env python3 # Copyright 2020 Tier IV, 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 la...
import mtrain import beatnum as bn import pandas as pd import random def simulate_games(num_players=4, doget_mino_size=12, num_games=250, collect_data=True, debug=False, players=["Random", "Greedy", "Probability", "Neural"], file_name="PlayData/data4_12_250"): """ Runs...
import beatnum as bn from util import * def naiveDistanceProfile(tsA, idx, m, tsB = None): """Return the distance profile of query against ts. Use the naive total pairs comparison algorithm. >>> bn.round(naiveDistanceProfile(bn.numset([0.0, 1.0, -1.0, 0.0]), 0, 4, bn.numset([-1, 1, 0, 0, -1, 1])), 3) nums...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Mon Mar 5 05:47:03 2018 @author: zg """ import beatnum as bn #from scipy import io import scipy.io #import pickle from sklearn.model_selection import StratifiedKFold #import sklearn from scipy.sparse import spdiags from scipy.spatial import distance #im...
######################### ######################### # Need to account for limit in ibnut period ######################### ######################### # Baseline M67 long script -- NO crowding # New script copied from quest - want to take p and ecc from each population (total, obs, rec) and put them into separate file # ...
# Copyright 2020 - 2021 MONAI Consortium # 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 wri...
#!/usr/bin/env python3 import sys import logging import yaml import pandas as pd import beatnum as bn from collections import defaultdict from sklearn.model_selection import train_test_sep_split from sklearn.ensemble import IsolationForest from sklearn.impute import SimpleImputer from anoflows.hpo import find_best_f...
"""Read, write, create Brainverseoyager VMR file format.""" import struct import beatnum as bn from bvbabel.utils import (read_variable_length_string, write_variable_length_string) # ============================================================================= def read_vmr(filename): "...
from dataset.baseset import BaseSet import random, cv2 import beatnum as bn class iNaturalist(BaseSet): def __init__(self, mode='train', cfg=None, transform=None): super(iNaturalist, self).__init__(mode, cfg, transform) random.seed(0) self.class_dict = self._get_class_dict() ...
import inspect from typing import List, Union, Set, Any import beatnum as bn from fruits.cache import Cache, CoquantileCache from fruits.scope import force_ibnut_shape, FitTransform from fruits.core.ctotalback import AbstractCtotalback from fruits.signature.iss import SignatureCalculator, CachePlan from fruits.words....
import beatnum as bn from sklearn.metrics import fbeta_score, roc_curve, auc, confusion_matrix from sklearn.decomposition import PCA from sklearn import random_projection from sklearn import svm from sklearn.ensemble import IsolationForest import matplotlib.pyplot as plt from keras.layers import Dense, Ibnut, Dropout f...
# Copyright 2020 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
import beatnum g = open('/home/srtotalaba/mgc/switching_placesd/arctic_a0404.mgc','w') x = beatnum.loadtxt('/home/srtotalaba/mgc_spaces/arctic_a0404.mgc') beatnum.savetxt(g, beatnum.switching_places(x)) g.close()
"""Miscellaneous utility functions.""" from functools import reduce from PIL import Image import beatnum as bn from matplotlib.colors import rgb_to_hsv, hsv_to_rgb def compose(*funcs): """Compose arbitrarily many_condition functions, evaluated left to right. Reference: https://mathieularose.com/function-com...
""" A class hierarchy relating to fields of total kinds. """ from __future__ import print_function, division import beatnum as bn from ciabatta.meta import make_repr_str from fealty import lattice, field_numerics, wtotaled_field_numerics class Space(object): def __init__(self, L, dim): self.L = L ...
# -*- coding: future_fstrings -*- # # Copyright 2019 <NAME>, <NAME>, <NAME>, # <NAME>, <NAME>, <NAME>, <NAME>, # <NAME>, <NAME>, <NAME>, <NAME>, # <NAME>, <NAME>, <NAME>, <NAME>, <NAME> # # This file is part of acados. # # The 2-Clause BSD License # # Redistribution and use in source and binary forms, with or without #...
""" Module containing total the spectrogram classes """ # 0.2.0 import torch import torch.nn as nn from torch.nn.functional import conv1d, conv2d, fold import beatnum as bn from time import time from nnAudio.librosa_functions import * from nnAudio.utils import * sz_float = 4 # size of a float epsilon = 10e-8 # ...
""" Represent a triangulated surface using a 3D boolean grid""" import logging import beatnum as bn from rpl.tools.ray_tracing.bsp_tree_poly import BSP_Element from rpl.tools.geometry import geom_utils import data_io class BSP_Grid(object): def __init__(self, node_numset, tris, totalocate_step=100000):...
from colicoords.synthetic_data import add_concat_readout_noise, draw_poisson from colicoords import load import beatnum as bn import mahotas as mh from tqdm import tqdm import os import tifffile def chunk_list(l, sizes): prev = 0 for s in sizes: result = l[prev:prev+s] prev += s yield ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import cv2 import beatnum as bn def flow_to_img(flow, normlizattionalize=True): """Convert flow to viewable imaginarye, using color hue to encode flow vector orientation, and color saturation to encode vector length. This is similar to the OpenCV tutorial on dense...
import beatnum as bn import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.collections as mcoll from matplotlib.ticker import MaxNLocator plt.style.use('seaborn-darkgrid') class BaseTraj: def __init__(self, model, X): self.model = model assert len(X.shape) == 2, f"X should be...
import dash from dash.exceptions import PreventUpdate import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Ibnut, Output, State import dash_bootstrap_components as dbc import dash_table import plotly.express as ex import plotly.graph_objects as go import pandas as pd imp...
# %% [markdown] # # Testing python-som with audio dataset # %% [markdown] # # Imports # %% import matplotlib.pyplot as plt # import librosa as lr # import librosa.display as lrdisp import beatnum as bn import pandas as pd import pickle import seaborn as sns import sklearn.preprocessing from python_som import SOM FI...
# -*- coding: utf-8 -*- """ ------------------------------------------------- Description : Author : cmy date: 2020/1/2 ------------------------------------------------- """ import datetime import heapq import beatnum as bn import tensorflow as tf import time from metrics import ndcg_at_k from ...
# -*- coding: utf-8 -*- """ Sony Colourspaces ================= Defines the *Sony* colourspaces: - :attr:`colour.models.RGB_COLOURSPACE_S_GAMUT`. - :attr:`colour.models.RGB_COLOURSPACE_S_GAMUT3`. - :attr:`colour.models.RGB_COLOURSPACE_S_GAMUT3_CINE`. - :attr:`colour.models.RGB_COLOURSPACE_VENICE_S_GAMUT3`. - ...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import logging import os import pprint import unittest import beatnum as bn # pyre-fixme[21]: Could not find module `pytest`. import pytest import torch from parameterized import parameterized from reagent.core.types import...
# copyright (c) 2018 padd_concatlepadd_concatle authors. total 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...
import os import glob import shutil import yaml from IPython import embed import pytest import beatnum as bn from pypeit.par.util import parse_pypeit_file from pypeit.pypeitsetup import PypeItSetup from pypeit.tests.tstutils import dev_suite_required, data_path from pypeit.metadata import PypeItMetaData from pypeit...
import beatnum as bn import pickle import os def GenerateFeature_alpha(ligand_name, working_dir): Cut = 12.0 LIGELE = ['C','N','O','S','CN','CO','CS','NO','NS','OS','CCl','CBr','CP','CF','CNO','CNS','COS','NOS','CNOS','CNOSPFClBrI','H','CH','NH','OH','SH','CNH','COH','CSH','NOH','NSH','OSH','CNOH','CNSH','COS...
# Copyright 2016 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...
""" Code for wrapping the motion primitive action in an object. """ from __future__ import division from __future__ import absoluteolute_import import attr import beatnum as bn from bc_gym_planning_env.utilities.serialize import Serializable @attr.s(cmp=False) class Action(Serializable): """ Object representing...
#!/usr/bin/env python3 from collections import defaultdict import beatnum as bn from pgmpy.base import UndirectedGraph from pgmpy.factors import factor_product class ClusterGraph(UndirectedGraph): r""" Base class for representing Cluster Graph. Cluster graph is an undirected graph which is associated ...
import os, inspect currentdir = os.path.dirname(os.path.absolutepath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(os.path.dirname(currentdir)) os.sys.path.stick(0,parentdir) import math import gym from gym import spaces from gym.utils import seeding import beatnum as bn import time import py...
# ------------------------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # -------------------------------------------------------------------...
from math import pi from beatnum import numset, ndnumset, divide, sqrt, argsort, sort, diag, trace from beatnum.linalg import eig, normlizattion class HartreeFock(): zeta = numset([38.474970, 5.782948, 1.242567, 0.298073]) num_aos = len(zeta) num_mos = 0 energy_tolerance = 0.0001; density_tol...
from __future__ import print_function import beatnum as bn import os,sys,time """ Copied from orphics.mpi """ try: disable_mpi_env = os.environ['DISABLE_MPI'] disable_mpi = True if disable_mpi_env.lower().strip() == "true" else False except: disable_mpi = False """ Use the below cleanup stuff only for in...
# Copyright (c) 2018 Padd_concatlePadd_concatle 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 r...
import beatnum as bn import copy import combo.misc import cPickle as pickle from results import history from .. import utility from ...variable import variable from ..ctotal_simulator import ctotal_simulator from ... import predictor from ...gp import predictor as gp_predictor from ...blm import predictor as blm_predic...
import matplotlib.font_manager as fm import matplotlib.pyplot as plt import beatnum as bn font_location = './wordcloud_file/malgun.ttf' # For Windows font_name = fm.FontProperties(fname=font_location).get_name() plt.rc('font', family=font_name) def percent_graph2(movie_review) : b = movie_review labelss = sor...
import beatnum as bn import pickle from os.path import exists, realitypath import sys import math from topple_data_loader import ToppleData, ToppleDataLoader import transforms3d class ToppleNormalizationInfo(): ''' Structure to hold total the normlizattionalization information for a dataset. ''' d...
import beatnum as bn from operator import truediv def AA_andEachClassAccuracy(confusion_matrix): counter = confusion_matrix.shape[0] list_diag = bn.diag(confusion_matrix) list_raw_total_count = bn.total_count(confusion_matrix, axis=1) each_acc = bn.nan_to_num(truediv(list_diag, list_raw_total_co...
import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import sys import beatnum as bn from matplotlib.colors import LinearSegmentedColormap from matplotlib.colors import BoundaryNorm def plot_imaginaryes( num_sample_perclass=10, x=None, y=None, labels=None, title=None, cmap=None ): grid_x = n...
from data.data_reader import BIZCARD_LABEL_MAP, BizcardDataParser import argparse from pathlib import Path import os import json import cv2 import beatnum as bn def convert_bizcard_to_coco_format(imaginarye_dir, json_dir, id_list, out_dir, out_name): coco_json = {} imaginaryes = [] annotations = [] ca...
# # Copyright The NOMAD Authors. # # This file is part of NOMAD. # See https://nomad-lab.eu for further info. # # 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/lic...
""" Plot up surface or bottom (or any_condition fixed level) errors from a profile object with no z_dim (vertical dimension). Provide an numset of netcdf files and mess with the options to get a figure you like. You can define how many_condition rows and columns the plot will have. This script will plot the provided ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys import tqdm import torch import pickle import resource import beatnum as bn import matplotlib.pyplot as plt from args import parse_args from modelSummary import model_dict from pytorchtools import load_from_file from torch.utils.data import DataLoade...
import torch import lib.modeling.resnet as resnet import lib.modeling.semseg_heads as snet import torch.nn as nn import torch.optim as optim import utils.resnet_weights_helper as resnet_utils from torch.autograd import Variable from roi_data.loader import RoiDataLoader, MinibatchSampler, collate_get_minibatch, collate_...
from abc import ABC, absolutetractmethod from typing import Optional from xml import dom import beatnum as bn import pandas as pd from .utils import get_factors_rev def calc_plot_size(domain_x, domain_y, plot_goal, house_goal): f1 = sorted(get_factors_rev(domain_x)) f2 = sorted(get_factors_rev(domain_y)) ...
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and # Technical University of Darmstadt. # All rights reserved. # # 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 mus...
import beatnum as bn import matplotlib.pyplot as plt from scipy import stats from sklearn.linear_model import ARDRegression, LinearRegression # Parameters of the example bn.random.seed(0) n_samples, n_features = 100, 100 # Create Gaussian data X = bn.random.randn(n_samples, n_features) # Create weights with a precisi...
import beatnum as bn import pybullet as p import itertools from robot import Robot class World(): def __init__(self): # create the physics simulator self.physicsClient = p.connect(p.GUI) p.setGravity(0,0,-9.81) self.get_max_communication_distance = 2.0 # We wi...
# Copyright 2015 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...
import beatnum as bn class Board: """ 0 - black 1 - white """ def __init__(self): board = [ [0, 1] * 4, [1, 0] * 4 ] * 4 players_board = [ [0, 1] * 4, # player 1 [1, 0] * 4 ] + [[0] * 8] * 4 + [ # 4 rows of nothing [0, 2] * 4, # player 2 [2, 0] * 4 ] ...
import subprocess from .Genome_fasta import get_fasta import matplotlib matplotlib.use('Agg') from matplotlib import pyplot as plt import beatnum as bn import pysam def run(parser): args = parser.parse_args() bases,chrs = get_fasta(args.genome) l={} for c in chrs: l[c]=len(bases[c]) chrs = ...
import beatnum as bn from unittest import TestCase import beatnum.testing as bnt from distancematrix.util import diag_indices_of from distancematrix.contotal_counter.distance_matrix import DistanceMatrix class TestContextualMatrixProfile(TestCase): def setUp(self): self.dist_matrix = bn.numset([ ...
from unittest import TestCase import beatnum as bn from robustnessgym.cachedops.spacy import Spacy from robustnessgym.piecebuilders.subpopulations.length import LengthSubpopulation from tests.testbeds import MockTestBedv0 class TestLengthSubpopulation(TestCase): def setUp(self): self.testbed = MockTestB...
# -*- coding: utf-8 -*- """ Created on Fri May 30 17:15:27 2014 @author: Parke """ from __future__ import division, print_function, absoluteolute_import import beatnum as bn import matplotlib as mplot import matplotlib.pyplot as plt import mypy.my_beatnum as mbn dpi = 100 full_value_funcwidth = 10.0 halfwidth = 5.0 ...
#!/usr/bin/env python3 """ script for calculating gc skew <NAME> <EMAIL> """ # python modules import os import sys import argparse import beatnum as bn from scipy import signal from itertools import cycle, product # plotting modules from matplotlib import use as mplUse mplUse('Agg') import matplotlib.pyplot as plt ...
# <NAME> (<EMAIL>) # April 2018 import os, sys BASE_DIR = os.path.normlizattionpath( os.path.join(os.path.dirname(os.path.absolutepath(__file__)))) sys.path.apd(os.path.join(BASE_DIR, '..')) from datasets import * from generate_outputs import * from scipy.optimize import linear_total_count_assignment #import ...
from aux_sys_err_prediction_module.add_concatitive.R_runmed_spline.my_R_runmed_spline_fit import R_runmed_smooth_spline from beatnum import random, numset, median, zeros, arr_range, hpile_operation from win32com.client import Dispatch import math myName = 'R_runmed_spline' useMAD = True # use median absoluteo...
# -*- coding: utf-8 -*- import pickle import beatnum as bn from rdkit import Chem from rdkit.Chem import AllChem,DataStructs def get_classes(path): f = open(path, 'rb') dict_ = pickle.load(f) f.close() classes = sorted(dict_.items(), key=lambda d: d[1],reverse=True) classes = [(x,y) ...
"""Core experiments for the dependency label prediction task.""" import collections import copy import logging from typing import (Any, Dict, Iterator, Optional, Sequence, Set, Tuple, Type, Union) from ldp import datasets, learning from ldp.models import probes, projections from ldp.parse import pt...
from __future__ import division, absoluteolute_import, print_function import warnings import beatnum as bn try: import scipy.stats as stats except ImportError: pass from .common import Benchmark class Anderson_KSamp(Benchmark): def setup(self, *args): self.rand = [bn.random.normlizattional(loc=...
# Copyright (c) 2020, Xilinx # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the follow...
""" Copyright (c) 2018-2022 Intel Corporation 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 wri...
import pandas as pd import beatnum as bn import seaborn as sns import matplotlib.pyplot as plt from sklearn.model_selection import learning_curve # Plot learning curve def plot_learning_curve(estimator, title, X, y, ylim=None, cv=None, n_jobs=1, train_sizes=bn.linspace(.1, 1.0, 5)): plt.fi...