text
string
import cv2 import numpy as np import base64 import websockets import asyncio import requests #import detector import time import xlwt from scipy import ndimage from tkinter import * window = Tk() window.title('Пишем историю для сервера') window.geometry('720x960+300+100') window.configure(bg='gray10...
import autograd.numpy as np import dxchange import h5py import matplotlib.pyplot as plt import matplotlib import warnings import datetime from math import ceil, floor try: import sys from scipy.ndimage import gaussian_filter from scipy.ndimage import fourier_shift except: warnings.warn('Some dependenci...
import re from fractions import Fraction import sys ''' Calculations for converting between metric and imperial units ''' def second_level_keys(d): o = [] for v in d.values(): o = o + list(v.keys()) return o def string_to_number(s): try: return float(s) except: try: ...
<filename>tools.py import os import numpy as np from sklearn import preprocessing from sklearn.neighbors import KDTree from scipy import io from sklearn.decomposition import PCA, IncrementalPCA import csv import random from sklearn.datasets import make_blobs import pdb from pandas import * def ij_to_vectorized_idx(i,...
<reponame>RileyWClarke/flarubin<gh_stars>0 import numpy as np import scipy.spatial as spatial import itertools from collections import deque # Solve Traveling Salesperson using convex hulls. # re-write of https://github.com/jameskrysiak/ConvexSalesman/blob/master/convex_salesman.py # This like a good explination too h...
'''############ <NAME> 6/13/18 ELEC 3800 Lab 6 Python stuffs '''############ #importing all the modules we will need import numpy as np import scipy.signal as sig import matplotlib.pyplot as plt #specify the stype of the plot to use plt.style.use('ggplot') #creates an array from 0 to 0.22, with 20 evenly spaced nume...
<gh_stars>0 '''快速分割肺,但是细节不够好''' from skimage.segmentation import clear_border from skimage.measure import label, regionprops, perimeter from skimage.morphology import ball, disk, dilation, binary_erosion, remove_small_objects, erosion, closing, \ reconstruction, binary_closing from skimage.filters import rober...
<reponame>duserzym/BiCEP_GUI<gh_stars>1-10 import pandas as pd import pandas as pd from importlib import reload # allows reloading of modules import numpy as np import matplotlib.pyplot as plt from sklearn.decomposition import PCA import ipywidgets as widgets from IPython.display import display, clear_output from impor...
# Copyright 2019 The dm_control 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 or agreed to i...
# -*- coding: utf-8 -*- from __future__ import division """ Created on Wed Mar 25 09:36:27 2020 @author: splathottam """ """PV-DER base class.""" import os import math import pdb import numpy as np import scipy from scipy.optimize import fsolve, minimize from pvder.DER_check_and_initialize import PVDER_SetupUtilit...
import sys sys.path.insert(0, "../") import random import os import pandas as pd import numpy as np import pickle import multiprocessing from scipy.stats import hypergeom from statsmodels.sandbox.stats.multicomp import fdrcorrection0 import pcst_fast import networkx as nx from networkx.algorithms.community.quality i...
# InfiniTag Copyright © 2020 AMOS-5 # Permission is hereby granted, # free of charge, to any person obtaining a copy of this software and # associated documentation files (the "Software"), to deal in the Software # without restriction, including without limitation the rights to use, copy, # modify, merge, publish, dist...
<reponame>asistradition/sparse_dot import warnings from sparse_dot_mkl._mkl_interface import (MKL, sparse_matrix_t, _create_mkl_sparse, _get_numpy_layout, debug_timer, _export_mkl, _order_mkl_handle, _destroy_mkl_handle, _type_check, ...
# -*- coding: utf-8 -*- """ .. codeauthor:: <NAME> <<EMAIL>> See: https://cs.nyu.edu/~silberman/datasets/nyu_depth_v2.html """ import argparse as ap import os from tempfile import gettempdir import urllib.request import cv2 import h5py import numpy as np from PIL import Image from scipy.io import loadmat from tqdm im...
# go-to imports import csv import cv2 import numpy as np from scipy import ndimage from sklearn.model_selection import train_test_split from sklearn.utils import shuffle # Keras imports from keras.models import Sequential from keras.layers import Flatten, Dense, Lambda, Cropping2D, Conv2D, Dropout # set up some varia...
from fractions import Fraction from math import floor from numbers import Real from typing import (List, TypeVar) from gon.discrete import Multipoint from gon.linear import Contour from gon.shaped import Polygon from hypothesis import strategies as st from hypothesis_geometry import planar from sec...
<filename>robust_depth_filter/data_utils.py import pandas as pd import numpy as np import matplotlib.pyplot as plt import glob from scipy.signal import savgol_filter from tqdm import tqdm import os import math def import_aqualoc_pressure(dataset_folder = 'aqualoc/',verbose=False,file_idx=1): type_file = 'cur...
<filename>brainbox/lfp/lfp.py # -*- coding: utf-8 -*- """ Created on Fri Mar 13 14:57:53 2020 Functions to analyse LFP signals @author: <NAME> """ from scipy.signal import welch, csd, filtfilt, butter import numpy as np def butter_filter(signal, highpass_freq=None, lowpass_freq=None, order=4, fs=2500)...
<gh_stars>100-1000 # License: BSD 3 clause import numpy as np from scipy.sparse import csr_matrix import unittest from tick.preprocessing import LongitudinalFeaturesProduct class Test(unittest.TestCase): def setUp(self): self.finite_exposures = [ np.array([[0, 1, 0], [0, 0, 0], [0, 1, 1]], dt...
<reponame>karalekas/Cirq # Copyright 2020 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 applic...
''' Hamiltonian Monte Carlo ''' from numbers import Integral, Real import numpy from scipy.stats import norm from pypuffin.decorators import accepts from pypuffin.numeric.mcmc.base import MCMCBase from pypuffin.types import Callable @accepts(numpy.ndarray, numpy.ndarray, Callable, Callable, Real, Integral) def _l...
from collections import Counter from scipy.spatial import distance from tqdm import tqdm """ K Nearest Neighbour classification """ class KNN: """ Classifier for nearest neighbours Attributes ---------- X_train : numpy array training features to initialize Y_train : numpy array ...
import scipy.stats as stats import csv file = open('../../csv_data/AQI.csv') data_iter = csv.reader(file) data = [] next(data_iter) # Skip header. for row in data_iter: data.append(float(row[0])) # print(len(data)) result = stats.exponweib.fit(data, floc = 0, f0 = 1) print(result)
<gh_stars>1-10 import os import glob import gzip import struct import pathlib import warnings from pathlib import Path from collections import OrderedDict from urllib.request import Request, urlopen import cdflib import matplotlib.dates as mdates import numpy as np import pandas as pd from matplotlib import pyplot as ...
<filename>gen_mot_data.py import os import os.path as path import argparse import subprocess from joblib import Parallel, delayed import multiprocessing import math # import cv2 import numpy as np import torch import sys sys.path.append("modules") import utils import torchvision # Importing Image module from PIL packag...
""" Test out pval correction and alternate normalisation methods""" import os import numpy as np import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from GEN_Utils import FileHandling from scipy.stats import ttest_1samp from loguru import logger logger.info('Import OK') if not os.path.exists(o...
<reponame>Jejulia/labtools<filename>labtools/plot.py from scipy.stats import ttest_ind, ttest_rel, median_test, wilcoxon, bartlett, levene, fligner from scipy.stats import f as ftest from scipy.stats.mstats import mannwhitneyu import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns ...
<filename>nirvana/data/scatter.py """ Provides a random set of utility methods. .. include:: ../include/links.rst """ import warnings from IPython import embed import numpy as np from scipy import sparse, stats, optimize from matplotlib import pyplot, patches from astropy.stats import sigma_clip from . import util...
<gh_stars>0 import numpy as np from misc.misc import open_pickle, save_pickle_data, plot_heatmap import seaborn as sns import matplotlib.pyplot as plt import matplotlib.patheffects as pe import scipy import math from statsmodels.stats.stattools import medcouple from misc.config import initialize_stm_setup line = ...
<reponame>Jie-Re/GraphGallery<gh_stars>0 import numpy as np import scipy.sparse as sp from graphgallery import functional as gf from .attacker import Attacker class FlipAttacker(Attacker): def __init__(self, graph, device="cpu", seed=None, name=None, **kwargs): super().__init__(graph, device=device, seed...
<filename>FRSVD/train.py import cv2 import os import numpy as np from scipy.linalg import svd from preprocess import * def load_dataset(name='faces96'): dir = './datasets/{}/'.format(name) people_names = os.listdir(dir) dataset = [] for key in people_names: dataset += [(cv2.imread(dir + key + ...
from scipy.spatial.distance import cosine from gensim.models.keyedvectors import KeyedVectors import csv import numpy as np from sklearn.feature_extraction.text import CountVectorizer from sklearn.metrics import accuracy_score from sklearn.metrics import classification_report import matplotlib.pyplot as plt fro...
import pandas as pd import numpy as np import pickle from textwrap import wrap import re import matplotlib.pyplot as plt from skimage import io import nltk nltk.download('vader_lexicon') nltk.download('stopwords') from nltk.corpus import stopwords from nltk.stem import SnowballStemmer from nltk.tokenize import Regexp...
#!/usr/bin/env python import os import sys import numpy as np import matplotlib.pyplot as plt from matplotlib.ticker import MultipleLocator from scipy.integrate import odeint import csv # comma separated value # sys.path.append(os.path.abspath('../')) # look in parent directory for three_point_angular_velocity serve...
from __future__ import division, print_function import numpy as np from scipy import fftpack import scipy.linalg as la try: import mkl_fft as fft has_mklfft = True except ImportError: import numpy.fft as fft has_mklfft = False def autocorr(x): """ Fast autocorrelation computation using the FFT ""...
import numpy as np, urllib2 from scipy.io import wavfile from matplotlib.pyplot import * matplotlib.pyplot.style.use(['dark_background']) #getSoundAndGraph: Script that pulls data and processes into image and audio def getSoundAndGraph(self, locate, date, time, duration, AF, FA): halfpi = 0.5*np.pi duration = ...
<filename>src/tools/tricolor_earth.py #!/usr/bin/env python3 import numpy as np import meshdd from meshdd.tools import shapes # Default values for the parameters defaults = { 'Ntheta': 501, 'Nphi': 501, 'radius': 50, 'depth': 1.2, 'sigma': 1, } def create_tricolor_earth(texture, ...
import popsims import numpy as np import matplotlib.pyplot as plt import wisps import pandas as pd import wisps.simulations as wispsim from tqdm import tqdm import astropy.units as u import numba from scipy.interpolate import griddata from popsims import galaxy def probability_of_selection(spt, snr): """ pro...
<gh_stars>10-100 # coding: utf-8 from itertools import product from collections import OrderedDict import numpy as np from sympy import Abs, S, cacheit from sympy import Indexed, Matrix, ImmutableDenseMatrix from sympy import expand from sympy.core import Basic, Symbol from sympy.core import Add, Mul, Pow from sympy...
<reponame>FSavoy/visuo-server from data.models import SkyPicture, WeatherMeasurement, MeasuringDevice from rest_framework import serializers from django.core.files import File import datetime from fractions import Fraction import exifread from data.tasks import gator, computeProjection class SkyPictureSerializer(seri...
<reponame>MattAshman/geepee import numpy as np from scipy.optimize import check_grad import copy import pdb import os import time import matplotlib matplotlib.use('Agg') import matplotlib.pylab as plt from .context import aep from .context import flatten_dict, unflatten_dict from .context import PROP_MC, PROP_MM, PROP...
<reponame>adowaconan/psychopy_experiments<gh_stars>1-10 # -*- coding: utf-8 -*- """ Created on Fri Jan 31 15:56:33 2020 @author: ning """ import pandas as pd import numpy as np from matplotlib import pyplot as plt from scipy.spatial.distance import pdist from utils import single_langauge,switching_language workin...
import warnings import numpy as np from tqdm import tqdm from scipy.cluster.vq import vq from scipy.cluster.vq import _vq from scipy.cluster.vq import _valid_miss_meth from scipy.cluster.vq import _valid_init_meth from scipy.cluster.vq import _asarray_validated def weighted_kmeans(data, w, k, p, iter=10, ...
<reponame>TimothyKBook/distributions import numpy as np from scipy.stats import binom from . import distribution class Binomial(distribution.Distribution): """ Binomial Distribution using the following parameterization: f(x | n, p) = (n p) * p**x * (1 - p)**(n - x) Parameters ---------- n : i...
import numpy as np from scipy import interpolate from cemc.wanglandau.wltools import convert_array, adapt_array import sqlite3 as sq import time class Histogram( object ): """ Class for tracking the WL histtogram and related quantities """ def __init__( self, Nbins, Emin, Emax, logger ): self....
<reponame>ChanaRoss/Thesis # mathematical imports - import numpy as np import scipy.stats as stats # graphical imports - from matplotlib import pyplot as plt import seaborn as sns import os,sys sys.path.insert(0, '/Users/chanaross/dev/Thesis/UtilsCode/') from createGif import create_gif def createProbabilityMatrix(in...
import numpy as np import random import time from matplotlib import pyplot as plt import pandas as pd from scipy.interpolate import interp1d from scipy.optimize import curve_fit from scipy.special import gammainc from itertools import islice # Initialize random number generator: np.random.seed(int(100*time.perf_counte...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Loads '.edf' data format in the data shape of EEGNet """ import numpy as np # pyEDFlib is a python library to read/write EDF+/BDF+ files based on EDFlib. import pyedflib as edf import os # to calculate mean and the standard deviation import statistics as stats impor...
<reponame>uci-cbcl/tree-hmm # -*- coding: utf-8 -*- """ Created on Sun Jun 10 10:55:55 2012 @author: <NAME> """ #!/usr/bin/env python # loopy BP for learning graphical model of chromatin modification import scipy as sp import copy from numpy import array, random, diag from math import log from vb_mf import normal...
<filename>07/part2.py from statistics import mean from math import ceil, floor input = *map(lambda s: int(s), open('input.txt').readline().split(',')), def fuel(horizontal): fuel = 0 for i in input: fuel += sum(range(1, abs(i - horizontal)+1)) return fuel horizontal = mean(input) print(min(fuel(in...
<filename>autotf/ensemble/ML/ensemble/Deep_super_learner.py import numpy as np from scipy.optimize import fmin_slsqp from sklearn.base import BaseEstimator from sklearn.metrics import log_loss from sklearn.metrics import accuracy_score from sklearn.utils.validation import check_X_y, check_array from sklearn.prepr...
""" Tools to put CP2K orbitals on a real space grid """ import os import numpy as np import scipy import scipy.io import scipy.interpolate import scipy.ndimage import time import copy import sys import re import io import ase import ase.io from .cube import Cube from .cp2k_wfn_file import Cp2kWfnFile from mpi4py...
import pickle from constant import * import torch import os import random import time from contextlib import contextmanager import numpy as np import pandas as pd from sklearn.preprocessing import MinMaxScaler import torch.nn.functional as F from scipy.special import erfinv from ordered_set import OrderedSet import sci...
from .prelude import * from . import atl_types as T from . import builtins as B from fractions import Fraction from .frontend import AST from .norm_ir import NIR, NIR_Check, NIR_Stmts, nir_is_rescale from math import gcd def lcm(x,y): return x*y // gcd(x,y) # -----------------------------------------------------...
<reponame>gift-surg/puma<filename>tests/test_case_helpers.py<gh_stars>0 import statistics from typing import Any, Collection, Iterable, List, Optional, Sized, Tuple, Union, cast from unittest import TestCase def is_empty(things: Union[Sized, Iterable[Any]]) -> bool: """Returns true if the given container is empty...
""" Tue Jan 26th Goal - code to calculate total number of frames in each video to see max and min and also to calculate max number of frames masked """ import os import pathlib from pprint import pprint import numpy as np from scipy import stats from scipy.spatial import distance import matplotlib.pyplot as plt fr...
# MIT License # # Copyright (c) 2020 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publi...
<reponame>fkwai/geolearn<gh_stars>0 import scipy import os from hydroDL import pathSMAP from hydroDL.utils.app import ecoReg_ind from hydroDL.data import dbCsv from hydroDL import master from hydroDL.post import figplot, stat import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import ListedColorma...
from abc import ABC from abc import abstractmethod from copy import deepcopy import itertools import numpy as np from autode.bond_lengths import get_avg_bond_length from autode.calculation import Calculation from autode.exceptions import AtomsNotFound, NoClosestSpecies, FitFailed from autode.log import logger from auto...
import pandas as pd # import Lagrange interpolation functions from scipy.interpolate import lagrange df = pd.read_excel("nan.xlsx") # name A B C # 0 a 56.0 87.0 90.0 # 1 b NaN 89.0 78.0 # 2 c 67.0 66.0 75.0 # 3 d 97.0 NaN NaN # 4 e NaN 92.0 74.0 # 5 f 82.0 75.0 N...
import scipy.io import numpy as np from collections import OrderedDict from src.generate_CCF import genCCF from src.predict_from_CCF import predictFromCCF from src.plotting.plot_surface import plotCCFRegDecisionSurface # Sample Camel6 Data Testing script # ----------------------Use optionsClassCCF-------------------...
<filename>core/lattice_enumeration.py """ Finds all non-zero vectors in a lattice that are shorter than a given distance from the origin. If argument for distance is empty then finds the shortest vector precisely (i.e. non-approximation like LLL). """ from core.log_util import log import numpy as np from core.norms im...
<reponame>omuryorulmaz/kriptografi<filename>vize/100401053.py import random import secrets import math import functions import sympy import os # <NAME> 100401053 # <NAME> def keygen(n): w=[];wtotal=0;rcontrol=0;controlPrime=0 y=secrets.randbits(32) w.append(y) while len(w)!=8: total=0 total=sum(w) ...
import pandas as pd from datetime import datetime import numpy as np from scipy.io.arff import loadarff import os def data_remove_zero(repo_name, directory): df_raw = pd.read_csv(directory + repo_name, sep=',') df_raw = df_raw.drop(columns=['monthly_commit_comments']) for index, row in df_raw.iterrows(): ...
# A Python 2.7 library to simulate AB tests and analyze results. ############################################################################### # Copyright 2016 Intuit # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtai...
from typing import Any, Dict, Union import numpy as np from scipy.spatial.distance import cosine from scipy.stats import spearmanr from .base_metric import BaseMetric from ..query import Query from ..word_embedding_model import PreprocessorArgs, WordEmbeddingModel class ECT(BaseMetric): """An implementation of ...
<gh_stars>1-10 # -*- encoding:utf-8 -*- """ 对各个依赖库不同版本,不同系统的规范进行统一以及问题修正模块 """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import numbers import sys import matplotlib import numpy as np import pandas as pd import scipy import sklea...
# -*- coding: utf-8 -*- """ Created on Mon Feb 7 14:49:42 2021 @author: gabri Me baseei muito nas aulas 54, 55 e em seus respectivos notebooks """ import numpy as np import matplotlib.pyplot as plt from scipy.stats import norm from scipy import signal # Frequencia de amostragem e vetor temporal fs = 2000 time = ...
<filename>well_NIPS18.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Apr 19 09:04:27 2018 @author: jeremiasknoblauch Description: Well-log data processing """ """System packages/modules""" import numpy as np import scipy import matplotlib.pyplot as plt import csv import datetime import matplotl...
import argparse import os import random import sys import time import struct from collections import Counter from collections import deque from operator import itemgetter from tempfile import NamedTemporaryFile as NTF import SharedArray as sa import numpy as np from numba import jit from text_embedding.documents import...
''' Copyright (c) <NAME>, <NAME> All rights reserved ''' import numpy as np import math from scipy import signal from ext import utils from ext import features #import spectrum2scaletime, scaletime2scalerate, scalerate2cortical, waveform2auditoryspectrogram import matplotlib.pylab as plt def load_static_params(): ...
import numpy as np from scipy.special import logsumexp class BaseLayer: '''Basic layout of the layers''' def __init__(self): pass def forward(self): pass def update_params(self): pass class Dense(BaseLayer): def __init__(self, in_features, out_features,...
<gh_stars>0 import numpy as np import matplotlib.pyplot as plt from pandas.io.parsers import read_csv import scipy.optimize as opt from scipy.io import loadmat from sklearn.preprocessing import PolynomialFeatures def gradient(thetas, X, Y, lamb): m = np.shape(X)[0] H = h(thetas, X) grad = (1/m) * np.dot(...
<reponame>ipc-sim/rigid-ipc<filename>comparisons/STIV/src/autogen/utils.py """Utilities for generating C code from symbolic Python.""" import os from sympy import Function, simplify, cse, numbered_symbols from sympy.matrices import MatrixSymbol from sympy.printing.ccode import C99CodePrinter assert_ = Function('assert...
<reponame>janbodnar/Python-Course #!/usr/bin/python from sympy import pprint, Symbol, sin, cos x = Symbol('x') y = Symbol('y') z = Symbol('z') expr = x**3 + 4*x*y - z val = expr.subs([(x, 2), (y, 4), (z, 0)]) print(val)
""" Created on Fri Feb 17 15:26:03 2017 @author: hum094 """ """ Functions related to the loading and processing of CCNC data from DMT version: 1.1 date: 2017-03-23 Search for "xkcd" to find sections of the code that need attention Things to do: - simplify the execution functions (breaking up into reada...
#!/usr/bin/python import numpy as np from EKF_with_HMM import EKF_with_HMM from scipy.stats import multivariate_normal from image_projection import ImageProjection import logging logger = logging.getLogger(__name__) class Tracker: def __init__(self, ekf_sensor_noise, hmm_observation_model, use_h...
import numpy as np import scipy.io as sio import matplotlib.pyplot as plt from Alignment.SyntheticCurves import * from Alignment.AlignmentTools import * from Alignment.DTWGPU import * from Alignment.ctw.CTWLib import * from Alignment.AllTechniques import * from mpl_toolkits.mplot3d import Axes3D def doExperiment(N, NP...
<reponame>ajdillhoff/3dhpe-udd import sys import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as colors from scipy.interpolate import interp1d from matplotlib import cm from utils.util import get_errors FONT_SIZE_XLABEL = 15 FONT_SIZE_YLABEL = 15 FONT_SIZE_LEGEND = 11.8 FONT_SIZE_TICK = 11.8 ...
""" Implementation of the FFTlog algorithm, very much inspired by mcfit (https://github.com/eelregit/mcfit) and implementation in https://github.com/sfschen/velocileptors/blob/master/velocileptors/Utils/spherical_bessel_transform_fftw.py """ import os import warnings import numpy as np class FFTlog(object): r""...
<filename>oldversion/train_rf.py import pickle import pandas as pd import numpy as np from sklearn import svm from sklearn.ensemble import RandomForestClassifier from classifier_evaluator import classifier_evaluator from sklearn.model_selection import train_test_split from scipy.io import loadmat import h5py #######...
# SPDX-License-Identifier: MIT ''' File containing mathematical tools ''' import math import numpy as np import scipy.integrate as integrate # *** COEFFICIENTS FOR FINITE DIFFERENCE *** dic_coeff_FD = {} # *** Finite differences for first and second derivative at 2th order *** denom = 2. dic_coeff_FD['[1,2],centered...
<reponame>tytechortz/denver-temp-dash<filename>app2.py import dash import dash_core_components as dcc import dash_html_components as html import dash_table as dt import plotly.graph_objs as go from dash.dependencies import Input, Output, State from datetime import datetime, date, timedelta import json, csv, dash_table,...
from hparams import hougen_hparams as hp # from utils import * import os import re import random import matplotlib.pylab as plt from scipy.io.wavfile import write import numpy as np import torch import torch.utils.data from torch.utils.data import DataLoader from audio_processing import griffin_lim import layers fro...
""" Implementations of metrics are based on https://github.com/xuqiantong/GAN-Metrics/blob/master/metric.py """ import torch import numpy as np import scipy.linalg def inception_score(samples, eps=1e-20): X = samples kl = X * ((X + eps).log() - (X.mean(0)+eps).log().expand_as(X)) score = kl.sum(1).mean()....
<reponame>tekhnus/misc<filename>funny/rhythm-patterns/models/__init__.py from fractions import gcd from itertools import cycle, islice from collections import OrderedDict from xml.etree import ElementTree as trees class Rhythm: def __init__(self, name, *args): self.name = name self.braids = args ...
<filename>data/3d_linear_system/main_linear_3d.py """ code for generating data and closure data for 3D linear system with x_1 as resolved x_2 as unresolved A = | 0 -1 -1 | | 0.5 -1.1 1.5 | | 1 -3 0.5 | x0 = [3 0 0] with 4000 snapshots and tot = 40 """ import os import numpy as np import scipy.spa...
""" Is the hessian even supported by pyipopt? There is a comment here http://www.wstein.org/home/wstein/www/home/was/patches/ openopt-0.24/src/openopt/solvers/CoinOr/ipopt_oo.py suggesting that the pyipopt hessian support may be buggy. Also check some bug reports here: http://code.google.com/p/pyipopt/issues/list ?can...
<reponame>vishalbelsare/cplvm import functools import warnings import matplotlib.pyplot as plt import numpy as np import seaborn as sns import pandas as pd import os from scipy.stats import poisson from scipy.special import logsumexp from sklearn.neighbors import DistanceMetric from sklearn.decomposition import PCA fr...
<gh_stars>0 import numpy as np import pandas as pd from scipy import ndimage from tqdm import tqdm import os import csv ### GLOBAL CONSTANTS ### SIM_ALL_MODELS = False SAVE_ACCURACIES = False SAVE_PATH = './' OUTPUT_FILE_NAME = 'Extra_Pruned_Ensemble_Accuracies.csv' #Function to check if starting frame is a solution ...
import numpy as np import pandas as pd import os import sys from scipy.stats import linregress # pyburst from pyburst.burst_analyser import burst_tools from pyburst.grids import grid_tools, grid_analyser, grid_strings from pyburst.kepler import kepler_tools def predict_qnuc(params, source, linr_table=None, grid_vers...
# https://dash.plot.ly/dash-core-components import dash # contains widgets that can be dropped into app import dash_core_components as dcc import dash_html_components as html import plotly.graph_objs as go from dash.dependencies import Input, Output, State import pandas as pd import pickle # new imports #pip install ...
<reponame>ScienceStacks/JViz """ Tests for slope """ from slope import slope import unittest import numpy as np import scipy as sp ############################# # Tests ############################# # pylint: disable=W0212,C0111,R0904 class TestIntercept(unittest.TestCase): def testBasics(self): SIZE = 100 ...
<reponame>EugeneNdiaye/Gap_Safe_Rules import numpy as np from numpy.linalg import norm from intercept_sparse_cd_lasso_fast import cd_lasso from intercept_sparse_cd_lasso_fast import matrix_column_norm # from scdl_fast import cd_lasso from scipy.sparse import csc_matrix from sklearn.linear_model import lasso_path NO_SC...
import numpy as np from scipy import stats from config import * class MonteCarloHW2: @staticmethod def generate_samples(): ''' stock_matrix: (252 * 10000) pathwise sample stock price under BSM framework d_st_d_sigma_matrix: (252 * 10000) the derivative of stock by sigma for c...
<filename>py/legacyanalysis/transients.py<gh_stars>10-100 import pylab as plt import numpy as np from astrometry.util.fits import * from astrometry.libkd.spherematch import match_radec import fitsio import os from collections import Counter from scipy.ndimage.measurements import label, find_objects import time #import...
<filename>utils/polygon_2d.py import torch from scipy import interpolate import numpy as np class Polygon2d(object): def __init__(self, polygonal_chain): """ This class represents polygonal chain, polygons are stored as polygonal chains as well as their projection to a tangent space similar to the...
<reponame>oraisa/masters-thesis<gh_stars>0 # MIT License # Copyright (c) 2019 DPBayes # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the ...
<reponame>kkraoj/lfmc_for_ignitions<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Mon May 25 22:33:04 2020 @author: kkrao """ import pandas as pd from init import dir_data, lc_dict, color_dict import seaborn as sns import os import numpy as np import matplotlib.pyplot as plt from scipy.stats import mannwhitneyu ...
<filename>Graph-NN.py #!/usr/bin/env python # coding: utf-8 # # Initialize Pytorch # In[1]: import torch import torch.nn as nn import torchvision.datasets as dsets import torchvision.transforms as transforms from torch.autograd import Variable import pandas as pd import numpy as np from numpy import genfromtxt impo...