code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import numpy as np
from UQpy.surrogates.kriging.regression_models.baseclass.Regression import Regression
class LinearRegression(Regression):
def r(self, s):
s = np.atleast_2d(s)
fx = np.concatenate((np.ones([np.size(s, 0), 1]), s), 1)
jf_b = np.zeros([np.size(s, 0), np.size(s, 1), np.size(... | [
"numpy.size",
"numpy.einsum",
"numpy.atleast_2d"
] | [((175, 191), 'numpy.atleast_2d', 'np.atleast_2d', (['s'], {}), '(s)\n', (188, 191), True, 'import numpy as np\n'), ((336, 362), 'numpy.einsum', 'np.einsum', (['"""jii->ji"""', 'jf_b'], {}), "('jii->ji', jf_b)\n", (345, 362), True, 'import numpy as np\n'), ((282, 295), 'numpy.size', 'np.size', (['s', '(0)'], {}), '(s, ... |
import numpy as np
from random import shuffle
import pandas as pd
import os
from FAE.DataContainer.DataContainer import DataContainer
class DataSeparate:
def __init__(self):
pass
def __SetNewData(self, data_container, case_index):
array, label, feature_name, case_name = data_container.GetDat... | [
"FAE.DataContainer.DataContainer.DataContainer",
"random.shuffle",
"numpy.max",
"numpy.where",
"os.path.join"
] | [((3064, 3079), 'FAE.DataContainer.DataContainer.DataContainer', 'DataContainer', ([], {}), '()\n', (3077, 3079), False, 'from FAE.DataContainer.DataContainer import DataContainer\n'), ((3269, 3284), 'FAE.DataContainer.DataContainer.DataContainer', 'DataContainer', ([], {}), '()\n', (3282, 3284), False, 'from FAE.DataC... |
import unittest
import numpy as np
import gobenchplot.plot as plot
import gobenchplot.benchmark as benchmark
import gobenchplot.inputs as inputs
from collections import namedtuple
class TestPlotData(unittest.TestCase):
def test_eq(self):
TestCase = namedtuple(
'TestCase', 'a b expect_eq')
... | [
"unittest.main",
"gobenchplot.plot.get_bar_widths",
"numpy.array_equal",
"gobenchplot.plot.bench_res_data",
"gobenchplot.plot.get_bar_spacing_adjustment",
"numpy.dtype",
"gobenchplot.benchmark.SplitRes",
"numpy.array",
"collections.namedtuple",
"gobenchplot.plot.build_plot_fn"
] | [((11783, 11798), 'unittest.main', 'unittest.main', ([], {}), '()\n', (11796, 11798), False, 'import unittest\n'), ((263, 302), 'collections.namedtuple', 'namedtuple', (['"""TestCase"""', '"""a b expect_eq"""'], {}), "('TestCase', 'a b expect_eq')\n", (273, 302), False, 'from collections import namedtuple\n'), ((1551, ... |
import glob
import os
from enum import auto, IntFlag
import tkinter as tk
import cv2
import numpy as np
from data_management.phase_tkinter_class import PipelinePhase
class Application(PipelinePhase):
"""
This applications purpose is to clip out inline images and other art or writting errors surrounded by ha... | [
"cv2.multiply",
"tkinter.Button",
"cv2.cvtColor",
"cv2.imwrite",
"os.path.basename",
"numpy.zeros",
"cv2.fillPoly",
"numpy.array",
"os.path.splitext",
"glob.glob",
"enum.auto",
"os.path.join",
"tkinter.Tk"
] | [((8312, 8319), 'tkinter.Tk', 'tk.Tk', ([], {}), '()\n', (8317, 8319), True, 'import tkinter as tk\n'), ((1334, 1364), 'tkinter.Button', 'tk.Button', (['self.controls_frame'], {}), '(self.controls_frame)\n', (1343, 1364), True, 'import tkinter as tk\n'), ((1535, 1565), 'tkinter.Button', 'tk.Button', (['self.controls_fr... |
"""
University of Minnesota
Aerospace Engineering and Mechanics - UAV Lab
Copyright 2019 Regents of the University of Minnesota
See: LICENSE.md for complete license details
Author: <NAME>
Example script for generating Schroeder type Multisine Excitations.
"""
import numpy as np
import matplotlib.pyplot as plt
# Hac... | [
"numpy.ones",
"json.dumps",
"matplotlib.pyplot.figure",
"os.path.dirname",
"Core.FreqTrans.OptSpect",
"Core.GenExcite.MultiSineComponents",
"Core.GenExcite.MultiSine",
"numpy.log10",
"matplotlib.pyplot.subplots",
"numpy.ones_like",
"matplotlib.pyplot.show",
"matplotlib.pyplot.legend",
"matpl... | [((1254, 1370), 'Core.GenExcite.MultiSineComponents', 'GenExcite.MultiSineComponents', (['freqMinDes_rps', 'freqMaxDes_rps', 'freqRate_hz', 'numCycles', 'freqStepDes_rps', 'methodSW'], {}), '(freqMinDes_rps, freqMaxDes_rps, freqRate_hz,\n numCycles, freqStepDes_rps, methodSW)\n', (1283, 1370), False, 'from Core impo... |
"""
Calibration Plot Widget
-----------------------
"""
from collections import namedtuple
import numpy as np
from AnyQt.QtWidgets import QListWidget
import pyqtgraph as pg
import Orange
from Orange.widgets import widget, gui, settings
from Orange.widgets.evaluate.utils import check_results_adequacy
from Orange.wi... | [
"Orange.widgets.gui.listBox",
"Orange.widgets.evaluate.utils.check_results_adequacy",
"Orange.widgets.widget.Input",
"numpy.argsort",
"numpy.exp",
"AnyQt.QtWidgets.QApplication",
"Orange.widgets.settings.Setting",
"numpy.zeros_like",
"pyqtgraph.GraphicsView",
"numpy.linspace",
"pyqtgraph.mkPen",... | [((449, 480), 'collections.namedtuple', 'namedtuple', (['"""Curve"""', "['x', 'y']"], {}), "('Curve', ['x', 'y'])\n", (459, 480), False, 'from collections import namedtuple\n'), ((494, 554), 'collections.namedtuple', 'namedtuple', (['"""PlotCurve"""', "['curve', 'curve_item', 'rug_item']"], {}), "('PlotCurve', ['curve'... |
# -*- coding: utf-8 -*-
"""
Created on 2020/9/14
@project: SPAIC
@filename: Torch_Backend
@author: <NAME>
@contact: <EMAIL>
@description:
"""
from .Backend import Backend, backends
import torch
import numpy as np
# from torch import fx
#from torch.nn import Module, Parameter
import torch.nn.functional as fn
from typing... | [
"torch.scatter",
"torch.relu",
"torch.bmm",
"torch.sparse.mm",
"torch.nn.init.uniform_",
"torch.fx.symbolic_trace",
"torch.empty",
"torch.cat",
"torch.nn.functional.unfold",
"torch.cos",
"torch.nn.init.constant_",
"torch.no_grad",
"torch.ones",
"torch.nn.init.kaiming_normal_",
"torch.sin... | [((2794, 2824), 'torch.fx.symbolic_trace', 'fx.symbolic_trace', (['self.engine'], {}), '(self.engine)\n', (2811, 2824), False, 'from torch import fx\n'), ((8364, 8381), 'torch.cat', 'torch.cat', (['x', 'dim'], {}), '(x, dim)\n', (8373, 8381), False, 'import torch\n'), ((8903, 8924), 'torch.sum', 'torch.sum', (['x'], {'... |
# importint packages
import numpy as np
import itertools as it
from scipy import optimize
from tqdm import tqdm
# question 1 #
#defining f as in the ipynb file
def f(c = 1, l = 1, v = 10, epsilon = 0.3):
return np.log(c) - v*(l**(1+1/epsilon))/(1+1/epsilon)
# Defining a function that will solve the model.
def so... | [
"numpy.random.uniform",
"scipy.optimize.minimize",
"numpy.fmax",
"numpy.random.seed",
"numpy.log",
"scipy.optimize.minimize_scalar",
"numpy.array"
] | [((936, 952), 'numpy.array', 'np.array', (['[1, 1]'], {}), '([1, 1])\n', (944, 952), True, 'import numpy as np\n'), ((981, 1071), 'scipy.optimize.minimize', 'optimize.minimize', (['obj', 'initial_guess'], {'method': '"""SLSQP"""', 'bounds': 'bounds', 'constraints': 'cons'}), "(obj, initial_guess, method='SLSQP', bounds... |
import pytest
from periodic_table.element import Element, box_fraction_line
from scipy import integrate
import numpy as np
np.random.seed(0)
# I could do more tests by doing direct plot comparisons, but I don't think those are
# really necessary for a project this simple. Maybe later...
def test_fracs_in_range():... | [
"numpy.random.uniform",
"numpy.minimum",
"numpy.random.seed",
"periodic_table.element.box_fraction_line",
"scipy.integrate.quad",
"periodic_table.element.Element",
"pytest.raises",
"numpy.isclose"
] | [((126, 143), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (140, 143), True, 'import numpy as np\n'), ((485, 519), 'periodic_table.element.Element', 'Element', (['"""H"""', '(1)', '(1)', '(1)'], {'frac_bb': '(1.0)'}), "('H', 1, 1, 1, frac_bb=1.0)\n", (492, 519), False, 'from periodic_table.element imp... |
def selection_7():
# Library import
import numpy
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
# Library version
matplotlib_version = matplotlib.__version__
numpy_version = numpy.__version__
# Histo binning
xBinning = numpy.lin... | [
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"numpy.array",
"matplotlib.pyplot.rc",
"numpy.linspace",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.ylabel",
"matplotlib.gridspec.GridSpec",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig"
] | [((311, 359), 'numpy.linspace', 'numpy.linspace', (['(750.0)', '(6000.0)', '(21)'], {'endpoint': '(True)'}), '(750.0, 6000.0, 21, endpoint=True)\n', (325, 359), False, 'import numpy\n'), ((419, 620), 'numpy.array', 'numpy.array', (['[881.25, 1143.75, 1406.25, 1668.75, 1931.25, 2193.75, 2456.25, 2718.75, \n 2981.25, ... |
from collections import defaultdict
from typing import Dict, List, Any
import numpy as np
import pandas as pd
from dataclasses import dataclass
from ira.series.Indicators import ATR
from ira.simulator.SignalTester import Tracker
from ira.strategies.exec_core_api import Quote
class TakeStopTracker(Tracker):
"""
... | [
"ira.strategies.exec_core_api.Quote",
"numpy.isfinite",
"numpy.sign",
"collections.defaultdict",
"numpy.isnan",
"numpy.mean",
"pandas.Timedelta",
"ira.series.Indicators.ATR"
] | [((6048, 6093), 'ira.strategies.exec_core_api.Quote', 'Quote', (['np.nan', 'np.nan', 'np.nan', 'np.nan', 'np.nan'], {}), '(np.nan, np.nan, np.nan, np.nan, np.nan)\n', (6053, 6093), False, 'from ira.strategies.exec_core_api import Quote\n'), ((6692, 6713), 'numpy.isfinite', 'np.isfinite', (['quantity'], {}), '(quantity)... |
# ===============================================================================
# Copyright 2012 <NAME>
#
# 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/... | [
"numpy.array",
"Image.open"
] | [((1423, 1439), 'Image.open', 'Image.open', (['path'], {}), '(path)\n', (1433, 1439), False, 'import Image\n'), ((1514, 1523), 'numpy.array', 'array', (['im'], {}), '(im)\n', (1519, 1523), False, 'from numpy import array\n')] |
# Author: <NAME>
# Email: <EMAIL>
import tensorflow as tf
import os
import cv2
import numpy as np
from models.face.mtcnn.detector import mtcnn_detector
from models.face.alignment.alignment import transform
def crop_align(input_dir, output_dir, model, threshold, minisize, factor):
'''
crop_align(datasets, mod... | [
"os.mkdir",
"models.face.mtcnn.detector.mtcnn_detector",
"cv2.imwrite",
"os.path.exists",
"numpy.argsort",
"cv2.imread",
"models.face.alignment.alignment.transform",
"os.path.join",
"os.listdir"
] | [((719, 769), 'models.face.mtcnn.detector.mtcnn_detector', 'mtcnn_detector', (['model', 'threshold', 'minisize', 'factor'], {}), '(model, threshold, minisize, factor)\n', (733, 769), False, 'from models.face.mtcnn.detector import mtcnn_detector\n'), ((787, 808), 'os.listdir', 'os.listdir', (['input_dir'], {}), '(input_... |
# coding: utf-8
# In[ ]:
import numpy as np
import matplotlib.pyplot as plt
# In[ ]:
x = np.linspace(0,2*np.pi,1000)
y = (5.5)*np.cos(2*x) + 5.5
z = 0.02*np.exp(x)
w = (0.25)*(x**2) + 0.1*np.sin(10*x)
# In[ ]:
plt.plot(x,y)
plt.plot(x,z)
plt.plot(x,w)
plt.xlabel('Time in ASTR119')
plt.ylabel('Level of Awe... | [
"matplotlib.pyplot.plot",
"numpy.sin",
"numpy.exp",
"numpy.linspace",
"numpy.cos",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
] | [((97, 128), 'numpy.linspace', 'np.linspace', (['(0)', '(2 * np.pi)', '(1000)'], {}), '(0, 2 * np.pi, 1000)\n', (108, 128), True, 'import numpy as np\n'), ((223, 237), 'matplotlib.pyplot.plot', 'plt.plot', (['x', 'y'], {}), '(x, y)\n', (231, 237), True, 'import matplotlib.pyplot as plt\n'), ((237, 251), 'matplotlib.pyp... |
"""cogeo_tiler.handler: handle request for cogeo-tiler."""
import io
import json
import os
import urllib.parse
from typing import Any, Dict, Optional, Tuple, Union
import numpy
import rasterio
from boto3.session import Session as boto3_session
from lambda_proxy.proxy import API
from rasterio.session import AWSSession... | [
"io.BytesIO",
"lambda_proxy.proxy.API",
"numpy.save",
"rio_tiler.utils.geotiff_options",
"rio_tiler.colormap.cmap.get",
"os.path.basename",
"json.dumps",
"rasterio.Env",
"rio_tiler.utils.render",
"boto3.session.Session",
"rio_tiler.io.COGReader"
] | [((586, 609), 'lambda_proxy.proxy.API', 'API', ([], {'name': '"""cogeo-tiler"""'}), "(name='cogeo-tiler')\n", (589, 609), False, 'from lambda_proxy.proxy import API\n'), ((643, 658), 'boto3.session.Session', 'boto3_session', ([], {}), '()\n', (656, 658), True, 'from boto3.session import Session as boto3_session\n'), ((... |
#%%
import os
import sys
try:
os.chdir('/Volumes/GoogleDrive/My Drive/python_code/connectome_tools/')
sys.path.append('/Volumes/GoogleDrive/My Drive/python_code/maggot_models/')
sys.path.append('/Volumes/GoogleDrive/My Drive/python_code/connectome_tools/')
except:
pass
from pymaid_creds import url, nam... | [
"pandas.DataFrame",
"connectome_tools.process_graph.Analyze_Nx_G",
"pymaid.CatmaidInstance",
"sys.path.append",
"seaborn.heatmap",
"numpy.concatenate",
"pymaid.get_annotated",
"pandas.read_csv",
"connectome_tools.process_matrix.Promat.load_pairs_from_annotation",
"numpy.setdiff1d",
"pymaid.get_s... | [((875, 925), 'pymaid.CatmaidInstance', 'pymaid.CatmaidInstance', (['url', 'token', 'name', 'password'], {}), '(url, token, name, password)\n', (897, 925), False, 'import pymaid\n'), ((933, 1018), 'pandas.read_csv', 'pd.read_csv', (['"""VNC_interaction/data/brA1_axon-dendrite.csv"""'], {'header': '(0)', 'index_col': '(... |
import numpy as np
import time
from tqdm.autonotebook import tqdm
from scipy.linalg import sqrtm
import logging
try:
import mosek.fusion as msk
except ImportError:
pass
def dyn_no_lips_pos(X, W0, dagness_exp, dagness_pen, l1_pen, eps=1e-4, mosek=True, max_iter=500,
verbose=False, logging_d... | [
"numpy.trace",
"numpy.maximum",
"numpy.abs",
"numpy.sum",
"mosek.fusion.Model",
"numpy.linalg.norm",
"mosek.fusion.Expr.flatten",
"logging.warning",
"mosek.fusion.Domain.inPPowerCone",
"mosek.fusion.Expr.dot",
"mosek.fusion.Domain.inRotatedQCone",
"mosek.fusion.Domain.greaterThan",
"mosek.fu... | [((2599, 2610), 'time.time', 'time.time', ([], {}), '()\n', (2608, 2610), False, 'import time\n'), ((2622, 2684), 'tqdm.autonotebook.tqdm', 'tqdm', ([], {'desc': '"""Causal Lasso for positive weights"""', 'total': 'max_iter'}), "(desc='Causal Lasso for positive weights', total=max_iter)\n", (2626, 2684), False, 'from t... |
"""
Classses representing GLSL objects (functions, variables, etc) that may be
composed together to create complete shaders.
See the docstring of Function for details.
Details
-------
A complete GLSL program is composed of ShaderObjects, each of which may be used
inline as an expression, and some of which include a ... | [
"numpy.isscalar",
"re.sub"
] | [((18571, 18604), 're.sub', 're.sub', (['search', "(val + '\\\\1')", 'code'], {}), "(search, val + '\\\\1', code)\n", (18577, 18604), False, 'import re\n'), ((23400, 23418), 'numpy.isscalar', 'np.isscalar', (['value'], {}), '(value)\n', (23411, 23418), True, 'import numpy as np\n')] |
import os
import glob
import copy
import numpy as np
import Bio
import scipy.spatial
import itertools as it
# create dictionaries of amino acids and codons
gencode = {
'ATA':'I', 'ATC':'I', 'ATT':'I', 'ATG':'M',
'ACA':'T', 'ACC':'T', 'ACG':'T', 'ACT':'T',
'AAC':'N', 'AAT':'N', 'AAA':'K', 'AAG':'K',
... | [
"numpy.sum",
"numpy.log",
"numpy.copy",
"numpy.argmax",
"numpy.zeros",
"copy.copy",
"numpy.sort",
"numpy.array"
] | [((4471, 4482), 'numpy.zeros', 'np.zeros', (['(1)'], {}), '(1)\n', (4479, 4482), True, 'import numpy as np\n'), ((10655, 10666), 'numpy.zeros', 'np.zeros', (['(1)'], {}), '(1)\n', (10663, 10666), True, 'import numpy as np\n'), ((10885, 10901), 'numpy.copy', 'np.copy', (['weights'], {}), '(weights)\n', (10892, 10901), T... |
# Author: Yubo "Paul" Yang
# Email: <EMAIL>
# Routines to parse hdf5 spectral and volumetric data output.
# Mostly built around h5py's API.
import os
import numpy as np
from qharv.seed.wf_h5 import read, ls
def path_loc(handle, path):
return handle[path][()]
def me2d(edata, kappa=None, axis=0):
""" Calculate me... | [
"numpy.apply_along_axis",
"numpy.arange",
"numpy.array",
"os.path.join",
"numpy.prod",
"numpy.sqrt"
] | [((1915, 1946), 'os.path.join', 'os.path.join', (['obs_path', '"""value"""'], {}), "(obs_path, 'value')\n", (1927, 1946), False, 'import os\n'), ((5215, 5237), 'numpy.arange', 'np.arange', (['(0)', 'rmax', 'dr'], {}), '(0, rmax, dr)\n', (5224, 5237), True, 'import numpy as np\n'), ((6378, 6417), 'os.path.join', 'os.pat... |
import numpy as np
class GaussianBandit(object):
def __init__(self, k_arms=10):
self.bandits_expectations = np.random.normal(0,1,k_arms)
def gamble(self, action):
"""ação(int) -> recompensa(int)
Recebe uma ação representando o bandit que será acionado, que devolve uma recompensa b... | [
"numpy.random.normal"
] | [((122, 152), 'numpy.random.normal', 'np.random.normal', (['(0)', '(1)', 'k_arms'], {}), '(0, 1, k_arms)\n', (138, 152), True, 'import numpy as np\n'), ((411, 465), 'numpy.random.normal', 'np.random.normal', (['self.bandits_expectations[action]', '(1)'], {}), '(self.bandits_expectations[action], 1)\n', (427, 465), True... |
# Copyright 2017 Google Inc. 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 applicable law or a... | [
"tensorflow_fold.blocks.blocks.Concat",
"tensorflow_fold.blocks.blocks.Composition",
"tensorflow_fold.blocks.block_compiler.Compiler.create",
"tensorflow.global_variables_initializer",
"tensorflow_fold.blocks.metrics.Metric",
"tensorflow_fold.blocks.blocks.Slice",
"tensorflow_fold.blocks.blocks.Identity... | [((1212, 1229), 'tensorflow_fold.blocks.blocks.Composition', 'tdb.Composition', ([], {}), '()\n', (1227, 1229), True, 'import tensorflow_fold.blocks.blocks as tdb\n'), ((4801, 4816), 'tensorflow_fold.blocks.test_lib.main', 'test_lib.main', ([], {}), '()\n', (4814, 4816), False, 'from tensorflow_fold.blocks import test_... |
"""
Performs several operations and manipulations of geometries
"""
import numpy
from phydat import phycon
import automol.create.geom
from automol import util
from automol.geom import _base as geom_base
from automol.graph.geom import center_of_mass
from automol.graph.geom import translate as _translate
from automol.... | [
"automol.geom._base.count",
"automol.geom._base.set_coordinates",
"automol.graph.geom.center_of_mass",
"automol.graph.geom.geometry_join",
"automol.geom._base.symbols",
"numpy.transpose",
"automol.graph.geom.translate",
"automol.util.mat.euler_rotation_matrix",
"automol.geom._base.coordinates",
"n... | [((979, 1001), 'automol.geom._base.symbols', 'geom_base.symbols', (['geo'], {}), '(geo)\n', (996, 1001), True, 'from automol.geom import _base as geom_base\n'), ((1013, 1039), 'automol.geom._base.coordinates', 'geom_base.coordinates', (['geo'], {}), '(geo)\n', (1034, 1039), True, 'from automol.geom import _base as geom... |
# LICENSE: Simplified BSD https://github.com/mmp2/megaman/blob/master/LICENSE
import sys
import numpy as np
import scipy as sp
import scipy.sparse as sparse
from scipy.spatial.distance import squareform, pdist
from itertools import product
from numpy.testing import assert_array_almost_equal
from sklearn import manifo... | [
"megaman.geometry.geometry.Geometry",
"numpy.dot",
"sklearn.datasets.samples_generator.make_s_curve",
"numpy.ones",
"numpy.random.RandomState",
"megaman.embedding.locally_linear.locally_linear_embedding",
"sklearn.manifold.LocallyLinearEmbedding",
"numpy.array",
"megaman.embedding.locally_linear.bar... | [((1079, 1137), 'sklearn.datasets.samples_generator.make_s_curve', 'datasets.samples_generator.make_s_curve', (['N'], {'random_state': '(0)'}), '(N, random_state=0)\n', (1118, 1137), False, 'from sklearn import manifold, datasets\n'), ((1238, 1253), 'megaman.geometry.geometry.Geometry', 'geom.Geometry', ([], {}), '()\n... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import numpy as np
a = np.array([[1, 2, 3], [4, 5, 6]])
# print(a)
# mean_val = np.mean(a, axis=0)
# std_val = np.std(a, axis=0)
# print("mean val:", mean_val)
# print("std val:", std_val)
# print(a-mean_val)
# print((a - mean_val) / std_val)
print(a)
print(a[:,1])
b ... | [
"numpy.array"
] | [((73, 105), 'numpy.array', 'np.array', (['[[1, 2, 3], [4, 5, 6]]'], {}), '([[1, 2, 3], [4, 5, 6]])\n', (81, 105), True, 'import numpy as np\n'), ((322, 342), 'numpy.array', 'np.array', (['[[1], [2]]'], {}), '([[1], [2]])\n', (330, 342), True, 'import numpy as np\n')] |
# -*- coding: utf-8 -*-
import numpy as np
import cv2
from models.AE_Model import AE_Model
from models.Combine_Model import InferenceModel
from options.AE_face import wholeOptions
from options.parts_combine import CombineOptions
import _thread as thread
import time
import scipy.ndimage as sn
import random
... | [
"models.AE_Model.AE_Model",
"numpy.ones_like",
"models.Combine_Model.InferenceModel",
"random.randint",
"numpy.ones",
"numpy.expand_dims",
"options.AE_face.wholeOptions",
"jittor.gc",
"cv2.imread",
"options.parts_combine.CombineOptions"
] | [((417, 457), 'numpy.ones', 'np.ones', (['(512, 512, 3)'], {'dtype': 'np.float32'}), '((512, 512, 3), dtype=np.float32)\n', (424, 457), True, 'import numpy as np\n'), ((2327, 2343), 'models.Combine_Model.InferenceModel', 'InferenceModel', ([], {}), '()\n', (2341, 2343), False, 'from models.Combine_Model import Inferenc... |
#!/bin/python
import numpy as np
import json
from keras.models import Model, Sequential
from keras.layers import Dense, Dropout, TimeDistributed, Conv1D
from keras.layers import LSTM, Reshape, LeakyReLU
from keras.layers import PReLU, ELU
from keras.utils.generic_utils import get_custom_objects
#from keras import opti... | [
"keras.layers.LSTM",
"keras.layers.Dropout",
"keras.backend.abs",
"time.time",
"keras.utils.generic_utils.get_custom_objects",
"keras.layers.Dense",
"keras.backend.greater",
"numpy.array",
"keras.models.Sequential",
"keras.layers.Reshape",
"keras.layers.TimeDistributed"
] | [((1436, 1447), 'keras.backend.abs', 'K.abs', (['loss'], {}), '(loss)\n', (1441, 1447), True, 'from keras import backend as K\n'), ((1720, 1736), 'keras.backend.greater', 'K.greater', (['tC', '(0)'], {}), '(tC, 0)\n', (1729, 1736), True, 'from keras import backend as K\n'), ((1747, 1763), 'keras.backend.greater', 'K.gr... |
import gym
import pandas as pd
from gym.wrappers.monitoring.video_recorder import VideoRecorder
import random
import numpy as np
from keras.models import Sequential
from keras.layers import Dense
from keras.optimizers import Adam
env_name = "MountainCarContinuous-v0"
env = gym.make(env_name)
data = []
video = VideoRe... | [
"pandas.DataFrame",
"gym.make",
"keras.optimizers.Adam",
"keras.layers.Dense",
"random.randrange",
"numpy.array",
"keras.models.Sequential",
"gym.wrappers.monitoring.video_recorder.VideoRecorder"
] | [((275, 293), 'gym.make', 'gym.make', (['env_name'], {}), '(env_name)\n', (283, 293), False, 'import gym\n'), ((313, 351), 'gym.wrappers.monitoring.video_recorder.VideoRecorder', 'VideoRecorder', (['env', '"""1mountainCar.mp4"""'], {}), "(env, '1mountainCar.mp4')\n", (326, 351), False, 'from gym.wrappers.monitoring.vid... |
import logging
import pandas as pd
import numpy
import tableschema
import tabulator.exceptions
log = logging.getLogger(__name__)
TSV_LABELS = {
'name': 'Column Name',
'type': 'Data Type',
'format': 'Format',
'count': 'Number of non-null entries',
'25': '25th Percentile',
'50': '50th Percenti... | [
"pandas.HDFStore",
"pandas.read_csv",
"pandas.read_feather",
"numpy.isnan",
"pandas.read_parquet",
"tableschema.infer",
"logging.getLogger"
] | [((103, 130), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (120, 130), False, 'import logging\n'), ((1170, 1196), 'pandas.HDFStore', 'pd.HDFStore', (['filename', '"""r"""'], {}), "(filename, 'r')\n", (1181, 1196), True, 'import pandas as pd\n'), ((676, 707), 'pandas.read_csv', 'pd.read_... |
#!/usr/bin/env python3
"""
Shows how to toss a capsule to a container.
"""
import numpy as np
import math
from pprint import pprint
import mujoco_py as mpy #import load_model_from_path, MjSim, MjViewer
import os
model = mpy.mujoco_py.load_model_from_path("xml/quadrupedrobot.xml")
# model = mpy.mujoco_py.load_model... | [
"mujoco_py.mujoco_py.load_model_from_path",
"mujoco_py.MjSim",
"mujoco_py.functions.mju_quat2Mat",
"numpy.zeros",
"numpy.array",
"pprint.pprint",
"mujoco_py.cymj.PyMjvPerturb",
"mujoco_py.MjViewer",
"os.getenv",
"numpy.concatenate"
] | [((225, 285), 'mujoco_py.mujoco_py.load_model_from_path', 'mpy.mujoco_py.load_model_from_path', (['"""xml/quadrupedrobot.xml"""'], {}), "('xml/quadrupedrobot.xml')\n", (259, 285), True, 'import mujoco_py as mpy\n'), ((357, 373), 'mujoco_py.MjSim', 'mpy.MjSim', (['model'], {}), '(model)\n', (366, 373), True, 'import muj... |
from typing import Dict
import numpy as np
from catalyst.dl.core import (
Callback, CallbackOrder, MetricCallback, RunnerState
)
from catalyst.dl.utils import criterion
from catalyst.utils.confusion_matrix import (
calculate_confusion_matrix_from_tensors, calculate_tp_fp_fn
)
class IouCallback(MetricCallbac... | [
"catalyst.utils.confusion_matrix.calculate_confusion_matrix_from_tensors",
"catalyst.utils.confusion_matrix.calculate_tp_fp_fn",
"numpy.all"
] | [((1900, 1920), 'numpy.all', 'np.all', (['(jaccard <= 1)'], {}), '(jaccard <= 1)\n', (1906, 1920), True, 'import numpy as np\n'), ((2005, 2024), 'numpy.all', 'np.all', (['(jaccard > 0)'], {}), '(jaccard > 0)\n', (2011, 2024), True, 'import numpy as np\n'), ((2959, 3016), 'catalyst.utils.confusion_matrix.calculate_confu... |
import os
import numpy as np
from schnetpack.md.parsers.orca_parser import *
from schnetpack import Properties
from schnetpack.data import AtomsData
from tests.fixtures import *
def test_main_file_parser(orca_log_path, orca_main_targets):
main_parser = OrcaMainFileParser(properties=OrcaMainFileParser.properties)... | [
"schnetpack.data.AtomsData",
"numpy.allclose",
"os.path.join",
"numpy.array_equal"
] | [((1223, 1267), 'os.path.join', 'os.path.join', (['testdir', '"""test_orca_parser.db"""'], {}), "(testdir, 'test_orca_parser.db')\n", (1235, 1267), False, 'import os\n'), ((1544, 1574), 'schnetpack.data.AtomsData', 'AtomsData', (['target_orca_db_path'], {}), '(target_orca_db_path)\n', (1553, 1574), False, 'from schnetp... |
# -*- coding: utf-8 -*-
# @Time : 2018/8/14 21:23
# @Author : Dylan
# @File : unet.py
# @Email : <EMAIL>
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
import numpy as np
from keras.models import *
from keras.layers import Input, merge, Conv2D, MaxPooling2D, UpSampling2D, Dropout, Cropping2D
from keras.op... | [
"keras.models.load_model",
"numpy.load",
"numpy.save",
"keras.callbacks.ModelCheckpoint",
"keras.layers.Dropout",
"keras.layers.merge.concatenate",
"os.path.isfile",
"keras.callbacks.EarlyStopping",
"keras.layers.Conv2D",
"keras.layers.UpSampling2D",
"keras.layers.Input",
"keras.callbacks.Redu... | [((1028, 1088), 'keras.layers.Input', 'Input', (['(config.norm_size, config.norm_size, config.channels)'], {}), '((config.norm_size, config.norm_size, config.channels))\n', (1033, 1088), False, 'from keras.layers import Input, merge, Conv2D, MaxPooling2D, UpSampling2D, Dropout, Cropping2D\n'), ((2998, 3031), 'keras.lay... |
import unittest
import numpy as np
from momentum import initial_velocity, update_parameters as update_momentum_parameters
from random_mini_batches import random_mini_batches
from adam import initialize as initialize_adam, update_parameters as update_adam_parameters
from gradient_descent import gradient_descent
class ... | [
"unittest.main",
"momentum.initial_velocity",
"numpy.allclose",
"numpy.zeros",
"gradient_descent.gradient_descent",
"numpy.shape",
"random_mini_batches.random_mini_batches",
"numpy.arange",
"numpy.array",
"adam.initialize",
"momentum.update_parameters",
"numpy.array_equal",
"adam.update_para... | [((15782, 15797), 'unittest.main', 'unittest.main', ([], {}), '()\n', (15795, 15797), False, 'import unittest\n'), ((1270, 1298), 'momentum.initial_velocity', 'initial_velocity', (['parameters'], {}), '(parameters)\n', (1286, 1298), False, 'from momentum import initial_velocity, update_parameters as update_momentum_par... |
"""
This module contains all the routines that are responsible for pulling
the matrices out of the knowledge time and routines on them
"""
# from pympler import muppy, summary, tracker
import hashlib
import itertools
import json
import os
import pickle
import string
from collections import defaultdict
from copy import... | [
"numpy.sum",
"numpy.argmax",
"random.sample",
"json.dumps",
"collections.defaultdict",
"scipy.sparse.lil_matrix",
"numpy.arange",
"bioflow.utils.io_routines.undump_object",
"scipy.sparse.csgraph.connected_components",
"bioflow.utils.io_routines.dump_object",
"os.path.join",
"bioflow.algorithms... | [((1484, 1504), 'bioflow.utils.log_behavior.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (1494, 1504), False, 'from bioflow.utils.log_behavior import get_logger\n'), ((1871, 1877), 'time.time', 'time', ([], {}), '()\n', (1875, 1877), False, 'from time import time\n'), ((1906, 1912), 'time.time', 'time... |
import torch
from torch_kalman.kalman_filter import KalmanFilter
from torch_kalman.process import LocalLevel, Season, FourierSeason
import numpy as np
from torch_kalman.utils.data import TimeSeriesDataset
from torch_kalman.utils.datetime import DEFAULT_START_DT
def _simulate(num_groups: int, num_timesteps: int, dt... | [
"torch_kalman.process.FourierSeason",
"torch_kalman.process.LocalLevel",
"torch_kalman.process.Season",
"numpy.zeros",
"torch_kalman.kalman_filter.KalmanFilter",
"torch.no_grad"
] | [((686, 735), 'torch_kalman.kalman_filter.KalmanFilter', 'KalmanFilter', ([], {'measures': "['y']", 'processes': 'processes'}), "(measures=['y'], processes=processes)\n", (698, 735), False, 'from torch_kalman.kalman_filter import KalmanFilter\n'), ((775, 816), 'numpy.zeros', 'np.zeros', (['num_groups'], {'dtype': '"""t... |
from IMLearn.learners.regressors import PolynomialFitting
from IMLearn.utils import split_train_test
import numpy as np
import pandas as pd
import plotly.express as px
import plotly.io as pio
from scipy import stats
pio.templates.default = "simple_white"
DATA_PATH = "G:/My Drive/Semester_4/IML/IML.HUJI/datasets/City... | [
"pandas.DataFrame",
"numpy.random.seed",
"scipy.stats.zscore",
"pandas.read_csv",
"plotly.express.line",
"IMLearn.learners.regressors.PolynomialFitting",
"plotly.express.bar",
"IMLearn.utils.split_train_test",
"plotly.express.scatter"
] | [((966, 983), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (980, 983), True, 'import numpy as np\n'), ((2254, 2305), 'IMLearn.utils.split_train_test', 'split_train_test', (["il_df['DayOfYear']", "il_df['Temp']"], {}), "(il_df['DayOfYear'], il_df['Temp'])\n", (2270, 2305), False, 'from IMLearn.utils im... |
import collections
import numpy as np
import math
a = 0
b = 7
p = pow(2,256) - pow(2, 32) - pow(2,9) - pow(2, 8) - pow(2, 7) - pow(2, 6) - pow(2, 4) - 1
x = 0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798
y = 0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8
G = (x,y)
def inverse_... | [
"numpy.random.choice"
] | [((1869, 1892), 'numpy.random.choice', 'np.random.choice', (['(65535)'], {}), '(65535)\n', (1885, 1892), True, 'import numpy as np\n')] |
import logging
import numpy as np
import torch
from ..datasets import build_loader
from ..tasks import build_task
from ..utils import get_default_parser, env_setup, \
Timer, get_eta, dist_get_world_size
def add_args(parser):
## Basic options
parser.add_argument('--dataset', type=str, defaul... | [
"torch.cuda.synchronize",
"logging.info",
"torch.no_grad",
"numpy.empty"
] | [((2446, 2494), 'logging.info', 'logging.info', (['f"""# of testing examples: {n_test}"""'], {}), "(f'# of testing examples: {n_test}')\n", (2458, 2494), False, 'import logging\n'), ((3296, 3326), 'logging.info', 'logging.info', (['"""Testing starts"""'], {}), "('Testing starts')\n", (3308, 3326), False, 'import loggin... |
import numpy as np
import pyclipper
#from shapely import geometry
from sl_utils import rbox_to_polygon, polygon_to_rbox
from ssd_metric import fscore
def evaluate_polygonal_results(ground_truth, detection_results, iou_thresh=0.5):
"""Evaluate polygonal text detection results and return TP, FP, FN.
# Ar... | [
"ssd_metric.fscore",
"numpy.sum",
"numpy.argmax",
"numpy.asarray",
"numpy.logical_not",
"numpy.zeros",
"sl_utils.rbox_to_polygon",
"numpy.array",
"numpy.reshape",
"numpy.tile",
"pyclipper.Area",
"pyclipper.Pyclipper",
"numpy.concatenate"
] | [((3859, 3877), 'numpy.concatenate', 'np.concatenate', (['TP'], {}), '(TP)\n', (3873, 3877), True, 'import numpy as np\n'), ((3887, 3905), 'numpy.concatenate', 'np.concatenate', (['FP'], {}), '(FP)\n', (3901, 3905), True, 'import numpy as np\n'), ((3924, 3934), 'numpy.sum', 'np.sum', (['TP'], {}), '(TP)\n', (3930, 3934... |
from statistics import mean
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import style
style.use('fivethirtyeight')
xs = np.array([1,2,3,4,5,6], dtype = np.float64)
ys = np.array([5,4,6,5,6,7], dtype = np.float64)
def best_fit_slope_and_intercept(xs,ys):
m =( ((mean(xs)* mean(ys)) - mean(x... | [
"matplotlib.pyplot.show",
"matplotlib.style.use",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.scatter",
"numpy.array",
"statistics.mean"
] | [((109, 137), 'matplotlib.style.use', 'style.use', (['"""fivethirtyeight"""'], {}), "('fivethirtyeight')\n", (118, 137), False, 'from matplotlib import style\n'), ((144, 190), 'numpy.array', 'np.array', (['[1, 2, 3, 4, 5, 6]'], {'dtype': 'np.float64'}), '([1, 2, 3, 4, 5, 6], dtype=np.float64)\n', (152, 190), True, 'imp... |
from typing import Callable, Iterable, List, Optional
import os
import numpy as np
from PIL import Image, ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
def image_reader(prefix="",
pad_w: Optional[int] = None,
pad_h: Optional[int] = None,
rescale: bool = False,
... | [
"PIL.Image.new",
"numpy.zeros",
"numpy.expand_dims",
"os.path.exists",
"PIL.Image.open",
"numpy.array"
] | [((4963, 4997), 'numpy.zeros', 'np.zeros', (['(pad_h, pad_w, channels)'], {}), '((pad_h, pad_w, channels))\n', (4971, 4997), True, 'import numpy as np\n'), ((1991, 2006), 'numpy.array', 'np.array', (['image'], {}), '(image)\n', (1999, 2006), True, 'import numpy as np\n'), ((1412, 1432), 'os.path.exists', 'os.path.exist... |
import pandas as pd
import time
from datetime import datetime
from datetime import timedelta
import numpy as np
import os
import mysql.connector
import pyodbc
from mktcalendar import *
def get_uni(start, end, lookback, uni_size=1400):
unidate = start - TDay * lookback
t_low_price = 2.0
t_high_price = 500.... | [
"pyodbc.connect",
"numpy.log",
"os.makedirs",
"pandas.merge",
"os.path.exists",
"pandas.read_sql"
] | [((1479, 1501), 'pyodbc.connect', 'pyodbc.connect', (['cnxn_s'], {}), '(cnxn_s)\n', (1493, 1501), False, 'import pyodbc\n'), ((1515, 1565), 'pandas.read_sql', 'pd.read_sql', (['sql', 'cnxn'], {'index_col': "['gvkey', 'tid']"}), "(sql, cnxn, index_col=['gvkey', 'tid'])\n", (1526, 1565), True, 'import pandas as pd\n'), (... |
import numpy as np
from scipy.ndimage.filters import convolve
HS_KERN = np.array([[1, 2, 1],
[2, 0, 2],
[1, 2, 1]], dtype=float) / 12.
kernelX = np.array([[-1, 1], # kernel for computing d/dx
[-1, 1]], dtype=float) * .25
kernelY = np.array([[-1, -1], # k... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"numpy.zeros",
"numpy.ones",
"numpy.array",
"numpy.exp",
"numpy.arange",
"scipy.ndimage.filters.convolve",
"numpy.diag"
] | [((74, 130), 'numpy.array', 'np.array', (['[[1, 2, 1], [2, 0, 2], [1, 2, 1]]'], {'dtype': 'float'}), '([[1, 2, 1], [2, 0, 2], [1, 2, 1]], dtype=float)\n', (82, 130), True, 'import numpy as np\n'), ((188, 229), 'numpy.array', 'np.array', (['[[-1, 1], [-1, 1]]'], {'dtype': 'float'}), '([[-1, 1], [-1, 1]], dtype=float)\n'... |
import numpy as np
import pytest
import torch
from l5kit.dataset.utils import convert_str_to_fixed_length_tensor, kMaxStrLength, move_to_device, move_to_numpy
def test_convert_str() -> None:
# assert the type of the return
assert convert_str_to_fixed_length_tensor("test").dtype == torch.uint8
# test wit... | [
"torch.ones",
"numpy.allclose",
"l5kit.dataset.utils.convert_str_to_fixed_length_tensor",
"l5kit.dataset.utils.move_to_numpy",
"pytest.raises",
"torch.device",
"torch.zeros",
"numpy.unique"
] | [((535, 571), 'numpy.allclose', 'np.allclose', (['str_cast[rep_count:]', '(0)'], {}), '(str_cast[rep_count:], 0)\n', (546, 571), True, 'import numpy as np\n'), ((1081, 1103), 'l5kit.dataset.utils.move_to_numpy', 'move_to_numpy', (['in_dict'], {}), '(in_dict)\n', (1094, 1103), False, 'from l5kit.dataset.utils import con... |
import logging
import numpy as np
import math
from interactionviz.tracks import Tracks
from interactionviz.maps import WayKind, Map
from interactionviz.tracks import AgentKind, Tracks, Frame
from interactionviz.viewers import Viewport, viewport_for_map
from typing import IO
from PIL import Image, ImageDraw
AGENT_COLO... | [
"PIL.Image.new",
"logging.warn",
"math.sin",
"numpy.array",
"math.cos",
"PIL.ImageDraw.Draw",
"interactionviz.viewers.viewport_for_map"
] | [((795, 843), 'interactionviz.viewers.viewport_for_map', 'viewport_for_map', (['width', 'height', 'interaction_map'], {}), '(width, height, interaction_map)\n', (811, 843), False, 'from interactionviz.viewers import Viewport, viewport_for_map\n'), ((1272, 1291), 'PIL.ImageDraw.Draw', 'ImageDraw.Draw', (['img'], {}), '(... |
import numpy as np
import random
class BasicDatamanager(object):
def __init__(self, image, label, nclass):
self.image = image
self.label = label
self.nclass = nclass
self.ndata = len(self.label)
self.fullidx = np.arange(self.ndata)
self.start = 0
self.end = ... | [
"numpy.concatenate",
"random.sample",
"numpy.zeros",
"numpy.ones",
"numpy.append",
"numpy.arange",
"numpy.array",
"numpy.random.shuffle"
] | [((256, 277), 'numpy.arange', 'np.arange', (['self.ndata'], {}), '(self.ndata)\n', (265, 277), True, 'import numpy as np\n'), ((558, 579), 'numpy.zeros', 'np.zeros', (['self.nclass'], {}), '(self.nclass)\n', (566, 579), True, 'import numpy as np\n'), ((2141, 2162), 'numpy.arange', 'np.arange', (['self.ndata'], {}), '(s... |
import os
import cv2
import numpy as np
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_selection import train_test_split
from sklearn import metrics
# Global variables:
IMG_SCALE = 32
test_k = [3, 5, 7]
l_mode = [1, 2]
labels = []
animal_s2i = {
"cat": 0,
"dog": 1,
"panda": 2
}
ani... | [
"cv2.resize",
"numpy.ravel",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.accuracy_score",
"sklearn.metrics.recall_score",
"numpy.hsplit",
"sklearn.metrics.classification_report",
"cv2.imread",
"sklearn.neighbors.KNeighborsClassifier",
"numpy.append",
"numpy.array",
"sklearn.me... | [((691, 709), 'os.listdir', 'os.listdir', (['target'], {}), '(target)\n', (701, 709), False, 'import os\n'), ((1085, 1099), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (1093, 1099), True, 'import numpy as np\n'), ((1285, 1321), 'sklearn.model_selection.train_test_split', 'train_test_split', (['arr'], {'test_... |
"""
Goal - to enter the temp, group size and replicate and func should return plot with speed as a function of time
"""
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
from matplotlib.pyplot import figure... | [
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.show",
"argparse.ArgumentParser",
"pandas.read_csv",
"trajectorytools.Trajectories.from_idtrackerai",
"numpy.asarray",
"matplotlib.pyplot.figure",
"numpy.diff",
"numpy.linalg.norm"
] | [((3848, 3873), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (3871, 3873), False, 'import argparse\n'), ((5740, 5805), 'pandas.read_csv', 'pd.read_csv', (['"""../../data/temp_collective/roi/metadata_w_loom.csv"""'], {}), "('../../data/temp_collective/roi/metadata_w_loom.csv')\n", (5751, 5805)... |
# Import Modules as needed
import numpy as np
#import seaborn as sn
import pandas as pd
from pylab import *
from mylocal_functions import *
# ======== T2 MSME============= #
# Make list of all T2.txt files
T2_list = get_ipython().getoutput('ls ../Study_03_CBA/*T2.txt')
# Allocate variables needed for analysis
T2DF=pd... | [
"pandas.DataFrame",
"numpy.zeros_like",
"numpy.zeros",
"numpy.linspace",
"pandas.DataFrame.to_csv",
"pandas.concat",
"numpy.concatenate"
] | [((318, 332), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (330, 332), True, 'import pandas as pd\n'), ((336, 370), 'numpy.linspace', 'np.linspace', (['(0.012)', '(0.012 * 12)', '(12)'], {}), '(0.012, 0.012 * 12, 12)\n', (347, 370), True, 'import numpy as np\n'), ((1448, 1462), 'pandas.DataFrame', 'pd.DataFram... |
import cv2.cv2 as cv2
import sys
import numpy as np
import glob
def filter_white_only(frame):
hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
lower = np.array([0, 0, 120])
upper = np.array([255, 80, 255])
# Threshold the HSV image to get only white colors
white_threshold = cv2.inRange(hsv, lower, upp... | [
"cv2.cv2.VideoCapture",
"cv2.cv2.destroyAllWindows",
"cv2.cv2.bitwise_and",
"cv2.cv2.waitKey",
"cv2.cv2.rectangle",
"cv2.cv2.inRange",
"numpy.where",
"numpy.array",
"cv2.cv2.matchTemplate",
"glob.glob",
"cv2.cv2.createBackgroundSubtractorMOG2",
"cv2.cv2.imread",
"cv2.cv2.cvtColor",
"cv2.cv... | [((413, 456), 'cv2.cv2.VideoCapture', 'cv2.VideoCapture', (['"""vid/handblock_30fps.mp4"""'], {}), "('vid/handblock_30fps.mp4')\n", (429, 456), True, 'import cv2.cv2 as cv2\n'), ((467, 503), 'cv2.cv2.createBackgroundSubtractorMOG2', 'cv2.createBackgroundSubtractorMOG2', ([], {}), '()\n', (501, 503), True, 'import cv2.c... |
import os
import sys
import time
import math
import cv2
import re
import json
import numpy as np
from PIL import Image, ImageOps, ImageDraw, ImageFont
import matplotlib.pyplot as plt
import seaborn as sns
import torch
import torch.optim as optim
import torch.optim.lr_scheduler as lr_scheduler
import torch.nn as nn
impo... | [
"matplotlib.pyplot.xlim",
"json.load",
"metrics.Metrics",
"matplotlib.pyplot.show",
"metrics.Coef",
"re.match",
"matplotlib.pyplot.text",
"matplotlib.pyplot.figure",
"numpy.linspace"
] | [((861, 870), 'metrics.Metrics', 'Metrics', ([], {}), '()\n', (868, 870), False, 'from metrics import Metrics, Coef\n'), ((889, 898), 'metrics.Metrics', 'Metrics', ([], {}), '()\n', (896, 898), False, 'from metrics import Metrics, Coef\n'), ((1640, 1649), 'metrics.Metrics', 'Metrics', ([], {}), '()\n', (1647, 1649), Fa... |
from mesa import Model
from robot import Robot, Seed
from mesa.space import ContinuousSpace
import utils
from mesa.datacollection import DataCollector
from mesa.time import SimultaneousActivation
import numpy as np
from shape import Shape
import parameters
class World(Model):
"""
Represents the world
"""
... | [
"shape.Shape",
"mesa.space.ContinuousSpace",
"mesa.datacollection.DataCollector",
"robot.Robot",
"numpy.random.seed",
"numpy.random.randn",
"mesa.time.SimultaneousActivation",
"utils.get_agents_coordinates",
"robot.Seed",
"numpy.array"
] | [((522, 558), 'mesa.space.ContinuousSpace', 'ContinuousSpace', (['width', 'height', '(True)'], {}), '(width, height, True)\n', (537, 558), False, 'from mesa.space import ContinuousSpace\n'), ((583, 611), 'mesa.time.SimultaneousActivation', 'SimultaneousActivation', (['self'], {}), '(self)\n', (605, 611), False, 'from m... |
import numpy as np
a = np.array([[1,2,3], [4,5,6], [7,8,9], [10, 11, 12]])
print(a)
nums = [1, 2, 3, 4]
print(nums[:2]) | [
"numpy.array"
] | [((26, 83), 'numpy.array', 'np.array', (['[[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]'], {}), '([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]])\n', (34, 83), True, 'import numpy as np\n')] |
import argparse
import json
import os
import numpy as np
from sklearn import svm
from sklearn.metrics import classification_report, confusion_matrix
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import FunctionTransformer, StandardScaler
from config import CONFIG_BY_KEY
from data_loader import... | [
"json.dump",
"config.CONFIG_BY_KEY.keys",
"sklearn.preprocessing.FunctionTransformer",
"sklearn.preprocessing.StandardScaler",
"data_loader.DataHelper",
"argparse.ArgumentParser",
"numpy.argmax",
"os.path.dirname",
"sklearn.metrics.classification_report",
"data_loader.DataLoader",
"numpy.mean",
... | [((697, 715), 'data_loader.DataLoader', 'DataLoader', (['config'], {}), '(config)\n', (707, 715), False, 'from data_loader import DataLoader\n'), ((434, 459), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (457, 459), False, 'import argparse\n'), ((1232, 1262), 'numpy.argmax', 'np.argmax', (['t... |
import timeit
import numpy as np
def control_sphero(dist, groundspeed, Kp, Ki, Kd, stopRadius, maxspeed, minspeed, restartspeed, clearvars):
#persistent = []
init = []
prevu = []
preve = []
prevt = []
prev2e = []
prev2t = []
#Initialize
if len(init) == 0:
prevu = 0
preve = 0... | [
"timeit.default_timer",
"numpy.finfo"
] | [((452, 474), 'timeit.default_timer', 'timeit.default_timer', ([], {}), '()\n', (472, 474), False, 'import timeit\n'), ((351, 373), 'timeit.default_timer', 'timeit.default_timer', ([], {}), '()\n', (371, 373), False, 'import timeit\n'), ((387, 409), 'timeit.default_timer', 'timeit.default_timer', ([], {}), '()\n', (407... |
"""Test the AcademyRateModel class and its related functions"""
import unittest
import numpy as np
from pyesg import AcademyRateProcess
from pyesg.academy_rate_model import (
interpolate,
perturb,
scenario_rank,
scenario_significance_value,
scenario_subset,
AcademyRateModel,
)
from pyesg.datase... | [
"numpy.full",
"pyesg.academy_rate_model.interpolate",
"pyesg.academy_rate_model.scenario_significance_value",
"pyesg.academy_rate_model.scenario_rank",
"pyesg.AcademyRateProcess",
"numpy.testing.assert_array_equal",
"pyesg.academy_rate_model.scenario_subset",
"pyesg.academy_rate_model.perturb",
"num... | [((513, 531), 'pyesg.academy_rate_model.AcademyRateModel', 'AcademyRateModel', ([], {}), '()\n', (529, 531), False, 'from pyesg.academy_rate_model import interpolate, perturb, scenario_rank, scenario_significance_value, scenario_subset, AcademyRateModel\n'), ((560, 590), 'pyesg.datasets.load_academy_sample_scenario', '... |
# zhangshulin
# 2018-3-17
# e-mail: <EMAIL>
import numpy as np
from collections import Counter
class Datasets_creator:
def __init__(self, file_path, vocabs_size=5000, max_len=30):
self._vocabs_size = vocabs_size
self._max_len = max_len
with open(file_path, encoding='utf8') as f:
... | [
"collections.Counter",
"numpy.zeros"
] | [((1637, 1646), 'collections.Counter', 'Counter', ([], {}), '()\n', (1644, 1646), False, 'from collections import Counter\n'), ((2379, 2417), 'numpy.zeros', 'np.zeros', (['(m, max_len)'], {'dtype': 'np.int32'}), '((m, max_len), dtype=np.int32)\n', (2387, 2417), True, 'import numpy as np\n')] |
import tensorflow as tf
import keras
from tensorflow.keras import backend as K
from tensorflow.keras.applications import ResNet50, ResNet101
from tensorflow.keras.utils import to_categorical
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Flatten, Dropout, LSTM
import numpy as ... | [
"tensorflow.meshgrid",
"tensorflow.reshape",
"tensorflow.nn.relu",
"tensorflow.math.ceil",
"tensorflow.concat",
"tensorflow.stack",
"tensorflow.keras.applications.ResNet50",
"tensorflow.range",
"tensorflow.initializers.RandomNormal",
"keras.Model",
"tensorflow.tile",
"keras.layers.ReLU",
"ke... | [((3468, 3524), 'tensorflow.keras.applications.ResNet50', 'ResNet50', ([], {'include_top': '(False)', 'input_shape': '[None, None, 3]'}), '(include_top=False, input_shape=[None, None, 3])\n', (3476, 3524), False, 'from tensorflow.keras.applications import ResNet50, ResNet101\n'), ((3697, 3782), 'keras.Model', 'keras.Mo... |
import numpy as np
import matplotlib.pyplot as plt
import os
from colorama import Back, Style
import matplotlib
try:
plt.style.use("gadfly")
except:
pass
def DrawCheckpoints(checkpoint, root_dir=r".\model"):
checkpoint_path = os.path.join(root_dir, checkpoint)
for file in os.listdir(checkpoint_path):... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"os.path.join",
"matplotlib.pyplot.plot",
"numpy.ptp",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.style.use",
"numpy.array",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.tight_layout",
"os.listdir"
] | [((2550, 2562), 'matplotlib.pyplot.legend', 'plt.legend', ([], {}), '()\n', (2560, 2562), True, 'import matplotlib.pyplot as plt\n'), ((2563, 2581), 'matplotlib.pyplot.tight_layout', 'plt.tight_layout', ([], {}), '()\n', (2579, 2581), True, 'import matplotlib.pyplot as plt\n'), ((2582, 2592), 'matplotlib.pyplot.show', ... |
#!/usr/bin/env python
import cv2
import numpy as np
from faster_rcnn_wrapper import FasterRCNNSlim
import tensorflow as tf
from nms_wrapper import NMSType, NMSWrapper
from flask import Flask, jsonify
import os
from main import detect
app = Flask(__name__)
class Searcher:
DEFAULT_MODEL = 'model/res101_faster_rcn... | [
"faster_rcnn_wrapper.FasterRCNNSlim",
"tensorflow.train.Saver",
"nms_wrapper.NMSWrapper",
"flask.Flask",
"tensorflow.Session",
"numpy.hstack",
"tensorflow.ConfigProto",
"cv2.imread",
"main.detect",
"numpy.where"
] | [((242, 257), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (247, 257), False, 'from flask import Flask, jsonify\n'), ((518, 551), 'nms_wrapper.NMSWrapper', 'NMSWrapper', (['self.DEFAULT_NMS_TYPE'], {}), '(self.DEFAULT_NMS_TYPE)\n', (528, 551), False, 'from nms_wrapper import NMSType, NMSWrapper\n'), ((57... |
#!/usr/bin/env python
"""Prepare interaction matrix from interaction list."""
from __future__ import print_function
import argparse
import sys
import numpy as np
import pandas as pd
__author__ = "<NAME>"
__copyright__ = "Copyright 2016, <NAME>"
__license__ = "MIT"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
_... | [
"argparse.ArgumentParser",
"numpy.zeros",
"sys.stdout.flush",
"pandas.read_table",
"pandas.io.pytables.HDFStore"
] | [((2958, 3063), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '__doc__', 'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), '(description=__doc__, formatter_class=argparse.\n ArgumentDefaultsHelpFormatter)\n', (2981, 3063), False, 'import argparse\n'), ((1819, 1891), 'pandas.... |
# -*- coding: utf-8 -*-
"""
Содержит в себе слои и синапсы. Запускается в текущем процессе.
"""
from openre.domain.base import DomainBase
from openre.vector import Vector
from openre.metadata import Metadata
from types import GeneratorType
from openre.data_types import types
from openre.layer import Layer, LayersVector... | [
"openre.synapses.SynapsesVector",
"openre.domain.packets.ReceiverVector",
"numpy.iinfo",
"datetime.datetime.utcnow",
"openre.metadata.Metadata",
"openre.layer.Layer",
"openre.layer.LayersVector",
"random.Random",
"openre.index.ReceiverIndex",
"openre.neurons.NeuronsExtendableMetadata",
"openre.v... | [((3771, 3785), 'openre.layer.LayersVector', 'LayersVector', ([], {}), '()\n', (3783, 3785), False, 'from openre.layer import Layer, LayersVector\n'), ((3846, 3877), 'copy.deepcopy', 'deepcopy', (["self.config['layers']"], {}), "(self.config['layers'])\n", (3854, 3877), False, 'from copy import deepcopy\n'), ((3969, 39... |
import pandas as pd
import numpy as np
ser = pd.Series(np.random.randint(0, 100, 5))
# 統計 with functions.
print(ser.min())
print(ser.max())
print(ser.mean())
print(ser.sum())
print(ser.nlargest(3))
print(ser.nsmallest(3)) | [
"numpy.random.randint"
] | [((56, 84), 'numpy.random.randint', 'np.random.randint', (['(0)', '(100)', '(5)'], {}), '(0, 100, 5)\n', (73, 84), True, 'import numpy as np\n')] |
import keras
import WAnet.training
import numpy
class Network(object):
def __init__(self, structure, weights):
# Instantiate variables
self.curves = 0
self.new_curves = 0
self.geometry = 0
self.new_geometry = 0
self.S = 0
self.N = 0
self.D = 0
... | [
"numpy.random.randint"
] | [((830, 870), 'numpy.random.randint', 'numpy.random.randint', (['(1)', '(self.S * self.N)'], {}), '(1, self.S * self.N)\n', (850, 870), False, 'import numpy\n')] |
# coding: utf-8
# # Vehicle Detection and Tracking Project
import os.path
import glob
import pickle
import time
from collections import deque
import numpy as np
import matplotlib.image as mpimg
from scipy.ndimage.measurements import label
import cv2
from skimage.feature import hog
from sklearn.preprocessing import Sta... | [
"sklearn.preprocessing.StandardScaler",
"numpy.sum",
"numpy.ravel",
"sklearn.model_selection.train_test_split",
"sklearn.model_selection.cross_val_score",
"scipy.ndimage.measurements.label",
"numpy.clip",
"sklearn.tree.DecisionTreeClassifier",
"numpy.histogram",
"numpy.random.randint",
"sklearn.... | [((1670, 1690), 'collections.deque', 'deque', ([], {'maxlen': 'LAST_N'}), '(maxlen=LAST_N)\n', (1675, 1690), False, 'from collections import deque\n'), ((22739, 22765), 'moviepy.editor.VideoFileClip', 'VideoFileClip', (['video_input'], {}), '(video_input)\n', (22752, 22765), False, 'from moviepy.editor import VideoFile... |
import numpy as np
import pandas as pd
import warnings
import matplotlib.pyplot as plt
import matplotlib.axes
from sklearn import metrics
from ._matthews import mcc_f1_curve , mcc_f1_score
def plot_hyperparameters(ncv , name , discrete = True , ax = None , **kwargs):
""" Plot the number of times each value of an h... | [
"pandas.DataFrame",
"numpy.minimum",
"numpy.maximum",
"sklearn.metrics.average_precision_score",
"sklearn.metrics.roc_curve",
"numpy.abs",
"numpy.std",
"numpy.round",
"sklearn.metrics.roc_auc_score",
"sklearn.metrics.precision_recall_curve",
"numpy.mean",
"numpy.array",
"numpy.linspace",
"... | [((1152, 1182), 'pandas.DataFrame', 'pd.DataFrame', (['ncv.best_params_'], {}), '(ncv.best_params_)\n', (1164, 1182), True, 'import pandas as pd\n'), ((5762, 5784), 'numpy.linspace', 'np.linspace', (['(0)', '(1)', '(100)'], {}), '(0, 1, 100)\n', (5773, 5784), True, 'import numpy as np\n'), ((6349, 6370), 'numpy.mean', ... |
from eflow._hidden.parent_objects import AutoModeler
from eflow._hidden.custom_exceptions import UnsatisfiedRequirments
from eflow.utils.sys_utils import load_pickle_object,get_all_files_from_path, get_all_directories_from_path, pickle_object_to_file, create_dir_structure, write_object_text_to_file, json_file_to_dict,... | [
"matplotlib.pyplot.title",
"kneed.KneeLocator",
"numpy.absolute",
"sklearn.preprocessing.StandardScaler",
"numpy.abs",
"matplotlib.pyplot.clf",
"numpy.polyfit",
"scipy.cluster.hierarchy.linkage",
"matplotlib.pyplot.figure",
"numpy.mean",
"numpy.arange",
"matplotlib.patches.Patch",
"matplotli... | [((2900, 2988), 'eflow._hidden.parent_objects.AutoModeler.__init__', 'AutoModeler.__init__', (['self', 'f"""{dataset_name}/{dataset_sub_dir}"""', 'overwrite_full_path'], {}), "(self, f'{dataset_name}/{dataset_sub_dir}',\n overwrite_full_path)\n", (2920, 2988), False, 'from eflow._hidden.parent_objects import AutoMod... |
import os
import pickle
import timeit
import logging
import argparse
import threading
import numpy as np
import pandas as pd
from sklearn.datasets import load_svmlight_file
from sklearn.utils import shuffle
from sklearn.neural_network import MLPClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.... | [
"sklearn.ensemble.RandomForestClassifier",
"sklearn.naive_bayes.GaussianNB",
"sklearn.ensemble.AdaBoostClassifier",
"argparse.ArgumentParser",
"logging.basicConfig",
"sklearn.svm.SVC",
"timeit.default_timer",
"sklearn.tree.DecisionTreeClassifier",
"logging.info",
"sklearn.neighbors.KNeighborsClass... | [((630, 689), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG', 'format': 'LOG_FORMAT'}), '(level=logging.DEBUG, format=LOG_FORMAT)\n', (649, 689), False, 'import logging\n'), ((700, 725), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (723, 725), False, 'import argp... |
from PyQt5.QtGui import QPen, QPainter, QBrush, QFont, QColor
from PyQt5.QtCore import Qt, QPointF, QRectF
import matplotlib.pyplot as plt
import math
import numpy as np
import pydynamo_brain.util as util
"""
Red Radii = Points with None as radius vaule
Orange Radii = Radius with a real value
Cyan dot and Cyan Radi ... | [
"PyQt5.QtGui.QColor",
"PyQt5.QtGui.QFont",
"PyQt5.QtGui.QColor.fromRgbF",
"PyQt5.QtCore.QRectF",
"numpy.array",
"PyQt5.QtGui.QBrush",
"numpy.linalg.norm",
"PyQt5.QtCore.QPointF",
"pydynamo_brain.util.normDelta"
] | [((1061, 1091), 'PyQt5.QtGui.QFont', 'QFont', (['"""Arial"""', '(12)', 'QFont.Bold'], {}), "('Arial', 12, QFont.Bold)\n", (1066, 1091), False, 'from PyQt5.QtGui import QPen, QPainter, QBrush, QFont, QColor\n'), ((545, 561), 'PyQt5.QtGui.QBrush', 'QBrush', (['Qt.black'], {}), '(Qt.black)\n', (551, 561), False, 'from PyQ... |
import rlagent
import numpy as np
import tensorflow as tf
import time
from mpi4py import MPI
import sys
class NStepMPIAgent(rlagent.Agent):
def __init__(self, agent=None, env=None, save_steps=5000, model_dir='model', dtype=tf.float32):
super(NStepMPIAgent, self).__init__(agent=agent, env=env,
... | [
"tensorflow.train.Saver",
"tensorflow.get_collection",
"tensorflow.global_variables_initializer",
"tensorflow.keras.Input",
"tensorflow.train.get_or_create_global_step",
"numpy.zeros",
"time.sleep",
"tensorflow.placeholder",
"sys.stdout.flush",
"numpy.random.choice",
"numpy.concatenate"
] | [((629, 694), 'numpy.zeros', 'np.zeros', (['((self.size,) + self.agent.state_shape)'], {'dtype': 'np.float32'}), '((self.size,) + self.agent.state_shape, dtype=np.float32)\n', (637, 694), True, 'import numpy as np\n'), ((725, 776), 'numpy.zeros', 'np.zeros', (['self.agent.action_shape'], {'dtype': 'np.float32'}), '(sel... |
#!/usr/bin/env python
"""
This node will publish waypoints from the car's current position to some `x` distance ahead.
As mentioned in the doc, you should ideally first implement a version which does not care
about traffic lights or obstacles.
Once you have created dbw_node, you will update this node to use the statu... | [
"rospy.logerr",
"rospy.Subscriber",
"math.sqrt",
"styx_msgs.msg.Lane",
"rospy.Publisher",
"rospy.Rate",
"rospy.loginfo",
"rospy.is_shutdown",
"numpy.array",
"rospy.init_node",
"scipy.spatial.KDTree",
"numpy.dot",
"styx_msgs.msg.Waypoint"
] | [((1265, 1300), 'rospy.init_node', 'rospy.init_node', (['"""waypoint_updater"""'], {}), "('waypoint_updater')\n", (1280, 1300), False, 'import rospy\n'), ((1333, 1399), 'rospy.Subscriber', 'rospy.Subscriber', (['"""/current_pose"""', 'PoseStamped', 'self.pose_callback'], {}), "('/current_pose', PoseStamped, self.pose_c... |
import numpy as np
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import os
# Plot configuration
PLOT_VERTICALLY = 0
PLOT_HORIZONTALLY = 1
# number of figures in this plot
num_figures = 5
def create_figures(subfigure_width=480, subfigure_height=600, starting_figure_no=1, starting_col_index... | [
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"os.getcwd",
"matplotlib.pyplot.get_current_fig_manager",
"numpy.genfromtxt",
"matplotlib.pyplot.figure",
"matplotlib.use",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid"
] | [((37, 60), 'matplotlib.use', 'matplotlib.use', (['"""TkAgg"""'], {}), "('TkAgg')\n", (51, 60), False, 'import matplotlib\n'), ((582, 657), 'numpy.genfromtxt', 'np.genfromtxt', (["(file_path + 'front_contact.txt')"], {'delimiter': 'None', 'dtype': 'float'}), "(file_path + 'front_contact.txt', delimiter=None, dtype=floa... |
from __future__ import (division, absolute_import, print_function, unicode_literals)
from .. import _tomlib
import numpy as np
try:
import scipy.linalg as py_linalg
pinv = py_linalg.pinv2
except ImportError:
import numpy.linalg as py_linalg
pinv = py_linalg.pinv
def spectral_norm_expectation(sqrt_V, ... | [
"numpy.random.randn",
"numpy.zeros",
"numpy.linalg.svd",
"numpy.mean",
"numpy.array_equal"
] | [((646, 657), 'numpy.zeros', 'np.zeros', (['n'], {}), '(n)\n', (654, 657), True, 'import numpy as np\n'), ((793, 811), 'numpy.mean', 'np.mean', (['spec_norm'], {}), '(spec_norm)\n', (800, 811), True, 'import numpy as np\n'), ((1003, 1062), 'numpy.linalg.svd', 'np.linalg.svd', (['(sqrt_w_Y * F * sqrt_w_X)'], {'full_matr... |
import netCDF4
import numpy as np
from functools import lru_cache
class Coordinates(object):
"""Coordinate system related to EIDA50 file(s)"""
def initial_time(self, path):
return min(self._cached_times(path))
def valid_times(self, path, variable):
return self._cached_times(path)
@lr... | [
"netCDF4.Dataset",
"functools.lru_cache",
"numpy.array",
"netCDF4.num2date"
] | [((318, 329), 'functools.lru_cache', 'lru_cache', ([], {}), '()\n', (327, 329), False, 'from functools import lru_cache\n'), ((534, 573), 'numpy.array', 'np.array', (['values'], {'dtype': '"""datetime64[s]"""'}), "(values, dtype='datetime64[s]')\n", (542, 573), True, 'import numpy as np\n'), ((378, 399), 'netCDF4.Datas... |
import numpy as np
import cv2
import math
class Node:
def __init__(self,data,parent,cost):
self.Node_state = data
self.Node_parent_node = parent
self.Node_cost_to_reach = cost
def get_line(A,B):
x1,y1,x2,y2 = A[0],A[1],B[0],B[1]
m = (y2-y1)/(x2-x1)
c = y1 - m * x1
return m,c
def check_for_obsta... | [
"cv2.VideoWriter_fourcc",
"cv2.rotate",
"cv2.waitKey",
"cv2.imwrite",
"cv2.destroyAllWindows",
"numpy.ones",
"numpy.array",
"cv2.convertScaleAbs",
"cv2.imshow",
"cv2.resize"
] | [((2221, 2243), 'numpy.ones', 'np.ones', (['(401, 251, 3)'], {}), '((401, 251, 3))\n', (2228, 2243), True, 'import numpy as np\n'), ((2250, 2269), 'numpy.ones', 'np.ones', (['(406, 256)'], {}), '((406, 256))\n', (2257, 2269), True, 'import numpy as np\n'), ((7861, 7911), 'cv2.rotate', 'cv2.rotate', (['matrix', 'cv2.ROT... |
import argparse
import time
import torch
import os
from Models_ucbcpu import get_model
from Process21_cpu import *
import torch.nn.functional as F
from Optim import CosineWithRestarts
from Batch21 import create_masks
import dill as pickle
import torch
import torch.nn as nn
import numpy as np
import random
import torch.... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.savefig",
"argparse.ArgumentParser",
"numpy.argmax",
"Optim.CosineWithRestarts",
"matplotlib.pyplot.bar",
"torch.cat",
"Batch21.create_masks",
"matplotlib.pyplot.figure",
"sklearn.metrics.f1_score",
"torch.no_grad",
"torch.ones",
"numpy.linspace"... | [((390, 411), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (404, 411), False, 'import matplotlib\n'), ((1084, 1121), 'torch.zeros', 'torch.zeros', (['opt.epochs', 'opt.n_layers'], {}), '(opt.epochs, opt.n_layers)\n', (1095, 1121), False, 'import torch\n'), ((3419, 3431), 'matplotlib.pyplot.figu... |
import anndata as ad
import numpy as np
import pandas as pd
def readandimputematrix(file_name, min_coverage=1):
"""
Temporary function to load and impute methyaltion count matrix into an AnnData object
Parameters
----------
file_name : file name to read and load
min_coverage : minimum... | [
"pandas.DataFrame",
"numpy.matrix"
] | [((2668, 2693), 'numpy.matrix', 'np.matrix', (['imputed_matrix'], {}), '(imputed_matrix)\n', (2677, 2693), True, 'import numpy as np\n'), ((2722, 2762), 'pandas.DataFrame', 'pd.DataFrame', ([], {'index': 'name_windows_covered'}), '(index=name_windows_covered)\n', (2734, 2762), True, 'import pandas as pd\n'), ((2791, 28... |
import copy
import numpy as np
import scipy.io.wavfile
import scipy.signal
from . import utils as ut
import pdb
def load_sound(wav_fname):
rate, samples = scipy.io.wavfile.read(wav_fname)
times = (1./rate) * np.arange(len(samples))
return Sound(times, rate, samples)
class Sound:
def __init__(self, ... | [
"copy.deepcopy",
"numpy.abs",
"numpy.dtype",
"numpy.ndim",
"numpy.iinfo",
"numpy.clip",
"numpy.zeros",
"numpy.array",
"numpy.round",
"numpy.concatenate"
] | [((881, 900), 'copy.deepcopy', 'copy.deepcopy', (['self'], {}), '(self)\n', (894, 900), False, 'import copy\n'), ((1855, 1884), 'numpy.clip', 'np.clip', (['s.samples', '(-1.0)', '(1.0)'], {}), '(s.samples, -1.0, 1.0)\n', (1862, 1884), True, 'import numpy as np\n'), ((2322, 2341), 'copy.deepcopy', 'copy.deepcopy', (['se... |
import random
import math
import time
from tkinter import Frame, Label, CENTER, Tk
from DDQNAgent import DDQNAgent
import numpy as np # For numerical fast numerical calculations
import time
import logic
import constants as c
class GameGrid(Frame):
#TODO: VARIABLEN NAMEN IN ENGLISH UND MEHR HYPERPARAMETER HINZUFÜ... | [
"math.log2",
"numpy.count_nonzero",
"random.randint",
"tkinter.Frame.__init__",
"logic.up",
"logic.right",
"numpy.zeros",
"logic.left",
"numpy.array",
"tkinter.Frame",
"numpy.array_equal",
"logic.game_state",
"tkinter.Label",
"logic.add_two_or_four",
"logic.new_game",
"logic.down"
] | [((744, 764), 'tkinter.Frame.__init__', 'Frame.__init__', (['self'], {}), '(self)\n', (758, 764), False, 'from tkinter import Frame, Label, CENTER, Tk\n'), ((3666, 3710), 'numpy.array_equal', 'np.array_equal', (['self.matrix_old', 'self.matrix'], {}), '(self.matrix_old, self.matrix)\n', (3680, 3710), True, 'import nump... |
from collections import deque
import os
import numpy as np
import chainer
import chainer.functions as F
import chainer.links as L
from chainer import training
from chainer.training import extensions
from chainer import serializers
from chainer.datasets import tuple_dataset
from dqn_net import DQNNet
class DQNAgent()... | [
"numpy.random.choice",
"os.path.abspath",
"chainer.training.StandardUpdater",
"chainer.training.Trainer",
"chainer.serializers.load_npz",
"chainer.optimizer.WeightDecay",
"os.path.basename",
"dqn_net.DQNNet",
"chainer.datasets.tuple_dataset.TupleDataset",
"chainer.optimizers.RMSprop",
"numpy.arr... | [((1052, 1089), 'collections.deque', 'deque', ([], {'maxlen': 'self.replay_memory_size'}), '(maxlen=self.replay_memory_size)\n', (1057, 1089), False, 'from collections import deque\n'), ((1348, 1376), 'chainer.optimizers.RMSprop', 'chainer.optimizers.RMSprop', ([], {}), '()\n', (1374, 1376), False, 'import chainer\n'),... |
from PIL import Image
import numpy
from math import sqrt, pow
class WhiteImageAnalysis:
def __init__(self, image_path):
self.image = Image.open(image_path)
self.width = self.image.width
self.height = self.image.height
self.pixels = self.image.load()
self.threshold = (0, 0,... | [
"numpy.multiply",
"numpy.array",
"math.pow",
"PIL.Image.open"
] | [((148, 170), 'PIL.Image.open', 'Image.open', (['image_path'], {}), '(image_path)\n', (158, 170), False, 'from PIL import Image\n'), ((771, 820), 'numpy.array', 'numpy.array', (['[[1, 2, 1], [0, 0, 0], [-1, -2, -1]]'], {}), '([[1, 2, 1], [0, 0, 0], [-1, -2, -1]])\n', (782, 820), False, 'import numpy\n'), ((931, 980), '... |
import numpy as np
from tfsnippet.ops import space_to_depth, depth_to_space, reshape_tail
from tfsnippet.utils import (get_static_shape, get_shape, InputSpec,
add_name_and_scope_arg_doc)
from .base import BaseFlow
from .utils import ZeroLogDet
__all__ = ['ReshapeFlow', 'SpaceToDepthFlow']... | [
"tfsnippet.ops.reshape_tail",
"tfsnippet.utils.get_static_shape",
"tfsnippet.ops.depth_to_space",
"tfsnippet.utils.InputSpec",
"tfsnippet.utils.get_shape",
"tfsnippet.ops.space_to_depth",
"numpy.prod"
] | [((2694, 2717), 'tfsnippet.utils.get_static_shape', 'get_static_shape', (['input'], {}), '(input)\n', (2710, 2717), False, 'from tfsnippet.utils import get_static_shape, get_shape, InputSpec, add_name_and_scope_arg_doc\n'), ((3146, 3188), 'tfsnippet.utils.InputSpec', 'InputSpec', ([], {'shape': 'x_shape_spec', 'dtype':... |
"""Classes for handling non-convex polygons
"""
from __future__ import division, print_function
import numpy as np
from .helpers import *
from .convex import *
import copy
__all__ = ['approximate_convex_decomposition']
# Decompose a non-convex shape into approximately convex hulls
# From Lien & Amato (2006): Approxi... | [
"numpy.linalg.norm",
"copy.deepcopy",
"copy.copy"
] | [((3037, 3058), 'copy.deepcopy', 'copy.deepcopy', (['pocket'], {}), '(pocket)\n', (3050, 3058), False, 'import copy\n'), ((6650, 6669), 'copy.copy', 'copy.copy', (['vertices'], {}), '(vertices)\n', (6659, 6669), False, 'import copy\n'), ((621, 656), 'numpy.linalg.norm', 'np.linalg.norm', (['(self._point - point)'], {})... |
import unittest
import numpy as np
from Atlas.configuration import AtlasConfiguration
def relative_err(x, y):
return (np.abs(x-y)/np.linalg.norm(x)).max()
def absolute_err(x, y):
return np.abs(x-y).max()
class AtlasTestCase(unittest.TestCase):
def setup(self):
pass
def test_configuratio... | [
"unittest.main",
"numpy.abs",
"Atlas.configuration.AtlasConfiguration",
"numpy.linalg.norm"
] | [((843, 858), 'unittest.main', 'unittest.main', ([], {}), '()\n', (856, 858), False, 'import unittest\n'), ((344, 364), 'Atlas.configuration.AtlasConfiguration', 'AtlasConfiguration', ([], {}), '()\n', (362, 364), False, 'from Atlas.configuration import AtlasConfiguration\n'), ((200, 213), 'numpy.abs', 'np.abs', (['(x ... |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 28 21:59:21 2019
@author: krups
"""
from keras.preprocessing.sequence import pad_sequences
from keras.preprocessing.image import load_img
import numpy as np
import matplotlib.pyplot as plt
def predict_caption(image,max_length,tokenizer,index_word,model_):
... | [
"matplotlib.pyplot.show",
"numpy.argmax",
"keras.preprocessing.sequence.pad_sequences",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.figure",
"keras.preprocessing.image.load_img"
] | [((1682, 1710), 'matplotlib.pyplot.figure', 'plt.figure', ([], {'figsize': '(10, 20)'}), '(figsize=(10, 20))\n', (1692, 1710), True, 'import matplotlib.pyplot as plt\n'), ((2490, 2500), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (2498, 2500), True, 'import matplotlib.pyplot as plt\n'), ((463, 500), 'keras.... |
# 第3期的python作业:
# 做一个简单的网络爬虫demo,
# 爬取一下空气质量指数的网站(http://pm25.in/)的数据,
# 然后处理数据做成如下的图表(x坐标为城市名称,y坐标为对应城市的AQI,
# title为:空气质量最好的50个城市,对应的更新时间为网页的 数据更新时间)
import urllib3
from pyquery import PyQuery as pq
import matplotlib.pyplot as plt
import numpy as np
# http = urllib3.PoolManager()
# r = http.request('GET', 'http://p... | [
"matplotlib.pyplot.title",
"pyquery.PyQuery",
"matplotlib.pyplot.show",
"matplotlib.pyplot.bar",
"numpy.arange",
"numpy.random.rand"
] | [((349, 378), 'pyquery.PyQuery', 'pq', ([], {'url': '"""http://pm25.in/rank"""'}), "(url='http://pm25.in/rank')\n", (351, 378), True, 'from pyquery import PyQuery as pq\n'), ((694, 706), 'numpy.arange', 'np.arange', (['N'], {}), '(N)\n', (703, 706), True, 'import numpy as np\n'), ((781, 803), 'matplotlib.pyplot.title',... |
from osgeo import gdal, gdal_array
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D
"""
To calculate the pixel location of a geospatial coordinate
Get the WorldFile info: Pixel width and height;
as well as origin coordinates.
"""
def get_coordinates(... | [
"numpy.meshgrid",
"matplotlib.pyplot.show",
"mpl_toolkits.mplot3d.Axes3D",
"osgeo.gdal_array.LoadFile",
"matplotlib.pyplot.figure",
"osgeo.gdal.Open"
] | [((506, 525), 'osgeo.gdal.Open', 'gdal.Open', (['filepath'], {}), '(filepath)\n', (515, 525), False, 'from osgeo import gdal, gdal_array\n'), ((571, 600), 'osgeo.gdal_array.LoadFile', 'gdal_array.LoadFile', (['filepath'], {}), '(filepath)\n', (590, 600), False, 'from osgeo import gdal, gdal_array\n'), ((955, 993), 'num... |
import hmvec as hm
import numpy as np
from orphics import io
from enlib import bench
zs = np.linspace(0.1,3.,4)[-1:]
ms = np.geomspace(2e10,1e17,200)
ks = np.geomspace(1e-4,100,1001)
with bench.show("num"):
hcos = hm.HaloCosmology(zs,ks,ms=ms,nfw_numeric=True)
opmm_1h = hcos.get_power_1halo_auto(name="nfw")
opmm_2... | [
"numpy.geomspace",
"hmvec.HaloCosmology",
"enlib.bench.show",
"orphics.io.Plotter",
"numpy.linspace"
] | [((123, 162), 'numpy.geomspace', 'np.geomspace', (['(20000000000.0)', '(1e+17)', '(200)'], {}), '(20000000000.0, 1e+17, 200)\n', (135, 162), True, 'import numpy as np\n'), ((156, 187), 'numpy.geomspace', 'np.geomspace', (['(0.0001)', '(100)', '(1001)'], {}), '(0.0001, 100, 1001)\n', (168, 187), True, 'import numpy as n... |
import pytest
import numpy as np
from pypif import pif
import random as rnd
from citrine_converters.mechanical.converter import process_files
"""
README
Format:
TEST NAME
-Description
PASS/FAIL
**note numbers correspond to order of tests. Tests Start on line 441
1. test_stress_strain_both_files
-The tests generates sim... | [
"pypif.pif.Value",
"random.randint",
"pypif.pif.dump",
"pytest.raises",
"numpy.linspace",
"citrine_converters.mechanical.converter.process_files",
"numpy.array_equal"
] | [((2193, 2212), 'numpy.linspace', 'np.linspace', (['(0)', '(100)'], {}), '(0, 100)\n', (2204, 2212), True, 'import numpy as np\n'), ((2231, 2250), 'numpy.linspace', 'np.linspace', (['(0)', '(100)'], {}), '(0, 100)\n', (2242, 2250), True, 'import numpy as np\n'), ((2264, 2283), 'numpy.linspace', 'np.linspace', (['(0)', ... |
# Import Packages
from IPython.display import clear_output
import pandas as pd
import requests
from requests.utils import requote_uri
from fake_useragent import UserAgent
from lxml import html
from bs4 import BeautifulSoup
from tqdm import tqdm
import time
from textblob import TextBlob
from langdetect import detect
imp... | [
"requests.packages.urllib3.disable_warnings",
"numpy.random.seed",
"pandas.read_csv",
"sklearn.feature_extraction.text.TfidfVectorizer",
"nltk.word_tokenize",
"pandas.DataFrame",
"random.randint",
"pandas.merge",
"re.findall",
"requests.get",
"tqdm.tqdm._instances.pop",
"matplotlib.pyplot.subp... | [((1414, 1425), 'fake_useragent.UserAgent', 'UserAgent', ([], {}), '()\n', (1423, 1425), False, 'from fake_useragent import UserAgent\n'), ((14728, 14754), 'nltk.corpus.stopwords.words', 'stopwords.words', (['"""english"""'], {}), "('english')\n", (14743, 14754), False, 'from nltk.corpus import stopwords\n'), ((14773, ... |
from numpy import linalg as la
import numpy as np
def nearestPD(A):
"""Find the nearest positive-definite matrix to input
A Python/Numpy port of <NAME>'s `nearestSPD` MATLAB code [1], which
credits [2].
[1] https://www.mathworks.com/matlabcentral/fileexchange/42885-nearestspd
[2] <NAME>, "Compu... | [
"numpy.linalg.eigvals",
"numpy.linalg.svd",
"numpy.linalg.norm",
"numpy.eye",
"numpy.diag",
"numpy.linalg.cholesky"
] | [((477, 486), 'numpy.linalg.svd', 'la.svd', (['B'], {}), '(B)\n', (483, 486), True, 'from numpy import linalg as la\n'), ((669, 687), 'numpy.eye', 'np.eye', (['A.shape[0]'], {}), '(A.shape[0])\n', (675, 687), True, 'import numpy as np\n'), ((641, 651), 'numpy.linalg.norm', 'la.norm', (['A'], {}), '(A)\n', (648, 651), T... |
import cv2
import numpy as np
# Create point matrix get coordinates of mouse click on image
point_matrix = np.zeros((8, 2), np.int)
counter = 0
def mousePoints(event, x, y, flags, params):
global counter
# Left button mouse click event opencv
if event == cv2.EVENT_LBUTTONDOWN:
point_matrix[count... | [
"cv2.circle",
"cv2.waitKey",
"cv2.destroyAllWindows",
"numpy.zeros",
"cv2.setMouseCallback",
"cv2.imshow"
] | [((108, 132), 'numpy.zeros', 'np.zeros', (['(8, 2)', 'np.int'], {}), '((8, 2), np.int)\n', (116, 132), True, 'import numpy as np\n'), ((1041, 1064), 'cv2.destroyAllWindows', 'cv2.destroyAllWindows', ([], {}), '()\n', (1062, 1064), False, 'import cv2\n'), ((651, 680), 'cv2.imshow', 'cv2.imshow', (['windows_name', 'img']... |
import face_recognition
from threading import Thread
import concurrent.futures
from multiprocessing import Process
import cv2
import time
import pickle
import zlib
import numpy as np
class VideoStreamWidget:
def __init__(self, src=0):
self.capture = cv2.VideoCapture(src)
self.face_locations = []
self.face_enco... | [
"threading.Thread",
"cv2.waitKey",
"numpy.frombuffer",
"face_recognition.face_encodings",
"cv2.destroyAllWindows",
"cv2.imwrite",
"time.sleep",
"cv2.VideoCapture",
"zlib.compress",
"numpy.array",
"cv2.rectangle",
"face_recognition.face_locations",
"cv2.imshow",
"cv2.resize"
] | [((255, 276), 'cv2.VideoCapture', 'cv2.VideoCapture', (['src'], {}), '(src)\n', (271, 276), False, 'import cv2\n'), ((426, 461), 'threading.Thread', 'Thread', ([], {'target': 'self.update', 'args': '()'}), '(target=self.update, args=())\n', (432, 461), False, 'from threading import Thread\n'), ((831, 877), 'cv2.resize'... |
# -*- coding: UTF-8 -*-
import netCDF4 as nc
import numpy as np
import scipy.interpolate as scint
def geb_bat(filename):
data = nc.Dataset(filename)
LON = data.variables[u'lon'][:]
LAT = data.variables[u'lat'][:]
DEPTH = data.variables[u'elevation'][:]
DEPTH[DEPTH>0] = 0
DEPTH = -... | [
"netCDF4.Dataset",
"numpy.meshgrid",
"numpy.abs",
"numpy.ones",
"numpy.isnan",
"numpy.hstack",
"numpy.argsort",
"scipy.interpolate.interp1d",
"numpy.sin",
"numpy.array",
"numpy.tile",
"numpy.cos",
"numpy.diff",
"numpy.argwhere",
"scipy.signal.fftconvolve",
"numpy.blackman"
] | [((134, 154), 'netCDF4.Dataset', 'nc.Dataset', (['filename'], {}), '(filename)\n', (144, 154), True, 'import netCDF4 as nc\n'), ((351, 372), 'numpy.meshgrid', 'np.meshgrid', (['LON', 'LAT'], {}), '(LON, LAT)\n', (362, 372), True, 'import numpy as np\n'), ((481, 496), 'numpy.blackman', 'np.blackman', (['nw'], {}), '(nw)... |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a emotionEmoji script file.
"""
from keras.models import model_from_json
import numpy as np
import cv2
class FacialExpressionModel(object):
EMOTIONS_LIST = ["ANGRY", "DISGUST", "FEAR", "HAPPY", "SAD", "SURPRISE", "NEUTRAL"]; ## dont change the order
def __ini... | [
"cv2.equalizeHist",
"cv2.putText",
"numpy.argmax",
"cv2.cvtColor",
"cv2.waitKey",
"cv2.imshow",
"cv2.addWeighted",
"cv2.VideoCapture",
"cv2.imread",
"cv2.rectangle",
"keras.models.model_from_json",
"cv2.CascadeClassifier",
"cv2.normalize",
"cv2.destroyAllWindows",
"cv2.resize"
] | [((1008, 1027), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (1024, 1027), False, 'import cv2\n'), ((1036, 1096), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""haarcascade_frontalface_default.xml"""'], {}), "('haarcascade_frontalface_default.xml')\n", (1057, 1096), False, 'import cv2\n'), (... |
"""
Explore all models' performance for the following parameters:
nsamples, nfeatures, nseqfeatures, seqlen
"""
import numpy as np
from numpy import inf
import argparse
from sklearn.ensemble import RandomForestClassifier
from HMM.hmm_classifier import HMMClassifier
from LSTM.lstm_classifier import LSTMClassifier
fr... | [
"sklearn.ensemble.RandomForestClassifier",
"numpy.matrix",
"numpy.random.uniform",
"argparse.ArgumentParser",
"HMM.hmm_classifier.HMMClassifier",
"numpy.zeros",
"DataNexus.gensyn_lstm_wins.generate_lstm_wins",
"numpy.min",
"numpy.vstack",
"numpy.tile",
"LSTM.lstm_classifier.LSTMClassifier",
"n... | [((416, 507), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Train all models for a given set of parameters."""'}), "(description=\n 'Train all models for a given set of parameters.')\n", (439, 507), False, 'import argparse\n'), ((1683, 1744), 'DataNexus.gensyn_lstm_wins.generate_lstm... |
'''
Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
NVIDIA CORPORATION and its licensors retain all intellectual property
and proprietary rights in and to this software, related documentation
and any modifications thereto. Any use, reproduction, disclosure or
distribution of this software and related docu... | [
"numpy.minimum",
"numpy.maximum",
"external.object_pose_estimation_aae.auto_pose.ae.ae.AE",
"tensorflow.contrib.training.create_train_op",
"numpy.array",
"external.object_pose_estimation_aae.auto_pose.ae.encoder.Encoder",
"cv2.resize"
] | [((1791, 1850), 'cv2.resize', 'cv2.resize', (['scene_crop', 'resize'], {'interpolation': 'interpolation'}), '(scene_crop, resize, interpolation=interpolation)\n', (1801, 1850), False, 'import cv2\n'), ((2602, 2714), 'external.object_pose_estimation_aae.auto_pose.ae.encoder.Encoder', 'Encoder', (['x', 'latent_space_size... |
from nets.deeplab import Deeplabv3
from PIL import Image
import numpy as np
import random
import copy
import os
def letterbox_image(image, size):
'''resize image with unchanged aspect ratio using padding'''
iw, ih = image.size
w, h = size
scale = min(w/iw, h/ih)
nw = int(iw*scale)
... | [
"PIL.Image.new",
"copy.deepcopy",
"numpy.uint8",
"random.randint",
"numpy.zeros",
"PIL.Image.open",
"nets.deeplab.Deeplabv3",
"random.seed",
"numpy.array",
"PIL.Image.blend",
"os.listdir"
] | [((523, 537), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (534, 537), False, 'import random\n'), ((694, 747), 'nets.deeplab.Deeplabv3', 'Deeplabv3', ([], {'classes': '(21)', 'input_shape': '(HEIGHT, WIDTH, 3)'}), '(classes=21, input_shape=(HEIGHT, WIDTH, 3))\n', (703, 747), False, 'from nets.deeplab import De... |
#author: <NAME>
#This code implements a light version of the Eigenvalue Decay regularizer for
#the Keras deep learning library, approximating the dominant eigenvalue by a
#soft function given by the power method. (It only works with Theano backend)
#The syntax for Eigenvalue Decay is similar to the other Keras weight... | [
"keras.backend.in_train_phase",
"keras.backend.dot",
"numpy.ones",
"keras.backend.shape",
"keras.backend.transpose"
] | [((1625, 1638), 'numpy.ones', 'np.ones', (['dim1'], {}), '(dim1)\n', (1632, 1638), True, 'import numpy as np\n'), ((1780, 1792), 'keras.backend.dot', 'K.dot', (['WW', 'o'], {}), '(WW, o)\n', (1785, 1792), True, 'from keras import backend as K\n'), ((1912, 1938), 'keras.backend.dot', 'K.dot', (['WW', 'domin_eigenvect'],... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.