text string |
|---|
import numpy
from scipy import optimize
import math
import sys
from handwritingrecognition import data
__memoizeforward = {} # Memoize forwardpropogation
def randomtheta(layers, num_features):
# Create Theta
Theta = []
layers = list(layers)
layers.insert(0, num_features)
for i in range(len(layer... |
#-------------------------------------------------------------------------------
#
# Spherical Harmonic Expansion - Geomagnetic Model - tests
#
#
# Author: <NAME> <<EMAIL>>
#
# Original Author: <NAME> <<EMAIL>>
#-------------------------------------------------------------------------------
# Copyright (C) 2019 Geois... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Name: stream/core.py
# Purpose: mixin class for the core elements of Streams
#
# Authors: <NAME>
# <NAME>
#
# Copyright: Copyright © 2008-2015 <NAME> and the music21 Project
# Lic... |
#!/usr/bin/env python
# this script can serve as an example for post-processing voxels
# from here, you're on your own!
# note the three critical (and general) steps involved:
# 1. read voxel image to array
# 2. perform aggregation if needed and calculation of region of interest
# 3. output image with calculated metri... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Feb 2020
@author: <NAME> (<EMAIL>)
"""
##############################################################
######## EXCUTE TRAINING AND PREDICTION ########
##############################################################
import tensorflow as tf
import nump... |
<filename>py3/nn/experiments/tf_vae_pixel/resnet_viz.py
"""
Multilayer VAE + Pixel CNN
<NAME>
"""
import os, sys
sys.path.append(os.getcwd())
sys.path.append('/u/ahmedfar/Tmp/lsun_viz/nn/')
N_GPUS = 1
try: # This only matters on Ishaan's computer
import experiment_tools
experiment_tools.wait_for_gpu(tf=True,... |
from __future__ import print_function
# Usage python train_with_labels_wholedata.py number_of_data_parts_divided
# command line in developer's linux machine :
# module load cuda-8.0 using GPU
#srun -p gpu --gres=gpu:1 -c 2 --mem=20Gb python train_with_labels_wholedatax.py 9 /home/yey3/cnn_project/code3/NEPDF_data ... |
#!/usr/bin/env python3
""" Automated processing of spectramax plate-reader data """
import sys
import os
import time
import re
import json
import argparse ## https://docs.python.org/3/library/argparse.html
import yaml
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats
DEBUG = False
# latest github v... |
# Copyright 2021 AIPlan4EU project
#
# 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 wri... |
# 필요한 라이브러리 불러오기
import warnings
warnings.filterwarnings(action='ignore')
import time
from xgboost import XGBRegressor
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from sklearn.metrics import mean_squared_error
from sklearn.preprocessing import OneHotEncoder
from scipy... |
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.2'
# jupytext_version: 1.2.0
# kernelspec:
# display_name: kaggle_airbus_ships
# language: python
# name: kaggle_airbus_ships
# ---
# %% [markdown] {"_uuid": "18c... |
<filename>jetset/template_model.py<gh_stars>10-100
__author__ = "<NAME>"
from .data_loader import log_to_lin, lin_to_log
from scipy.interpolate import interp1d
import numpy as np
import os
from .spectral_shapes import SED
from .plot_sedfit import PlotSED,PlotSpecComp
from .model_parameters import ModelParamete... |
<reponame>amit17133129/pyMG-2016<filename>project/weighted_jacobi.py
# coding=utf-8
import scipy.sparse as sp
import scipy.sparse.linalg as spLA
from pymg.smoother_base import SmootherBase
class WeightedJacobi(SmootherBase):
"""Implementation of the weighted Jacobian iteration
Attributes:
P (scipy.s... |
<filename>being/serialization.py
"""Serialization of being objects.
Supports dynamic named tuples and enums but these types have to be registered
with register_named_tuple() and register_enum().
Notation:
- obj -> Python object
- dct -> JSON dict / object
Notes:
- We use OrderedDict to control key ordering for... |
import os
from os import truncate
from pathlib import Path
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
from egg.core.language_analysis import TopographicSimilarity
from egg.core import Callback
from egg.core.interaction import Interaction
import json
from typing impor... |
<filename>workflow/scripts/plot_validation_figure_by_population.py
"""
Produce all validation/test figures for all populations in a single notebook.
"""
import argparse
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import numpy as np
import pandas as pd
from scipy.stats... |
<reponame>weiya711/scadi_graph
import pytest
import time
import scipy.sparse
from sam.sim.src.rd_scanner import UncompressCrdRdScan, CompressedCrdRdScan
from sam.sim.src.wr_scanner import ValsWrScan
from sam.sim.src.joiner import Intersect2
from sam.sim.src.compute import Multiply2
from sam.sim.src.crd_manager import C... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This program computes the mean image during baseline, from injection to end of first pass and the difference between those two mean images.
Created on Mon Oct 14 19:21:50 2019
@author: slevy
"""
import dsc_utils
import nibabel as nib
import numpy as np
import argp... |
<reponame>amandadumi/OpenFermion-Cirq
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
from __future__ import absolute_import
import sys
import warnings
from typing import Any, List, Tuple, Type
import numpy as np
from pandas import DataFrame
from scipy import interpolate, signal
from scipy.stats import pearsonr
from sklearn.metrics import mean_absolute_error, mean_squared_error, r2_score
from sklearn.... |
import bisect
import os.path as osp
from collections import defaultdict
import json
import numpy as np
import scipy.linalg as LA
from scipy.ndimage import binary_dilation, generate_binary_structure
import pandas as pd
from PIL import Image
from tabulate import tabulate
from panopticapi.utils import rgb2id
from panop... |
#!/usr/bin/env python
"""
This demonstrates how to create a plot offscreen and save it to an image
file on disk.
"""
# Standard library imports
import os, sys
# Major library imports
from numpy import fabs, linspace, pi, sin
from scipy.special import jn
# Enthought library imports
from traits.api import false
from tr... |
<filename>plottingWin.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Author: <NAME>
Description: GUI for training and plotting the activation times.
"""
from pyqtgraph.Qt import QtGui, QtCore
from GuiWindowDocks import GuiWindowDocks
import numpy as np
import scipy.io as sio
import config_global as cg
"""
G... |
<reponame>hechth/vimms<filename>vimms/scripts/box_controller.py
import itertools
import random
from time import perf_counter
from vimms.Box import GenericBox, DictGrid, ArrayGrid, LocatorGrid, AllOverlapGrid, IdentityDrift
from vimms.GridEstimator import GridEstimator
from vimms.ChemicalSamplers import DatabaseFormula... |
<filename>VBDiarization_not_working/vbdiar/scoring/plda.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2018 Brno University of Technology FIT
# Author: <NAME> <<EMAIL>>
# All Rights Reserved
import h5py
import numpy as np
from scipy.io.idl import AttrDict
from scipy.sparse import coo_matrix
from v... |
# import os.path
# import torchvision.transforms as transforms
# from data.base_dataset import BaseDataset, get_transform
from data.base_dataset import BaseDataset
# from data.image_folder import make_dataset
# from PIL import Image
# import PIL
import h5py
import random
import torch
import numpy
import math
# import s... |
<reponame>siddhirane/ga-learner-dsmp-repo<gh_stars>0
# --------------
# Import packages
import numpy as np
import pandas as pd
from scipy.stats import mode
# code starts here
bank=pd.read_csv(path)
categorical_var = bank.select_dtypes(include = 'object')
print(categorical_var)
numerical_var = bank.select_dtypes(i... |
import numpy as np
import scipy as scipy
import lxmls.classifiers.linear_classifier as lc
from lxmls.distributions.gaussian import *
class GaussianNaiveBayes(lc.LinearClassifier):
def __init__(self):
lc.LinearClassifier.__init__(self)
self.trained = False
self.means = 0
# self.var... |
import os.path
import scipy.io as io
import numpy as np
_folder_path = os.path.abspath("./CVACaseStudy/CVACaseStudy/")
FILE_NAMES = (
('Training Data', 'Training.mat'),
('Faulty Case 1', 'FaultyCase1.mat'),
('Faulty Case 2', 'FaultyCase2.mat'),
('Faulty Case 3', 'FaultyCase3.mat'),
('Faulty Case 4... |
import numpy as np
from autograd import numpy as anp
from autograd import jacobian
from scipy.optimize import least_squares
from matplotlib import pyplot as plt
from utils import vmath as M
class ESVSolver(object):
def __init__(self, w, h, verbose=True):
self.w_, self.h_ = w,h
self.Fs_ = None
... |
import scipy.io.wavfile as wav
from speech_server_main.apps import SpeechServerMain
from speech_server_main.config import config
from speech_server_main import logging
audiolength = float(config.ConfigDeepSpeech().get_config("audiofilelength"))
def stt(audioPath, from_websocket=False):
try:
logging.log("I... |
""" Comparing various stopping criterion on European Call option """
from qmcpy import *
from scipy.stats import norm
def european_options(abs_tol=.5):
volatility = .2
start_price = 100
interest_rate = .05
t_final = 1
integrand = MLCallOptions(IIDStdUniform(),'european',volatility,start_price,in... |
<reponame>martenlienen/finite-element-networks
import logging
import math
import random
import subprocess
from dataclasses import dataclass
from pathlib import Path
from typing import Optional
import einops as eo
import numpy as np
import pytorch_lightning as pl
import torch
import xarray as xr
from more_itertools imp... |
<reponame>nyukhalov/CarND-Capstone
#!/usr/bin/env python
import rospy
from std_msgs.msg import Int32
from geometry_msgs.msg import PoseStamped, Pose
from styx_msgs.msg import TrafficLightArray, TrafficLight
from styx_msgs.msg import Lane
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
from light_classi... |
<filename>analysis/analysis_mine.py
import snap
from dataset import dataset_mine
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats, integrate
from pylab import *
plt.rcParams['font.sans-serif']=['Microsoft YaHei']
import seaborn as sns # for making plots
amazon_path='../dataset/com-amazon.ung... |
#!/usr/bin/python
# mating.py
# flake8: noqa
'''
Functions to implement mating operations.
'''
#other imports
from scipy.spatial import cKDTree
import numpy as np
import numpy.random as r
from operator import itemgetter as ig
from itertools import repeat, starmap
######################################
# ----------... |
<filename>similarity/similarity.py
from py2neo import Graph
from fuzzywuzzy import fuzz
import itertools
import statistics
from time import time
graph = Graph()
cut_threshold = 0.4
__VERBOSE__ = False
def walk_the_graph(walks, start, walk=None):
if start is None:
return
paths = graph.run("MATCH (s{r... |
### code written by <NAME> and reusable under MIT license ###
from statistics import mean
import json
data = {
"Bull Run Fossil Plant10-51": {
"2010": [],
"2011": [
{
"contaminant": "manganese",
"concentration": "0.4"
},
{
"contaminant": "manganese",
"conc... |
#!/usr/bin/env python
"""
main.py
Use IO + preprocessing + random seeds from https://github.com/klicperajo/ppnp
to guarantee reproducibility
"""
import os
import sys
import math
import json
import random
import argparse
import numpy as np
import pandas as pd
from time import time
import scipy.sparse ... |
__author__ = '<NAME> (<EMAIL>)'
import os
import statistics
import numpy as np
import pandas as pd
from news_popularity_prediction.datautil.feature_rw import h5load_from, h5store_at, h5_open, h5_close, get_target_value,\
get_kth_row
from news_popularity_prediction.discussion.features import get_branching_feature... |
# This code is heavily inspired by sklearn/feature_selection/_mutual_info.py,
# which was written by <NAME> <<EMAIL>> under the 3-clause
# BSD license.
#
# Author: <NAME> <<EMAIL>>
import numpy as np
from numpy.random import default_rng
from scipy.special import digamma
from sklearn.neighbors import KDTree
def get_r... |
import openpnm as op
import scipy as sp
from numpy.testing import assert_approx_equal
from numpy.testing import assert_allclose
class DiffusiveConductanceTest:
def setup_class(self):
self.net = op.network.Cubic(shape=[5, 5, 5])
self.geo = op.geometry.GenericGeometry(network=self.net,
... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA
from scipy import stats
features = ["LB", "AC", "FM", "UC", "ASTV", "MSTV", "ALTV", "MLTV", "DL"]
data = pd.read_excel("CTG.xls", sheet_nam... |
import igl
import numpy as np
from scipy.sparse import csr_matrix, diags
def cotan_weights_tets(V, T):
"""
Returns the cotan weights for a tet-mesh, implemented as described in
"Algorithms and Interfaces for Real-Time Deformation of 2D and 3D Shapes" [Jacobson, 2013]
:param V: |V|xdim Vertices of yo... |
<reponame>xishansnow/MLAPP
"""实现含噪数据的函数插值"""
import numpy as np
from scipy.sparse import spdiags
from functools import reduce
import matplotlib.pyplot as plt
from scipy import stats
D = 150 # 支撑集中共有D个点
N_OBS = 10 # 观测值的数目
X_S = np.linspace(0, 1, D) # 支撑集
PERM = np... |
import matplotlib.pyplot as plt
import pydicom
import numpy as np
from skimage.measure import label
import cv2 as cv
from scipy.signal import argrelextrema
from scipy import ndimage
import cv2
try:
from utils.LUT_table_codes import extract_parameters, get_name_from_df
except:
from LUT_table_codes import extra... |
<gh_stars>0
from math import atan, sqrt
import cv2
import numpy as np
from tunable import Selectable
class ROIDetector(Selectable):
def get_rois(self, image):
threshold = 0.5
image = image > threshold
image = (image * 255).astype(np.uint8)
# this problem is non-trivial unfortunat... |
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 27 19:30:32 2022
@author: <NAME>
"""
from PIL import Image
import numpy as np
from numpy.fft import fftn
from numpy.fft import ifftn
import math
import matplotlib.pyplot as plt
import os
from scipy.optimize import curve_fit
#TODO what is the actual dimen... |
# -*- coding: utf-8 -*-
# @Author: yulidong
# @Date: 2018-03-19 13:33:07
# @Last Modified by: yulidong
# @Last Modified time: 2018-04-07 15:14:04
import os
import torch
import numpy as np
import scipy.misc as m
import cv2
from torch.utils import data
from python_pfm import *
from rsden.utils import recursive_glob
... |
<reponame>inkyusa/SE2-3-
import torch
from utils import *
from lie_group_utils import SO3, SE3_2
import matplotlib.pyplot as plt
import numpy as np
import scipy.linalg
torch.set_default_dtype(torch.float64)
from preintegration_utils import *
def propagate(T0, P, Upsilon, Q, method, dt, g, cholQ=0):
"""Propagate ... |
<filename>sympy/core/sympify.py<gh_stars>0
"""sympify -- convert objects SymPy internal format"""
# from basic import Basic, BasicType, S
# from numbers import Integer, Real
import decimal
class SympifyError(ValueError):
def __init__(self, expr, base_exc=None):
self.expr = expr
self.base_exc = bas... |
<reponame>kim-jane/NuclearManyBody
import numpy as np
import scipy.special
class ImaginaryTime:
def __init__(self, T, dt):
self.T = T
self.dt = dt
self.num_steps = int(np.ceil(T/dt))
def display_params():
print("IMAGINARY-TIME PROPAGATION")
print("\... |
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import sys
import argparse
import scipy.stats
from matplotlib.offsetbox import AnchoredText
def remove_failed_experiments(df):
df = df.applymap(lambda x: float('nan') if x < 0 else x)
return df
def print_summary(label, insert_col, find100... |
<gh_stars>0
"""
Functions and objects describing optical components.
"""
from arch.block import Block
from arch.connectivity import Connectivity
from arch.models.model import Linear, LinearGroupDelay
from sympy import Matrix, sqrt, exp, I, eye
import arch.port as port
import numpy as np
class Beamsplitter(Block):
... |
#!/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>
# import modules
import rospy
import tf
import numpy as np
from kuka_arm.srv import *
from trajectory_msgs.msg impo... |
import numpy as np
import pandas as pd
from sklearn import datasets
from sklearn.metrics import mean_squared_error, mean_absolute_error, r2_score
from sklearn import model_selection
from sklearn import preprocessing
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from math import sqrt
import seaborn a... |
<filename>utils.py
#!/usr/bin/env python
""" Data reader and feature extracter modules for E4 offline processing
__Author__='<NAME>'
__Institution__='RASL Lab, Vanderbilt Univ'
__version__='0.1'
"""
import pandas as pd
import numpy as np
from scipy.signal import find_peaks
import scipy
import heartpy as hp
import dat... |
<gh_stars>0
#!/usr/bin/env python
# coding: utf-8
# # Clifford Alegrba Generators
# This code create the matrix representations of Clifford algebras.
# The aim of this code to provide everything you need for a Clifford module, given just its type.
#
# So far, only the simple cases are coded in, with the procedure t... |
<gh_stars>0
"""Transition class: provide transition equations and -probabilities.
TransitionFactorSettingError class: exception for unfit factor settings.
"""
import numpy as np
from scipy.stats import norm
class Transition:
"""Handle the transition equations of the different factor types for a
given setting ... |
"""
ValidationUtils - utils to help validate that arrays and data structures match.
For example in testing and comparing to a known-good run from matlab.
"""
import numbers
import numpy as np # type: ignore
import scipy.stats as sstats # type: ignore
from .structDict import MatlabStructDict
from .utils import loadMa... |
<gh_stars>0
import sympy as sp
import numpy as np
from kaa.pykodiak.pykodiak_interface import Kodiak
def test_seg_fault():
x, y = sp.Symbol('x'), sp.Symbol('y')
poly = -134960909.098539*x + 82082638596.6177*y - 4.65914220457606e-19*(1 - 6.81812756737304e+21*(-0.000785800134345946*x + y - 0.0683305085482289)**... |
<filename>scripts/paper/batch_predict.py
import sys
import os
if not os.path.join('..','..') in sys.path: sys.path.append(os.path.join('..','..'))
import pickle
import h5py
import nibabel as nib
import numpy as np
import json
from glob import glob
from scipy.ndimage import zoom
from pyapetnet.losses imp... |
<filename>examples/pitch_plots/plot_heatmap.py
"""
=======
Heatmap
=======
This example shows how to plot all pressure events from three matches as a heatmap.
"""
import matplotlib.patheffects as path_effects
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from matplotlib.colors import LinearSe... |
<reponame>IBM/S4_semantic_shift<gh_stars>1-10
# Runs all US vs UK english comparison experiments
import numpy as np
import argparse
from WordVectors import WordVectors, intersection
from alignment import align
from scipy.spatial.distance import cosine, euclidean
from noise_aware import noise_aware
from s4 import s4
fr... |
# Copyright 2021 san kim
#
# 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, soft... |
<gh_stars>1-10
# BSD 3-Clause License; see https://github.com/jpivarski/doremi/blob/main/LICENSE
from fractions import Fraction
import pytest
from lark.tree import Tree
from lark.lexer import Token
from doremi.abstract import (
AbstractNote,
Scope,
Word,
Call,
AugmentStep,
AugmentDegree,
... |
<reponame>DrawZeroPoint/VIPS<filename>python/experiments/lnpdfs/create_target_lnpfs.py<gh_stars>10-100
import numpy as np
from experiments.GMM import GMM
from scipy.stats import multivariate_normal as normal_pdf
import os
file_path = os.path.dirname(os.path.realpath(__file__))
data_path = os.path.abspath(os.path.join(... |
"""
Naming convention for matrix variables:
a_<module>
- module: {pt, sp} whether the matrix is a PyTorch or SciPy object
Sparse matrices can be converted to dense as follows:
(PyTorch) a.to_dense()
(SciPy) a.toarray()
"""
import argparse
import numpy as np
from scipy import sparse
import torch
import tor... |
<reponame>lpsinger/afterglowpy
import math
import numpy as np
import scipy.integrate as integrate
from . import shock
from . import jet
c = 2.99792458e10
me = 9.1093897e-28
mp = 1.6726231e-24
h = 6.6260755e-27
hbar = 1.05457266e-27
ee = 4.803e-10
sigmaT = 6.65e-25
Msun = 1.98892e33
cgs2mJy = 1.0e26
mJy2cgs = 1.0e-26
... |
<reponame>bcso/351SYDE
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from math import tan, cos, sin, pi
from scipy.integrate import odeint, simps, cumtrapz
##############
## y0 = yk
## y1 = theta
## y2 = px
## y3 = py
##############
def model(y, t):
yk, theta, vx, vy = y
... |
from __future__ import division, print_function, absolute_import
from numpy.testing import assert_equal, assert_raises, assert_
import time
import pytest
import ctypes
import threading
from scipy._lib import _ccallback_c as _test_ccallback_cython
from scipy._lib import _test_ccallback
from scipy._lib._ccallback impor... |
import cmath
import TransformeFourier.FFT as FFT
def usual(tab):
I = len(tab)
J = len(tab[0])
#print(tab[0])
for i in range(I):
tab[i]=FFT.usual(tab[i])
tab = transpose(tab)
for i in range(J):
tab[i]=FFT.usual(tab[i])
tab = transpose(tab)
return tab
def transpo... |
<gh_stars>1-10
import cv2
import os
import time
import gc
import glob
import json
import pprint
import joblib
import warnings
import random
import pandas as pd
import numpy as np
import seaborn as sns
import scipy as sp
import matplotlib.pyplot as plt
import lightgbm as lgb
import xgboost as xgb
impo... |
import glob
import os
from matplotlib.ticker import MultipleLocator
from scipy.stats import norm
import matplotlib as mpl
import matplotlib.pyplot as plt
from numpy import *
# from mpl_toolkits.mplot3d import Axes3D
# import matplotlib.patches as mpatches
mpl.use('Agg')
# TS sampling
def open_tsfile(file_name):
... |
<filename>smrf/spatial/grid.py
'''
2016-03-07 <NAME>
Distributed forcing data over a grid using interpolation
'''
import numpy as np
import pandas as pd
from scipy.interpolate import griddata
from scipy.interpolate.interpnd import _ndim_coords_from_arrays
from scipy.spatial import qhull as qhull
from smrf.utils.util... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 26 20:51:32 2022
@author: bennett
"""
"""
[] add gaussian IC, source
[] clean up scripts/drafts
"""
import numpy as np
import math as math
import scipy.integrate as integrate
# from numba import njit, cfunc, jit
import matplotlib.pyplot as plt
f... |
<filename>spearmint/choosers/.ipynb_checkpoints/spearprior-checkpoint.py
import sys
import os
from scipy.stats import norm
import numpy as np
import pandas as pd
class GaussianKDE():
def __init__(self, data, bandwidth=False, one_dim=True):
# create pdfs centered at different points in the input space... |
<filename>UNetRestoration/train.py
"""
Main training file
The goal is to correct the colors in underwater images.
The image pair contains color-distort image (which can be generate by CycleGan),and ground-truth image
Then, we use the u-net, which will attempt to correct the colors
"""
import tensorflow as tf
from sc... |
<gh_stars>1-10
#!/usr/bin/python
import numpy as np
import os
import sys
import math
import matplotlib
matplotlib.use('Pdf')
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
from matplotlib.backends.backend_pdf import PdfPages
import matplotlib.font_manager as fm
import loggin... |
<gh_stars>1-10
import numpy as np
import argparse
import csv
import sys
from scipy.stats import norm
from smoothed_fdr import GaussianKnown, calc_plateaus
from normix import GridDistribution, predictive_recursion, empirical_null
import signal_distributions
from utils import generate_data, ProxyDistribution
from plotuti... |
<reponame>mthoren-adi/education_tools
#
# Copyright (c) 2019 Analog Devices Inc.
#
# This file is part of libm2k
# (see http://www.github.com/analogdevicesinc/libm2k).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
#... |
import warnings
import cv2
import matplotlib.pyplot as plt
import numpy as np
import scipy
from scipy.optimize import linear_sum_assignment
def get_fast_aji(true, pred):
true = np.copy(true) # ? do we need this
pred = np.copy(pred)
true_id_list = list(np.unique(true))
pred_id_list... |
<filename>codes/AnomalyGeneration.py
import datetime
import numpy as np
from scipy.sparse import csr_matrix,coo_matrix
from sklearn.cluster import SpectralClustering
def anomaly_generation(ini_graph_percent, anomaly_percent, data, n, m, seed = 1):
np.random.seed(seed)
print('[#s] generating anomalous dataset.... |
"""
Interactive clustergram ploted with plotly API, https://plot.ly/
Users need to supply the function with username and APIkey for plotly
to enable this feature.
TODOs:
Group labels are not supported yet.
Dendrogram can not be displayed,
Colormaps haven't been costomized...
Author: <NAME>
Created on 4/8/2014
"""
... |
<filename>test.py
import os
import torch
from scipy import io
import torch.nn as nn
import torch.nn.functional as F
from sklearn.metrics import confusion_matrix
from tqdm import tqdm
import numpy as np
import argparse
import pickle
import network.cnn as CNN
import network.lstm as LSTM
import network.dataset as DS
pars... |
<filename>utils/extract_SBUKinect_GPD.py
import os
import h5py
import numpy as np
from scipy.spatial.distance import pdist
from joblib import Parallel, delayed
from sklearn.preprocessing import normalize
# version for GPD
def read_skeleton_file(file_path):
skeleton_file = open(file_path)
lines = skeleton_file... |
<gh_stars>100-1000
# vim: expandtab:ts=4:sw=4
import numpy as np
import scipy.linalg
import EKF
import pdb
class KalmanFilter3D(EKF.EKF):
"""
A simple 3D Kalman filter for tracking bounding cuboids in 3d.
The 12-dimensional state space
x, y, l, h, w, theta, Vx, Vy, Vl, Vh, Vw, Vtheta
contai... |
<reponame>renlliang3/minot
"""
This file contain a subclass of the model.py module and Cluster class. It
is dedicated to the computing of the physical properties of clusters.
"""
#==================================================
# Requested imports
#==================================================
import numpy a... |
# Copyright 2020 The TensorFlow Probability 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 law o... |
# --------------
# Import packages
import numpy as np
import pandas as pd
from scipy.stats import mode
# code starts here
bank = pd.read_csv(path, sep=',')
categorical_var = bank.select_dtypes(include = 'object')
print(categorical_var)
numerical_var = bank.select_dtypes(include = 'number')
print(numerical_var)
... |
import GPy
import numpy as np
import time
from os import getpid
import pandas as pd
import matplotlib.pyplot as plt
import scipy.spatial as spatial
from scipy import stats
from scipy.special import inv_boxcox
import multiprocessing
import math
# se cargan los datos de entrenamiento
train_data = pd.read_csv('../../GP_... |
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import numpy as np
import cv2
import glob
import os
import time
from sklearn.svm import LinearSVC
from sklearn.preprocessing import StandardScaler
from skimage.feature import hog
import pickle
from scipy.ndimage.measurements import label
from moviepy.edit... |
<filename>hera_cal/tests/test_delay_filter.py
# -*- coding: utf-8 -*-
# Copyright 2018 the HERA Project
# Licensed under the MIT License
import hera_cal.delay_filter as df
from hera_cal import io
import numpy as np
import unittest
from copy import deepcopy
from pyuvdata import UVCal, UVData
from hera_cal.data import D... |
"""
Iterative normalized least-mean-squares (NLMS) algorithm for signal recovery.
"""
from __future__ import division
import numpy as np
import numpy.linalg as npl
from scipy.io import loadmat
from scipy.io.wavfile import write as wavwrite
################################################# MAIN
# Do you want to sav... |
import os
import sys
import argparse
import json
from fractions import Fraction
from typing import List, Tuple, Dict, Set
from random import sample, choice, randint
from soadata import DataSystem, DataSystemConfig, ServiceCost
if not (sys.version_info.major == 3 and sys.version_info.minor >= 5):
print("This script... |
<filename>ablationDictionarySizeC0.py
# -*- coding: utf-8 -*-
"""
Function that learns feature model + 3layer pose models x 12 object categories
in an end-to-end manner by minimizing the mean squared error for axis-angle representation
"""
import torch
from torch import nn, optim
from torch.autograd import Variable
fr... |
<reponame>smowlavi/AnisotropicGrains
import numpy as np
from scipy.interpolate import interp2d
import scipy.io as sio
import os
from functions.elasticity_tensor import ElasticityTensor
from functions.plane_strain_modulus import PlaneStrainModulusTable
from functions.force import Force
'''
Parameters
'''
# Materials... |
<reponame>noahberthusen/heis_dynamics<filename>figure_scripts/ideal_circuit_shots.py
import numpy as np
import pandas as pd
from scipy.sparse import csc_matrix
from scipy.sparse.linalg import expm_multiply
from scipy.linalg import expm
import matplotlib.pyplot as plt
import os
import matplotlib
def FlipFlop(n, i, j):
... |
<filename>helpers/mi3gpu/utils/pre_regularize.py<gh_stars>0
#!/usr/bin/env python
#
#Copyright 2019 <NAME>.
#This file is part of Mi3-GPU.
#Mi3-GPU is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, version 3 of ... |
from __future__ import print_function, division
import numpy as np
from scipy.spatial.distance import pdist, squareform
from tqdm import trange
class SVGD:
def __init__(self):
pass
@staticmethod
def svgd_kernel(theta, h=-1):
sq_dist = pdist(theta)
pairwise_dists = squareform(sq_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.