code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import numpy as np #(activate this if CPU is used)
# import cupy as np #(activate this if GPU is used)
from mlxtend.data import loadlocal_mnist
import json
def Read_MNIST(par, Agent):
##################################################################################################################################... | [
"json.load",
"mlxtend.data.loadlocal_mnist",
"numpy.array",
"numpy.split"
] | [((734, 850), 'mlxtend.data.loadlocal_mnist', 'loadlocal_mnist', ([], {'images_path': '"""./Inputs/train-images-idx3-ubyte"""', 'labels_path': '"""./Inputs/train-labels-idx1-ubyte"""'}), "(images_path='./Inputs/train-images-idx3-ubyte', labels_path\n ='./Inputs/train-labels-idx1-ubyte')\n", (749, 850), False, 'from ... |
# -*- coding: utf-8 -*-
"""
Created on Thu May 13 13:43:45 2021
@author: Hatlab_3
"""
import numpy as np
import matplotlib.pyplot as plt
import sympy as sp
from data_processing.models.SNAIL_supporting_modules.Participation_and_Alpha_Fitter import slider_fit
from data_processing.fitting.QFit import fit, plotRes
from s... | [
"data_processing.ddh5_Plotting.TACO_multiplot_b1.superTACO_Bars",
"data_processing.models.SNAIL_supporting_modules.Participation_and_Alpha_Fitter.slider_fit",
"sympy.series",
"numpy.absolute",
"numpy.abs",
"numpy.argmax",
"pandas.read_csv",
"sympy.cos",
"numpy.argmin",
"matplotlib.pyplot.figure",
... | [((1405, 1449), 'sympy.symbols', 'sp.symbols', (['"""alpha,E_j,phi_s,phi_e, phi_min"""'], {}), "('alpha,E_j,phi_s,phi_e, phi_min')\n", (1415, 1449), True, 'import sympy as sp\n'), ((2372, 2416), 'sympy.symbols', 'sp.symbols', (['"""alpha,E_j,phi_s,phi_e, phi_min"""'], {}), "('alpha,E_j,phi_s,phi_e, phi_min')\n", (2382,... |
from operator import attrgetter, itemgetter
import numpy
import talib
from pymongo import MongoClient
import line_messageer
from strategy.bull_market import BullMarket
from strategy.force_sell import ForceSell
from strategy.foreign_investor_total import GoldKDJ
from strategy.main_force import MainForce
from strategy.s... | [
"pymongo.MongoClient",
"strategy.value_concentrated.ValueConcentrated",
"strategy.foreign_investor_total.GoldKDJ",
"numpy.array",
"operator.itemgetter",
"strategy.force_sell.ForceSell",
"strategy.bull_market.BullMarket"
] | [((454, 485), 'pymongo.MongoClient', 'MongoClient', (['"""localhost"""', '(27017)'], {}), "('localhost', 27017)\n", (465, 485), False, 'from pymongo import MongoClient\n'), ((1315, 1333), 'numpy.array', 'numpy.array', (['value'], {}), '(value)\n', (1326, 1333), False, 'import numpy\n'), ((1610, 1628), 'numpy.array', 'n... |
from collections import OrderedDict
# compatibility
from six.moves import range
# nose tools
from nose.tools import assert_raises
from nose.plugins.attrib import attr
# modules
import loopy as lp
import numpy as np
# local imports
from pyjac.core import array_creator as arc
from pyjac.tests import TestClass
from py... | [
"pyjac.core.rate_subs.assign_rates",
"six.moves.range",
"pyjac.tests.test_utils.OptionLoopWrapper.from_dict",
"pyjac.core.array_creator.MapStore",
"pyjac.tests.get_test_langs",
"pyjac.utils.listify",
"numpy.arange",
"numpy.array",
"nose.tools.assert_raises",
"pyjac.core.array_creator.creator",
"... | [((651, 667), 'pyjac.tests.get_test_langs', 'get_test_langs', ([], {}), '()\n', (665, 667), False, 'from pyjac.tests import get_test_langs\n'), ((721, 886), 'collections.OrderedDict', 'OrderedDict', (["[('width', width), ('depth', depth), ('order', order), ('lang', lang), (\n 'order', order), ('is_simd', is_simd), (... |
# Implement and train a neural network from scratch in Python for the MNIST dataset (no PyTorch).
# The neural network should be trained on the Training Set using stochastic gradient descent.
import numpy as np
import h5py
#data file type h5py
import time
import copy
from random import randint
# cd Desktop/CS\ 398/... | [
"matplotlib.pyplot.title",
"h5py.File",
"matplotlib.pyplot.show",
"numpy.log",
"numpy.tanh",
"numpy.random.randn",
"numpy.float32",
"numpy.floor",
"copy.copy",
"numpy.array",
"matplotlib.pyplot.xticks",
"numpy.exp",
"numpy.matmul",
"numpy.squeeze",
"matplotlib.pyplot.ylabel",
"matplotl... | [((366, 398), 'h5py.File', 'h5py.File', (['"""MNISTdata.hdf5"""', '"""r"""'], {}), "('MNISTdata.hdf5', 'r')\n", (375, 398), False, 'import h5py\n'), ((409, 445), 'numpy.float32', 'np.float32', (["MNIST_data['x_train'][:]"], {}), "(MNIST_data['x_train'][:])\n", (419, 445), True, 'import numpy as np\n'), ((512, 547), 'nu... |
# -*- coding: utf-8 -*-
"""
@author: alexyang
@contact: <EMAIL>
@file: inference.py
@time: 2018/4/22 14:32
@desc:
"""
import os
import random
from argparse import ArgumentParser
import numpy as np
import pickle
import pandas as pd
from models import EntDect, RelNet, SubTransE, SubTypeVec
os.environ['CUDA_VISIB... | [
"models.EntDect",
"models.SubTypeVec",
"argparse.ArgumentParser",
"pandas.read_csv",
"numpy.zeros",
"models.RelNet",
"models.SubTransE"
] | [((968, 1140), 'pandas.read_csv', 'pd.read_csv', (['data_path'], {'header': 'None', 'index_col': 'None', 'sep': '"""\t"""', 'names': "['line_id', 'subject', 'entity_name', 'entity_type', 'relation', 'object',\n 'tokens', 'labels']"}), "(data_path, header=None, index_col=None, sep='\\t', names=[\n 'line_id', 'subj... |
import unittest
import pandas as pd
import numpy as np
from model_scripts.surge_inference import SurgePriceClassifier
class TestSurgePriceClassifier(unittest.TestCase):
'''
Tests for checking the surge price classifier model inference
script
params, returns: None
'''
def test_get_rush_hour(sel... | [
"pandas.DataFrame",
"model_scripts.surge_inference.SurgePriceClassifier",
"numpy.unique"
] | [((466, 708), 'pandas.DataFrame', 'pd.DataFrame', (["{'temp': [40.67], 'clouds': [0.94], 'pressure': [1013.76], 'rain': [0.0],\n 'humidity': [0.92], 'wind': [2.92], 'rush_hr': [0], 'location_latitude':\n [42.3559219], 'location_longitude': [-71.0549768], 'surge_mult': [0]}"], {}), "({'temp': [40.67], 'clouds': [0... |
import numpy as np
from holoviews.element import HeatMap, Points, Image
try:
from bokeh.models import FactorRange, HoverTool
except:
pass
from .testplot import TestBokehPlot, bokeh_renderer
class TestHeatMapPlot(TestBokehPlot):
def test_heatmap_hover_ensure_kdims_sanitized(self):
hm = HeatMap(... | [
"holoviews.element.Image",
"holoviews.element.HeatMap",
"holoviews.element.Points",
"numpy.array",
"bokeh.models.HoverTool"
] | [((312, 397), 'holoviews.element.HeatMap', 'HeatMap', (['[(1, 1, 1), (2, 2, 0)]'], {'kdims': "['x with space', 'y with $pecial symbol']"}), "([(1, 1, 1), (2, 2, 0)], kdims=['x with space', 'y with $pecial symbol']\n )\n", (319, 397), False, 'from holoviews.element import HeatMap, Points, Image\n'), ((770, 798), 'bok... |
import os
import pandas as pd
import uproot3 as uproot
from tqdm import tqdm
import numpy as np
import json
def generate_files(basedir, period, samples, TreeName="selection", format="pickle", mode="normal"):
"""
Combine jobs by dataset event process and save files
Args:
basedir (str): Path to ana... | [
"json.dump",
"json.load",
"os.makedirs",
"os.path.exists",
"os.path.isfile",
"numpy.sqrt",
"os.path.join",
"pandas.concat",
"uproot3.open"
] | [((893, 926), 'os.path.join', 'os.path.join', (['basedir', '"""datasets"""'], {}), "(basedir, 'datasets')\n", (905, 926), False, 'import os\n'), ((945, 976), 'os.path.join', 'os.path.join', (['comb_path', 'period'], {}), '(comb_path, period)\n', (957, 976), False, 'import os\n'), ((989, 1014), 'os.path.exists', 'os.pat... |
"""
.. module:: PMRF
:synopsis: This module is responsible for image segmentation using pmrf algorithm
.. moduleauthor:: <NAME>
"""
__copyright__ = "CAMERA Materials Segmentation & Metrics (MSM) Copyright (c) 2017, The Regents of the University of California, through Lawrence Berkeley Nat... | [
"os.path.abspath",
"numpy.fromfile",
"numpy.zeros",
"numpy.where",
"scipy.misc.imsave"
] | [((2358, 2400), 'numpy.zeros', 'np.zeros', (['self.image.shape'], {'dtype': 'np.uint8'}), '(self.image.shape, dtype=np.uint8)\n', (2366, 2400), True, 'import numpy as np\n'), ((3011, 3037), 'scipy.misc.imsave', 'misc.imsave', (['name', 'avg_out'], {}), '(name, avg_out)\n', (3022, 3037), False, 'from scipy import misc\n... |
""" Present an interactive function explorer with slider widgets.
Scrub the sliders to change the properties of the ``sin`` curve, or
type into the title text box to update the title of the plot.
Use the ``bokeh serve`` command to run the example by executing:
bokeh serve abcd_sliders.py
at your command prompt. The... | [
"bokeh.models.widgets.TextInput",
"bokeh.plotting.figure",
"os.system",
"irt_parameter_estimation.util.logistic4PLabcd",
"bokeh.io.curdoc",
"numpy.arange",
"bokeh.layouts.column",
"bokeh.models.widgets.Slider",
"bokeh.layouts.row"
] | [((923, 945), 'numpy.arange', 'np.arange', (['(0)', '(3001)', '(50)'], {}), '(0, 3001, 50)\n', (932, 945), True, 'import numpy as np\n'), ((950, 1012), 'irt_parameter_estimation.util.logistic4PLabcd', 'logistic4PLabcd', (['a_default', 'b_default', 'c_default', 'd_default', 'x'], {}), '(a_default, b_default, c_default, ... |
"""Class that collects experience batches."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import math
from rl_2048.game import play
# Parameters for undersampling
DO_UNDERSAMPLING = True
AVG_KEEP_PROB = 0.04
MIN_KEEP_PROB = 0.01
c... | [
"numpy.random.rand",
"rl_2048.game.play.play"
] | [((1966, 2017), 'rl_2048.game.play.play', 'play.play', (['strategy'], {'allow_unavailable_action': '(False)'}), '(strategy, allow_unavailable_action=False)\n', (1975, 2017), False, 'from rl_2048.game import play\n'), ((2255, 2271), 'numpy.random.rand', 'np.random.rand', ([], {}), '()\n', (2269, 2271), True, 'import num... |
"""
Classes for point set registration using variants of Iterated-Closest Point
Author: <NAME>
"""
from abc import ABCMeta, abstractmethod
import logging
import numpy as np
from .feature_matcher import PointToPlaneFeatureMatcher
from .points import PointCloud, NormalCloud
from .rigid_transformations import RigidTransf... | [
"numpy.sum",
"logging.warning",
"numpy.zeros",
"numpy.nonzero",
"logging.info",
"numpy.mean",
"numpy.linalg.norm",
"numpy.array",
"numpy.where",
"numpy.random.choice",
"numpy.tile",
"numpy.eye"
] | [((6100, 6143), 'numpy.linalg.norm', 'np.linalg.norm', (['orig_target_normals'], {'axis': '(1)'}), '(orig_target_normals, axis=1)\n', (6114, 6143), True, 'import numpy as np\n'), ((6165, 6189), 'numpy.nonzero', 'np.nonzero', (['normal_norms'], {}), '(normal_norms)\n', (6175, 6189), True, 'import numpy as np\n'), ((6348... |
import numpy as np
import sympy as sp
import pylbm
import sys
"""
Von Karman vortex street simulated by Navier-Stokes solver D2Q9
Reynolds number = 2500
"""
def printProgress (iteration, total, prefix = '', suffix = '', decimals = 1, barLength = 100):
"""
Call in a loop to create terminal progress bar
@... | [
"sys.stdout.write",
"sympy.symbols",
"pylbm.Simulation",
"pylbm.Circle",
"numpy.abs",
"pylbm.H5File",
"sys.stdout.flush"
] | [((1201, 1223), 'sympy.symbols', 'sp.symbols', (['"""X, Y, LA"""'], {}), "('X, Y, LA')\n", (1211, 1223), True, 'import sympy as sp\n'), ((1238, 1263), 'sympy.symbols', 'sp.symbols', (['"""rho, qx, qy"""'], {}), "('rho, qx, qy')\n", (1248, 1263), True, 'import sympy as sp\n'), ((3411, 3433), 'pylbm.Simulation', 'pylbm.S... |
#### MK 4 Networks ####
'''
Exploration of convex Networks on a simple example
It includes the ICNN techniques (Amos et al)
'''
### This is a script for the training of the
### Third NN approach
'''
Improvements:
1) accepts u as a N-vector
2) Generalized Loss function
3) Adapted network layout
4) RESNet Used as N... | [
"csv.reader",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.callbacks.ModelCheckpoint",
"matplotlib.pyplot.style.use",
"tensorflow.Variable",
"numpy.arange",
"tensorflow.keras.activations.softplus",
"tensorflow.keras.callbacks.EarlyStopping",
"tensorflow.keras.Input",
"legacyCode.nnUtils.load... | [((898, 921), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""kitish"""'], {}), "('kitish')\n", (911, 921), True, 'import matplotlib.pyplot as plt\n'), ((1346, 1393), 'tensorflow.keras.models.load_model', 'tf.keras.models.load_model', (["(filename + '/model')"], {}), "(filename + '/model')\n", (1372, 1393), True,... |
# Install lungmask from https://github.com/amrane99/lungmask using pip install git+https://github.com/amrane99/lungmask
from lungmask import mask
import SimpleITK as sitk
import os
import numpy as np
from mp.utils.load_restore import pkl_dump
from mp.paths import storage_data_path
import mp.data.datasets.dataset_utils ... | [
"lungmask.mask.apply",
"os.makedirs",
"SimpleITK.ImageFileReader",
"mp.utils.load_restore.pkl_dump",
"SimpleITK.ReadImage",
"os.path.isdir",
"mp.data.datasets.dataset_utils.get_original_data_path",
"numpy.nonzero",
"SimpleITK.GetImageFromArray",
"os.path.join",
"os.listdir"
] | [((449, 475), 'SimpleITK.ReadImage', 'sitk.ReadImage', (['input_path'], {}), '(input_path)\n', (463, 475), True, 'import SimpleITK as sitk\n'), ((492, 541), 'lungmask.mask.apply', 'mask.apply', ([], {'image': 'input_image', 'gpu': 'gpu', 'cuda': 'cuda'}), '(image=input_image, gpu=gpu, cuda=cuda)\n', (502, 541), False, ... |
import numpy as np
import cv2
import glob
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from globalvars import *
class LineDetect:
"""
Detect lines using sliding window protocol
"""
def __init__(self):
self.left_fitx = []
self.right_fitx = []
self.ploty = []
... | [
"numpy.dstack",
"numpy.absolute",
"numpy.sum",
"numpy.argmax",
"numpy.polyfit",
"numpy.max",
"numpy.mean",
"numpy.array",
"numpy.int",
"numpy.linspace",
"cv2.rectangle",
"numpy.concatenate"
] | [((526, 588), 'numpy.sum', 'np.sum', (['binary_warped[binary_warped.shape[0] // 2:, :]'], {'axis': '(0)'}), '(binary_warped[binary_warped.shape[0] // 2:, :], axis=0)\n', (532, 588), True, 'import numpy as np\n'), ((673, 729), 'numpy.dstack', 'np.dstack', (['(binary_warped, binary_warped, binary_warped)'], {}), '((binar... |
# This file is part of DEAP.
#
# DEAP is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# DEAP is distributed ... | [
"playsound.playsound",
"scipy.spatial.distance.cosine",
"deap.base.Toolbox",
"random.randint",
"evolvetools.mutation",
"numpy.zeros",
"scipy.io.wavfile.write",
"scipy.io.wavfile.read",
"deap.tools.Statistics",
"deap.creator.create",
"random.seed",
"deap.algorithms.eaMuPlusLambda",
"deap.tool... | [((3230, 3263), 'scipy.io.wavfile.read', 'sio.wavfile.read', (['seed_audio_name'], {}), '(seed_audio_name)\n', (3246, 3263), True, 'import scipy.io as sio\n'), ((3322, 3357), 'scipy.io.wavfile.read', 'sio.wavfile.read', (['target_audio_name'], {}), '(target_audio_name)\n', (3338, 3357), True, 'import scipy.io as sio\n'... |
# Written by: <NAME>, @dataoutsider
# Viz: "On the Move", enjoy!
import numpy as np
from mpl_toolkits import mplot3d
import numpy as np
import matplotlib.pyplot as plt
from math import cos, sin, pi
plt.rcParams["figure.figsize"] = 12.8, 9.6
def tube(x, y):
return (x**2+y**2)
N = 10
n = 1000
x = np.linspace(-N,N,... | [
"numpy.meshgrid",
"csv.writer",
"os.path.dirname",
"numpy.reshape",
"numpy.linspace"
] | [((303, 324), 'numpy.linspace', 'np.linspace', (['(-N)', 'N', 'n'], {}), '(-N, N, n)\n', (314, 324), True, 'import numpy as np\n'), ((344, 361), 'numpy.meshgrid', 'np.meshgrid', (['x', 'y'], {}), '(x, y)\n', (355, 361), True, 'import numpy as np\n'), ((397, 418), 'numpy.reshape', 'np.reshape', (['Xgrid', '(-1)'], {}), ... |
import tensorflow as tf
gpus = tf.config.experimental.list_physical_devices('GPU')
if gpus:
try:
tf.config.experimental.set_memory_growth(gpus[0], True)
print(gpus)
except RuntimeError as e:
# 프로그램 시작시에 메모리 증가가 설정되어야만 합니다
print(e)
from source.modals import modals_cov as modals
fr... | [
"source.modals.modals_cov",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.MaxPooling2D",
"numpy.eye",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.Input",
"tensorflow.config.experimental.set_memory_growth",
"tensorflow.keras.Model",
"tensorflow.keras.optimizers.Adam",
"source.ut... | [((31, 82), 'tensorflow.config.experimental.list_physical_devices', 'tf.config.experimental.list_physical_devices', (['"""GPU"""'], {}), "('GPU')\n", (75, 82), True, 'import tensorflow as tf\n'), ((436, 467), 'tensorflow.keras.Input', 'tf.keras.Input', ([], {'shape': 'input_dim'}), '(shape=input_dim)\n', (450, 467), Tr... |
import numpy as np
import numpy.testing as npt
import os.path as op
import nibabel as nib
import nibabel.tmpdirs as nbtmp
import dipy.data.fetcher as fetcher
import AFQ.bundles as bdl
hardi_dir = op.join(fetcher.dipy_home, "stanford_hardi")
hardi_fdata = op.join(hardi_dir, "HARDI150.nii.gz")
def test_bundles_class... | [
"nibabel.load",
"numpy.testing.assert_array_equal",
"numpy.zeros",
"numpy.testing.assert_equal",
"numpy.eye",
"nibabel.tmpdirs.InTemporaryDirectory",
"os.path.join",
"AFQ.bundles.Bundles"
] | [((199, 243), 'os.path.join', 'op.join', (['fetcher.dipy_home', '"""stanford_hardi"""'], {}), "(fetcher.dipy_home, 'stanford_hardi')\n", (206, 243), True, 'import os.path as op\n'), ((258, 295), 'os.path.join', 'op.join', (['hardi_dir', '"""HARDI150.nii.gz"""'], {}), "(hardi_dir, 'HARDI150.nii.gz')\n", (265, 295), True... |
# import sys
# sys.path.extend(['/home/ubuntu/workspace/scrabble-gan'])
import os
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
os.environ['KMP_DUPLICATE_LIB_OK'] = 'True'
def main():
latent_dim = 128
char_vec = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
path_to_... | [
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"tensorflow.random.normal",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.axis",
"numpy.array",
"tensorflow.saved_model.load"
] | [((571, 611), 'tensorflow.saved_model.load', 'tf.saved_model.load', (['path_to_saved_model'], {}), '(path_to_saved_model)\n', (590, 611), True, 'import tensorflow as tf\n'), ((737, 779), 'tensorflow.random.normal', 'tf.random.normal', (['[batch_size, latent_dim]'], {}), '([batch_size, latent_dim])\n', (753, 779), True,... |
"""Specify the jobs to run via config file.
Product assortment exeperiment (Figure 7.2).
"""
import collections
import functools
import numpy as np
from base.config_lib import Config
from base.experiment import ExperimentNoAction
from assortment.agent_assortment import TSAssortment, GreedyAssortment, EpsilonGreedyAss... | [
"collections.OrderedDict",
"functools.partial",
"base.config_lib.Config",
"numpy.array"
] | [((639, 660), 'numpy.array', 'np.array', (['([1 / 6] * 6)'], {}), '([1 / 6] * 6)\n', (647, 660), True, 'import numpy as np\n'), ((1778, 1831), 'collections.OrderedDict', 'collections.OrderedDict', (['[(name, ExperimentNoAction)]'], {}), '([(name, ExperimentNoAction)])\n', (1801, 1831), False, 'import collections\n'), (... |
import logging
import time
from pathlib import Path
from collections import deque, defaultdict
import h5py
import zarr
import torch
import tracemalloc
import numpy as np
from tqdm import tqdm
from torch.utils.data import Dataset, DataLoader, IterableDataset
class DataReader:
def read(self, group_key, subj_keys,... | [
"numpy.pad",
"tracemalloc.start",
"tqdm.tqdm",
"numpy.minimum",
"numpy.maximum",
"numpy.ceil",
"time.perf_counter",
"zarr.group",
"numpy.insert",
"numpy.array",
"numpy.arange",
"tracemalloc.get_traced_memory",
"logging.getLogger"
] | [((3587, 3607), 'numpy.array', 'np.array', (['patch_size'], {}), '(patch_size)\n', (3595, 3607), True, 'import numpy as np\n'), ((3623, 3646), 'numpy.array', 'np.array', (['img.shape[1:]'], {}), '(img.shape[1:])\n', (3631, 3646), True, 'import numpy as np\n'), ((3667, 3690), 'numpy.array', 'np.array', (['patch_overlap'... |
import numpy as np
import pickle
import matplotlib.pyplot as plt
import random
from encoder import get_encoder_layer
from decoder import decoding_layer,process_decoder_input
import tensorflow as tf
import os
device_name = "/gpu:0"
#def corrupt_noise(traj, rate_noise, factor):
# new_traj={}
# for count, key in enu... | [
"decoder.decoding_layer",
"tensorflow.clip_by_value",
"tensorflow.identity",
"decoder.process_decoder_input",
"tensorflow.ConfigProto",
"tensorflow.reduce_max",
"tensorflow.GPUOptions",
"encoder.get_encoder_layer",
"tensorflow.placeholder",
"tensorflow.name_scope",
"tensorflow.train.Saver",
"t... | [((1300, 1362), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', '[None, None, 20]'], {'name': '"""embed_seq"""'}), "(tf.float32, [None, None, 20], name='embed_seq')\n", (1314, 1362), True, 'import tensorflow as tf\n'), ((1376, 1429), 'tensorflow.placeholder', 'tf.placeholder', (['tf.int32', '[None, None]'],... |
from sklearn.preprocessing import StandardScaler, MinMaxScaler
from sklearn.svm import SVC
from sklearn.neural_network import MLPClassifier
from sklearn.decomposition import PCA
from sklearn.feature_selection import SelectKBest, f_classif, chi2, f_regression
import numpy as np
import matplotlib.pyplot as plt
interval... | [
"numpy.load",
"matplotlib.pyplot.show",
"sklearn.preprocessing.StandardScaler",
"matplotlib.pyplot.ylim",
"sklearn.svm.SVC",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.text",
"matplotlib.pyplot.figure",
"sklearn.decomposition.PCA",
"numpy.arange",
"sklearn.neural_n... | [((366, 385), 'sklearn.decomposition.PCA', 'PCA', ([], {'n_components': '(9)'}), '(n_components=9)\n', (369, 385), False, 'from sklearn.decomposition import PCA\n'), ((533, 572), 'sklearn.feature_selection.SelectKBest', 'SelectKBest', ([], {'score_func': 'f_classif', 'k': '(10)'}), '(score_func=f_classif, k=10)\n', (54... |
import numpy as np
import matplotlib.pyplot as plt
# UKF Parameters
ukf_lambda = 10.0 # UKFのλパラメータ
ukf_kappa = 0.1 # UKFのκパラメータ
ukf_alpha2 = (2.0 + ukf_lambda) / (2.0 + ukf_kappa) # UKFのα^2パラメータ
ukf_w0_m = ukf_lambda / (2.0 + ukf_lambda) # UKFの重みパラメータ
ukf_w0_c = ukf_w0_m + (1.0 - ukf_alpha2 + 2.0) # UKFの重みパラメー... | [
"numpy.zeros_like",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"numpy.empty",
"matplotlib.pyplot.legend",
"numpy.zeros",
"numpy.identity",
"numpy.sin",
"numpy.array",
"numpy.linalg.inv",
"numpy.random.normal",
"numpy.cos",
"numpy.dot",
"numpy.sqrt",
"numpy.arctan",
"numpy.lina... | [((388, 404), 'numpy.zeros', 'np.zeros', (['[5, 1]'], {}), '([5, 1])\n', (396, 404), True, 'import numpy as np\n'), ((432, 448), 'numpy.zeros', 'np.zeros', (['[5, 1]'], {}), '([5, 1])\n', (440, 448), True, 'import numpy as np\n'), ((479, 504), 'numpy.sqrt', 'np.sqrt', (['(3.0 + ukf_lambda)'], {}), '(3.0 + ukf_lambda)\n... |
from kivy.config import Config
Config.set('graphics', 'width', '640')
Config.set('graphics', 'height', '640')
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.floatlayout import FloatLayout
from kivy.clock import Clock
from kivy.graphics import Color, Rectangle
import particle_system_ext
imp... | [
"random.randint",
"particle_system_ext.PyMasterParticleSystem",
"kivy.config.Config.set",
"kivy.graphics.Rectangle",
"particle_system_ext.PySlaveParticleSystem",
"random.random",
"numpy.array"
] | [((31, 69), 'kivy.config.Config.set', 'Config.set', (['"""graphics"""', '"""width"""', '"""640"""'], {}), "('graphics', 'width', '640')\n", (41, 69), False, 'from kivy.config import Config\n'), ((70, 109), 'kivy.config.Config.set', 'Config.set', (['"""graphics"""', '"""height"""', '"""640"""'], {}), "('graphics', 'heig... |
# import tensorflow as tf
# import numpy as np
# class Augumentation():
# def __init__(self,size = 512):
# self.seed = 42
# self.size = size
# self.transform_functions = [self.crop,
# self.rotate]
# def transform(self,xx,yy):
# """ choose a ra... | [
"numpy.random.seed",
"skimage.util.random_noise",
"numpy.flipud",
"numpy.fliplr",
"numpy.max",
"numpy.random.randint",
"skimage.transform.resize",
"numpy.random.choice",
"numpy.random.rand"
] | [((1367, 1392), 'numpy.random.seed', 'np.random.seed', (['self.seed'], {}), '(self.seed)\n', (1381, 1392), True, 'import numpy as np\n'), ((1941, 1983), 'numpy.random.choice', 'np.random.choice', (['self.transform_functions'], {}), '(self.transform_functions)\n', (1957, 1983), True, 'import numpy as np\n'), ((2554, 262... |
#!/usr/bin/env python
"""
tools for expression and count based tasks
"""
import os,sys,csv,gc,re
import numpy as np
def read_RSEM_counts_files(geneFilePath,isoformFilePath):
"""
read the RSEM counts files into a matrix
"""
if not os.path.exists(geneFilePath):
raise Exception("Cannot find ge... | [
"gc.disable",
"csv.reader",
"csv.writer",
"numpy.zeros",
"os.path.exists",
"numpy.array",
"re.search",
"gc.enable",
"re.sub"
] | [((545, 577), 'csv.reader', 'csv.reader', (['fid1'], {'delimiter': '"""\t"""'}), "(fid1, delimiter='\\t')\n", (555, 577), False, 'import os, sys, csv, gc, re\n'), ((641, 653), 'gc.disable', 'gc.disable', ([], {}), '()\n', (651, 653), False, 'import os, sys, csv, gc, re\n'), ((1148, 1180), 'csv.reader', 'csv.reader', ([... |
import numpy as np
import pandas as pd
import pytest
from abagen import datasets
KEYS = [
'microarray', 'annotation', 'pacall', 'probes', 'ontology'
]
def test_fetch_datasets(testdir):
# check downloading for a subset of donors
files = datasets.fetch_microarray(data_dir=str(testdir),
... | [
"abagen.datasets.fetch_microarray",
"abagen.datasets._fetch_alleninf_coords",
"abagen.datasets.fetch_mri",
"pytest.raises",
"numpy.all"
] | [((743, 776), 'abagen.datasets._fetch_alleninf_coords', 'datasets._fetch_alleninf_coords', ([], {}), '()\n', (774, 776), False, 'from abagen import datasets\n'), ((874, 927), 'numpy.all', 'np.all', (["(coords.columns == ['mni_x', 'mni_y', 'mni_z'])"], {}), "(coords.columns == ['mni_x', 'mni_y', 'mni_z'])\n", (880, 927)... |
import torch
import torch.nn as nn
import numpy as np
from math import ceil
class ConvPoint(nn.Module):
"""ConvPoint convolution layer.
Provide the convolution layer as defined in ConvPoint paper
(https://github.com/aboulch/ConvPoint).
To be used with a `lightconvpoint.nn.Conv` instance.
# Argum... | [
"torch.nn.ReLU",
"math.ceil",
"torch.nn.Sequential",
"torch.nn.Conv2d",
"numpy.zeros",
"torch.nn.Linear",
"numpy.random.rand",
"torch.matmul",
"torch.from_numpy"
] | [((2639, 2677), 'numpy.zeros', 'np.zeros', (['(self.dim, self.kernel_size)'], {}), '((self.dim, self.kernel_size))\n', (2647, 2677), True, 'import numpy as np\n'), ((3306, 3329), 'torch.nn.Sequential', 'nn.Sequential', (['*modules'], {}), '(*modules)\n', (3319, 3329), True, 'import torch.nn as nn\n'), ((2532, 2597), 't... |
import os
import sys
from config import cfg
import argparse
import torch
from torch.backends import cudnn
import torchvision.transforms as T
from PIL import Image
sys.path.append('.')
from utils.logger import setup_logger
from model import make_model
import numpy as np
import cv2
from utils.metrics import cosine_simil... | [
"numpy.load",
"argparse.ArgumentParser",
"utils.metrics.cosine_similarity",
"numpy.argsort",
"torchvision.transforms.Normalize",
"torch.no_grad",
"sys.path.append",
"cv2.cvtColor",
"torch.load",
"os.path.exists",
"config.cfg.merge_from_file",
"numpy.hstack",
"model.make_model",
"os.listdir... | [((163, 183), 'sys.path.append', 'sys.path.append', (['"""."""'], {}), "('.')\n", (178, 183), False, 'import sys\n'), ((702, 741), 'cv2.cvtColor', 'cv2.cvtColor', (['figure', 'cv2.COLOR_BGR2RGB'], {}), '(figure, cv2.COLOR_BGR2RGB)\n', (714, 741), False, 'import cv2\n'), ((1053, 1114), 'argparse.ArgumentParser', 'argpar... |
from __future__ import annotations
from threading import Lock
from typing import ClassVar
from hypothesis import given, settings, strategies as st
import hypothesis.extra.numpy as st_np
import numpy as np
from rasterio import windows
import dask.core
import dask.threaded
from dask.array.utils import assert_eq
from st... | [
"stackstac.raster_spec.RasterSpec",
"numpy.isnan",
"numpy.random.default_rng",
"hypothesis.settings",
"rasterio.windows.window_index",
"numpy.full",
"stackstac.testing.strategies.chunksizes",
"dask.array.utils.assert_eq",
"numpy.empty_like",
"numpy.equal",
"threading.Lock",
"stackstac.to_dask.... | [((2385, 2428), 'hypothesis.settings', 'settings', ([], {'max_examples': '(500)', 'print_blob': '(True)'}), '(max_examples=500, print_blob=True)\n', (2393, 2428), False, 'from hypothesis import given, settings, strategies as st\n'), ((1789, 1830), 'numpy.empty_like', 'np.empty_like', (['bounds_arr', 'ASSET_TABLE_DT'], ... |
import cv2
# import keyboard
import numpy as np
import open3d as o3d
import pygame
import os
import os.path as osp
import json
import time
from transforms3d.axangles import axangle2mat
import config
from capture import OpenCVCapture
from hand_mesh import HandMesh
from kinematics import mpii_to_mano
from utils import O... | [
"json.dump",
"numpy.flip",
"os.makedirs",
"wrappers.ModelPipeline",
"utils.imresize",
"kinematics.mpii_to_mano",
"time.time",
"numpy.mean",
"os.path.join"
] | [((1291, 1306), 'wrappers.ModelPipeline', 'ModelPipeline', ([], {}), '()\n', (1304, 1306), False, 'from wrappers import ModelPipeline\n'), ((3050, 3092), 'os.makedirs', 'os.makedirs', (['output_dirpath'], {'exist_ok': '(True)'}), '(output_dirpath, exist_ok=True)\n', (3061, 3092), False, 'import os\n'), ((1869, 1902), '... |
# -*- coding: utf-8 -*-
# @Time : 2018-04-06 16:29
# @Author : Dingzh.tobest
# 文件描述 : AROON指标测试
import talib
import numpy as np
def init(context):
# 在context中保存全局变量
context.s1 = "000300.XSHG"
# before_trading此函数会在每天策略交易开始前被调用,当天只会被调用一次
def before_trading(context):
pass
# 你选择的证券的数据更新将会触发此段逻辑,例如日或... | [
"numpy.array"
] | [((511, 526), 'numpy.array', 'np.array', (['highs'], {}), '(highs)\n', (519, 526), True, 'import numpy as np\n'), ((528, 542), 'numpy.array', 'np.array', (['lows'], {}), '(lows)\n', (536, 542), True, 'import numpy as np\n')] |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: wensong
import os
import sys
sys.path.append(os.getcwd() + "/../../")
from utils.tf_utils import TFUtils
import tensorflow as tf
from utils.tf_vocab_processor import TFVocabProcessor
import numpy as np
import logging
class PreProcessor(object):
'''nlp分类器初始... | [
"utils.tf_utils.TFUtils.cut_and_padding_2D",
"numpy.random.seed",
"os.getcwd",
"utils.tf_vocab_processor.TFVocabProcessor",
"numpy.array",
"utils.tf_utils.TFUtils.load_multitype_text"
] | [((103, 114), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (112, 114), False, 'import os\n'), ((959, 1061), 'utils.tf_utils.TFUtils.load_multitype_text', 'TFUtils.load_multitype_text', (['flags.data_type', 'flags.data_file', 'flags.cls_num', 'flags.doc_separators'], {}), '(flags.data_type, flags.data_file, flags.cls_num... |
import unittest
import numpy as np
from dsbox.ml.neural_networks.processing import Text2Sequence
from nltk.stem.snowball import EnglishStemmer
import logging
logging.getLogger("tensorflow").setLevel(logging.WARNING)
np.random.seed(42)
class TestText2Sequence(unittest.TestCase):
def test_TestText2Sequence_fit_... | [
"unittest.main",
"numpy.random.seed",
"nltk.stem.snowball.EnglishStemmer",
"numpy.array",
"logging.getLogger"
] | [((220, 238), 'numpy.random.seed', 'np.random.seed', (['(42)'], {}), '(42)\n', (234, 238), True, 'import numpy as np\n'), ((955, 970), 'unittest.main', 'unittest.main', ([], {}), '()\n', (968, 970), False, 'import unittest\n'), ((161, 192), 'logging.getLogger', 'logging.getLogger', (['"""tensorflow"""'], {}), "('tensor... |
#
# Copyright 2019-2020 <NAME>
# 2019 <EMAIL>
#
# ### MIT license
#
# 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... | [
"scipy.linalg.null_space",
"numpy.roots",
"numpy.ndindex",
"numpy.isscalar",
"numpy.zeros",
"numpy.einsum",
"numpy.append",
"numpy.isclose",
"numpy.linalg.det",
"numpy.array",
"numpy.exp",
"numpy.real",
"numpy.eye",
"numpy.linalg.solve",
"numpy.sqrt"
] | [((1344, 1353), 'numpy.eye', 'np.eye', (['(3)'], {}), '(3)\n', (1350, 1353), True, 'import numpy as np\n'), ((2331, 2493), 'numpy.array', 'np.array', (['[[C11, C12, C12, 0, 0, 0], [C12, C11, C12, 0, 0, 0], [C12, C12, C11, 0, 0, \n 0], [0, 0, 0, C44, 0, 0], [0, 0, 0, 0, C44, 0], [0, 0, 0, 0, 0, C44]]'], {}), '([[C11,... |
# coding: utf-8
# ## Prediction BigMart dataset from AWS Notebook Cloud Instance
# In[60]:
# Import Libraries
import matplotlib.pyplot as plt
get_ipython().run_line_magic('matplotlib', 'inline')
import numpy as np
import pandas as pd
import seaborn as sns
from statsmodels.nonparametric.kde import KDEUnivariate
f... | [
"pandas.DataFrame",
"pylab.show",
"matplotlib.pyplot.show",
"sklearn.cross_validation.cross_val_score",
"numpy.abs",
"sklearn.preprocessing.StandardScaler",
"pandas.read_csv",
"pandas.get_dummies",
"sklearn.model_selection.train_test_split",
"sklearn.ensemble.GradientBoostingRegressor",
"sklearn... | [((983, 1007), 'pandas.read_csv', 'pd.read_csv', (['"""train.csv"""'], {}), "('train.csv')\n", (994, 1007), True, 'import pandas as pd\n'), ((1016, 1039), 'pandas.read_csv', 'pd.read_csv', (['"""test.csv"""'], {}), "('test.csv')\n", (1027, 1039), True, 'import pandas as pd\n'), ((1313, 1356), 'pandas.concat', 'pd.conca... |
# -*- coding: utf-8 -*-
# file: memnet.py
# author: songyouwei <<EMAIL>>
# Copyright (C) 2018. All Rights Reserved.
import numpy as np
from layers.attention import Attention
import torch
import torch.nn as nn
from torch.nn.parameter import Parameter
from layers.squeeze_embedding import SqueezeEmbedding
import torch.nn... | [
"torch.unique",
"torch.nn.ModuleList",
"layers.attention.Attention",
"layers.squeeze_embedding.SqueezeEmbedding",
"torch.randn",
"numpy.array",
"torch.nn.Linear",
"torch.zeros",
"torch.matmul",
"torch.sum",
"torch.tensor",
"torch.transpose"
] | [((1290, 1324), 'layers.squeeze_embedding.SqueezeEmbedding', 'SqueezeEmbedding', ([], {'batch_first': '(True)'}), '(batch_first=True)\n', (1306, 1324), False, 'from layers.squeeze_embedding import SqueezeEmbedding\n'), ((1350, 1396), 'layers.attention.Attention', 'Attention', (['opt.embed_dim'], {'score_function': '"""... |
# ******************************************************************************
# Copyright 2014-2018 Intel Corporation
#
# 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.apa... | [
"h5py.File",
"h5py.special_dtype",
"future.standard_library.install_aliases",
"os.path.exists",
"numpy.zeros",
"collections.defaultdict",
"neon.data.text_preprocessing.clean_string",
"numpy.random.rand",
"numpy.unique"
] | [((784, 818), 'future.standard_library.install_aliases', 'standard_library.install_aliases', ([], {}), '()\n', (816, 818), False, 'from future import standard_library\n'), ((2190, 2214), 'h5py.File', 'h5py.File', (['fname_h5', '"""w"""'], {}), "(fname_h5, 'w')\n", (2199, 2214), False, 'import h5py\n'), ((3054, 3078), '... |
#Metrics
import torch
import numpy as np
import pandas as pd
from torch.nn import functional as F
from src import data
def site_confusion(y_true, y_pred, site_lists):
"""What proportion of misidentified species come from the same site?
Args:
y_true: string values of true labels
y_pred: string ... | [
"pandas.DataFrame",
"torch.utils.data.DataLoader",
"src.data.TreeDataset",
"pandas.read_csv",
"numpy.argmax",
"torch.nn.functional.softmax",
"torch.no_grad",
"numpy.concatenate"
] | [((2451, 2525), 'src.data.TreeDataset', 'data.TreeDataset', (['csv_file'], {'image_size': "config['image_size']", 'config': 'config'}), "(csv_file, image_size=config['image_size'], config=config)\n", (2467, 2525), False, 'from src import data\n'), ((2549, 2654), 'torch.utils.data.DataLoader', 'torch.utils.data.DataLoad... |
from __future__ import print_function
# Copyright (c) 2013, <NAME>
# All rights reserved.
import unittest
import numpy as np
from numpy.testing import assert_array_almost_equal
import matplotlib.pyplot as plt
from undaqTools.misc.cdf import CDF, percentile
testdata = './data/normaltestdata' # space delimited ASCII ... | [
"unittest.TextTestRunner",
"matplotlib.pyplot.close",
"unittest.makeSuite",
"undaqTools.misc.cdf.percentile",
"numpy.array",
"numpy.testing.assert_array_almost_equal"
] | [((17117, 17142), 'unittest.TextTestRunner', 'unittest.TextTestRunner', ([], {}), '()\n', (17140, 17142), False, 'import unittest\n'), ((751, 3837), 'numpy.array', 'np.array', (['[-1050.231, -1043.33599147, -1036.44098295, -1029.54597442, -1022.6509659, \n -1015.75595737, -1008.86094885, -1001.96594033, -995.0709318... |
from __future__ import print_function
import os
import numpy as np
import cv2
from keras.utils import Sequence
from cocoaugmenter.datagen import CocoDataGen
class CocoSeq(Sequence):
def __init__(self,
batch_size,
batches_per_epoch,
data_dir,
... | [
"numpy.array",
"cocoaugmenter.datagen.CocoDataGen"
] | [((1358, 1485), 'cocoaugmenter.datagen.CocoDataGen', 'CocoDataGen', ([], {'dataDir': 'self.data_dir', 'classGrps': 'self.class_grps', 'grpProbs': 'self.grp_probs', 'cacheMaskImgs': 'self.cache_mask_imgs'}), '(dataDir=self.data_dir, classGrps=self.class_grps, grpProbs=self\n .grp_probs, cacheMaskImgs=self.cache_mask_... |
import numpy as np
from numpy import pi,sin,cos,arctan
import subprocess
#########################################
args={}
### Commonly changed for art
args['output_image']="out/out.jpg" #[out.png]
args['style_image']="styles/elephant.jpg" #Style target image [examples/inputs/seated-nude.jpg]
args['content_image']=... | [
"subprocess.run",
"numpy.sin",
"numpy.cos",
"numpy.linspace",
"numpy.arctan"
] | [((2661, 2685), 'numpy.linspace', 'np.linspace', (['(0.1)', '(0.9)', '(6)'], {}), '(0.1, 0.9, 6)\n', (2672, 2685), True, 'import numpy as np\n'), ((3681, 3752), 'subprocess.run', 'subprocess.run', (['"""notify-send finished another calibration!"""'], {'shell': '(True)'}), "('notify-send finished another calibration!', ... |
import numpy as np
import pickle
import multiprocessing as mp
import tqdm
from models.vaccination.create_model_vaccination import create_model_splines
from functions.tools import get_model_output
create_model = False
model_name = "vaccination_multi_test"
path_sbml = f"stored_models/{model_name}/" + model_name
model_d... | [
"functions.tools.get_model_output",
"pickle.dump",
"pickle.load",
"numpy.array",
"numpy.linspace",
"multiprocessing.Pool"
] | [((3459, 3486), 'numpy.linspace', 'np.linspace', (['(0)', 'max_T', '(6000)'], {}), '(0, max_T, 6000)\n', (3470, 3486), True, 'import numpy as np\n'), ((4824, 4962), 'functions.tools.get_model_output', 'get_model_output', (['model', 'solver', 'parameters', 'areas', 'par_to_optimize'], {'n_starts_pb': '(50)', 'n_starts_p... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from model.config import cfg
from model.train_val import filter_roidb, SolverWrapper
from utils.timer import Timer
try:
import cPickle as pickle
except ImportError:
import pickle
import numpy as np
import ... | [
"tensorflow.train.Saver",
"numpy.allclose",
"tensorflow.Session",
"tensorflow.variable_scope",
"time.time",
"tensorflow.set_random_seed",
"tensorflow.ConfigProto",
"tensorflow.assign",
"model.train_val.filter_roidb",
"tensorflow.Variable",
"tensorflow.train.MomentumOptimizer",
"tensorflow.summ... | [((5949, 5968), 'model.train_val.filter_roidb', 'filter_roidb', (['roidb'], {}), '(roidb)\n', (5961, 5968), False, 'from model.train_val import filter_roidb, SolverWrapper\n'), ((5982, 6004), 'model.train_val.filter_roidb', 'filter_roidb', (['valroidb'], {}), '(valroidb)\n', (5994, 6004), False, 'from model.train_val i... |
import numpy as np
class A2CRunner:
def __init__(self, agent, env, n_updates=10000, n_steps=16, train=True):
self.agent = agent
self.env = env
self.n_updates = n_updates
self.n_steps = n_steps
self.observation = self.env.reset()
self.reset()
def reset(self):
... | [
"numpy.zeros"
] | [((865, 899), 'numpy.zeros', 'np.zeros', (['shapes'], {'dtype': 'np.float32'}), '(shapes, dtype=np.float32)\n', (873, 899), True, 'import numpy as np\n'), ((917, 951), 'numpy.zeros', 'np.zeros', (['shapes'], {'dtype': 'np.float32'}), '(shapes, dtype=np.float32)\n', (925, 951), True, 'import numpy as np\n'), ((968, 1002... |
'''
convenience functions for raster of points
'''
import numpy
import math
def createRaster(shape, spacing, angle, indices=False, limit=None):
'''
raster across entire image
'''
co = spacing * numpy.cos(angle)
si = spacing * numpy.sin(angle)
E = numpy.array(((co,si),(-si,co)), numpy.float32)
Einv = numpy.linal... | [
"numpy.zeros",
"numpy.ones",
"math.sin",
"numpy.indices",
"numpy.sin",
"numpy.linalg.inv",
"numpy.array",
"math.cos",
"numpy.cos"
] | [((254, 303), 'numpy.array', 'numpy.array', (['((co, si), (-si, co))', 'numpy.float32'], {}), '(((co, si), (-si, co)), numpy.float32)\n', (265, 303), False, 'import numpy\n'), ((309, 328), 'numpy.linalg.inv', 'numpy.linalg.inv', (['E'], {}), '(E)\n', (325, 328), False, 'import numpy\n'), ((1171, 1206), 'numpy.indices',... |
# I know it's not much but it's honest work :')
import numpy as np
import cv2 # REMOVE THIS IMPORT
def rotation_vector_to_rotation_matrix(rotation_vector):
"""Transforms rotation vector (axis-angle) form to rotation matrix.
# Arguments
rotation_vector: Array (3). Rotation vector in axis-angle form.... | [
"numpy.argmin",
"cv2.Rodrigues",
"numpy.sin",
"numpy.array",
"numpy.linalg.norm",
"numpy.cos",
"numpy.linalg.inv",
"numpy.eye"
] | [((404, 413), 'numpy.eye', 'np.eye', (['(3)'], {}), '(3)\n', (410, 413), True, 'import numpy as np\n'), ((418, 465), 'cv2.Rodrigues', 'cv2.Rodrigues', (['rotation_vector', 'rotation_matrix'], {}), '(rotation_vector, rotation_matrix)\n', (431, 465), False, 'import cv2\n'), ((715, 728), 'numpy.cos', 'np.cos', (['angle'],... |
#!/usr/bin/env python
#
# See top-level LICENSE.rst file for Copyright information
#
# -*- coding: utf-8 -*-
"""
Generate S/N plots as a function of object type for the
current production
"""
import argparse
from desisim.spec_qa import __qa_version__
def parse(options=None):
parser = argparse.ArgumentParser(des... | [
"desisim.spec_qa.s2n.parse_s2n_values",
"desisim.spec_qa.s2n.obj_s2n_z",
"desisim.spec_qa.s2n.obj_s2n_wave",
"numpy.arange",
"numpy.array",
"numpy.linspace",
"desisim.spec_qa.s2n.load_all_s2n_values"
] | [((1656, 1692), 'desisim.spec_qa.s2n.load_all_s2n_values', 'load_all_s2n_values', (['nights', 'channel'], {}), '(nights, channel)\n', (1675, 1692), False, 'from desisim.spec_qa.s2n import load_all_s2n_values\n'), ((1810, 1841), 'numpy.arange', 'np.arange', (['(3570.0)', '(5700.0)', '(20.0)'], {}), '(3570.0, 5700.0, 20.... |
# !/usr/bin/env python
# encoding: utf-8
__author__ = '<NAME>'
from sklearn.naive_bayes import GaussianNB,BernoulliNB
import numpy as np
import pandas as pd
from sklearn import preprocessing
from sklearn import model_selection
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib import colors
from s... | [
"numpy.stack",
"matplotlib.pyplot.xlim",
"sklearn.naive_bayes.GaussianNB",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"sklearn.model_selection.train_test_split",
"matplotlib.pyplot.scatter",
"numpy.split",
"numpy.loadtxt",
"matplotl... | [((567, 644), 'numpy.loadtxt', 'np.loadtxt', (['filepath'], {'dtype': 'float', 'delimiter': '""","""', 'converters': '{(4): iris_type}'}), "(filepath, dtype=float, delimiter=',', converters={(4): iris_type})\n", (577, 644), True, 'import numpy as np\n'), ((820, 848), 'numpy.split', 'np.split', (['data', '(4,)'], {'axis... |
# -*- coding: utf-8 -*-
from __future__ import division, print_function
from keras import backend as K
from keras.engine.topology import Layer, InputSpec
from keras.layers.core import Dropout, Reshape
from keras.layers.convolutional import ZeroPadding2D
from keras.models import Sequential
import numpy as np
# test har... | [
"keras.backend.pool2d",
"keras.layers.core.Reshape",
"numpy.random.randn",
"keras.backend.sum",
"numpy.expand_dims",
"keras.backend.pow",
"keras.layers.core.Dropout",
"keras.layers.convolutional.ZeroPadding2D",
"keras.models.Sequential",
"keras.backend.square",
"keras.backend.repeat_elements"
] | [((2040, 2063), 'numpy.random.randn', 'np.random.randn', (['(10)', '(10)'], {}), '(10, 10)\n', (2055, 2063), True, 'import numpy as np\n'), ((2072, 2084), 'keras.layers.core.Dropout', 'Dropout', (['(0.5)'], {}), '(0.5)\n', (2079, 2084), False, 'from keras.layers.core import Dropout, Reshape\n'), ((2142, 2168), 'numpy.r... |
from skimage.io import imread
from image import convolution
import numpy as np
from matplotlib import pyplot as plt
def to_image(array):
a_min = np.min(array)
a_max = np.min(array)
return ((array - a_min)/float(a_max-a_min))*255
image = imread('./civetta.jpg', as_grey=True)
box_blur_kernel = np.ones((20,2... | [
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"numpy.ones",
"numpy.min",
"image.convolution",
"skimage.io.imread"
] | [((251, 288), 'skimage.io.imread', 'imread', (['"""./civetta.jpg"""'], {'as_grey': '(True)'}), "('./civetta.jpg', as_grey=True)\n", (257, 288), False, 'from skimage.io import imread\n'), ((307, 324), 'numpy.ones', 'np.ones', (['(20, 20)'], {}), '((20, 20))\n', (314, 324), True, 'import numpy as np\n'), ((333, 368), 'im... |
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
# data
df = pd.read_csv("test.csv")
print(df)
print()
# separate the output column
y_name = df.columns[-1]
y_df = df[y_name]
X_df = df.drop(y_name, axis=1)
# numpy arrays
X_ar = np.array(X_df, dtype=np.float32)
y_ar = np.array(y_df, dtype=np.f... | [
"torch.nn.MSELoss",
"torch.nn.ReLU",
"pandas.read_csv",
"torch.nn.Tanh",
"numpy.array",
"torch.nn.Linear",
"torch.from_numpy"
] | [((87, 110), 'pandas.read_csv', 'pd.read_csv', (['"""test.csv"""'], {}), "('test.csv')\n", (98, 110), True, 'import pandas as pd\n'), ((255, 287), 'numpy.array', 'np.array', (['X_df'], {'dtype': 'np.float32'}), '(X_df, dtype=np.float32)\n', (263, 287), True, 'import numpy as np\n'), ((295, 327), 'numpy.array', 'np.arra... |
import numpy as np
from .datahandler import DataHandler as DH
from tqdm import tqdm
class GeoUtils:
@staticmethod
def zerodata_augmentation(data, x_range=(-175, -64), y_range=(18, 71),
fineness=(20, 20), numdata_sqrt_oneclass=10):
labels = set([i for i in range(fineness[0... | [
"numpy.fill_diagonal",
"tqdm.tqdm",
"numpy.std",
"numpy.zeros",
"numpy.mean",
"numpy.arange",
"numpy.linspace"
] | [((540, 550), 'tqdm.tqdm', 'tqdm', (['data'], {}), '(data)\n', (544, 550), False, 'from tqdm import tqdm\n'), ((785, 797), 'tqdm.tqdm', 'tqdm', (['labels'], {}), '(labels)\n', (789, 797), False, 'from tqdm import tqdm\n'), ((1628, 1713), 'numpy.arange', 'np.arange', (['x_min', 'x_max', '((x_max - x_min) / (fineness[0] ... |
import numpy as np
class NN:
"""
Arguments:
data: data
labels: labels
layers: List (of lists) of net layer sizes and activation functions, e.g.
[[8,"relu"],
[5,"relu"],
[3,"relu"],
[2, "sigmoid"]]
Currently supported functions: "relu", "tanh", "... | [
"numpy.divide",
"numpy.sum",
"numpy.log",
"numpy.random.randn",
"numpy.zeros",
"numpy.array",
"numpy.exp",
"numpy.squeeze",
"numpy.dot",
"numpy.sqrt"
] | [((6157, 6171), 'numpy.array', 'np.array', (['data'], {}), '(data)\n', (6165, 6171), True, 'import numpy as np\n'), ((1503, 1526), 'numpy.array', 'np.array', (['dA'], {'copy': '(True)'}), '(dA, copy=True)\n', (1511, 1526), True, 'import numpy as np\n'), ((3288, 3304), 'numpy.squeeze', 'np.squeeze', (['cost'], {}), '(co... |
import sys
import gym
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import DQN.sparsemountaincar
from util.network import QNetworkBuilder
from util.replay_buffer import ReplayBuffer, PrioritizedReplayBuffer
from tensorflow.python.platform import flags
FLAGS = flags.FLAGS
flags.DEFINE_strin... | [
"tensorflow.python.platform.flags.DEFINE_string",
"numpy.random.seed",
"tensorflow.trainable_variables",
"numpy.argmax",
"numpy.mean",
"tensorflow.python.platform.flags.DEFINE_float",
"numpy.exp",
"util.replay_buffer.PrioritizedReplayBuffer",
"tensorflow.Summary",
"matplotlib.pyplot.close",
"ten... | [((302, 368), 'tensorflow.python.platform.flags.DEFINE_string', 'flags.DEFINE_string', (['"""env_name"""', '"""CartPole-v0"""', '"""Environment name"""'], {}), "('env_name', 'CartPole-v0', 'Environment name')\n", (321, 368), False, 'from tensorflow.python.platform import flags\n'), ((369, 454), 'tensorflow.python.platf... |
import cv2
import numpy as np
im = cv2.imread("./example.png", 1)
# ch = im[:, :, 0]
# n_bins = 256.
# hist = cv2.calcHist([ch], [0], None, [n_bins], [0, n_bins])
#
def equalize_func(img):
'''
same output as PIL.ImageOps.equalize
PIL's implementation is different from cv2.equalize
'''
... | [
"numpy.sum",
"numpy.fromfile",
"cv2.calcHist",
"numpy.empty_like",
"cv2.imread",
"numpy.cumsum",
"cv2.split",
"numpy.arange",
"cv2.merge"
] | [((37, 67), 'cv2.imread', 'cv2.imread', (['"""./example.png"""', '(1)'], {}), "('./example.png', 1)\n", (47, 67), False, 'import cv2\n'), ((2905, 2955), 'numpy.fromfile', 'np.fromfile', (['"""./build/res_cpp.bin"""'], {'dtype': 'np.uint8'}), "('./build/res_cpp.bin', dtype=np.uint8)\n", (2916, 2955), True, 'import numpy... |
from nbdt.graph import get_root, get_roots, get_wnids, synset_to_name, wnid_to_synset, get_leaves, get_path_to_node
from nbdt.utils import (
DEFAULT_CIFAR10_TREE, DEFAULT_CIFAR10_WNIDS, DEFAULT_CIFAR100_TREE,
DEFAULT_CIFAR100_WNIDS, DEFAULT_TINYIMAGENET200_TREE,
DEFAULT_TINYIMAGENET200_WNIDS, DEFAULT_IMAGEN... | [
"nbdt.loss.HardTreeSupLoss.inference",
"os.mkdir",
"wandb.log",
"nbdt.graph.wnid_to_synset",
"nbdt.loss.SoftTreeSupLoss.inference",
"generate_vis.build_tree",
"nbdt.graph.get_leaves",
"numpy.exp",
"nbdt.loss.HardTreeSupLoss.get_output_sub",
"pandas.DataFrame",
"saliency.Grad_CAM.gcam.GradCAM",
... | [((2351, 2372), 'nbdt.utils.set_np_printoptions', 'set_np_printoptions', ([], {}), '()\n', (2370, 2372), False, 'from nbdt.utils import DEFAULT_CIFAR10_TREE, DEFAULT_CIFAR10_WNIDS, DEFAULT_CIFAR100_TREE, DEFAULT_CIFAR100_WNIDS, DEFAULT_TINYIMAGENET200_TREE, DEFAULT_TINYIMAGENET200_WNIDS, DEFAULT_IMAGENET1000_TREE, DEFA... |
import numpy as np
import torch
import shutil
import matplotlib.pyplot as plt
import os
from PIL import Image
def resize_padding(im, desired_size, mode="RGB"):
# compute the new size
old_size = im.size
ratio = float(desired_size)/max(old_size)
new_size = tuple([int(x*ratio) for x in old_size])
im... | [
"matplotlib.pyplot.title",
"PIL.Image.new",
"torch.cat",
"torch.cos",
"matplotlib.pyplot.figure",
"torch.nn.init.constant_",
"numpy.arange",
"torch.no_grad",
"os.path.join",
"torch.nn.init.kaiming_normal_",
"matplotlib.pyplot.close",
"torch.zeros",
"torch.randint",
"matplotlib.pyplot.legen... | [((427, 472), 'PIL.Image.new', 'Image.new', (['mode', '(desired_size, desired_size)'], {}), '(mode, (desired_size, desired_size))\n', (436, 472), False, 'from PIL import Image\n'), ((1349, 1376), 'torch.save', 'torch.save', (['state', 'filename'], {}), '(state, filename)\n', (1359, 1376), False, 'import torch\n'), ((37... |
import gym
import numpy as np
from gym import spaces
from gym.utils import seeding
class NavigationVel2DEnv(gym.Env):
"""2D navigation problems, as described in [1]. The code is adapted from
https://github.com/cbfinn/maml_rl/blob/9c8e2ebd741cb0c7b8bf2d040c4caeeb8e06cc95/maml_examples/point_env_randgoal.py
... | [
"numpy.zeros",
"numpy.clip",
"numpy.linalg.norm",
"gym.spaces.Box",
"numpy.sqrt",
"numpy.concatenate",
"gym.utils.seeding.np_random"
] | [((925, 991), 'gym.spaces.Box', 'spaces.Box', ([], {'low': '(-np.inf)', 'high': 'np.inf', 'shape': '(4,)', 'dtype': 'np.float32'}), '(low=-np.inf, high=np.inf, shape=(4,), dtype=np.float32)\n', (935, 991), False, 'from gym import spaces\n'), ((1020, 1076), 'gym.spaces.Box', 'spaces.Box', ([], {'low': '(-1)', 'high': '(... |
# TODO: your agent here!
import numpy as np
from task import Task
from keras import layers, models, optimizers, regularizers
from keras import backend as K
import random
from collections import namedtuple, deque
class ReplayBuffer:
def __init__(self, buffer_size, batch_size):
self.memory = deque(maxlen=... | [
"random.sample",
"numpy.ones",
"keras.models.Model",
"keras.layers.Input",
"collections.deque",
"numpy.reshape",
"keras.backend.gradients",
"keras.backend.learning_phase",
"keras.layers.Dropout",
"keras.optimizers.Adam",
"keras.layers.BatchNormalization",
"numpy.vstack",
"keras.layers.Activa... | [((307, 332), 'collections.deque', 'deque', ([], {'maxlen': 'buffer_size'}), '(maxlen=buffer_size)\n', (312, 332), False, 'from collections import namedtuple, deque\n'), ((396, 489), 'collections.namedtuple', 'namedtuple', (['"""Experience"""'], {'field_names': "['state', 'action', 'reward', 'next_state', 'done']"}), "... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun May 26 15:46:31 2019
@author: david
"""
import numpy as np
from physique import exportToCsv
x=np.array([0,1,2,3,4,5,6,7,8,9])
y=np.array([4.98, 3.59, 2.57, 1.83, 1.32, 0.93, 0.67, 0.48, 0.34, 0.25])
exportToCsv((x,y), fileName = "data_exp2.txt")
| [
"numpy.array",
"physique.exportToCsv"
] | [((162, 202), 'numpy.array', 'np.array', (['[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]'], {}), '([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])\n', (170, 202), True, 'import numpy as np\n'), ((196, 266), 'numpy.array', 'np.array', (['[4.98, 3.59, 2.57, 1.83, 1.32, 0.93, 0.67, 0.48, 0.34, 0.25]'], {}), '([4.98, 3.59, 2.57, 1.83, 1.32, 0.93, 0.67,... |
import nbp
import numpy as np
from nbp.tests.tools import make_system
@nbp.timing
def setup(specific_pos=False, use_neighbours=False):
characteristic_length = 20
if specific_pos:
positions = (np.asarray([[1, 0, -2 ** (-1 / 2)],
[-1, 0, -2 ** (-1 / 2)],
... | [
"numpy.random.rand",
"numpy.asarray",
"nbp.tests.tools.make_system"
] | [((538, 691), 'nbp.tests.tools.make_system', 'make_system', ([], {'characteristic_length': 'characteristic_length', 'positions': 'positions', 'lj': '(True)', 'ewald': '(True)', 'use_neighbours': 'use_neighbours', 'reci_cutoff': '(5)'}), '(characteristic_length=characteristic_length, positions=\n positions, lj=True, ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Provide basic interface to handle a single material being studied.
Created on Wed Jul 29 23:09:54 2020
author: <NAME>
"""
import numpy as np
from pyabsorp.air import AirProperties
from pyabsorp.absorption import absorption_coefficient
from pyabsorp.models import de... | [
"pyabsorp.models.delany_bazley",
"pyabsorp.models.biot_allard",
"numpy.float32",
"pyabsorp.models.johnson_champoux",
"pyabsorp.models.rayleigh",
"pyabsorp.absorption.absorption_coefficient"
] | [((2477, 2493), 'numpy.float32', 'np.float32', (['freq'], {}), '(freq)\n', (2487, 2493), True, 'import numpy as np\n'), ((7906, 7999), 'pyabsorp.absorption.absorption_coefficient', 'absorption_coefficient', (['self.impedance', 'self.waveNum', 'self.thickness', 'self.air.impedance'], {}), '(self.impedance, self.waveNum,... |
import numpy as np
from pathlib import Path
from aocd import get_data
lines = get_data(day=17, year=2020).splitlines()
p = Path(__file__).resolve()
with open(p.parent / 'in.txt') as f:
lines2 = f.read().splitlines()
iterations = 6
input_size = len(lines)
output_size = (iterations) * 2 + input_size
pocketdim = np... | [
"numpy.count_nonzero",
"numpy.ndenumerate",
"numpy.zeros",
"pathlib.Path",
"aocd.get_data"
] | [((318, 361), 'numpy.zeros', 'np.zeros', (['((output_size,) * 3)'], {'dtype': 'np.bool'}), '((output_size,) * 3, dtype=np.bool)\n', (326, 361), True, 'import numpy as np\n'), ((377, 420), 'numpy.zeros', 'np.zeros', (['((output_size,) * 4)'], {'dtype': 'np.bool'}), '((output_size,) * 4, dtype=np.bool)\n', (385, 420), Tr... |
from __future__ import print_function, absolute_import, division
import abc
import numpy as np
from sklearn.utils import check_array, check_random_state
class Coreset(object):
"""
Abstract class for coresets.
Parameters
----------
X : ndarray, shape (n_points, n_dims)
The data set to gene... | [
"sklearn.utils.check_array",
"sklearn.utils.check_random_state",
"numpy.ones",
"numpy.random.choice"
] | [((812, 890), 'sklearn.utils.check_array', 'check_array', (['X'], {'accept_sparse': '"""csr"""', 'order': '"""C"""', 'dtype': '[np.float64, np.float32]'}), "(X, accept_sparse='csr', order='C', dtype=[np.float64, np.float32])\n", (823, 890), False, 'from sklearn.utils import check_array, check_random_state\n'), ((1059, ... |
from __future__ import division, print_function, absolute_import
import time
import warnings
import numpy as np
import itertools as itr
import sys
from contextlib import contextmanager
warnings.simplefilter("ignore", np.ComplexWarning)
_is_verbose = False
_is_silent = False
class AbortException(Exception):
"""
... | [
"numpy.log",
"warnings.simplefilter",
"numpy.argmax",
"numpy.dtype",
"time.time",
"numpy.shape",
"numpy.min",
"numpy.max",
"numpy.arange",
"numpy.prod"
] | [((185, 235), 'warnings.simplefilter', 'warnings.simplefilter', (['"""ignore"""', 'np.ComplexWarning'], {}), "('ignore', np.ComplexWarning)\n", (206, 235), False, 'import warnings\n'), ((3834, 3853), 'numpy.arange', 'np.arange', (['arr.ndim'], {}), '(arr.ndim)\n', (3843, 3853), True, 'import numpy as np\n'), ((7263, 72... |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"sys.stdout.write",
"tensorflow.gfile.Exists",
"random.shuffle",
"numpy.empty",
"sys.stdout.flush",
"os.path.join",
"cv2.cvtColor",
"os.path.dirname",
"random.seed",
"cv2.destroyAllWindows",
"cv2.resize",
"cv2.waitKey",
"tensorflow.Session",
"tensorflow.Graph",
"datasets.dataset_utils.vi... | [((3401, 3436), 'os.path.join', 'os.path.join', (['dataset_dir', '"""UCF101"""'], {}), "(dataset_dir, 'UCF101')\n", (3413, 3436), False, 'import os\n'), ((3499, 3519), 'os.listdir', 'os.listdir', (['ucf_root'], {}), '(ucf_root)\n', (3509, 3519), False, 'import os\n'), ((4384, 4445), 'os.path.join', 'os.path.join', (['d... |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"absl.testing.absltest.main",
"jax.numpy.array",
"functools.partial",
"jax.numpy.log",
"numpy.log",
"gfsa.model.model_util.linear_cross_entropy",
"jax.scipy.special.logit",
"jax.numpy.arange",
"jax.numpy.zeros",
"gfsa.model.model_util.safe_logit",
"numpy.ones",
"numpy.isfinite",
"jax.numpy.o... | [((895, 1224), 'absl.testing.parameterized.named_parameters', 'parameterized.named_parameters', (["{'testcase_name': 'min', 'minval': 1, 'maxval': None, 'expected': [1.0, 1.0,\n 2.0, 3.0, 4.0]}", "{'testcase_name': 'max', 'minval': None, 'maxval': 3, 'expected': [0.0, 1.0,\n 2.0, 3.0, 3.0]}", "{'testcase_name': '... |
import numpy as np
import matplotlib.pyplot as plt
import os
from matplotlib.font_manager import FontProperties
from find_ring import load_dust_outputs, load_gas_outputs, get_dust_trap
G = 6.67e-11 # SI Gravitational Constant
M = 1.989e30 # mass of the Sun in kg (the default MSTAR in FARGO3D)
R = 5.2*1.4959e11 ... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.xscale",
"matplotlib.pyplot.show",
"find_ring.get_dust_trap",
"numpy.logspace",
"matplotlib.pyplot.legend",
"numpy.asarray",
"find_ring.load_dust_outputs",
"numpy.linspace",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"numpy.sqrt",
"m... | [((529, 556), 'numpy.linspace', 'np.linspace', (['rmin', 'rmax', 'Ny'], {}), '(rmin, rmax, Ny)\n', (540, 556), True, 'import numpy as np\n'), ((1331, 1354), 'numpy.logspace', 'np.logspace', (['(-4)', '(2)', '(127)'], {}), '(-4, 2, 127)\n', (1342, 1354), True, 'import numpy as np\n'), ((1450, 1460), 'matplotlib.pyplot.s... |
####################################################################################################
#
# Project: Embedded Learning Library (ELL)
# File: modelHelpers.py
# Authors: <NAME>
# <NAME>
#
# Requires: Python 3.x
#
###########################################################################... | [
"sys.path.append",
"os.path.abspath",
"cv2.cvtColor",
"numpy.mean",
"numpy.array",
"cv2.rectangle",
"os.path.join",
"cv2.resize"
] | [((456, 484), 'sys.path.append', 'sys.path.append', (['script_path'], {}), '(script_path)\n', (471, 484), False, 'import sys\n'), ((429, 454), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (444, 454), False, 'import os\n'), ((501, 535), 'os.path.join', 'os.path.join', (['script_path', '"""bu... |
import tensorflow as tf
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import math_ops
import os
import sys
import numpy as np
from utils import montage_tf, get_variables_to_train, assign_from_checkpoint_fn, remove_missing, weights_montage
from constants import LOG_DIR
slim = tf.contr... | [
"tensorflow.get_collection",
"tensorflow.logging.set_verbosity",
"tensorflow.python.ops.control_flow_ops.with_dependencies",
"sys.stdout.flush",
"tensorflow.train.batch",
"tensorflow.contrib.losses.softmax_cross_entropy",
"tensorflow.losses.get_losses",
"tensorflow.summary.histogram",
"utils.get_var... | [((539, 581), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.DEBUG'], {}), '(tf.logging.DEBUG)\n', (563, 581), True, 'import tensorflow as tf\n'), ((602, 614), 'tensorflow.Session', 'tf.Session', ([], {}), '()\n', (612, 614), True, 'import tensorflow as tf\n'), ((636, 646), 'tensorflow.Gr... |
from PIL import Image
import numpy as np
import copy
from PyQt5.QtGui import QImage
class ImageHandler:
def __init__(self):
self.reference_image = None
self.modified_image = None
self.view = None
self.metrics_engine = None
def subscribe_view(self, view) -> None:
self.v... | [
"copy.deepcopy",
"numpy.asarray",
"PIL.Image.open",
"PyQt5.QtGui.QImage",
"numpy.delete"
] | [((526, 548), 'PIL.Image.open', 'Image.open', (['image_path'], {}), '(image_path)\n', (536, 548), False, 'from PIL import Image\n'), ((571, 595), 'numpy.asarray', 'np.asarray', (['loaded_image'], {}), '(loaded_image)\n', (581, 595), True, 'import numpy as np\n'), ((760, 800), 'numpy.asarray', 'np.asarray', (['image_arr... |
"""Common functions used in scoring germ and fiducial sets."""
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS, the U.S. G... | [
"numpy.abs",
"numpy.array",
"numpy.errstate"
] | [((1694, 1723), 'numpy.errstate', '_np.errstate', ([], {'divide': '"""ignore"""'}), "(divide='ignore')\n", (1706, 1723), True, 'import numpy as _np\n'), ((5864, 5890), 'numpy.array', '_np.array', (['candidateScores'], {}), '(candidateScores)\n', (5873, 5890), True, 'import numpy as _np\n'), ((1785, 1805), 'numpy.abs', ... |
import numpy as np
from scipy import signal
import math
import itertools
import pickle
import matplotlib.pyplot as plt
def skewness(t, x, detrend=1):
# normalize
x = x / x[0]
if detrend == 1:
x = signal.detrend(x, type='linear')
nx = (x - np.mean(x)) / np.std(x - np.mean(x))
s... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.yscale",
"numpy.sum",
"numpy.polyfit",
"numpy.empty",
"numpy.ones",
"numpy.argsort",
"numpy.mean",
"numpy.arange",
"pickle.load",
"numpy.tile",
"numpy.atleast_2d",
"matplotlib.pyplot.axvline",
"numpy.std",
"numpy.cumsum",
"numpy.max",
"nu... | [((1771, 1786), 'numpy.mean', 'np.mean', (['ers', '(0)'], {}), '(ers, 0)\n', (1778, 1786), True, 'import numpy as np\n'), ((1801, 1820), 'numpy.std', 'np.std', (['ers'], {'axis': '(0)'}), '(ers, axis=0)\n', (1807, 1820), True, 'import numpy as np\n'), ((1879, 1907), 'matplotlib.pyplot.plot', 'plt.plot', (['ptime', 'pda... |
#!/usr/bin/python3.7
# -*-coding:utf8 -*
import numpy as np
import unittest
from FDApy.representation.functional_data import (DenseFunctionalData,
IrregularFunctionalData)
class TestDenseFunctionalData1D(unittest.TestCase):
"""Test class for the class DenseFunct... | [
"unittest.main",
"numpy.array",
"FDApy.representation.functional_data.DenseFunctionalData"
] | [((4901, 4916), 'unittest.main', 'unittest.main', ([], {}), '()\n', (4914, 4916), False, 'import unittest\n'), ((448, 533), 'numpy.array', 'np.array', (['[[1, 2, 3, 4], [5, 6, 7, 9], [3, 4, 5, 7], [3, 4, 6, 1], [3, 4, 7, 6]]'], {}), '([[1, 2, 3, 4], [5, 6, 7, 9], [3, 4, 5, 7], [3, 4, 6, 1], [3, 4, 7, 6]]\n )\n', (45... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import functools
import argparse
import os
import cv2
from DataPreparation import get_baseline_dataset, split_data, augment
from Model import Model
_IMG_SHAPE = (512, 512, 3)
_BATCH_SIZE =... | [
"functools.partial",
"argparse.ArgumentParser",
"Model.Model",
"DataPreparation.split_data",
"cv2.imread",
"numpy.reshape",
"cv2.resize"
] | [((871, 904), 'functools.partial', 'functools.partial', (['augment'], {}), '(augment, **cfg)\n', (888, 904), False, 'import functools\n'), ((1055, 1103), 'numpy.reshape', 'np.reshape', (['pred', '(_IMG_SHAPE[0], _IMG_SHAPE[1])'], {}), '(pred, (_IMG_SHAPE[0], _IMG_SHAPE[1]))\n', (1065, 1103), True, 'import numpy as np\n... |
"""
Sparse matrix functions
"""
#
# Authors: <NAME>, March 2002
# <NAME>, August 2012 (Sparse Updates)
# <NAME>, August 2012 (Sparse Updates)
#
from __future__ import division, print_function, absolute_import
__all__ = ['expm', 'inv']
import math
from numpy import asarray, dot, eye, ceil, log2
fr... | [
"scipy.linalg.basic.solve",
"numpy.sum",
"numpy.ceil",
"numpy.tril",
"numpy.log2",
"scipy.sparse.construct.eye",
"scipy.sparse.base.isspmatrix",
"numpy.linalg.norm",
"numpy.exp",
"scipy.sparse.linalg.spsolve",
"math.factorial",
"scipy.linalg.basic.solve_triangular",
"numpy.eye",
"numpy.sin... | [((1268, 1329), 'scipy.sparse.construct.eye', 'speye', (['A.shape[0]', 'A.shape[1]'], {'dtype': 'A.dtype', 'format': 'A.format'}), '(A.shape[0], A.shape[1], dtype=A.dtype, format=A.format)\n', (1273, 1329), True, 'from scipy.sparse.construct import eye as speye\n'), ((1341, 1354), 'scipy.sparse.linalg.spsolve', 'spsolv... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Author: <NAME>
@Contact: <EMAIL>
@File: reconstruction.py
@Time: 2020/1/2 10:26 AM
"""
import os
import sys
import time
import shutil
import numpy as np
import torch
import torch.optim as optim
from torch.optim.lr_scheduler import CosineAnnealingLR
import sklearn.metr... | [
"sklearn.metrics.accuracy_score",
"time.strftime",
"numpy.mean",
"shutil.rmtree",
"os.path.join",
"torch.utils.data.DataLoader",
"dataset.Dataset",
"torch.load",
"os.path.exists",
"torch.optim.lr_scheduler.CosineAnnealingLR",
"sys.exit",
"numpy.concatenate",
"tensorboardX.SummaryWriter",
"... | [((1399, 1437), 'os.path.join', 'os.path.join', (['snapshot_root', '"""models/"""'], {}), "(snapshot_root, 'models/')\n", (1411, 1437), False, 'import os\n'), ((2205, 2243), 'tensorboardX.SummaryWriter', 'SummaryWriter', ([], {'log_dir': 'self.tboard_dir'}), '(log_dir=self.tboard_dir)\n', (2218, 2243), False, 'from ten... |
import numpy as np
def identity(x):
""" A no-op link function.
"""
return x
def _identity_inverse(x):
return x
identity.inverse = _identity_inverse
def logit(x):
""" A logit link function useful for going from probability units to log-odds units.
"""
return np.log(x/(1-x))
def _logit_inv... | [
"numpy.exp",
"numpy.log"
] | [((290, 309), 'numpy.log', 'np.log', (['(x / (1 - x))'], {}), '(x / (1 - x))\n', (296, 309), True, 'import numpy as np\n'), ((345, 355), 'numpy.exp', 'np.exp', (['(-x)'], {}), '(-x)\n', (351, 355), True, 'import numpy as np\n')] |
# -*- coding: utf-8 -*-
# http://pointclouds.org/documentation/tutorials/planar_segmentation.php#planar-segmentation
import pcl
import numpy as np
import random
# int main (int argc, char** argv)
# {
# pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
#
# // Fill in the cloud data
# ... | [
"random.random",
"pcl.PointCloud",
"numpy.zeros"
] | [((807, 823), 'pcl.PointCloud', 'pcl.PointCloud', ([], {}), '()\n', (821, 823), False, 'import pcl\n'), ((834, 869), 'numpy.zeros', 'np.zeros', (['(15, 3)'], {'dtype': 'np.float32'}), '((15, 3), dtype=np.float32)\n', (842, 869), True, 'import numpy as np\n'), ((937, 952), 'random.random', 'random.random', ([], {}), '()... |
#!/usr/bin/env python3
"""
Tool for automated capturing of EM traces. EMcap can send commands to the target device for starting and stopping
operations using a simple communication protocol over either a serial connection or over TCP.
"""
import numpy as np
import sys
import socket
import os
import signal
import logg... | [
"argparse.ArgumentParser",
"os.unlink",
"socket.socket",
"collections.defaultdict",
"datetime.datetime.utcnow",
"numpy.mean",
"os.path.join",
"emma.emcap.ttywrapper.TTYWrapper",
"emma.utils.utils.binary_to_hex",
"numpy.fft.fft",
"os.path.exists",
"subprocess.Popen",
"struct.unpack",
"emma.... | [((899, 958), 'logging.basicConfig', 'logging.basicConfig', ([], {'stream': 'sys.stdout', 'level': 'logging.DEBUG'}), '(stream=sys.stdout, level=logging.DEBUG)\n', (918, 958), False, 'import logging\n'), ((968, 995), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (985, 995), False, 'impor... |
# Copyright (c) 2019 PaddlePaddle Authors. 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 appli... | [
"numpy.ceil",
"numpy.log",
"numpy.zeros",
"logging.getLogger",
"numpy.array",
"numpy.random.choice",
"cv2.resize"
] | [((967, 994), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (984, 994), False, 'import logging\n'), ((3546, 3574), 'numpy.random.choice', 'np.random.choice', (['self.sizes'], {}), '(self.sizes)\n', (3562, 3574), True, 'import numpy as np\n'), ((2346, 2408), 'numpy.zeros', 'np.zeros', (['... |
import numpy as np
from keras.models import Model
from data_unet import load_test_data, desired_size
from train_unet import preprocess, batch_size
import os
from skimage.io import imsave
from constants import mask_raw_path, get_unet
print('-'*30)
print('Loading and preprocessing test data...')
print('-'*30)
imgs_test,... | [
"os.mkdir",
"numpy.save",
"os.path.exists",
"train_unet.preprocess",
"data_unet.load_test_data",
"constants.get_unet"
] | [((336, 352), 'data_unet.load_test_data', 'load_test_data', ([], {}), '()\n', (350, 352), False, 'from data_unet import load_test_data, desired_size\n'), ((365, 386), 'train_unet.preprocess', 'preprocess', (['imgs_test'], {}), '(imgs_test)\n', (375, 386), False, 'from train_unet import preprocess, batch_size\n'), ((609... |
from keras.models import load_model
from time import sleep
from keras.preprocessing.image import img_to_array
from keras.preprocessing import image
import cv2
import numpy as np
face_classifier = cv2.CascadeClassifier(
r'C:\Python37\Projects\Live Project\haarcascade_frontalface_default.xml')
classifier = load_mode... | [
"keras.models.load_model",
"numpy.sum",
"cv2.putText",
"cv2.cvtColor",
"cv2.waitKey",
"cv2.imshow",
"numpy.expand_dims",
"cv2.VideoCapture",
"cv2.rectangle",
"keras.preprocessing.image.img_to_array",
"cv2.CascadeClassifier",
"cv2.destroyAllWindows",
"cv2.resize"
] | [((197, 305), 'cv2.CascadeClassifier', 'cv2.CascadeClassifier', (['"""C:\\\\Python37\\\\Projects\\\\Live Project\\\\haarcascade_frontalface_default.xml"""'], {}), "(\n 'C:\\\\Python37\\\\Projects\\\\Live Project\\\\haarcascade_frontalface_default.xml'\n )\n", (218, 305), False, 'import cv2\n'), ((311, 384), 'kera... |
import os
import warnings
from pathlib import Path
try:
import mne
except ImportError:
print(
"You need to install toeplitzlda with neuro extras to run examples "
"with real EEG data, i.e. pip install toeplitzlda[neuro]"
)
exit(1)
import numpy as np
import pandas as pd
from blockmatrix... | [
"pathlib.Path.home",
"numpy.argmax",
"pathlib.Path",
"numpy.mean",
"pandas.DataFrame",
"numpy.zeros_like",
"toeplitzlda.usup_replay.visual_speller.VisualMatrixSpellerLLPDataset",
"mne.epochs.read_epochs",
"mne.set_log_level",
"toeplitzlda.usup_replay.visual_speller.seq_labels_from_epoch",
"sklea... | [((717, 742), 'mne.set_log_level', 'mne.set_log_level', (['"""INFO"""'], {}), "('INFO')\n", (734, 742), False, 'import mne\n'), ((744, 770), 'numpy.seterr', 'np.seterr', ([], {'divide': '"""ignore"""'}), "(divide='ignore')\n", (753, 770), True, 'import numpy as np\n'), ((936, 994), 'warnings.filterwarnings', 'warnings.... |
"""Plots Laplacian kernel used for edge-detector test."""
import argparse
import numpy
import matplotlib
matplotlib.use('agg')
import matplotlib.colors
from matplotlib import pyplot
from gewittergefahr.gg_utils import file_system_utils
from gewittergefahr.plotting import plotting_utils
THIS_FIRST_MATRIX = numpy.array... | [
"matplotlib.colors.to_rgba",
"numpy.full",
"numpy.stack",
"argparse.ArgumentParser",
"numpy.ma.masked_where",
"matplotlib.pyplot.close",
"gewittergefahr.plotting.plotting_utils.create_paneled_figure",
"numpy.min",
"matplotlib.use",
"numpy.array",
"matplotlib.pyplot.rc",
"gewittergefahr.gg_util... | [((106, 127), 'matplotlib.use', 'matplotlib.use', (['"""agg"""'], {}), "('agg')\n", (120, 127), False, 'import matplotlib\n'), ((309, 355), 'numpy.array', 'numpy.array', (['[[0, 0, 0], [0, 1, 0], [0, 0, 0]]'], {}), '([[0, 0, 0], [0, 1, 0], [0, 0, 0]])\n', (320, 355), False, 'import numpy\n'), ((392, 439), 'numpy.array'... |
from os.path import isfile
from debug_tools import Debug
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__),'..'))
import numpy as np
from torchvision import transforms
import torch
from .sensation import Sensation
from .configure import config
from .AutoEncoder import AutoEncoder
from .Delta... | [
"torch.nn.MSELoss",
"torch.from_numpy",
"numpy.abs",
"os.path.dirname",
"torch.load",
"numpy.zeros",
"numpy.floor",
"os.path.isfile",
"numpy.arange",
"torch.device",
"numpy.random.permutation",
"torch_model_fit.Fit",
"os.path.join",
"os.listdir",
"numpy.concatenate",
"torchvision.trans... | [((107, 132), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (122, 132), False, 'import os\n'), ((778, 798), 'torch.device', 'torch.device', (['device'], {}), '(device)\n', (790, 798), False, 'import torch\n'), ((861, 892), 'torch_model_fit.Fit', 'Fit', (['self.log_title', 'debug_mode'], {}),... |
import os
import sys
import numpy as np
import pandas as pd
from .reader import open_csv_file, read_erbs_file, read_measurements_file
from .path_loss import Cost231, Cost231Hata, FlatEarth, OkumuraHata
from .path_loss import FreeSpace, Ecc33, CitySize, AreaKind
from .geo import Coordinate, distance_in_km, azimuth
from ... | [
"numpy.stack",
"pandas.DataFrame",
"os.getcwd",
"pandas.read_csv",
"numpy.zeros",
"numpy.argmin",
"os.path.isfile",
"numpy.array",
"pandas.Series",
"numpy.linalg.norm",
"numpy.round",
"numpy.delete",
"numpy.ndarray.flatten"
] | [((3033, 3052), 'numpy.array', 'np.array', (['loss_list'], {}), '(loss_list)\n', (3041, 3052), True, 'import numpy as np\n'), ((4418, 4440), 'numpy.array', 'np.array', (['loss_vectors'], {}), '(loss_vectors)\n', (4426, 4440), True, 'import numpy as np\n'), ((4462, 4494), 'numpy.stack', 'np.stack', (['loss_matrices'], {... |
#
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
from rlalgos import BaseExperiment
from rlstructures.logger import Logger, TFLogger
from rlstructures import DictTensor, TemporalDictTens... | [
"copy.deepcopy",
"pickle.dump",
"torch.randint",
"torch.eye",
"numpy.random.rand",
"time.time",
"torch.distributions.Normal",
"rlstructures.DictTensor",
"torch.arange",
"torch.device",
"torch.zeros",
"rlstructures.logging.info",
"torch.min",
"torch.tensor"
] | [((2538, 2577), 'torch.randint', 'torch.randint', (['(0)'], {'high': 'limit', 'size': '(n,)'}), '(0, high=limit, size=(n,))\n', (2551, 2577), False, 'import torch\n'), ((2654, 2667), 'rlstructures.DictTensor', 'DictTensor', (['d'], {}), '(d)\n', (2664, 2667), False, 'from rlstructures import DictTensor, TemporalDictTen... |
## @author: <NAME>
# Documentation for this module.
#
# Created on Wed Feb 6 15:06:12 2019; -*- coding: utf-8 -*-;
#################################################################################################################################
#####################################################################... | [
"pylab.close",
"os.mkdir",
"numpy.load",
"numpy.fft.rfft",
"numpy.sum",
"pylab.GridSpec",
"numpy.ravel",
"numpy.empty",
"numpy.floor",
"numpy.reciprocal",
"numpy.ones",
"pylab.waitforbuttonpress",
"os.path.isfile",
"pylab.subplots",
"pylab.figure",
"pylab.tight_layout",
"numpy.arange... | [((2777, 2793), 'numpy.empty', 'np.empty', (['(1, 2)'], {}), '((1, 2))\n', (2785, 2793), True, 'import numpy as np\n'), ((2799, 2815), 'numpy.empty', 'np.empty', (['(1, 2)'], {}), '((1, 2))\n', (2807, 2815), True, 'import numpy as np\n'), ((2821, 2837), 'numpy.empty', 'np.empty', (['(1, 2)'], {}), '((1, 2))\n', (2829, ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 1 07:26:50 2021
@author: P.Chimenti
This code tests the base class of WoodHardness analysis
"""
import numpy as np
from Tests.BasicTools import WoodHardness_base as whb
samples = 10000
wh_base = whb.WoodHardness_base()
print("Number of s... | [
"Tests.BasicTools.WoodHardness_base.WoodHardness_base",
"numpy.concatenate"
] | [((277, 300), 'Tests.BasicTools.WoodHardness_base.WoodHardness_base', 'whb.WoodHardness_base', ([], {}), '()\n', (298, 300), True, 'from Tests.BasicTools import WoodHardness_base as whb\n'), ((624, 664), 'numpy.concatenate', 'np.concatenate', (['(samples, blobs)'], {'axis': '(1)'}), '((samples, blobs), axis=1)\n', (638... |
from smt_solver.formula_parser.formula_parser import FormulaParser
from smt_solver.sat_solver.sat_solver import SATSolver
import numpy as np
class TestFormulaParser:
@staticmethod
def test_prepare_formula():
assert FormulaParser._prepare_formula(' ') == ''
assert FormulaParser._prepar... | [
"smt_solver.formula_parser.formula_parser.FormulaParser.import_uf",
"smt_solver.formula_parser.formula_parser.FormulaParser._create_boolean_abstraction",
"smt_solver.formula_parser.formula_parser.FormulaParser._parse_linear_equation",
"smt_solver.formula_parser.formula_parser.FormulaParser._prepare_formula",
... | [((7792, 7829), 'smt_solver.formula_parser.formula_parser.FormulaParser._parse_formula', 'FormulaParser._parse_formula', (['formula'], {}), '(formula)\n', (7820, 7829), False, 'from smt_solver.formula_parser.formula_parser import FormulaParser\n'), ((7859, 7944), 'smt_solver.formula_parser.formula_parser.FormulaParser.... |
import argh
import logging
import networkx as nx
import pygna.reading_class as rc
import pygna.output as out
import pygna.statistical_test as st
import pygna.painter as paint
import pygna.diagnostic as diagnostic
import pygna.command as cmd
import numpy as np
def average_closeness_centrality(graph: nx.Graph, geneset:... | [
"pygna.statistical_test.StatisticalTest",
"numpy.sum",
"pygna.reading_class.ReadTsv",
"argh.dispatch_commands",
"numpy.transpose",
"logging.info",
"pygna.command.read_distance_matrix",
"numpy.mean",
"networkx.connected_components",
"pygna.output.Output",
"pygna.reading_class.ReadGmt",
"numpy.v... | [((1147, 1172), 'numpy.mean', 'np.mean', (['graph_centrality'], {}), '(graph_centrality)\n', (1154, 1172), True, 'import numpy as np\n'), ((1980, 2050), 'logging.info', 'logging.info', (['"""Evaluating the test topology total degree, please wait"""'], {}), "('Evaluating the test topology total degree, please wait')\n",... |
import os
import logging
logger = logging.getLogger(__name__)
import numpy as np
import astropy.io.fits as fits
import scipy.interpolate as intp
from scipy.signal import savgol_filter
import matplotlib.pyplot as plt
def get_region_lst(header):
"""Get a list of array indices.
Args:
header ():
Retu... | [
"scipy.interpolate.InterpolatedUnivariateSpline",
"numpy.logical_not",
"numpy.zeros",
"numpy.isnan",
"numpy.arange",
"numpy.int16",
"logging.getLogger"
] | [((34, 61), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (51, 61), False, 'import logging\n'), ((7753, 7767), 'numpy.int16', 'np.int16', (['mask'], {}), '(mask)\n', (7761, 7767), True, 'import numpy as np\n'), ((10323, 10371), 'numpy.zeros', 'np.zeros', (['(ny, nx - ovs_width)'], {'dtyp... |
import os
import dabest
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.stats import pearsonr
from task import SequenceLearning
from utils.params import P
from utils.constants import TZ_COND_DICT
from utils.io import build_log_path, pickle_load_dict, \
get_test_data_dir, get_test... | [
"numpy.moveaxis",
"analysis.make_df",
"numpy.random.seed",
"analysis.compute_cell_memory_similarity",
"scipy.special.comb",
"numpy.shape",
"numpy.argsort",
"numpy.mean",
"numpy.arange",
"numpy.diag",
"os.path.join",
"analysis.create_sim_dict",
"task.SequenceLearning",
"utils.io.get_test_da... | [((661, 723), 'seaborn.set', 'sns.set', ([], {'style': '"""white"""', 'palette': '"""colorblind"""', 'context': '"""poster"""'}), "(style='white', palette='colorblind', context='poster')\n", (668, 723), True, 'import seaborn as sns\n'), ((789, 802), 'numpy.arange', 'np.arange', (['(15)'], {}), '(15)\n', (798, 802), Tru... |
import torch
import torch.nn as nn
import numpy as np
from .base import Denoiser, Denoiser2D
class TVDenoiser(Denoiser):
def __init__(self, iter_num=5, use_3dtv=False):
self.iter_num = iter_num
self.use_3dtv = use_3dtv
def denoise(self, x, sigma):
from .models.TV_denoising import TV_... | [
"numpy.ceil",
"torch.load",
"torch.cat",
"torch.zeros",
"torch.squeeze",
"torch.unsqueeze",
"torch.tensor"
] | [((1462, 1484), 'torch.load', 'torch.load', (['model_path'], {}), '(model_path)\n', (1472, 1484), False, 'import torch\n'), ((2134, 2156), 'torch.load', 'torch.load', (['model_path'], {}), '(model_path)\n', (2144, 2156), False, 'import torch\n'), ((5478, 5500), 'torch.load', 'torch.load', (['model_path'], {}), '(model_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.