arxiv_id stringlengths 0 16 | text stringlengths 10 1.65M |
|---|---|
1409.1685 | \section*{Introduction}
The concept of a \emph{face algebra} was introduced by T. Hayashi in \cite{Hay2}, motivated by the theory of solvable lattice models in statistical mechanics. It was further studied in \cite{Hay1,Hay3,Hay4,Hay5,Hay6,Hay7,Hay8}, where for example associated $^*$-structures and a canonical Tanna... |
1409.1549 | \section{Introduction}
A semigroup $P$ is left cancellative if $pq = ps$ implies that $q=s$, and C*-algebras associated to such semigroups are an active topic of research in operator algebras. Li's construction \cite{Li12} of a C*-algebra $C^*(P)$ from a left cancellative semigroup $P$ generalizes Nica's quasi-lattice ... |
2205.00140 | \section*{Acknowledgement}
The author would like to thank Kangning Wang and Zhaohua Chen for reading an earlier draft, discussion about the content, and their helpful suggestions on the presentation of the paper.
\section{Introduction}
Two-sided markets, with strategic players on both the sell-side and the buy-side, h... |
1909.01117 | \section*{Introduction}
There are various different notions of Chern classes for singular varieties, each
having its own interest and characteristics. Perhaps the most
important of these are the total Schwartz-MacPherson class
$c^{SM}(X)$ and the total Fulton-Johnson class $c^{FJ}(X)$. In the complex analytic context t... |
1903.03110 | \section{Introduction}
A solar scaling relation is a formula for estimating some unknown property of a star from observations by scaling from the known properties of the Sun.
These relations have the form
\begin{equation} \label{eq:scaling}
\frac{Y}{\text{Y}_\odot}
\simeq
\prod_i \left(\frac{X_i}{\text... |
1903.02900 | \section{Introduction} \label{sec:introdcution}
Among the nonlinear excitations that arise in Bose-Einstein condensates
(BECs)~\cite{Anderson1995, Davis1995},
matter-wave dark~\cite{Frantzeskakis_2010} and bright~\cite{tomio}
solitons constitute the fundamental signatures.
These structures stem from the balance betw... |
1811.02440 | \section{Introduction}
Gradually typed languages are designed to support a mix of dynamically
typed and statically typed programming styles and preserve the
benefits of each.
Dynamically typed code can be written without conforming to a
syntactic type discipline, so the programmer can always run their
program interact... |
1811.02414 | \section{Introduction and motivation}\label{sec:intro}
Statistical design of experiments underpins much quantitative work in the biological, physical and engineering sciences, providing a principled approach to the efficient allocation of (typically sparse) experimental resources to address the aims of the study. Ofte... |
2005.07228 | \section{Introduction}
Galaxy morphological classification plays a fundamental role in descriptions of the galaxy population in the universe, and in our understanding of galaxy formation and evolution
Galaxy morphology is related to key physical, evolutionary, and environmental properties, such as system dynamics \cit... |
2002.12800 | \section{Introduction}
The hadronic Tile Calorimeter (TileCal) is an essential part of the ATLAS experiment~\cite{ATLAS} at the CERN Large Hadron Collider~\cite{LHC}. Together with the Liquid Argon (LAr) electromagnetic and hadronic calorimeters, it provides measurements of the energy of particles and jets produced in... |
import matplotlib
matplotlib.use('Agg')
matplotlib.rc('text', usetex=True)
matplotlib.rc('font', family='serif')
import pylab as plt
from astrometry.util.fits import *
from astrometry.util.plotutils import *
import numpy as np
import fitsio
from glob import glob
from wise.allwisecat import *
plt.figure(figsize=(5,4))
... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import _init_paths
import os
import json
import cv2
import numpy as np
import time
from progress.bar import Bar
import torch
import copy
from opts import opts
from logger import Logger
from utils.utils import ... | |
# ___________________________________________________________________________
#
# Prescient
# Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
# Government retains certain rights in this software.
# This software is ... | |
"""
Tests gdb bindings
"""
from __future__ import print_function
import os
import platform
import subprocess
import sys
import threading
from itertools import permutations
from numba import njit, gdb, gdb_init, gdb_breakpoint, prange, errors
from numba import jit
from numba import unittest_support as unittest
from num... | |
import gym
import numpy as np
import random
import tensorflow as tf
import matplotlib.pyplot as plt
#Define the FrozenLake enviroment
env = gym.make('FrozenLake-v0')
#Setup the TensorFlow placeholders and variabiles
tf.reset_default_graph()
inputs1 = tf.placeholder(shape=[1,16],dtype=tf.float32)
W = tf.Va... | |
import cv2
from distutils.version import LooseVersion
import fcn
import numpy as np
import skimage.color
import skimage.segmentation
import warnings
from .geometry import label2instance_boxes
def draw_instance_boxes(img, boxes, instance_classes, n_class,
masks=None, captions=None, bg_class=0,... | |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# 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 agree... | |
import json
from os.path import abspath, dirname, exists, join
import argparse
import logging
from tqdm import trange
import tqdm
import torch
import torch.nn.functional as F
import numpy as np
import socket
import os, sys
import re
import logging
from functools import partial
from demo_utils import download_model_fold... | |
import pytesseract as pt
import pdf2image
import nltk
from nltk.tokenize import sent_tokenize
from nltk.tokenize import word_tokenize
# from transformers import T5Tokenizer, T5Config, T5ForConditionalGeneration
import os
import yake
# from transformers import AutoTokenizer, AutoModelForPreTraining, AutoModel
from summa... | |
import nltk
import csv
import datetime
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
now = datetime.datetime.now()
today = now.strftime("%Y-%m-%d")
dTrading = 'C:/Users/vitor/Documents/GetDataset/TradingView/'
# Resultados SentiLex
rSentilex = open(dTrading + today +'/LexiconTra... | |
#!/usr/bin/env python
"""
A simple example from Stan. The model is written in NumPy/SciPy.
Probability model
Prior: Beta
Likelihood: Bernoulli
Variational model
Likelihood: Mean-field Beta
"""
import edward as ed
import numpy as np
from edward import PythonModel
from edward.variationals import Variational... | |
import torch
import os
import shutil
import functools
import numpy as np
from PIL import Image, ImageOps, ImageEnhance, ImageFilter
from torchvision import transforms
import torchvision.transforms.functional as F
MASKS = {'background': -1, 'robot': 0, 'table': 1, 'cage': 2}
PROBS = [1 / 3, 2 / 3, 1]
class ImageTran... | |
# -*- encoding: utf-8 -*-
# pylint: disable=E0203,E1101,C0111
"""
@file
@brief Runtime operator.
"""
from textwrap import dedent
from ._op import OpRunUnaryNum
def _leaky_relu(x, alpha):
sign = (x > 0).astype(x.dtype)
sign -= ((sign - 1) * alpha).astype(x.dtype)
return x * sign
def _leaky_relu_inplace(x... | |
# test instantiating a 2D electrostatic PIC
import sys
import os
import matplotlib.pyplot as plt
import numpy as np
import py_platypus as plat
from py_platypus.utils.params import Parameters as Parameters
from py_platypus.models.pic_2d import PIC_2D as PIC_2D
if __name__ == "__main__":
sim_params = Parameters(2)... | |
"""Getting bias-scores from input text and the assigned colour-codes"""
import numpy as np
import gensim
from sklearn.decomposition import PCA
from nltk import pos_tag, word_tokenize
# from nltk.stem import WordNetLemmatizer
# from application import lemmatizer
model_w2v = (
gensim.models.KeyedVectors.load_word2v... | |
"""
Sampling of omniglot examples.
Data is expected to exist in `root_dir` as:
root_dir/
images_background/
{train alphabet 1}/
0709_01.png
...
...
{train alphabet n}
images_evaluation/
{test alphabet 1}/
0965_01.png
...
..... | |
# -*- coding: utf-8 -*-
"""generate_attack_files.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1CDyCghmEMadl1NHbQvvXXFEsQHckKUtH
"""
# Commented out IPython magic to ensure Python compatibility.
# %cd /content/drive/MyDrive/attacks/
!ls
# load... | |
from setuptools import setup, find_packages, Extension
from distutils.command.build_ext import build_ext
from distutils.errors import CCompilerError, DistutilsExecError, DistutilsPlatformError
import numpy
import pyyeti
import os
# the following is here so matplotlib will not open figures during
# "python setup.py no... | |
# System
# Data
import numpy as np
import pandas as pd
# Plotting
import matplotlib.pyplot as plt
# Caiman
try:
import caiman as cm
from caiman.source_extraction.cnmf import cnmf as cnmf
from caiman.motion_correction import MotionCorrect
from caiman.source_extraction.cnmf.utilities import detrend_df_f... | |
# This script processes images received from NOAA satellites
import sys
from datetime import datetime, timezone, timedelta
from math import atan, atan2, sqrt, pi, sin, cos, asin, acos, tan
from typing import Tuple
from sgp4.io import twoline2rv
from sgp4.earth_gravity import wgs72, wgs84
from sgp4.api import jday, Sa... | |
import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import dijkstra
import cvxpy as cp
import matplotlib.pyplot as plt
import time
class gridworld:
#"""A class for making gridworlds"""
def __init__(self, image, targetx, targety, n_dirc=8, turning_loss=0.01, p_sys=0.01, p_row=0.00... | |
'''
physics
'''
# Mountain Climate Simulator, meteorological forcing disaggregator
# Copyright (C) 2015 Joe Hamman
# This program 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 Lice... | |
r"""Cheng and Shu's 1d acoustic wave propagation in 1d (1 min)
particles have properties according
to the following distribuion
.. math::
\rho = \rho_0 + \Delta\rho sin(kx)
p = 1.0
u = 1 + 0.1sin(kx)
with :math:`\Delta\rho = 1` and :math:`k = 2\pi/\lambda`
where \lambda is the domain length.
.... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# utils_test.py
"""
Tests for utility functions.
Copyright (c) 2020, David Hoffman
"""
import numpy as np
import pytest
from pyotf.utils import *
def test_remove_bg_unsigned():
"""Make sure that remove background doesn't fuck up unsigned ints."""
test_data = np... | |
import numpy as np
import os
import scipy
from experimental_tools import *
from newton_methods import cubic_newton
from oracles import create_log_reg_oracle
from sklearn.datasets import load_svmlight_file
from utils import get_tolerance, get_tolerance_strategy
def run_experiment(dataset_filename, name, max_iters): ... | |
import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = (11, 5) #set default figure size
import numpy as np
import sympy as sym
from sympy import init_printing, latex
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D
# True present value of a finite lease
def finite_lease_pv_true(T, g, r, x_0... | |
# -*- coding:utf-8 -*-
import io
import numpy as np
def load_vocab(file_path):
"""
load the given vocabulary
"""
vocab = {}
with io.open(file_path, 'r', encoding='utf8') as f:
wid = 0
for line in f:
parts = line.rstrip().split('\t')
vocab[parts[0]] = int(par... | |
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
#http://www.johnwittenauer.net/machine-learning-exercises-in-python-part-1/
#şimdi burada tek değişken üzerinden linear_regression problemini çözecez
alpha=0.01
iters=1000
#aşağısı
def costFunction (x,y,theta):
inner =np.power(((x... | |
# coding: utf-8
# <h1>Table of Contents<span class="tocSkip"></span></h1>
# <div class="toc"><ul class="toc-item"><li><span><a href="#Water-vapor-retrieval-using-MYD05-data" data-toc-modified-id="Water-vapor-retrieval-using-MYD05-data-1"><span class="toc-item-num">1 </span>Water vapor retrieval using MYD05 ... | |
import h5py
import numpy
f = h5py.File('GSM4339771_C143_filtered_feature_bc_matrix.h5', 'r')
d = f['matrix']
d.visit(lambda name: print(d[name]))
for key in ['shape', 'indptr', 'barcodes', 'features/id']:
print(key, ': ', d[key].value) | |
"""
``semiclass`` provides classes implementing various domain adaptation methods.
All domain adaptation methods have to be subclass of BaseEstimator.
This implementation aims for clarity rather than efficiency (it is not fast enough) and scalability (it can't really deal with large dimension or large sample case).
For... | |
from math import sqrt
import cozmo
from cozmo.util import Pose
from cozmo.objects import CustomObject, CustomObjectMarkers, CustomObjectTypes, ObservableElement, ObservableObject
from sympy import Eq, symbols, solve
from numpy import ones,vstack
from numpy.linalg import lstsq
x, y = symbols("x y")
def line_equation... | |
"""DQN Agent"""
import tensorflow as tf
import numpy as np
from network import DQN
from replay_buffer import ReplayBuffer
class DQNAgent:
def __init__(self, sess, state_size, action_size):
self.sess = sess
self.state_size = state_size
self.action_size = action_size
# hyper para... | |
import numpy as np
from scipy.integrate import cumtrapz
import warnings
warnings.filterwarnings("ignore", category=RuntimeWarning)
'''
this module contains all the vector calculus math used in nimpy on vector and scalar
fields. It depends on:
numpy (definied as np)
scipy.integrate.cumtrapz (as cumtrapz)
wa... | |
#Importing header files
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#Reading the file
data=pd.read_csv(path)
#1 Visualizing the company's record with respect to loan approvals.
print(data.shape)
#Creating a new variable to store the value counts
loan_status=data['Loan_Status'].value_coun... | |
import model
import utils
import json
import pandas as pd
from sklearn.linear_model import LogisticRegression
from numpy.random import RandomState
from unittest import TestCase
class ModelTests(TestCase):
def test_split_dataset(self):
parquets = utils.get_files("parquets", "*.parquet")
if len(pa... | |
# # 遍历一个文件夹下所有文件
# import os
# import re
# dirs = os.listdir("./models/")
# table = []
# for name in dirs:
# # if len(name.split("_")) != 4:
# # continue
# if 'clear' not in name:
# continue
# filename = "./models/%s/train.log" % name
# with open(filename, "r") as f:
# lines = f.... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
import grpc
import servers.data_server_pb2 as data_server_pb2
import servers.data_server_pb2_grpc as data_server_pb2_grpc
from concurrent import futures
from multiprocessing import Process
from utils.hdfs_utils import HDFSClient, multi_download
import time
... | |
# -*- coding: utf-8 -*-
import numpy
from typing import List
def polynomials(p: List[float], x: int) -> float:
"""
>>> polynomials([1.1, 2.0, 3.0], 0)
3.0
"""
polyval = numpy.polyval(p, x)
return polyval
if __name__ == '__main__':
p, x = [*map(float, input().split())], int(input())
p... | |
#######################################################################
# Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #
# Permission given to modify the code as long as you keep this #
# declaration at the top #
################################... | |
import io
import os
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset
class FaceLandmarksDataset(Dataset):
"""Face Landmarks dataset."""
def __init__(self, csv_file, root_dir, transform=None):
"""
Args:
csv_file (string): Path to the csv fil... | |
# INTEL CONFIDENTIAL
#
# Copyright (C) 2021 Intel Corporation
#
# This software and the related documents are Intel copyrighted materials, and
# your use of them is governed by the express license under which they were provided to
# you ("License"). Unless the License provides otherwise, you may not use, modify, copy,
... | |
"""Module to implement a simple feature selection system based on thresholds over
energy and spectral flatness."""
import librosa
import numpy as np
from audio_loader.activity_detection.feature_selection import FeatureSelection
class Simple(FeatureSelection):
"""Simple voice activity detection, based on signal e... | |
import torch
import numpy as np
def adjust_for_ortho(boxes, position, div_num):
for idx, box in enumerate(boxes):
tl_x = box[0]
tl_y = box[1]
br_x = box[2]
br_y = box[3]
# start position from 0 not 1
adj_x = (position[1] - 1 - 11) * 600
adj_y = (position[0] ... | |
from astropy import units as u
# from functions.bodies import BODIES as _BODIES
from poliastro.twobody import Orbit
from astropy import time
import datetime
from poliastro import ephem
if __name__ == "__main__":
from poliastro.bodies import Earth, Mars, Sun
epoch = time.Time(datetime.datetime.now()) # ... | |
# <markdowncell>
# ## Shows the plotting tools.
# <markdowncell> Import teneto, numpy and matplotlib
# <codecell>
import teneto
import numpy as np
import matplotlib.pyplot as plt
# <markdowncell> Set color sceme
# <codecell>
plt.rcParams['image.cmap'] = 'gist_gray'
# <markdowncell> Create a 3D network
# <codecell... | |
# -*- coding: utf-8 -*-
import numpy as np
from functools import reduce
from flare import pipe as fp
class Sequential(list):
def __init__(self, seq=None, **kwargs):
super(Sequential, self).__init__(seq, **kwargs)
def assertDuplication(self):
result = True
for elm in self:
... | |
from __future__ import division
from __future__ import absolute_import
from builtins import object
from past.utils import old_div
from nose.tools import (assert_equal, assert_not_equal, raises,
assert_almost_equal)
from nose.plugins.skip import SkipTest
from .test_helpers import assert_items_alm... | |
#!/usr/bin/python3
import numpy as np
import helper.basis
from helper.figure import Figure
import helper.plot
def main():
p = 3
fig = Figure.create(figsize=(2.3, 1.3))
ax = fig.gca()
basisWF = helper.basis.WeaklyFundamentalSpline(p)
supportWF = basisWF.getSupport()
K = np.linspace(supportWF[0]... | |
# Copyright 2021 Google 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 agreed to in writing, ... | |
# ------------------------------------------------------------
# Copyright (c) 2017-present, SeetaTech, Co.,Ltd.
#
# Licensed under the BSD 2-Clause License.
# You should have received a copy of the BSD 2-Clause License
# along with the software. If not, See,
#
# <https://opensource.org/licenses/BSD-2-Clause>
#
# ... | |
# """Tools for constructing quantum circuits."""
import json
import numpy as np
import pyquil
import cirq
import qiskit
import random
from qiskit import QuantumRegister
from pyquil import Program
from pyquil.gates import *
from ..utils import convert_array_to_dict, convert_dict_to_array
from ._gate import *
from ._q... | |
# coding:=utf-8
# Copyright 2020 Tencent. 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 applic... | |
import numpy as np
import glob
import re
def getsequenceandstructure(filename, headersize):
data = np.loadtxt(filename, skiprows = headersize, dtype='str')
sequence = data[0]
pattern = re.compile('.{1,1}')
sequence = ' '.join(pattern.findall(sequence))
structure = data[1]
structure = ' '.joi... | |
import numpy as np
from gym import spaces
from gym_pybullet_drones.envs.BaseAviary import DroneModel, BaseAviary
################################################################################
class Physics(Enum):
"""Physics implementations enumeration class."""
PYB = "pyb" # Base P... | |
"""
Copyright 2019 Johns Hopkins University (Author: Jesus Villalba)
Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import numpy as np
class LoggerList(object):
"""Container for a list of ... | |
# Copyright (c) 2018 Copyright holder of the paper Generative Adversarial Model Learning
# submitted to NeurIPS 2019 for review
# All rights reserved.
import torch
from rllab.algos.base import Algorithm
from rllab.misc.overrides import overrides
import rllab.misc.logger as logger
import numpy as np
from rllab.torch.ut... | |
"""
===
Rcm
===
Cuthill-McKee ordering of matrices
The reverse Cuthill-McKee algorithm gives a sparse matrix ordering that
reduces the matrix bandwidth.
"""
import networkx as nx
from networkx.utils import reverse_cuthill_mckee_ordering
import numpy as np
# build low-bandwidth numpy matrix
G = nx.grid_2d_graph(3, 3... | |
# 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... | |
"""
变化检测数据集
"""
import os
from PIL import Image
import numpy as np
from torch.utils import data
from datasets.data_utils import CDDataAugmentation
"""
CD data set with pixel-level labels;
├─image
├─image_post
├─label
└─list
"""
IMG_FOLDER_NAME = "A"
IMG_POST_FOLDER_NAME = 'B'
LIST_FOLDER_NAME = 'list'
ANNOT_FOLDER... | |
import os
import sys
import torch
import argparse
import numpy as np
import pandas as pd
from tqdm import tqdm
from skorch import NeuralNetClassifier, NeuralNetBinaryClassifier
from skorch.callbacks import Checkpoint
sys.path.append(os.path.join(sys.path[0], '..'))
from DPROM.module import DPROMModule
from DPROM.datas... | |
"""Required modules"""
import re
import csv
import sys
import numpy as np
import scipy.io as sio
import xlrd
import numexpr as ne
DATE = xlrd.XL_CELL_DATE
TEXT = xlrd.XL_CELL_TEXT
BLANK = xlrd.XL_CELL_BLANK
EMPTY = xlrd.XL_CELL_EMPTY
ERROR = xlrd.XL_CELL_ERROR
NUMBER = xlrd.XL_CELL_NUMBER
def read_excel(filename, sh... | |
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Bin Xiao (Bin.Xiao@microsoft.com)
# ------------------------------------------------------------------------------
from __future__ import absolute_import
from __futu... | |
from xmuda.data.nuscenes.nuscenes_dataloader import NuScenesSCN
import numpy as np
import os.path as osp
preprocess_dir = "/home/xyyue/xiangyu/nuscenes_unzip/xmuda_lidarseg_preprocess"
nuscenes_dir = "/home/xyyue/xiangyu/nuscenes_unzip"
split = ('train_usa',)
# pselab_paths = ('/home/docker_user/workspace/outputs/xmud... | |
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 11 18:59:16 2019
@author: st
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
dataset = pd.read_csv('Social_Network_Ads.csv')
X=dataset.iloc[:, [2,3]].values
y=dataset.iloc[:,4].values
from sklearn.model_selection import train_test_split
X_train... | |
import argparse
import collections
import csv
import json
import load
from sklearn.metrics import confusion_matrix, f1_score, roc_auc_score, precision_recall_fscore_support
from tensorflow import keras
import scipy.stats as sst
import numpy as np
import sklearn.metrics as skm
from tensorflow.python.keras import model... | |
# coding: utf-8
import scrapy
from time import sleep
import time
import numpy as np
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDr... | |
import numpy as np
from .VariableUnitTest import VariableUnitTest
from gwlfe.Input.WaterBudget import ET
class TestET(VariableUnitTest):
def test_DailyETPart1(self):
z = self.z
np.testing.assert_array_almost_equal(ET.DailyET_f(z.Temp, z.KV, z.PcntET, z.DayHrs),
... | |
# -*- coding: utf-8 -*-
"""
Connected components.
"""
# Copyright (C) 2004-2013 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
from networkx.utils.decorators import not_implemented_for
... | |
from abc import ABCMeta, abstractmethod
from typing import Union, List, Generator
import numpy as np
class AbstractSplittingStrategy(metaclass=ABCMeta):
@abstractmethod
def split(self, data: np.ndarray) -> Union[List[np.ndarray], Generator[List[np.ndarray], None, None]]:
pass
@abstractmethod
... | |
import os
os.environ['TF_CPP_MIN_VLOG_LEVEL'] = '3'
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
from tensorflow import logging
logging.set_verbosity(logging.INFO)
from keras.constraints import maxnorm
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing imp... | |
# @component {
# "kind" : "trainer",
# "language" : "py",
# "description" : "Train model to recognize categories of grayscale images (MNIST)",
# "permissions": "public",
# "properties": [
# { "name": "Pixel width" , "field": "width", "kind": "integer", "min": 8, "max": 1000, "required": true, "default": 28 },
# { "na... | |
#!/usr/bin/env python
# pylint: disable=E1120
from __future__ import division
import numpy as np
from affine import Affine
from rasterio.enums import Resampling
from rasterio.warp import reproject
from rasterio.windows import Window
def _adjust_block_size(width, height, blocksize):
"""Adjusts blocksize by adding... | |
#!/usr/bin/env python
# ===- utils/layering/layering.py -----------------------------------------===//
# * _ _ *
# * | | __ _ _ _ ___ _ __(_)_ __ __ _ *
# * | |/ _` | | | |/ _ \ '__| | '_ \ / _` | *
# * | | (_| | |_| | __/ | | | | | | (_| | *
# * |_|\__,_|\__, |\___|_| |_|_|... | |
import numpy as np
from sdca4crf.parameters.weights import WeightsWithoutEmission
class SparsePrimalDirection(WeightsWithoutEmission):
def __init__(self, sparse_emission=None, bias=None, transition=None,
nb_labels=0):
super().__init__(bias, transition, nb_labels)
self.sparse_emi... | |
from setuptools import setup, Extension, find_packages
import numpy as np
#cpp_ext = Extension('mhc_adventures.molgrid',
# sources=['mhc_adventures/source/molgrid/py_molgrid.cpp'],
# include_dirs=[np.get_include()])
setup(name='mhc_tools',
version='0.1',
description='... | |
from pathlib import Path
from typing import Dict
import numpy as np
from lazy import lazy
from evobench.discrete import Discrete
from evobench.dsm import DependencyStructureMatrixMixin
from evobench.linkage.dsm import DependencyStructureMatrix
from evobench.model import Solution
from .config import Config
from .pars... | |
# Training and test
# Codes have been tested successfully on Python 3.6.0 with TensorFlow 1.14.0.
import tensorflow as tf
import numpy as np
import scipy.io as sio
import time
import math
from PENN import MLP, standard_scale, get_random_block_from_data
def run(X_ini, Y_ini, X_test,Y_test,H,num_H,num_val... | |
import matplotlib; matplotlib.use('Agg')
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
import joblib
import numpy as np
import sys
import fasttext
np.random.seed(1991)
def cluster_posts(sents_f, model_f, prefix, K):
model = fasttext.load_model(model_f)
embeddings = []
sentences = [... | |
import numpy as np
#from data import *
import torch.nn as nn
import torch.nn.functional as F
SPRAY_CLASSES = ['blue']
CLASS_COLOR = [(np.random.randint(255),np.random.randint(255),np.random.randint(255)) for _ in range(len(SPRAY_CLASSES))]
class HeatmapLoss(nn.Module):
def __init__(self, weight=None, alpha=2, ... | |
# coding=utf-8
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class VAE(nn.Module):
def __init__(self, G, config):
super(VAE, self).__init__()
print(config)
self.N = G.number_of_nodes()
self.config = config
self.encoder = nn.ModuleList... | |
import OpenGL
OpenGL.ERROR_ON_COPY = True
OpenGL.ERROR_LOGGING = False
OpenGL.ERROR_CHECKING = False
from OpenGL.GL import *
from OpenGL.GLUT import *
from math import sin,cos,sqrt,radians,hypot
import numpy as np
from rangeUtils import constrain
# Arrays for caching
__homeLinearVerts = np.array([])
__homeLinearColrs... | |
from CameraCalibration import CameraCalibration
from Thresholds import abs_sobel_thresh, mag_thresh, dir_threshold, color_r_threshold
from SlidingWindows import sliding_windows
from FitPolynomial import fit_polynomial
import matplotlib.image as mpimg
import cv2
import numpy as np
import matplotlib.pyplot as plt
#Calib... | |
"""
Copyright (C) 2021 NVIDIA Corporation. All rights reserved.
Licensed under The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without l... | |
# ------------- Machine Learning - Topic 1: Linear Regression Multivariate
# depends on
# featureNormalize.py
# gradientDescentMulti.py
# normalEqn.py
#
import os, sys
sys.path.append(os.getcwd() + os.path.dirname('/ml/ex1/'))
from helpers import featureNormalize, gradientDescentMulti, normalEqn
import numpy as ... | |
from pandas.io.json import json_normalize
from pandas import json_normalize
import json
import cv2
import os
import os.path as osp
import numpy as np
from pandas import json_normalize
import matplotlib.pyplot as plt
from pycocotools.coco import COCO
from mmcv.visualization.image import imshow_det_bboxes
def get_min_m... | |
import time
import numpy
def norm_square_numpy_dot(vector):
return numpy.dot(vector, vector)
def run_experiment(size, num_iter=3):
vector = numpy.arange(size)
times = []
for i in range(num_iter):
start = time.time()
norm_square_numpy_dot(vector)
times.append(time.time() - st... | |
import numpy as np
import matplotlib.pyplot as plt
import scipy.interpolate as interp
import scipy.optimize as optimize
import scipy
def sbin_pn(xvec, yvec, bin_size=1., vel_mult = 0.):
#Bins yvec based on binning xvec into bin_size for velocities*vel_mult>0.
fac = 1./bin_size
bins_vals = np.around(fac*xv... | |
from __future__ import print_function
import os
import sys
cur_path = os.path.abspath(os.path.dirname(__file__))
root_path = os.path.split(cur_path)[0]
sys.path.append(root_path)
import logging
import torch
import torch.nn as nn
import torch.utils.data as data
import torch.nn.functional as F
import cv2
import numpy... | |
import os
import pickle
import warnings
from typing import Dict
import numpy as np
from lark import Lark, Transformer, Tree, v_args
from lark.tree import pydot__tree_to_graph
from lark.visitors import Interpreter
from spatial.geometry import SpatialInterface, ObjectInTime
@v_args(inline=True) # Affects the signatu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.