code stringlengths 31 1.05M | apis list | extract_api stringlengths 97 1.91M |
|---|---|---|
import networkx as nx
import numpy as np
import os
import palantir
import random
import scanpy as sc
import torch
import warnings
from sklearn.neighbors import NearestNeighbors
from models.ti.connectivity import (
compute_directed_cluster_connectivity,
compute_undirected_cluster_connectivity,
)
from models.ti... | [
"palantir.core.run_palantir",
"numpy.random.seed",
"scanpy.pp.neighbors",
"numpy.iinfo",
"scanpy.tl.louvain",
"scanpy.tl.paga",
"models.ti.connectivity.compute_undirected_cluster_connectivity",
"warnings.simplefilter",
"palantir.utils.run_pca",
"utils.util.get_start_cell_cluster_id",
"scanpy.tl.... | [((1260, 1277), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (1271, 1277), False, 'import random\n'), ((1282, 1302), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (1296, 1302), True, 'import numpy as np\n'), ((1307, 1330), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(see... |
# -*- coding: utf-8 -*-
import grace
import grace.times
import grace.ols
import datetime
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import mpl_toolkits.basemap as maps
# Load Thetas
description = grace.ols.theta_description()
Theta = grace.ols.theta_matrix()
# Parameter ind... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"grace.ols.theta_description",
"matplotlib.pyplot.figure",
"grace.ols.theta_matrix",
"numpy.arange",
"mpl_toolkits.basemap.Basemap",
"numpy.sqrt"
] | [((241, 270), 'grace.ols.theta_description', 'grace.ols.theta_description', ([], {}), '()\n', (268, 270), False, 'import grace\n'), ((279, 303), 'grace.ols.theta_matrix', 'grace.ols.theta_matrix', ([], {}), '()\n', (301, 303), False, 'import grace\n'), ((386, 458), 'numpy.sqrt', 'np.sqrt', (['(Theta[:, :, paramIndex] *... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Setup script for pyshtools"""
import sys
min_version = (3, 6)
if sys.version_info < min_version:
error = '\n*** Beginning with pyshtools 4.6, Python {:} or above \n' \
'*** is required. This error may be a result of using a \n' \
'*** pyt... | [
"versioneer.get_version",
"numpy.distutils.command.build.build.run",
"numpy.distutils.core.setup",
"pypandoc.convert_file",
"setuptools.find_packages",
"numpy.distutils.system_info.get_info",
"numpy.distutils.command.develop.develop.run",
"versioneer.get_cmdclass",
"sysconfig.get_platform",
"numpy... | [((3121, 3145), 'versioneer.get_version', 'versioneer.get_version', ([], {}), '()\n', (3143, 3145), False, 'import versioneer\n'), ((8088, 8105), 'numpy.distutils.core.setup', 'setup', ([], {}), '(**metadata)\n', (8093, 8105), False, 'from numpy.distutils.core import setup\n'), ((1614, 1655), 'pypandoc.convert_file', '... |
"""
Implements the master frame base class.
.. _numpy.ndarray: https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.html
"""
import os
import sys
import warnings
import time
from abc import ABCMeta
import numpy as np
from astropy.io import fits
from pypeit import msgs
# These imports are largely jus... | [
"astropy.io.fits.ImageHDU",
"os.getcwd",
"time.gmtime",
"astropy.io.fits.PrimaryHDU",
"os.path.exists",
"pypeit.msgs.error",
"pypeit.msgs.newline",
"os.path.isfile",
"astropy.io.fits.Header",
"astropy.io.fits.open",
"pypeit.msgs.warn",
"numpy.log10",
"os.path.join"
] | [((2876, 2921), 'os.path.join', 'os.path.join', (['self.master_dir', 'self.file_name'], {}), '(self.master_dir, self.file_name)\n', (2888, 2921), False, 'import os\n'), ((9074, 9093), 'astropy.io.fits.open', 'fits.open', (['filename'], {}), '(filename)\n', (9083, 9093), False, 'from astropy.io import fits\n'), ((1954, ... |
import pickle
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from predictors.RNN_abandoned_Tensorflow.RNN_model_tensorflow import RNNPredictor
from sklearn.preprocessing import RobustScaler
from predictors.RNN_under_development.Utils import format_time_series, split_data
input_cols = ["vol_re... | [
"matplotlib.pyplot.show",
"pandas.read_csv",
"sklearn.preprocessing.RobustScaler",
"predictors.RNN_under_development.Utils.split_data",
"numpy.array",
"predictors.RNN_under_development.Utils.format_time_series"
] | [((688, 765), 'pandas.read_csv', 'pd.read_csv', (['"""./../../new_database/aapl/time_data.csv"""'], {'header': '(0)', 'index_col': '(0)'}), "('./../../new_database/aapl/time_data.csv', header=0, index_col=0)\n", (699, 765), True, 'import pandas as pd\n'), ((1024, 1059), 'predictors.RNN_under_development.Utils.split_dat... |
import cv2
import numpy as np
from shapely.geometry import Polygon
import pyclipper
class SegDetectorRepresenter():
thresh = 0.3
box_thresh = 0.7
max_candidates = 1000
dest = 'binary'
def __init__(self, cmd={}, **kwargs):
# self.load_all(**kwargs)
self.min_size = 3
self.sca... | [
"shapely.geometry.Polygon",
"cv2.approxPolyDP",
"cv2.arcLength",
"numpy.zeros",
"cv2.boxPoints",
"numpy.array",
"cv2.minAreaRect",
"cv2.mean",
"numpy.round",
"pyclipper.PyclipperOffset"
] | [((4882, 4928), 'numpy.zeros', 'np.zeros', (['(num_contours, 4, 2)'], {'dtype': 'np.int16'}), '((num_contours, 4, 2), dtype=np.int16)\n', (4890, 4928), True, 'import numpy as np\n'), ((4946, 4989), 'numpy.zeros', 'np.zeros', (['(num_contours,)'], {'dtype': 'np.float32'}), '((num_contours,), dtype=np.float32)\n', (4954,... |
#!/usr/bin/python
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | [
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.Session",
"numpy.zeros",
"scripts.retrain.create_image_lists",
"PIL.Image.open",
"tensorflow.placeholder",
"scripts.retrain.get_image_path",
"numpy.mean",
"numpy.array",
"scripts.retrain.add_evaluation_step",
"scripts.count_ops.load_... | [((1747, 1832), 'scripts.retrain.create_image_lists', 'retrain.create_image_lists', (['image_dir', 'testing_percentage', 'validation_percentage'], {}), '(image_dir, testing_percentage, validation_percentage\n )\n', (1773, 1832), True, 'import scripts.retrain as retrain\n'), ((1018, 1080), 'tensorflow.placeholder', '... |
"""HW1 - DATA PROCESSING
<NAME>
MAE 298 AEROACOUSTICS
HOMEWORK 1 - SIGNAL PROCESSING
CREATED: 04 OCT 2016
MODIFIY: 17 OCT 2016
DESCRIPTION: Read sound file of sonic boom and convert signal to
Narrow-band in Pa.
Compute Single-side power spectral density (FFT).
1/3 octave and octave band
NOTE: use 'soundfile' module t... | [
"pandas.DataFrame",
"soundfile.read",
"numpy.sum",
"numpy.abs",
"numpy.fft.fft",
"scipy.io.wavfile.read",
"numpy.fft.fftfreq",
"numpy.array",
"numpy.arange",
"pandas.Series",
"numpy.log10"
] | [((856, 873), 'soundfile.read', 'sf.read', (['filename'], {}), '(filename)\n', (863, 873), True, 'import soundfile as sf\n'), ((1209, 1231), 'scipy.io.wavfile.read', 'wavfile.read', (['filename'], {}), '(filename)\n', (1221, 1231), False, 'from scipy.io import wavfile\n'), ((1470, 1484), 'numpy.array', 'np.array', (['d... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
# Standard imports
from future import standard_library
standard_library.install_aliases()
from builtins import *
import unittest
from datetime import datetime
import loggi... | [
"unittest.main",
"emission.analysis.intake.cleaning.cleaning_methods.speed_outlier_detection.SimpleQuartileOutlier",
"logging.basicConfig",
"emission.analysis.intake.cleaning.location_smoothing.add_speed",
"future.standard_library.install_aliases",
"emission.analysis.intake.cleaning.cleaning_methods.jump_... | [((204, 238), 'future.standard_library.install_aliases', 'standard_library.install_aliases', ([], {}), '()\n', (236, 238), False, 'from future import standard_library\n'), ((6036, 6076), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.DEBUG'}), '(level=logging.DEBUG)\n', (6055, 6076), False, 'impo... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2019-06-23 13:52:57
# @Author : <NAME> (<EMAIL>)
# @Link : http://www.runoob.com/numpy/numpy-array-from-existing-data.html
# @Version : $Id$
import os
import numpy as np
"""
numpy.asarray(a, dtype = None, order = None)
a 任意形式的输入参数,可以是,列表, 列表的元组, 元组, 元组的... | [
"numpy.asarray",
"numpy.zeros"
] | [((401, 444), 'numpy.zeros', 'np.zeros', (['[2, 3, 4]'], {'dtype': 'float', 'order': '"""C"""'}), "([2, 3, 4], dtype=float, order='C')\n", (409, 444), True, 'import numpy as np\n'), ((504, 517), 'numpy.asarray', 'np.asarray', (['l'], {}), '(l)\n', (514, 517), True, 'import numpy as np\n')] |
"""
Utilities to Support Random Operations and Generating Vectors and Matrices
"""
import numpy as np
from numba import guvectorize, generated_jit, types
from ..util import check_random_state, searchsorted
# Generating Arrays and Vectors #
def probvec(m, k, random_state=None, parallel=True):
"""
Return m ... | [
"numpy.empty",
"numpy.floor",
"numpy.ones",
"numpy.random.random",
"numpy.arange",
"numba.guvectorize",
"numba.generated_jit"
] | [((4197, 4274), 'numba.guvectorize', 'guvectorize', (["['(i8, f8[:], i8[:])']", '"""(),(k)->(k)"""'], {'nopython': '(True)', 'cache': '(True)'}), "(['(i8, f8[:], i8[:])'], '(),(k)->(k)', nopython=True, cache=True)\n", (4208, 4274), False, 'from numba import guvectorize, generated_jit, types\n'), ((4698, 4726), 'numba.g... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# File: deeplabFOV.py
# Author: <NAME> <<EMAIL>>
import cv2
import tensorflow as tf
import argparse
from six.moves import zip
import os
import numpy as np
os.environ['TENSORPACK_TRAIN_API'] = 'v2' # will become default soon
from tensorpack import *
from tensorpack.dataf... | [
"argparse.ArgumentParser",
"numpy.argmax",
"tensorflow.identity",
"tensorflow.reshape",
"six.moves.zip",
"tensorpack.utils.segmentation.segmentation.predict_scaler",
"cv2.imshow",
"tensorflow.get_variable",
"LSTM_model_convlstm_p543.LSTM_model",
"tensorflow.add_n",
"data_loader.DataLoader.class_... | [((808, 830), 'data_loader.DataLoader.class_num', 'DataLoader.class_num', ([], {}), '()\n', (828, 830), False, 'from data_loader import DataLoader\n'), ((4357, 4463), 'data_loader.DataLoader', 'DataLoader', ([], {'name': 'name', 'max_length': 'MAX_LENGTH', 'img_size': 'IMG_SIZE', 'train_img_num': '(8000)', 'test_img_nu... |
import pprint
import glob
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
dat = np.loadtxt("cooperation_level.dat")
n_cols = dat.shape[1] - 1
for i in range(n_cols):
n = i + 3 # N: [3,...]
col = i + 1
plt.plot(dat[:,0], dat[:,col], label=n)
plt.legend()
plt.xlab... | [
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legend",
"matplotlib.use",
"numpy.loadtxt",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig"
] | [((44, 65), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (58, 65), False, 'import matplotlib\n'), ((125, 160), 'numpy.loadtxt', 'np.loadtxt', (['"""cooperation_level.dat"""'], {}), "('cooperation_level.dat')\n", (135, 160), True, 'import numpy as np\n'), ((299, 311), 'matplotlib.pyplot.legend',... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
from ..spectrum.models import PowerLaw
from ..maps import WcsNDMap
__all__ = ["make_map_exposure_true_energy"]
def make_map_exposure_true_energy(pointi... | [
"numpy.diff",
"numpy.expand_dims"
] | [((2383, 2404), 'numpy.diff', 'np.diff', (['energy_edges'], {}), '(energy_edges)\n', (2390, 2404), True, 'import numpy as np\n'), ((1203, 1236), 'numpy.expand_dims', 'np.expand_dims', (['exposure.value', '(0)'], {}), '(exposure.value, 0)\n', (1217, 1236), True, 'import numpy as np\n')] |
#!/usr/bin/env python
# ------------------------------------------------------------------------------------------------------%
# Created by "Thieu" at 09:55, 02/03/2021 %
# ... | [
"numpy.random.uniform",
"copy.deepcopy",
"numpy.sum",
"numpy.array",
"numpy.random.rand"
] | [((2006, 2022), 'copy.deepcopy', 'deepcopy', (['pop[0]'], {}), '(pop[0])\n', (2014, 2022), False, 'from copy import deepcopy\n'), ((2097, 2121), 'copy.deepcopy', 'deepcopy', (['pop[:self.nsr]'], {}), '(pop[:self.nsr])\n', (2105, 2121), False, 'from copy import deepcopy\n'), ((2207, 2231), 'copy.deepcopy', 'deepcopy', (... |
import numpy as np
import scipy as sp
import scipy.stats as spstats
import math
import cardiachelpers.mathhelper as mathhelper
def rotateDataCoordinates(points, apex_pt, basal_pt, septal_pts):
"""Reorganize endo and epi data for processing.
args:
all_data_endo (array): Endo data from MRI model
all_data_epi (ar... | [
"numpy.sum",
"cardiachelpers.mathhelper.getBinValues",
"numpy.empty",
"numpy.ones",
"numpy.isnan",
"numpy.argsort",
"numpy.mean",
"numpy.arange",
"cardiachelpers.mathhelper.cart2pol",
"scipy.interpolate.interp1d",
"numpy.round",
"numpy.unique",
"numpy.nanmean",
"numpy.full",
"numpy.trans... | [((895, 911), 'numpy.array', 'np.array', (['points'], {}), '(points)\n', (903, 911), True, 'import numpy as np\n'), ((923, 940), 'numpy.array', 'np.array', (['apex_pt'], {}), '(apex_pt)\n', (931, 940), True, 'import numpy as np\n'), ((953, 971), 'numpy.array', 'np.array', (['basal_pt'], {}), '(basal_pt)\n', (961, 971),... |
import copy
import time
import numpy as np
import gym
import pickle
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
import scipy.stats as st
env = gym.make("Acrobot-v1")
obs_num = env.observation_space.shape[0]
acts_num = env.action_sp... | [
"copy.deepcopy",
"pickle.dump",
"torch.nn.MSELoss",
"gym.make",
"scipy.stats.mannwhitneyu",
"time.time",
"numpy.random.permutation",
"torch.max",
"numpy.array",
"torch.nn.Linear",
"numpy.random.rand",
"torch.from_numpy"
] | [((231, 253), 'gym.make', 'gym.make', (['"""Acrobot-v1"""'], {}), "('Acrobot-v1')\n", (239, 253), False, 'import gym\n'), ((1426, 1442), 'copy.deepcopy', 'copy.deepcopy', (['Q'], {}), '(Q)\n', (1439, 1442), False, 'import copy\n'), ((2122, 2133), 'time.time', 'time.time', ([], {}), '()\n', (2131, 2133), False, 'import ... |
# Fully self generative mono-site stochastic weather generator
# Author: <NAME>
import numpy as np
import netCDF4 as nc
import os
from scipy.optimize import curve_fit
import random
from scipy import stats
import pandas
import math
import yaml
import warnings
import sys
# load in required parameters
warnings.filterwa... | [
"os.mkdir",
"yaml.load",
"numpy.load",
"numpy.abs",
"numpy.sum",
"math.erf",
"pandas.read_csv",
"numpy.argmin",
"numpy.isnan",
"numpy.histogram",
"numpy.mean",
"numpy.sin",
"numpy.exp",
"numpy.interp",
"netCDF4.Dataset",
"numpy.std",
"os.path.exists",
"numpy.genfromtxt",
"numpy.i... | [((303, 336), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (326, 336), False, 'import warnings\n'), ((417, 443), 'os.path.exists', 'os.path.exists', (['Param_file'], {}), '(Param_file)\n', (431, 443), False, 'import os\n'), ((557, 567), 'sys.exit', 'sys.exit', ([], {}), ... |
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## Created by: <NAME>
## ECE Department, Rutgers University
## Email: <EMAIL>
## Copyright (c) 2017
##
## This source code is licensed under the MIT-style license found in the
## LICENSE file in the root directory of this source tree
##++++++++... | [
"threading.Thread",
"numpy.sum",
"numpy.asarray",
"numpy.spacing",
"threading.Lock",
"numpy.histogram",
"torch.max"
] | [((2233, 2253), 'torch.max', 'torch.max', (['output', '(1)'], {}), '(output, 1)\n', (2242, 2253), False, 'import torch\n'), ((2386, 2404), 'numpy.sum', 'np.sum', (['(target > 0)'], {}), '(target > 0)\n', (2392, 2404), True, 'import numpy as np\n'), ((2425, 2467), 'numpy.sum', 'np.sum', (['((predict == target) * (target... |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. 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/LI... | [
"transformers.utils.logging.enable_default_handler",
"numpy.argmax",
"transformers.trainer_utils.get_last_checkpoint",
"transformers.utils.logging.set_verbosity",
"gc.collect",
"transformers.AutoFeatureExtractor.from_pretrained",
"scipy.stats.describe",
"os.path.join",
"torchvision.transforms.Normal... | [((1553, 1580), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1570, 1580), False, 'import logging\n'), ((1856, 1901), 'transformers.MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING.keys', 'MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING.keys', ([], {}), '()\n', (1899, 1901), False, 'from transformers impo... |
import datetime
import os
import random
from collections import deque
import time
import gym
import numpy as np
import tensorflow as tf
from tensorflow.keras import models, layers
import psutil
from utils import collect_experience_hidden_action, preprocess, image_grid, plot_to_image, exploration_linear_decay, explora... | [
"numpy.sum",
"numpy.argmax",
"random.choices",
"tensorflow.reshape",
"tensorflow.train.latest_checkpoint",
"tensorflow.reduce_max",
"os.path.join",
"numpy.round",
"collections.deque",
"tensorflow.one_hot",
"tensorflow.keras.callbacks.TensorBoard",
"model.create_model_faithful",
"tensorflow.s... | [((615, 637), 'gym.make', 'gym.make', (['"""Assault-v0"""'], {}), "('Assault-v0')\n", (623, 637), False, 'import gym\n'), ((714, 767), 'os.path.join', 'os.path.join', (['"""."""', '"""models"""', 'now', '"""-{epoch:04d}.ckpt"""'], {}), "('.', 'models', now, '-{epoch:04d}.ckpt')\n", (726, 767), False, 'import os\n'), ((... |
from __future__ import print_function
import copy
from theano.compat import izip
import numpy
import theano
from theano import Apply, scalar, config
from theano import scalar as scal
from six.moves import StringIO, xrange
from theano.gof.utils import MethodNotDefined
from theano.scalar import Scalar
from theano.tensor... | [
"theano.tensor.elemwise.Elemwise.make_node",
"six.moves.StringIO",
"pygpu.empty",
"theano.tensor.elemwise.CAReduceDtype.__init__",
"pygpu.get_default_context",
"theano.Apply",
"theano.tensor.elemwise.Elemwise",
"theano.scalar.basic.Scalar",
"theano.compat.izip",
"pygpu.elemwise.ElemwiseKernel",
... | [((1362, 1393), 'pygpu.empty', 'pygpu.empty', (['shape'], {'dtype': 'dtype'}), '(shape, dtype=dtype)\n', (1373, 1393), False, 'import pygpu\n'), ((1990, 2023), 'theano.tensor.elemwise.Elemwise.make_node', 'Elemwise.make_node', (['self', '*inputs'], {}), '(self, *inputs)\n', (2008, 2023), False, 'from theano.tensor.elem... |
import numpy as np
from tensorflow import keras
from keras import backend as K
# 带有warm-up的cosine学习率
def cosine_decay_with_warmup(global_step,
learning_rate_base,
total_steps,
warmup_learning_rate=0.0,
... | [
"matplotlib.pyplot.title",
"tensorflow.keras.utils.to_categorical",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"keras.backend.set_value",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.axis",
"keras.backend.get_value",
"numpy.where",
"numpy.random.randint",
"numpy.random.random",
"ker... | [((2549, 2604), 'numpy.where', 'np.where', (['(global_step > total_steps)', '(0.0)', 'learning_rate'], {}), '(global_step > total_steps, 0.0, learning_rate)\n', (2557, 2604), True, 'import numpy as np\n'), ((5165, 5177), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (5175, 5177), False, 'from keras.models ... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from __future__ import division
from __future__ import print_function
import sys
import numpy as np
import pandas as pd
from scipy.stats import percentileofscore
from .base import Expression, ExpressionOps
from ..log import get_module_logger
... | [
"numpy.nansum",
"numpy.log",
"numpy.seterr",
"numpy.isnan",
"numpy.where",
"pandas.Series",
"scipy.stats.percentileofscore",
"numpy.nanmean"
] | [((1206, 1233), 'numpy.seterr', 'np.seterr', ([], {'invalid': '"""ignore"""'}), "(invalid='ignore')\n", (1215, 1233), True, 'import numpy as np\n'), ((14490, 14538), 'numpy.where', 'np.where', (['series_cond', 'series_left', 'series_right'], {}), '(series_cond, series_left, series_right)\n', (14498, 14538), True, 'impo... |
import numpy as np
from matplotlib import pyplot as plt
import train
import analysis
def plot_losses(losses, dataset='train1'):
plt.semilogy(losses)
plt.xlabel('Iteration')
plt.ylabel('Loss in log')
plt.title(f'Semilogy Loss - {dataset}')
plt.show()
def train_1_eval_test_create_c... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"numpy.array",
"analysis.create_comp_file",
"train.train",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.semilogy",
"matplotlib.pyplot.xlabel",
"analysis.find_acc"
] | [((143, 163), 'matplotlib.pyplot.semilogy', 'plt.semilogy', (['losses'], {}), '(losses)\n', (155, 163), True, 'from matplotlib import pyplot as plt\n'), ((169, 192), 'matplotlib.pyplot.xlabel', 'plt.xlabel', (['"""Iteration"""'], {}), "('Iteration')\n", (179, 192), True, 'from matplotlib import pyplot as plt\n'), ((198... |
"""Computer vision algorithms for identifying targets in a camera frame"""
from typing import List, Optional, Tuple
import numpy as np
import cv2
def find_features(frame: np.ndarray) -> List[cv2.KeyPoint]:
"""Find bright features in a camera frame.
Args:
frame: A grayscale camera frame with dtype ui... | [
"cv2.line",
"numpy.argmax",
"cv2.cvtColor",
"cv2.waitKey",
"cv2.threshold",
"cv2.moments",
"cv2.namedWindow",
"numpy.diff",
"numpy.array",
"numpy.linalg.norm",
"cv2.KeyPoint",
"cv2.setMouseCallback",
"cv2.resizeWindow",
"cv2.imshow",
"cv2.findContours"
] | [((880, 895), 'numpy.argmax', 'np.argmax', (['hist'], {}), '(hist)\n', (889, 895), True, 'import numpy as np\n'), ((960, 973), 'numpy.diff', 'np.diff', (['hist'], {}), '(hist)\n', (967, 973), True, 'import numpy as np\n'), ((1067, 1122), 'cv2.threshold', 'cv2.threshold', (['frame', 'threshold', '(255)', 'cv2.THRESH_BIN... |
import numpy as np
import stocklab
from stocklab.datetime import Date
class force_variance(stocklab.Module):
spec = {
'args': [
('mode', ['buy', 'sell']),
'stock_id',
('date', Date),
('days', int),
('min_force', int),
],
}
def evaluate(self, db, args):
... | [
"numpy.linalg.norm",
"stocklab.evaluate"
] | [((329, 416), 'stocklab.evaluate', 'stocklab.evaluate', (['f"""tendency.{args.mode}.{args.stock_id}.{args.date}.{args.days}"""'], {}), "(\n f'tendency.{args.mode}.{args.stock_id}.{args.date}.{args.days}')\n", (346, 416), False, 'import stocklab\n'), ((483, 500), 'numpy.linalg.norm', 'np.linalg.norm', (['v'], {}), '(... |
# Copyright 2019 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agre... | [
"numpy.trace",
"numpy.sum",
"numpy.abs",
"numpy.empty",
"numpy.allclose",
"numpy.einsum",
"numpy.arccosh",
"numpy.shape",
"numpy.sin",
"numpy.arange",
"numpy.exp",
"numpy.diag",
"numpy.matrix.trace",
"thewalrus.quantum.density_matrix",
"numpy.meshgrid",
"thewalrus.symplectic.rotation",... | [((16512, 16523), 'numpy.array', 'np.array', (['y'], {}), '(y)\n', (16520, 16523), True, 'import numpy as np\n'), ((17283, 17294), 'numpy.array', 'np.array', (['y'], {}), '(y)\n', (17291, 17294), True, 'import numpy as np\n'), ((22080, 22127), 'numpy.reshape', 'np.reshape', (['probs', '([self._cutoff] * self._modes)'],... |
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# reduce_prod paddle model generator
#
import numpy as np
import sys
from save_model import saveModel
def reduce_prod(name : str, x, axis=None, keepdim=False):
import paddle
paddle.enable_static()
with paddle.static.pro... | [
"paddle.static.data",
"paddle.prod",
"paddle.static.cpu_places",
"paddle.enable_static",
"paddle.static.Program",
"save_model.saveModel",
"numpy.array",
"paddle.static.Executor",
"paddle.static.default_startup_program"
] | [((270, 292), 'paddle.enable_static', 'paddle.enable_static', ([], {}), '()\n', (290, 292), False, 'import paddle\n'), ((399, 457), 'paddle.static.data', 'paddle.static.data', ([], {'name': '"""x"""', 'shape': 'x.shape', 'dtype': 'x.dtype'}), "(name='x', shape=x.shape, dtype=x.dtype)\n", (417, 457), False, 'import padd... |
import heterocl as hcl
import numpy as np
import hlib
import numpy.testing as tst
def _test_transpose(shape, axes):
hcl.init()
I = hcl.placeholder(shape)
def transpose(I, axes=axes):
return hlib.op.nn.transpose(I, axes)
s = hcl.create_schedule([I], transpose)
f = hcl.build(s)
data = np... | [
"numpy.zeros",
"hlib.op.nn.transpose",
"heterocl.placeholder",
"numpy.random.randint",
"heterocl.build",
"heterocl.create_schedule",
"heterocl.init",
"heterocl.asarray"
] | [((121, 131), 'heterocl.init', 'hcl.init', ([], {}), '()\n', (129, 131), True, 'import heterocl as hcl\n'), ((140, 162), 'heterocl.placeholder', 'hcl.placeholder', (['shape'], {}), '(shape)\n', (155, 162), True, 'import heterocl as hcl\n'), ((250, 285), 'heterocl.create_schedule', 'hcl.create_schedule', (['[I]', 'trans... |
from pathlib import Path
import torch
import torch.utils.data
import numpy as np
import random
from utils.utils import get_conditions
from settings import *
class UnetInput(torch.utils.data.Dataset):
def __init__(self, state):
self.SPECTROGRAM_DIRECTORY = os.path.join(MUSDB_SPLITS_PATH, state)
sel... | [
"numpy.load",
"numpy.sum",
"random.shuffle",
"numpy.angle",
"utils.utils.get_conditions",
"numpy.zeros",
"numpy.prod",
"numpy.nonzero",
"numpy.finfo",
"pathlib.Path",
"numpy.delete",
"numpy.concatenate",
"torch.from_numpy"
] | [((464, 503), 'numpy.load', 'np.load', (["(FILTERED_SAMPLE_PATHS + '.npy')"], {}), "(FILTERED_SAMPLE_PATHS + '.npy')\n", (471, 503), True, 'import numpy as np\n'), ((864, 895), 'random.shuffle', 'random.shuffle', (['self.input_list'], {}), '(self.input_list)\n', (878, 895), False, 'import random\n'), ((1086, 1114), 'nu... |
import errno
import os
import matplotlib
matplotlib.use("Agg")
import dicom, dicom.UID
from dicom.dataset import Dataset, FileDataset
import numpy as np
import datetime, time
from scipy.ndimage.morphology import binary_fill_holes
import scipy.misc
import tensorflow as tf
import random
import SegNetCMR as sn
import nump... | [
"tensorflow.train.SessionManager",
"SegNetCMR.GetData",
"tensorflow.ConfigProto",
"matplotlib.pyplot.figure",
"tensorflow.global_variables",
"numpy.round",
"os.path.join",
"os.path.dirname",
"mpl_toolkits.mplot3d.art3d.Poly3DCollection",
"cv2.resize",
"matplotlib.pyplot.show",
"os.path.basenam... | [((41, 62), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (55, 62), False, 'import matplotlib\n'), ((1177, 1217), 'os.path.join', 'os.path.join', (['ROOT_LOG_DIR', 'RUN_NAME_CT1'], {}), '(ROOT_LOG_DIR, RUN_NAME_CT1)\n', (1189, 1217), False, 'import os\n'), ((1232, 1272), 'os.path.join', 'os.path... |
# standard
import numpy as np
import numpy.random as nr
import pandas as pd
# first party
from delphi_changehc.config import Config
from delphi_changehc.load_data import load_combined_data
from delphi_changehc.sensor import CHCSensor
CONFIG = Config()
PARAMS = {
"indicator": {
"input_denom_file": "test_da... | [
"delphi_changehc.load_data.load_combined_data",
"pandas.date_range",
"delphi_changehc.sensor.CHCSensor.fit",
"numpy.isnan",
"numpy.nanmin",
"numpy.min",
"numpy.max",
"numpy.array",
"pandas.to_datetime",
"delphi_changehc.config.Config",
"numpy.array_equal",
"delphi_changehc.sensor.CHCSensor.bac... | [((245, 253), 'delphi_changehc.config.Config', 'Config', ([], {}), '()\n', (251, 253), False, 'from delphi_changehc.config import Config\n'), ((610, 658), 'pandas.to_datetime', 'pd.to_datetime', (["PARAMS['indicator']['drop_date']"], {}), "(PARAMS['indicator']['drop_date'])\n", (624, 658), True, 'import pandas as pd\n'... |
import copy
import glob
import hashlib
import math
import os
import random
import re
import numpy as np
import torch
__all__ = ["setup_seed", "save_ckpt", "Meter", "ModelEMA", "find_ckpts",
"reduce_weights"]
def setup_seed(seed):
torch.manual_seed(seed)
random.seed(seed)
np.random.seed(seed)
... | [
"copy.deepcopy",
"math.exp",
"numpy.random.seed",
"torch.manual_seed",
"torch.save",
"re.findall",
"random.seed",
"os.path.splitext",
"glob.glob",
"torch.device",
"torch.no_grad",
"os.path.split"
] | [((249, 272), 'torch.manual_seed', 'torch.manual_seed', (['seed'], {}), '(seed)\n', (266, 272), False, 'import torch\n'), ((277, 294), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (288, 294), False, 'import random\n'), ((299, 319), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (313, 31... |
import numpy as np
import os
# imports for type hinting
from typing import Any, Tuple, TYPE_CHECKING
if TYPE_CHECKING:
from .network import Network
from functools import wraps
try:
from . import plotting # will perform the correct setup for matplotlib before it is called below
import matplotlib.pyplot ... | [
"numpy.linalg.eigvals",
"numpy.load",
"numpy.abs",
"numpy.amin",
"numpy.empty",
"numpy.linalg.qr",
"numpy.angle",
"numpy.linalg.cond",
"numpy.shape",
"numpy.imag",
"numpy.linalg.svd",
"numpy.linalg.norm",
"matplotlib.pyplot.gca",
"numpy.diag",
"numpy.conjugate",
"matplotlib.ticker.EngF... | [((760, 771), 'functools.wraps', 'wraps', (['func'], {}), '(func)\n', (765, 771), False, 'from functools import wraps\n'), ((4775, 4957), 'warnings.warn', 'warnings.warn', (['"""Attribute `zeros` is deprecated and will be removed in a future version. Please use the new attribute `residues` instead."""', 'DeprecationWar... |
import matplotlib.pyplot as plt
import matplotlib.image as img
import skimage
import cv2
import uuid
from skimage.transform import rescale, resize, downscale_local_mean
import os
import sys
import random
import math
import re
import time
import numpy as np
import tensorflow as tf
import matplotlib
import matplotlib... | [
"sys.path.append",
"mrcnn.utils.download_trained_weights",
"os.path.abspath",
"skimage.transform.rescale",
"matplotlib.pyplot.imshow",
"numpy.empty",
"tensorflow.device",
"os.path.exists",
"matplotlib.pyplot.subplots",
"numpy.max",
"numpy.rint",
"skimage.transform.resize",
"os.path.join",
... | [((2606, 2627), 'os.path.abspath', 'os.path.abspath', (['"""./"""'], {}), "('./')\n", (2621, 2627), False, 'import os\n'), ((2628, 2653), 'sys.path.append', 'sys.path.append', (['ROOT_DIR'], {}), '(ROOT_DIR)\n', (2643, 2653), False, 'import sys\n'), ((2666, 2696), 'os.path.join', 'os.path.join', (['ROOT_DIR', '"""logs"... |
# Copyright 2019 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | [
"numpy.array",
"numpy.round",
"numpy.zeros",
"numpy.full"
] | [((2613, 2658), 'numpy.zeros', 'np.zeros', ([], {'shape': '(max_voxels,)', 'dtype': 'np.int32'}), '(shape=(max_voxels,), dtype=np.int32)\n', (2621, 2658), True, 'import numpy as np\n'), ((2673, 2751), 'numpy.zeros', 'np.zeros', ([], {'shape': '(max_voxels, max_points, points.shape[-1])', 'dtype': 'points.dtype'}), '(sh... |
from config import SOMConfig as Config
import numpy as np # type: ignore
import matplotlib.pyplot as plt # type: ignore
import util
window_size = 5
dpi = 100
node_radius = 0.1
# b_init = 10
# b_growth = 1.005
# b_ceil = 1000
b_init = 10.0
alpha = 0.03
# b_ceil = 1000
# mu = 1.0
mu = 0.6
iter_lim = 200
record_moment... | [
"numpy.abs",
"matplotlib.pyplot.figure",
"numpy.sin",
"numpy.arange",
"numpy.exp",
"numpy.genfromtxt",
"numpy.max",
"numpy.linspace",
"util.dist",
"matplotlib.pyplot.get_fignums",
"matplotlib.pyplot.pause",
"numpy.random.shuffle",
"numpy.average",
"numpy.min",
"numpy.cos",
"matplotlib.... | [((323, 349), 'numpy.arange', 'np.arange', (['(0)', 'iter_lim', '(10)'], {}), '(0, iter_lim, 10)\n', (332, 349), True, 'import numpy as np\n'), ((1455, 1484), 'numpy.random.shuffle', 'np.random.shuffle', (['city_array'], {}), '(city_array)\n', (1472, 1484), True, 'import numpy as np\n'), ((3792, 3827), 'numpy.linspace'... |
# Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | [
"tensorflow_probability.python.distributions.Bernoulli",
"numpy.log",
"tensorflow.compat.v2.nn.sigmoid",
"tensorflow.compat.v2.identity",
"tensorflow.compat.v2.convert_to_tensor",
"tensorflow_probability.python.internal.dtype_util.common_dtype",
"tensorflow.compat.v1.name_scope",
"tensorflow_probabili... | [((9383, 9399), 'tensorflow.compat.v2.nn.sigmoid', 'tf.nn.sigmoid', (['r'], {}), '(r)\n', (9396, 9399), True, 'import tensorflow.compat.v2 as tf\n'), ((10576, 10585), 'tensorflow.compat.v2.exp', 'tf.exp', (['r'], {}), '(r)\n', (10582, 10585), True, 'import tensorflow.compat.v2 as tf\n'), ((11001, 11018), 'tensorflow.co... |
#!/usr/bin/env python
import numpy as np
import sklearn
from sklearn.preprocessing import LabelEncoder
import pickle
from sensor_stick.srv import GetNormals
from sensor_stick.features import compute_color_histograms
from sensor_stick.features import compute_normal_histograms
from visualization_msgs.msg import Marker... | [
"pcl_helper.ros_to_pcl",
"filtering.visualize_clusters",
"sensor_stick.features.compute_normal_histograms",
"pcl_helper.pcl_to_ros",
"sensor_stick.features.compute_color_histograms",
"pcl_helper.XYZRGB_to_XYZ",
"filtering.pass_through_filter",
"sklearn.preprocessing.LabelEncoder",
"sensor_stick.msg.... | [((1980, 2008), 'pcl_helper.ros_to_pcl', 'pclh.ros_to_pcl', (['ros_pcl_msg'], {}), '(ros_pcl_msg)\n', (1995, 2008), True, 'import pcl_helper as pclh\n'), ((2073, 2113), 'filtering.statistical_outlier_filter', 'flt.statistical_outlier_filter', (['pcl_data'], {}), '(pcl_data)\n', (2103, 2113), True, 'import filtering as ... |
#!/usr/bin/env python3
"""
Creates a language model for generating prose.
"""
__author__ = "<NAME> <<EMAIL>>"
__copyright__ = "Copyright (C) 2018 <NAME>"
__license__ = "Apache License, Version 2.0"
import argparse
import csv
import os
import random
import tempfile
from typing import Any, Callable, Dict, Sequence, Tu... | [
"numpy.load",
"numpy.random.seed",
"argparse.ArgumentParser",
"csv.reader",
"random.shuffle",
"numpy.isnan",
"os.path.join",
"tempfile.TemporaryDirectory",
"os.path.dirname",
"random.seed",
"numpy.save",
"keras.callbacks.ModelCheckpoint",
"os.path.commonpath",
"numpy.isinf",
"keras.optim... | [((2484, 2496), 'keras.models.Sequential', 'Sequential', ([], {}), '()\n', (2494, 2496), False, 'from keras.models import Sequential\n'), ((2785, 2801), 'keras.optimizers.RMSprop', 'RMSprop', ([], {'lr': '(0.01)'}), '(lr=0.01)\n', (2792, 2801), False, 'from keras.optimizers import RMSprop\n'), ((3444, 3514), 'os.path.j... |
import os
import random
import tempfile
from typing import Tuple
import numpy as np
import pytest
import torch
from pytorch_lightning.loggers import CSVLogger
from pytorch_lightning.loggers import LoggerCollection
from pytorch_lightning.loggers import MLFlowLogger
from pytorch_lightning.loggers import TensorBoardLogge... | [
"biome.text.Trainer",
"json.load",
"numpy.random.seed",
"torch.manual_seed",
"biome.text.VocabularyConfiguration",
"tempfile.gettempdir",
"random.seed",
"biome.text.configuration.TrainerConfiguration",
"pytest.approx",
"biome.text.Pipeline.from_config"
] | [((2977, 2992), 'random.seed', 'random.seed', (['(43)'], {}), '(43)\n', (2988, 2992), False, 'import random\n'), ((2997, 3015), 'numpy.random.seed', 'np.random.seed', (['(43)'], {}), '(43)\n', (3011, 3015), True, 'import numpy as np\n'), ((3020, 3041), 'torch.manual_seed', 'torch.manual_seed', (['(43)'], {}), '(43)\n',... |
import numpy as np
import pandas as pd
from tconfig.core.data import (
Value,
Parameter,
ParameterSet,
ConfigurationSet,
DEFAULT_NDARRAY_TYPE,
)
RED = Value("Red")
GREEN = Value("Green")
BLUE = Value("Blue")
BIRD = Value("Bird")
CAT = Value("Cat")
DOG = Value("Dog")
FISH = Value("Fish")
FAST = V... | [
"pandas.DataFrame",
"pandas.Series.equals",
"tconfig.core.data.ConfigurationSet",
"tconfig.core.data.ParameterSet",
"numpy.array",
"pandas.Series",
"tconfig.core.data.ConfigurationSet.dataframe_to_covering_array",
"numpy.array_equal",
"tconfig.core.data.Parameter",
"tconfig.core.data.Value"
] | [((173, 185), 'tconfig.core.data.Value', 'Value', (['"""Red"""'], {}), "('Red')\n", (178, 185), False, 'from tconfig.core.data import Value, Parameter, ParameterSet, ConfigurationSet, DEFAULT_NDARRAY_TYPE\n'), ((194, 208), 'tconfig.core.data.Value', 'Value', (['"""Green"""'], {}), "('Green')\n", (199, 208), False, 'fro... |
import os
import numpy as np
import pandas as pd
import pytest
from janitor.testing_utils import date_data
TEST_DATA_DIR = "tests/test_data"
EXAMPLES_DIR = "examples/"
@pytest.fixture
def dataframe():
data = {
"a": [1, 2, 3] * 3,
"Bell__Chart": [1.234_523_45, 2.456_234, 3.234_612_5] * 3,
... | [
"pandas.DataFrame",
"numpy.random.seed",
"pandas.read_csv",
"numpy.random.choice",
"os.path.join"
] | [((491, 509), 'pandas.DataFrame', 'pd.DataFrame', (['data'], {}), '(data)\n', (503, 509), True, 'import pandas as pd\n'), ((573, 634), 'pandas.DataFrame', 'pd.DataFrame', (['date_data.date_list'], {'columns': "['AMOUNT', 'DATE']"}), "(date_data.date_list, columns=['AMOUNT', 'DATE'])\n", (585, 634), True, 'import pandas... |
from __future__ import absolute_import, print_function, division
import theano
import theano.tensor as T
import numpy as np
class Model(object):
def __init__(self, name=""):
self.name = name
self.layers = []
self.params = []
self.other_updates = {}
def add_layer(self, layer):... | [
"theano.tensor.tanh",
"theano.tensor.dot",
"numpy.zeros",
"theano.scan",
"theano.shared",
"numpy.sqrt"
] | [((1146, 1191), 'theano.shared', 'theano.shared', (['weight_inialization'], {'name': 'name'}), '(weight_inialization, name=name)\n', (1159, 1191), False, 'import theano\n'), ((1462, 1507), 'theano.shared', 'theano.shared', (['bias_initialization'], {'name': 'name'}), '(bias_initialization, name=name)\n', (1475, 1507), ... |
# coding: utf-8
# pylint: disable=no-member
"""Online evaluation metric module."""
from __future__ import absolute_import
import numpy
from . import ndarray
def check_label_shapes(labels, preds, shape=0):
"""Check to see if the two arrays are the same size."""
if shape == 0:
label_shape, pred_shape ... | [
"numpy.abs",
"numpy.log",
"numpy.maximum",
"numpy.argmax",
"numpy.arange",
"numpy.exp",
"numpy.int64",
"numpy.unique"
] | [((8453, 8474), 'numpy.exp', 'numpy.exp', (['(loss / num)'], {}), '(loss / num)\n', (8462, 8474), False, 'import numpy\n'), ((5931, 5957), 'numpy.argmax', 'numpy.argmax', (['pred'], {'axis': '(1)'}), '(pred, axis=1)\n', (5943, 5957), False, 'import numpy\n'), ((6022, 6041), 'numpy.unique', 'numpy.unique', (['label'], {... |
# coding=utf-8
# Copyright 2022 The REALM authors and The HuggingFace Inc. team.
#
# 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 ... | [
"torch.nn.Dropout",
"torch.nn.Embedding",
"torch.cat",
"torch.arange",
"torch.device",
"torch.ones",
"os.path.abspath",
"re.fullmatch",
"numpy.transpose",
"torch.nn.LayerNorm",
"torch.nn.Linear",
"torch.zeros",
"torch.matmul",
"torch.logsumexp",
"torch.topk",
"re.split",
"math.sqrt",... | [((2637, 2672), 'os.path.abspath', 'os.path.abspath', (['tf_checkpoint_path'], {}), '(tf_checkpoint_path)\n', (2652, 2672), False, 'import os\n'), ((2790, 2822), 'tensorflow.train.list_variables', 'tf.train.list_variables', (['tf_path'], {}), '(tf_path)\n', (2813, 2822), True, 'import tensorflow as tf\n'), ((2973, 3010... |
import torch
from torch.autograd import Variable
import utils
import dataset
from PIL import Image
import cv2 as cv
import os
import numpy as np
import models.crnn as crnn
debug = False
model_path = './data/crnn.pth'
gt_path = './data/res/'
img_path = '/data/home/zjw/pythonFile/masktextspotter.caffe2/lib/datasets/dat... | [
"models.crnn.CRNN",
"cv2.cvtColor",
"torch.autograd.Variable",
"torch.load",
"utils.strLabelConverter",
"dataset.resizeNormalize",
"cv2.imread",
"torch.cuda.is_available",
"numpy.array",
"PIL.Image.fromarray"
] | [((405, 430), 'models.crnn.CRNN', 'crnn.CRNN', (['(32)', '(1)', '(37)', '(256)'], {}), '(32, 1, 37, 256)\n', (414, 430), True, 'import models.crnn as crnn\n'), ((434, 459), 'torch.cuda.is_available', 'torch.cuda.is_available', ([], {}), '()\n', (457, 459), False, 'import torch\n'), ((600, 633), 'utils.strLabelConverter... |
'''
file CompMatrix.py
@author <NAME>
@copyright Copyright © UCLouvain 2020
multiflap is a Python tool for finding periodic orbits and assess their stability via the Floquet multipliers.
Copyright <2020> <Université catholique de Louvain (UCLouvain), Belgique>
List of the contributors to the development of multiflap... | [
"numpy.array"
] | [((1006, 1049), 'numpy.array', 'np.array', (['[[k, 0, 0], [0, 1, 0], [0, 0, 1]]'], {}), '([[k, 0, 0], [0, 1, 0], [0, 0, 1]])\n', (1014, 1049), True, 'import numpy as np\n'), ((1128, 1171), 'numpy.array', 'np.array', (['[[1, 0, 0], [0, k, 0], [0, 0, 1]]'], {}), '([[1, 0, 0], [0, k, 0], [0, 0, 1]])\n', (1136, 1171), True... |
# Lint as: python2, python3
# Copyright 2020 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
#
... | [
"tensorflow.compat.v1.unstack",
"tensorflow.compat.v1.train.Features",
"object_detection.utils.dataset_util.int64_list_feature",
"object_detection.utils.dataset_util.bytes_list_feature",
"tensorflow.compat.v1.resource_loader.get_data_files_path",
"object_detection.dataset_tools.seq_example_util.make_seque... | [((1448, 1504), 'os.path.join', 'os.path.join', (['parent_path', '"""data"""', '"""pet_label_map.pbtxt"""'], {}), "(parent_path, 'data', 'pet_label_map.pbtxt')\n", (1460, 1504), False, 'import os\n'), ((9419, 9433), 'tensorflow.compat.v1.test.main', 'tf.test.main', ([], {}), '()\n', (9431, 9433), True, 'import tensorfl... |
'''
Methods to identify regions of interest in images.
'''
from skimage.filters import threshold_otsu
from scipy.signal import argrelextrema
import matplotlib.pyplot as plt
from . import superpixels
from sklearn.cluster import KMeans
import numpy as np
def bubbles_from_slic(data, n_segments=5000, bins='knuth'):
"""
... | [
"sklearn.cluster.KMeans",
"numpy.zeros",
"numpy.unique",
"numpy.ones_like"
] | [((3184, 3204), 'numpy.zeros', 'np.zeros', (['cube.shape'], {}), '(cube.shape)\n', (3192, 3204), True, 'import numpy as np\n'), ((3813, 3848), 'sklearn.cluster.KMeans', 'KMeans', ([], {'n_clusters': '(3)', 'n_jobs': 'n_jobs'}), '(n_clusters=3, n_jobs=n_jobs)\n', (3819, 3848), False, 'from sklearn.cluster import KMeans\... |
import json
import math
import numpy as np
import os
import sys
import time
from jinja2 import Environment, FileSystemLoader
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
board_sizes = { 5 : 11, 6 : 13, 7 : 15 } # Rings : Board Size
display_size = { 5 : 650, 6 : 750, 7 : 850 } #... | [
"os.path.abspath",
"selenium.webdriver.chrome.options.Options",
"selenium.webdriver.common.action_chains.ActionChains",
"math.radians",
"numpy.array",
"selenium.webdriver.Chrome",
"os.path.join"
] | [((360, 385), 'os.path.abspath', 'os.path.abspath', (['__file__'], {}), '(__file__)\n', (375, 385), False, 'import os\n'), ((1358, 1367), 'selenium.webdriver.chrome.options.Options', 'Options', ([], {}), '()\n', (1365, 1367), False, 'from selenium.webdriver.chrome.options import Options\n'), ((1527, 1574), 'selenium.we... |
"""
Copyright (c) 2018-2021 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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... | [
"numpy.ones",
"cv2.warpAffine",
"numpy.mean",
"numpy.linalg.svd",
"numpy.diag",
"numpy.pad",
"numpy.full",
"numpy.std",
"cv2.copyMakeBorder",
"numpy.finfo",
"numpy.linalg.matrix_rank",
"cv2.estimateAffinePartial2D",
"numpy.linalg.det",
"cv2.resize",
"numpy.ceil",
"numpy.hstack",
"ski... | [((1242, 1306), 'collections.namedtuple', 'namedtuple', (['"""GeometricOperationMetadata"""', "['type', 'parameters']"], {}), "('GeometricOperationMetadata', ['type', 'parameters'])\n", (1252, 1306), False, 'from collections import namedtuple\n'), ((2215, 2246), 'cv2.flip', 'cv2.flip', (['image.data', 'self.mode'], {})... |
import numpy as np
import requests
import twitter_bot_utils as tbu
import os
def tweet_image(url, message):
# Automatically check for a config file in the above-named directories
twitter = tbu.API(screen_name='traffic_west')
filename = '/tmp/temp.jpg'
request = requests.get(url, stream=True)
if ... | [
"numpy.random.choice",
"os.remove",
"requests.get",
"twitter_bot_utils.API"
] | [((201, 236), 'twitter_bot_utils.API', 'tbu.API', ([], {'screen_name': '"""traffic_west"""'}), "(screen_name='traffic_west')\n", (208, 236), True, 'import twitter_bot_utils as tbu\n'), ((282, 312), 'requests.get', 'requests.get', (['url'], {'stream': '(True)'}), '(url, stream=True)\n', (294, 312), False, 'import reques... |
import os
import sys
import h5py
import random
from math import sqrt, copysign
import numpy as np
from common import production_assert
from Vec3d import Vec3d
from Particle import Particle
class ParticleSource():
def __init__( self ):
pass
@classmethod
def init_from_config( cls, conf, this_sourc... | [
"math.sqrt",
"os.path.basename",
"random.uniform",
"numpy.empty_like",
"random.getstate",
"random.seed",
"Particle.Particle",
"random.setstate",
"random.gauss",
"Vec3d.Vec3d"
] | [((908, 925), 'random.getstate', 'random.getstate', ([], {}), '()\n', (923, 925), False, 'import random\n'), ((934, 947), 'random.seed', 'random.seed', ([], {}), '()\n', (945, 947), False, 'import random\n'), ((1009, 1026), 'random.getstate', 'random.getstate', ([], {}), '()\n', (1024, 1026), False, 'import random\n'),... |
# -*- coding: utf-8 -*-
import cv2
import numpy as np
from yolo.utils.visualization_utils import \
visualize_boxes_and_labels_on_image_array
def correct_yolo_boxes(boxes, image_h, image_w):
"""
# Args
boxes : array, shape of (N, 4)
[0, 1]-scaled box
# Returns
... | [
"numpy.zeros_like",
"yolo.utils.visualization_utils.visualize_boxes_and_labels_on_image_array",
"numpy.argmax",
"numpy.argsort",
"numpy.array",
"cv2.rectangle"
] | [((5721, 5748), 'numpy.zeros_like', 'np.zeros_like', (['minmax_boxes'], {}), '(minmax_boxes)\n', (5734, 5748), True, 'import numpy as np\n'), ((6162, 6191), 'numpy.zeros_like', 'np.zeros_like', (['centroid_boxes'], {}), '(centroid_boxes)\n', (6175, 6191), True, 'import numpy as np\n'), ((6844, 6859), 'numpy.array', 'np... |
import gym_roboticArm
# Purpose is to develop QLearning algorithm with CartPole environment
import gym
import numpy as np
from tqdm import tqdm
import os
from time import sleep
import tensorflow as tf
import matplotlib.pyplot as plt
from random import random
# env = gym.make("CartPole-v0")
env = gym.make('roboticArm-... | [
"numpy.load",
"matplotlib.pyplot.show",
"gym.make",
"matplotlib.pyplot.plot",
"numpy.argmax",
"numpy.zeros",
"os.path.exists",
"time.sleep",
"numpy.max",
"numpy.linspace",
"numpy.digitize"
] | [((299, 324), 'gym.make', 'gym.make', (['"""roboticArm-v0"""'], {}), "('roboticArm-v0')\n", (307, 324), False, 'import gym\n'), ((4434, 4466), 'matplotlib.pyplot.plot', 'plt.plot', (['reward_list'], {'color': '"""b"""'}), "(reward_list, color='b')\n", (4442, 4466), True, 'import matplotlib.pyplot as plt\n'), ((5900, 59... |
import numpy as np
import matplotlib.pyplot as plt
import helpers as helpers
import filters as filters
# --------------------------------------------------------------------------------------------------------------------
# Read the File / Load data:
# ---------------------------------------------------------... | [
"matplotlib.pyplot.show",
"numpy.zeros",
"numpy.rad2deg",
"filters.KalmanFilter",
"matplotlib.pyplot.subplots",
"helpers.get_data_from_file"
] | [((434, 485), 'helpers.get_data_from_file', 'helpers.get_data_from_file', (['file_name'], {'degrees': '(True)'}), '(file_name, degrees=True)\n', (460, 485), True, 'import helpers as helpers\n'), ((753, 769), 'numpy.zeros', 'np.zeros', (['(3, 1)'], {}), '((3, 1))\n', (761, 769), True, 'import numpy as np\n'), ((1002, 10... |
import numpy as np
from numpy.fft import fft, ifft
from sympy import Poly, GF
from sympy.abc import x
# https://github.com/popcornell/pyGF2
def strip_zeros(a):
'''
Strip un-necessary leading (rightmost) zeroes
from a polynomial
'''
return np.trim_zeros(a, trim='b')
def deg(a: np.ndarray):
''... | [
"numpy.full",
"numpy.fft.ifft",
"numpy.trim_zeros",
"numpy.roll",
"numpy.fft.fft",
"numpy.log2",
"numpy.zeros",
"sympy.GF",
"numpy.where",
"numpy.array",
"numpy.exp",
"numpy.real",
"numpy.convolve",
"numpy.all",
"numpy.repeat"
] | [((261, 287), 'numpy.trim_zeros', 'np.trim_zeros', (['a'], {'trim': '"""b"""'}), "(a, trim='b')\n", (274, 287), True, 'import numpy as np\n'), ((2650, 2680), 'numpy.zeros', 'np.zeros', (['size'], {'dtype': 'np.uint8'}), '(size, dtype=np.uint8)\n', (2658, 2680), True, 'import numpy as np\n'), ((5643, 5688), 'numpy.zeros... |
from module.Configuration import Configuration
from module.Evaluation import Evaluation
# from module.Cluster import Cluster
from dask.distributed import Client
import pandas as pd
import numpy as np
import logging
from module import labeling
from sklearn.ensemble import RandomForestClassifier
from sklearn import metri... | [
"pandas.DataFrame",
"sklearn.ensemble.RandomForestClassifier",
"dask.distributed.Client",
"pandas.read_csv",
"module.labeling.SimpleConfig",
"sklearn.metrics.accuracy_score",
"collections.defaultdict",
"numpy.mean",
"module.Evaluation.Evaluation",
"module.Configuration.Configuration",
"sklearn.u... | [((447, 491), 'pandas.read_csv', 'pd.read_csv', (['file'], {'sep': '""";"""', 'index_col': '"""name"""'}), "(file, sep=';', index_col='name')\n", (458, 491), True, 'import pandas as pd\n'), ((614, 660), 'module.Configuration.Configuration', 'Configuration', ([], {'window_size': '(20)', 'window_step': '(5.0)'}), '(windo... |
import os
import argparse
import numpy as np
import torch
from torch.utils.data import Dataset
class SmallSynthData(Dataset):
def __init__(self, data_path, mode, params):
self.mode = mode
self.data_path = data_path
if self.mode == 'train':
path = os.path.join(data_path, 'train... | [
"numpy.stack",
"numpy.random.uniform",
"numpy.random.seed",
"argparse.ArgumentParser",
"torch.load",
"torch.FloatTensor",
"torch.cat",
"torch.save",
"numpy.array",
"numpy.linalg.norm",
"os.path.join",
"torch.atan2",
"numpy.concatenate"
] | [((4046, 4071), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (4069, 4071), False, 'import argparse\n'), ((4545, 4562), 'numpy.random.seed', 'np.random.seed', (['(1)'], {}), '(1)\n', (4559, 4562), True, 'import numpy as np\n'), ((6290, 6308), 'numpy.stack', 'np.stack', (['all_data'], {}), '(al... |
import cv2 as cv
import numpy as np
import time
dataset = 'COCO'
if dataset == 'COCO':
BODY_PARTS = {"Nose": 0, "Neck": 1, "RShoulder": 2, "RElbow": 3, "RWrist": 4,
"LShoulder": 5, "LElbow": 6, "LWrist": 7, "RHip": 8, "RKnee": 9,
"RAnkle": 10, "LHip": 11, "LKnee": 12, "LAnkle": 1... | [
"cv2.getTickFrequency",
"cv2.waitKey",
"cv2.dnn.blobFromImage",
"time.time",
"cv2.VideoCapture",
"numpy.int32",
"cv2.dnn.readNetFromCaffe",
"cv2.minMaxLoc",
"cv2.imshow"
] | [((1598, 1609), 'time.time', 'time.time', ([], {}), '()\n', (1607, 1609), False, 'import time\n'), ((1729, 1767), 'cv2.dnn.readNetFromCaffe', 'cv.dnn.readNetFromCaffe', (['protoc', 'model'], {}), '(protoc, model)\n', (1752, 1767), True, 'import cv2 as cv\n'), ((1848, 1866), 'cv2.VideoCapture', 'cv.VideoCapture', (['(0)... |
# -*- coding: utf-8 -*-
"""Arsenal classifier.
kernel based ensemble of ROCKET classifiers.
"""
__author__ = ["MatthewMiddlehurst", "kachayev"]
__all__ = ["Arsenal"]
import time
import numpy as np
from joblib import Parallel, delayed
from sklearn.linear_model import RidgeClassifierCV
from sklearn.pipeline import ma... | [
"sktime.transformations.panel.rocket.Rocket",
"sklearn.pipeline.make_pipeline",
"sklearn.utils.check_random_state",
"numpy.sum",
"sklearn.preprocessing.StandardScaler",
"sktime.transformations.panel.rocket.MultiRocketMultivariate",
"numpy.logspace",
"numpy.zeros",
"numpy.ones",
"numpy.iinfo",
"t... | [((6013, 6024), 'time.time', 'time.time', ([], {}), '()\n', (6022, 6024), False, 'import time\n'), ((9843, 9880), 'sklearn.utils.check_random_state', 'check_random_state', (['self.random_state'], {}), '(self.random_state)\n', (9861, 9880), False, 'from sklearn.utils import check_random_state\n'), ((10986, 11023), 'skti... |
from typing import List, Union
import numpy as np
from .baserecording import BaseRecording, BaseRecordingSegment
class ChannelSliceRecording(BaseRecording):
"""
Class to slice a Recording object based on channel_ids.
Do not use this class directly but use `recording.channel_slice(...)`
"""
de... | [
"numpy.asarray"
] | [((658, 681), 'numpy.asarray', 'np.asarray', (['channel_ids'], {}), '(channel_ids)\n', (668, 681), True, 'import numpy as np\n'), ((718, 749), 'numpy.asarray', 'np.asarray', (['renamed_channel_ids'], {}), '(renamed_channel_ids)\n', (728, 749), True, 'import numpy as np\n')] |
# 6-DOF full nonlinear model for F-16 aircraft
# ---- State Variables --------
# x = [ vt ( ft/sec ) - velocity
# alpha ( rad ) - angle of attack
# beta ( rad ) - sideslip angle
# phi ( rad ) - Euler angle
# theta ( rad ) - Euler angle
# psi ( rad ... | [
"math.asin",
"math.atan2",
"tgear.tgear",
"numpy.sin",
"dldr.dldr",
"dlda.dlda",
"cz.cz",
"dndr.dndr",
"thrust.thrust",
"cn.cn",
"dnda.dnda",
"pdot.pdot",
"numpy.cos",
"cx.cx",
"cl.cl",
"damping.damping",
"cy.cy",
"cm.cm",
"adc.adc"
] | [((3044, 3056), 'adc.adc', 'adc', (['vt', 'alt'], {}), '(vt, alt)\n', (3047, 3056), False, 'from adc import adc\n'), ((3192, 3203), 'tgear.tgear', 'tgear', (['thtl'], {}), '(thtl)\n', (3197, 3203), False, 'from tgear import tgear\n'), ((3221, 3236), 'pdot.pdot', 'pdot', (['pow', 'cpow'], {}), '(pow, cpow)\n', (3225, 32... |
import torch
import logging
from tqdm import tqdm
import numpy as np
import re
from datetime import datetime
from os.path import exists, join
from torch.utils.data import DataLoader
from pathlib import Path
from .base_pipeline import BasePipeline
from ..dataloaders import TorchDataloader, ConcatBatcher
from torch.ut... | [
"logging.setLogRecordFactory",
"tqdm.tqdm",
"torch.utils.data.get_worker_info",
"logging.FileHandler",
"logging.basicConfig",
"torch.load",
"os.path.exists",
"datetime.datetime.now",
"pathlib.Path",
"numpy.mean",
"re.findall",
"torch.utils.tensorboard.SummaryWriter",
"torch.no_grad",
"os.p... | [((538, 576), 'logging.setLogRecordFactory', 'logging.setLogRecordFactory', (['LogRecord'], {}), '(LogRecord)\n', (565, 576), False, 'import logging\n'), ((577, 686), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO', 'format': '"""%(levelname)s - %(asctime)s - %(module)s - %(message)s"""'}), ... |
import json
import os
from typing import Union, List
from Datasets.Datasets import NumpyDataset
from rdkit.Chem import MolFromSmiles, Mol
from standardizer.CustomStandardizer import CustomStandardizer
from deepsweet_models import PreBuiltModel
from deepsweet_utils import PipelineUtils
from generate_features_rnn impor... | [
"deepsweet_utils.PipelineUtils.filter_valid_sequences",
"numpy.std",
"standardizer.CustomStandardizer.CustomStandardizer",
"numpy.apply_along_axis",
"numpy.mean",
"numpy.array",
"numpy.column_stack",
"numpy.delete"
] | [((1244, 1314), 'deepsweet_utils.PipelineUtils.filter_valid_sequences', 'PipelineUtils.filter_valid_sequences', (['self.models_folder_path', 'dataset'], {}), '(self.models_folder_path, dataset)\n', (1280, 1314), False, 'from deepsweet_utils import PipelineUtils\n'), ((2186, 2224), 'numpy.delete', 'np.delete', (['final_... |
from __future__ import absolute_import
import numpy as np
import time
from PIL import Image
from ..utils.viz import show_frame
class Tracker(object):
def __init__(self, name, is_deterministic=False):
self.name = name
self.is_deterministic = is_deterministic
def init(self, image, box):
... | [
"time.time",
"numpy.zeros",
"PIL.Image.open"
] | [((523, 547), 'numpy.zeros', 'np.zeros', (['(frame_num, 4)'], {}), '((frame_num, 4))\n', (531, 547), True, 'import numpy as np\n'), ((587, 606), 'numpy.zeros', 'np.zeros', (['frame_num'], {}), '(frame_num)\n', (595, 606), True, 'import numpy as np\n'), ((677, 697), 'PIL.Image.open', 'Image.open', (['img_file'], {}), '(... |
r"""
Execute nosetests in all subdirectories, to run a series of quick
regression tests.
Sends output and result/errors to separate files to simplify checking
results and looking for errors.
"""
from __future__ import absolute_import
from __future__ import print_function
import os
import sys
import tempfile
import su... | [
"sys.path.pop",
"numpy.allclose",
"shutil.rmtree",
"os.path.join",
"os.chdir",
"subprocess.check_call",
"setrun.setrun",
"numpy.savetxt",
"os.path.exists",
"tempfile.mkdtemp",
"numpy.loadtxt",
"clawpack.visclaw.gaugetools.read_setgauges",
"time.localtime",
"nose.plugins.skip.SkipTest",
"... | [((671, 688), 'nose.plugins.skip.SkipTest', 'SkipTest', (['message'], {}), '(message)\n', (679, 688), False, 'from nose.plugins.skip import SkipTest\n'), ((708, 716), 'functools.wraps', 'wraps', (['f'], {}), '(f)\n', (713, 716), False, 'from functools import wraps\n'), ((1098, 1109), 'nose.plugins.attrib.attr', 'attr',... |
import cStringIO
import chainer
import imageio
import neural_renderer
import numpy as np
import os
import tqdm
def decode_image(image):
return imageio.imread(cStringIO.StringIO(image)).transpose((2, 0, 1)).astype('float32') / 255.
def process_images(images, threshold=0.1):
# for RGB, rescale from [0, 1] to ... | [
"tqdm.tqdm",
"numpy.load",
"numpy.random.rand",
"numpy.zeros",
"numpy.random.RandomState",
"cStringIO.StringIO",
"numpy.arange",
"chainer.cuda.to_gpu",
"numpy.random.choice",
"numpy.random.permutation",
"neural_renderer.get_points_from_angles",
"os.path.join",
"numpy.repeat"
] | [((1570, 1590), 'tqdm.tqdm', 'tqdm.tqdm', (['class_ids'], {}), '(class_ids)\n', (1579, 1590), False, 'import tqdm\n'), ((2368, 2394), 'numpy.random.RandomState', 'np.random.RandomState', (['num'], {}), '(num)\n', (2389, 2394), True, 'import numpy as np\n'), ((4250, 4279), 'numpy.zeros', 'np.zeros', (['batch_size', '"""... |
"""
Script calculates regressions on sea ice index
Notes
-----
Author : <NAME>
Date : 18 July 2019
"""
### Import modules
import datetime
import numpy as np
import matplotlib.pyplot as plt
import cmocean
from mpl_toolkits.basemap import Basemap, addcyclic, shiftgrid
import read_MonthlyData as MOM
import rea... | [
"numpy.empty",
"numpy.isnan",
"matplotlib.pyplot.figure",
"numpy.arange",
"calc_Utilities.calcDecJanFeb",
"matplotlib.pyplot.tight_layout",
"numpy.nanmean",
"numpy.meshgrid",
"mpl_toolkits.basemap.addcyclic",
"numpy.genfromtxt",
"read_MonthlyData.readDataM",
"matplotlib.pyplot.rc",
"scipy.st... | [((454, 477), 'datetime.datetime.now', 'datetime.datetime.now', ([], {}), '()\n', (475, 477), False, 'import datetime\n'), ((809, 839), 'numpy.arange', 'np.arange', (['year1', '(year2 + 1)', '(1)'], {}), '(year1, year2 + 1, 1)\n', (818, 839), True, 'import numpy as np\n'), ((1643, 1690), 'read_Reanalysis.readDataR', 'M... |
from meta_policy_search.envs.base import MetaEnv
import numpy as np
from gym.spaces import Box
class MetaPointEnvMomentumModes(MetaEnv):
"""
Simple 2D point meta environment. Each meta-task corresponds to a different goal / corner
(one of the 4 points (-2,-2), (-2, 2), (2, -2), (2,2)) which are sampled w... | [
"numpy.random.uniform",
"numpy.maximum",
"numpy.random.randn",
"numpy.clip",
"numpy.hstack",
"numpy.max",
"numpy.random.randint",
"numpy.array",
"gym.spaces.Box",
"numpy.linalg.norm"
] | [((661, 725), 'numpy.array', 'np.array', (['[[-5, -5], [5, -5], [-5, 5], [5, 5]]'], {'dtype': 'np.float32'}), '([[-5, -5], [5, -5], [-5, 5], [5, 5]], dtype=np.float32)\n', (669, 725), True, 'import numpy as np\n'), ((850, 891), 'gym.spaces.Box', 'Box', ([], {'low': '(-np.inf)', 'high': 'np.inf', 'shape': '(4,)'}), '(lo... |
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from mo.front.common.partial_infer.utils import shape_array
from mo.graph.graph import Graph
from mo.middle.passes.convert_data_type import np_data_type_to_destination_type
from mo.ops.op import Op
from mo.utils.error... | [
"mo.middle.passes.convert_data_type.np_data_type_to_destination_type",
"numpy.dtype",
"numpy.array"
] | [((1960, 1986), 'numpy.dtype', 'np.dtype', (['node.output_type'], {}), '(node.output_type)\n', (1968, 1986), True, 'import numpy as np\n'), ((2182, 2227), 'numpy.array', 'np.array', (['input_shape'], {'dtype': 'node.output_type'}), '(input_shape, dtype=node.output_type)\n', (2190, 2227), True, 'import numpy as np\n'), ... |
import numpy as np
import matplotlib.pyplot as plt
import argparse
from keras.callbacks import ModelCheckpoint, TensorBoard
from keras.models import load_model
from tensorflow.keras.optimizers import Adam
from sklearn.utils import shuffle
from time import time
from dataset import *
from model import *
from util imp... | [
"keras.models.load_model",
"matplotlib.pyplot.title",
"numpy.random.seed",
"argparse.ArgumentParser",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"keras.callbacks.ModelCheckpoint",
"matplotlib.pyplot.legend",
"time.time",
"tensorflow.keras.optimizers.Adam",
"matplotlib.pyplot.ylabel",
... | [((353, 378), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (376, 378), False, 'import argparse\n'), ((593, 610), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (607, 610), True, 'import numpy as np\n'), ((5915, 5932), 'numpy.vstack', 'np.vstack', (['x_gyro'], {}), '(x_gyro)\n'... |
"""
泛化到n维,同时传入适应度函数
"""
import numpy as np
import matplotlib.pyplot as plt
import copy as cp
def function(x):
"""
:param x: 自变量
:return: y: 函数值
"""
return 10 + np.sin(1/x)/((x - 0.16)**2+0.1)
# -(x+10*np.sin(5*x)+7*np.cos(4*x))
# x*np.cos(5*np.pi*x)+3.5
def functi... | [
"copy.deepcopy",
"numpy.meshgrid",
"matplotlib.pyplot.show",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.sin",
"numpy.array",
"numpy.arange",
"numpy.cos",
"numpy.random.random",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.subplots"
] | [((10943, 10959), 'numpy.array', 'np.array', (['[-0.5]'], {}), '([-0.5])\n', (10951, 10959), True, 'import numpy as np\n'), ((10961, 10976), 'numpy.array', 'np.array', (['[0.5]'], {}), '([0.5])\n', (10969, 10976), True, 'import numpy as np\n'), ((10982, 10999), 'numpy.array', 'np.array', (['[16, 1]'], {}), '([16, 1])\n... |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
"""
This module defines classes for point defects.
"""
__author__ = "<NAME>, <NAME>"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "1.... | [
"scipy.cluster.hierarchy.fcluster",
"pymatgen.core.periodic_table.get_el_sp",
"pymatgen.core.periodic_table.Element",
"numpy.allclose",
"scipy.cluster.hierarchy.linkage",
"pymatgen.analysis.bond_valence.BVAnalyzer",
"scipy.spatial.Voronoi",
"numpy.ones",
"collections.defaultdict",
"six.moves.zip",... | [((1722, 1749), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1739, 1749), False, 'import logging\n'), ((1762, 1787), 'os.path.dirname', 'os.path.dirname', (['__file__'], {}), '(__file__)\n', (1777, 1787), False, 'import os\n'), ((1799, 1841), 'os.path.join', 'os.path.join', (['file_dir... |
# -*- coding: utf-8 -*-
"""Tests for dataframe `adni` extension."""
# pylint: disable=W0621
# Third party imports
import numpy as np
import pandas as pd
import pytest
from adnipy import adni # noqa: F401 pylint: disable=W0611
@pytest.fixture
def test_df():
"""Provide sample dataframe for standardized testing... | [
"pandas.DataFrame",
"pandas.testing.assert_frame_equal",
"numpy.dtype",
"pytest.raises"
] | [((1041, 1080), 'pandas.DataFrame', 'pd.DataFrame', (['subjects'], {'columns': 'columns'}), '(subjects, columns=columns)\n', (1053, 1080), True, 'import pandas as pd\n'), ((1689, 1737), 'pandas.testing.assert_frame_equal', 'pd.testing.assert_frame_equal', (['correct', 'with_rid'], {}), '(correct, with_rid)\n', (1718, 1... |
import tensorflow as tf
import numpy as np
import cv2
import os
from model import Model
from data_preprocessing import get_dataset_features_in_np
def get_batch(dataset, i, BATCH_SIZE):
'''get a batch of size BATCH_SIZE from dataset
Arguments:
dataset {numpy array} -- dataset from which we want to extract a batch... | [
"numpy.uint8",
"data_preprocessing.get_dataset_features_in_np",
"os.makedirs",
"cv2.cvtColor",
"cv2.imwrite",
"tensorflow.global_variables_initializer",
"model.Model",
"tensorflow.Session",
"os.path.exists",
"tensorflow.placeholder",
"numpy.append",
"tensorflow.losses.huber_loss",
"tensorflo... | [((2157, 2231), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32'], {'shape': '[None, DIM_1, DIM_2, NUM_INPUT_CHANNELS]'}), '(tf.float32, shape=[None, DIM_1, DIM_2, NUM_INPUT_CHANNELS])\n', (2171, 2231), True, 'import tensorflow as tf\n'), ((2236, 2311), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float3... |
import sys
import numpy as np
import time
import uuid
from logger import DEFAULT_FORMAT
from loguru import logger
from n_puzzle_base import NPuzzleBase
# Configuração do Logger
logger.configure(
handlers=[
{
"sink": sys.stdout,
"level": 10,
"format": DEFAULT_FORMAT
... | [
"uuid.uuid4",
"loguru.logger.level",
"loguru.logger.add",
"loguru.logger.configure",
"time.time",
"loguru.logger.info",
"numpy.array",
"loguru.logger.success",
"loguru.logger.debug"
] | [((180, 272), 'loguru.logger.configure', 'logger.configure', ([], {'handlers': "[{'sink': sys.stdout, 'level': 10, 'format': DEFAULT_FORMAT}]"}), "(handlers=[{'sink': sys.stdout, 'level': 10, 'format':\n DEFAULT_FORMAT}])\n", (196, 272), False, 'from loguru import logger\n'), ((371, 443), 'loguru.logger.add', 'logge... |
import os
import logging
import numpy as np
import pandas as pd
import seaborn as sb
import torch
from matplotlib import pyplot as plt
from functools import partial
from simulation.observers import dynamics_traj_observer
from simulation.observer_functions import EKF_ODE
from NN_for_ODEs.NODE_utils import make_init_st... | [
"matplotlib.pyplot.title",
"utils.utils.reshape_pt1",
"NN_for_ODEs.NODE_utils.make_init_state_obs",
"torch.arange",
"matplotlib.pyplot.fill_between",
"torch.no_grad",
"os.path.join",
"pandas.DataFrame",
"torch.flatten",
"matplotlib.pyplot.close",
"utils.utils.list_torch_to_numpy",
"torch.zeros... | [((500, 525), 'seaborn.set_style', 'sb.set_style', (['"""whitegrid"""'], {}), "('whitegrid')\n", (512, 525), True, 'import seaborn as sb\n'), ((939, 1008), 'torch.zeros', 'torch.zeros', (['(rollout_length + 1, init_state.shape[1])'], {'device': 'device'}), '((rollout_length + 1, init_state.shape[1]), device=device)\n',... |
import tensorflow.keras as keras
from tensorflow.keras.callbacks import EarlyStopping
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import Embedding
from tensorflow.keras.layers import GRU, LSTM, Bidirectional, TimeDistributed
from tensorflow.keras.layers import Input
from tensorflow.keras.mode... | [
"tensorflow.reduce_sum",
"numpy.random.seed",
"tensorflow.keras.layers.Dense",
"tensorflow_hub.Module",
"time.strftime",
"tensorflow.keras.metrics.FalseNegatives",
"tensorflow.local_variables_initializer",
"tensorflow.keras.layers.concatenate",
"tensorflow.tables_initializer",
"tensorflow.keras.me... | [((869, 907), 'tensorflow.keras.metrics.TruePositives', 'keras.metrics.TruePositives', ([], {'name': '"""tp"""'}), "(name='tp')\n", (896, 907), True, 'import tensorflow.keras as keras\n'), ((915, 954), 'tensorflow.keras.metrics.FalsePositives', 'keras.metrics.FalsePositives', ([], {'name': '"""fp"""'}), "(name='fp')\n"... |
import kabuki
import hddm
import numpy as np
import pandas as pd
from numpy.random import rand
from scipy.stats import uniform, norm
from copy import copy
def gen_single_params_set(include=()):
"""Returns a dict of DDM parameters with random values for a singel conditin
the function is used by gen_rand_par... | [
"numpy.random.seed",
"numpy.abs",
"scipy.stats.norm.rvs",
"numpy.empty",
"numpy.ones",
"numpy.isnan",
"numpy.random.randint",
"numpy.tile",
"numpy.random.normal",
"numpy.exp",
"hddm.utils.check_params_valid",
"pandas.DataFrame",
"hddm.generate.gen_rand_data",
"numpy.cumsum",
"pandas.conc... | [((1515, 1554), 'hddm.utils.check_params_valid', 'hddm.utils.check_params_valid', ([], {}), '(**params)\n', (1544, 1554), False, 'import hddm\n'), ((8589, 8606), 'numpy.empty', 'np.empty', (['samples'], {}), '(samples)\n', (8597, 8606), True, 'import numpy as np\n'), ((11067, 11190), 'hddm.wfpt.full_pdf', 'hddm.wfpt.fu... |
# Generic estimators for either classification or regression.
import os
import re
import time
import joblib
import numpy as np
import scipy.signal
from sklearn.exceptions import NotFittedError
from enum import Enum
class ModelType(Enum):
"""Enumerator for types of pre-trained nirs_models."""
classification = ... | [
"os.remove",
"numpy.abs",
"joblib.dump",
"numpy.expand_dims",
"time.time",
"os.path.isfile",
"numpy.mean",
"numpy.array",
"joblib.load",
"os.path.join",
"numpy.random.shuffle",
"re.compile"
] | [((546, 601), 're.compile', 're.compile', (['"""^(?P<label>.*?)_(?P<identifier>.*?)\\\\.csv"""'], {}), "('^(?P<label>.*?)_(?P<identifier>.*?)\\\\.csv')\n", (556, 601), False, 'import re\n'), ((5109, 5144), 'numpy.mean', 'np.mean', (['(predicted_labels == labels)'], {}), '(predicted_labels == labels)\n', (5116, 5144), T... |
import argparse
import os
import random
import numpy as np
import torch as tc
from mpi4py import MPI
from common.atari_wrappers import make_atari, wrap_deepmind
import logger
from bench.monitor import Monitor
from cnn_policy import CnnPolicy
from pposgd_simple import learn
from play import play
from movie import movie
... | [
"numpy.random.seed",
"argparse.ArgumentParser",
"torch.optim.lr_scheduler.OneCycleLR",
"torch.manual_seed",
"logger.configure",
"common.atari_wrappers.make_atari",
"pposgd_simple.learn",
"random.seed",
"play.play",
"common.atari_wrappers.wrap_deepmind",
"logger.get_dir",
"torch.tensor",
"tor... | [((348, 418), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Pytorch port of ppo1 for Atari."""'}), "(description='Pytorch port of ppo1 for Atari.')\n", (371, 418), False, 'import argparse\n'), ((2489, 2514), 'common.atari_wrappers.make_atari', 'make_atari', (['args.env_name'], {}), '(ar... |
'''
Copyleft Oct 30, 2016 <NAME>, PhD Student, Bafna Lab, UC San Diego, Email: <EMAIL>
'''
import numpy as np;
np.set_printoptions(linewidth=200, precision=5, suppress=True)
import pandas as pd;
pd.options.display.max_rows = 20;
pd.options.display.expand_frame_repr = False
import seaborn as sns
import pylab as plt;
... | [
"numpy.set_printoptions",
"os.path.expanduser"
] | [((113, 175), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'linewidth': '(200)', 'precision': '(5)', 'suppress': '(True)'}), '(linewidth=200, precision=5, suppress=True)\n', (132, 175), True, 'import numpy as np\n'), ((364, 387), 'os.path.expanduser', 'os.path.expanduser', (['"""~"""'], {}), "('~')\n", (382, ... |
import os
import sys
import json
import numpy as np
import tensorflow as tf
from typing import ClassVar, Callable
from sklearn.linear_model import LinearRegression
from model_ensemble import ensembleTest
from core.get_model import create_EEGNet, create_TSGLEEGNet
from core.dataloaders import RawDataloader
from core.d... | [
"json.load",
"tensorflow.keras.models.load_model",
"numpy.ones_like",
"numpy.argmax",
"os.path.exists",
"sklearn.linear_model.LinearRegression",
"numpy.array",
"numpy.squeeze",
"os.path.join"
] | [((5658, 5686), 'os.path.exists', 'os.path.exists', (['cvfolderpath'], {}), '(cvfolderpath)\n', (5672, 5686), False, 'import os\n'), ((6528, 6569), 'os.path.join', 'os.path.join', (['cvfolderpath', '"""params.json"""'], {}), "(cvfolderpath, 'params.json')\n", (6540, 6569), False, 'import os\n'), ((6577, 6601), 'os.path... |
import numpy as np
from scipy import optimize
from pyther import Data_parse
from sympy import *
# from .constants import RGAS
RGAS = 0.08314472
R = RGAS
NUMERO_COMPONENTES = 3
ETAPAS = 5
ETAPA_ALIMENTACION = 2
Z = np.zeros([NUMERO_COMPONENTES, ETAPAS])
Zf = np.array([0.3, 0.3, 0.4])
Z[:, ETAPA_ALIMENTACION] = Zf
pri... | [
"numpy.roots",
"numpy.sum",
"numpy.log",
"pyther.Data_parse",
"numpy.transpose",
"numpy.zeros",
"numpy.append",
"numpy.array",
"numpy.exp",
"scipy.optimize.root",
"numpy.float64"
] | [((217, 255), 'numpy.zeros', 'np.zeros', (['[NUMERO_COMPONENTES, ETAPAS]'], {}), '([NUMERO_COMPONENTES, ETAPAS])\n', (225, 255), True, 'import numpy as np\n'), ((261, 286), 'numpy.array', 'np.array', (['[0.3, 0.3, 0.4]'], {}), '([0.3, 0.3, 0.4])\n', (269, 286), True, 'import numpy as np\n'), ((332, 363), 'numpy.array',... |
"""
Least Angle Regression algorithm. See the documentation on the
Generalized Linear Model for a complete discussion.
"""
from __future__ import print_function
# Author: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME>
#
# License: BSD 3 clause
from math import log
import sys
import warnings
import nump... | [
"sys.stdout.write",
"numpy.sum",
"scipy.linalg.solve_triangular",
"numpy.resize",
"numpy.argmax",
"numpy.abs",
"numpy.empty",
"numpy.argmin",
"numpy.mean",
"numpy.arange",
"sys.stdout.flush",
"scipy.interpolate.interp1d",
"numpy.unique",
"numpy.zeros_like",
"scipy.linalg.get_blas_funcs",... | [((5726, 5763), 'numpy.empty', 'np.empty', (['max_features'], {'dtype': 'np.int8'}), '(max_features, dtype=np.int8)\n', (5734, 5763), True, 'import numpy as np\n'), ((5871, 5924), 'numpy.empty', 'np.empty', (['(max_features, max_features)'], {'dtype': 'X.dtype'}), '((max_features, max_features), dtype=X.dtype)\n', (587... |
import torch
import numpy as np
import time
import matplotlib.pyplot as plt
import os
import h5py
from load_vel import parihaka_model
from generator import generator
from tqdm import tqdm
from scipy.interpolate import interp1d
import matplotlib.ticker as ticker
sfmt=ticker.ScalarFormatter(useMathText=True)
sfmt.set_po... | [
"matplotlib.pyplot.title",
"torch.set_default_tensor_type",
"os.path.isfile",
"numpy.mean",
"matplotlib.pyplot.figure",
"torch.device",
"os.path.join",
"matplotlib.ticker.ScalarFormatter",
"numpy.std",
"matplotlib.pyplot.close",
"matplotlib.pyplot.imshow",
"torch.load",
"matplotlib.pyplot.co... | [((267, 307), 'matplotlib.ticker.ScalarFormatter', 'ticker.ScalarFormatter', ([], {'useMathText': '(True)'}), '(useMathText=True)\n', (289, 307), True, 'import matplotlib.ticker as ticker\n'), ((1354, 1370), 'load_vel.parihaka_model', 'parihaka_model', ([], {}), '()\n', (1368, 1370), False, 'from load_vel import pariha... |
#!/usr/bin/env python
# encoding: utf-8
# The MIT License (MIT)
# Copyright (c) 2018-2020 CNRS
# 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 limita... | [
"pyannote_xxx.audio.features.wrapper.Wrapper",
"pyannote_xxx.core.SlidingWindowFeature",
"pyannote_xxx.metrics.segmentation.SegmentationPurityCoverageFMeasure",
"pyannote_xxx.audio.utils.signal.Peak",
"pyannote_xxx.metrics.diarization.DiarizationPurityCoverageFMeasure",
"pyannote_xxx.database.get_annotate... | [((3178, 3198), 'pyannote_xxx.audio.features.wrapper.Wrapper', 'Wrapper', (['self.scores'], {}), '(self.scores)\n', (3185, 3198), False, 'from pyannote_xxx.audio.features.wrapper import Wrapper, Wrappable\n'), ((3346, 3363), 'pyannote_xxx.pipeline.parameter.Uniform', 'Uniform', (['(0.0)', '(1.0)'], {}), '(0.0, 1.0)\n',... |
from sklearn.tree import DecisionTreeClassifier
from sklearn.linear_model import LogisticRegression
import pytest
import numpy as np
import pandas as pd
from probatus.interpret import ShapModelInterpreter
from unittest.mock import patch
import os
@pytest.fixture(scope='function')
def X_train():
return pd.DataFram... | [
"pandas.DataFrame",
"pandas.testing.assert_frame_equal",
"numpy.abs",
"probatus.interpret.ShapModelInterpreter",
"pytest.warns",
"pytest.fixture",
"sklearn.tree.DecisionTreeClassifier",
"unittest.mock.patch",
"os.environ.get",
"sklearn.linear_model.LogisticRegression",
"pandas.Series",
"pytest... | [((250, 282), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (264, 282), False, 'import pytest\n'), ((466, 498), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (480, 498), False, 'import pytest\n'), ((572, 604), 'pytest.fixt... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import warnings
from textwrap import dedent
import pytest
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.transforms import Affine2D, IdentityTransform
from astropy.io import fits
from astropy import units as u
from astropy... | [
"astropy.visualization.wcsaxes.wcsapi.apply_slices",
"numpy.ones",
"matplotlib.pyplot.figure",
"astropy.visualization.wcsaxes.wcsapi.transform_coord_meta_from_wcs",
"astropy.io.fits.Header.fromstring",
"pytest.mark.mpl_image_compare",
"pytest.mark.parametrize",
"os.path.join",
"matplotlib.pyplot.clo... | [((947, 959), 'astropy.wcs.WCS', 'WCS', ([], {'naxis': '(2)'}), '(naxis=2)\n', (950, 959), False, 'from astropy.wcs import WCS\n'), ((1120, 1132), 'astropy.wcs.WCS', 'WCS', ([], {'naxis': '(3)'}), '(naxis=3)\n', (1123, 1132), False, 'from astropy.wcs import WCS\n'), ((11305, 11784), 'pytest.mark.parametrize', 'pytest.m... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2014, <NAME>
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------------------------------
"""
Antigrain Geometry Path Colle... | [
"vispy.glsl.get",
"numpy.empty",
"numpy.zeros",
"numpy.array",
"numpy.tile",
"numpy.arange",
"vispy.gloo.gl.glDepthMask",
"numpy.repeat"
] | [((4663, 4692), 'numpy.empty', 'np.empty', (['n'], {'dtype': 'self.vtype'}), '(n, dtype=self.vtype)\n', (4671, 4692), True, 'import numpy as np\n'), ((6619, 6636), 'vispy.gloo.gl.glDepthMask', 'gl.glDepthMask', (['(0)'], {}), '(0)\n', (6633, 6636), False, 'from vispy.gloo import gl\n'), ((6681, 6698), 'vispy.gloo.gl.gl... |
import math
from numpy import sign, linspace
import matplotlib.pyplot as plt
"""
Find root for f(x) = x^3 - 10x^2 + 5 = 0 within the range (0.6, 0.8)
via Ridder's Method
"""
def ridder(f, a, b, stop_criterion):
fa = f(a)
if fa == 0.0:
return a
fb = f(b)
if fb == 0.0:
return b
... | [
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot",
"math.sqrt",
"matplotlib.pyplot.setp",
"numpy.linspace",
"numpy.sign",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.grid"
] | [((1214, 1237), 'numpy.linspace', 'linspace', (['(0.6)', '(0.8)', '(100)'], {}), '(0.6, 0.8, 100)\n', (1222, 1237), False, 'from numpy import sign, linspace\n'), ((1479, 1516), 'matplotlib.pyplot.setp', 'plt.setp', (['poly_func', '"""linewidth"""', '(2.0)'], {}), "(poly_func, 'linewidth', 2.0)\n", (1487, 1516), True, '... |
import dataclasses
from typing import Callable, Optional, Union
import numpy as np
import probnum.problems
from probnum.type import FloatArgType
from .problems import (
BoundaryValueProblem,
SecondOrderBoundaryValueProblem,
FourthOrderBoundaryValueProblem,
)
# Check out: https://uk.mathworks.com/help/mat... | [
"numpy.sum",
"numpy.flip",
"numpy.isscalar",
"numpy.asarray",
"numpy.zeros",
"numpy.ones",
"numpy.sin",
"numpy.array",
"numpy.exp",
"numpy.cos",
"numpy.cosh",
"numpy.eye",
"numpy.sinh"
] | [((557, 569), 'numpy.eye', 'np.eye', (['(1)', '(2)'], {}), '(1, 2)\n', (563, 569), True, 'import numpy as np\n'), ((578, 590), 'numpy.eye', 'np.eye', (['(1)', '(2)'], {}), '(1, 2)\n', (584, 590), True, 'import numpy as np\n'), ((1718, 1730), 'numpy.eye', 'np.eye', (['(1)', '(2)'], {}), '(1, 2)\n', (1724, 1730), True, '... |
import numpy as np
from torchvision import transforms
from data_loader.transformations import RandomFlipTransform, RandomAffineTransform, RandomNoiseTransform, \
RandomElasticTransform, ToFloat, ToTensor, ChannelsFirst
def gsd_pCT_train_transform(max_output_channels=2, random_flip_prob=0.5, random_elastic_prob=0... | [
"data_loader.transformations.RandomNoiseTransform",
"data_loader.transformations.ToTensor",
"data_loader.transformations.RandomFlipTransform",
"data_loader.transformations.ChannelsFirst",
"data_loader.transformations.RandomAffineTransform",
"data_loader.transformations.RandomElasticTransform",
"numpy.ra... | [((743, 769), 'numpy.random.randint', 'np.random.randint', (['(0)', '(9999)'], {}), '(0, 9999)\n', (760, 769), True, 'import numpy as np\n'), ((902, 1072), 'data_loader.transformations.RandomFlipTransform', 'RandomFlipTransform', ([], {'axes': 'flip_axis', 'flip_probability': 'flip_prob_per_axis', 'p': 'random_flip_pro... |
# Omega is the users latent representation of interests - vector of size K
# omega is initialised when you have new user with reset
# omega is updated at every timestep using timestep
#
# Gamma is the latent representation of organic products (matrix P by K)
# softmax(Gamma omega) is the next item probabilities... | [
"numpy.abs",
"numba.njit",
"numpy.mod",
"numpy.arange",
"numpy.array",
"numpy.exp",
"numpy.diag"
] | [((949, 965), 'numba.njit', 'njit', ([], {'nogil': '(True)'}), '(nogil=True)\n', (953, 965), False, 'from numba import njit\n'), ((1087, 1103), 'numba.njit', 'njit', ([], {'nogil': '(True)'}), '(nogil=True)\n', (1091, 1103), False, 'from numba import njit\n'), ((1622, 1805), 'numpy.array', 'np.array', (['[[0, self.conf... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the BSD license found in the
# LICENSE file in the root directory of this source tree.
"""
Testing ShardedDDP
"""
from contextlib import suppress
import tempfile
import numpy as np
import pytest
import torch
import torch.distri... | [
"torch.cuda.synchronize",
"numpy.random.seed",
"torch.cat",
"torch.randn",
"fairscale.utils.testing.GPT2",
"torch.device",
"pytest.mark.parametrize",
"torch.ones",
"contextlib.suppress",
"fairscale.optim.OSS",
"torch.nn.Linear",
"torch.cuda.set_device",
"torch.nn.SyncBatchNorm.convert_sync_b... | [((4311, 4370), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""broadcast_buffers"""', '[True, False]'], {}), "('broadcast_buffers', [True, False])\n", (4334, 4370), False, 'import pytest\n'), ((4372, 4431), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""grad_accumulation"""', '[True, False]'],... |
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.10.0
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# + nbsphinx="hidden"
# %matpl... | [
"numpy.load",
"torch.nn.MSELoss",
"numpy.sum",
"mpol.precomposed.SimpleNet",
"mpol.coordinates.GridCoords",
"torch.load",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.set_cmap",
"astropy.utils.data.download_file",
"numpy.squeeze",
"mpol.gridding.Gridder",
"matplotlib.pyplot.subplots"
] | [((2887, 3015), 'astropy.utils.data.download_file', 'download_file', (['"""https://zenodo.org/record/4930016/files/logo_cube.noise.npz"""'], {'cache': '(True)', 'show_progress': '(True)', 'pkgname': '"""mpol"""'}), "('https://zenodo.org/record/4930016/files/logo_cube.noise.npz',\n cache=True, show_progress=True, pkg... |
#!/usr/bin/env python
# coding: utf-8
# basic stuff
import numpy as np
import pandas as pd
from sklearn.utils import shuffle
import matplotlib.pylab as plt
# import warnings filter
from warnings import simplefilter
simplefilter(action='ignore', category=FutureWarning)
# ML stuff
from sklearn.preprocessing import Max... | [
"Online.Parties.System",
"Online.Parties.User",
"warnings.simplefilter",
"Online.Parties.UserClear",
"numpy.zeros",
"matplotlib.pylab.plot",
"Online.Parties.MLEClear",
"sklearn.utils.shuffle",
"Online.Parties.MLE",
"matplotlib.pylab.show"
] | [((217, 270), 'warnings.simplefilter', 'simplefilter', ([], {'action': '"""ignore"""', 'category': 'FutureWarning'}), "(action='ignore', category=FutureWarning)\n", (229, 270), False, 'from warnings import simplefilter\n'), ((1133, 1171), 'numpy.zeros', 'np.zeros', (['(5)', '(4)', "problemset['epoch']", '(3)'], {}), "(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.