text
string
<filename>membranequant/autofluorescence.py<gh_stars>0 import numpy as np import matplotlib.pyplot as plt from scipy.ndimage.filters import gaussian_filter import random import glob import scipy.odr as odr from sklearn.metrics import r2_score from sklearn.linear_model import LinearRegression from .funcs import load_ima...
<reponame>MFE5290/Hidden-Markov-Model-for-Stock-Trading #!/usr/bin/env python # -*- coding: utf-8 -*- # ### Libraries import warnings import numpy as np import pandas as pd import statsmodels.api as sm from scipy import stats from matplotlib import cm, pyplot as plt from matplotlib.dates import YearLocator, MonthLoca...
<filename>vizer.py import torch import numpy as np import scipy import librosa import test import os import sys if len(sys.argv) < 2: print("usage: vizer.py input.mp3 [outdir]") sys.exit(1) infile = sys.argv[1] if len(sys.argv) > 2: basename = sys.argv[2] else: basename = os.path.splitext(os.path.ba...
<reponame>fmqa/image-approximation #!/usr/bin/env python3 import operator import sys import random import argparse from math import inf, sqrt import numpy as np from PIL import Image from PIL.ImageOps import colorize from scipy.cluster.vq import kmeans, whiten def hc(cmp=operator.le): """Hill-climbing algorithm."...
<reponame>jshermeyer/CometTS<filename>CometTS/CometTS.py import os import glob import gdal import rasterio from rasterstats import zonal_stats import numpy as np import pandas as pd import geopandas as gpd import shapely.wkt import matplotlib.pyplot as plt from tqdm import tqdm as tqdm import matplotlib.dates as mdates...
import numpy as np import pandas as pd from scipy.stats import zscore from qualipy.anomaly.base import AnomalyModelImplementation class STDCheck(AnomalyModelImplementation): def __init__( self, config_dir, metric_name, project_name=None, arguments=None, ): super(STDCheck, self).__init__(confi...
<reponame>Jimmy-INL/pysensors<gh_stars>10-100 from scipy.linalg import qr from sklearn.base import BaseEstimator from sklearn.utils.validation import check_is_fitted class QR(BaseEstimator): """ Greedy QR optimizer for sensor selection. Ranks sensors in descending order of "importance" by applying the...
# (c) 2019 by Authors # This file is a part of centroFlye program. # Released under the BSD license (see LICENSE file) import argparse import os import statistics import subprocess from unit_extractor import get_period_info from utils.bio import read_bio_seq, read_bio_seqs, write_bio_seqs from utils.os_utils import s...
# Adopted form SfePy project, see http://sfepy.org # Thanks to <NAME> import numpy as nm import os import os.path as op import fnmatch import shutil from .base import output, Struct, basestr try: import tables as pt except: pt = None class InDir(Struct): """ Store the directory name a file is in, an...
""" Module for customising opensim segmented muscle points """ import os import numpy as np import copy from gias2.fieldwork.field import geometric_field from gias2.fieldwork.field.tools import fitting_tools from gias2.common import transform3D from gias2.registration import alignment_fitting as af from gias2.musculos...
<filename>vis_imagine_static_voxels/utils/imports.py import math import tensorflow as tf import numpy as np from scipy.misc import imsave, toimage import scipy.stats as st from os import makedirs from os.path import exists, join import pickle import constants as const import os from PIL import Image, ImageFont, ImageDr...
<gh_stars>0 """ Implementation of Cosmic RIM estimator""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf physical_devices = tf.config.experimental.list_physical_devices('GPU') world_size = len(physical_devices) print("\nphysical_devi...
""" Linear_Regession.py Written by <NAME> and <NAME>, Last Edit: 1/27/17 Purpose: Calculate the calibration curves via linear regression of the calibration data Input: 1) cal_data_file: data file containing the calibration data 2) output_dir: where to save the output results Note that the script will look for the ca...
import sys import os import time import numpy as np from scipy.special import erf from scipy.optimize import minimize from fortesfit import FortesFit_Settings from fortesfit import FortesFit_Filters from fortesfit import FortesFit_ModelManagement """ A module with functions that are used by the model fitting routi...
import numpy as np import argparse from scipy import io from sklearn.metrics import confusion_matrix parser = argparse.ArgumentParser(description="ESZSL") parser.add_argument('-data', '--dataset', help='choose between APY, AWA2, AWA1, CUB, SUN', default='AWA2', type=str) parser.add_argument('-mode', '--mode', help='t...
<filename>rmgpy/molecule/utilTest.py import unittest from scipy.special import comb from .util import * class PartitionTest(unittest.TestCase): def test_singleton(self): """ Test that a index not part of the parameter list, results in a key-value pair with an empty list. """ ...
import numpy as np from scipy.stats import norm # Obtains sum of normal distributions given centers and spreads and returns PMF def normal_sum_pmf(min_val, max_val, centers, spreads): assert len(centers) == len(spreads) ret = np.zeros((max_val - min_val + 1)) for i in range(len(centers)): r...
<reponame>asathiya007/nba-crowdsourcing-comparisons # import modules from basketball_reference_utils import get_random_pair from machine_learning import (construct_dataset, FEATURES, DEFAULT_HOLDOUT, RF_MAX_DEPTH, RF_NUM_EST, RF_MAX_FEATURES) import os import pandas as pd from predict_better_player import predict_...
import pytest import sys sys.path.insert(0,"..") import autogenes as ag import numpy as np import pandas as pd import anndata from sklearn.svm import NuSVR from sklearn import linear_model from scipy.optimize import nnls def test_unpack_bulk(): unpack_bulk = ag.main._Interface__unpack_bulk arr = np.ones((3,))...
<filename>model.py import bz2 import pickle import _pickle as cPickle import os import time import pandas as pd import numpy as np from tqdm import tqdm tqdm.pandas(desc="progress-bar") from gensim.models import Doc2Vec from sklearn import utils from sklearn.model_selection import train_test_split import gensim from s...
''' Astro.IQ - Trajectory <NAME> <EMAIL> https://cisprague.github.io/Astro.IQ ''' ''' -------- Dependencies -------- ''' from numpy import * from scipy.integrate import odeint import matplotlib.pyplot as plt set_printoptions(suppress=True) from ML import MLP import os from numba import jit import tensorflow ''' -----...
<gh_stars>0 # %% [markdown] # # THE MIND OF A MAGGOT # %% [markdown] # ## Imports import os import time import warnings import colorcet as cc import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.transforms as transforms import numpy as np import pandas as pd import seaborn as sns from anytree im...
"""Bayesian estimation for two groups This module implements Bayesian estimation for two groups, providing complete distributions for effect size, group means and their difference, standard deviations and their difference, and the normality of the data. Based on: <NAME>. (2012) Bayesian estimation supersedes the t ...
<reponame>NamelessCoder/fermentrack # Tilt Hydrometer Tilt polling library # <NAME> 22/01/2017 # <EMAIL> # # Version: 1.5 - Bug fix for debugging log and also adding connection resilliance. Will now reset # bluetooth connection if dropped for any reason. # Version: 1.4 - Added additional resiliance and ...
<gh_stars>1-10 import numpy as np from scipy import misc import os import scipy.io from PIL import Image def filter(base_root, config, crops_list='crops_LiTS_gt.txt', input_config='masked_out_lesion', results_list='detection_lesion_example', th=0.5): # crops_list = base_root + 'utils/crops_list/' + crops_list ...
<reponame>da5nsy/SAPS<gh_stars>0 #input between 0 and 1 converted to normalised linearized output, with respect to polynomial factors import numpy as np import cmath from scipy import interpolate def linz(input): red= [1.127339114,-0.163569181,0.017654147] green= [1.107403255,-0.138534706,0.009456395...
import numpy #for numpy storage import os #to find files import time #for time to complete from sklearn.ensemble import RandomForestClassifier import pickle from statistics import mean start = time.time() #Import Training Data & Labels odata = numpy.load("Data/20ImpTrainingData.npy") data = odata.reshape(9826,(3*3*78)...
#!/usr/bin/python #-*- coding: utf-8 -*- """ This script deals with embedding creation from sentences and generation of offsets between pairs of norms. """ import logging logger = logging.getLogger(__name__) logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) import argparse im...
""" Models a simple photon travelling through 2D space and reflecting off circular mirrors at specific positions. """ from math import floor, ceil from typing import Generator, Tuple, List from sympy import Rational from sympy.geometry import Point, Ray, Circle, intersection from .turtle_helpers import * class Pho...
<reponame>Phionx/quantumnetworks """ Unittests Run using: python -m unittest tests/test_multimode.py """ import os import sys import unittest sys.path.insert(0, ".." + os.sep) from quantumnetworks import SingleModeSystem, DoubleModeSystem, MultiModeSystem from scipy.integrate import odeint import numpy as np clas...
<reponame>wmvanvliet/psychic import numpy as np from .basenode import BaseNode from ..dataset import DataSet from ..utils import get_samplerate from ..trials import erp, baseline, concatenate_trials, slice from scipy import linalg class EOGCorr(BaseNode): def __init__(self, mdict, heog='hEOG', veog='vEOG', reog='...
""" (c) 2011, 2012 Georgia Tech Research Corporation This source code is released under the New BSD license. Please see http://wiki.quantsoftware.org/index.php?title=QSTK_License for license details. This package is an implementation of a novel improvement to KNN which speeds up query times """ import math,random,sys...
<reponame>velocist/TS4CheatsInfo # uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\event_testing\common_event_tests.py # Compiled at: 2020-08-07 22:38...
r""" =============================================================================== Submodule -- molar_density =============================================================================== """ import scipy as sp def standard(phase, pore_MW='pore.molecular_weight', pore_density='pore.dens...
<reponame>cactaur/astropy-utils import astropy.units as u import matplotlib.pyplot as plt import numpy as np from scipy.stats import uniform def list_sorted(lst, ascending=True): '''Checks to see if the given list is sorted. Function returns true or false depending on if the list is sorted. It by default...
""" coral_model v3 - hydrodynamics @author: <NAME> @contributor: <NAME> """ import sys import numpy as np import os from scipy.optimize import fsolve import faulthandler import bmi.wrapper faulthandler.enable() # class Hydrodynamics: # """Interface for all hydrodynamic model modes.""" # __model = None # ...
import pickle import json from tqdm import tqdm import configparser from scipy import spatial import numpy as np import os from os import sys, path import random # sys.path.append(path.dirname(path.dirname(path.abspath(__file__)))) # from embeddings.TransE import * config = configparser.ConfigParser() config.read(...
#!/usr/bin/env python3 import sys import random from fractions import Fraction N = int(sys.argv[1]) m = int(sys.argv[2]) sigma = float(sys.argv[3]) assert m < N random.seed(int(sys.argv[-1])) R = random.randint(N+1, 5*N) def rand(): s = '%0.6f' % (1-abs(random.gauss(0, sigma))) return Fraction(s) print('%d %...
import numpy as np import scipy.sparse as sp import time import scipy.linalg as la class CLPerceptron(): S_X = np.array([[0, 1], [1, 0]], dtype=complex) S_Y = np.array([[0, complex(0, -1)], [complex(0, 1), 0]], dtype=complex) S_Z = np.array([[1, 0], [0, -1]], dtype=complex) S = np.array([S_X, S_Y, S_Z...
import os import copy import torch from tensorboardX import SummaryWriter import time import glob import re import h5py import datetime import argparse import csv import math from pathlib import Path import torch.distributed as dist from pcdet.datasets import build_dataloader from pcdet.models import build_network from...
import pandas as pd import numpy as np from scipy import interpolate from scipy.optimize import curve_fit, root_scalar import json try: import matplotlib.pyplot as plt except: pass from ._emulator import Emulator def build_emulator( file_PV_loops, period, file_EDPV = None, cycle...
<reponame>patmloi/PalettePal from PIL import Image import numpy as np from scipy.cluster.vq import whiten, kmeans import pandas as pd from typing import Union, Literal, Tuple, List def getTextColours(paletteColours: list) -> List[tuple]: textColourOptions = [(255, 255, 255), (0, 0, 0)] textColours = [] ...
<reponame>ashayp22/Logistic-Regression-with-MNIST<filename>model.py #imports from mnist import MNIST import random import numpy as np from numpy import * import matplotlib.pyplot as plt import tkinter as tk import math import time import csv import scipy from scipy import optimize from scipy.optimize import...
<filename>lenstronomywrapper/LensSystem/LensSystemExtensions/solver.py import numpy as np from lenstronomy.LensModel.lens_model import LensModel from scipy.optimize import minimize from lenstronomywrapper.LensSystem.LensSystemExtensions.solver_functions import _solve_one_image, _source_plane_delta from lenstronomywrap...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import torch import numpy as np from ogb.lsc.pcqm4m_pyg import PygPCQM4MDataset from rdkit import Chem import rdkit.Chem.AllChem as AllChem import joblib import numpy as np import math from scipy.spatial.distance import cdist # ===============...
<filename>IRtrack.py # Copyright 2018 QIMR Berghofer Medical Research Institute # import os import glob import types from collections import Sequence, namedtuple import numpy as np import scipy.io as sio import cv2 as cv class Error(Exception): pass def normFrame(data): """Convert floating poi...
""" Itt van az összes olyan felhasznált funkció, amit külön letöltött csomagban definiáltak. """ import cv2, imageio, numpy, PIL, pytest, scipy, skimage, shapely.geometry, termcolor, keras, tensorflow # valamiért nem működik # import matplotlib # formában from matplotlib.pyplot import subplots, show, ion, cla, figure,...
import mesh_to_sdf import matplotlib.pyplot as plt from drawnow import drawnow import numpy as np import argparse import pickle import trimesh from klampt.io import resource from scipy.spatial.transform.rotation import Rotation import os import sys sys.path.append("./3rdparty/bop_toolkit") sys.path.append("./3rdparty/b...
<filename>lib/pysgpp/extensions/datadriven/uq/analysis/Analysis.py # !/usr/bin/python # Copyright (C) 2013 Technische Universitaet Muenchen # This file is part of the SG++ project. For conditions of distribution and # use, please see the copyright notice at http://www5.in.tum.de/SGpp # from pysgpp.extensions.datadriven...
from __future__ import print_function, division from six import string_types, iteritems import numpy as np from scipy.sparse import csr_matrix from openmdao.api import ExplicitComponent from dymos.phases.grid_data import GridData from dymos.utils.misc import get_rate_units class ODERateComp(ExplicitComponent): ...
"""conftest.py - pytest local plugins and fixtures""" from contextlib import contextmanager from distutils.version import StrictVersion import os import sys import matplotlib as mpl import numpy as np import scipy as sp import pytest import control TEST_MATRIX_AND_ARRAY = os.getenv("PYTHON_CONTROL_ARRAY_AND_MATRIX"...
<reponame>DamienIrving/climate-analysis<filename>data_processing/calc_vrot.py<gh_stars>10-100 """ Filename: calc_vrot.py Author: <NAME>, <EMAIL> Description: Calculate the meridional wind for a rotated coordinate system """ # Import general Python modules import sys, os, re, pdb import argparse import num...
import sys from os.path import isfile, isdir, join from os import makedirs, listdir, remove import shutil import numpy as np import numpy.linalg as la import json from scipy.optimize import linear_sum_assignment from tqdm import tqdm MAX_RANGE = 300 dataset_dir = sys.argv[1] assert isdir(dataset_dir), dataset_dir pri...
<filename>dendroplot/plotting/pltprops.py #!/usr/bin/env python import numpy as np from numpy.random import randint from scipy import stats from scipy import odr import os from os.path import join import re import matplotlib.pyplot as plt from matplotlib.patches import Polygon from astropy import units as u from astro...
""" Compute pattern correlation between images Reference : Kay et al. (2015, BAMS) Author : <NAME> Date : 24 November 2020 """ ### Import modules import numpy as np import matplotlib.pyplot as plt import scipy.stats as sts import read_LENS as LL import calc_Utilities as UT import seaborn as sns from seaborn_q...
""" volreader.py Author: <NAME> Utilities for reading 3D volumetric data as a 3D OpenGL texture. """ import os import numpy as np from PIL import Image import OpenGL from OpenGL.GL import * from scipy import misc def loadVolume(dirName): """read volume from directory as a 3D texture""" # list images in di...
import sys #this is for qt5, which didn't want to compile #from PyQt5.QtWidgets import QDialog, QApplication, QPushButton, QVBoxLayout, QLineEdit, QLabel, QFileDialog, QHBoxLayout, QFrame, QGridLayout #from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas #for qt4 try this from PyQt4.QtGui i...
<reponame>ahthaide/Rasch_Model<gh_stars>0 # imports import matplotlib.pyplot as plt import numpy as np from scipy.stats import spearmanr, pearsonr from sklearn import datasets, linear_model, metrics import pandas as pd import pickle data = pd.read_csv('difficulty_.csv') # defining feature inputs and outp...
<gh_stars>1-10 # Copyright 2021 <NAME>. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
import pandas as pd import numpy as np from scipy.interpolate import interp1d def loadWind(filename, interp_kind='linear'): df = pd.read_csv(filename) altitudes = np.array(df['altitude']) # 風のu, vの方向 # U: 西→東に吹く風を正 # V: 南→北を正 wind_u = np.array(df['wind_u']) wind_v = np.array(df['wind_v']) ...
#### -——————————————— Zoom-PPG ———————————————— #### #### —————————————————————————————————————————— #### #### /\ /\ /\ /\ /\ /\ #### #### / \/\ / \ /\/ \ / \ /\ / \/ \ #### #### \/ \/ \/ \/ \/ \ #### #### —————————————————————————————————————————— #### ##...
import functools import logging import typing import numpy as np import pandas as pd from pandas.api.types import is_numeric_dtype import scipy.sparse import sklearn.utils from sklearn import preprocessing from sklearn.base import BaseEstimator from sklearn.compose import make_column_transformer from sklearn.except...
<filename>retailbox/implicit_als.py import pandas as pd import scipy.sparse as sparse import numpy as np from scipy.sparse.linalg import spsolve def implicit_weighted_als(training_set, lambda_val = 0.1, alpha = 40, iterations = 10, rank_size = 20, seed = 0): conf = (alpha*training_set) num_user = conf.sh...
import pkg_resources try: pkg_resources.get_distribution('numpy') except pkg_resources.DistributionNotFound: numpyPresent = False print("Error: Numpy package not available.") else: numpyPresent = True import numpy as np try: pkg_resources.get_distribution('pandas') except pkg_resources.Distri...
<reponame>williamhowardsnyder/OnClass import numpy as np import os #Pytorch import torch import torch.nn as nn import torch.nn.functional as F import sys from scipy.special import softmax import time import math from sklearn.metrics import roc_auc_score, average_precision_score from scipy import stats from torch.nn.m...
<gh_stars>1-10 from operator import index import os import sys sys.path.append(".") from torchvision.transforms.functional import scale import torchvision.transforms.functional as TF from utils import class_array_histogram_equalization,split_path import numpy as np import torch from torch.utils.data import DataLoader,...
import subprocess import numpy as np from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm import itertools import os from scipy import stats import csv SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) PROJECT_DIR = os.path.dirname(SCRIPT_DIR) DATA_PATH = os.pat...
<filename>Chapter09/Edge_detection_Kernel.py #Edge dection kernel #Built with SciPy #Copyright 2018 <NAME> MIT License. READ LICENSE. import matplotlib.image as mpimg import numpy as np import scipy.ndimage.filters as filter import matplotlib.pyplot as plt #I.An edge dectection kernel kernel_edge_detection = np.array...
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Tue Dec 4 16:48:57 2018 keyframes extract tool this key frame extract algorithm is based on interframe difference. The principle is very simple First, we load the video and compute the interframe difference between each frames Then, we can choose one of these thre...
import datamaker import time import os import matplotlib.pyplot as plt import numpy as np from matplotlib import pyplot import matplotlib as mpl from statistics import mean plt.style.use('seaborn-whitegrid') max_reps = 100 # How many iterations-Measurements of Spectrum frequencies = [2.407,2.412,2.417,2.422,2.427,2...
import os import random import sys from scipy import misc from data.abstract.data_set import DataSet class Inputs(DataSet): def __init__(self, config): DataSet.__init__(self) self.config = config self.training_set.x = [] self.validation_set.x = [] self.testing_set.x = [] ...
<reponame>alex-w/vplanet import numpy as np import matplotlib.pyplot as plt import vplot as vpl import sys import scipy.signal as sig import subprocess # Check correct number of arguments if (len(sys.argv) != 2): print('ERROR: Incorrect number of arguments.') print('Usage: '+sys.argv[0]+' <pdf | png>') exi...
import scipy import scipy.stats as ss import numpy as np import pandas as pd import random import math import sys import sklearn.decomposition as decomp import sklearn.linear_model as linear_model import sklearn.datasets as sk_data from sklearn.preprocessing import StandardScaler import numpy.linalg as nla import sklea...
<reponame>xrick/Lcj-DSP-in-Python<gh_stars>0 import numpy as np import wave from scipy.io.wavfile import read, write import struct import scipy.signal as signal def downsampling( x, method = 1 ): N = int( len( x ) / 2 ) y = np.zeros( N ) if method == 1: # Decimation for n in range( N ): y[n] = x[2*n] ...
# Author: <NAME> <<EMAIL>> from itertools import product from math import floor import os from warnings import catch_warnings, filterwarnings import numpy as np from numpy.testing import assert_array_equal, assert_allclose import pickle import pytest from pytest import approx import scipy.io from eelbrain import ( ...
""" Train and validate the RNN approach Author: <NAME> """ from __future__ import division, print_function, absolute_import import random from datetime import datetime from os import listdir, makedirs import numpy as np from scipy.io import loadmat, savemat from sklearn.linear_model import LogisticRegression from skl...
## Runs biophysical simulations of MF-GC network # Designed to write files to be run in parallel # on a server or cluster, but can also be used to run # individually # python run_mf_grc_network.py runID sigma NADT # Generates xml and nml files for model, saved in tempdata # To simulate, switch run to True, spike times...
""" This is a simple application for sentence embeddings: semantic search We have a corpus with various sentences. Then, for a given query sentence, we want to find the most similar sentence in this corpus. This script outputs for various queries the top 5 most similar sentences in the corpus. """ from sentence_trans...
<reponame>daniellehot/ROB10 #!/usr/bin/env python3 import sys import copy import rospy import math import numpy as np import time import open3d as o3d import cv2 import random import sys, signal from scipy.spatial.transform import Rotation as R #import actionlib import geometry_msgs.msg from geometry_msgs.msg import P...
<filename>Demos/pi0_spectra.py ############################################################### # Reconstruct the pi0 mass peak using ND MC in h5 files # # @ # ############################################################### # Includes import sys # PandAna import from pandana.core import...
<gh_stars>1-10 #!/usr/bin/env python3 """Train with 1000""" from __future__ import annotations import argparse import functools import logging import pathlib import random import typing import albumentations as A import cv2 import horovod.tensorflow.keras as hvd import numpy as np import scipy import sklearn.metrics ...
<gh_stars>1-10 #Implementation of Kmeans from scratch and using sklearn #Loading the required modules import numpy as np from scipy.spatial.distance import cdist from sklearn.datasets import load_digits from sklearn.decomposition import PCA from sklearn.cluster import KMeans from sklearn.metrics import silhouette_sco...
# -*- coding: utf-8 -*- """ Ionospheric delay analysis module """ import logging log = logging.getLogger(__name__) import numpy as np import os import re from scipy.interpolate import RegularGridInterpolator from arepytools.geometry.conversions import xyz2llh from sct.support.geometry_extended import find_ellipso...
<gh_stars>1-10 # -*- coding: utf-8 -*- """ Created on Fri Jul 28 17:39:02 2017 @author: gawe """ #import scipy as _scipy from scipy.special import jvp import numpy as _np import os as _os import matplotlib.pyplot as _plt from pybaseutils import speed_of_light import cmath # #from matplotlib.patches import Ellipse ...
<reponame>mihnea-chirila/gemx # Copyright 2019 Xilinx, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
<gh_stars>0 from __future__ import division from __future__ import print_function """ This file serves as an example of how to a) select a problem to be solved b) select a network type c) train the network to minimize recovery MSE """ import numpy as np import os import time import tensorflow as tf from...
#MCCA (Multiview Canonical Correlation Analysis) import numpy as np from scipy import linalg as lin from sklearn.preprocessing import StandardScaler class MCCA: def __init__(self,n_components=2,reg_param=0.01): self.n_components = n_components self.reg_param = reg_param self.dimen =...
# -*- coding: utf-8 -*- """ A module containing a number of functions used for performing common optical calculations """ import numpy as np import matplotlib.pyplot as plt import scipy.constants as const import seaborn as sns sns.set_style('whitegrid') def diff_limited_spot(wavelength, f,D): ...
<filename>backend/app/database/Lumerical.py<gh_stars>1-10 from app.database.db import db import mongoengine_goodjson as gj import pandas as pd import numpy as np from decimal import Decimal from sklearn.linear_model import LinearRegression from sklearn.preprocessing import PolynomialFeatures from sympy.solvers i...
<gh_stars>0 """ FILE: main_MSE_EX2.py Script performing exemplary solution of the Volterra kernel reconstruction problem for the simplified optoacoustic problem on the beam-axis assuming a Gaussian irradiation source profile, see Eq. (40) in section 1.3 "Diffraction of laser-excited acoustic pulses" in the article ...
import os import pickle import numpy as np import PIL.Image import dnnlib import dnnlib.tflib as tflib import config import scipy def main(): tflib.init_tf() # Load pre-trained network. # url = 'https://drive.google.com/uc?id=1MEGjdvVpUsu1jB4zrXZN7Y4kBBOzizDQ' # with dnnlib.util.open_url(url, cache_d...
<filename>assignment3/utils.py import numpy as np import pandas as pd #################### choosing number of k for clustering ################################ def elbow_method(k_list, X, random_state_list, save=False, filename=None, **kmeans_kwargs): """ choose number of K for k-means clustering usi...
#!/usr/bin/env python # # Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA) # # 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/li...
import scipy.sparse as sps import numpy as np from tqdm import tqdm from utils.pre_processing import norm_max_row def transitivity_boost(sim): sim_col = sps.csc_matrix(sim) print("Similarity shape: " + str(sim.shape)) for row in tqdm(range(sim.shape[0])): data_row = sim.data[sim.indptr[row]:sim.i...
''' This function calculates the kinetic energy of the structure controlled by a direct velocity feedback in series with an electronic compensator. ''' from dtApp.dtData.soton_twin import Soton_twin_data import numpy as np import scipy.linalg as la import control.matlab as ctrmat from plotly.subplots import make_subplo...
from typing import Tuple import numpy as np import globals as g from data_preprocessing.physionet_data_loader.load_physionet_dataset import get_data from scipy.io import loadmat class BCI2aIVDataLoader: """ A BCI2aIVDataLoader object does the data loading and returns it as a python object. """ def __...
#!/usr/bin/python -tt from collections import defaultdict from math import fabs, log from numpy import array import scipy.cluster.vq as scipy import argparse DEFAULT_VOWELS = set(['a','e','i','o','u','A','E','I','O','U']) FREQUENCY_PROPORTION_LOWERBOUND = 0.0000001 GLOBAL = "GLOBAL" LOCAL = "LOCAL" ANTILOCAL = "ANTIL...
from __future__ import division, print_function, absolute_import import numpy as np from scipy.sparse import csr_matrix from scipy.sparse.linalg import eigsh, inv from numpy.linalg import norm, eig from scipy.linalg import eigh from itertools import product from typing import Union class framework(object): """B...
<filename>ivf/core/sparse_interpolation/bilateral_normal_smoothing.py # -*- coding: utf-8 -*- ## @package ivf.cmds.sparse_interpolation.bilateral_normal_smoothing # # ivf.cmds.sparse_interpolation.bilateral_normal_smoothing utility package. # @author tody # @date 2016/02/03 import numpy as np from skle...
#!/usr/bin/env python # Copyright (C) 2017 Udacity Inc. # # This file is part of Robotic Arm: Pick and Place project for Udacity # Robotics nano-degree program # # All Rights Reserved. # Author: <NAME> # IK_server.py # Server script for controlling KUKA robotic arm in pick-and-place simulation. # Service takes ...