repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
DannyLee1991/article_cosine_similarity
[ "babea7286d64b96bb4e25a4e1dec40278ba8e55a" ]
[ "main/calc_vect_angle.py" ]
[ "# 计算向量夹角\nimport numpy as np\nfrom utils.cache import cache\n\n@cache(use_mem=True,use_file=True)\ndef calc_vct_angle_cos(vct_1, vct_2):\n '''\n 向量夹角cos计算\n :param vct_1:\n :param vct_2:\n :return:\n '''\n dot = np.dot(vct_1, vct_2)\n Lx = np.sqrt(np.dot(vct_1, vct_1))\n Ly = np.sqrt(np....
[ [ "numpy.dot" ] ]
mikewcasale/featuretools
[ "bc36f37b079cde874646a5fc882b1df9a187b57e" ]
[ "featuretools/tests/variables/test_variables.py" ]
[ "import pandas as pd\nimport pytest\n\nimport featuretools as ft\nfrom featuretools.variable_types import NaturalLanguage, Text\n\n\ndef test_text_depreciation():\n data = pd.DataFrame({\n \"id\": [1, 2, 3, 4, 5],\n \"text_column\": [\"a\", \"c\", \"b\", \"a\", \"a\"],\n })\n es = ft.EntitySe...
[ [ "pandas.DataFrame" ] ]
QianMuluo/PaddleOCR
[ "6ee301be36eb54d91dc437842f754593dce13967", "6ee301be36eb54d91dc437842f754593dce13967" ]
[ "ppstructure/vqa/infer_re.py", "ppstructure/vqa/infer_ser.py" ]
[ "import os\nimport sys\n\n__dir__ = os.path.dirname(os.path.abspath(__file__))\nsys.path.append(__dir__)\nsys.path.append(os.path.abspath(os.path.join(__dir__, '../..')))\n\nimport random\n\nimport cv2\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport paddle\n\nfrom paddlenlp.transformers import LayoutXL...
[ [ "matplotlib.pyplot.imshow" ], [ "numpy.bincount", "numpy.argmax" ] ]
sanchitvj/Global_Wheat_Detection-A-Pytorch-Tutorial
[ "7e89e3c0342d8b831460b10f2eb88e9e2b481f31" ]
[ "src/evaluation_metrics.py" ]
[ "import numpy as np\r\nimport numba\r\nfrom numba import jit\r\n\r\n# BoilerPlate code\r\nclass AverageMeter(object):\r\n \r\n # Keeps track of most recent, average, sum, and count of a metric.\r\n \r\n def __init__(self):\r\n self.reset()\r\n\r\n def reset(self):\r\n self.val = 0\r\n ...
[ [ "numpy.where", "numpy.mean" ] ]
Yu-Nie/YOLOV3
[ "09db1d551d293dcfa7a638fd6693920840d28a74", "09db1d551d293dcfa7a638fd6693920840d28a74" ]
[ "25-ratios/model/head/yolo_head.py", "36-ratios/eval/voc_eval.py" ]
[ "import torch.nn as nn\nimport torch\n\n\nclass Yolo_head(nn.Module):\n def __init__(self, nC, anchors, stride):\n super(Yolo_head, self).__init__()\n\n self.__anchors = anchors\n self.__nA = len(anchors)\n self.__nC = nC\n self.__stride = stride\n\n\n def forward(self, p):\...
[ [ "torch.sigmoid", "torch.cat", "torch.stack", "torch.arange", "torch.exp" ], [ "numpy.concatenate", "numpy.max", "numpy.array", "numpy.zeros", "numpy.minimum", "numpy.sum", "numpy.where", "numpy.finfo", "numpy.arange", "numpy.sort", "numpy.argsort...
GitDjTHU/exchange_calendars
[ "5c544f74d14fe01aa43a18a73667033124495d0c" ]
[ "tests/test_cmes_calendar.py" ]
[ "from unittest import TestCase\n\nimport pandas as pd\nfrom pytz import UTC\n\nfrom exchange_calendars.exchange_calendar_cmes import CMESExchangeCalendar\n\nfrom .test_exchange_calendar import ExchangeCalendarTestBase\n\n\nclass CMESCalendarTestCase(ExchangeCalendarTestBase, TestCase):\n answer_key_filename = \"...
[ [ "pandas.Timestamp" ] ]
rmodi6/dependency-parsing
[ "24909d24ddf0de6e0d0f6378962c6225afe97db0" ]
[ "lib/model.py" ]
[ "# inbuilt lib imports:\nfrom typing import Dict\nimport math\n\n# external libs\nimport tensorflow as tf\nfrom tensorflow.keras import models, layers\n\n# project imports\n\n\nclass CubicActivation(layers.Layer):\n \"\"\"\n Cubic activation as described in the paper.\n \"\"\"\n def call(self, vector: t...
[ [ "tensorflow.zeros_initializer", "tensorflow.exp", "tensorflow.initializers.TruncatedNormal", "tensorflow.matmul", "tensorflow.math.log", "tensorflow.reshape", "tensorflow.nn.l2_loss", "tensorflow.math.pow", "tensorflow.reduce_max", "tensorflow.clip_by_value", "tensorflo...
jaisenbe58r/demo-shazam
[ "bb18ccf882049eedb4965e313ca988b34424d289" ]
[ "utils/audio.py" ]
[ "\nimport pyaudio\nimport wave\nimport sys\n\nimport sounddevice as sd\nfrom scipy.io.wavfile import write\n\nfrom playsound import playsound\n\n\n\ndef play_audio(filename):\n print('Escuchando ......')\n playsound(filename)\n\n\n\ndef record_v1(seconds, filename):\n \n fs = 44100 # Sample rate\n\n ...
[ [ "scipy.io.wavfile.write" ] ]
elsandal/pyclesperanto_prototype
[ "7bda828813b86b44b63d73d5e8f466d9769cded1", "7bda828813b86b44b63d73d5e8f466d9769cded1", "7bda828813b86b44b63d73d5e8f466d9769cded1" ]
[ "tests/test_set_ramp_x.py", "tests/test_set_ramp_z.py", "tests/test_exclude_labels_with_map_values_out_of_range.py" ]
[ "import pyclesperanto_prototype as cle\nimport numpy as np\n\ndef test_set_ramp_x():\n result = cle.push(np.asarray([\n [\n [0, 0, 0],\n [3, 4, 3],\n [3, 4, 3]\n ], [\n [3, 4, 3],\n [3, 4, 3],\n [3, 4, 3]\n ]\n ]))\n\n r...
[ [ "numpy.allclose", "numpy.asarray" ], [ "numpy.allclose", "numpy.asarray" ], [ "numpy.array_equal", "numpy.asarray" ] ]
smoia/nigsp
[ "75eab5e428e5b28b4a5c174b3aeb69b8172cf9f5" ]
[ "nigsp/viz.py" ]
[ "#!/usr/bin/env python3\n\"\"\"\nVisualisation utility.\n\nAttributes\n----------\nFIGSIZE : tuple\n Figure size\nLGR\n Logger\nSET_DPI : int\n DPI of the figure\n\"\"\"\n\nimport logging\nimport os\n\nimport numpy as np\n\n\nLGR = logging.getLogger(__name__)\nSET_DPI = 100\nFIGSIZE = (18, 10)\n\n\ndef plo...
[ [ "matplotlib.pyplot.savefig", "numpy.percentile", "matplotlib.pyplot.imshow", "matplotlib.pyplot.figure" ] ]
lemoncyb/vispr-online
[ "6e4b59650dae392c34d145bb8fc3754ff289c9f7" ]
[ "vispr_screen/results/target.py" ]
[ "# coding: utf-8\nfrom __future__ import absolute_import, division, print_function\n\n__author__ = \"Johannes Köster\"\n__copyright__ = \"Copyright 2015, Johannes Köster, Liu lab\"\n__email__ = \"koester@jimmy.harvard.edu\"\n__license__ = \"MIT\"\n\n\nfrom flask import render_template\nimport pandas as pd\nimport n...
[ [ "numpy.histogram", "pandas.DataFrame", "numpy.arange", "numpy.log10", "numpy.maximum" ] ]
bizkid123/fibermorph
[ "46898e6eb68eaafad419b74626ea5498ca86e987" ]
[ "optimizationTest.py" ]
[ "import numpy as np\r\nfrom PIL import Image\r\nfrom scipy import ndimage\r\nfrom skimage.measure import CircleModel\r\nimport time\r\nfrom curveDrawing import createImage, loadImage, displayImage\r\n\r\nclass CurvesImage:\r\n def __init__(self, imagePath, imageWidth, imageHeight):\r\n self.imageWidth, se...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.ones", "numpy.nonzero", "numpy.where", "numpy.arctan2", "numpy.average", "numpy.column_stack" ] ]
a113n/bcbio-nextgen
[ "b5618f3c100a1a5c04bd5c8acad8f96d0587e41c" ]
[ "bcbio/ngsalign/tophat.py" ]
[ "\"\"\"Next-gen alignments with TopHat a spliced read mapper for RNA-seq experiments.\n\nhttp://tophat.cbcb.umd.edu\n\"\"\"\nimport os\nimport shutil\nimport glob\nimport subprocess\n\nimport numpy\nimport pysam\n\nfrom bcbio.pipeline import config_utils\nfrom bcbio.ngsalign import bowtie, bowtie2\nfrom bcbio.utils...
[ [ "numpy.median" ] ]
jin-hao-chen/csrnet
[ "8cdbce206a08499e76a8ff677d3c5a43ec1f4e6e" ]
[ "src/main.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\nimport os\nimport sys\nPROJ_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\nsys.path.insert(0, PROJ_DIR)\nimport fire\nimport numpy as np\nimport datetime\nimport torch as t\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.utils....
[ [ "numpy.reshape", "torch.cuda.is_available", "torch.utils.data.dataloader.DataLoader", "torch.nn.MSELoss" ] ]
awesome-archive/google-research
[ "6b3c751abbf658b33fb03e51d7b84105d2dbea68" ]
[ "mol_dqn/chemgraph/mcts/run_dqn.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google Research Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "numpy.array", "tensorflow.gfile.Open", "tensorflow.Session", "tensorflow.reset_default_graph", "tensorflow.train.Saver", "numpy.ones", "numpy.random.randint", "numpy.abs", "tensorflow.summary.FileWriter", "tensorflow.global_variables_initializer", "numpy.squeeze", ...
Softalleys/tensorflow-yolov4-tflite
[ "9a01d1e28d10b4028fe300129d62eb671d3981ad" ]
[ "detect_video.py" ]
[ "import time\r\nimport tensorflow as tf\r\nphysical_devices = tf.config.experimental.list_physical_devices('GPU')\r\nif len(physical_devices) > 0:\r\n tf.config.experimental.set_memory_growth(physical_devices[0], True)\r\nfrom absl import app, logging\r\nimport core.utils as utils\r\nfrom core.yolov4 import filt...
[ [ "tensorflow.shape", "numpy.asarray", "tensorflow.compat.v1.ConfigProto", "tensorflow.compat.v1.InteractiveSession", "tensorflow.config.experimental.set_memory_growth", "tensorflow.lite.Interpreter", "tensorflow.constant", "tensorflow.config.experimental.list_physical_devices", ...
cvpr22sub7201/SpeechDrivenTongueAnimation
[ "82caf9d7f4331e039e3b2f0d31df6393d24ccb1c" ]
[ "losses/contrastive.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nThis class was impelmented to compute the contrastive loss\nover a batch of sequence predictions\n\"\"\"\n\nimport torch\n\n\nclass ContrastiveLoss(torch.nn.Module):\n def __init__(self, eps=1e-8):\n super(ContrastiveLoss, self).__init__()\n self.eps = eps\n\n d...
[ [ "torch.eye", "torch.cdist", "torch.masked_select" ] ]
cmastalli/eigenpy
[ "aef2a9aa3be42d85275fbe654eb621e289b02017" ]
[ "unittest/python/test_LDLT.py" ]
[ "import eigenpy\neigenpy.switchToNumpyArray()\n\nimport numpy as np\nimport numpy.linalg as la\n\ndim = 100\nA = np.random.rand(dim,dim)\n\nA = (A + A.T)*0.5 + np.diag(10. + np.random.rand(dim))\n\nldlt = eigenpy.LDLT(A)\n\nL = ldlt.matrixL() \nD = ldlt.vectorD() \nP = ldlt.transpositionsP() \n\nassert eigenpy.is_a...
[ [ "numpy.diag", "numpy.random.rand", "numpy.transpose" ] ]
HusseinLezzaik/Deep-Learning-for-Multi-Robotics
[ "ecdb28793cc1f5fa6cded752908105ec37e9bfc7" ]
[ "Two Robots Topology Graph/Consensus Algorithm/main_consensus_algorithm_pioneer.py" ]
[ "\"\"\"\n\nConsensus Algorithm for two mobile robots, with code for saving data in csv file\n\n\"\"\"\nimport math\nimport numpy as np\nimport rclpy\nfrom rclpy.node import Node\nfrom tf2_msgs.msg import TFMessage\nfrom std_msgs.msg import Float32\nimport csv\n\nk = 1 # Control Gain\nL = 0.0975 # Configured for Pio...
[ [ "numpy.array", "numpy.dot", "numpy.linalg.inv" ] ]
shibing624/labelit
[ "de1233b4b674a41ae12ccfcbaebdbf1e002d865e" ]
[ "labelit/active_learning/sampler/graph_density.py" ]
[ "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed...
[ [ "numpy.zeros", "numpy.exp", "sklearn.metrics.pairwise_distances", "numpy.arange", "numpy.argmax", "sklearn.neighbors.kneighbors_graph" ] ]
nhutnamhcmus/pykeen
[ "62d4f075fbd39135d6a5c8677d95e1ac46f8318f" ]
[ "src/pykeen/datasets/wk3l.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"The Wk3l-15k dataset family.\n\nGet a summary with ``python -m pykeen.datasets.wk3l``\n\"\"\"\n\nimport logging\nimport pathlib\nimport zipfile\nfrom abc import ABC\nfrom typing import ClassVar, Mapping, Optional, Tuple, cast\n\nimport click\nimport pandas\nfrom docdata import pars...
[ [ "pandas.read_csv" ] ]
uit-hdl/hover_serving
[ "baca88c2b1738cd38f98deed4140b905ebc4c74c" ]
[ "src/scripts/viz_utils.py" ]
[ "import cv2\r\nimport numpy as np\r\nimport itertools\r\n\r\n\r\ndef bounding_box(img):\r\n rows = np.any(img, axis=1)\r\n cols = np.any(img, axis=0)\r\n rmin, rmax = np.where(rows)[0][[0, -1]]\r\n cmin, cmax = np.where(cols)[0][[0, -1]]\r\n # due to python indexing, need to add 1 to max\r\n # els...
[ [ "numpy.array", "numpy.asarray", "numpy.any", "numpy.where", "numpy.amax", "numpy.unique" ] ]
armandli/ReconChessRL
[ "6d0de7acd7aeba0ad767e29c807ee0e6f30d95fb" ]
[ "senseis/models/rc_action_model3.py" ]
[ "import torch\nfrom torch import nn\n\nfrom senseis.torch_modules.activation import relu_activation\nfrom senseis.torch_modules.residual_layer import ResidualLayer1DV5, ResidualLayer2DV3\n\n# Action Policy Model: output pi(s)\nclass RCActionModel3(nn.Module):\n def __init__(self, csz, row_sz, col_sz, a_sz):\n s...
[ [ "torch.nn.Linear", "torch.flatten", "torch.nn.Softmax" ] ]
nepeplwu/PaddleSeg
[ "6192a9642e3078f66de8fed054a330e536869481" ]
[ "pdseg/check.py" ]
[ "# coding: utf8\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport numpy as np\nimport os\nimport sys\nimport pprint\nimport argparse\nimport cv2\nfrom tqdm import tqdm\nimport imghdr\nimport logging\n\nfrom utils.config import cfg\n\ndef init...
[ [ "numpy.where", "numpy.fromfile", "numpy.unique" ] ]
R3ab/ttpla_dataset
[ "863fb874c1519eea7673cd95252b07cf5fdbd657" ]
[ "scripts/resize_image_and_annotation-final.py" ]
[ "import cv2\nimport sys, json\nimport argparse\nfrom xml.dom import minidom\nimport numpy as np\nimport os\n\noutput_folder = '.'\nsized_folder = output_folder+'/'+'sized_data'\ndim=(700,700)\n\nfor p in [output_folder,sized_folder]:\n\tif not os.path.exists(p):\n\t\tos.makedirs(p)\n\nap = argparse.ArgumentParser()...
[ [ "numpy.int32" ] ]
datvo06/3ddfav2_modified
[ "d9128c5ec7c2e3c7f517b5c7b61689a44d62c028" ]
[ "TDDFA.py" ]
[ "# coding: utf-8\n\n__author__ = 'cleardusk'\n\nimport os.path as osp\nimport time\nimport numpy as np\nimport cv2\nimport torch\nfrom torchvision.transforms import Compose\nimport torch.backends.cudnn as cudnn\n\nimport models\nfrom utils.io import _load\nfrom utils.functions import (\n crop_img, parse_roi_box_...
[ [ "torch.set_grad_enabled" ] ]
leofansq/FII-CenterNet
[ "9e5b03d2b22a035d52af60b4846f5c141aeeca9e" ]
[ "src/lib/datasets/dataset/kitti_full.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport torch.utils.data as data\nimport pycocotools.coco as coco\nimport numpy as np\nimport torch\nimport json\nimport cv2\nimport os\nimport math\n\nimport torch.utils.data as data\n\n\nclass KITTI(d...
[ [ "numpy.array", "numpy.random.RandomState" ] ]
sun-yitao/PsychicLearners
[ "8577e7ec2989ec759cdb7e79b11cdef7fe31268b" ]
[ "title_classification/title_cnn.py" ]
[ "import os\nimport pandas as pd\nimport numpy as np\nimport tensorflow as tf\nimport keras\nfrom keras.layers import *\nfrom keras.preprocessing.text import Tokenizer\nfrom keras.preprocessing.sequence import pad_sequences\nfrom keras import backend as K\n#os.environ['KMP_DUPLICATE_LIB_OK'] = 'True'\nos.environ[\"C...
[ [ "tensorflow.ConfigProto", "tensorflow.Session" ] ]
ryansdowning/pandas
[ "6995dd7854cfa8820d587dfa6f72cf73219eb1c3" ]
[ "pandas/tests/io/parser/test_unsupported.py" ]
[ "\"\"\"\nTests that features that are currently unsupported in\neither the Python or C parser are actually enforced\nand are clearly communicated to the user.\n\nUltimately, the goal is to remove test cases from this\ntest suite as new feature support is added to the parsers.\n\"\"\"\nfrom io import StringIO\nimpor...
[ [ "pandas.compat.is_ci_environment", "pandas._testing.assert_produces_warning", "pandas.compat.is_platform_windows", "pandas._testing.ensure_clean", "pandas.compat.is_platform_mac" ] ]
efyang/timelag-graphgen
[ "800fc88458064fa999397ee0404164364390f032" ]
[ "timelag-graphgen/fileformat.py" ]
[ "import pandas as pd\nimport time_offset\nimport dataformat\n\n\nclass FileFormat:\n read_method = None\n\n def __init__(self, file_path):\n self.df = self.read_method(file_path)\n self.preprocessed = False\n\n\nclass WeekPreprocessedSSFile(FileFormat):\n def __init__(self, file_path, state_i...
[ [ "pandas.to_datetime", "pandas.read_csv" ] ]
florianbeyer/maptor
[ "8fd899dd3123484fd83b7aa74a007edc8879dba6" ]
[ "venv/UI/RFR_SSS.py" ]
[ "try:\n import sys,os\n import pathlib, os, sys\n current_folder_path, current_folder_name = os.path.split(os.getcwd())\n sys.path.append(str(current_folder_path) + \"\\HelpingModel\")\n sys.path.append(str(current_folder_path) + \"\\Model\")\n\n # sys.path.append(r\"..\\Model\")\n # sys.path.a...
[ [ "pandas.DataFrame", "numpy.array", "numpy.nan_to_num" ] ]
ratkhohieu/EAD-2020
[ "62841b3cdccf5ce515c1735cb921a2a10f5377e3" ]
[ "evaluation_mAP-IoU/compute_mAP_IoU.py" ]
[ "# =============================================================================\n# Evaluates mAP and IoU \n#\n# Requires bounding boxes to be given in the VOC format i.e:\n# ground-truth boxes: class_name, x1, y1, x2, y2\n# predicted boxes: class_name, confidence, x1, y1, x2, y2 \n# EAD 2019 Challe...
[ [ "numpy.mean" ] ]
isunLt/PolarSeg
[ "50b6df8d0a63aae1835377178baeaeb071b8f78d" ]
[ "network/BEV_Unet.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom dropblock import DropBlock2D\n\n\nclass BEV_Unet(nn.Module):\n\n def __init__(self,n_class,n_height,dilation = 1,group_conv=False,input_batch_norm = False,dropout = 0...
[ [ "torch.nn.Dropout", "torch.cat", "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.LeakyReLU", "torch.nn.ConvTranspose2d", "torch.nn.Upsample", "torch.nn.Conv2d", "torch.nn.functional.pad" ] ]
BrunoASNascimento/varied_codes
[ "8eb800023506602fa27c9d9f1600b95741960348" ]
[ "python/recording_sound_sounddevice.py" ]
[ "import sounddevice as sd\nfrom scipy.io.wavfile import write\n\nprint(sd.query_devices())\nfs = 44100 # Sample rate\nseconds = 5 # Duration of recording\nsd.default.device = 1\n\nmyrecording = sd.rec(int(seconds * fs), samplerate=fs, channels=2)\nsd.wait() # Wait until recording is finished\nwrite('data\\output...
[ [ "scipy.io.wavfile.write" ] ]
CityU-AIM-Group/SCAN
[ "c42d67416fda5c44ee023e14307b63b1ad9890a2" ]
[ "fcos_core/modeling/discriminator/con_fgbg.py" ]
[ "import torch\nimport torch.nn.functional as F\nfrom torch import nn\n\nfrom .layer import GradientReversal\n\nclass FCOSDiscriminator_con(nn.Module):\n def __init__(self, with_GA=False, fusion_cfg ='concat', num_convs=4, in_channels=256, num_classes=2, grad_reverse_lambda=-1.0, grl_applied_domain='both', cfg = ...
[ [ "torch.cat", "torch.nn.init.constant_", "torch.nn.Sequential", "torch.nn.GroupNorm", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.full", "torch.nn.init.normal_", "torch.nn.BCEWithLogitsLoss" ] ]
lele94218/ml_project
[ "8eb95222e0c9e848ecfc9eaa9de56d17a3d7e56d" ]
[ "exp.py" ]
[ "#!/usr/bin/env python\n\n\nimport time\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom sklearn import cluster, datasets\nfrom sklearn.neighbors import kneighbors_graph\nfrom sklearn.preprocessing import StandardScaler\n\nnp.random.seed(0)\n\n# Generate datasets. We choose the size big enough to see ...
[ [ "numpy.random.rand", "matplotlib.pyplot.xlim", "sklearn.cluster.Birch", "sklearn.cluster.MeanShift", "matplotlib.pyplot.xticks", "sklearn.cluster.AgglomerativeClustering", "sklearn.cluster.SpectralClustering", "sklearn.datasets.make_circles", "matplotlib.pyplot.gca", "matpl...
StanfordASL/neural-network-lyapunov
[ "9e5db1c7f91b42df729026c9aa8575bc126f66b6" ]
[ "neural_network_lyapunov/control_affine_system.py" ]
[ "import torch\nimport neural_network_lyapunov.gurobi_torch_mip as gurobi_torch_mip\nimport neural_network_lyapunov.utils as utils\nimport neural_network_lyapunov.mip_utils as mip_utils\nimport neural_network_lyapunov.relu_to_optimization as relu_to_optimization\n\n\nclass ControlAffineSystemConstraintReturn:\n \...
[ [ "torch.zeros", "torch.cat", "torch.min", "torch.split", "torch.all", "torch.eye" ] ]
vt-vl-lab/SDN
[ "d1f0a448acf720b9b86527f808cb17d30ed2f4e9" ]
[ "models/model.py" ]
[ "import torch\nfrom torch import nn\n\nfrom models import resnet, pre_act_resnet, wide_resnet, resnext, densenet, vgg\nimport pdb\n\ndef generate_model(opt):\n assert opt.model in [\n 'resnet', 'preresnet', 'wideresnet', 'resnext', 'densenet', 'vgg'\n ]\n\n if opt.model == 'resnet':\n assert ...
[ [ "torch.nn.Linear", "torch.nn.DataParallel", "torch.load" ] ]
J-JinZhang/metric_learning
[ "31dac46801abfdc43e01867160dac6e2d94f5ef7" ]
[ "inception_emb.py" ]
[ "\"\"\"\nAuthor: Dr. Jin Zhang \nE-mail: j.zhang.vision@gmail.com\nCreated on 2022.02.09\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\n\nclass Img_Inception(nn.Module):\n\n def __init__(self, num_classes=1, aux_logits=False, transform_input=False):\n super(Img_Incept...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.functional.avg_pool2d", "torch.nn.Dropout", "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "scipy.stats.truncnorm", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.functional.relu", "torch.nn.functional.max_pool2d" ] ]
only4cc/sel_points
[ "c4195cefe0f5c1ab77d78dfa4bb0a6cdc214566d" ]
[ "proto.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# # Determinacion de puntos para toma de muestras\n\n# In[1]:\n\n\n# python 3.7\n#\n# Parametros de entrada:\n# nombre del archivo formato csv\n# numero minimo de puntos a seleccionar o ... porcentaje minimo de puntos a seleccionar\n# distancia minima entre puntos...
[ [ "pandas.DataFrame", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.show", "matplotlib.pyplot.scatter", "pandas.read_csv", "pandas.to_numeric" ] ]
kqasem/pygridtools
[ "e73f35c0bb6ac809655f823b47551fccfc84f5b9" ]
[ "pygridtools/tests/test_gefdc.py" ]
[ "import os\r\nfrom pkg_resources import resource_filename\r\nimport tempfile\r\n\r\nimport numpy\r\nimport pandas\r\nfrom shapely import geometry\r\nimport geopandas\r\n\r\nimport pytest\r\nimport numpy.testing as nptest\r\nimport pandas.util.testing as pdtest\r\n\r\nfrom pygridtools import gefdc\r\nfrom . import u...
[ [ "numpy.array", "numpy.ones", "numpy.zeros", "numpy.testing.assert_array_equal" ] ]
nehaljwani/optbinning
[ "ee98684f3d25e35cf5efa2ef724844397e851294" ]
[ "optbinning/outlier.py" ]
[ "\"\"\"\nUnivariate outlier detection methods.\n\"\"\"\n\n# Guillermo Navas-Palencia <g.navas.palencia@gmail.com>\n# Copyright (C) 2020\n\nimport numbers\n\nimport numpy as np\n\nfrom sklearn.base import BaseEstimator\nfrom sklearn.exceptions import NotFittedError\n\n\nclass OutlierDetector:\n \"\"\"Base class f...
[ [ "numpy.ceil", "numpy.asarray", "numpy.argmin", "numpy.median", "numpy.percentile", "numpy.where", "numpy.sort", "numpy.abs" ] ]
rivasjc/OpenMDAO
[ "cc1b1e34500e8bcfd9d350f66d8e1d73bec96696" ]
[ "openmdao/components/interp_util/interp_lagrange3.py" ]
[ "\"\"\"\nInterpolate using a third order Lagrange polynomial.\n\nBased on NPSS implementation.\n\"\"\"\nimport numpy as np\n\nfrom openmdao.components.interp_util.interp_algorithm import InterpAlgorithm, InterpAlgorithmSemi\n\n\nclass InterpLagrange3(InterpAlgorithm):\n \"\"\"\n Interpolate using a third orde...
[ [ "numpy.empty" ] ]
JianpingChen066/pytorch-1
[ "30214aef2d831067b8962398321f1fb20d359c97" ]
[ "test/test_functional_optim.py" ]
[ "import unittest\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.optim import SGD, Adam\nfrom torch.testing._internal.common_utils import TestCase, run_tests, IS_WINDOWS\n\nif not IS_WINDOWS:\n from torch.distributed.optim.functional_sgd import _FunctionalSGD\n from torch.d...
[ [ "torch.manual_seed", "torch.randn", "torch.testing._internal.common_utils.run_tests", "torch.nn.Linear" ] ]
AayushGrover/NeuroRL
[ "605d5385a6de18067e97207984d4203f46f9150c" ]
[ "mri/src/config.py" ]
[ "import torch\n\ndevice = device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\nbatch_size = 16\nnum_class = 3 # do not change\nmodel_name = '../models/mri.pt'\ntrain_input_image_path = '../data/images/train_images.npy'\ntrain_mask_image_path = '../data/masks/train_masks.npy'\ntest_input_image_...
[ [ "torch.cuda.is_available" ] ]
chosj95/PFPNet.pytorch
[ "35f597903b312876d237a22c1e8e2fb7c879928d" ]
[ "layers/functions/detection.py" ]
[ "import torch\nfrom torch.autograd import Function\nfrom ..box_utils import decode, nms\nfrom data import data_configs\n\ncfg = data_configs['VOC']\n\n\nclass Detect(Function):\n \"\"\"At test time, Detect is the final layer of SSD. Decode location preds,\n apply non-maximum suppression to location predictio...
[ [ "torch.zeros" ] ]
snakeztc/NeuralDialog-ZSDG
[ "1d1548457a16a2e07567dc8532ea8b2fba178540" ]
[ "zsdg/evaluators.py" ]
[ "# @Time : 9/25/17 3:54 PM\n# @Author : Tiancheng Zhao\nfrom collections import Counter\nimport numpy as np\nfrom sklearn.feature_extraction.text import CountVectorizer\nfrom sklearn.multiclass import OneVsRestClassifier\nfrom sklearn.linear_model import SGDClassifier\nfrom sklearn import metrics\nfrom nltk.tra...
[ [ "sklearn.linear_model.SGDClassifier", "sklearn.metrics.f1_score", "sklearn.feature_extraction.text.CountVectorizer", "scipy.stats.gmean" ] ]
SiliGuo/CloudML_Final_Project
[ "8592fb678f0367bb9c8d63816480884c13452673" ]
[ "src/train.py" ]
[ "import os\nimport keras\nimport tensorflow as tf\nimport keras.backend as K\nimport matplotlib.pyplot as plt\nimport sys\nimport pickle\nfrom keras.utils import plot_model\nfrom keras.applications.xception import Xception\nfrom keras.preprocessing.image import load_img\nfrom keras.preprocessing.image import img_to...
[ [ "numpy.array", "numpy.zeros", "numpy.percentile", "numpy.argmax", "tensorflow.reduce_mean", "tensorflow.math.equal", "tensorflow.cast" ] ]
ellisvalentiner/credit-card-fraud
[ "e1cb6bde2cab4ea4aa1f9dadafe4240c94613b32" ]
[ "src/model.py" ]
[ "#!/usr/bin/python\n\nfrom __future__ import print_function\nimport numpy as np\nimport pandas as pd\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Dropout\nfrom keras_contrib.layers import SReLU...
[ [ "matplotlib.pyplot.xlim", "numpy.nanmean", "pandas.read_csv", "sklearn.model_selection.StratifiedKFold", "sklearn.metrics.precision_recall_curve", "matplotlib.pyplot.savefig", "matplotlib.use", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.clf", ...
RobinSatterthwaite/opengl-experiments
[ "3de0466e7a7937e9fe36c8dbb15b67d9739222e2" ]
[ "src/models.py" ]
[ "#=============================================================================#\n# #\n# Copyright (c) 2016 #\n# ...
[ [ "numpy.array", "numpy.ones", "numpy.zeros" ] ]
lzhangbv/kfac_pytorch
[ "159e7ef9541bb960d79c438622780cdcc71b3210", "159e7ef9541bb960d79c438622780cdcc71b3210" ]
[ "legacy/kfac_preconditioner_inv_rdc.py", "kfac/kfac_preconditioner_inv_dp.py" ]
[ "import math\nimport torch\nimport torch.optim as optim\nimport horovod.torch as hvd\nimport numpy as np\nfrom horovod.torch.mpi_ops import allgather_async\n\nfrom legacy.utils import (ComputeA, ComputeG)\nfrom legacy.utils import update_running_avg\nfrom legacy.utils import try_contiguous\nfrom legacy.utils import...
[ [ "torch.triu_indices", "numpy.argmin", "numpy.prod", "numpy.argsort", "torch.is_grad_enabled" ], [ "torch.is_grad_enabled" ] ]
wendyrvllr/Dicom-To-CNN
[ "be7976d122c238fe43b5b90230682d99e7250bbe", "be7976d122c238fe43b5b90230682d99e7250bbe" ]
[ "dicom_to_cnn/tools/visualization/create_mip.py", "dicom_to_cnn/model/segmentation/rtstruct/ROIContourSequence.py" ]
[ "import os \nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom dicom_to_cnn.model.post_processing.mip.MIP_Generator import MIP_Generator\n\ndef transform_to_nan(MIP:np.ndarray) -> np.ndarray:\n \"\"\"function to replace pixel with value 0 with np.NaN\n\n Args:\n MIP (np.ndarray): [2D np.ndarray...
[ [ "numpy.empty", "matplotlib.pyplot.close", "numpy.linspace", "matplotlib.pyplot.figure", "numpy.where", "matplotlib.pyplot.gca", "matplotlib.pyplot.imshow" ], [ "numpy.where", "numpy.zeros" ] ]
melmasri/trilearn
[ "cbda999140881a5f0e01d75a54d5ff55201a33e7" ]
[ "trilearn/pgibbs.py" ]
[ "from multiprocessing import Process\nimport multiprocessing\nimport os\nimport datetime\nimport time\n\nimport numpy as np\nfrom tqdm import tqdm\n\nimport trilearn.graph\nfrom trilearn import set_process as sp\nfrom trilearn.distributions import sequential_junction_tree_distributions as seqdist\nfrom trilearn.gra...
[ [ "numpy.asmatrix", "numpy.array", "numpy.random.choice", "numpy.random.seed", "numpy.exp", "numpy.identity" ] ]
seuretm/dici
[ "5337ee3b83a22bd39b7781addd1b1d006b97c8cb" ]
[ "run_viewer.py" ]
[ "#!/usr/bin/env python\n\nfrom PyQt5.QtWidgets import QApplication\nfrom viewer import ProjView\nimport numpy\nimport pickle\n\nfrom viewer import ImageDisplay\nfrom lib.berlin_viewer import BerlinImageDisplay\nfrom viewer import TextDisplay\n\n\n#pickle.dump((filename[i], proj[i], classifi[i]), f)\n\nfname = []\nr...
[ [ "numpy.array" ] ]
Arghya-Banerjee/pandas
[ "9a4fcea8de798938a434fcaf67a0aa5a46b76b5b" ]
[ "pandas/core/arrays/timedeltas.py" ]
[ "from __future__ import annotations\n\nfrom datetime import timedelta\nfrom typing import TYPE_CHECKING\n\nimport numpy as np\n\nfrom pandas._libs import (\n lib,\n tslibs,\n)\nfrom pandas._libs.arrays import NDArrayBacked\nfrom pandas._libs.tslibs import (\n BaseOffset,\n NaT,\n NaTType,\n Period...
[ [ "pandas.core.nanops.nansum", "pandas.core.dtypes.common.is_string_dtype", "pandas._libs.tslibs.NaT.to_datetime64", "pandas.compat.numpy.function.validate_sum", "pandas.core.ops.common.unpack_zerodim_and_defer", "pandas.core.arrays.datetimelike.validate_inferred_freq", "pandas.core.arra...
yangtx2009/finance
[ "5ba428f0495a16de89ea852e04e71bde8a00f9ba" ]
[ "Analyser/MachineLearning/DecoderLayer.py" ]
[ "import tensorflow as tf\nfrom MultiHeadAttention import MultiHeadAttention\n\nclass DecoderLayer(tf.keras.layers.Layer):\n def __init__(self, d_model, num_heads, dff, rate=0.1):\n super(DecoderLayer, self).__init__()\n\n self.mha1 = MultiHeadAttention(d_model, num_heads)\n self.mha2 = Multi...
[ [ "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.LayerNormalization", "tensorflow.keras.layers.Dense" ] ]
dtak/POPCORN-POMDP
[ "d6878a0fe06fda09f8ed9d5069731af0e148cf34" ]
[ "src/sepsis_simulator/sepsisSimDiabetes/DataGenerator.py" ]
[ "import numpy as np, random\nfrom .MDP import MDP\nfrom .State import State\nfrom .Action import Action\n\nNUM_OBS = 5 #total dim of obs space: hr, sbp, O2, gluc, diabetes\n\nimport scipy.stats as stat\nfrom scipy.misc import logsumexp\n\n\ndef update_belief(belief,obs,action,log_T,O,obs_mask=None): \n \"\"\"\n ...
[ [ "numpy.concatenate", "numpy.random.normal", "scipy.stats.norm.logpdf", "numpy.dot", "numpy.max", "numpy.log", "numpy.zeros", "numpy.sum", "numpy.copy", "numpy.ones", "numpy.random.uniform", "numpy.random.randint", "numpy.argmax", "scipy.misc.logsumexp" ] ]
yanniskatsaros/tafra
[ "3a4ccc66f3b2f7fb8a1a20ba667bd16571ce44c7" ]
[ "tafra/csvreader.py" ]
[ "\"\"\"\nTafra: a minimalist dataframe\n\nCopyright (c) 2020 Derrick W. Turk and David S. Fulford\n\nAuthor\n------\nDerrick W. Turk\nDavid S. Fulford\n\nNotes\n-----\nCreated on April 25, 2020\n\"\"\"\nfrom pathlib import Path\nimport csv\nimport dataclasses as dc\n\nimport numpy as np\n\nfrom enum import Enum, au...
[ [ "numpy.array" ] ]
marioyc/optimisation-orsay-2017
[ "de5509369e3a7c66faa8d570a59dba8342333282", "de5509369e3a7c66faa8d570a59dba8342333282" ]
[ "hw1/gradient_descent.py", "hw2/losses.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\n\nfrom load_data import load_data\nfrom losses import (square_loss, square_loss_gradient,\n logistic_loss, logistic_loss_gradient)\n\ndef classification_error(y, y2):\n n = y.shape[0]\n error = 0\n aux = y * y2\n for i in range(n):\n ...
[ [ "numpy.dot", "numpy.zeros", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ], [ "numpy.expand_dims", "numpy.dot", "numpy.exp", "numpy.zeros" ] ]
DarseZ/DL_hw1
[ "f6b86e3e51996acf17b8ff93a828e104539729f3" ]
[ "2_pytorch/models/twolayernn.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\n\nclass TwoLayerNN(nn.Module):\n def __init__(self, im_size, hidden_dim, n_classes):\n '''\n Create components of a two layer neural net classifier (often\n refer...
[ [ "torch.nn.Linear", "torch.nn.Softmax", "torch.nn.Sequential", "torch.nn.ReLU", "numpy.prod" ] ]
RPGroup-PBoC/gist_pboc_2017
[ "2c2f5134e221cf174c92a933ab1e5f71b2eb8b17" ]
[ "code/project_pt4_fold-change.py" ]
[ "# Import the necessary modules.\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nsns.set_context('talk')\n# For image processing.\nimport skimage.io\n\n# For file management\nimport glob\n\n# Utilities for our course.\nimport pboc_utils as pboc\n\n\n# In the final part of our project, w...
[ [ "matplotlib.pyplot.xscale", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.logspace", "numpy.mean", "matplotlib.pyplot.figure", "numpy.exp", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabe...
ethanknights/mne-bids
[ "cfb2ee9c7ddad6e3590427d65844de9f47e66d2d" ]
[ "mne_bids/tests/test_write.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"Test the MNE BIDS converter.\n\nFor each supported file format, implement a test.\n\"\"\"\n# Authors: Mainak Jas <mainak.jas@telecom-paristech.fr>\n# Teon L Brooks <teon.brooks@gmail.com>\n# Chris Holdgraf <choldgraf@berkeley.edu>\n# Stefan Appelhoff <stefa...
[ [ "numpy.array", "numpy.array_equal", "numpy.asarray", "numpy.random.RandomState", "numpy.testing.assert_array_equal", "numpy.testing.assert_array_almost_equal", "numpy.atleast_3d", "numpy.loadtxt", "numpy.int32" ] ]
MingSun-Tse/pytorch-vdsr
[ "597bacb4ec7385c8cc6cdf91e26e64ef2e6808b7", "597bacb4ec7385c8cc6cdf91e26e64ef2e6808b7" ]
[ "Bin/train_autoencoder_vdsr.py", "Bin/transform_vdsr_model_to_mine.py" ]
[ "from __future__ import print_function\nimport sys\nimport os\npjoin = os.path.join\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = sys.argv[sys.argv.index(\"--gpu\") + 1] # The args MUST has an option \"--gpu\".\nimport shutil\nimport time\nimport argparse\nimport numpy as np\nfrom PIL import Image\nimport matplotlib\nmat...
[ [ "matplotlib.use", "numpy.array", "torch.nn.MSELoss", "torch.autograd.Variable", "torch.FloatTensor", "scipy.io.loadmat", "numpy.mean", "torch.from_numpy", "torch.utils.data.DataLoader", "numpy.abs" ], [ "torch.load" ] ]
ctroein/octavvs
[ "5a68ed61d01640f377bda116769b7cf783d3b668" ]
[ "octavvs/algorithms/ptir.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Feb 4 02:56:27 2021\n\n@author: carl\n\"\"\"\n\nimport numpy as np\n\nfrom .util import find_wn_ranges\n\n\n\ndef normalize_mirage(wn, data, breaks=[(922,926), (1202,1206), (1448,1452)],\n endpoints=6, slopefactor=.5):\n ...
[ [ "numpy.array", "numpy.zeros", "numpy.abs", "numpy.linspace", "numpy.maximum" ] ]
bisho1995/whatsapp-message-datavisualization
[ "985b17f39cb403688f93dac0f601e911252d578a" ]
[ "model.py" ]
[ "#!/usr/bin/python3\n\nimport pandas as pd\nimport numpy as np \nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\n\ndef create_scatter_plot_time_vs_messages(df, save_fig_name, title, figure_size):\n #saving images in a folder\n save_fig_name = 'pics/'+save_fig_name+'_scatter_plot'\n\n for i in ran...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "pandas.read_csv", "matplotlib.pyplot.bar", "matplotlib.pyplot.xticks" ] ]
MustafaKadioglu/autokeras
[ "e75f3194ac4ed6741bc64583fda483dc2f6dfe09" ]
[ "autokeras/search.py" ]
[ "import os\nimport queue\nimport re\nimport time\nimport torch\nimport torch.multiprocessing as mp\n\nfrom autokeras.bayesian import BayesianOptimizer\nfrom autokeras.constant import Constant\nfrom autokeras.nn.model_trainer import ModelTrainer\nfrom autokeras.utils import pickle_to_file, pickle_from_file, verbose_...
[ [ "torch.multiprocessing.get_context", "torch.cuda.empty_cache" ] ]
agramfort/mne-python
[ "b2ad276877cc628928798aa168d782d857c2ebb9" ]
[ "mne/viz/tests/test_evoked.py" ]
[ "# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>\n# Denis Engemann <denis.engemann@gmail.com>\n# Martin Luessi <mluessi@nmr.mgh.harvard.edu>\n# Eric Larson <larson.eric.d@gmail.com>\n# Cathy Nangini <cnangini@gmail.com>\n# Mainak Jas <mainak@neuro...
[ [ "matplotlib.use", "numpy.testing.assert_raises", "matplotlib.pyplot.close" ] ]
sdpython/mlinsights
[ "bae59cda775a69bcce83b16b88df2f34a092cb60", "bae59cda775a69bcce83b16b88df2f34a092cb60", "bae59cda775a69bcce83b16b88df2f34a092cb60" ]
[ "mlinsights/mlmodel/kmeans_l1.py", "_unittests/ut_mlmodel/test_extended_features.py", "_unittests/ut_sklapi/test_sklearn_convert.py" ]
[ "# pylint: disable=C0302\n\"\"\"\n@file\n@brief Implements k-means with norms L1 and L2.\n\"\"\"\nimport warnings\nimport numpy\nfrom scipy.sparse import issparse\nfrom sklearn.cluster import KMeans\nfrom sklearn.cluster._kmeans import _tolerance as _tolerance_skl\nfrom sklearn.exceptions import ConvergenceWarning\...
[ [ "numpy.argmin", "numpy.minimum", "numpy.median", "numpy.where", "sklearn.utils.check_array", "sklearn.metrics.pairwise.euclidean_distances", "sklearn.cluster._kmeans._check_normalize_sample_weight", "numpy.empty", "numpy.log", "sklearn.utils.extmath.stable_cumsum", "skl...
uskfujino/optuna
[ "15a1878f80b3dc6f064d8d654509154004f9f46f" ]
[ "tests/integration_tests/test_xgboost.py" ]
[ "import numpy as np\nimport pytest\nimport xgboost as xgb\n\nimport optuna\nfrom optuna.integration.xgboost import XGBoostPruningCallback\nfrom optuna.testing.integration import create_running_trial\nfrom optuna.testing.integration import DeterministicPruner\n\n\ndef test_xgboost_pruning_callback_call():\n # typ...
[ [ "numpy.ones", "numpy.asarray" ] ]
Loisel/colorview2d
[ "20aa3cb1992d1b34bf96b14def80b784055311ae", "20aa3cb1992d1b34bf96b14def80b784055311ae" ]
[ "test/test_tutorial.py", "colorview2d/mods/Smooth.py" ]
[ "# coding: utf-8\nimport colorview2d\nimport numpy as np\ndata = np.random.random((100, 100))\nxrange = (0., 0.1)\nyrange = (0., 0.2)\ndata = colorview2d.Data(data, (yrange, xrange))\nview = colorview2d.View(data)\nview.config['Xlabel'] = 'foo (f)'\nview.config['Ylabel'] = 'bar (b)'\nview.config['Cblabel'] = 'nicyn...
[ [ "numpy.random.random" ], [ "scipy.ndimage.filters.gaussian_filter" ] ]
jacksonhenry3/CDT
[ "0234de7faa1a6c5bf6e9dc4294038e5880592dab", "0234de7faa1a6c5bf6e9dc4294038e5880592dab" ]
[ "cdtea/visualization/plot_st.py", "cdtea/observables.py" ]
[ "import random\n\nimport platform\n\nif platform.system() == 'Darwin':\n import matplotlib\n\n matplotlib.use('MacOSX')\nimport matplotlib.pyplot as plt\nimport networkx\nimport plotly.graph_objects as go\nfrom matplotlib.collections import LineCollection\nfrom plotly import graph_objects\nfrom plotly.offline...
[ [ "matplotlib.use", "matplotlib.pyplot.annotate", "matplotlib.pyplot.fill", "matplotlib.collections.LineCollection", "matplotlib.pyplot.show", "matplotlib.pyplot.scatter", "matplotlib.pyplot.gca", "matplotlib.pyplot.axis" ], [ "numpy.array" ] ]
tholiao/learning-morph-and-ctrl
[ "6093cc7cede3b7ab2f3304d7060815712d535a2d" ]
[ "objectives/normal_obj_f.py" ]
[ "import traceback\n\nimport numpy as np\n\nfrom walkers.scalable_walker import ScalableWalker\nfrom utils.vrep_exceptions import *\nfrom cpg.cpg_gaits import DualTripod\nfrom .simulation import Simulation\nfrom utils import DEFAULT_SCENE, DEFAULT_WALKER\nfrom cpg import CpgController\nimport vrep_api.vrep as vrep\n...
[ [ "numpy.array", "numpy.asarray", "numpy.abs" ] ]
DLR-RM/moegplib
[ "501c7fff49bc98e7cb62831f4185c34523837597" ]
[ "src/moegplib/lightnni/utils/counter.py" ]
[ "\"\"\" Methods to profile the compressor. E.g. counting FLOPS.\n\nModified scripts from https://github.com/microsoft/nni\n\"\"\"\n\nimport functools\nimport torch\nimport torch.nn as nn\n\nfrom collections import Counter\nfrom prettytable import PrettyTable\n\nfrom moegplib.lightnni.compressor import PrunerModuleW...
[ [ "torch.zeros", "torch.prod", "torch.is_tensor", "torch.no_grad", "torch.Tensor" ] ]
jperuggia/ComputerVision
[ "6a36cf96dec40fe4cd5584fbc2d8e384a74a66cf" ]
[ "assignments/ps03/ps3.py" ]
[ "\"\"\"\nCS6476 Problem Set 3 imports. Only Numpy and cv2 are allowed.\n\"\"\"\nimport cv2\nimport numpy as np\n\n\ndef display_img(img, title='Image'):\n cv2.imshow(title, img)\n cv2.waitKey(0)\n cv2.destroyAllWindows()\n\n\ndef process_base_image(img, kernel_size=(5, 5), show_image=False):\n \"\"\"\n ...
[ [ "numpy.array", "numpy.ones_like", "numpy.float32", "numpy.sqrt", "numpy.linalg.solve", "numpy.int32", "numpy.indices", "numpy.linalg.inv", "numpy.int16" ] ]
soduco/icdar21-mapseg-eval
[ "4186395828b5cf16a136f2cea2f946984d062791" ]
[ "tests/test_point_detection.py" ]
[ "import numpy as np\n\nfrom icdar21_mapseg_eval.point_detection import eval_pt_detect\n\nradius_limit = 118\n\nground_truth = np.float32([\n [5710, 1170], # A\n [8080, 1170], # B\n [3330, 3530], # C\n [5710, 3550], # D\n [8085, 3540], # E\n [3327, 5922], # F\n [5715, 5940], # G\n [808...
[ [ "numpy.array", "numpy.isclose", "numpy.empty", "numpy.random.seed", "numpy.float32", "numpy.random.randint", "numpy.abs" ] ]
akern40/pybaseball
[ "55a3e35b2dd2d4fc5c59f8d3f17bfee1364a86f3" ]
[ "pybaseball/teamid_lookup.py" ]
[ "import logging\nimport os\nimport re\nfrom difflib import SequenceMatcher\nfrom typing import Dict, List, Optional, Set\nfrom datetime import date\n\nimport numpy as np\nimport pandas as pd\n\nfrom . import lahman\nfrom .datasources import fangraphs\nfrom .utils import most_recent_season\n\n_DATA_FILENAME = os.pat...
[ [ "pandas.read_csv", "numpy.mean", "pandas.concat" ] ]
AgustD-2/caw-quant-training2
[ "27f3ef5c244a6f20f7f9f0960c34488daae3c2b4" ]
[ "section3/task1/S3_task1.py" ]
[ "import websockets\r\nfrom datetime import datetime \r\nfrom binance.websockets import BinanceSocketManager\r\nfrom binance.client import Client\r\nimport os\r\nimport keys\r\n#import json\r\nimport pandas as pd\r\n\r\ndef process_msg(msg):\r\n file_exists = os.path.isfile('S3_task1.csv')\r\n old_dict=msg[\"k...
[ [ "pandas.DataFrame.from_dict" ] ]
smin0136/cyclegan
[ "a916a2428d29fe979668e4d8a7bab2a20d2dd44b" ]
[ "iscl.py" ]
[ "import functools\n\nimport imlib as im\nimport numpy as np\nimport pylib as py\nimport tensorflow as tf\nimport tensorflow.keras as keras\nimport tf2lib as tl\nimport tf2gan as gan\nimport tqdm\nfrom skimage.metrics import peak_signal_noise_ratio as psnr\nfrom skimage.metrics import structural_similarity as ssim\n...
[ [ "numpy.concatenate", "tensorflow.abs", "tensorflow.GradientTape", "tensorflow.losses.MeanAbsoluteError", "tensorflow.image.convert_image_dtype", "tensorflow.Variable", "tensorflow.print", "tensorflow.clip_by_value", "tensorflow.math.reduce_max", "tensorflow.image.ssim", ...
SamuelXJames/SRKernels
[ "103adb523b5e963571b933693c67d5fef5793b0e" ]
[ "Kernel_Generator/utils/wgan_clipping.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sun Nov 8 21:00:36 2020\r\n\r\n@author: S\r\n\"\"\"\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nfrom torch.autograd import Variable\r\nimport time as t\r\nimport matplotlib.pyplot as plt\r\nplt.switch_backend('agg')\r\nimport os\r\nfrom utils.tensorboard_logger ...
[ [ "matplotlib.pyplot.switch_backend", "torch.rand", "torch.autograd.Variable", "torch.nn.Tanh", "torch.FloatTensor", "torch.nn.ConvTranspose2d", "torch.nn.BatchNorm2d", "torch.nn.LeakyReLU", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.InstanceNorm2d", "torch.load", ...
PEAT-AI/serving-utils
[ "5d69d110cb92f0bae3a158582fc49d20a5e9a944" ]
[ "serving_utils/tests/test_freeze_graph.py" ]
[ "import pytest\nimport numpy as np\n\nfrom ..freeze_graph import freeze_graph, create_session_from_graphdef\nfrom .mock_model import MockModel\n\n\n@pytest.fixture\ndef x_test():\n return np.random.rand(5, 10).astype('float32')\n\n\n@pytest.fixture\ndef y_test(x_test):\n batch_size, dims = x_test.shape\n r...
[ [ "numpy.random.rand" ] ]
raudipra/ATMC
[ "650b1d1bbaa0642c5d362048256a5022a25d93eb", "650b1d1bbaa0642c5d362048256a5022a25d93eb" ]
[ "svhn/wrn/wideresnet_abcv2.py", "cifar100/resnet/resnet_abcv2.py" ]
[ "import math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport wideresnet_super as wrnsuper\nimport sys\nimport os\nfile_path = os.path.dirname(__file__)\nsys.path.append(os.path.join(file_path, '../../super_module'))\nsys.path.append(os.path.join(file_path, '../'))\nsys.path.append(file...
[ [ "torch.randn" ], [ "torch.randn" ] ]
CeasonCui/FeatureLearningRotNet
[ "ffc51ae2b128229dc84314272da1d97713291062" ]
[ "architectures/LinearClassifier.py" ]
[ "# -*- coding: UTF-8 -*-\nimport math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\n\nclass Flatten(nn.Module):\n def __init__(self):\n super(Flatten, self).__init__()\n\n def forward(self, feat):\n return feat.view(feat.size(0), -1)\n\nclass Classifi...
[ [ "torch.nn.Linear", "torch.nn.AdaptiveMaxPool2d", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "numpy.sqrt", "torch.nn.AdaptiveAvgPool2d" ] ]
martinResearch/xarray
[ "e921d1bfa4785b10310f8b5d46a1efacba7e1cc9" ]
[ "xarray/plot/plot.py" ]
[ "\"\"\"\nUse this module directly:\n import xarray.plot as xplt\n\nOr use the methods on a DataArray or Dataset:\n DataArray.plot._____\n Dataset.plot._____\n\"\"\"\nimport functools\n\nimport numpy as np\nimport pandas as pd\n\nfrom .facetgrid import _easy_facetgrid\nfrom .utils import (\n _add_colorba...
[ [ "pandas.notnull", "numpy.asarray", "numpy.shape", "numpy.ma.ones", "numpy.any", "numpy.ravel", "numpy.ma.concatenate", "numpy.issubdtype", "numpy.broadcast_to" ] ]
HuanjunWang/AlphaZero_Gomoku
[ "c388492f4a49c1cbe9d3b7a939d499bd2cd7b718" ]
[ "train.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nAn implementation of the training pipeline of AlphaZero for Gomoku\n\n@author: Junxiao Song\n\"\"\"\n\nfrom __future__ import print_function\nimport random\nimport time\n\nimport numpy as np\nfrom collections import defaultdict, deque\nfrom game import Board, Game\nfrom mcts_pure i...
[ [ "numpy.rot90", "numpy.array", "numpy.log", "numpy.flipud", "numpy.fliplr" ] ]
WestCityInstitute/KAIR
[ "3eb3cc7776fa8c57e8ed7c71bfa8039beb4c6677" ]
[ "data/dataset_srmd.py" ]
[ "import random\nimport numpy as np\nimport torch\nimport torch.utils.data as data\nimport utils.utils_image as util\nfrom utils import utils_sisr\n\n\nimport hdf5storage\nimport os\n\n\nclass DatasetSRMD(data.Dataset):\n '''\n # -----------------------------------------\n # Get L/H/M for noisy image SR wit...
[ [ "torch.zeros", "torch.cat", "numpy.dot", "numpy.random.rand", "numpy.reshape", "torch.FloatTensor", "torch.from_numpy", "numpy.float32", "numpy.random.uniform", "numpy.random.randint", "numpy.sqrt" ] ]
hxb1997/Menge
[ "7a09a6236d8eef23e3d15d08873d5918d064761b" ]
[ "out/trajectory.py" ]
[ "# Various utilities for playing with trajectories\n\nimport numpy as np\n\ndef firstDerivForward( x, dt, k=1 ):\n '''Given a time-dependent value, x, computes the first derivative.\n It uses the first-order forward-difference approach\n\n @param x: an Nx1 numpy array. The uniformly sampled time-dependent...
[ [ "numpy.array", "numpy.sqrt", "numpy.nonzero" ] ]
gonzaloriquelme/Tarea3-WebIntelligence
[ "ff544649acb96953ef8621f1beb1788689d166e2" ]
[ "recommenders.py" ]
[ "#!/usr/bin/env python\n\nimport numpy as np\nfrom scipy.optimize import fmin_cg\nfrom scipy.sparse.linalg import svds\nfrom sklearn.metrics.pairwise import pairwise_distances\n\n\nclass ModelBasedRecommender():\n def __init__(self, lambda_=0.1, n_features=20):\n self.lambda_ = lambda_\n self.n_fea...
[ [ "numpy.square", "numpy.zeros_like", "numpy.random.rand", "numpy.savetxt", "numpy.zeros", "numpy.mean", "numpy.nonzero", "numpy.loadtxt", "scipy.optimize.fmin_cg", "numpy.argsort", "numpy.clip", "numpy.sqrt", "numpy.vstack" ] ]
clayton-ho/EGGs
[ "e1aecb2c1c2bec59e2741077a288d0706b6df5a2" ]
[ "lib/clients/cryovac_clients/RGA_client.py" ]
[ "import numpy as np\nfrom datetime import datetime\n\nfrom twisted.internet.defer import inlineCallbacks\nfrom EGGS_labrad.lib.clients.cryovac_clients.RGA_gui import RGA_gui\n\n\nclass RGA_client(RGA_gui):\n\n name = 'RGA Client'\n BUFFERID = 289961\n\n def __init__(self, reactor, cxn=None, parent=None):\n...
[ [ "numpy.array" ] ]
konsoz/tensorflow
[ "6aa83398ab03bfae822f36772757097bcb98b6ed" ]
[ "tensorflow/python/training/tracking/util_with_v1_optimizers_test.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.training.tracking.tracking.AutoTrackable", "tensorflow.python.training.tracking.graph_view.ObjectGraphView", "tensorflow.python.eager.context.graph_mode", "tensorflow.python.ops.variable_scope.variable_scope", "tensorflow.python.ops.variable_scope.get_variable", "tensorf...
Theerit/bert
[ "2251eac7031f5ca4e7fdcec88c3c96a4a1595cff" ]
[ "examples/run_squad_predict.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/l...
[ [ "torch.device", "torch.cuda.manual_seed_all", "torch.isnan", "numpy.random.seed", "torch.distributed.init_process_group", "torch.no_grad", "torch.utils.data.SequentialSampler", "torch.nn.parallel.DistributedDataParallel", "torch.cuda.device_count", "torch.manual_seed", ...
jtrpinto/SecureTL
[ "8c131ece280ed7206cb14c5ffcc6d03e250287de" ]
[ "face_prepare_ytfdb.py" ]
[ "'''\nSecure Triplet Loss Project Repository (https://github.com/jtrpinto/SecureTL)\n\nFile: face_prepare_ytfdb.py\n- Takes the YouTube Faces aligned images database and prepares everything to\n be used in the Secure Triplet Loss training and experiments.\n\n\"Secure Triplet Loss: Achieving Cancelability and Non-L...
[ [ "numpy.random.seed", "numpy.save", "numpy.concatenate" ] ]
jm4474/FOMCTextAnalysis
[ "0a039d9b197f487d8ba8c5d230b587c48cf865f6" ]
[ "src/analysis/python/scripts/indirect/produce_statement_availability.py" ]
[ "\n\"\"\"\nPurpose: Produce summary statistics for the statements\nStatus: Draft\n@author: olivergiesecke\n\"\"\"\n\n\nimport pandas as pd\nimport numpy as np\nfrom auxfunction_tablecreation import create_table_df \n\ndata_df=pd.read_csv('../../../derivation/python/output/meeting_derived_file.csv')\n\n# Restri...
[ [ "pandas.read_csv", "pandas.pivot_table" ] ]
rish-16/Simulated-Annealing-Attack
[ "0541bc21863ca1a6e9e5ee6a05d5090de9cd8d83" ]
[ "src/utils.py" ]
[ "import numpy as np\n\nclass Mask:\n def superimpose(self, image):\n w = image.shape[0]\n h = image.shape[1]\n \n r_loc = np.random.randint(0, h)\n c_loc = np.random.randint(0, w)\n \n color = np.random.randint(0, 255) / 255\n image[r_loc][c_loc] = color\...
[ [ "numpy.random.randint" ] ]
SiddheshKukade/tensorflow-template
[ "cce8d7683a3c35424f920fbc691e70971c4b0a60" ]
[ "Linear Regression.py" ]
[ "from __future__ import absolute_import, division, print_function, unicode_literals\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom IPython.display import clear_output\nfrom six.moves import urllib\n\nimport tensorflow.compat.v2.feature_column as fc\n\nimport tensorflow as tf\n\n# ...
[ [ "tensorflow.estimator.LinearClassifier", "pandas.read_csv", "tensorflow.feature_column.numeric_column", "tensorflow.feature_column.categorical_column_with_vocabulary_list" ] ]
thlarsen13/thlarsen_uncertainty_models
[ "f274b6024d04ff1cd77570994bc3767bac049b83", "f274b6024d04ff1cd77570994bc3767bac049b83" ]
[ "uncertainty_baselines/models/bert.py", "uncertainty_baselines/models/wide_resnet.py" ]
[ "# coding=utf-8\n# Copyright 2021 The Uncertainty Baselines Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unles...
[ [ "tensorflow.sequence_mask", "tensorflow.io.gfile.GFile", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Dropout", "tensorflow.zeros_like", "tensorflow.keras.Model", "tensorflow.keras.initializers.TruncatedNormal" ], [ "tensorflow.keras.layers.add", "tensorflow.ke...
surajp92/PGML
[ "2b919d65e6467b2afdd9f58b9a72f1d5ec74132f" ]
[ "PGML-BL/Similarity_Solution/turbulent_bl.py" ]
[ "\"\"\"\nCreated on Sun Jun 20 15:29:55 2021\n\n@author: suraj\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt \nfrom scipy.integrate import odeint\n\nLx = 2.0\nnx = 500\nny = 500\nx = np.linspace(0,Lx,nx+1)\nx[0] = 1.0e-5\nuinf = 69.4\nnu = 1.388e-5\n\nRex = uinf*x/nu\n\ndelta = 0.38*x/(Rex**(1/5))\...
[ [ "scipy.integrate.odeint", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.contourf", "numpy.log", "matplotlib.pyplot.grid", "numpy.copy", "matplotlib.pyplot.ylim", "matplotlib.pyplot.legend", "matplotlib.pyplot.plot", "numpy.where", "numpy.log10", "matplotlib.pyplo...
FZfangzheng/Swin-Transformer-Semantic-Segmentation-Without-mmsegmentation
[ "becd4c412946f571aad0a2a505226274b59c9001" ]
[ "mmseg/models/backbones/swin_transformer.py" ]
[ "# --------------------------------------------------------\n# Swin Transformer\n# Copyright (c) 2021 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ze Liu, Yutong Lin, Yixuan Wei\n# --------------------------------------------------------\n\nimport torch\nimport torch.nn as nn\...
[ [ "torch.nn.Linear", "torch.zeros", "torch.nn.Dropout", "torch.cat", "torch.nn.Identity", "torch.roll", "torch.nn.Softmax", "torch.arange", "torch.nn.ModuleList", "numpy.ceil", "torch.nn.functional.interpolate", "torch.nn.init.constant_", "torch.nn.Conv2d", "t...
mciprian13/glow
[ "90f88205d9bf8baff8df5bbda51c9d138e3e668b" ]
[ "torch_glow/tests/nodes/quantized_leaky_relu_test.py" ]
[ "from __future__ import absolute_import, division, print_function, unicode_literals\n\nimport torch\nfrom tests import utils\n\n\nclass SimpleQuantizedLeakyReluModel(torch.nn.Module):\n def __init__(self, scale, zero_point, dtype):\n super(SimpleQuantizedLeakyReluModel, self).__init__()\n self.scal...
[ [ "torch.nn.quantized.Quantize", "torch.nn.quantized.DeQuantize", "torch.randn", "torch.nn.LeakyReLU" ] ]
surbhi-software/ZMOD-development
[ "44003b5dc500b18d3a2b2c6ed6fc4db217e2d2c0" ]
[ "zmk/nyokaBase/lgbm/tests/lgb_Test.py" ]
[ "import unittest\nfrom lightgbm import LGBMRegressor,LGBMClassifier\nfrom nyoka import PMML43Ext as pml\nimport nyoka.lgbm.lgb_to_pmml as lgbToPmml\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\n\nclass TestMethods(unittest.TestCase):\n\n def test_LightGradientBoostingClassifier(self...
[ [ "sklearn.model_selection.train_test_split", "pandas.read_csv" ] ]
thayerAlshaabi/DeepEye
[ "969cd2379ed79894e6f9d44ebb58d3b355427e9a" ]
[ "src/object_classifier/object_detection/utils/label_map_util.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.gfile.GFile" ] ]