text string |
|---|
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the MIT license.
# See the LICENSE file in the project root for more information.
from __future__ import annotations # Allow subscripting Popen
from dataclasses import dataclass, replace
from datetime... |
<reponame>Eng-RSMY/OpenPNM<filename>OpenPNM/Physics/models/multiphase.py
r"""
===============================================================================
Submodule -- diffusive_conductance
===============================================================================
"""
import scipy as sp
def conduit_conducta... |
<filename>opnormalize3.py
import numpy as np
import mdtraj as md
import sys
np.set_printoptions(threshold=sys.maxsize)
import argparse
from scipy.spatial import cKDTree
from sklearn.neighbors import DistanceMetric
from sklearn.neighbors import BallTree
def getargs():
'''
Description: This pulls co... |
<reponame>ckoerber/luescher-nd
#!/usr/bin/env python3
# pylint: disable=C0103, E0611
"""Scripts which computes eigenvalues and export overlap
"""
from typing import Dict
from typing import Tuple
import os
import numpy as np
import pandas as pd
from scipy.sparse.linalg import eigsh
from tqdm import tqdm
from luesch... |
<reponame>sorenchiron/VGAN
############################################################################
# VGAN: Spectral Image Visualization Using Generative Adversarial Networks
# LICENSE: MIT
# Author: <NAME>
# DATE: 2017-2018
############################################################################
import... |
# coding: utf-8
import numpy as np
from mnist_util import read
from num2words import num2words
import operator as op
import json
import scipy.misc
import os
# possible properties
colors = ['blue', 'red', 'green', 'violet', 'brown']
bgcolors = ['white', 'cyan', 'salmon', 'yellow', 'silver']
styles = ['flat', 'strok... |
<reponame>ciarajudge/SARSCov2_Evolution<filename>evocov/scoring.py
import sys
import os
import numpy as np
import csv
import math
from tqdm import tqdm
from statistics import mean
from statistics import variance
def entropy(AA, NTtable):
e = []
for nt in range((AA*3)-3, (AA*3)):
total = NTtable[nt,0]+... |
<gh_stars>1000+
from __future__ import absolute_import
import scipy.special
import autograd.numpy as np
from autograd.extend import primitive, defvjp, defjvp
from autograd.numpy.numpy_vjps import unbroadcast_f, repeat_to_match_shape
### Beta function ###
beta = primitive(scipy.special.beta)
betainc = primitive(scip... |
import math
import json
import torch
import numpy as np
from pathlib import Path
from scipy import stats
from quince.library import utils
from quince.library import models
from quince.library import datasets
from quince.library import plotting
def compute_intervals_ensemble(trial_dir, mc_samples):
config_path ... |
<reponame>waffleSheep/phyton<filename>vectors/__init__.py<gh_stars>1-10
# phyton.vectors
from math import *
from inspect import getmro as inspect
from sympy import Symbol
from phyton.constants import *
π = Symbol('π')
class VectorError(Exception): pass
class Vector:
def __init__(self, *args):
... |
import os
from tqdm import tqdm
import torch
import torch.nn as nn
import numpy as np
from torch.utils.data import DataLoader
from scipy.stats import pearsonr
from scipy.stats import spearmanr
from tensorboardX import SummaryWriter
from sklearn.metrics import accuracy_score
from models.u_model import NIMA
# from model... |
<gh_stars>1-10
import matplotlib
matplotlib.use("TkAgg")
import os
import numpy as np
import scipy as sp
import scipy.io
import torch
import matplotlib.pyplot as plt
from torchid.module.lti import MimoLinearDynamicalOperator, SisoLinearDynamicalOperator
from torchid.module.static import MimoStaticNonLinearity, MimoStat... |
<filename>nc2png_cli.py
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 9 19:41:58 2020
@author: <EMAIL>
"""
import xarray, os, glob, datetime
import numpy as np
import matplotlib.pyplot as plt
import cartomap.geogmap as gm
import subprocess
import cartopy.crs as ccrs
from scipy import ndimage
from dateutil import pa... |
<gh_stars>0
"""Animations of common operations in signal processing."""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
from matplotlib.collections import LineCollection, PolyCollection
import sympy as sym
def animate_convolution(x, h, y, t, tau, td, taud, interval=75... |
import argparse
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import scipy.stats
import seaborn as sns
def plot_clusdist(netlist, output_dir):
max_clusters = netlist["Num_Clusters"].max()
sns.distplot(netlist["Num_Clusters"], kde=False)
plt.title("Cluster Size Distribution")
p... |
<filename>plotting/attenuation.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
CERN@school: Analysis functions for the attenuation experiment.
See the README.md file for more information.
"""
#...for the logging.
import logging as lg
#...for the MATH.
import math
#...for even more MATH.
import numpy as np
... |
#!/usr/bin/env python
'''
eval.py
Perform evaluation of predicted vs gold standard adjective
rankings, using metrics:
- Pairwise accuracy
- Kendall's Tau correlation coefficient
- Spearman's rho correlation coefficient
'''
import os, sys
import itertools
import numpy as np
from collections import Counter
from scipy... |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 20 09:57:48 2018
# Recording instructions:
1. Use index finger tip
2. Place fingertip exactly on camera, covering the entire lens
3. Limit pressure, tough lens gently so as not to restrict blood flow in the finger
4. 50 seconds is required for reliable measure of HRV; Sour... |
<reponame>Tinaatucsd/maml<filename>maml/utils/_signal_processing.py
"""Signal processing utils"""
from math import ceil, floor
from typing import Callable, Tuple, Union
import numpy as np
from monty.dev import requires
from scipy import fft, signal
try:
import tftb
except ImportError:
tftb = None
def fft_ma... |
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import torch
import torch.autograd as autograd
import torch.optim as optim
from torch.distributions import constraints, transform_to
import sobol_seq
import pyDOE
import pyro
import pyro.contrib.gp as gp
import copy
from torch.distributions.multivar... |
import psutil
import time
from PIL import Image
from threading import Thread
from numpy import exp
from scipy.optimize import curve_fit
# set this if you don't want it to eat up your system's memory
MAX_MEM = psutil.virtual_memory().total * .8
mem_vals = []
def get_total_memu():
info = psutil.virtual_memory()
... |
""" Slow Feature Analysis
Implementation of Slow Feature Analysis [1].
References
----------
.. [1] <NAME>., <NAME>., <NAME>., <NAME>., <NAME>., & <NAME>.
(2015). Concurrent monitoring of operating condition deviations and
process dynamics anomalies with slow feature analysis. AIChE Journal, 6
(1... |
<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
BSD 3-Clause License
Copyright (c) 2020 Okinawa Institute of Science and Technology (OIST).
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditi... |
<filename>lib/python/stratipy/stratipy/test1_Hofree.py<gh_stars>0
import importlib # NOTE for python >= Python3.4
import load_data
import nbs
from nbs import Ppi, Patient
import filtering_diffusion
import clustering
import scipy.sparse as sp
import numpy as np
import time
import datetime
from sklearn.grid_search impor... |
# %% [markdown]
# ## Training the Single Atom Binding Energy Correlation in Python
#
# Author: <NAME> [(<EMAIL>)](<EMAIL>)
#
# Predict $E_{bind}$ of single-atom metal on support based on descriptors (features) 'Ebulk', 'Evac', 'delta X' , 'CN', 'bond angle' (values from DFT calculations)
#
# The form of the scaling ... |
<reponame>weishi/praat
import shutil
from pathlib import Path
import itertools
import numpy as np
import pandas as pd
from scipy.optimize import minimize_scalar
input_base_dir = Path('./analysis/item_a/')
output_base_dir = input_base_dir / 'normalized/'
shutil.rmtree(output_base_dir, ignore_errors=True)
output_base_di... |
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import numpy as np
from pyapprox.multivariate_polynomials import PolynomialChaosExpansion
from pyapprox.utilities import evaluate_tensor_product_function,\
gradient_of_tensor_product_function
def get_q... |
<reponame>synqs/pennylane-ls
# we always import NumPy directly
import numpy as np
import scipy
from pennylane import Device
from pennylane.operation import Observable
# observables
from .MultiQuditOps import Lz, Z
# operations
from .MultiQuditOps import rLx, rLz, rLz2, LxLy, LzLz, load
# classes
from .MultiQuditOps... |
#!/usr/bin/python3
# project: piano/guitar tuner
# This code permanently records the microphone, calculates the FFT and shows the peak-frequency
# You can use it to tune a piano or guitar buy playing one (piano) string and
# check whether you see the right frequency or not
# (Hint: Normally when you play a piano key yo... |
from sympy.codegen.ast import Print
from sympy.codegen.pyutils import render_as_module
def test_standard():
ast = Print('x y'.split(), "coordinate: %12.5g %12.5g")
assert render_as_module(ast, standard='python3') == \
'\n\nprint("coordinate: %12.5g %12.5g" % (x, y))'
assert render_as_module(ast, st... |
'''
Several Models used for testing.
'''
import numpy as np
from scipy.sparse.csgraph import minimum_spanning_tree
from .blocks import get_demo_circuit
from .dataset import gaussian_pdf, barstripe_pdf
from .qcbm import QCBM
from .mmd import RBFMMD2
from .structure import chowliu_tree, nearest_neighbor, random_tree
fr... |
<reponame>nik-sergeson/bsuir-informatics-labs
from __future__ import division
from sympy import Matrix
from lab3.CuttingPlaneMethod import CuttingPlaneMethod
A = Matrix([[1, 1], [1, 1]])
b = Matrix([[1 / 4], [1 / 2]])
c = Matrix([1, 1])
# solver = CuttingPlaneMethod(A, b, c, condition_operators=[">=", "<="])
# plan =... |
<filename>pyscf/nao/m_comp_vext_tem.py
from __future__ import print_function, division
import numpy as np
from pyscf.nao.m_tools import find_nearrest_index
from pyscf.nao.m_ao_matelem import ao_matelem_c
from pyscf.nao.m_csphar import csphar
from scipy.fftpack import fft
import math
import warnings
from pyscf.nao.m_lib... |
<reponame>li-ziang/cogdl<filename>cogdl/data/sampler.py<gh_stars>1000+
from typing import List
import os
import random
import numpy as np
import scipy.sparse as sp
import torch
import torch.utils.data
from cogdl.utils import remove_self_loops, row_normalization
from cogdl.data import Graph, DataLoader
class Neighbor... |
from typing import Any
import numpy as np
from scipy import linalg
from scipy.stats import chi2
from tqdm import tqdm
from changedet.algos.base import MetaAlgo
from changedet.algos.catalog import AlgoCatalog
from changedet.utils import InitialChangeMask, contrast_stretch, np_weight_stats
@AlgoCatalog.register("irma... |
<gh_stars>0
import json
import os
import argparse
import math
import numpy as np
from multiprocessing import Pool
from scipy.stats import ttest_ind
from stable_baselines3 import PPO
from reward_surfaces.agents.make_agent import make_agent
from reward_surfaces.algorithms import evaluate
def compare_a2c_ppo(environment... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
TODO:
- [ ] Remove doctest dependency on ndsampler?
- [ ] Remove the datakeys that tries to define what heatmap should represent
(e.g. class_probs, keypoints, etc...) and instead just focus on a
data structure that stores a [C, H, W] or [H, W] tens... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
import numpy as np
import os
import h5py
import subprocess
import shlex
import json
import glob
from .. ops import transform_functions, se3
from sklearn.neighbors import Neare... |
<reponame>shaun95/google-research<gh_stars>1-10
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lice... |
from __future__ import annotations
import numpy as np
import numpy.testing as npt
from scipy.integrate import quad
import pymwm
params: dict = {
"core": {"shape": "coax", "r": 0.15, "ri": 0.1, "fill": {"RI": 1.0}},
"clad": {"book": "Au", "page": "Stewart-DLF", "bound_check": False},
"bounds": {"wl_max": ... |
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import plotly.figure_factory as FF
import plotly.offline as offline
from plotly.subplots import make_subplots
import numpy as np
import pandas as pd
import os.path
from datetime import datetime
from dash.de... |
from .covar_base import Covariance
import pdb
import numpy as np
import scipy as sp
from .acombinators import ACombinatorCov
from limix.hcache import Cached, cached
class SumCov(ACombinatorCov):
"""
Sum of multiple covariance matrices.
The number of paramteters is the sum of the parameters of the single co... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 14 21:31:56 2017
@author: Franz
"""
import scipy.signal
import numpy as np
import scipy.io as so
import os.path
import re
import matplotlib.pylab as plt
import h5py
import matplotlib.patches as patches
import numpy.random as rand
import seaborn as s... |
<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Aquí va el docstring de mi codigo explicando que cosas hace
'''
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
import scipy.integrate
def w_sin_normalizar(x):
'''docstring'''
return 3.5 * np.exp(-(x-3)**2 / 3) +... |
<filename>bench/benchmarks/construction.py
import numpy as np
import scipy.sparse as ss
from sparray import FlatSparray
class Construction2D(object):
def setup(self):
num_rows, num_cols = 3000, 4000
self.spm = ss.rand(num_rows, num_cols, density=0.1, format='coo')
self.arr = self.spm.A
self.data = ... |
import sys
sys.path.append(".")
sys.path.append("..")
from sympy import Basic,exp,Symbol,sin,Rational,I,Mul,NCSymbol, Matrix, \
gamma, sigma, one, Pauli
#gamma^mu
gamma0=gamma(0)
gamma1=gamma(1)
gamma2=gamma(2)
gamma3=gamma(3)
gamma5=gamma(5)
#sigma_i
sigma1=sigma(1)
sigma2=sigma(2)
sigma3=sigma(3)
a=Symbol("a"... |
<reponame>lcx366/ATMOS
import numpy as np
from scipy.interpolate import CubicSpline
from pyshtools.legendre import PLegendreA,PlmIndex
import pkg_resources
def nrlmsis00_data():
'''
Read the data block from nrlmsis00_data.npz
'''
data_path = pkg_resources.resource_filename('pyatmos', 'data/')
data... |
<filename>heroku_rest_api/fierce-hamlet-74882/model.py<gh_stars>1-10
import pandas as pd
import numpy as np
import scipy.fftpack
from sklearn import preprocessing
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import confusion_matrix, f1_score
from sklearn.model_selection import train_test_... |
"""
This module lists the component vectors of the direct and reciprocal lattices
for different crystals.
It is based on the following publication:
<NAME> and <NAME>, "High-throughput electronic band
structure calculations: Challenges and tools", Comp. Mat. Sci. 49 (2010),
pp. 291--312.
"""... |
<reponame>dugu9sword/certified-word-sub
"""Analyze word vectors."""
import argparse
import os
from scipy.stats import special_ortho_group
import sys
import torch
from tqdm import tqdm
sys.path.append(os.path.join(
os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'src'))
import data_util
import text_cla... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
<reponame>mdsarfarazulh/deep-texture-synthesis-cnn-keras<gh_stars>1-10
'''
@author: Md <NAME>
This file contains the main class, of this project,
that synthesise a texture based on the provided texture.
This Project is an implementation of following research paper:
Citations{
@online{
... |
##########################################################################
#
# MRC FGU Computational Genomics Group
#
# $Id$
#
# Copyright (C) 2009 <NAME>
#
# 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 Fre... |
import os
import numpy as np
import pandas as pd
import scipy.io as sio
import matplotlib.pyplot as plt
# import seaborn as sns
def value_of_mat(mat_filename):
"""
load the mat file and return the data.
sio.loadmat() returns a dict and 'val' means value.
"""
return sio.loadmat(mat_filename)["val"... |
import numpy as np
import numpy.random as npr
import scipy as sc
from scipy import stats
from sds.models import AutoRegressiveHiddenMarkovModel
from sds.utils.general import random_rotation
import matplotlib.pyplot as plt
npr.seed(1337)
true_arhmm = AutoRegressiveHiddenMarkovModel(nb_states=3, obs_dim=2)
obs_dim ... |
<reponame>fxbriol/probnum<filename>src/probnum/problems/zoo/linalg/_suitesparse_matrix.py
"""Sparse matrices from the SuiteSparse Matrix Collection."""
import codecs
import csv
import io
import tarfile
from typing import Dict, Union
import numpy as np
import scipy.io
import probnum.linops as linops
# URLs and file ... |
<gh_stars>1-10
# coding: utf-8
# # NGC 6946
# In[10]:
import numpy as np
import matplotlib.pyplot as plt
import scipy.optimize
import scipy.stats
get_ipython().run_line_magic('matplotlib', 'inline')
# ## B filter
# In[20]:
#mean sky value, standard deviation, etc from AIJ
mean_sky = 1574.550
sky_std = 7.223
... |
<reponame>hamogu/psfsubtraction
# Licensed under a MIT licence - see file `license`
'''Function to construct the "optimization region" for a region.
The "optimization region" is the region used in the fitting to find the best
PSF for a region. The "optimization region" can (but usually will not) be
identical to the re... |
<reponame>FabioCaffarello/Youtube-Video-Recommendations
import math
import numpy as np
import pandas as pd
import joblib as jb
from scipy.sparse import hstack
class DataPipeline(object):
def __init__(self):
self.home_path = ''
self.titleVec = jb.load(open(self.home_path + 'parameter/titleVec.pkl.z', 'rb'... |
# ClinVarome annotation functions
# Gather all genes annotations : gene, gene_id,
# (AF, FAF,) diseases, clinical features, mecanismes counts, nhomalt.
# Give score for genes according their confidence criteria
# Commented code is the lines needed to make the AgglomerativeClustering
import pandas as pd
import numpy as ... |
# -*- coding: utf-8 -*-
from . import plot_settings as pls
from . import plots as pl
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import logging
from matplotlib.colors import LinearSegmentedColormap, colorConverter
from scipy.stats.kde import gaussian_kde
try:
from scipy... |
<reponame>JKrehl/Electrons.py
#!/usr/bin/env python
"""
Copyright (c) 2015 <NAME> <<EMAIL>>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS ... |
from sklearn.base import BaseEstimator, RegressorMixin
class GenericRegressor(BaseEstimator, RegressorMixin):
"""
Uses a linear regression algorithm and a transformer to perform nonlinear regression.
Using a set of functions :math:`(f_0,\dots,f_n)`, and a point :math:`x`, lifts the point
:math:`x` to ... |
<gh_stars>10-100
import argparse
import json
import multiprocessing as mp
import multiprocessing.context as ctx
import sys
import time
from pathlib import Path
import subprocess
import imageio
import numpy as np
import trimesh
import pickle
from scipy.ndimage import binary_opening
from trimesh.voxel.ops import fill_or... |
<filename>miplearn/problems/knapsack.py<gh_stars>10-100
# MIPLearn: Extensible Framework for Learning-Enhanced Mixed-Integer Optimization
# Copyright (C) 2020-2021, UChicago Argonne, LLC. All rights reserved.
# Released under the modified BSD license. See COPYING.md for more details.
from typing import List, Dict, ... |
# -*- coding: utf-8 -*-
#!/usr/bin/python
#
# Author <NAME>
# E-mail <EMAIL>
# License MIT
# Created 24/10/2016
# Updated 09/11/2016
# Version 1.0.0
#
import os
import re
import csv
import sys
import json
import time
import utils
import shutil
import fnmatch
import argparse
import subprocess
import webbr... |
import Adafruit_ADS1x15
import time
import numpy as np
import matplotlib.pyplot as plt
from scipy.fftpack import fft , fft2
GAIN = 1
adc = Adafruit_ADS1x15.ADS1015()
sps = input("Input Sampling Rate: ")
time1 = input("Input sample time (seconds): ")
def logdata():
period = 1.0 / sps
datapoints = int... |
"""
source: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/tutorials/deepdream/deepdream.ipynb
"""
import numpy as np
import scipy.misc as misc
import tensorflow as tf
import matplotlib.pyplot as plt
DEFAULT_IMAGE_SIZE = 224
k = np.float32([1,4,6,4,1])
k = np.outer(k, k)
K5x5 = k[:,:,None,... |
"""Rudimentary reimplementation of layer smoothing from LAYNII
Reference
---------
https://github.com/layerfMRI/LAYNII/blob/master/LN_LAYER_SMOOTH.cpp
"""
import os
import argparse
import numpy as np
import nibabel as nb
from scipy.ndimage import gaussian_filter
# Input
NII1 = "/home/faruk/data/DATA_MRI_NIFTI/derive... |
# -*- coding: utf-8 -*-
###############################################################################
""" This file implements tests comparing the operation of the actual optimized
local search procedures in inter_route_operations.py/intra_route_operations.py
with their naive implementation counterparts in naive_impl... |
# coding: utf-8
"""
https://leetcode.com/problems/median-of-two-sorted-arrays/
"""
from typing import List
import heapq
import statistics
class Solution:
def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -> float:
sorted_nums = heapq.merge(nums1, nums2)
return statistics.median(... |
import os
from slack_bolt import App
from slack_bolt.adapter.aws_lambda import SlackRequestHandler
from sympy.ntheory import factorint
app = App(process_before_response=True,
token=os.environ["SLACK_BOT_TOKEN"],
signing_secret=os.environ["SLACK_SIGNING_SECRET"]
)
def _prime_factorization(n):
if n < 2:
... |
<gh_stars>0
# <NAME>
# Georgia Tech Fall 2013
# url-encode.py: collection of functions to hide small chunks of data in urls
from base64 import urlsafe_b64encode, urlsafe_b64decode
import binascii
import numpy as np
from random import choice, randint
import re
from scipy.stats import entropy
AVAILABLE_TYPES=['market',... |
import numpy
from math import cos, sin, tan, atan, sqrt, pi, pow
import scipy
import scipy.linalg
from PIL import Image, ImageDraw
from sympy.core import Catalan
from numpy.f2py.auxfuncs import throw_error
def sqrDist( p1, p2 ):
return (p1[0] - p2[0])**2 + (p1[1] - p2[1])**2
def quadForm(a, b, c, sign):
retu... |
<reponame>certik/sympy-oldcore<gh_stars>1-10
"""
"""
from sympy.polynomials import roots
def filter_roots(poly, n, predicate):
return [ r for r in set(roots(poly, n)) if predicate(r) ]
def nni_roots(poly, n):
return filter_roots(poly, n, lambda r: r.is_integer and r.is_nonnegative) |
<filename>ai_ml_projects/masters_courses/machine_learning/svm/svm.py<gh_stars>1-10
#!/bin/env python3.5
#Author: <NAME>
from matplotlib import pyplot as pl, patches
from mpl_toolkits.mplot3d import Axes3D
from numpy import genfromtxt, multiply, ones, zeros, identity, around, meshgrid, amin, argsort, vstack, matrix as m... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 29 18:33:36 2021
@author: peter
"""
from pathlib import Path
import datetime
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from vsd_cancer.functions import stats_functions as statsf
import f.plotting_functions as pf
imp... |
import os, sys
import pickle
import numpy as np
import skimage.io as io
import matplotlib.pyplot as plt
import scipy.spatial.distance as dist
def estimate_top_view_sigmas(pkl_file):
''' call this on 'AMT_data/top/AMT15_csv.pkl'
we estimate keypoint accuracy in terms of the Object Keypoint Similarity (OKS) after Ron... |
<gh_stars>10-100
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# flake8: noqa
import argparse
import dask
import dask.array as da
import numpy as np
from astropy.io import fits
import warnings
from africanus.model.spi.dask import fit_spi_components
iFs = np.fft.ifftshift
Fs = np.fft.fftshift
# we want to fall back to... |
<reponame>JulianoLagana/MT3
"""tkinter app for evaluation GUI. Run evaluation.py to try it out!
"""
import matplotlib
import os
import torch
from pathlib import Path
matplotlib.use("TkAgg")
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
from matplotlib.figure import Figure
from sc... |
<filename>src/classes/utilFunc.py
"""
Collections of auxiliary functions
@date : 07.03.2021
@author: <NAME> (on the basis of the MATLAB code by <NAME>)
"""
import torch
import numpy as np
from scipy.io import savemat as sm
# ------------------------------------------------------------------------------
def fortran_... |
"""
Copyright (C) 2016-2019 <NAME>
Licensed under Illinois Open Source License (see the file LICENSE). For more information
about the license, see http://otm.illinois.edu/disclose-protect/illinois-open-source-license.
Implement ProSRS algorithm.
"""
import numpy as np
import os, sys, pickle, shutil, warnings
import m... |
#!git clone https://github.com/26medias/keras-face-toolbox.git
#!mv keras-face-toolbox/models models
#!mv keras-face-toolbox/utils utils
#!rm -r keras-face-toolbox
#!gdown https://drive.google.com/uc?id=1H37LER8mRRI4q_nxpS3uQz3DcGHkTrNU
#!mv lresnet100e_ir_keras.h5 models/verifier/insightface/lresnet100e_ir_keras.h5
#... |
<reponame>ArnePlatteau/time_var_extr_index
# -*- coding: utf-8 -*-
"""
Created on Fri May 7 11:22:11 2021
@author: arnep
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import mean_squared_error
from methods_extremal_index import non_parametric_extremal_i... |
<filename>src/dfn_mesh_generator.py<gh_stars>0
import numpy as np
from scipy.special import comb
from pymoab import rng
from preprocessor.meshHandle.finescaleMesh import FineScaleMesh
from .utils import rotation_to_align
class DFNMeshGenerator(object):
"""
Base class for the mesh generator.
"""
def _... |
<filename>ekf.py
# ************************************** #
# Extended Kalman Filter #
# ************************************** #
# by <NAME> #
# <NAME> #
# <NAME> #
# ************************************** #
# Department of Mechanical ... |
<reponame>yipenghuang0302/Cirq
# Copyright 2018 The Cirq Developers
#
# 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 ... |
<filename>textmap/transformers.py<gh_stars>0
import numpy as np
import numba
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.utils.validation import check_X_y, check_array, check_is_fitted
from sklearn.preprocessing import normalize
import scipy.sparse
import enstop
from nltk.collocations import B... |
import os
import numpy as np
import pandas as pd
import torch
from scipy.sparse import coo_matrix, csr_matrix, load_npz, save_npz
from src.utils.hilbert import Encoding
from src.utils.system import mk_dir
import pickle
from src.utils.hamiltonian_math import get_Hij_cy, popcount_parity
import time
from abc import ... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from scipy import *
from pylab import *
from matplotlib.pyplot import draw,figure,show
" Função seno com argumento em graus"
def sind(theta_deg):
return sin(theta_deg*pi/180)
" Função coseno com argumento de graus"
def cosd(theta_deg):
return cos(theta_deg*pi/180... |
<gh_stars>0
import torch
from torch.autograd import Variable
import os, errno
import numpy as np
from scipy import linalg
import torchvision
from torchvision import datasets
import torchvision.transforms as transforms
from itertools import repeat, cycle
data_dir = r'D:\Data\facescrub100'
def get_face_loaders(batch_... |
<gh_stars>10-100
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
def cutoff(log,phi=None,sw=None,vsh=None,elbow=0.9,swaq=0.7,ax=None, plot=True):
"""cutoff [summary]
Parameters
----------
log : [type]
[description]
phi : [type... |
#!/usr/bin/env python3
import argparse
import json
import os
import sys
import time
from statistics import Statistic
parser = argparse.ArgumentParser(description="Program counts nucleotides found in FASTA file.")
parser.add_argument("-i", "--input-file", type=argparse.FileType('r'), nargs='+', default=None, help="Pat... |
from __future__ import absolute_import
from __future__ import print_function
__author__ = 'marafi'
import os
# from numba import jit
def ExtractGroundMotion(Folder_Location):
GMids = []
GMFiles = {}
GMData = {}
Dt = {}
NumPoints = {}
# for subdir, dirs, files in os.walk(Folder_Location, True):
... |
import os
import torch
import torchvision
import torch.nn as nn
from SCNN import SCNN
from PIL import Image
from scipy import stats
import random
import torch.nn.functional as F
import numpy as np
import time
import scipy.io
import itertools
from torch.optim import lr_scheduler
def pil_loader(path):
# open path a... |
# Copyright (c) 2020, FADA-CATEC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing,... |
import numpy as np
from taurex.model import ForwardModel
from taurex.model import SimpleForwardModel
from taurex.util.util import clip_native_to_wngrid
from scipy.interpolate import interp1d
import pycuda.autoinit
from pycuda.compiler import SourceModule
import pycuda.driver as drv
from pycuda.gpuarray import GPUArray,... |
<reponame>neutronpy/neutronpy
# -*- coding: utf-8 -*-
r"""A collection of commonly used one- and two-dimensional functions in neutron scattering,
=============== ==========================================================
gaussian Vector or matrix norm
gaussian2d Inverse of a square matrix
lorentzian S... |
import numpy as np
from scipy.io.wavfile import read
import torch
def get_mask_from_lengths(lengths, max_len=None):
if not max_len:
max_len = torch.max(lengths).item()
ids = torch.arange(0, max_len, out=torch.cuda.LongTensor(max_len))
mask = (ids < lengths.unsqueeze(1))
return mask
def get_d... |
<reponame>ozdamarberkan/Computational_Neuroscience
import sys
import numpy as np
import scipy.io
import matplotlib.pyplot as plt
import hdf5storage
import h5py
from scipy.stats import norm
question = sys.argv[1]
def berkan_ozdamar_21602353_hw3(question):
if question == '1' :
with h5py.File('hw3_data2.ma... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.