code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
#!/usr/bin/env python # %% import numpy as np import numba # meta parameters LINEWIDTH = 0.3 EXPERIMENT_UNCERTAIN_SCALE = 10 # reference data grid_short = np.array([ 0.138912671079212, 0.136826895237182, 0.134802828739590, 0.132837772927060, 0.130929184235579, 0.129074663212412, 0.127271944452462, 0.125518887366340, ...
[ "numpy.minimum", "numpy.maximum", "numpy.all", "numba.jit", "numpy.array", "numpy.random.normal", "numpy.exp", "numpy.vstack", "numpy.sqrt" ]
[((157, 758), 'numpy.array', 'np.array', (['[0.138912671079212, 0.136826895237182, 0.13480282873959, 0.13283777292706, \n 0.130929184235579, 0.129074663212412, 0.127271944452462, \n 0.12551888736634, 0.123813467701037, 0.122153769742578, \n 0.120537979137517, 0.118964376276714, 0.117431330190674, \n 0.11593...
from torch.utils.data import DataLoader, Dataset import torch import h5py import numpy as np import os import random import json import copy def get_dataloader(phase, config): is_shuffle = phase == 'train' dataset = SDFdata(phase, config, shuffle=is_shuffle) dataloader = DataLoader(dataset, batch_size=con...
[ "copy.deepcopy", "json.load", "h5py.File", "numpy.random.seed", "os.path.exists", "numpy.clip", "os.path.join", "numpy.random.shuffle" ]
[((566, 586), 'json.load', 'json.load', (['json_file'], {}), '(json_file)\n', (575, 586), False, 'import json\n'), ((2940, 2970), 'copy.deepcopy', 'copy.deepcopy', (['self.data_order'], {}), '(self.data_order)\n', (2953, 2970), False, 'import copy\n'), ((3055, 3084), 'numpy.random.shuffle', 'np.random.shuffle', (['temp...
import sys import pygame from pygame import * from game_objects import * from settings import * from network import * from population import * from genome import * from level_design import levels from input import * import numpy as np from time import gmtime, strftime global cameraX, cameraY import pandas ...
[ "pygame.event.Event", "pygame.event.get", "pygame.display.update", "pygame.mouse.get_pos", "pandas.DataFrame", "pygame.font.SysFont", "pygame.display.set_mode", "pygame.transform.scale", "numpy.reshape", "pygame.display.set_caption", "pygame.quit", "pygame.mouse.get_pressed", "pygame.draw.re...
[((439, 452), 'pygame.init', 'pygame.init', ([], {}), '()\n', (450, 452), False, 'import pygame\n'), ((463, 509), 'pygame.display.set_mode', 'pygame.display.set_mode', (['DISPLAY', 'FLAGS', 'DEPTH'], {}), '(DISPLAY, FLAGS, DEPTH)\n', (486, 509), False, 'import pygame\n'), ((511, 557), 'pygame.display.set_caption', 'pyg...
def mpl_plot_graph(ax,G,vertex_options={},edge_options={},dims=[0,1],directed=False): """Plots a graph G=(V,E) using matplotlib. ax is a matplotlib Axes object. If states have more than 2 dimensions, you can control the x-y axes using the dims argument. """ import numpy as np V,E = G i...
[ "matplotlib.collections.LineCollection", "numpy.array" ]
[((920, 973), 'matplotlib.collections.LineCollection', 'LineCollection', (['lines'], {'zorder': '(2)'}), '(lines, zorder=2, **collection_options)\n', (934, 973), False, 'from matplotlib.collections import LineCollection\n'), ((618, 661), 'numpy.array', 'np.array', (['[[x1, y1], [x2, y2]]'], {'dtype': 'float'}), '([[x1,...
""" Dubins Path """ import math import numpy as np import matplotlib.pyplot as plt from scipy.spatial.transform import Rotation as Rot import CurvesGenerator.draw as draw # class for PATH element class PATH: def __init__(self, L, mode, x, y, yaw): self.L = L # total path length [float] self.mode...
[ "matplotlib.pyplot.title", "math.hypot", "math.atan2", "matplotlib.pyplot.clf", "matplotlib.pyplot.figure", "matplotlib.pyplot.draw", "math.cos", "matplotlib.pyplot.pause", "numpy.stack", "math.sqrt", "math.sin", "matplotlib.pyplot.ion", "CurvesGenerator.draw.Car", "matplotlib.pyplot.plot"...
[((806, 821), 'math.sin', 'math.sin', (['alpha'], {}), '(alpha)\n', (814, 821), False, 'import math\n'), ((834, 848), 'math.sin', 'math.sin', (['beta'], {}), '(beta)\n', (842, 848), False, 'import math\n'), ((861, 876), 'math.cos', 'math.cos', (['alpha'], {}), '(alpha)\n', (869, 876), False, 'import math\n'), ((889, 90...
from rockyraccoon.model.wave_fn import WaveFunction from rockyraccoon.model.core import RaccoonWrapper from rockyraccoon.utils.plot import plot_qml_landscape_multiclass import matplotlib.pyplot as plt import numpy as np def multiclass_wave_fn(): """ Test the wave function QML model for a simple data set with ...
[ "rockyraccoon.model.wave_fn.WaveFunction", "rockyraccoon.model.core.RaccoonWrapper", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "rockyraccoon.utils.plot.plot_qml_landscape_multiclass", "numpy.tile", "numpy.vstack" ]
[((421, 469), 'rockyraccoon.model.wave_fn.WaveFunction', 'WaveFunction', ([], {'nclasses': '(3)', 'device': '"""default.qubit"""'}), "(nclasses=3, device='default.qubit')\n", (433, 469), False, 'from rockyraccoon.model.wave_fn import WaveFunction\n'), ((484, 505), 'rockyraccoon.model.core.RaccoonWrapper', 'RaccoonWrapp...
""" To Do: -Add an optional input for the networks so they can be defined in a main run script. -Test -Combine Training Operation """ from .method import Method from .buffer import Trajectory from .AdvantageEstimator import gae import tensorflow as tf import numpy as np from utils.utils import MovingAverage from utils...
[ "numpy.absolute", "tensorflow.keras.optimizers.SGD", "numpy.prod", "tensorflow.keras.optimizers.Adagrad", "numpy.full", "tensorflow.keras.optimizers.Adadelta", "tensorflow.variable_scope", "tensorflow.placeholder", "tensorflow.keras.optimizers.Adam", "tensorflow.name_scope", "numpy.stack", "te...
[((815, 867), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', '([None] + stateShape)', '"""S"""'], {}), "(tf.float32, [None] + stateShape, 'S')\n", (829, 867), True, 'import tensorflow as tf\n'), ((885, 924), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', '[None]', '"""A"""'], {}), "(tf.float32...
#!/usr/bin/env python3 """Plot the live microphone signal(s) with matplotlib. Matplotlib and NumPy have to be installed. """ import math from matplotlib.animation import FuncAnimation import matplotlib.pyplot as plt import numpy as np import rtmixer import sounddevice as sd window = 200 # ms interval = 30 # ms bl...
[ "matplotlib.pyplot.show", "rtmixer.Recorder", "numpy.roll", "numpy.frombuffer", "numpy.zeros", "sounddevice.query_devices", "matplotlib.animation.FuncAnimation", "rtmixer.RingBuffer", "math.log2", "matplotlib.pyplot.subplots" ]
[((1590, 1618), 'numpy.zeros', 'np.zeros', (['(length, channels)'], {}), '((length, channels))\n', (1598, 1618), True, 'import numpy as np\n'), ((1630, 1644), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (1642, 1644), True, 'import matplotlib.pyplot as plt\n'), ((2028, 2143), 'rtmixer.Recorder', 'rtm...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Aug 27 10:55:08 2020 @author: andreypoletaev Inputs: file = ... Required duration = ... Required file_out = ... Required com = ... Boolean, default: False. True if center-of-mass velocity. batch = ... Batch size for parallel. Defaul...
[ "itertools.repeat", "pandas.read_csv", "schwimmbad.MPIPool", "numpy.argwhere", "datetime.datetime.now", "sys.exit" ]
[((4599, 4608), 'schwimmbad.MPIPool', 'MPIPool', ([], {}), '()\n', (4606, 4608), False, 'from schwimmbad import MPIPool\n'), ((2400, 2445), 'pandas.read_csv', 'pd.read_csv', (["options['file']"], {'index_col': '(False)'}), "(options['file'], index_col=False)\n", (2411, 2445), True, 'import pandas as pd\n'), ((3845, 385...
#!/usr/bin/env python """Split the classes into two equal-sized groups to maximize accuracy.""" import json import os import random import numpy as np random.seed(0) import logging import sys from visualize import apply_permutation, plot_cm, read_symbols, swap, swap_1d logging.basicConfig(format='%(asctime)s %(le...
[ "visualize.plot_cm", "visualize.apply_permutation", "json.load", "logging.debug", "argparse.ArgumentParser", "logging.basicConfig", "random.randint", "numpy.zeros", "random.random", "os.path.isfile", "logging.info", "random.seed", "numpy.array", "numpy.exp", "visualize.swap", "visualiz...
[((155, 169), 'random.seed', 'random.seed', (['(0)'], {}), '(0)\n', (166, 169), False, 'import random\n'), ((276, 388), 'logging.basicConfig', 'logging.basicConfig', ([], {'format': '"""%(asctime)s %(levelname)s %(message)s"""', 'level': 'logging.DEBUG', 'stream': 'sys.stdout'}), "(format='%(asctime)s %(levelname)s %(m...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # text_representation: # extension: .py # format_name: light # format_version: '1.4' # jupytext_version: 1.1.4 # kernelspec: # display_name: Python 3 # language: python # name: python3 # --- # # S_HB...
[ "ColorCodedFP.ColorCodedFP", "matplotlib.pyplot.subplot2grid", "matplotlib.pyplot.style.use", "GarchResiduals.GarchResiduals", "numpy.arange", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "os.path.join", "os.path.abspath", "numpy.max", "BlowSpinFP.BlowSpinFP", "matplotlib.pypl...
[((991, 1015), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn"""'], {}), "('seaborn')\n", (1004, 1015), True, 'import matplotlib.pyplot as plt\n'), ((1597, 1628), 'ARPM_utils.struct_to_dict', 'struct_to_dict', (["db['StocksSPX']"], {}), "(db['StocksSPX'])\n", (1611, 1628), False, 'from ARPM_utils import ...
""" Application of SPOD to backward-facing step 2D slice pressure data by DDES. Details of the data can be found in the following: <NAME>., <NAME>., & <NAME>. (2022). Detached Eddy Simulation: Recent Development and Application to Compressor Tip Leakage Flow. ASME Journal of Turbomachinery, 144(1), 011009. <NAM...
[ "numpy.ones", "matplotlib.pyplot.figure", "numpy.mean", "numpy.arange", "matplotlib.pyplot.tricontourf", "matplotlib.pyplot.fill_between", "os.path.join", "matplotlib.pyplot.close", "os.path.dirname", "spod.plot_spectrum", "numpy.int", "numpy.real", "numpy.linspace", "io.BytesIO", "pylab...
[((691, 702), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (700, 702), False, 'import os\n'), ((718, 747), 'os.path.dirname', 'os.path.dirname', (['current_path'], {}), '(current_path)\n', (733, 747), False, 'import os\n'), ((792, 821), 'sys.path.insert', 'sys.path.insert', (['(0)', 'SPOD_path'], {}), '(0, SPOD_path)\n'...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Tue Mar 21 15:55:41 2017 @author: weif """ import pafy import pandas as pd import numpy as np from pydub import AudioSegment import soundfile as sf #%% #csv_header = ['YTID', 'start_sec', 'end_sec','l1','l2','l3','l4','l5','l6','l7','l8','l9','l10','l11'] ...
[ "pandas.DataFrame", "numpy.sum", "pandas.read_csv", "pafy.new", "numpy.zeros", "numpy.arange", "pydub.AudioSegment.from_file" ]
[((581, 753), 'pandas.read_csv', 'pd.read_csv', (['"""../eval_segments.csv"""'], {'skiprows': '(2)', 'header': 'None', 'names': "['id', 'start', 'end', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n '10', '11', '12', '13']"}), "('../eval_segments.csv', skiprows=2, header=None, names=['id',\n 'start', 'end', ...
from typing import Tuple import numpy as np from docknet.data_generator.data_generator import DataGenerator from docknet.util.geometry import random_to_polar, polar_to_cartesian class ClusterDataGenerator(DataGenerator): """ The cluster data generator generates two classes (0 and 1) of 2D vectors distribute...
[ "docknet.util.geometry.polar_to_cartesian", "numpy.array", "docknet.util.geometry.random_to_polar" ]
[((440, 458), 'docknet.util.geometry.random_to_polar', 'random_to_polar', (['x'], {}), '(x)\n', (455, 458), False, 'from docknet.util.geometry import random_to_polar, polar_to_cartesian\n'), ((516, 541), 'docknet.util.geometry.polar_to_cartesian', 'polar_to_cartesian', (['polar'], {}), '(polar)\n', (534, 541), False, '...
from __future__ import division, print_function import numpy as np import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt MU = 1.05 SIG = np.sqrt(0.105) def lognormal(x, mu=MU, sig=SIG): coeff = 1. / (x * sig * np.sqrt(2*np.pi)) expon = - (np.log(x)-mu)**2 / (2*sig**2) return coeff * np.e...
[ "numpy.log", "matplotlib.pyplot.clf", "matplotlib.pyplot.legend", "matplotlib.use", "numpy.exp", "numpy.linspace", "matplotlib.pyplot.savefig", "numpy.sqrt" ]
[((92, 106), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (99, 106), True, 'import matplotlib as mpl\n'), ((156, 170), 'numpy.sqrt', 'np.sqrt', (['(0.105)'], {}), '(0.105)\n', (163, 170), True, 'import numpy as np\n'), ((336, 363), 'numpy.linspace', 'np.linspace', (['(0.01)', '(10)', '(1000)'], {}), '...
# numpy_wrapper # # A wrapper around the NumPy library that makes it easier to use for simple # array mathematics. import numpy def new(num_rows, num_cols): return numpy.zeros((num_rows, num_cols), dtype=numpy.int32) def average(arrays_to_average): return numpy.mean(numpy.array(arrays_to_average), axis=0) d...
[ "numpy.array", "numpy.zeros" ]
[((170, 222), 'numpy.zeros', 'numpy.zeros', (['(num_rows, num_cols)'], {'dtype': 'numpy.int32'}), '((num_rows, num_cols), dtype=numpy.int32)\n', (181, 222), False, 'import numpy\n'), ((278, 308), 'numpy.array', 'numpy.array', (['arrays_to_average'], {}), '(arrays_to_average)\n', (289, 308), False, 'import numpy\n')]
import os import sys import numpy as np import cv2 import logging from wavedata.tools.obj_detection import obj_utils import perspective_utils as p_utils import matching_utils import trust_utils import config as cfg import std_utils import constants as const from tools.visualization import vis_matches # Compute and s...
[ "os.path.isfile", "perspective_utils.get_folder", "numpy.arange", "std_utils.delete_all_subdirs", "constants.ego_id", "os.path.join", "perspective_utils.get_all_detections", "trust_utils.AggregatedMessageEvaluation", "std_utils.make_dir", "trust_utils.get_message_trust_values", "numpy.savetxt", ...
[((521, 571), 'std_utils.delete_all_subdirs', 'std_utils.delete_all_subdirs', (['cfg.MSG_EVALS_SUBDIR'], {}), '(cfg.MSG_EVALS_SUBDIR)\n', (549, 571), False, 'import std_utils\n'), ((733, 759), 'constants.valid_perspectives', 'const.valid_perspectives', ([], {}), '()\n', (757, 759), True, 'import constants as const\n'),...
import PIL.Image import dnnlib import dnnlib.tflib as tflib import tensorflow as tf import PIL.ImageFile import scipy.ndimage import numpy as np import PIL.Image import dnnlib import dnnlib.tflib as tflib import os import re import sys sys.path.append(".") sys.path.append("..") import pretrained_networks def Ali...
[ "dlib.load_rgb_image", "tensorflow.reshape", "dnnlib.EasyDict", "numpy.floor", "numpy.clip", "pretrained_networks.load_networks", "tensorflow.matmul", "os.path.isfile", "numpy.mean", "dlib.cnn_face_detection_model_v1", "dlib.shape_predictor", "sys.path.append", "numpy.random.RandomState", ...
[((241, 261), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (256, 261), False, 'import sys\n'), ((262, 283), 'sys.path.append', 'sys.path.append', (['""".."""'], {}), "('..')\n", (277, 283), False, 'import sys\n'), ((484, 513), 'dlib.load_rgb_image', 'dlib.load_rgb_image', (['src_file'], {}), '(sr...
'''Numba tools This is a colection of functions used for numba functions that work for targets cpu as well as cuda ''' from __future__ import print_function __all__ = ['myjit', 'conjugate_transpose', 'conjugate', 'matrix_dot_matrix', 'matrix_dot_vector', 'clear_m...
[ "numpy.zeros", "numpy.ones", "numba.jit", "numba.cuda.jit", "numpy.linspace", "numpy.array_equal", "numpy.dot", "inspect.getsource" ]
[((2953, 2969), 'numpy.zeros', 'np.zeros', (['(3, 3)'], {}), '((3, 3))\n', (2961, 2969), True, 'import numpy as np\n'), ((3359, 3383), 'numpy.linspace', 'np.linspace', (['(1.0)', '(3.0)', '(3)'], {}), '(1.0, 3.0, 3)\n', (3370, 3383), True, 'import numpy as np\n'), ((3390, 3401), 'numpy.zeros', 'np.zeros', (['(3)'], {})...
# -*- coding: utf-8 -*- from __future__ import division, print_function __all__ = ["integrated_intensity", "intensity_weighted_velocity", "intensity_weighted_dispersion", "peak_pixel", "quadratic"] import numpy as np try: from scipy.ndimage.filters import gaussian_fil...
[ "numpy.moveaxis", "scipy.ndimage.filters.gaussian_filter1d", "numpy.sum", "numpy.load", "numpy.argmax", "scipy.ndimage.filters._gaussian_kernel1d", "numpy.ones", "numpy.arange", "numpy.zeros_like", "astropy.io.fits.getdata", "numpy.isfinite", "numpy.max", "numpy.reshape", "numpy.trapz", ...
[((1882, 1900), 'numpy.atleast_1d', 'np.atleast_1d', (['rms'], {}), '(rms)\n', (1895, 1900), True, 'import numpy as np\n'), ((4238, 4264), 'numpy.moveaxis', 'np.moveaxis', (['data', 'axis', '(0)'], {}), '(data, axis, 0)\n', (4249, 4264), True, 'import numpy as np\n'), ((4276, 4302), 'numpy.moveaxis', 'np.moveaxis', (['...
""" Created on 2019-12-20 @author: <NAME> - github.com/rpadrino - IMDEA Networks """ #imports from __future__ import division import math #from mod_read_crop_files import * #from mod_tracker import * #from mod_bin_classifier import * from mod_multiclass_classifier import * import os from os import listdir from os.pat...
[ "pandas.DataFrame", "os.path.abspath", "os.remove", "os.makedirs", "os.path.isdir", "os.path.exists", "os.path.isfile", "numpy.array", "pandas.concat", "os.path.join", "os.listdir", "shutil.copy" ]
[((4414, 4500), 'os.path.join', 'join', (['working_in_folder_path', 'camera_name', 'input_classification_path_to_crops_file'], {}), '(working_in_folder_path, camera_name,\n input_classification_path_to_crops_file)\n', (4418, 4500), False, 'from os.path import isfile, join\n'), ((4743, 4761), 'os.path.join', 'join', ...
""" Helper function to load part affinity fields and confidence maps on systems with no GPU where realtime processing is not possible """ import sys sys.path.insert(0,'../../easy_multi_person_pose_estimation') from poseestimation import model from time import time import numpy as np from os.path import isfi...
[ "numpy.load", "numpy.save", "sys.path.insert", "time.time", "os.path.isfile", "numpy.array", "numpy.squeeze", "poseestimation.model.PoseEstimator" ]
[((161, 222), 'sys.path.insert', 'sys.path.insert', (['(0)', '"""../../easy_multi_person_pose_estimation"""'], {}), "(0, '../../easy_multi_person_pose_estimation')\n", (176, 222), False, 'import sys\n'), ((529, 550), 'poseestimation.model.PoseEstimator', 'model.PoseEstimator', ([], {}), '()\n', (548, 550), False, 'from...
# Calculate KZIT (index of first interior grid cell) # interior grid cell = cell with no adjacent sidewall boundaries. # # Minimum of the 8 adjacent T-cells and the current T cell, -1 level. # Author: <NAME> # E-mail: <EMAIL> # Date: May/2019 import numpy as np from netCDF4 import Dataset from xarray ...
[ "netCDF4.Dataset", "numpy.logical_and", "numpy.zeros", "numpy.min", "xarray.DataArray", "numpy.int32" ]
[((584, 598), 'netCDF4.Dataset', 'Dataset', (['fname'], {}), '(fname)\n', (591, 598), False, 'from netCDF4 import Dataset\n'), ((991, 1009), 'numpy.zeros', 'np.zeros', (['(ny, nx)'], {}), '((ny, nx))\n', (999, 1009), True, 'import numpy as np\n'), ((2693, 2711), 'numpy.int32', 'np.int32', (['(kzit + 1)'], {}), '(kzit +...
import numpy as np import pandas as pd from mendeleev import element from scipy.constants import codata from read_database import load_levels_lines from RF_mathematica import cross_section from cumsum_diff import cumsum_diff from iter_calc import * import itertools import matplotlib.pyplot as plt, mpld3 import scipy...
[ "scipy.constants.codata.value", "RF_mathematica.cross_section", "numpy.around", "read_database.load_levels_lines", "numpy.exp", "matplotlib.pyplot.gca", "pandas.DataFrame", "numpy.genfromtxt", "numpy.loadtxt", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "cumsum_diff.cumsum_diff", ...
[((544, 635), 'numpy.genfromtxt', 'np.genfromtxt', (['atomionspins_file'], {'delimiter': '"""\t"""', 'dtype': 'str', 'skip_header': '(1)', 'autostrip': '(1)'}), "(atomionspins_file, delimiter='\\t', dtype=str, skip_header=1,\n autostrip=1)\n", (557, 635), True, 'import numpy as np\n'), ((953, 971), 'mendeleev.elemen...
''' This code is an implementation of policy iteration in the Grid World. ''' __author__ = '<NAME>' __copyright__ = 'Copyright 2019, Simple Reinforcement Learning project' __license__ = 'MIT' __version__ = '1.0.0' __maintainer__ = '<NAME>' __email__ = '<EMAIL>, gmail.com}' __status__ = 'Development' import ...
[ "numpy.chararray", "numpy.asanyarray", "numpy.zeros" ]
[((776, 811), 'numpy.zeros', 'np.zeros', (['(grid_height, grid_width)'], {}), '((grid_height, grid_width))\n', (784, 811), True, 'import numpy as np\n'), ((2911, 2957), 'numpy.chararray', 'np.chararray', (['(4, 4)'], {'unicode': '(True)', 'itemsize': '(4)'}), '((4, 4), unicode=True, itemsize=4)\n', (2923, 2957), True, ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Reads tidefac output and adapt given bctides file as required by the tidefac outputs. This script uses a dictionary to store the constituent values. The problem with dictionary is it does not maintain the order of the dictionary key as they are added. So consequently...
[ "numpy.genfromtxt", "numpy.arange", "numpy.array", "collections.OrderedDict", "os.path.join", "numpy.fromstring" ]
[((7074, 7107), 'os.path.join', 'os.path.join', (['path', '"""bctides.ini"""'], {}), "(path, 'bctides.ini')\n", (7086, 7107), False, 'import os\n'), ((7128, 7160), 'os.path.join', 'os.path.join', (['path', '"""bctides.in"""'], {}), "(path, 'bctides.in')\n", (7140, 7160), False, 'import os\n'), ((7176, 7210), 'os.path.j...
import numpy as np from scipy import signal from .utils.jade import jadeR from .base import VHRMethod class ICA(VHRMethod): methodName = 'ICA' def __init__(self, **kwargs): self.tech = kwargs['ICAmethod'] super(ICA, self).__init__(**kwargs) def apply(self, X): """ ICA method...
[ "numpy.dot", "sklearn.decomposition.FastICA", "sklearn.decomposition.PCA" ]
[((506, 518), 'numpy.dot', 'np.dot', (['W', 'X'], {}), '(W, X)\n', (512, 518), True, 'import numpy as np\n'), ((808, 827), 'sklearn.decomposition.PCA', 'PCA', ([], {'n_components': '(3)'}), '(n_components=3)\n', (811, 827), False, 'from sklearn.decomposition import FastICA, PCA\n'), ((893, 931), 'sklearn.decomposition....
from __future__ import division, print_function import math import numpy as np import numpy.random import scipy as sp import scipy.stats def ballot_comparison_pvalue(n, gamma, o1, u1, o2, u2, reported_margin, N, null_lambda=1): """ Compute the p-value for a ballot comparison audit using Kaplan-Markov ...
[ "numpy.min", "numpy.log", "numpy.exp" ]
[((1730, 1748), 'numpy.exp', 'np.exp', (['log_pvalue'], {}), '(log_pvalue)\n', (1736, 1748), True, 'import numpy as np\n'), ((1760, 1779), 'numpy.min', 'np.min', (['[pvalue, 1]'], {}), '([pvalue, 1])\n', (1766, 1779), True, 'import numpy as np\n'), ((1697, 1718), 'numpy.log', 'np.log', (['(1 + 1 / gamma)'], {}), '(1 + ...
# 两层全链接网络 # pytorch 官方示例 import numpy as np # N为样本大小; D_in为样本维度 # H为隐藏层维度; D_out 为输出维度(分类数) N,D_in, H, D_out = 64,1000,100,10 #生成随机样本 x = np.random.randn(N,D_in) y = np.random.randn(N,D_out) #生成随机权重 w1 = np.random.randn(D_in, H) w2 = np.random.randn(H, D_out) learning_rate = 1e-6 for t in range(500): #前向传播:计算Y的...
[ "numpy.square", "numpy.maximum", "numpy.random.randn" ]
[((140, 164), 'numpy.random.randn', 'np.random.randn', (['N', 'D_in'], {}), '(N, D_in)\n', (155, 164), True, 'import numpy as np\n'), ((168, 193), 'numpy.random.randn', 'np.random.randn', (['N', 'D_out'], {}), '(N, D_out)\n', (183, 193), True, 'import numpy as np\n'), ((207, 231), 'numpy.random.randn', 'np.random.randn...
""" Neighborhood Components Analysis (NCA) """ from __future__ import absolute_import import warnings import time import sys import numpy as np from scipy.optimize import minimize from sklearn.metrics import pairwise_distances from sklearn.exceptions import ConvergenceWarning, ChangedBehaviorWarning from sklearn.utils...
[ "numpy.fill_diagonal", "scipy.optimize.minimize", "sklearn.utils.fixes.logsumexp", "sklearn.metrics.pairwise_distances", "time.time", "numpy.finfo", "sys.stdout.flush", "numpy.dot", "warnings.warn" ]
[((499, 514), 'numpy.finfo', 'np.finfo', (['float'], {}), '(float)\n', (507, 514), True, 'import numpy as np\n'), ((5972, 5983), 'time.time', 'time.time', ([], {}), '()\n', (5981, 5983), False, 'import time\n'), ((7385, 7413), 'scipy.optimize.minimize', 'minimize', ([], {}), '(**optimizer_params)\n', (7393, 7413), Fals...
import os import numpy as np from rpeakdetection.rpeak_detector import RPeakDetector rpd = RPeakDetector() evaluation_width = 36 ecg_folder = "../data/ecg/mitdb/" peaks_folder = "../data/peaks/pan_tompkins/" precisions = list() recalls = list() for name in os.listdir(peaks_folder): peaks = list() file = open(pe...
[ "numpy.mean", "rpeakdetection.rpeak_detector.RPeakDetector", "os.listdir" ]
[((91, 106), 'rpeakdetection.rpeak_detector.RPeakDetector', 'RPeakDetector', ([], {}), '()\n', (104, 106), False, 'from rpeakdetection.rpeak_detector import RPeakDetector\n'), ((257, 281), 'os.listdir', 'os.listdir', (['peaks_folder'], {}), '(peaks_folder)\n', (267, 281), False, 'import os\n'), ((637, 656), 'numpy.mean...
import numpy as np import torch.utils.data class MultiEpochSampler(torch.utils.data.Sampler): r"""Samples elements randomly over multiple epochs Arguments: data_source (Dataset): dataset to sample from num_iter (int) : Number of times to loop over the dataset start_itr (int) : which i...
[ "numpy.random.permutation" ]
[((1225, 1249), 'numpy.random.permutation', 'np.random.permutation', (['n'], {}), '(n)\n', (1246, 1249), True, 'import numpy as np\n')]
"""Ray-distributed environment stepper.""" import typing import numpy as np import ray from alpacka.batch_steppers import core from alpacka.batch_steppers import worker_utils class RayObject(typing.NamedTuple): """Keeps value and id of an object in the Ray Object Store.""" id: typing.Any value: typing....
[ "ray.init", "ray.remote", "alpacka.batch_steppers.worker_utils.get_config", "alpacka.batch_steppers.worker_utils.decompress_episode", "ray.is_initialized", "ray.put", "numpy.array_equal" ]
[((1112, 1171), 'alpacka.batch_steppers.worker_utils.get_config', 'worker_utils.get_config', (['env_class', 'agent_class', 'network_fn'], {}), '(env_class, agent_class, network_fn)\n', (1135, 1171), False, 'from alpacka.batch_steppers import worker_utils\n'), ((1197, 1228), 'ray.remote', 'ray.remote', (['worker_utils.W...
import os import time import argparse import numpy as np import seaborn as sns import matplotlib.pyplot as plt from matplotlib import animation from algorithms.gradient_descent_2d import GradientDescent2D from algorithms.momentum_2d import Momentum2D plt.style.use('seaborn') def getArguments(): parser = argpars...
[ "matplotlib.pyplot.title", "seaborn.kdeplot", "argparse.ArgumentParser", "matplotlib.pyplot.show", "os.makedirs", "algorithms.gradient_descent_2d.GradientDescent2D", "matplotlib.pyplot.close", "os.path.exists", "matplotlib.animation.FuncAnimation", "time.time", "matplotlib.pyplot.style.use", "...
[((253, 277), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""seaborn"""'], {}), "('seaborn')\n", (266, 277), True, 'import matplotlib.pyplot as plt\n'), ((313, 389), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Parameters to tweak gradient descent."""'}), "(description='Paramete...
import sys #import importlib #importlib.reload(sys) import pickle import re from string import punctuation from nltk.tokenize import word_tokenize #sys.setdefaultencoding("utf-8") import numpy as np import math class PhraseVector: def __init__(self, wordvec_model, phrase): self.phrase = phrase se...
[ "math.isnan", "numpy.transpose", "pickle.load", "numpy.mean", "numpy.linalg.norm", "numpy.dot", "re.sub", "nltk.tokenize.word_tokenize" ]
[((960, 990), 're.sub', 're.sub', (['"""http\\\\S+"""', '""""""', 'phrase'], {}), "('http\\\\S+', '', phrase)\n", (966, 990), False, 'import re\n'), ((1008, 1034), 're.sub', 're.sub', (['"""http"""', '""""""', 'phrase'], {}), "('http', '', phrase)\n", (1014, 1034), False, 'import re\n'), ((1053, 1080), 're.sub', 're.su...
import unittest import numpy as np from numpy.testing import assert_array_almost_equal from specklesnake.model.bilinear import BilinearElement class TestBilinearElement(unittest.TestCase): def setUp(self): super().setUp() element = BilinearElement() nodes = np.array([ [0.0, 0...
[ "specklesnake.model.bilinear.BilinearElement", "numpy.testing.assert_array_almost_equal", "numpy.array" ]
[((256, 273), 'specklesnake.model.bilinear.BilinearElement', 'BilinearElement', ([], {}), '()\n', (271, 273), False, 'from specklesnake.model.bilinear import BilinearElement\n'), ((290, 348), 'numpy.array', 'np.array', (['[[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 1.0]]'], {}), '([[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0...
import numpy as np import cv2 # import glob # Termination criteria criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001) # Prepare object Points objp = np.zeros((7*9,3), np.float32) objp[:,:2] = np.mgrid[0:9,0:7].T.reshape(-1,2) # Array to store object points and image points from all images obj...
[ "cv2.undistort", "cv2.findChessboardCorners", "cv2.cvtColor", "cv2.waitKey", "numpy.savetxt", "numpy.zeros", "cv2.imshow", "cv2.projectPoints", "cv2.addWeighted", "cv2.VideoCapture", "cv2.cornerSubPix", "cv2.calibrateCamera", "cv2.norm", "cv2.drawChessboardCorners", "cv2.destroyAllWindow...
[((175, 207), 'numpy.zeros', 'np.zeros', (['(7 * 9, 3)', 'np.float32'], {}), '((7 * 9, 3), np.float32)\n', (183, 207), True, 'import numpy as np\n'), ((755, 774), 'cv2.VideoCapture', 'cv2.VideoCapture', (['(0)'], {}), '(0)\n', (771, 774), False, 'import cv2\n'), ((2006, 2029), 'cv2.destroyAllWindows', 'cv2.destroyAllWi...
from argparse import ArgumentParser import json import networkx as nx import gzip import numpy as np import statistics def compute_diameter(adjacency_list): # graph is a list of edges # every edge is a list: [source, type, target] g = nx.Graph() for edge_source, _, edge_target in adjacency_list: ...
[ "gzip.open", "argparse.ArgumentParser", "json.loads", "statistics.stdev", "numpy.percentile", "numpy.mean", "networkx.Graph", "networkx.diameter" ]
[((248, 258), 'networkx.Graph', 'nx.Graph', ([], {}), '()\n', (256, 258), True, 'import networkx as nx\n'), ((370, 384), 'networkx.diameter', 'nx.diameter', (['g'], {}), '(g)\n', (381, 384), True, 'import networkx as nx\n'), ((426, 442), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (440, 442), False, ...
# -*- coding: UTF-8 -*- import math import numpy as np from scipy.spatial.transform import Rotation as R import sys from dbstep.constants import metals """ calculator Performs calculations for finding angles, translation and rotation of molecules """ def unit_vector(vector): """ Returns the unit vector of the vec...
[ "numpy.arctan2", "numpy.copy", "numpy.degrees", "numpy.array", "numpy.linalg.norm", "sys.exit", "scipy.spatial.transform.Rotation.from_euler" ]
[((478, 503), 'numpy.array', 'np.array', (['[0.0, 0.0, 0.0]'], {}), '([0.0, 0.0, 0.0])\n', (486, 503), True, 'import numpy as np\n'), ((1404, 1419), 'numpy.copy', 'np.copy', (['coords'], {}), '(coords)\n', (1411, 1419), True, 'import numpy as np\n'), ((1439, 1459), 'numpy.copy', 'np.copy', (['cube_origin'], {}), '(cube...
import numpy as np from scipy import linalg import matplotlib.pyplot as plt def gen_data(n): x = np.random.randn(n, 1) #print(x) c = np.random.randn(1, 1) * n**2 #print(c) P_gen = np.random.randn(n, n) P_gen = (P_gen + np.transpose(P_gen)) / 2 #print(P_gen) w, v = linalg.e...
[ "numpy.amin", "numpy.allclose", "numpy.random.randint", "numpy.diag", "scipy.linalg.eigvalsh", "numpy.random.randn", "numpy.transpose", "numpy.max", "scipy.linalg.eigh", "matplotlib.pyplot.show", "numpy.hstack", "numpy.min", "matplotlib.pyplot.ylabel", "numpy.dot", "numpy.vstack", "mat...
[((107, 128), 'numpy.random.randn', 'np.random.randn', (['n', '(1)'], {}), '(n, 1)\n', (122, 128), True, 'import numpy as np\n'), ((210, 231), 'numpy.random.randn', 'np.random.randn', (['n', 'n'], {}), '(n, n)\n', (225, 231), True, 'import numpy as np\n'), ((312, 330), 'scipy.linalg.eigh', 'linalg.eigh', (['P_gen'], {}...
# -*-coding:utf-8-*- """ 使用 kNN(k - 临近) 算法实现简易的手写数字识别 """ import numpy as np import operator from os import listdir def img_to_vector(filename): """ 将图片转换为向量 :param filename: 图片的文件名 :return: 图片相应的向量 """ vector = np.zeros((1, 1024)) fr = open(filename) for i in range(32): lines ...
[ "numpy.tile", "operator.itemgetter", "numpy.zeros", "os.listdir" ]
[((238, 257), 'numpy.zeros', 'np.zeros', (['(1, 1024)'], {}), '((1, 1024))\n', (246, 257), True, 'import numpy as np\n'), ((1331, 1357), 'os.listdir', 'listdir', (['"""training_digits"""'], {}), "('training_digits')\n", (1338, 1357), False, 'from os import listdir\n'), ((1412, 1431), 'numpy.zeros', 'np.zeros', (['(m, 1...
""" Implementation on Pyomo of Distribution Expansion Planning Model proposed by Muñoz-Delgado et al. (2014). Reference: <NAME>., <NAME>., & <NAME>. (2014). Joint expansion planning of distributed generation and distribution networks. IEEE Transactions on Power Systems, 30(5), 2579-2590. DOI: 10.1109/TPWRS.2014.236496...
[ "pandas.DataFrame", "pyomo.environ.Constraint", "pyomo.environ.Var", "pyomo.environ.value", "pyomo.environ.Objective", "numpy.shape", "pyomo.opt.SolverFactory", "pyomo.environ.ConcreteModel", "pyomo.environ.Set", "pyomo.environ.ConstraintList", "pyomo.environ.inequality" ]
[((949, 968), 'pyomo.environ.ConcreteModel', 'pyo.ConcreteModel', ([], {}), '()\n', (966, 968), True, 'import pyomo.environ as pyo\n'), ((1157, 1187), 'pyomo.environ.Var', 'pyo.Var', (['T'], {'bounds': '(0.0, None)'}), '(T, bounds=(0.0, None))\n', (1164, 1187), True, 'import pyomo.environ as pyo\n'), ((1248, 1278), 'py...
""" File: examples/distribution/sech_distribution.py Author: <NAME> Date: Oct 15 2019 Description: Example of using the SechDistribution class to represent 1D random variates. """ import os, time import numpy as np import matplotlib.pyplot as pl from distpy import SechDistribution sample_size = int(1e5) ...
[ "os.remove", "matplotlib.pyplot.show", "numpy.std", "time.time", "distpy.SechDistribution", "matplotlib.pyplot.figure", "numpy.mean", "numpy.arange", "distpy.SechDistribution.load" ]
[((359, 388), 'distpy.SechDistribution', 'SechDistribution', (['umean', 'uvar'], {}), '(umean, uvar)\n', (375, 388), False, 'from distpy import SechDistribution\n'), ((658, 669), 'time.time', 'time.time', ([], {}), '()\n', (667, 669), False, 'import os, time\n'), ((1140, 1151), 'matplotlib.pyplot.figure', 'pl.figure', ...
#!/usr/bin/env python3 """Utilities for cross-validation. Notice data/folds-10.pkl we use in 10-fold cross-val. Keep it to replicate our results""" import numpy as np import glob from os.path import basename, join from sklearn.model_selection import StratifiedKFold import pickle def load_data(in_dir, folds=None, spl...
[ "pickle.dump", "numpy.load", "os.path.basename", "numpy.argmax", "numpy.array", "sklearn.model_selection.StratifiedKFold", "glob.glob", "numpy.vstack", "os.path.join", "numpy.concatenate" ]
[((2764, 2786), 'numpy.array', 'np.array', (['[0, 1, 2, 3]'], {}), '([0, 1, 2, 3])\n', (2772, 2786), True, 'import numpy as np\n'), ((3037, 3053), 'numpy.array', 'np.array', (['labels'], {}), '(labels)\n', (3045, 3053), True, 'import numpy as np\n'), ((3080, 3122), 'sklearn.model_selection.StratifiedKFold', 'Stratified...
import json import logging import os import shutil import torch import numpy as np import scipy.misc from io import BytesIO import sys import time import torch.nn as nn import torch.nn.init as init import torch.nn.functional as F from pathlib import Path from scipy.stats import norm from scipy.optimize import minimize...
[ "sys.stdout.write", "os.mkdir", "numpy.random.seed", "logging.Formatter", "sys.stdout.flush", "numpy.exp", "torch.no_grad", "os.path.join", "scipy.optimize.minimize", "logging.FileHandler", "torch.utils.data.DataLoader", "torch.load", "sklearn.metrics.log_loss", "os.path.exists", "numpy....
[((6273, 6284), 'time.time', 'time.time', ([], {}), '()\n', (6282, 6284), False, 'import time\n'), ((517, 542), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (540, 542), False, 'import torch\n'), ((2407, 2426), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (2424, 2426), False, 'i...
from numpy.testing import assert_almost_equal, assert_array_equal from model import * def test_sample_ecc(): for _ in range(10): ecc = np.random.randint(100) x, y = sample_ecc(ecc) assert_almost_equal(x**2 + y**2, ecc**2) def test_generate_params(): cov = np.array([[0, 0], [0, 1]]) ...
[ "numpy.testing.assert_array_equal", "numpy.testing.assert_almost_equal" ]
[((524, 559), 'numpy.testing.assert_array_equal', 'assert_array_equal', (['params', 'params_'], {}), '(params, params_)\n', (542, 559), False, 'from numpy.testing import assert_almost_equal, assert_array_equal\n'), ((957, 1011), 'numpy.testing.assert_almost_equal', 'assert_almost_equal', (['params[:, 2]', '([2] * 10)']...
import numpy as np class Experiment: """This class describes the experiment setup. Both the characteristics of a specific experiment and of the simulation are included. Moreover, the state during a simulation run can be acessed. """ def __init__(self, id, nr_wires, nr_strands, stress_rang...
[ "numpy.random.exponential", "numpy.sqrt" ]
[((7463, 7515), 'numpy.random.exponential', 'np.random.exponential', (['(lambda_fatigue * stress_range)'], {}), '(lambda_fatigue * stress_range)\n', (7484, 7515), True, 'import numpy as np\n'), ((6916, 6982), 'numpy.random.exponential', 'np.random.exponential', (['(lambda_fatigue_fretting_crack * crack_width)'], {}), '...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Jan 30 19:56:57 2022 @author: <NAME> """ import numpy as np nrandG=np.random.default_rng() #### for the purposes of calculations hbar=1 #### what is mu? can it be 0? it says tuning paramtere, so i assume constant. #H_el = sum_k (hbar k )^2/(2 m ) ...
[ "numpy.log", "numpy.zeros", "numpy.ones", "numpy.random.default_rng", "numpy.linalg.norm", "numpy.exp" ]
[((136, 159), 'numpy.random.default_rng', 'np.random.default_rng', ([], {}), '()\n', (157, 159), True, 'import numpy as np\n'), ((1227, 1244), 'numpy.linalg.norm', 'np.linalg.norm', (['q'], {}), '(q)\n', (1241, 1244), True, 'import numpy as np\n'), ((1762, 1784), 'numpy.exp', 'np.exp', (['(-omegaPH * tau)'], {}), '(-om...
# -*- coding: UTF-8 -*- """Learner for ProGANs (Progressively Growing GANs). Typical usage example: First configure your desired GAN on the command-line: go to root directory... $ python config.py progan $ python data_config.py CelebA-HQ path/to/datasets/celeba_hq Then write a custom script (or us...
[ "torch.cat", "matplotlib.pyplot.figure", "pathlib.Path", "torch.optim.lr_scheduler.LambdaLR", "torch.device", "torch.no_grad", "torch.ones", "warnings.simplefilter", "torch.nn.functional.avg_pool2d", "torch.load", "torchvision.transforms.ToPILImage", "torch.nn.functional.binary_cross_entropy_w...
[((2174, 2225), 'matplotlib.pyplot.rcParams.update', 'plt.rcParams.update', (["{'figure.max_open_warning': 0}"], {}), "({'figure.max_open_warning': 0})\n", (2193, 2225), True, 'import matplotlib.pyplot as plt\n'), ((9260, 9275), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (9273, 9275), False, 'import torch\n'),...
import numpy as np import networkx as nx import itertools as it import random from delegationForest import forest import scipy.stats as sts from utils import network_utils as nu import math class Election: def __init__(self, n, num_samples=1000): self.n = n self.network = nx.Graph() se...
[ "numpy.random.uniform", "random.sample", "random.shuffle", "numpy.random.exponential", "itertools.combinations", "random.random", "networkx.Graph", "utils.network_utils.validate_network", "scipy.stats.truncnorm.rvs", "utils.network_utils.generate_single_network", "math.log2", "numpy.prod", "...
[((299, 309), 'networkx.Graph', 'nx.Graph', ([], {}), '()\n', (307, 309), True, 'import networkx as nx\n'), ((445, 454), 'delegationForest.forest', 'forest', (['n'], {}), '(n)\n', (451, 454), False, 'from delegationForest import forest\n'), ((1377, 1410), 'utils.network_utils.validate_network', 'nu.validate_network', (...
# coding: utf-8 # # Nengo Example: Matrix multiplication # # This example demonstrates how to perform general matrix multiplication using Nengo. The matrix can change during the computation, which makes it distinct from doing static matrix multiplication with neural connection weights (as done in all neural network...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "matplotlib.pyplot.axhline", "nengo.dists.Choice", "nengo.networks.EnsembleArray", "numpy.asarray", "numpy.zeros", "nengo.Probe", "nengo.Simulator", "numpy.dot", "nengo.Network", "nengo.Connection" ]
[((427, 452), 'numpy.asarray', 'np.asarray', (['[[0.5, -0.5]]'], {}), '([[0.5, -0.5]])\n', (437, 452), True, 'import numpy as np\n'), ((458, 496), 'numpy.asarray', 'np.asarray', (['[[0.58, -1.0], [0.7, 0.1]]'], {}), '([[0.58, -1.0], [0.7, 0.1]])\n', (468, 496), True, 'import numpy as np\n'), ((572, 626), 'nengo.Network...
# > \brief \b SROTG # # =========== DOCUMENTATION =========== # # Online html documentation available at # http://www.netlib.org/lapack/explore-html/ # # Definition: # =========== # # def SROTG(SA,SB,C,S) # # .. Scalar Arguments .. # REAL C,S,SA,SB # .. # # # > \par Purpose: # ===...
[ "math.sqrt", "numpy.sign" ]
[((1979, 2022), 'math.sqrt', 'sqrt', (['((SA / SCALE) ** 2 + (SB / SCALE) ** 2)'], {}), '((SA / SCALE) ** 2 + (SB / SCALE) ** 2)\n', (1983, 2022), False, 'from math import sqrt\n'), ((1956, 1968), 'numpy.sign', 'np.sign', (['ROE'], {}), '(ROE)\n', (1963, 1968), True, 'import numpy as np\n')]
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2017 <NAME> """Convert inputs and lables GLOBAL cmvns to a Numpy file.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import os import sys import struct import numpy as np ...
[ "argparse.ArgumentParser", "numpy.hsplit", "numpy.reshape", "numpy.savez", "os.path.join", "sys.exit", "numpy.sqrt" ]
[((991, 1048), 'numpy.sqrt', 'np.sqrt', (['(cmvn_inputs[1] / inputs_frame - mean_inputs ** 2)'], {}), '(cmvn_inputs[1] / inputs_frame - mean_inputs ** 2)\n', (998, 1048), True, 'import numpy as np\n'), ((1117, 1174), 'numpy.sqrt', 'np.sqrt', (['(cmvn_labels[1] / labels_frame - mean_labels ** 2)'], {}), '(cmvn_labels[1]...
import argparse import os from pathlib import Path import numpy as np from lib.GANDCTAnalysis.src.dataset import image_paths from lib.GANDCTAnalysis.src.image_np import load_image from src.resources.calculations import subtract_fingerprint, reduce_fingerprint_proportionally, dct, restore_from_dct, \ remove_high_fre...
[ "src.resources.calculations.remove_high_frequencies", "numpy.load", "src.resources.calculations.reduce_fingerprint_proportionally", "os.makedirs", "argparse.ArgumentParser", "src.resources.calculations.restore_from_dct", "lib.GANDCTAnalysis.src.dataset.image_paths", "src.resources.calculations.dct", ...
[((503, 543), 'src.resources.calculations.restore_from_dct', 'restore_from_dct', (['manipulated', 'greyscale'], {}), '(manipulated, greyscale)\n', (519, 543), False, 'from src.resources.calculations import subtract_fingerprint, reduce_fingerprint_proportionally, dct, restore_from_dct, remove_high_frequencies\n'), ((195...
#! /usr/bin/env python3.6 import argparse import json from rospkg import RosPack import os from glob import glob import matplotlib.pyplot as plt import numpy as np from typing import Union, List import yaml if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('run_name', default...
[ "yaml.load", "argparse.ArgumentParser", "os.path.isfile", "matplotlib.pyplot.gca", "matplotlib.pyplot.tight_layout", "os.path.join", "numpy.max", "matplotlib.pyplot.rcParams.update", "numpy.average", "matplotlib.pyplot.show", "matplotlib.pyplot.ylim", "numpy.min", "matplotlib.pyplot.gcf", ...
[((251, 276), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (274, 276), False, 'import argparse\n'), ((684, 729), 'os.path.join', 'os.path.join', (['pkg_path', '"""runs"""', 'args.run_name'], {}), "(pkg_path, 'runs', args.run_name)\n", (696, 729), False, 'import os\n'), ((1537, 1575), 'matplot...
import numpy as np from torch.utils.data import Dataset, DataLoader class MNIST_Dataset(Dataset): def __init__(self, image): super(MNIST_Dataset).__init__() self.image = image def __len__(self): return self.image.shape[0] def __getitem__(self, idx): return np.random.bino...
[ "numpy.random.binomial" ]
[((306, 347), 'numpy.random.binomial', 'np.random.binomial', (['(1)', 'self.image[idx, :]'], {}), '(1, self.image[idx, :])\n', (324, 347), True, 'import numpy as np\n'), ((606, 647), 'numpy.random.binomial', 'np.random.binomial', (['(1)', 'self.image[idx, :]'], {}), '(1, self.image[idx, :])\n', (624, 647), True, 'impor...
# Copyright 2020 Graphcore Ltd. import os import numpy as np import tensorflow.compat.v1 as tf from tensorflow.python import ipu tf.disable_v2_behavior() SIZE = 5 def add_op(x, y): outputs = { "output_types": [tf.float32], "output_shapes": [tf.TensorShape([SIZE])], } base_path = os.pat...
[ "tensorflow.python.ipu.utils.configure_ipu_system", "tensorflow.python.ipu.scopes.ipu_scope", "os.path.join", "tensorflow.python.ipu.custom_ops.precompiled_user_op", "tensorflow.compat.v1.placeholder", "os.path.dirname", "tensorflow.compat.v1.TensorShape", "tensorflow.python.ipu.ipu_compiler.compile",...
[((131, 155), 'tensorflow.compat.v1.disable_v2_behavior', 'tf.disable_v2_behavior', ([], {}), '()\n', (153, 155), True, 'import tensorflow.compat.v1 as tf\n'), ((373, 415), 'os.path.join', 'os.path.join', (['base_path', '"""libcustom_op.so"""'], {}), "(base_path, 'libcustom_op.so')\n", (385, 415), False, 'import os\n')...
import numpy as np import sys import shapely.geometry import shapely.ops import ujson as json from descartes.patch import PolygonPatch import matplotlib #matplotlib.use('GTKAgg') import matplotlib.pyplot as plt from collections import defaultdict import os class TilespecVisualizer(object): def __init__(self, scal...
[ "descartes.patch.PolygonPatch", "matplotlib.pyplot.show", "os.path.basename", "ujson.load", "collections.defaultdict", "matplotlib.pyplot.figure", "numpy.min", "numpy.array", "numpy.max", "matplotlib.pyplot.gca" ]
[((880, 892), 'matplotlib.pyplot.figure', 'plt.figure', ([], {}), '()\n', (890, 892), True, 'import matplotlib.pyplot as plt\n'), ((2372, 2389), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (2383, 2389), False, 'from collections import defaultdict\n'), ((4048, 4074), 'os.path.basename', 'os.pat...
""" Code by <NAME>(@graykode) https://en.wikipedia.org/wiki/Bernoulli_distribution """ import random import numpy as np from matplotlib import pyplot as plt def bernoulli(p, k): return p if k else 1 - p n_experiment = 100 p = 0.6 x = np.arange(n_experiment) y = [] for _ in range(n_experiment): pick = ...
[ "matplotlib.pyplot.show", "numpy.std", "matplotlib.pyplot.scatter", "matplotlib.pyplot.legend", "numpy.mean", "numpy.arange", "random.getrandbits", "matplotlib.pyplot.savefig" ]
[((248, 271), 'numpy.arange', 'np.arange', (['n_experiment'], {}), '(n_experiment)\n', (257, 271), True, 'import numpy as np\n'), ((413, 476), 'matplotlib.pyplot.scatter', 'plt.scatter', (['x', 'y'], {'label': "('$\\\\mu=%.2f,\\\\ \\\\sigma=%.2f$' % (u, s))"}), "(x, y, label='$\\\\mu=%.2f,\\\\ \\\\sigma=%.2f$' % (u, s)...
""" Download from https://raw.githubusercontent.com/EricYizhenWang/robust_nn_icml/master/robust_1nn.py """ from __future__ import division import numpy as np from sklearn.neighbors import NearestNeighbors, KNeighborsClassifier from scipy.spatial.distance import cdist from .robust_nn.eps_separation import find_eps_sep...
[ "scipy.spatial.distance.cdist", "numpy.sum", "numpy.log", "numpy.unique", "numpy.ones", "numpy.array", "sklearn.neighbors.NearestNeighbors", "numpy.linalg.norm", "numpy.sign", "numpy.vstack", "numpy.concatenate" ]
[((472, 491), 'sklearn.neighbors.NearestNeighbors', 'NearestNeighbors', (['k'], {}), '(k)\n', (488, 491), False, 'from sklearn.neighbors import NearestNeighbors, KNeighborsClassifier\n'), ((576, 617), 'numpy.array', 'np.array', (['[[Y[j] for j in i] for i in nn]'], {}), '([[Y[j] for j in i] for i in nn])\n', (584, 617)...
from mesa import Agent import numpy as np ''' This module describes the main agents used in CityModel: - CarAgent - BuildingAgent - TrafficLightAgent - IntersectionAgent ''' class CarAgent(Agent): ''' Creates a car agent inside the model grid. Arguments: - unique_id: car identifier - ...
[ "numpy.random.uniform", "numpy.ceil" ]
[((5730, 5749), 'numpy.random.uniform', 'np.random.uniform', ([], {}), '()\n', (5747, 5749), True, 'import numpy as np\n'), ((1457, 1478), 'numpy.ceil', 'np.ceil', (['(distance / 2)'], {}), '(distance / 2)\n', (1464, 1478), True, 'import numpy as np\n'), ((5773, 5792), 'numpy.random.uniform', 'np.random.uniform', ([], ...
# /usr/bin/python from __future__ import print_function, division import click import glob from lxml import etree import numpy as np import os import pandas as pd from PIL import Image import shutil import subprocess import tensorflow as tf from tqdm import tqdm from object_detection.kitti_to_voc import kitti_to_voc ...
[ "os.remove", "numpy.floor", "click.option", "object_detection.utils.label_map_util.get_label_map_dict", "glob.glob", "os.path.join", "os.path.dirname", "os.path.exists", "click.command", "numpy.random.choice", "tqdm.tqdm", "os.path.basename", "pandas.Index", "tensorflow.gfile.GFile", "ob...
[((509, 566), 'object_detection.utils.label_map_util.get_label_map_dict', 'label_map_util.get_label_map_dict', (['"""data/kitti_map.pbtxt"""'], {}), "('data/kitti_map.pbtxt')\n", (542, 566), False, 'from object_detection.utils import label_map_util\n'), ((5585, 5600), 'click.command', 'click.command', ([], {}), '()\n',...
# -*- mode: python; coding: utf-8 -*- # Copyright 2020 the .NET Foundation # Licensed under the MIT License. from __future__ import absolute_import, division, print_function import numpy.testing as nt import pytest from xml.etree import ElementTree as etree from . import assert_xml_trees_equal from .. import imagese...
[ "io.BytesIO", "io.StringIO", "numpy.testing.assert_almost_equal", "xml.etree.ElementTree.fromstring" ]
[((1182, 1212), 'xml.etree.ElementTree.fromstring', 'etree.fromstring', (['expected_str'], {}), '(expected_str)\n', (1198, 1212), True, 'from xml.etree import ElementTree as etree\n'), ((2726, 2756), 'xml.etree.ElementTree.fromstring', 'etree.fromstring', (['expected_str'], {}), '(expected_str)\n', (2742, 2756), True, ...
# This file contains helper functions that are related to mnist sequence classification, such as loading data import numpy as np import tensorflow as tf supported_data_sets = ["SequentialMNIST", "P-MNIST"] def binary_mask(numbers, mask_size=10): """ This function binary masks the passed list of numbers....
[ "numpy.random.seed", "numpy.zeros", "numpy.random.RandomState", "tensorflow.keras.datasets.mnist.load_data", "tensorflow.compat.v1.set_random_seed", "numpy.reshape" ]
[((1952, 1986), 'tensorflow.compat.v1.set_random_seed', 'tf.compat.v1.set_random_seed', (['seed'], {}), '(seed)\n', (1980, 1986), True, 'import tensorflow as tf\n'), ((1991, 2011), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (2005, 2011), True, 'import numpy as np\n'), ((2022, 2049), 'numpy.rando...
# -*- coding: utf-8 -*- import time import PyDAQmx from PyDAQmx import Task import numpy as np #value = 1.3 # #task = Task() #task.CreateAOVoltageChan("/Dev1/ao0","",-10.0,10.0,PyDAQmx.DAQmx_Val_Volts,None) #task.StartTask() #task.WriteAnalogScalarF64(1,10.0,value,None) #time.sleep(5) #task.StopTask() # # class...
[ "numpy.zeros", "PyDAQmx.Task", "time.sleep" ]
[((1299, 1314), 'time.sleep', 'time.sleep', (['(0.5)'], {}), '(0.5)\n', (1309, 1314), False, 'import time\n'), ((365, 392), 'numpy.zeros', 'np.zeros', (['(1)'], {'dtype': 'np.uint8'}), '(1, dtype=np.uint8)\n', (373, 392), True, 'import numpy as np\n'), ((407, 413), 'PyDAQmx.Task', 'Task', ([], {}), '()\n', (411, 413), ...
import numpy as np from pybullet_planning.utils import PI, MAX_DISTANCE from pybullet_planning.motion_planners import birrt from pybullet_planning.interfaces.robots.collision import get_collision_fn from pybullet_planning.interfaces.planner_interface.joint_motion_planning import get_distance_fn, get_extend_fn, get_s...
[ "pybullet_planning.interfaces.planner_interface.joint_motion_planning.check_initial_end", "pybullet_planning.interfaces.robots.collision.get_collision_fn", "numpy.ones", "pybullet_planning.interfaces.planner_interface.joint_motion_planning.get_sample_fn", "numpy.append", "pybullet_planning.interfaces.plan...
[((712, 771), 'pybullet_planning.interfaces.planner_interface.joint_motion_planning.get_distance_fn', 'get_distance_fn', (['body', 'joints[2:]'], {'weights': '[angular_weight]'}), '(body, joints[2:], weights=[angular_weight])\n', (727, 771), False, 'from pybullet_planning.interfaces.planner_interface.joint_motion_plann...
#!/usr/bin/env python """plotutil.py: module is dedicated to plottting.""" __author__ = "<NAME>." __copyright__ = "Copyright 2020, SuperDARN@VT" __credits__ = [] __license__ = "MIT" __version__ = "1.0." __maintainer__ = "<NAME>." __email__ = "<EMAIL>" __status__ = "Research" import matplotlib matplotlib.use("Agg") i...
[ "matplotlib.cm.get_cmap", "scipy.io.loadmat", "pandas.read_csv", "utils.get_sd_data", "matplotlib.pyplot.suptitle", "utils.smooth", "numpy.ones", "mpl_toolkits.axes_grid1.Size.Fixed", "mpl_toolkits.axisartist.floating_axes.GridHelperCurveLinear", "matplotlib.pyplot.figure", "numpy.mean", "nump...
[((297, 318), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (311, 318), False, 'import matplotlib\n'), ((4609, 4653), 'matplotlib.pyplot.colorbar', 'plt.colorbar', (['mappable'], {'cax': 'cbax', 'shrink': '(0.7)'}), '(mappable, cax=cbax, shrink=0.7)\n', (4621, 4653), True, 'import matplotlib.pyp...
import numpy as np from synthrl.common.utils.terminalutils import mktable class IOSet: def __init__(self, ioset): self.ioset = list(ioset) self.n_example = len(self.ioset) def __len__(self): return self.n_example def get_rand(self, n): indices = (np.random.permutation(self.n_example).tolist()...
[ "numpy.random.permutation", "synthrl.common.utils.terminalutils.mktable" ]
[((592, 662), 'synthrl.common.utils.terminalutils.mktable', 'mktable', (['self.ioset'], {'header': "['Input', 'Output']", 'align': '""">"""', 'index': '(True)'}), "(self.ioset, header=['Input', 'Output'], align='>', index=True)\n", (599, 662), False, 'from synthrl.common.utils.terminalutils import mktable\n'), ((274, 3...
import numpy as np def norm(p2, p1): """ Compute normal vector based on two points Parameters ---------- p2,p1: ndarray(2D) Output ------ ndarray(2D) Example ------ TODO """ np.seterr(divide='ignore', invalid='ignore') norm = np.array([0, 0, 1]) v1 = p2 - p1 v1Length = np...
[ "numpy.roll", "numpy.seterr", "numpy.cross", "numpy.zeros", "numpy.append", "numpy.sin", "numpy.linalg.norm", "numpy.array", "numpy.cos", "numpy.array_equal" ]
[((216, 260), 'numpy.seterr', 'np.seterr', ([], {'divide': '"""ignore"""', 'invalid': '"""ignore"""'}), "(divide='ignore', invalid='ignore')\n", (225, 260), True, 'import numpy as np\n'), ((270, 289), 'numpy.array', 'np.array', (['[0, 0, 1]'], {}), '([0, 0, 1])\n', (278, 289), True, 'import numpy as np\n'), ((318, 344)...
#Functions utils to development fast def main(): #libs import streamlit as st st.sidebar.success('Selecione um item abaixo') st.markdown("<h1 style='color:#F00;'>Tutorial de desenvolvimento rápido com Streamlit Python (tags mais úteis)</h1>", unsafe_allow_html=True) st.markdown( """ ...
[ "pandas_datareader.DataReader", "streamlit.text_input", "streamlit.image", "streamlit.sidebar.success", "pandas.read_csv", "streamlit.title", "numpy.random.normal", "streamlit.components.v1.html", "numpy.random.randn", "streamlit.text_area", "matplotlib.pyplot.subplots", "streamlit.map", "st...
[((92, 138), 'streamlit.sidebar.success', 'st.sidebar.success', (['"""Selecione um item abaixo"""'], {}), "('Selecione um item abaixo')\n", (110, 138), True, 'import streamlit as st\n'), ((144, 295), 'streamlit.markdown', 'st.markdown', (['"""<h1 style=\'color:#F00;\'>Tutorial de desenvolvimento rápido com Streamlit Py...
import torch import torch.nn as nn import numpy as np import random import sys sys.path.append('./backbones/asrf') from libs.postprocess import PostProcessor def refiner_train(cfg, dataset, train_loader, model, backbones, backbone_names, optimizer, epoch, split_dict, device): normal_ce = nn.CrossEntropyLoss() ...
[ "sys.path.append", "torch.ones", "torch.argmax", "torch.nn.CrossEntropyLoss", "random.choice", "libs.postprocess.PostProcessor", "numpy.random.randint", "torch.Tensor" ]
[((79, 114), 'sys.path.append', 'sys.path.append', (['"""./backbones/asrf"""'], {}), "('./backbones/asrf')\n", (94, 114), False, 'import sys\n'), ((294, 315), 'torch.nn.CrossEntropyLoss', 'nn.CrossEntropyLoss', ([], {}), '()\n', (313, 315), True, 'import torch.nn as nn\n'), ((744, 773), 'random.choice', 'random.choice'...
import dace import numpy as np N = dace.symbol('N') @dace.program def dace_softmax(X_in: dace.float32[N], X_out: dace.float32[N]): tmp_max = dace.reduce(lambda a, b: a + b, X_in, identity=0) X_out[:] = exp(X_in - tmp_max) tmp_sum = dace.reduce(lambda a, b: max(a, b), X_in) X_out[:] /= tmp_sum @dace...
[ "numpy.array", "dace.reduce", "dace.symbol" ]
[((36, 52), 'dace.symbol', 'dace.symbol', (['"""N"""'], {}), "('N')\n", (47, 52), False, 'import dace\n'), ((148, 197), 'dace.reduce', 'dace.reduce', (['(lambda a, b: a + b)', 'X_in'], {'identity': '(0)'}), '(lambda a, b: a + b, X_in, identity=0)\n', (159, 197), False, 'import dace\n'), ((461, 495), 'numpy.array', 'np....
import os, time, glob, argparse import numpy as np import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data from tnn import main from tnn.reciprocalgaternn import tnn_ReciprocalGateCell from tnn.convrnn import tnn_ConvBasicCell '''This is an example of passing a custom cell to your model, i...
[ "tnn.main.unroll", "tnn.main.init_nodes", "argparse.ArgumentParser", "tensorflow.train.Saver", "tensorflow.losses.sparse_softmax_cross_entropy", "tensorflow.global_variables_initializer", "tensorflow.reshape", "tensorflow.Session", "tensorflow.variable_scope", "tensorflow.get_default_graph", "te...
[((449, 474), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (472, 474), False, 'import os, time, glob, argparse\n'), ((3450, 3501), 'tensorflow.examples.tutorials.mnist.input_data.read_data_sets', 'input_data.read_data_sets', (['DATA_PATH'], {'one_hot': '(False)'}), '(DATA_PATH, one_hot=False)...
import tensorflow as tf import numpy as np from tensorflow.contrib.slim.nets.inception import inception_v3 import tensorflow.contrib.eager as tfe session = tf.InteractiveSession() batch_size = 32 def get_inception_score(images, batch_size, splits=10): """ the function is to calculate the inception score of t...
[ "tensorflow.nn.softmax", "numpy.sum", "tensorflow.contrib.eager.enable_egaer_execution", "numpy.log", "numpy.std", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.contrib.eager.Iterator", "tensorflow.Variable", "numpy.mean", "numpy.exp", "tensorflow.InteractiveSession" ]
[((157, 180), 'tensorflow.InteractiveSession', 'tf.InteractiveSession', ([], {}), '()\n', (178, 180), True, 'import tensorflow as tf\n'), ((730, 758), 'tensorflow.contrib.eager.enable_egaer_execution', 'tfe.enable_egaer_execution', ([], {}), '()\n', (756, 758), True, 'import tensorflow.contrib.eager as tfe\n'), ((776, ...
from argparse import ArgumentParser import zmq from sklearn.externals import joblib from feature_generation import feature_generation import numpy as np parser = ArgumentParser() parser.add_argument('model') parser.add_argument('-p', '--port', type=int, default=5000) context = zmq.Context() socket = context.socket(zm...
[ "argparse.ArgumentParser", "feature_generation.feature_generation", "numpy.array", "sklearn.externals.joblib.load", "zmq.Context" ]
[((163, 179), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (177, 179), False, 'from argparse import ArgumentParser\n'), ((280, 293), 'zmq.Context', 'zmq.Context', ([], {}), '()\n', (291, 293), False, 'import zmq\n'), ((439, 462), 'sklearn.externals.joblib.load', 'joblib.load', (['args.model'], {}), '(...
import numpy as np import pandas as pd import matplotlib.pyplot as plt # my data set data_prefix = 'data/' data_list = ['2018_02_25.csv', '2018_02_26.csv', '2018_02_27.csv', '2018_03_03.csv', '2018_03_10.csv'] for ind, data in enumerate(data_list): dataset = pd.read_csv(data_prefix+data) for i in ...
[ "pandas.read_csv", "numpy.argsort", "numpy.log10", "matplotlib.pyplot.subplots", "numpy.delete", "numpy.sqrt" ]
[((277, 308), 'pandas.read_csv', 'pd.read_csv', (['(data_prefix + data)'], {}), '(data_prefix + data)\n', (288, 308), True, 'import pandas as pd\n'), ((533, 546), 'numpy.argsort', 'np.argsort', (['f'], {}), '(f)\n', (543, 546), True, 'import numpy as np\n'), ((729, 748), 'numpy.delete', 'np.delete', (['zj', 'inds'], {}...
import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import scipy.stats as ss from scipy.stats import norm, skew from scipy.special import boxcox1p from sklearn.preprocessing import LabelEncoder from sklearn.preprocessing import StandardScaler from utils import plot_miss_val...
[ "pandas.DataFrame", "sklearn.preprocessing.StandardScaler", "utils.plot_miss_val", "pandas.read_csv", "pandas.get_dummies", "utils.norm_target", "utils.qq_plot", "sklearn.preprocessing.LabelEncoder", "scipy.special.boxcox1p", "utils.scatter_plot", "pandas.concat", "numpy.log1p" ]
[((455, 478), 'pandas.read_csv', 'pd.read_csv', (['train_path'], {}), '(train_path)\n', (466, 478), True, 'import pandas as pd\n'), ((500, 522), 'pandas.read_csv', 'pd.read_csv', (['test_path'], {}), '(test_path)\n', (511, 522), True, 'import pandas as pd\n'), ((1888, 1916), 'numpy.log1p', 'np.log1p', (['self.train[tar...
# -*- coding: utf-8 -*- import numpy import matplotlib.pyplot as plt from pandas import read_csv import pandas as pd import math from keras.models import load_model from keras.models import Sequential from keras.layers import Dense from keras.layers import LSTM from sklearn.preprocessing import MinMaxScaler, ...
[ "pandas.read_csv", "keras.layers.LSTM", "sklearn.preprocessing.MinMaxScaler", "keras.layers.Dense", "numpy.array", "numpy.reshape", "keras.models.Sequential", "sklearn.metrics.mean_squared_error" ]
[((1185, 1203), 'numpy.array', 'numpy.array', (['dataX'], {}), '(dataX)\n', (1196, 1203), False, 'import numpy\n'), ((1586, 1726), 'pandas.read_csv', 'read_csv', (['DATASET'], {'usecols': "['Type', 'Type_property', 'Type_violent', 'Loc_public', 'Loc_private',\n 'Arrest', 'Domestic']", 'engine': '"""python"""'}), "(D...
import pickle import numpy as np import os import time import cv2 from glob import glob from PIL import ImageFile, Image from plyfile import PlyData from skimage.io import imread, imsave from concurrent.futures import ProcessPoolExecutor from config import cfg class ModelAligner(object): rotation_transform = n...
[ "pickle.dump", "numpy.random.seed", "numpy.sum", "concurrent.futures.ProcessPoolExecutor", "pickle.load", "numpy.arange", "numpy.random.randint", "numpy.mean", "os.path.join", "numpy.logical_not", "os.path.exists", "numpy.max", "numpy.loadtxt", "numpy.reshape", "plyfile.PlyData.read", ...
[((319, 382), 'numpy.array', 'np.array', (['[[1.0, 0.0, 0.0], [0.0, -1.0, 0.0], [0.0, 0.0, -1.0]]'], {}), '([[1.0, 0.0, 0.0], [0.0, -1.0, 0.0], [0.0, 0.0, -1.0]])\n', (327, 382), True, 'import numpy as np\n'), ((4220, 4283), 'numpy.array', 'np.array', (['[[1.0, 0.0, 0.0], [0.0, -1.0, 0.0], [0.0, 0.0, -1.0]]'], {}), '([...
"""DIV2K dataset """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import argparse from PIL import Image import numpy as np import tensorflow as tf import datasets REMOTE_URL = 'http://data.vision.ee.ethz.ch/cvl/DIV2K/' TRAIN_LR_ARCHIVE_NAME ...
[ "tensorflow.cond", "os.mkdir", "argparse.ArgumentParser", "tensorflow.estimator.export.ServingInputReceiver", "datasets.input_fn_tplt", "numpy.around", "os.path.join", "tensorflow.placeholder", "numpy.swapaxes", "numpy.stack", "datasets.update_argparser", "tensorflow.Graph", "tensorflow.read...
[((859, 892), 'datasets.update_argparser', 'datasets.update_argparser', (['parser'], {}), '(parser)\n', (884, 892), False, 'import datasets\n'), ((1817, 1873), 'tensorflow.data.Dataset.from_tensor_slices', 'tf.data.Dataset.from_tensor_slices', (['(lr_files, hr_files)'], {}), '((lr_files, hr_files))\n', (1851, 1873), Tr...
""" %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% This file is part of the collaboration with Universitat Oberta de Catalunya (UOC) on Multi-Source Team Orienteering Problem (MSTOP). The objective of the project is to develop an efficient algorithm to solve this extensi...
[ "matplotlib.pyplot.title", "edge.Edge", "matplotlib.pyplot.show", "math.sqrt", "numpy.zeros", "node.__copy__", "matplotlib.pyplot.figure", "networkx.draw", "networkx.DiGraph", "itertools.chain", "os.listdir", "collections.deque" ]
[((820, 850), 'os.listdir', 'os.listdir', (['"""../tests/single/"""'], {}), "('../tests/single/')\n", (830, 850), False, 'import os\n'), ((911, 940), 'os.listdir', 'os.listdir', (['"""../tests/multi/"""'], {}), "('../tests/multi/')\n", (921, 940), False, 'import os\n'), ((1284, 1346), 'math.sqrt', 'math.sqrt', (['((ino...
import numpy as np import time def cal_inverse(A): return np.linalg.inv(A) if __name__ == "__main__": N = 5000 # size A = np.random.rand(N, N) time_start = time.time() A_inv = cal_inverse(A) time_end = time.time() elapsed_time = time_end - time_start print('{:.5f} sec'.format(elaps...
[ "numpy.random.rand", "numpy.linalg.inv", "time.time" ]
[((63, 79), 'numpy.linalg.inv', 'np.linalg.inv', (['A'], {}), '(A)\n', (76, 79), True, 'import numpy as np\n'), ((137, 157), 'numpy.random.rand', 'np.random.rand', (['N', 'N'], {}), '(N, N)\n', (151, 157), True, 'import numpy as np\n'), ((175, 186), 'time.time', 'time.time', ([], {}), '()\n', (184, 186), False, 'import...
""" Deep Learning - Assignment #2: - Snake Game - Deep Reinforcement Learning Integrated Master of Computer Science and Engineering NOVA School of Science and Technology, NOVA University of Lisbon - 2020/2021 Authors: - <NAME> (<EMAIL>) - <NAME> (<EMAIL>) Instructor(s): - <NAME> (<EMAIL>) - <NAME> (<EMAIL>) Snake...
[ "numpy.array", "numpy.max", "tensorflow.keras.optimizers.Adam" ]
[((2493, 2526), 'tensorflow.keras.optimizers.Adam', 'Adam', ([], {'learning_rate': 'learning_rate'}), '(learning_rate=learning_rate)\n', (2497, 2526), False, 'from tensorflow.keras.optimizers import Adam\n'), ((4020, 4039), 'numpy.array', 'array', (['observations'], {}), '(observations)\n', (4025, 4039), False, 'from n...
#!/usr/bin/env python3 import fire import json import os import numpy as np import tensorflow as tf import model import sample import encoder raw_text = """Kommentar: My son does not know his way around the house. He really needs his face transforming. Kommentar: Got it , we have to transform human faces with trans...
[ "encoder.get_encoder", "json.load", "numpy.random.seed", "fire.Fire", "tensorflow.train.Saver", "tensorflow.set_random_seed", "os.path.expandvars", "model.default_hparams", "tensorflow.placeholder", "sample.sample_sequence", "tensorflow.Graph", "os.path.join" ]
[((5963, 6006), 'encoder.get_encoder', 'encoder.get_encoder', (['model_name', 'models_dir'], {}), '(model_name, models_dir)\n', (5982, 6006), False, 'import encoder\n'), ((6021, 6044), 'model.default_hparams', 'model.default_hparams', ([], {}), '()\n', (6042, 6044), False, 'import model\n'), ((7478, 7503), 'fire.Fire',...
import numpy as np import scipy as sp from scipy.optimize import curve_fit from scipy.stats import chi2 import pickle, sys from glob import glob import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns import healpy as hp import scipy.stats as st from francis.time_integrated_script...
[ "numpy.load", "numpy.sum", "numpy.maximum", "scipy.stats.poisson.cdf", "numpy.argmax", "numpy.abs", "healpy.graticule", "healpy.nside2pixarea", "francis.time_integrated_scripts.steady_sensitivity_fits.plot_color_bar", "pickle.load", "healpy.ang2pix", "numpy.exp", "glob.glob", "numpy.interp...
[((379, 407), 'francis.utils.initialize_mpl_style', 'utils.initialize_mpl_style', ([], {}), '()\n', (405, 407), False, 'from francis import utils\n'), ((417, 441), 'francis.utils.get_francis_path', 'utils.get_francis_path', ([], {}), '()\n', (439, 441), False, 'from francis import utils\n'), ((673, 740), 'glob.glob', '...
import os import sys import subprocess import ROOT as rt import numpy as np ptmin=0 ptmax=0 for pt in [100,200,500,1000]: ls=subprocess.check_output("ls *mixed*{}p*.npz".format(pt),shell=True) ls=ls.split("\n")[:-1] for l in ls: if("unscale" in l):continue a=np.load(l[:]) #print(l,f.Get("jetAnalyser")...
[ "numpy.load" ]
[((273, 286), 'numpy.load', 'np.load', (['l[:]'], {}), '(l[:])\n', (280, 286), True, 'import numpy as np\n')]
import abc import re import tempfile import traceback from typing import Tuple, Callable, Union, List, Optional import kerassurgeon import numpy as np import tensorflow as tf from keras import backend as K from keras import models, layers class BasePruning: _FUZZ_EPSILON = 1e-5 def __init__(self, ...
[ "keras.models.load_model", "tempfile.NamedTemporaryFile", "keras.backend.clear_session", "numpy.ceil", "tensorflow.reset_default_graph", "numpy.asarray", "re.match", "kerassurgeon.Surgeon", "traceback.format_exc", "numpy.random.shuffle" ]
[((5320, 5358), 'kerassurgeon.Surgeon', 'kerassurgeon.Surgeon', (['model'], {'copy': '(True)'}), '(model, copy=True)\n', (5340, 5358), False, 'import kerassurgeon\n'), ((7564, 7581), 'keras.backend.clear_session', 'K.clear_session', ([], {}), '()\n', (7579, 7581), True, 'from keras import backend as K\n'), ((7590, 7614...
#!/usr/bin/env python # # Copyright 2019 DFKI GmbH. # # 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, merg...
[ "PySignal.Signal", "copy.deepcopy", "vis_utils.animation.animation_controller.AnimationController.__init__", "vis_utils.animation.skeleton_visualization.SkeletonVisualization", "vis_utils.animation.animation_controller.AnimationController.resetAnimationTime", "anim_utils.animation_data.MotionVector", "a...
[((1666, 1674), 'PySignal.Signal', 'Signal', ([], {}), '()\n', (1672, 1674), False, 'from PySignal import Signal\n'), ((1706, 1714), 'PySignal.Signal', 'Signal', ([], {}), '()\n', (1712, 1714), False, 'from PySignal import Signal\n'), ((1792, 1834), 'vis_utils.scene.components.ComponentBase.__init__', 'ComponentBase.__...
""" Script that evaluates the events.csv and the admissions.csv files: Basically performs the data cleaning steps proposed by: https://github.com/YerevaNN/mimic3-benchmarks """ import os import pandas as pd import numpy as np from shutil import copyfile MIMIC_DIR = '/nfs/research1/birney/projects/ehr/mimic/mimic_ra...
[ "os.mkdir", "pandas.Interval", "os.path.dirname", "os.path.exists", "numpy.isnan", "pandas.to_datetime", "os.path.join" ]
[((735, 774), 'os.path.join', 'os.path.join', (['MIMIC_DIR', '"""PATIENTS.csv"""'], {}), "(MIMIC_DIR, 'PATIENTS.csv')\n", (747, 774), False, 'import os\n'), ((1020, 1057), 'os.path.join', 'os.path.join', (['OUT_DIR', '"""PATIENTS.csv"""'], {}), "(OUT_DIR, 'PATIENTS.csv')\n", (1032, 1057), False, 'import os\n'), ((1242,...
import copy import glob import os import time import pdb from collections import deque import gym import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from a2c_ppo_acktr import algo from a2c_ppo_acktr.arguments import get_args from a2c_ppo_acktr.envs import...
[ "os.remove", "a2c_ppo_acktr.arguments.get_args", "mymodels.CollectSamples", "visdom.Visdom", "a2c_ppo_acktr.algo.A2C_ACKTR", "torch.set_num_threads", "numpy.mean", "torch.device", "torch.no_grad", "os.path.join", "numpy.sqrt", "collections.deque", "torch.FloatTensor", "numpy.max", "copy....
[((624, 634), 'a2c_ppo_acktr.arguments.get_args', 'get_args', ([], {}), '()\n', (632, 634), False, 'from a2c_ppo_acktr.arguments import get_args\n'), ((903, 931), 'torch.manual_seed', 'torch.manual_seed', (['args.seed'], {}), '(args.seed)\n', (920, 931), False, 'import torch\n'), ((932, 969), 'torch.cuda.manual_seed_al...
__author__ = '<NAME>' # RESULTS LOG : October 16th, 2015 # Accuracy : TODO # Confusion Matrix : TODO from time import time ############################################### # load from csv training and testing sets from numpy import genfromtxt features_test = genfromtxt('d:/CODE/ml-crops/preproc/dataset/features_trai...
[ "pybrain.tools.shortcuts.buildNetwork", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "numpy.ravel", "pybrain.supervised.trainers.BackpropTrainer", "numpy.genfromtxt", "pybrain.utilities.percentError", "pybrain.datasets.ClassificationDataSet", "sklearn.metrics.confusion_matrix" ]
[((262, 347), 'numpy.genfromtxt', 'genfromtxt', (['"""d:/CODE/ml-crops/preproc/dataset/features_train.csv"""'], {'delimiter': '""","""'}), "('d:/CODE/ml-crops/preproc/dataset/features_train.csv', delimiter=','\n )\n", (272, 347), False, 'from numpy import genfromtxt\n'), ((358, 437), 'numpy.genfromtxt', 'genfromtxt'...
#!/usr/bin/env python # coding: utf-8 import pandas as pd import numpy as np import os import shutil import openpyxl import rpy2.robjects as ro from rpy2.robjects import r from rpy2.robjects.packages import importr ro.r['options'](warn=-1) r('as.POSIXct("2015-01-01 00:00:01")+0 ') base = importr('base') cars = importr...
[ "pandas.DataFrame", "os.mkdir", "os.remove", "rpy2.robjects.packages.importr", "openpyxl.Workbook", "pandas.read_csv", "pandas.ExcelWriter", "rpy2.robjects.pandas2ri.activate", "rpy2.robjects.r", "os.path.exists", "rpy2.robjects.r.assign", "numpy.array", "shutil.rmtree", "pandas.concat", ...
[((241, 282), 'rpy2.robjects.r', 'r', (['"""as.POSIXct("2015-01-01 00:00:01")+0 """'], {}), '(\'as.POSIXct("2015-01-01 00:00:01")+0 \')\n', (242, 282), False, 'from rpy2.robjects import r\n'), ((290, 305), 'rpy2.robjects.packages.importr', 'importr', (['"""base"""'], {}), "('base')\n", (297, 305), False, 'from rpy2.rob...
import gym import sys import agent import Q_network import experience_replay import torch import numpy as np import logging from torch.utils.tensorboard import SummaryWriter def run_episode(env, agent, rpm): total_reward = 0 obs = env.reset() step = 0 while True: step += 1 action = agen...
[ "gym.make", "agent.learn", "agent.save", "logging.warning", "agent.sample", "experience_replay.ReplayMemory", "agent.predict", "agent.DQN_agent", "numpy.mean", "torch.utils.tensorboard.SummaryWriter", "torch.no_grad" ]
[((1473, 1493), 'numpy.mean', 'np.mean', (['eval_reward'], {}), '(eval_reward)\n', (1480, 1493), True, 'import numpy as np\n'), ((1553, 1603), 'experience_replay.ReplayMemory', 'experience_replay.ReplayMemory', (["opt['MEMORY_SIZE']"], {}), "(opt['MEMORY_SIZE'])\n", (1583, 1603), False, 'import experience_replay\n'), (...
from __future__ import absolute_import import numpy as npo from scipy.signal import convolve as sp_convolve from builtins import range import autograd.numpy as np import autograd.numpy.random as npr import autograd.scipy.misc import autograd.scipy.signal import autograd.scipy.stats as stats import autograd.scipy.stats...
[ "autograd.numpy.dot", "builtins.range", "autograd.scipy.stats.dirichlet.rvs", "numpy.tensordot", "autograd.numpy.random.randn", "autograd.grad", "numpy_utils.check_grads", "numpy_utils.combo_check", "numpy_utils.unary_ufunc_check", "autograd.numpy.random.random", "autograd.numpy.eye", "scipy.s...
[((496, 507), 'autograd.numpy.random.seed', 'npr.seed', (['(1)'], {}), '(1)\n', (504, 507), True, 'import autograd.numpy.random as npr\n'), ((2001, 2035), 'autograd.scipy.stats.dirichlet.rvs', 'stats.dirichlet.rvs', (['alpha'], {'size': '(1)'}), '(alpha, size=1)\n', (2020, 2035), True, 'import autograd.scipy.stats as s...
import torch import random import numpy as np def normalize_center(x: torch.tensor): # cast origin from top left to middle of image torch.add(x, -0.5, out=x) for i, _ in enumerate(x): x[i, 1] = - x[i, 1] return x def denormalize_center(x: torch.tensor): # cast origin from top left to ...
[ "random.randint", "torch.zeros_like", "numpy.deg2rad", "torch.add", "torch.mm", "torch.rand", "torch.zeros" ]
[((144, 169), 'torch.add', 'torch.add', (['x', '(-0.5)'], {'out': 'x'}), '(x, -0.5, out=x)\n', (153, 169), False, 'import torch\n'), ((400, 424), 'torch.add', 'torch.add', (['x', '(0.5)'], {'out': 'x'}), '(x, 0.5, out=x)\n', (409, 424), False, 'import torch\n'), ((526, 546), 'random.randint', 'random.randint', (['(0)',...
import argparse import json import logging import math import os from os.path import exists, join, split import threading import shutil from fnmatch import filter from PIL import Image import torch from torch import nn import torch.backends.cudnn as cudnn import torch.optim as optim from torchvision import datasets, t...
[ "threading.Thread", "fnmatch.filter", "os.makedirs", "torch.where", "math.fabs", "distutils.version.LooseVersion", "numpy.empty", "os.path.exists", "torch.save", "torch.nn.functional.nll_loss", "torch.nn.functional.log_softmax", "PIL.Image.fromarray", "numpy.diag", "os.path.split", "os.p...
[((560, 612), 'torch.where', 'torch.where', (['(image > upper_bound)', 'upper_bound', 'image'], {}), '(image > upper_bound, upper_bound, image)\n', (571, 612), False, 'import torch\n'), ((625, 677), 'torch.where', 'torch.where', (['(image < lower_bound)', 'lower_bound', 'image'], {}), '(image < lower_bound, lower_bound...
import gym import time import torch import warnings import numpy as np from copy import deepcopy from numbers import Number from typing import Dict, List, Union, Optional, Callable from advertorch.attacks.base import Attack from tianshou.policy import BasePolicy from tianshou.env import BaseVectorEnv, DummyVectorEnv fr...
[ "numpy.sum", "numpy.mean", "numpy.arange", "torch.no_grad", "tianshou.data.ListReplayBuffer", "numpy.std", "torch.FloatTensor", "tianshou.data.Batch", "copy.deepcopy", "time.sleep", "torch.cuda.is_available", "tianshou.data.to_numpy", "tianshou.env.DummyVectorEnv", "random.uniform", "num...
[((2921, 2944), 'numpy.arange', 'np.arange', (['self.env_num'], {}), '(self.env_num)\n', (2930, 2944), True, 'import numpy as np\n'), ((4114, 4199), 'tianshou.data.Batch', 'Batch', ([], {'state': '{}', 'obs': '{}', 'act': '{}', 'rew': '{}', 'done': '{}', 'info': '{}', 'obs_next': '{}', 'policy': '{}'}), '(state={}, obs...
import os import numpy as np import pybullet as p import pybullet_data from panda import Panda from objects import YCBObject, InteractiveObj, RBOObject class DoubleEnv(): def __init__(self): # create simulation (GUI) self.urdfRootPath = pybullet_data.getDataPath() p.connect(p.GUI) ...
[ "os.path.join", "objects.RBOObject", "objects.YCBObject", "pybullet.setGravity", "pybullet.stepSimulation", "pybullet.computeViewMatrixFromYawPitchRoll", "pybullet.resetDebugVisualizerCamera", "panda.Panda", "pybullet.disconnect", "pybullet.resetBasePositionAndOrientation", "numpy.array", "pyb...
[((260, 287), 'pybullet_data.getDataPath', 'pybullet_data.getDataPath', ([], {}), '()\n', (285, 287), False, 'import pybullet_data\n'), ((296, 312), 'pybullet.connect', 'p.connect', (['p.GUI'], {}), '(p.GUI)\n', (305, 312), True, 'import pybullet as p\n'), ((321, 346), 'pybullet.setGravity', 'p.setGravity', (['(0)', '(...
import unittest import EXOSIMS.util.get_dirs as gd import os from unittest.mock import * import numpy as np import sys class TestGetDirs(unittest.TestCase): """ Tests the get_dir tool. <NAME>, Cornell, July 2021 """ def test_get_home_dir(self): """ Tests that get_home_dir works...
[ "EXOSIMS.util.get_dirs.get_home_dir", "numpy.testing.assert_array_equal", "EXOSIMS.util.get_dirs.get_paths", "os.path.relpath" ]
[((4556, 4609), 'numpy.testing.assert_array_equal', 'np.testing.assert_array_equal', (['assertErrors', 'exp_asrt'], {}), '(assertErrors, exp_asrt)\n', (4585, 4609), True, 'import numpy as np\n'), ((5257, 5271), 'EXOSIMS.util.get_dirs.get_paths', 'gd.get_paths', ([], {}), '()\n', (5269, 5271), True, 'import EXOSIMS.util...
from __future__ import division from __future__ import print_function import tensorflow as tf from pathlib import Path import numpy as np import scipy.sparse as sp import os import sys project_path = Path(__file__).resolve().parents[2] # Settings flags = tf.compat.v1.flags FLAGS = flags.FLAGS flags.DEFI...
[ "pathlib.Path", "numpy.dtype", "numpy.array", "numpy.ones" ]
[((772, 811), 'numpy.array', 'np.array', (['ppi_ids[:, 1]'], {'dtype': 'np.int32'}), '(ppi_ids[:, 1], dtype=np.int32)\n', (780, 811), True, 'import numpy as np\n'), ((750, 763), 'numpy.dtype', 'np.dtype', (['str'], {}), '(str)\n', (758, 763), True, 'import numpy as np\n'), ((1128, 1151), 'numpy.ones', 'np.ones', (['edg...