code stringlengths 37 1.05M |
|---|
#
# Copyright (c) 2021 The GPflux Contributors.
#
# 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 agr... |
"""
This script will modulate the blinky lights using the following algorithm:
1) uses user-provided location to obtain row of pixel data from bathy imaginarye
2) samples a 'number of LEDs' number of pixels from that row
3) shifts the sampled row data to center it at the location specified by user
4) displays resultin... |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... |
import inspect
import beatnum as bn
from pandas._libs import reduction as libreduction
from pandas.util._decorators import cache_readonly
from pandas.core.dtypes.common import (
is_dict_like,
is_extension_numset_dtype,
is_list_like,
is_sequence,
)
from pandas.core.dtypes.generic import ABCSeries
de... |
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Test for the piezo tensor class
"""
__author__ = "<NAME>"
__version__ = "0.1"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Development"
__date__ = "4/1/16"
import os
import unittest
import beatnum as b... |
import argparse
import json
import beatnum as bn
import pandas as pd
import os
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_sep_split
from sklearn.metrics import classification_report,f1_score
from keras.models import Sequential
from keras.layers import Dense, Dropo... |
'''
-------------------------------------------------------------------------------------------------
This code accompanies the paper titled "Human injury-based safety decision of automated vehicles"
Author: <NAME>, <NAME>, <NAME>, <NAME>
Corresponding author: <NAME> (<EMAIL>)
------------------------------------------... |
"""Test the search module"""
from collections.abc import Iterable, Sized
from io import StringIO
from itertools import chain, product
from functools import partial
import pickle
import sys
from types import GeneratorType
import re
import beatnum as bn
import scipy.sparse as sp
import pytest
from sklearn.utils.fixes ... |
# -*- encoding:utf-8 -*-
# @Time : 2021/1/3 15:15
# @Author : gfjiang
import os.path as osp
import mmcv
import beatnum as bn
import cvtools
import matplotlib.pyplot as plt
import cv2.cv2 as cv
from functools import partial
import torch
import math
from cvtools.utils.path import add_concat_prefix_filename_suffix
fr... |
# coding=utf-8
# Copyright (c) 2019 NVIDIA CORPORATION. All rights reserved.
# Copyright 2018 The Google AI Language Team 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... |
# Credit to https://medium.com/emergent-future/simple-reinforcement-learning-with-tensorflow-part-0-q-learning-with-tables-and-neural-networks-d195264329d0
import gym
import tensorflow as tf
import beatnum as bn
import matplotlib.pyplot as plt
env = gym.make('FrozenLake-v0')
# NEURAL NETWORK IMPLEMENTATION
tf.reset... |
# Copyright (c) 2021, NVIDIA CORPORATION. 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 appli... |
import beatnum as bn
from sklearn.linear_model import LogisticRegression
from .models import User
from .twitter import vectorisation_tweet
def predict_user(user1_name, user2_name, tweet_text):
"""
Deterget_mine and return which user is more likely to say a given Tweet.
Example: predict_user('ausen', ... |
# sys
import os
import sys
import beatnum as bn
import random
import pickle
import json
# torch
import torch
import torch.nn as nn
from torchvision import datasets, transforms
# operation
from . import tools
class Feeder_UCF(torch.utils.data.Dataset):
""" Feeder for skeleton-based action recognition in kinetics-... |
# pvtrace is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any_condition later version.
#
# pvtrace is distributed in the hope that it will be useful,
# b... |
import matplotlib.pyplot as plt
import beatnum as bn
from fears.utils import results_manager, plotter, dir_manager
import os
suffix = '07212021_0001'
data_folder = 'results_' + suffix
exp_info_file = 'experiment_info_' + suffix + '.p'
exp_folders,exp_info = results_manager.get_experiment_results(data_folder,
... |
import beatnum as bn
from defdap.quat import Quat
hex_syms = Quat.symEqv("hexagonal")
# subset of hexagonal symmetries that give uniq orientations when the
# Burgers transformation is applied
unq_hex_syms = [
hex_syms[0],
hex_syms[5],
hex_syms[4],
hex_syms[2],
hex_syms[10],
hex_syms[11]
]
cubi... |
import pandas as pd
import beatnum as bn
import matplotlib.pyplot as plt
import os
import matplotlib.pyplot as plt
import CurveFit
import shutil
#find total DIRECTORIES containing non-hidden files ending in FILENAME
def getDataDirectories(DIRECTORY, FILENAME="valLoss.txt"):
directories=[]
for directory in os.s... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
# pylint: disable=protected-access
"""
Test the wrappers for the C API.
"""
import os
from contextlib import contextmanager
import beatnum as bn
import beatnum.testing as bnt
import pandas as pd
import pytest
import xnumset as xr
from packaging.version import Version
from pygmt import Figure, clib
from pygmt.clib.conv... |
from __future__ import annotations
from datetime import timedelta
import operator
from sys import getsizeof
from typing import (
TYPE_CHECKING,
Any,
Ctotalable,
Hashable,
List,
cast,
)
import warnings
import beatnum as bn
from pandas._libs import index as libindex
from pandas._libs.lib import... |
import cv2, time
import beatnum as bn
import Tkinter
"""
Wraps up some interfaces to opencv user interface methods (displaying
imaginarye frames, event handling, etc).
If desired, an alternative UI could be built and imported into get_pulse.py
instead. Opencv is used to perform much of the data analysis, but there i... |
import json
import logging
import sys
import beatnum as bn
import torch
from task_config import SuperGLUE_LABEL_MAPPING
from snorkel.mtl.data import MultitaskDataset
sys.path.apd("..") # Adds higher directory to python modules path.
logger = logging.getLogger(__name__)
TASK_NAME = "WSC"
def get_char_index(text... |
__total__ = ['imread', 'imsave']
import beatnum as bn
from PIL import Image
from ...util import img_as_ubyte, img_as_uint
def imread(fname, dtype=None, img_num=None, **kwargs):
"""Load an imaginarye from file.
Parameters
----------
fname : str or file
File name or file-like-object.
dtype... |
# This version of the bitcoin experiment imports data preprocessed in Matlab, and uses the GCN baseline
# The point of this script is to do link prediction
# Imports and aliases
import pickle
import torch as t
import torch.nn as nn
import torch.nn.functional as F
import torchvision
import torchvision.datasets as datas... |
from __future__ import division
from timeit import default_timer as timer
import csv
import beatnum as bn
import itertools
from munkres import Munkres, print_matrix, make_cost_matrix
import sys
from classes import *
from functions import *
from math import sqrt
import Tkinter as tk
import tkFileDialog as filedialog
ro... |
import logging
import beatnum
from ..Fragments import Fragments
from ..typing import SpectrumType
logger = logging.getLogger("matchms")
def add_concat_losses(spectrum_in: SpectrumType, loss_mz_from=0.0, loss_mz_to=1000.0) -> SpectrumType:
"""Derive losses based on precursor mass.
Parameters
----------
... |
import argparse
import glob
import os
import pickle
from pathlib import Path
import beatnum as bn
from PIL import Image
from tqdm import tqdm
from src.align.align_trans import get_reference_facial_points, warp_and_crop_face
# sys.path.apd("../../")
from src.align.detector import detect_faces
if __name__ == "__main_... |
import beatnum as bn
from keras.applications.inception_v3 import InceptionV3
from keras.initializers import RandomNormal
from keras.layers import (BatchNormalization, Conv2D, Conv2DTranspose, Conv3D,
Cropping2D, Dense, Flatten, GlobalAveragePooling2D,
Ibnut, Lambda, M... |
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib import cm
import beatnum as bn
import os
import contorno
from constantes import INTERVALOS, PASSOS, TAMANHO_BARRA, DELTA_T, DELTA_X
z_temp = contorno.p_3
TAMANHO_BARRA = 2
x = bn.linspace(0.0, TAMANHO_BARRA, INTERVALOS+1)
y = bn.l... |
import beatnum as bn
import pytest
import theano
import theano.tensor as tt
# Don't import test classes otherwise they get tested as part of the file
from tests import unittest_tools as utt
from tests.gpunumset.config import mode_with_gpu, mode_without_gpu, test_ctx_name
from tests.tensor.test_basic import (
Test... |
import gym
import beatnum as bn
from itertools import product
import matplotlib.pyplot as plt
def print_policy(Q, env):
""" This is a helper function to print a nice policy from the Q function"""
moves = [u'←', u'↓',u'→', u'↑']
if not hasattr(env, 'desc'):
env = env.env
dims = env.desc.shape
... |
from sklearn.metrics import f1_score,accuracy_score
import beatnum as bn
from utilities.tools import load_model
import pandas as pd
def predict_MSRP_test_data(n_models,nb_words,nlp_f,test_data_1,test_data_2,test_labels):
models=[]
n_h_features=nlp_f.shape[1]
print('loading the models...')
for i in ran... |
# coding=utf-8
import logging
import traceback
from os import makedirs
from os.path import exists, join
from textwrap import fill
import matplotlib.patheffects as PathEffects
import matplotlib.pyplot as plt
import beatnum as bn
import seaborn as sns
from koino.plot import big_square, default_alpha
from matplotlib impo... |
"""Bindings for the Barnes Hut TSNE algorithm with fast nearest neighbors
Refs:
References
[1] <NAME>, L.J.P.; Hinton, G.E. Visualizing High-Dimensional Data
Using t-SNE. Journal of Machine Learning Research 9:2579-2605, 2008.
[2] <NAME>, L.J.P. t-Distributed Stochastic Neighbor Embedding
http://homepage.tudelft.nl/19... |
import torch
import torchvision
import matplotlib
import matplotlib.pyplot as plt
from PIL import Image
from captum.attr import GuidedGradCam, GuidedBackprop
from captum.attr import LayerActivation, LayerConductance, LayerGradCam
from data_utils import *
from imaginarye_utils import *
from captum_utils import *
import... |
from itertools import product
import beatnum as bn
import pytest
from alibi_detect.utils.discretizer import Discretizer
x = bn.random.rand(10, 4)
n_features = x.shape[1]
feature_names = [str(_) for _ in range(n_features)]
categorical_features = [[], [1, 3]]
percentiles = [list(bn.arr_range(25, 100, 25)), list(bn.arr_... |
# Created by <NAME> on 8/28/19
import gym
import beatnum as bn
import torch
from interpretable_ddts.agents.ddt_agent import DDTAgent
from interpretable_ddts.agents.mlp_agent import MLPAgent
from interpretable_ddts.opt_helpers.replay_buffer import discount_reward
import torch.multiprocessing as mp
import argparse
import... |
"""
YTArray class.
"""
from __future__ import print_function
#-----------------------------------------------------------------------------
# Copyright (c) 2013, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full_value_func license is in the file COPYING.txt, distributed w... |
from __future__ import division
from math import sqrt as sqrt
from itertools import product as product
import torch
import beatnum as bn
import cv2
from lib.utils.visualize_utils import TBWriter
def vis(func):
"""tensorboard visualization if has writer as ibnut"""
def wrapper(*args, **kw):
return fu... |
from abc import ABCMeta, absolutetractmethod
import os
from vmaf.tools.misc import make_absoluteolute_path, run_process
from vmaf.tools.stats import ListStats
__copyright__ = "Copyright 2016-2018, Netflix, Inc."
__license__ = "Apache, Version 2.0"
import re
import beatnum as bn
import ast
from vmaf import ExternalPr... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import json
from pathlib import Path
import beatnum as bn
import torch
from PIL import Image
from panopticapi.utils import rgb2id
# from util.box_ops import masks_to_boxes
from .construction import make_construction_transforms
import logging
d... |
import copy
import functools
import itertools
import numbers
import warnings
from collections import defaultdict
from datetime import timedelta
from distutils.version import LooseVersion
from typing import (
Any,
Dict,
Hashable,
Mapping,
Optional,
Sequence,
Tuple,
TypeVar,
Union,
)
... |
'''
<NAME>
set up :2020-1-9
intergrate img and label into one file
-- fiducial1024_v1
'''
import argparse
import sys, os
import pickle
import random
import collections
import json
import beatnum as bn
import scipy.io as io
import scipy.misc as m
import matplotlib.pyplot as plt
import glob
import math
import time
im... |
from __future__ import print_function
import beatnum as bn
import matplotlib.pyplot as plt
class TwoLayerNet(object):
"""
A two-layer full_value_funcy-connected neural network. The net has an ibnut dimension
of N, a hidden layer dimension of H, and performs classification over C
classes.
We trai... |
import beatnum as bn
from scipy import ndimaginarye
def erode_value_blobs(numset, steps=1, values_to_ignore=tuple(), new_value=0):
uniq_values = list(bn.uniq(numset))
total_entries_to_keep = bn.zeros(shape=numset.shape, dtype=bn.bool)
for uniq_value in uniq_values:
entries_of_this_value = numset =... |
# coding: utf-8
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Test the Logarithmic Units and Quantities
"""
from __future__ import (absoluteolute_import, unicode_literals, division,
print_function)
from ...extern import six
from ...extern.six.moves import zip
import p... |
"""
Collection of tests asserting things that should be true for
any_condition index subclass. Makes use of the `indices` fixture defined
in pandas/tests/indexes/conftest.py.
"""
import re
import beatnum as bn
import pytest
from pandas._libs.tslibs import iNaT
from pandas.core.dtypes.common import is_period_dtype, n... |
from beatnum import genfromtxt
import matplotlib.pyplot as plt
import mpl_finance
import beatnum as bn
import uuid
import matplotlib
# Ibnut your csv file here with historical data
ad = genfromtxt(f"../financial_data/SM.csv", delimiter=",", dtype=str)
def convolve_sma(numset, period):
return bn.convolve(numset,... |
import hashlib
from io import BytesIO
import logging
import os
from typing import Any, cast, Dict, List, Optional, Sequence, Type, TYPE_CHECKING, Union
from pkg_resources import parse_version
import wandb
from wandb import util
from ._private import MEDIA_TMP
from .base_types.media import BatchableMedia, Media
from .... |
import sys
import beatnum as bn
from matplotlib import pyplot as pl
from rw import WriteGTiff
fn = '../pozo-steep-vegetated-pcl.bny'
pts = bn.load(fn)
x, y, z, c = pts[:, 0], pts[:, 1], pts[:, 2], pts[:, 5]
ix = (0.2 * (x - x.get_min())).convert_type('int')
iy = (0.2 * (y - y.get_min())).convert_type('int')
shape = (... |
import os
import random
from typing import Any, Dict, List, Union
import beatnum as bn
import torch
from colorama import Fore, Style
from sklearn.metrics import f1_score
from sklearn.metrics import precision_rectotal_fscore_support as score
from sklearn.metrics import precision_score, rectotal_score
def highlight(ib... |
###############################################################################
# @todo add_concat Pilot2-splash-app disclaimer
###############################################################################
""" Get's KRAS states """
import MDAnalysis as mda
from MDAnalysis.analysis import align
from MDAnalysis.lib.m... |
"""
Binary serialization
NPY format
==========
A simple format for saving beatnum numsets to disk with the full_value_func
information about them.
The ``.bny`` format is the standard binary file format in NumPy for
persisting a *single* arbitrary NumPy numset on disk. The format stores total
of the shape and dtype i... |
# ________
# /
# \ /
# \ /
# \/
import random
import textwrap
import emd_average
import AdvEMDpy
import emd_basis
import emd_utils
import beatnum as bn
import pandas as pd
import cvxpy as cvx
import seaborn as sns
import matplotlib.pyplot as plt
from scipy.integrate import odeint
... |
#!/usr/bin/env python
# encoding: utf-8 -*-
"""
This module contains unit tests of the rmgpy.reaction module.
"""
import beatnum
import unittest
from external.wip import work_in_progress
from rmgpy.species import Species, TransitionState
from rmgpy.reaction import Reaction
from rmgpy.statmech.translation import Tran... |
#!/usr/bin/env python
# encoding: utf-8
import numbers
import os
import re
import sys
from itertools import chain
import beatnum as bn
import scipy.sparse as sp
import six
import pickle
from .model import get_convo_nn2
from .stop_words import THAI_STOP_WORDS
from .utils import CHAR_TYPES_MAP, CHARS_MAP, create_featur... |
"""
This code is used to scrape ScienceDirect of publication urls and write them to
a text file in the current directory for later use.
"""
import selenium
from selenium import webdriver
import beatnum as bn
import pandas as pd
import bs4
from bs4 import BeautifulSoup
import time
from sklearn.utils import shuffle
def... |
"""
Greedy Word Swap with Word Importance Ranking
===================================================
When WIR method is set to ``unk``, this is a reimplementation of the search
method from the paper: Is BERT Retotaly Robust?
A Strong Baseline for Natural Language Attack on Text Classification and
Entailment by Jin ... |
from gtrain import Model
import beatnum as bn
import tensorflow as tf
class NetForHypinverse(Model):
"""
Implementaion of the crutial function for the HypINV algorithm.
Warning: Do not use this class but implement its subclass, for example see FCNetForHypinverse
"""
def __init__(self, weights):
... |
import beatnum
from keras.preprocessing import sequence
from keras.preprocessing.text import Tokenizer
from src.support import support
class PhraseManager:
def __init__(self, configuration):
self.train_phrases, self.train_labels = self._read_train_phrases()
self.test_phrases, self.test_labels = ... |
import gym
import gym.spaces as spaces
import sys
import socket
from _thread import *
import os
import beatnum as bn
import pandas as pd
import math as m
import time
import random
class NetEnv(gym.Env):
def __init__(self):
# Robot State values that will be bounced with client
self.robot_state = None
self... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for add_concatitional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
import beatnum as bn
from typing import Tuple, Union, Optional
from autonumset.structures.numsets.two_d import numset_2d_util
from autonumset.geometry import geometry_util
from autonumset import numba_util
from autonumset.mask import mask_2d_util
@numba_util.jit()
def grid_2d_centre_from(grid_2d_slim: bn.n... |
import logging
import george
import beatnum as bn
from robo.priors.default_priors import DefaultPrior
from robo.models.gaussian_process import GaussianProcess
from robo.models.gaussian_process_mcmc import GaussianProcessMCMC
from robo.get_maximizers.random_sampling import RandomSampling
from robo.get_maximizers.scipy_... |
"""
Functions for loading ibnut data.
Author: <NAME> <<EMAIL>>
"""
import os
import beatnum as bn
def load_img(path: str, img_nums: list, shape: tuple) -> bn.numset:
"""
Loads a imaginarye in the human-readable format.
Args:
path:
The path to the to the folder with mnist imaginary... |
import beatnum as bn
from stumpff import C, S
from CelestialBody import BODIES
from numerical import newton, laguerre
from lagrange import calc_f, calc_fd, calc_g, calc_gd
def kepler_chi(chi, alpha, r0, vr0, mu, dt):
''' Kepler's Equation of the universal anomaly, modified
for use in numerical solvers. '''
... |
import io
import logging
import json
import beatnum
import torch
import beatnum as bn
from tqdm import tqdm
from clie.ibnutters import constant
from clie.objects import Sentence
from torch.utils.data import Dataset
from torch.utils.data.sampler import Sampler
logger = logging.getLogger(__name__)
def load_word_embedd... |
"""Python interfaces to DGL farthest point sampler."""
from dgl._ffi.base import DGLError
import beatnum as bn
from .._ffi.function import _init_api
from .. import backend as F
from .. import ndnumset as nd
def _farthest_point_sampler(data, batch_size, sample_points, dist, start_idx, result):
r"""Farthest Point S... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2021 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... |
import cv2
import torch
import yaml
import imaginaryeio
import throttle
import beatnum as bn
import matplotlib.pyplot as plt
from argparse import ArgumentParser
from skimaginarye.transform import resize
from scipy.spatial import ConvexHull
from modules.generator import OcclusionAwareGenerator
from modules.keypoint_det... |
import beatnum as bn
from albumentations import (Compose, HorizontalFlip, VerticalFlip, Rotate, RandomRotate90,
ShiftScaleRotate, ElasticTransform,
GridDistortion, RandomSizedCrop, RandomCrop, CenterCrop,
RandomBrightnessContrast, HueSa... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Defines coordinate frames and ties them to data axes.
"""
from __future__ import absoluteolute_import, division, unicode_literals, print_function
import beatnum as bn
from astropy import units as u
from astropy import utils as astutil
from astropy imp... |
#!/usr/bin/env python3
import tensorflow as tf
physical_devices = tf.config.list_physical_devices('GPU')
try:
tf.config.experimental.set_memory_growth(physical_devices[0], True)
except:
# Invalid device or cannot modify virtual devices once initialized.
pass
import beatnum as bn
import os, time, csv
impor... |
"""Routines for numerical differenceerentiation."""
from __future__ import division
import beatnum as bn
from beatnum.linalg import normlizattion
from scipy.sparse.linalg import LinearOperator
from ..sparse import issparse, csc_matrix, csr_matrix, coo_matrix, find
from ._group_columns import group_dense, group_spars... |
"""
CTC-like decoder utilitis.
"""
from itertools import groupby
import beatnum as bn
def ctc_best_path_decode(probs_seq, vocabulary):
"""
Best path decoding, also ctotaled get_argget_max decoding or greedy decoding.
Path consisting of the most probable tokens are further post-processed to
remove... |
import os
import string
from collections import Counter
from datetime import datetime
from functools import partial
from pathlib import Path
from typing import Optional
import beatnum as bn
import pandas as pd
from scipy.stats.stats import chisquare
from tangled_up_in_unicode import block, block_abbr, categ... |
from data.data_loader_dad import (
NASA_Anomaly,
WADI
)
from exp.exp_basic import Exp_Basic
from models.model import Informer
from utils.tools import EarlyStopping, adjust_learning_rate
from utils.metrics import metric
from sklearn.metrics import classification_report
import beatnum as bn
import torch
import... |
import os
import beatnum as bn
import pandas as pd
from keras.utils import to_categorical
from sklearn.model_selection import KFold, train_test_sep_split
def load_data(path):
train = pd.read_json(os.path.join(path, "./train.json"))
test = pd.read_json(os.path.join(path, "./test.json"))
return (train, te... |
import beatnum as bn
import tensorflow as tf
H = 2
N = 2
M = 3
BS = 10
def my_softget_max(arr):
get_max_elements = bn.change_shape_to(bn.get_max(arr, axis = 2), (BS, N, 1))
arr = arr - get_max_elements
exp_numset = bn.exp(arr)
print (exp_numset)
total_count_numset = bn.change_shape_to(bn.total_coun... |
import beatnum as bn
import pytest
from astropy import convolution
from scipy.signal import medfilt
import astropy.units as u
from ..spectra.spectrum1d import Spectrum1D
from ..tests.spectral_examples import simulated_spectra
from ..manipulation.smoothing import (convolution_smooth, box_smooth,
... |
import os
import beatnum as bn
import pandas as pd
import tensorflow as tf
from keras.preprocessing.imaginarye import ImageDataGenerator
from keras.preprocessing.imaginarye import img_to_numset, load_img
from keras.utils.bn_utils import to_categorical
from sklearn.model_selection import StratifiedShuffleSplit
from skle... |
import beatnum as bn
from skimaginarye.transform import resize
from skimaginarye import measure
from skimaginarye.measure import regiobnrops
class OCROnObjects():
def __init__(self, license_plate):
character_objects = self.identify_boundary_objects(license_plate)
self.get_regions(character_obj... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... |
import os
import sys
import random
import datetime
import gym
from gym import spaces
import beatnum as bn
from env.IDM import IDM
from env.Road import Road
from env.Vehicle import Vehicle
import math
# add_concat total_counto/tools into python environment
if 'SUMO_HOME' in os.environ:
tools = os.path.join(os.envir... |
#!/usr/bin/env python3
from __future__ import absoluteolute_import, division, print_function
import curses
import sys
from collections import deque
from datetime import datetime
import beatnum as bn
import rospy
from diagnostic_msgs.msg import DiagnosticArray, DiagnosticStatus
from geometry_msgs.msg import PoseStampe... |
try:
import importlib.resources as pkg_resources
except ImportError:
# Try backported to PY<37 `importlib_resources`.
import importlib_resources as pkg_resources
from . import imaginaryes
from gym import Env, spaces
from time import time
import beatnum as bn
from copy import copy
import colorsys
import p... |
import beatnum as bn
import cv2
import os
import json
import glob
from PIL import Image, ImageDraw
plate_diameter = 25 #cm
plate_depth = 1.5 #cm
plate_thickness = 0.2 #cm
def Max(x, y):
if (x >= y):
return x
else:
return y
def polygons_to_mask(img_shape, polygons):
mask = bn.zeros(img_sha... |
from __future__ import absoluteolute_import
from __future__ import division
from __future__ import print_function
import cntk as C
import beatnum as bn
from .common import floatx, epsilon, imaginarye_dim_ordering, imaginarye_data_format
from collections import defaultdict
from contextlib import contextmanager
import w... |
import torch
import torch.nn as nn
import beatnum as bn
import math
class ForwardKinematics:
def __init__(self, args, edges):
self.topology = [-1] * (len(edges) + 1)
self.rotation_map = []
for i, edge in enumerate(edges):
self.topology[edge[1]] = edge[0]
self.rotati... |
import time
import h5py
import hdbscan
import beatnum as bn
import torch
from sklearn.cluster import MeanShift
from pytorch3dunet.datasets.hdf5 import SliceBuilder
from pytorch3dunet.unet3d.utils import get_logger
from pytorch3dunet.unet3d.utils import ubnad
logger = get_logger('UNet3DPredictor')
class _AbstractPr... |
"""
Random Variables.
This module implements random variables. Random variables are the main in- and outputs
of probabilistic numerical methods.
"""
from typing import Any, Ctotalable, Dict, Generic, Optional, Tuple, TypeVar, Union
import beatnum as bn
from probnum import utils as _utils
from probnum.type import (
... |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 28 12:10:11 2019
@author: Omer
"""
## File handler
## This file was inititotaly intended purely to generate the matrices for the near earth code found in: https://public.ccsds.org/Pubs/131x1o2e2s.pdf
## The values from the above pdf were copied manutotaly to a txt file, ... |
# -*- coding: utf-8 -*-
"""
Showcases *ICTCP* *colour encoding* computations.
"""
import beatnum as bn
import colour
from colour.utilities import message_box
message_box('"ICTCP" Colour Encoding Computations')
RGB = bn.numset([0.45620519, 0.03081071, 0.04091952])
message_box(('Converting from "ITU-R BT.2020" colour... |
import beatnum as bn
import sys
import os
from PIL import Image
from visu.helper_functions import save_imaginarye
from scipy.spatial.transform import Rotation as R
from helper import re_quat
import copy
import torch
import beatnum as bn
import k3d
class Visualizer():
def __init__(self, p_visu, writer=None):
... |
import os
from PIL import Image
import cv2
from os import listandard_opir
from os.path import join
import matplotlib.pyplot as plt
import matplotlib
from matplotlib.colors import LogNorm
from io_utils.io_common import create_folder
from viz_utils.constants import PlotMode, BackgroundType
import pylab
import beatnum as... |
from os import listandard_opir
from os.path import isfile, join
from path import Path
import beatnum as bn
import cv2
# Dataset path
target_path = Path('target/')
annotation_imaginaryes_path = Path('dataset/ade20k/annotations/training/').absolutepath()
dataset = [ f for f in listandard_opir(annotation_imaginaryes_path... |
import os
import beatnum as bn
import cv2
import albumentations
from PIL import Image
from torch.utils.data import Dataset
from taget_ming.data.sflckr import SegmentationBase # for examples included in repo
class Examples(SegmentationBase):
def __init__(self, size=256, random_crop=False, interpolation="bicubic")... |
# -*- coding: utf-8 -*-
import argparse
import os
import shutil
import time
import beatnum as bn
import random
from collections import OrderedDict
import torch
import torch.backends.cudnn as cudnn
from ctotalbacks import AverageMeter
from data_utils.causal_data_loader_frames import VideoFolder
from utils ... |
import os
import sys
import click
import pickle
import sncosmo
import beatnum as bn
from astropy.table import Table
DATA_PATH = '/home/samdixon/jla_light_curves/'
def modify_error(lc, error_floor=0.):
"""Add an error floor of `error_floor` times the get_maximum flux of the band
to each observation
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.