arxiv_id
stringlengths
0
16
text
stringlengths
10
1.65M
planet-mitchell-0.1.0: Planet Mitchell Text Synopsis # Text data Text # A space efficient, packed, unboxed Unicode text type. Instances Instance detailsDefined in Data.Hashable.Class MethodshashWithSalt :: Int -> Text -> Int #hash :: Text -> Int # Instance detailsDefined in Data.Aeson.Types.ToJSON MethodstoJSON ...
# How to evaluate the second argument of Cases only once I'd like to find a fast but readable way to achieve the following: Cases[RandomInteger[{AbsoluteTime["2001"], AbsoluteTime["2003"]}, 1000], a_ /; a > AbsoluteTime["2002"]] The correct result can be achieved much faster using with: With[{d = AbsoluteTime["200...
# Using the Fisher linear discriminant for separating non-linearly separable data After learning the Fisher linear discriminant in class and its ability to project data into one dimension so that it can be separated by a threshold, I wanted to evaluate it using non linearly separable data and to observe visually its p...
# American Institute of Mathematical Sciences July  2018, 17(4): 1561-1572. doi: 10.3934/cpaa.2018074 ## On special regularity properties of solutions of the Zakharov-Kuznetsov equation 1 IMPA, Estrada Dona Castorina 110, Rio de Janeiro 22460-320, Brazil 2 Department of Mathematics, University of California, Santa ...
# What am I? 'Tis the season of mutual puzzling I'm born when one is over the treasure spot, I'm used when you drive to buy a present, I'm born in the spirit of mutual gift-giving, Yet I'm literally a super negative one. Kinda short, so might be open to interpretation, but I assure you your efforts in solving this ri...
# How do you draw the electron configuration diagram for Aluminum? ##### 1 Answer The electron configuration for aluminum is: $1 {s}^{2} 2 {s}^{2} 2 {p}^{6} 3 {s}^{2} 3 {p}^{1}$ #### Explanation: To figure out the electron configuration of any element you will use the diagonal diagram (seen in the right side of vid...
Python Programming – Class In this Page, We are Providing Python Programming – Class. Students can visit for more Detail and Explanation of Python Handwritten Notes Pdf. Python Programming – Class Class A class is the particular object type created by executing a class statement. Class objects are used as templates...
# Avoid Meetingbird and Front (frontapp.com) products This blog is far from viral, but it has a couple of thousands of views a month and likely a lot of the visitors could be interested in products by https://frontapp.com/ . I want to argue against that, as I don't think they can be trusted anymore. Just a few month...
# How to show non-convexity of the geometrical motivated SVM Optimization Problem Geometrically the SVM tries to classify each data point rightly, while maximize the margin $\gamma$. In the linear seperable case this can be formulated as \begin{align} \max_{\gamma,b \in \mathbb{R}, w \in \mathbb{R}^d} \gamma \ \ \text...
I'm an EE from USC with mostly a software career. My hobbies of robotics and mechatronics have kept my EE skills reasonably sharp. My current role is architecting software for SDRs so I get to get DSP too! ## Re: SDR/DSP Question I am going to echo everyone else's suggestion that you avoid using the TMS320C6713. Unle...
G Then the traction vector on the plane is given by, The magnitude of the traction vector is given by, Then the magnitude of the stress normal to the plane is given by, The magnitude of the resolved shear stress on the plane is given by, If the principal stresses {\displaystyle G(\phi ,\theta )} Essentially, the angle ...
Plate 18 Figure 17 The contents of these clamps are then ligated with 00 silk sutures. Downward traction is maintained on the esophagus while it is further freed from the surrounding structures by blunt dissection with the index finger. The vagus nerves are not always easily identified, but their location is more quic...
# Build my own mass spectrometer? 1. Aug 4, 2006 ### leright I am a double major in EE and physics and I was thinking that a great senior project would be to design and build my own mass spectrometer. I would not only like to build the basic device, but also calibrate the device so that it provides the m/q value bas...
Noticeboard archives ## User talk:70.173.50.153 Take a look at this page and tell me what you think. Looks like the user removed some templates back on the 10 november and received vandalism warnings for it. It doesn't look like vandalism to me, certainly not simple vandalism that requires a template. Possible test e...
Hilbert-Schmidt and compact operators I am new to this site and i dont really know how to ask questions properly, so i am really sorry if i did something wrong. My question is if there is a way to prove that a Hilbert-Schmidt operator is compact from the definition of compact operators. I can prove the result by not...
# How does ML algorithms treat unseen data, a conceptual discussion I want to predict the occurrence of certain events, but these events only occur say 5% of the time in my data, hence in 95% of the data there is nothing to learn. In order to teach the ML algo something I have learned to single out the 5% and drop th...
# Why aren't Faraday's law of induction and Maxwell-Ampere's law symmetric? [duplicate] I don't see Faraday's law of induction and Maxwell-Ampere's law are totally symmetric in the sense that Maxwell-Ampere's law has a factor of $ϵ_0μ_0$: \begin{align} \nabla\times\mathbf E&=-\frac{\partial\mathbf B}{\partial t} \\ \n...
# List NTFS Permissions on all Folders In this guide, I’ll show you how to list the NTFS permissions for all folders and subfolders. I’ll also show you how to export the NTFS permissions to a CSV file. Check it out. ## Option 1: List and Export NTFS Permissions using GUI Tool. For this first option, I’ll be using ...
Help protect the Great Barrier Reef with TensorFlow on Kaggle # tf.math.unsorted_segment_prod Computes the product along segments of a tensor. Read the section on segmentation for an explanation of segments. This operator is similar to the unsorted segment sum operator found (here). Instead of computing the sum ove...
lilypond-user [Top][All Lists] ## Re: Organization of the piese part by part, not staff by staff From: Mats Bengtsson Subject: Re: Organization of the piese part by part, not staff by staff Date: Fri, 11 Jan 2019 09:13:47 +0100 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 ...
# NCERT solution for class 9 science natural resources ( Chapter 14) #### Solution for Exercise Questions 1. Why is the atmosphere essential for life? The atmosphere is essential for life because of the following reasons: 1. The atmosphere constitutes of various main gases like O2, N2, and CO2 2. Photosynthesis is...
# Skipping Bases $\large 123_4 \qquad 123_5 \qquad 123_6$ The above shows three numbers, each written in a different base representation. Which of these numbers has the largest value? ×
+1.617.933.5480 +1.866.649.0192 # Q: Assume X is normally distributed Assume X is normally distributed with a mean of 5 and a standard deviation of 4. Determine the value for x that solves each of the following: (a) P(X > x) = 0.5 (b) P(X > x) = 0.95 (c) P(x < x="">< 9)="0.2"> (d) P(3 < x="">< x)=""> (e) P(-x < x="">...
Can you remove a factor from your model if it has a significant effect, but the removal improves AIC and R square? I have a complex problem but the title sums it up pretty easily. I have four types of cages that manipulate water flow, but I also have an actual measure of water flow from inside the cages. I'm wonderin...
# Tag Info 19 These are all good questions. Perhaps I can answer a few of them at once. The equation describing the violation of current conservation is $$\partial^\mu j_\mu=f(g)\epsilon^{\mu\nu\rho\sigma}F_{\mu\nu}F_{\rho\sigma}$$ where $f(g)$ is some function of the coupling constant $g$. It is not possible to writ...
GR 8677927796770177 | # Login | Register GR9677 #64 Problem GREPhysics.NET Official Solution Alternate Solutions This problem is still being typed. Advanced Topics$\Rightarrow$}Nuclear Physics In symmetric fission, the change in kinetic energy is just the change in binding energy. The change in binding energy for a ...
# Predicted probabilities from probit Assume following probit model: $y_i$ = $\phi$($\beta_0$+$\beta_1x_1$+$\beta_2x_1^2$+$\beta_3d_1$+$\beta_4d_2$) where $d_1$ and $d_2$ are dummies or in Stata: probit y_i x1 xsq d1 d2 Now I want to predict the probabilities $P(\hat{y_i} = 1)$ for each observation x. This seems ...
# Calculating Missing Amounts Required: For each of the following independent cases (A–E), compute... Calculating Missing Amounts Required: For each of the following independent cases (A–E), compute the missing values in the table below.
Python: Deep and Shallow Copy Object # Python: Deep and Shallow Copy Object ### Introduction In this article, we'll take a look at how to deep and shallow copy the objects in Python. The short answer is that you can use methods of the copy module, for both operations: import copy shallow_copy_list = copy.copy(ori...
import itertools import numpy as np from qubo_nn.problems.subgraph_isomorphism import SubGraphIsomorphism from qubo_nn.problems.util import gen_graph class GraphIsomorphism(SubGraphIsomorphism): def __init__(self, cfg, graph1, graph2): super(GraphIsomorphism, self).__init__(cfg, graph1, graph2, a=1, b=2) ...
#************************** # Logistic Regression # for DNA N6-Adenine Methylation # Tian Tian # tt72@njit.edu #************************** import sys import numpy as np import itertools import multiprocessing #************************** # import modules #************************** from joblib import Parallel, delayed...
# %% #Standard Library Modules import pandas import sys import unittest import os import numpy #set current working directory to where this file is saved thisdir = os.path.dirname(os.path.abspath(__file__)) + "\\" os.chdir(thisdir) # Add higher directory to python module's path sys.path.append("..") #Local Applica...
#!/usr/bin/python import math import random import string import sys import numpy as np from midiutil.MidiFile import MIDIFile from midigen import heightmap from midigen import dither if len(sys.argv) > 1: seed = str(sys.argv[1]) else: chars = string.ascii_lowercase + string.ascii_uppercase + string.digits...
# -*- coding: utf-8 -*- # Copyright 2020 PyePAL 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 applicable l...
#!/usr/bin/env python import sys import json import numpy as np from logging import warning IGNORE = set(['[CLS]', '[SEP]']) def argparser(): from argparse import ArgumentParser ap = ArgumentParser() ap.add_argument('file', nargs='+', metavar='JSONL', help='BERT extract_features.py...
# Copyright (c) 2020 Hartmut Kaiser # # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # #1258: np.random.randn does not work from phylanx import Phylanx import numpy as np @Phylanx def generate(): return np...
import numpy as np import torchvision.models.segmentation import torch import torchvision.transforms as tf Learning_Rate=1e-5 width=height=900 # image width and height batchSize=1 #---------------------Create training image --------------------------------------------------------- def ReadRandomImage(): FillLevel=...
# Licensed under a MIT style license - see LICENSE.rst """MUSE-PHANGS target sample module """ __authors__ = "Eric Emsellem" __copyright__ = "(c) 2017, ESO + CRAL" __license__ = "MIT License" __contact__ = " <eric.emsellem@eso.org>" # Standard modules import os from os.path import join as joinpath import nump...
# -*- coding: utf-8 -*- """ Created on Tue Nov 17 10:48:57 2020 @author: Manuel Camargo """ import os import subprocess import copy import multiprocessing from multiprocessing import Pool import itertools import traceback import numpy as np import pandas as pd import math import random from hyperopt import tpe from h...
import retro import gym import numpy as np from DQ import DuelingDQNPrioritizedReplay from matplotlib import pyplot as plt import cv2 class SonicDiscretizer(gym.ActionWrapper): """ Wrap a gym-retro environment and make it use discrete actions for the Sonic game. """ # B is do nothing # down...
import numpy as np from pdb import set_trace from tinylib import logmass_statistic from contcnet import MultivariateGaussain from utmLib.clses import Timer from utmLib.ml.GBN import GBN def predict_wrapper(model, test): pred = [] for item in test: unknown = np.where( np.isnan(item) )[0] ...
#! /usr/bin/env python import argparse import cv2 import sys import time import datetime import imutils from collections import deque import numpy as np import serial ser = serial.Serial('COM18', 9600) #initializing serial communication for Zigbee cam_device = 1 laser = (0,0) maxlen=10 pts = deque(maxlen=10) detec...
# MIT License # # Copyright (C) IBM Corporation 2018 # # 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 limitation the # rights to use, copy, modify, merge...
import numpy as np def editDistance(s1, s2): m=len(s1)+1 n=len(s2)+1 tbl = np.empty([m,n]) for i in xrange(m): tbl[i,0]=i for j in xrange(n): tbl[0,j]=j for i in xrange(1, m): for j in xrange(1, n): cost = 0 if s1[i-1] == s2[j-1] else 1 tbl[i,j] = min(tbl[i, j-1...
# imports import torch from torch.autograd import Variable from torch import nn from torch.nn import Parameter import numpy as np from numpy.linalg import norm import scipy.io as sio import pickle usecuda = True usecuda = usecuda and torch.cuda.is_available() dtype = torch.FloatTensor if usecuda: dtype = torc...
import math import numpy import random import types from itertools import izip, tee, imap from operator import itemgetter, add from cStringIO import StringIO import cPickle as pickle import tensorflow as tf class Graph(object): def transform_batch(self, data): raise NotImplemented def train_and_loss_f...
''' Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. NVIDIA CORPORATION and its licensors retain all intellectual property and proprietary rights in and to this software, related documentation and any modifications thereto. Any use, reproduction, disclosure or distribution of this software and related docu...
import numpy as np def h_fpp(H): """Evaluate the significance of an H score. The H test is an extension of the Z_m^2 or Rayleigh tests for uniformity on the circle. These tests estimate the Fourier coefficients of the distribution and compare them with the values predicted for a uniform distributi...
import numpy as np from numpy import nan import pytest from pandas._libs import groupby, lib, reduction from pandas.core.dtypes.common import ensure_int64 from pandas import Index, isna from pandas.core.groupby.ops import generate_bins_generic import pandas.util.testing as tm from pandas.util.testing import assert_a...
import sys import os import requests import re import urllib.request from scipy.io import savemat, loadmat from tqdm import tqdm from PyQt5.QtCore import Qt from PyQt5.QtCore import QThread, pyqtSignal from PyQt5.QtWidgets import QWidget, QPushButton, QProgressBar, QVBoxLayout, QLabel, QApplication import time import n...
# Tools - Pandas *The `pandas` library provides high-performance, easy-to-use data structures and data analysis tools. The main data structure is the `DataFrame`, which you can think of as an in-memory 2D table (like a spreadsheet, with column names and row labels). Many features available in Excel are available progr...
from preprocess.generateMap import ClusterGenerator import matplotlib.pyplot as plt from model.climateNet import ClimateNet from dataReader.dataset import dataset from torch.utils.data import DataLoader, WeightedRandomSampler import torch import numpy as np import pandas as pd from sklearn import metrics import os i...
import numpy as np from abraia import Multiple multiple = Multiple() def test_load_image(): img = multiple.load_image('lion.jpg') assert isinstance(img, np.ndarray) def test_load_metadata(): meta = multiple.load_metadata('lion.jpg') assert meta['MIMEType'] == 'image/jpeg' def test_save_image(): ...
""" Test pyfive's abililty to read multidimensional datasets. """ import os import numpy as np from numpy.testing import assert_array_equal import pyfive DIRNAME = os.path.dirname(__file__) DATASET_COMPRESSED_HDF5_FILE = os.path.join(DIRNAME, 'compressed.hdf5') def test_compressed_dataset(): with pyfive.File(...
# coding: utf-8 # In[1]: #After conversion and audio features have been extracted, rename the split channels according to the intensity values from OpenSmile or IBM ASR results (this is not consistently A: l, B: r in SWBD) # In[6]: import os import sys import numpy as np from collections import defaultdict # In[...
# SPDX-License-Identifier: Apache-2.0 from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from onnx import checker, helper, ModelProto, TensorProto, GraphProto, NodeProto, OperatorSetIdProto from typing import Sequence, T...
#!/usr/bin/env python import mmap import os import struct import sys from collections import OrderedDict import numpy as np class SigprocFile: """ Simple functions for reading sigproc filterbank files from python. Not all possible features are implemented. Original Source from Paul Demorest's [pysigproc...
import math import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from .utils import shift_dim class NormReLU(nn.Module): def __init__(self, channels, relu=True, affine=True): super().__init__() self.relu = relu self.norm = nn.BatchNorm3d(channels) ...
import random import os import pickle import librosa as lb import numpy as np import musdb import yaml # ignore warning about unsafe loaders in pyYAML 5.1 (used in musdb) # https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation yaml.warnings({'YAMLLoadWarning': False}) def musdb_pre_processing(pat...
import numpy as np # This is for Scotland bands = [12500.0, 14549.0, 24944.0, 43430.0, 150000.0, 1000000.0] rates = [ 0.0, 19.0, 20.0, 21.0, 41.0, 46.0] def gross_to_net(gross_income, bands, rates): gross_income = float(gross_income) chunks = [] for i in range(len(bands)): if i == 0: ...
# -*- coding: utf-8 -*- """Core Keras layers. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import copy import types as python_types import warnings from .. import backend as K from .. import activations from .. import initializers...
from . import utils from .base import BaseModel import numpy as np class CholerM1(BaseModel): """ The "M1" four parameter model described in Choler et al. 2010 """ def __init__(self, parameters={}): BaseModel.__init__(self) self.all_required_parameters = {'a1': (0, 100), 'a2': (0, 100)...
from sklearn.decomposition import NMF from sklearn.metrics import silhouette_score import numpy as np class NMFClustering(): """ """ def __init__(self, n_clusters=2): """ """ self.n_clusters = n_clusters self.nmf = NMF(n_components=n_clusters) def fit(self, X): """ ...
import numpy as np from tensorflow.keras import backend as K import tensorflow.keras as keras import tensorflow as t import json ###definitions of classes that will be used to define a current Network State class state: def __init__(self,gs=10,param=10): self.gs=gs self.param=param def __str__(self): ...
import numpy as np import cv2 from PIL import Image import pytesseract def plateDetection(plate): gray_img = cv2.cvtColor(plate, cv2.COLOR_BGR2GRAY) _, thresh = cv2.threshold(gray_img, 110, 255, cv2.THRESH_BINARY) if cv2.waitKey(0) & 0xff == ord('q'): pass num_contours, hierarchy = cv2.findCo...
from time import sleep import gaussianfft as grf import unittest import numpy as np from multiprocessing import Process, Queue, set_start_method def create_realization(): # Returns a 100 x 100 realization of a random field v = grf.variogram('exponential', 100.0, 50.0) s = grf.simulate(v, 100, 10.0, 100, ...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import numpy as np import random PATTERN_LENGTH = 7 class Link(object): def __init__(self, graph, src, tar): self.graph = graph self.src = src self.tar = tar assert (graph.path_len[src][tar] == 0) gra...
import base64 import cv2 import numpy as np import tensorflow as tf from starmart.input import Input, ImageInput from starmart.result import Result, CompositeResult, NamedResult, ImageResult, ClassificationResult, Classification, \ Failure from tensorflow.keras.applications.resnet50 import preprocess_input, decode...
""" :mod:`operalib.kernels` implements some Operator-Valued Kernel models. """ # Author: Romain Brault <romain.brault@telecom-paristech.fr> with help from # the scikit-learn community. # License: MIT from numpy import dot, diag, sqrt from sklearn.metrics.pairwise import rbf_kernel from sklearn.kernel_approxim...
"""Estimate tumor purity and frequency using copy number and allele freqencies with BubbleTree. http://www.bioconductor.org/packages/release/bioc/html/BubbleTree.html http://www.bioconductor.org/packages/release/bioc/vignettes/BubbleTree/inst/doc/BubbleTree-vignette.html """ from __future__ import print_function impor...
import huobi.model.position import huobi.model.bararray import numpy as np class TradeInfoArray: def __init__(self, interval, size=100): self.count = 0 self.inited = False self.size = size self.ttmu_buy_ratio = np.zeros(size) self.ttmu_sell_ratio = np.zeros(size) s...
#!/usr/bin/env python # coding: utf-8 # In[1]: import torch import matplotlib.pyplot as plt import matplotlib.animation as animation import time import numpy as np import sys sys.path.append('../codes') from utils import hyperbolic_utils as hyp from utils import manifolds from run import * from adjustText import ad...
# -*- coding: utf-8 -*- ''' test program to show various calculation result of xmensur ''' __version__ = '0.1' import xmensur as xmn import argparse import numpy as np if __name__ == "__main__" : # exec this as standalone program. parser = argparse.ArgumentParser(description='Print mensur data.') parse...
import numpy as np X = np.array(([0.4, -0.7], [0.3, -0.5], [0.6, 0.1], [0.2,0.4], [0.1,-0.2]), dtype=float) y = np.array(([0.1], [0.05], [0.3], [0.25], [0.12]), dtype=float) class Neural_Network(object): def __init__(self): self.inputSize = 2 self.outputSize = 1 self.hiddenSize = 2 self....
"""Smolyak sparse grid constructor.""" from collections import defaultdict from itertools import product import numpy from scipy.special import comb import numpoly import chaospy def construct_sparse_grid( order, dist, growth=None, recurrence_algorithm="stieltjes", rule="gaus...
import torch import torch.nn as nn import numpy as np from src.IoU import * from src.utils import * from config import config CONFIG = config() def Validate(model, validloader, criterion, valid_loss_min, device, model_path): valid_loss = 0 val_iou = [] val_losses = [] model.eval() for i, val_data ...
""" Copyright (C) 2019 NVIDIA Corporation. All rights reserved. Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode). This file incorporates work covered by the following copyright and permission notice: Copyright (c) 2019 LI RUOTENG Permission to use, co...
# Copyright 2018 DeepMind Technologies Limited. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
import os import re import numpy as np from AlphaZero.processing.go.game_converter import GameConverter def selfplay_to_h5(model_name, base_dir='data'): """ Takes a model that has just generated the selfplay data, combine everything into a single h5 file. And store the h5 file as 'train.h5' in the same ...
"""Turns a MusicXML file into a pandas DataFrame.""" import io from itertools import combinations from fractions import Fraction import music21 from music21.interval import Interval from music21.pitch import Pitch from music21.chord import Chord from music21.note import Rest import numpy as np import pandas as pd fr...
from apps.geocode import geocoder import folium import copy import branca.colormap as cm import json import streamlit as st import numpy as np import pandas as pd import altair as alt from datetime import datetime, timedelta import leafmap.foliumap as leafmap from vega_datasets import data import time from streamlit.s...
import os import re import cv2 import sys import glob import random import numpy as np from imgaug import augmenters as iaa from tensorflow.keras.utils import to_categorical #augmentations to be performed on the timeseries dataset # seq_img = iaa.Sequential([ # iaa.Crop(px=(1, 16), keep_size=True), # iaa.Flipl...
#Author: Michail Mamalakis #Version: 0.1 #Licence: #email:mmamalakis1@sheffield.ac.uk from __future__ import division, print_function import glob import matplotlib.patches as patches import json import numpy as np from matplotlib.path import Path import pydicom import pydicom.uid import dicom import cv2 import matplotl...
import matplotlib.pyplot as plt import numpy as np import os import scipy.io as scio def vis_gt(im, bboxes, plt_name='output', ext='.png', visualization_folder=None): """ A function to visualize the detections :param im: The image :param bboxes: ground truth :param plt_name: The name of the plot ...
import matplotlib.pyplot as plt import numpy as np fig, ax = plt.subplots() rect = plt.Rectangle((np.pi, -0.5), 1, 1, fc=np.random.random(3), picker=True) ax.add_patch(rect) x = np.linspace(0, np.pi*2, 100) y = np.sin(x) line, = plt.plot(x, y, picker=8.0) def on_pick(event): artist = event.artist if isinstanc...
# Adapted for numpy/ma/cdms2 by convertcdms.py # Adapted for numpy/ma/cdms2 by convertcdms.py import numpy import genutil import cdms2 import numpy.ma import os import sys import unittest import cdat_info class GENUTIL(unittest.TestCase): ### EXTRACT TESTS def assertArraysEqual(self,A,B): self.assertTr...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Oct 19 18:00:36 2021 @author: ml """ from code.feature_extraction.feature_extractor import FeatureExtractor from code.util import COLUMN_WORD_COUNT, string_to_words_list import numpy as np #class for extracting the amount of words after general prepro...
#-------------------------------------------------------------------------------------------- # Key routines of this repository, where we implement the Sinkhorn algorithms and MMDs #-------------------------------------------------------------------------------------------- import numpy as np import torch # Refere...
from controller import Robot import PuPy import HDPy import numpy as np import h5py # Initialize a policy bound_gait = { 'amplitude' : ( 0.8, 1.0, 0.8, 1.0), 'frequency' : (1.0, 1.0, 1.0, 1.0), 'offset' : ( -0.23, -0.23, -0.37, -0.37), 'phase' : (0.0, 0.0, 0.5, 0.5) } policy = HDPy.puppy.policy...
""" This module provides metrics and related functions """ # Standard library imports # Third party imports import numpy as np import pandas as pd # Local imports def avg(data): return data["h"] / data["ab"] def obp(data): numerator = data["h"] + data["bb"] + data["hbp"] denominator = data["ab"] + data...
import copy import numpy as np from scipy.spatial.transform import Rotation as R from ase.data import atomic_numbers,atomic_masses_iupac2016 from mcse.core.structure import Structure def check_molecule(struct, exception=True): # Check for valid molecule_struct if len(struct.get_lattice_vectors()) > 0: ...
import numpy as np import matplotlib.pyplot as plt import scanpy as sc from anndata import AnnData from kneed import KneeLocator from scipy.sparse import isspmatrix, csr_matrix, spmatrix from sklearn.decomposition import PCA from typing import Optional, Tuple, List, Union # Convert sparse matrix to dense matrix. to_d...
#FOUR Ultrasonic sensors (HC-SR04) FUNCTION #Version 2 #Two conditions: #1. Every half a second determine location on boardSize_updown #2. In front of washer, determine location on board #Length is 23 cm with pushing mechanism #Goal: Assign four sensors to the four directions depending on the configuration ...
import numpy as np import Domains import argparse from multiprocessing import Pool import subprocess, random, os # Modify the following lines according to your NUPACK installation: nupack_path = os.environ['HOME'] + '/nupack3.2.2/build/bin' nupack_env = {'NUPACKHOME' : os.environ['HOME'] + '/nupack3.2.2'} subopt_gap =...
""" Apply PCA first, and then zscoring to spatiotemporal covariates """ import argparse import sys import os os.chdir(os.path.join("..")) sys.path.insert(0, 'SSF_mip/') import numpy as np import pandas as pd import preprocess import cfg_target_test as cfg parser = argparse.ArgumentParser() parser.add_a...
import enum from typing import List, Tuple from numpy import dstack, dtype, iinfo import numpy from pandas.core.frame import DataFrame import zarr import pandas import pkg_resources DATE_COLUMNS = ['53-0.0', '53-1.0', '53-2.0'] def load_dtype_dictionary(): path = pkg_resources.resource_filename('ukb_loader', 'a...
import time import numpy as np from dqo.datasets import QueriesDataset from dqo.relational import SQLParser from dqo.relational.tree.parser import parse_ast from dqo.relational.query.parser import parse_tree from tqdm.auto import tqdm from multiprocessing import Pool if __name__ == '__main__': ds = QueriesDataset(...
import sys sys.path.append("..") from geneticAlgorithm.solver import * import numpy as np chromosome = solve(np.mat([1, 1, 1, 1, 0]).tolist()[0], 5, binCapacity=2) position = chrom2position(chromosome) print(position)
# TODO: introduce better object naming system for logging # e.g. <Sound object at 0x7fa535d23870> -> Sound X import logging import time from numpy import exp from typing import List from .braillify import H_STEP, V_STEP from .common import Vec2 from .events import AnimationEndedEvent, CollisionEvent, Event, Collisio...
from __future__ import absolute_import, division import numpy as np from ._base import PreprocessingBase class NormalizeRmZeroStd(PreprocessingBase): """ Not exact a PCA, only remove features with std 0. """ def fit(self, X): self.means = np.empty((0,)) self.stds = np.empty((0,)) ...