repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
Myyyr/segmentation
[ "6b9423e327cff1eb23599404031b7fb8e9ecf75d" ]
[ "models/layers/loss.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.modules.loss import _Loss\nfrom torch.autograd import Function, Variable\nimport numpy as np\ndef cross_entropy_2D(input, target, weight=None, size_average=True):\n n, c, h, w = input.size()\n log_p = F.log_softmax(input, dim...
[ [ "torch.Size", "torch.nn.functional.log_softmax", "torch.LongTensor", "torch.sparse.torch.eye", "torch.nn.functional.softmax", "torch.nn.functional.nll_loss", "torch.sum" ] ]
cmuartfab/handtrack-evaluation
[ "e98d2c553b50ded19235e76f7624949ac18ab3ee" ]
[ "label_tool/labeler.py" ]
[ "# Labeling tool for creating the hand tracking dataset for Dranimate\n#\n#\n# Program reads images from a given directory and lets the user draw points on\n# the image with their mouse. These selected (x,y) coordinates are then saved\n# into a text file in a user specified output directory. The program stores all\...
[ [ "numpy.savetxt" ] ]
haofengsiji/synthetic-to-real-semantic-segmentation
[ "048b18871b07052d67f5356e6b31218c2f85b29a", "048b18871b07052d67f5356e6b31218c2f85b29a" ]
[ "modeling/backbone/mobilenet.py", "val.py" ]
[ "import os\nimport torch\nimport torch.nn.functional as F\nimport torch.nn as nn\nimport math\nfrom modeling.sync_batchnorm.batchnorm import SynchronizedBatchNorm2d\nimport torch.utils.model_zoo as model_zoo\n\ndef conv_bn(inp, oup, stride, BatchNorm):\n return nn.Sequential(\n nn.Conv2d(inp, oup, 3, stri...
[ [ "torch.rand", "torch.nn.Sequential", "torch.nn.init.kaiming_normal_", "torch.nn.ReLU6", "torch.nn.Conv2d", "torch.nn.functional.pad" ], [ "numpy.zeros", "torch.no_grad", "torch.optim.SGD", "torch.optim.Adam", "numpy.load", "torch.manual_seed", "torch.cuda.is...
veb-101/Deeplearning-Specialization-Coursera
[ "19efc9ef30133960b96a65c7babaaeeee19a34f6" ]
[ "Course 2 - Improving Deep Neural Networks/week 1/Assignment 1/init_utils.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport h5py\nimport sklearn\nimport sklearn.datasets\n\ndef sigmoid(x):\n \"\"\"\n Compute the sigmoid of x\n\n Arguments:\n x -- A scalar or numpy array of any size.\n\n Return:\n s -- sigmoid(x)\n \"\"\"\n s = 1/(1+np.exp(-x))\n retu...
[ [ "numpy.dot", "numpy.exp", "numpy.mean", "numpy.log", "numpy.arange", "sklearn.datasets.make_circles", "matplotlib.pyplot.scatter", "numpy.array", "matplotlib.pyplot.contourf", "numpy.zeros", "numpy.reshape", "numpy.nansum", "matplotlib.pyplot.show", "numpy.r...
lbcsept/keras-CenterNet
[ "18dbe80686644fc4c56cf12f8455c9214a9aae28" ]
[ "generators/common.py" ]
[ "import cv2\nimport keras\nimport math\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport random\nimport warnings\n\nfrom generators.utils import get_affine_transform, affine_transform\nfrom generators.utils import gaussian_radius, draw_gaussian, gaussian_radius_2, draw_gaussian_2\n\n\nclass Generator(ker...
[ [ "numpy.where", "numpy.array", "numpy.delete", "numpy.clip" ] ]
OlegJakushkin/s3prl
[ "c0e41f07fa56f0f79b5bf3839b4d0a4cf7c421bf" ]
[ "downstream/libri_phone/model.py" ]
[ "# -*- coding: utf-8 -*- #\n\"\"\"*********************************************************************************************\"\"\"\n# FileName [ model.py ]\n# Synopsis [ the 1-hidden model ]\n# Author [ S3PRL ]\n# Copyright [ Copyleft(c), Speech Lab, NTU, Taiwan ]\n\"\"\"****************...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.cat", "torch.nn.ModuleList", "torch.nn.Conv1d", "torch.nn.functional.relu" ] ]
Juggernaut93/SSH-pytorch
[ "9a6159c6692bac5c2f090a91f691e798c52da2b5" ]
[ "model/utils/config.py" ]
[ "import os\nimport os.path as osp\nimport numpy as np\n# `pip install easydict` if you don't have it\nfrom easydict import EasyDict as edict\n\n__C = edict()\n# Consumers can get config by:\n# from fast_rcnn_config import cfg\ncfg = __C\n\n#\n# Training options\n#\n\n__C.TRAIN = edict()\n\n# Online hard negative ...
[ [ "numpy.array" ] ]
lvrcek/consensus-net
[ "560957f315751822e1ddf8c097eb7b712ceadff3" ]
[ "experiments/karla/diplomski-rad/blade/pb/datasets/n3-all-indels/finished-experiments/model-n3-indel-5.py" ]
[ "from comet_ml import Experiment\n\nexperiment = Experiment(api_key=\"oda8KKpxlDgWmJG5KsYrrhmIV\", project_name=\"consensusnet\")\n\nimport numpy as np\nfrom keras.models import Model\nfrom keras.layers import Dense, Dropout, Activation, Flatten, BatchNormalization, Input\nfrom keras.layers import Conv1D, MaxPoolin...
[ [ "numpy.load" ] ]
eumiro/OpenOA
[ "c0d3d4125e971dc5e48b41a4ab75767ace277457" ]
[ "operational_analysis/toolkits/met_data_processing.py" ]
[ "\"\"\"\nThis module provides methods for processing meteorological data.\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nimport scipy.constants as const\n\n\ndef compute_wind_direction(u, v):\n \"\"\"Compute wind direction given u and v wind vector components\n\n Args:\n u(:obj:`pandas.Series`): t...
[ [ "numpy.sin", "numpy.isnan", "scipy.optimize.curve_fit", "numpy.log", "numpy.exp", "numpy.shape", "numpy.any", "numpy.power", "numpy.cos", "numpy.arctan2", "numpy.repeat" ] ]
lifedespicable/Python_Learning
[ "b3ec851c80a8137d64d02d15a3566af49b9a7ba7" ]
[ "Python_Learning/plt_test.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport warnings\n\nwarnings.filterwarnings('ignore')\n\n# 绘制简单的曲线\n# plt.plot([1, 3, 5], [4, 8, 10])\n# plt.show() # 这条命令没有作用,只是单纯让曲线在Pycharm当中显示\n#\n# x = np.linspace(-np.pi, np.pi, 100) # x的定义域为-3.14 ~ 3.14,中间间隔10...
[ [ "matplotlib.pyplot.show", "pandas.read_csv" ] ]
kmaehashi/numba
[ "6ecb815772900705f2bc64821a6c1fd632b2b666" ]
[ "numba/cuda/tests/cudapy/test_ipc.py" ]
[ "import multiprocessing as mp\nimport itertools\nimport traceback\nimport pickle\n\nimport numpy as np\n\nfrom numba import cuda\nfrom numba.cuda.testing import (skip_on_cudasim, skip_under_cuda_memcheck,\n ContextResettingTestCase, ForeignArray)\nimport unittest\n\n\ndef core_ipc_han...
[ [ "numpy.zeros", "numpy.testing.assert_equal", "numpy.arange", "numpy.random.random", "numpy.dtype" ] ]
emschimmel/BrainPi
[ "96c0ccb727507bcce4d48292f77bb80a77164a0c" ]
[ "1IntegrationTests/py-impl/PythonEyePiClient.py" ]
[ "#!/usr/bin/env python\n\n# not used in this project.\n\nimport sys\nsys.path.append('../gen-py')\n\nfrom EyePi.ttypes import EyePiInput\nfrom EyePi.ttypes import ConfirmInput\nfrom GenericStruct.ttypes import ActionEnum\nfrom WeatherPi.ttypes import WeatherInput\n\nfrom ConnectionHelpers.DeviceRegistrator import D...
[ [ "numpy.fromstring" ] ]
PratyushTripathy/unet
[ "bb2e552d4a239df62ad3840a9f1176437790df90" ]
[ "data.py" ]
[ "from __future__ import print_function\nfrom tensorflow.keras.preprocessing.image import ImageDataGenerator\nimport numpy as np \nimport os\nimport glob\nimport skimage.io as io\nimport skimage.transform as trans\n\nSky = [128,128,128]\nBuilding = [128,0,0]\nPole = [192,192,128]\nRoad = [128,64,128]\nPavement = [60...
[ [ "numpy.max", "tensorflow.keras.preprocessing.image.ImageDataGenerator", "numpy.array", "numpy.reshape", "numpy.zeros" ] ]
navjotts/flax
[ "5ffd0006701e4b162ae906c4f089553600d3114c" ]
[ "examples/pixelcnn/train.py" ]
[ "# Copyright 2021 The Flax 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 required by applicable law or a...
[ [ "numpy.prod", "tensorflow.io.gfile.makedirs" ] ]
cdeil/pandas
[ "1accb6e7fdf8742e0aa304abbf1531a3b9633ce8" ]
[ "pandas/core/tools/timedeltas.py" ]
[ "\"\"\"\ntimedelta support tools\n\"\"\"\n\nimport numpy as np\n\nfrom pandas._libs.tslibs import NaT\nfrom pandas._libs.tslibs.timedeltas import Timedelta, parse_timedelta_unit\n\nfrom pandas.core.dtypes.common import is_list_like\nfrom pandas.core.dtypes.generic import ABCIndexClass, ABCSeries\n\nfrom pandas.core...
[ [ "pandas._libs.tslibs.timedeltas.parse_timedelta_unit", "pandas.core.dtypes.common.is_list_like", "pandas.core.arrays.timedeltas.sequence_to_td64ns", "pandas._libs.tslibs.timedeltas.Timedelta", "pandas.TimedeltaIndex" ] ]
novabiosignals/novainstrumentation
[ "02d29983f970077613143db66d8df2bce59f8714" ]
[ "novainstrumentation/tools.py" ]
[ "import pylab as pl\r\nimport numpy as np\r\nfrom os import path\r\nfrom numpy import abs, linspace, sin, pi, int16\r\nimport pandas\r\n\r\n\r\ndef plotfft(s, fmax, doplot=False):\r\n \"\"\" This functions computes the fft of a signal, returning the frequency\r\n and their magnitude values.\r\n\r\n Paramet...
[ [ "numpy.sin", "numpy.zeros", "numpy.load", "numpy.fft.fft", "numpy.loadtxt", "numpy.arange", "pandas.read_csv" ] ]
VoIlAlex/pytorchresearch
[ "c4f08cd0ec6b78788e682005c099aef4582640cb" ]
[ "docs/example_1/back.py" ]
[ "import pytorchresearch as ptr\n\n\nimport torch\nimport torchvision\n\nif __name__ == \"__main__\":\n # transform for data\n transform = torchvision.transforms.Compose([\n torchvision.transforms.ToTensor(),\n torchvision.transforms.Normalize(\n mean=(0.485, 0.456, 0.406),\n ...
[ [ "torch.nn.CrossEntropyLoss", "torch.cuda.is_available", "torch.utils.data.DataLoader" ] ]
litchiar/ArknightsAutoHelper
[ "55cc4c751ba899aaa3cabe4222687a6ef930f267" ]
[ "addons/start_sp_stage/__init__.py" ]
[ "import logging\nimport os\nimport random\nimport time\nfrom functools import lru_cache\n\nimport cv2\nimport numpy as np\n\nimport imgreco.main\nfrom Arknights.helper import logger\nfrom addons.activity import ActivityAddOn, get_stage_map\nfrom addons.base import BaseAddOn, pil2cv, crop_cv_by_rect, show_img\nfrom ...
[ [ "numpy.where" ] ]
Nnemr/PRNet
[ "9176a943377f925d56ce361a47eb0957afa13edc" ]
[ "get_300WLP_maps.py" ]
[ "''' \nGenerate uv position map of 300W_LP.\n'''\nimport os, sys\nimport numpy as np\nimport scipy.io as sio\nimport random as ran\nfrom skimage.transform import SimilarityTransform\nfrom skimage import io, util\nimport skimage.transform\nfrom time import time\nimport cv2\nimport matplotlib.pyplot as plt\nsys.path....
[ [ "numpy.max", "numpy.array", "numpy.dot", "numpy.random.rand", "numpy.zeros", "scipy.io.loadmat", "numpy.min", "numpy.deg2rad", "numpy.squeeze" ] ]
lannguyen0910/theseus
[ "5c08fb2f4a9c7ffa395788e6a0ade43780e8bd7d" ]
[ "theseus/classification/trainer/trainer.py" ]
[ "import torch\nfrom torchvision.transforms import functional as TFF\nimport matplotlib.pyplot as plt\nfrom theseus.base.trainer.supervised_trainer import SupervisedTrainer\nfrom theseus.utilities.loading import load_state_dict\nfrom theseus.classification.utilities.gradcam import CAMWrapper, show_cam_on_image\nfrom...
[ [ "torch.enable_grad", "torch.no_grad", "matplotlib.pyplot.figure", "matplotlib.pyplot.tight_layout", "torch.load", "matplotlib.pyplot.axis", "matplotlib.pyplot.imshow" ] ]
microsoft/DistributedBERT
[ "e6245fee4d7123466a3e3b53f8afacffd6baa75f" ]
[ "run_pretraining.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team 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# Unl...
[ [ "tensorflow.data.TFRecordDataset", "tensorflow.python.debug.LocalCLIDebugHook", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.metrics.mean", "tensorflow.nn.softmax", "tensorflow.train.ProfilerHook", "tensorflow.one_hot", "tensorflow.parse_single_example", "tensorfl...
TristanHehnen/propti
[ "4aa52ea5f47a1497df6ae4e6f61cdfc680cce69a", "4aa52ea5f47a1497df6ae4e6f61cdfc680cce69a" ]
[ "propti/propti_pre_processing.py", "propti/spotpy_wrapper.py" ]
[ "import re\nimport os\nimport sys\nimport shutil as sh\nimport logging\n\nimport propti as pr\n\nimport statistics as stat\nimport numpy as np\nimport pandas as pd\nfrom scipy import stats\nfrom scipy import interpolate\nimport scipy.signal as sign\nfrom scipy.stats import norm\nimport matplotlib as mpl\nmpl.use('p...
[ [ "matplotlib.use", "scipy.interpolate.interp1d", "scipy.signal.savgol_filter", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.savefig", "matplotlib.pyplot.figure", ...
hoshigakky/shinma_bot
[ "23d21f7a69f8e0b33270072baeaa18a62f334469" ]
[ "utils/opencv_util.py" ]
[ "import logging\nimport cv2\nimport numpy as np\n\n# loggerの子loggerオブジェクトの宣言\nfrom const.constants import constant_list, FIRST_LEFT_Y, FIRST_RIGHT_Y, FIRST_LEFT_X, FIRST_RIGHT_X, SECOND_LEFT_Y, \\\n SECOND_RIGHT_Y, SECOND_LEFT_X, SECOND_RIGHT_X, TYPE_PATHS\n\nfrom const.constants import TMP_SCREEN_SHOT_PATH\n\nl...
[ [ "numpy.array" ] ]
franneck94/UdemyAI
[ "bb3decc35ec626a09edf0abdbfbe7c36dac6179a", "bb3decc35ec626a09edf0abdbfbe7c36dac6179a" ]
[ "Chapter10_DeepQNetworks/FrozenLake/frozenLakeDqn.py", "Chapter4_OpenAIGym/gymGamesAgent.py" ]
[ "import numpy as np\nfrom tensorflow.keras.layers import Activation\nfrom tensorflow.keras.layers import Dense\nfrom tensorflow.keras.layers import Input\nfrom tensorflow.keras.models import Model\nfrom tensorflow.keras.optimizers import Adam\n\n\nclass DQN(Model):\n def __init__(self, state_shape: int, num_acti...
[ [ "tensorflow.keras.layers.Input", "tensorflow.keras.layers.Activation", "tensorflow.keras.models.Model", "tensorflow.keras.layers.Dense", "tensorflow.keras.optimizers.Adam" ], [ "numpy.max", "numpy.min", "numpy.mean" ] ]
nuwang/tools-iuc
[ "e6dda21d0488a7792a672db197c7937e8828885b" ]
[ "tools/variant_analyzer/mut2read.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"mut2read.py\n\nAuthor -- Gundula Povysil\nContact -- povysil@bioinf.jku.at\n\nTakes a tabular file with mutations and a BAM file as input and prints\nall tags of reads that carry the mutation to a user specified output file.\nCreates fastq file of reads of tags with mutation.\n\n====...
[ [ "numpy.array", "numpy.genfromtxt" ] ]
GSNCodes/CSCI-5551-PackBot
[ "5c0269c9f499b271b7961839f1c0bffb273572f3" ]
[ "Aruco/aruco_test.py" ]
[ "import argparse\nimport imutils\nfrom imutils.video import VideoStream\nimport time\nimport cv2\nimport sys\nimport os\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# all tags supported by cv2\nARUCO_DICT = {\n\t\"DICT_4X4_50\": cv2.aruco.DICT_4X4_50,\n\t\"DICT_4X4_100\": cv2.aruco.DICT_4X4_100,\n\t\"DIC...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.zeros" ] ]
vlasenkoalexey/tensorflow_serving_benchmark
[ "c8b9c26ab6026cb91bf4a5183e0f4bd182b1888f" ]
[ "clients/triton_rest.py" ]
[ "\"\"\"Client for Triton Inference Server using REST API.\n\nReferences:\n-\nhttps://github.com/kubeflow/kfserving/blob/master/docs/predict-api/v2/required_api.md#httprest\n-\nhttps://github.com/triton-inference-server/client/tree/master/src/python/examples\n-\nhttps://github.com/triton-inference-server/client/blob...
[ [ "numpy.array", "tensorflow.compat.v1.gfile.GFile" ] ]
jbarrow/variational-item-response-theory-public
[ "1e40eb2685908c48a7111ad64971024fe4eb0110" ]
[ "src/torch_core/infer.py" ]
[ "\"\"\"Create infer_dict for VIBO_ models.\"\"\"\n\nimport os\nfrom tqdm import tqdm\n\nimport torch\nfrom src.torch_core.models import (\n VIBO_1PL, \n VIBO_2PL, \n VIBO_3PL,\n)\nfrom src.datasets import load_dataset\n\n\nif __name__ == \"__main__\":\n import argparse\n parser = argparse.ArgumentPar...
[ [ "torch.device", "torch.cat", "torch.save", "torch.no_grad", "torch.cuda.set_device", "torch.utils.data.DataLoader", "torch.load" ] ]
dotslash/Ganymede
[ "e096258b95d42e9d622c06de0b30adc9c3fae2c0" ]
[ "kg:jigsaw-unintended-bias-in-toxicity-classification/simple_model.py" ]
[ "import datetime\nfrom typing import List, Tuple, Dict, Callable\n\nimport numpy as np\nimport pandas\nimport tensorflow as tf\nfrom keras.callbacks import LearningRateScheduler\nfrom keras.initializers import Constant\nfrom keras.layers import Bidirectional, GlobalMaxPooling1D\nfrom keras.layers import Embedding\n...
[ [ "numpy.concatenate", "numpy.asarray", "numpy.zeros", "numpy.random.shuffle", "numpy.where", "numpy.average", "pandas.read_csv" ] ]
heytitle/schnetpack
[ "6facf724e6e220053f4ba8d5b81744744d1abef3" ]
[ "src/scripts/schnetpack_md17.py" ]
[ "#!/usr/bin/env python\nimport argparse\nimport logging\nimport os\nfrom shutil import copyfile, rmtree\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom ase.data import atomic_numbers\nfrom torch.optim import Adam\nfrom torch.utils.data.sampler import RandomSampler\n\nimport schnetpack as spk\nfrom ...
[ [ "torch.device", "numpy.array", "torch.utils.data.sampler.RandomSampler", "torch.optim.Adam", "torch.nn.DataParallel" ] ]
anikaanzum/NetworkDataAnalysis
[ "13f008233ccb4e7c16a576a6e068daf9c14510d6" ]
[ "k-means.py" ]
[ "import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n# Though the following import is not directly being used, it is required\n# for 3D projection to work\nfrom mpl_toolkits.mplot3d import Axes3D\n\nfrom sklearn.cluster import KMeans\nfrom...
[ [ "numpy.random.seed", "sklearn.cluster.KMeans", "numpy.choose", "matplotlib.pyplot.figure", "sklearn.datasets.load_iris" ] ]
Berk035/SimStar-Racer
[ "6deec22b02ed80195bf854d1ccce164ebc724d13" ]
[ "sac_example/simstarEnv.py" ]
[ "import gym\nimport collections as col\nimport numpy as np \nimport time\nfrom gym import spaces\n\ntry:\n import simstar\nexcept ImportError:\n print(\"go to PythonAPI folder where setup.py is located\")\n print(\"python setup.py install\")\n\nclass SensoredVehicle(simstar.Vehicle):\n def __init__(self...
[ [ "numpy.array", "numpy.sin", "numpy.min", "numpy.abs", "numpy.sqrt", "numpy.cos" ] ]
peter-ho/mlfinlab
[ "54d3ff004095b1354095811fe0dc64b3691dc76b" ]
[ "mlfinlab/tests/test_risk_metrics.py" ]
[ "# pylint: disable=missing-module-docstring\nimport unittest\nimport os\nimport pandas as pd\nfrom mlfinlab.portfolio_optimization.risk_metrics import RiskMetrics\n\n\nclass TestRiskMetrics(unittest.TestCase):\n \"\"\"\n Tests different risk metrics calculation from the RiskMetrics class.\n \"\"\"\n\n d...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
justinbooms/imu-positioning
[ "26f33b4021ba824a44bc329ab4dc0c0c2dbfbbd0" ]
[ "measure/measure_sum.py" ]
[ "\"\"\"Continuous Reading of Sensors\n\nMake continuous readings from the sensors and begin\na take measurements function.\n\nWe Believe the Following:\nMagnet x: \nMagnet y:\nMagnet z:\nEuler Heading: Dir w/ 0 being North 90 East, 180 South, 270 West\nEuler Roll:\nEuler Pitch: Angle up \nAccel x:\nAccel y:\nAccel ...
[ [ "numpy.arctan2" ] ]
CermakM/cryptoanalysis
[ "02c157daa046915b46451eeec3bde93860082abc" ]
[ "cryptoanalysis/analysis/decryption.py" ]
[ "\"\"\"Decryption tools\"\"\"\n\nimport numpy as np\nimport pandas as pd\n\nfrom collections import Counter, deque\nfrom matplotlib import pyplot as plt\nfrom cryptoanalysis.cipher import vigener\n\nimport cryptoanalysis\n\nMETA_DIR = \"%s/meta\" % cryptoanalysis.__path__[0]\n\n\nclass Analyser:\n\n def __init__...
[ [ "numpy.array", "numpy.empty", "pandas.DataFrame.from_dict", "numpy.where", "numpy.resize", "numpy.argmax", "matplotlib.pyplot.show" ] ]
QRemy/gammapy-benchmarks
[ "7f6170e88284958056fbdf468fb890787a13f153" ]
[ "benchmarks/io.py" ]
[ "# To check the reading/writing performance of DL3 data\nimport logging\nimport numpy as np\nimport time\nimport yaml\nimport os\nfrom gammapy.data import DataStore\nfrom gammapy.maps import Map\n\nN_OBS = int(os.environ.get(\"GAMMAPY_BENCH_N_OBS\", 10))\n\ndef run_benchmark():\n info = {\"n_obs\": N_OBS}\n\n ...
[ [ "numpy.ones" ] ]
chengdazhi/mmdetection
[ "08cb54216479e59b4e4fad19ea2c9b3c72fb0405" ]
[ "mmdet/datasets/phillyzip.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport zipfile\n\nimport cv2\nimport numpy as np\n\n_im_zfile = []\n\ndef imread(filename, flags=cv2.IMREAD_COLOR):\n global _im_zfile\n path = filename\n pos_at = path.index('@')\n...
[ [ "numpy.frombuffer" ] ]
informaton/GPflow
[ "164d90d78c1c6fd966ae19ebaee59b9241bcba39" ]
[ "tests/test_logdensities.py" ]
[ "# Copyright 2018 the GPflow 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 required by applicable law or agr...
[ [ "numpy.testing.assert_allclose", "tensorflow.convert_to_tensor", "numpy.dot", "numpy.random.RandomState", "scipy.stats.multivariate_normal.logpdf", "numpy.random.randn", "numpy.eye", "tensorflow.placeholder", "numpy.linalg.cholesky", "tensorflow.identity" ] ]
ess-dmsc/nicos
[ "755d61d403ff7123f804c45fc80c7ff4d762993b" ]
[ "nicos/clients/gui/widgets/plotting.py" ]
[ "# -*- coding: utf-8 -*-\n# *****************************************************************************\n# NICOS, the Networked Instrument Control System of the MLZ\n# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)\n#\n# This program is free software; you can redistribute it and/or modify it und...
[ [ "numpy.array", "numpy.savetxt", "numpy.asarray", "numpy.log", "numpy.stack", "numpy.isfinite" ] ]
ofir-frd/Machine-Learning-Bootcamp
[ "71233cf3764b528c39438d5d45b433f094456717" ]
[ "gradient-boosting/main.py" ]
[ "import numpy as np\r\nimport pandas as pd\r\nfrom sklearn.tree import DecisionTreeRegressor\r\nfrom sklearn.model_selection import KFold\r\nimport plotly.express as px\r\nfrom plotly.subplots import make_subplots\r\nimport plotly.graph_objects as go\r\n\r\n\r\n# import data and preprocess it\r\ndef preprocessing(f...
[ [ "numpy.square", "numpy.array", "pandas.DataFrame", "numpy.arange", "sklearn.tree.DecisionTreeRegressor", "sklearn.model_selection.KFold", "pandas.read_csv", "pandas.get_dummies" ] ]
DimitriPapadopoulos/python-caterva
[ "f2162c2cdaea8a818ad948afee1555db3747e3a3" ]
[ "tests/test_copy.py" ]
[ "#######################################################################\n# Copyright (C) 2019-present, Blosc Development team <blosc@blosc.org>\n# All rights reserved.\n#\n# This source code is licensed under a BSD-style license (found in the\n# LICENSE file in the root directory of this source tree)\n############...
[ [ "numpy.testing.assert_almost_equal", "numpy.prod", "numpy.arange", "numpy.asarray" ] ]
DAIRLab/drake-pytorch
[ "3c7e33d58f1ad26008bd89f3e0fe1951b5175d3b" ]
[ "rigid_chain_performance_test.py" ]
[ "from abc import ABC, abstractmethod\nfrom dataclasses import dataclass\nfrom typing import List, Tuple, Callable, Type, Union, Optional\n\nimport torch\nfrom torch import Tensor\nfrom torch.nn import Module, ModuleList, Parameter, ParameterList\nimport drake_pytorch\nimport numpy as np\n\nfrom pydrake.all import (...
[ [ "numpy.hstack", "torch.tensor", "numpy.vstack" ] ]
MatthewAlexanderFisher/GaussED
[ "492473991d47d4acc4155e34389b47cebf0eb664" ]
[ "src/gaussed/basis/laplace.py" ]
[ "import math\nfrom functools import lru_cache\nimport torch\n\nfrom gaussed.basis.base import Basis\nfrom gaussed.utils.summation_tensor_gen import sum_tensor_gen\n\n\ndef diff_basis_func_gen(order):\n \"\"\"Generates t\n\n Args:\n order ([type]): [description]\n\n Raises:\n TypeError: [descr...
[ [ "torch.zeros", "torch.cos", "torch.stack", "torch.sin", "torch.ones", "torch.Tensor" ] ]
tomwhite/gimmemotifs
[ "984399eaef3f05fd04c0b45c62efe9d287aaccf8" ]
[ "gimmemotifs/preprocessing.py" ]
[ "# Copyright (c) 2009-2020 Simon van Heeringen <simon.vanheeringen@gmail.com>\n#\n# This module is free software. You can redistribute it and/or modify it under\n# the terms of the MIT License, see the file COPYING included with this\n# distribution.\n\n\"\"\" Data preprocessing to create GimmeMotifs input. \"\"\"\...
[ [ "pandas.read_table", "pandas.DataFrame", "numpy.log1p", "sklearn.preprocessing.scale", "pandas.concat" ] ]
Horsmann/LREC2018-DeepTC
[ "8451c20c2a36f4ab7b3c0ead352490a8e5f8db6a" ]
[ "de.unidue.ltl.LREC2018_keras/src/main/resources/kerasCode/posTaggingLstmBatchOne.py" ]
[ "from sys import argv\nimport numpy as np\nimport sys\nimport argparse\n\nnp.set_printoptions(threshold=np.nan)\n\ndef numpyizeVector(vec):\n\tvout=[]\n\tfile = open(vec, 'r')\n\tfor l in file.readlines():\n\t\tl = l.strip()\n\t\tv = [int(x) for x in l.split()]\n\t\tvout.append(v)\n\tfile.close()\n\treturn np.asarr...
[ [ "numpy.random.seed", "numpy.set_printoptions", "numpy.asarray", "numpy.random.shuffle" ] ]
Vikas89/private-mxnet
[ "7797584450186d36e52c902c3b606f4b4676e0a3" ]
[ "python/mxnet/image/image.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.random.normal", "numpy.array", "numpy.dot", "numpy.sin", "numpy.cos", "numpy.frombuffer", "numpy.sqrt" ] ]
imk1/MethylationQTLCode
[ "d193f518994074a29a39e081d470b1c67a95a527" ]
[ "correlateSNPsMethylationPlusPlus.py" ]
[ "def makeIntDict(intDictFileName):\n\t# Make a dictionary from pairs of ints in a file\n\tintDictFile = open(intDictFileName)\n\tintDict = {}\n\t\n\tfor line in intDictFile:\n\t\t# Iterate through the lines of the int dictionary file and enter each into the dictionary\n\t\tlineElements = line.strip().split(\"\\t\")...
[ [ "scipy.stats.pearsonr" ] ]
Guymer/PyGuymer3
[ "c2e2788a8b65854fa1e84d6ba5017fb2544fc195" ]
[ "pyguymer3/media/return_ISO_palette.py" ]
[ "def return_ISO_palette(fname, kwArgCheck = None, usr_track = -1, errors = \"replace\"):\n # Import standard modules ...\n import html\n import os\n import shutil\n import subprocess\n\n # Import special modules ...\n try:\n import lxml\n import lxml.etree\n except:\n ra...
[ [ "numpy.zeros" ] ]
DavidKatz-il/filesystem_spec
[ "449faf44c35a501df28ffd723191aeef77021a7e" ]
[ "fsspec/tests/test_spec.py" ]
[ "import json\nimport pickle\n\nimport numpy as np\nimport pytest\n\nimport fsspec\nfrom fsspec.implementations.ftp import FTPFileSystem\nfrom fsspec.spec import AbstractFileSystem, AbstractBufferedFile\n\n\nclass DummyTestFS(AbstractFileSystem):\n protocol = \"mock\"\n _fs_contents = (\n {\"name\": \"t...
[ [ "numpy.arange", "numpy.array_equal", "numpy.empty_like" ] ]
samcw/nanodet
[ "dc7c4f6021199d6988221b516d49af392a52d748" ]
[ "nanodet/model/backbone/ghostnet.py" ]
[ "\"\"\"\n2020.06.09-Changed for building GhostNet\nHuawei Technologies Co., Ltd. <foss@huawei.com>\nCreates a GhostNet Model as defined in:\nGhostNet: More Features from Cheap Operations By Kai Han, Yunhe Wang,\nQi Tian, Jianyuan Guo, Chunjing Xu, Chang Xu.\nhttps://arxiv.org/abs/1911.11907\nModified from https://g...
[ [ "torch.cat", "torch.nn.functional.relu6", "torch.nn.Sigmoid", "torch.nn.Conv1d", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.nn.init.constant_", "torch.nn.ReLU6", "torch.nn.Conv2d", "torch.nn.init.normal_", "torch.hub.load_state_dict_from_url", "torch.nn.A...
wangck20/GeDML
[ "1f76ac2094d7b88be7fd4eb6145e5586e547b9ca" ]
[ "src/gedml/launcher/managers/base_manager.py" ]
[ "import torch\nfrom torch.nn.parallel import DistributedDataParallel as DDP\nimport torch.distributed as dist \nimport logging\nimport pandas as pd \nimport traceback\n\nfrom ...core import models\nfrom ..misc import utils\n\nclass BaseManager:\n \"\"\"\n Manager all modules and computation devices. Support t...
[ [ "torch.distributed.get_world_size", "pandas.DataFrame", "torch.nn.parallel.DistributedDataParallel", "torch.cuda.empty_cache", "torch.cuda.is_available", "torch.nn.DataParallel" ] ]
RuiNian7319/Woodberry_Distillation
[ "4ee8ab9de8e313bca48d9a7af9393abcad85ece4" ]
[ "Benchmark_Plots/Optimal_input_plots/plotting.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\n# Load Data\ntransfer_function = np.loadtxt('transfer_function.csv', delimiter=',')\nmatlab_state_space = np.loadtxt('state_space.csv', delimiter=',')\npython_state_space = np.loadtxt('python_state_space.csv')\n\n\"\"\"\nMath Plotting Library settings\n\"\"\"\...
[ [ "matplotlib.pyplot.xlim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.rc", "numpy.loadtxt", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "matplotlib.pyplot.subplot" ] ]
Tobi-Alonso/ResNet50-PYNQ
[ "7c203c2b249479c5384afe152dde2bb06576339b" ]
[ "host/synth_bench_power.py" ]
[ "# Copyright (c) 2019, Xilinx\n# All rights reserved.\n# \n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n# \n# 1. Redistributions of source code must retain the above copyright notice, this\n# list of c...
[ [ "pandas.DataFrame", "numpy.genfromtxt" ] ]
BehaviorPredictionTestingPlatform/VerifAI
[ "db05f3573c2e7d98c03029c1b4efca93e6b08edb" ]
[ "examples/openai_gym/cartpole/cartpole_simulation.py" ]
[ "from verifai.simulators.openai_gym.baselines_task import *\nfrom verifai.simulators.openai_gym.client_gym import *\nfrom dotmap import DotMap\nimport numpy as np\n\n# 0 for control only, 1 for training only and >=2 for both\nsample_type = 0\nclass cartpole_standing(control_task):\n def __init__(self, baselines_...
[ [ "numpy.array", "numpy.abs" ] ]
gregtucker/facetmorphology
[ "0bad54943b825f2742ebc3ee4e82a7d2f47ed2d7" ]
[ "ModelRunScripts/SensitivityAnalysisDandV/run_v_w.py" ]
[ "#!/usr/bin/env python2\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Jul 5 09:10:56 2018\n\n@author: gtucker\n\"\"\"\n\nimport numpy as np\nimport datetime\nfrom grainhill import GrainFacetSimulator\nfrom grainhill import SlopeMeasurer\nimport landlab\nfrom landlab.io.native_landlab import save_grid\nimport os...
[ [ "numpy.arctan", "numpy.arange" ] ]
JiaxiangBU/link-prediction
[ "8fd569dae07cc4fc2972e2fb97cce0fb00875111" ]
[ "gae/initializations.py" ]
[ "import tensorflow as tf\nimport numpy as np\n\ndef weight_variable_glorot(input_dim, output_dim, dtype=tf.float32, name=\"\"):\n \"\"\"Create a weight variable with Glorot & Bengio (AISTATS 2010)\n initialization.\n \"\"\"\n init_range = np.sqrt(6.0 / (input_dim + output_dim))\n initial = tf.random_...
[ [ "tensorflow.random_uniform", "tensorflow.Variable", "numpy.sqrt" ] ]
decisionforce/pgdrive
[ "19af5d09a40a68a2a5f8b3ac8b40f109e71c26ee", "19af5d09a40a68a2a5f8b3ac8b40f109e71c26ee" ]
[ "pgdrive/tests/test_env/local_test_pgdrive_rgb_depth.py", "pgdrive/policy/idm_policy.py" ]
[ "from pgdrive.envs.pgdrive_env import PGDriveEnv\nfrom pgdrive.constants import TerminationState\nimport numpy as np\n\ninfo_keys = [\n \"cost\", \"velocity\", \"steering\", \"acceleration\", \"step_reward\", TerminationState.CRASH_VEHICLE,\n TerminationState.OUT_OF_ROAD, TerminationState.SUCCESS\n]\n\n\ndef ...
[ [ "numpy.isscalar" ], [ "numpy.dot", "numpy.sqrt" ] ]
nobodykid/sinkhorngan-positive
[ "811f697da4fe02599fc7f0e1bdf77c89d183aba4" ]
[ "old/dataloader/anomaly/mnist.py" ]
[ "from __future__ import print_function\n\nimport codecs\nimport gzip\nimport os\nimport os.path\nimport warnings\n\nimport numpy as np\nimport torch\nimport torch.utils.data as data\nfrom PIL import Image\nfrom torchvision.datasets.utils import download_url, makedir_exist_ok\n\n\nclass MNIST(data.Dataset):\n \"\...
[ [ "numpy.append", "numpy.zeros_like", "numpy.ones_like", "numpy.asarray", "torch.save", "torch.from_numpy", "numpy.frombuffer" ] ]
tangshulien/Deep-Learning-Steering
[ "848c8e04fa39b668fd59f3223cb34275eace5abd" ]
[ "hevctoh5a.py" ]
[ "# YPL & JLL, 2021.3.19\n# Code: /home/jinn/openpilot/tools/lib/hevctoh5a.py \n# Input: /home/jinn/data1/8bfda98c9c9e4291|2020-05-11--03-00-57--61/fcamera.hevc\n# Output: /home/jinn/data1/8bfda98c9c9e4291|2020-05-11--03-00-57--61/camera.h5\nimport os\nimport cv2\nimport h5py\nimport matplotlib.pyplot as plt\nfrom t...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.imshow" ] ]
LucasAntognoni/SCC0270
[ "31065234d658b6944f75c845d669fdb85bc9cf16" ]
[ "Assignment 3/rbf.py" ]
[ "import numpy as np \nimport sys\n\nclass RBF():\n def __init__(self, Input, Output, Ptypes, Nclasses):\n\n self.input = Input\n self.hidden = Ptypes * Nclasses\n self.output = Output\n self.ptypes = Ptypes\n self.nclasses = Nclasses\n\n self.protos = 0\n self.wei...
[ [ "numpy.square", "numpy.array", "numpy.linalg.norm", "numpy.zeros", "numpy.linalg.pinv", "numpy.random.shuffle", "numpy.loadtxt", "numpy.random.randint", "numpy.amax", "numpy.argmax", "numpy.sqrt" ] ]
scale-lab/BitTrain
[ "3a15f96cc32222e3d6fceb00a622521e31745d4c" ]
[ "expr/utils/sparsity_stats.py" ]
[ "import torch\nimport torchvision\nimport collections\nimport numpy as np\n\n'''\n_sparsity_ratios is a dictionary to save the sparsity ratios of each layer,\nKey - the layer name\nValue - list of sparsity ratios for the executed forward passes\n'''\n_sparsity_ratios_per_layer = collections.defaultdict(list)\n_spar...
[ [ "torch.abs", "numpy.sum", "torch.numel", "numpy.mean" ] ]
ElisaCovato/Computer-pointer-controller---Intel-Edge-AI-Nanodegree
[ "89e626b5591f543139d9cdab0dec9a6d8db53c6d" ]
[ "src/facial_landmarks_detection.py" ]
[ "import logging as log\nimport cv2\nimport sys\nimport numpy as np\n\n\nclass LandmarksDetectionModel:\n '''\n Class for the Face Landmarks Detection Model.\n\n Load and configure inference plugins for the specified target devices,\n and performs either synchronous or asynchronous modes for the\n spe...
[ [ "numpy.array" ] ]
allenai/advisor
[ "6849755042c6dab1488f64cf21bde2322add3cc1" ]
[ "poisoneddoors_plugin/poisoneddoors_offpolicy.py" ]
[ "import typing\nfrom typing import Dict, Union, Tuple, Iterator, Any\nfrom typing import Optional\n\nimport numpy as np\nimport torch\nfrom gym.utils import seeding\n\nfrom advisor_losses import AlphaScheduler, AdvisorWeightedStage\nfrom allenact.algorithms.offpolicy_sync.losses.abstract_offpolicy_loss import (\n ...
[ [ "numpy.zeros", "torch.ones", "torch.from_numpy", "numpy.prod", "numpy.random.randint" ] ]
hos/pyfem1d
[ "8ad3528670dd4ab936206ed775b2bdad29a5c7a6" ]
[ "pyfem1d/umat_defaults.py" ]
[ "import numpy as np\nfrom pyfem1d.umat import Umat\n\n\nclass LinearElastic(Umat):\n parameter_values = [100]\n parameter_names = ['elastic_mod']\n\n def stress_tangent(self, dt, n, eps):\n #Get the material variables\n E = self.parameter_values[0]\n #Calculate the stress and consisten...
[ [ "numpy.exp", "numpy.zeros" ] ]
yanzihan1/IONE-Aligning-Users-across-Social-Networks-Using-Network-Embedding
[ "7dab01a823c9bd1933f0d0d40170bf8e1091ca27" ]
[ "IONE_tf/IONE_tf_retrain.py" ]
[ "from __future__ import print_function\nimport numpy as np\nimport random\nfrom argparse import ArgumentParser, ArgumentDefaultsHelpFormatter\nfrom sklearn.linear_model import LogisticRegression\nfrom graph import *\nfrom src.openne.classify import Classifier, read_node_label\nfrom src.openne import double_up\nimpo...
[ [ "numpy.random.seed", "sklearn.linear_model.LogisticRegression" ] ]
DADADA-X/pytorch-template
[ "b205ad16f792fee79d553a95ecb5584b18dac946" ]
[ "train.py" ]
[ "import argparse\nimport collections\nimport torch\nimport numpy as np\nimport data_loader.data_loaders as module_data\nimport model.loss as module_loss\nimport model.metric as module_metric\nimport model.model as module_arch\nfrom parse_config import ConfigParser\nfrom trainer import Trainer\n\n# fix random seeds ...
[ [ "torch.manual_seed", "numpy.random.seed" ] ]
anubhakabra/Calling_Out_Bluff
[ "0aae46449958cd26313a14bc3fcabd39e44e40f9" ]
[ "Model4-BERT/util.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Created by Jiawei Liu on 2018/06/18\nimport os\nimport re\n\nimport json\nfrom openpyxl import load_workbook\nimport nltk\nimport numpy as np\nimport pandas as pd\nimport tensorflow as tf\nfrom tensorflow.python.estimator.estimator import Estimator\nimport yaml\nfr...
[ [ "tensorflow.data.TFRecordDataset", "tensorflow.train.Features", "tensorflow.train.Int64List", "numpy.load", "numpy.mean", "tensorflow.reshape", "pandas.read_csv", "tensorflow.parse_single_example", "tensorflow.random.shuffle", "tensorflow.train.FloatList", "numpy.nan_to...
eclee25/flu-SDI-exploratory-age
[ "2f5a4d97b84d2116e179e85fe334edf4556aa946" ]
[ "scripts/create_fluseverity_figs/F2_OR_time.py" ]
[ "#!/usr/bin/python\n\n##############################################\n###Python template\n###Author: Elizabeth Lee\n###Date: 4/26/14\n###Function: OR of incidence in children to incidence in adults vs. week number. Incidence in children and adults is normalized by the size of the child and adult populations in the ...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.savefig", "matplotlib.pyplot.legend", "matplotlib.pyplot.close", "matplotlib.pyplot.ylabel" ] ]
felixquinton1/TransBTS
[ "6992c902413ba15f40ebfe9f6d5d0e3594051033" ]
[ "data/preprocess.py" ]
[ "import pickle\r\nimport os\r\nimport numpy as np\r\nimport nibabel as nib\r\n\r\nmodalities = ('t1')\r\n\r\n# train\r\ntrain_set = {\r\n 'root': '/home/felix/Bureau/TransBTS/data/Train/',\r\n 'image': 'image',\r\n 'label': 'label',\r\n 'flist': 'train.txt',\r\n 'has_label': True\...
[ [ "numpy.expand_dims" ] ]
tyjyang/analysis-essentials
[ "dad8cff5957562b8ab1386d2e67ef37819a39751" ]
[ "git/files/make_plot.py" ]
[ "#!/usr/bin/env python\nfrom matplotlib import pyplot as plt\nimport numpy as np\n\n\ndata = np.random.normal(4, 2, 1000)\nbins = np.linspace(0, 10, 50)\n\nplt.hist(data, bins=bins, histtype='stepfilled')\nplt.savefig('plots/first_plot.pdf')\n" ]
[ [ "numpy.random.normal", "numpy.linspace", "matplotlib.pyplot.savefig", "matplotlib.pyplot.hist" ] ]
jvarela-zenika/sketch-code-fork
[ "a185364325d67818452e5c9ca8e85ef4d6324295" ]
[ "src/classes/dataset/Dataset.py" ]
[ "from __future__ import absolute_import\n\nimport os\nimport shutil\nimport pdb\nimport hashlib\nimport numpy as np\n\nfrom keras.preprocessing.text import Tokenizer, one_hot\nfrom keras.preprocessing.sequence import pad_sequences\nfrom keras.utils import to_categorical\n\nfrom .ImagePreprocessor import *\n\nVOCAB_...
[ [ "numpy.array", "numpy.load", "numpy.random.shuffle" ] ]
Sibimobon/Connect4
[ "5694c23a7dc27251f3b659ce3fd6c67e1cde8652" ]
[ "tests/test_common.py" ]
[ "import numpy as np\nimport pytest\n\nfrom agents.common import BoardPiece, NO_PLAYER, PLAYER1, PLAYER2, pretty_print_board, initialize_game_state, \\\n string_to_board, apply_player_action, connected_four, check_connect_topleft_bottomright\n\n\ndef test_initialize_game_state():\n\n ret = initialize_game_stat...
[ [ "numpy.all", "numpy.ndarray", "numpy.zeros" ] ]
sibeiyang/sgmn
[ "f09b94707bf8094d6d63353b9e5ca0ee83423ba5" ]
[ "tools/train_dga.py" ]
[ "import os.path as osp\nimport sys\nimport numpy as np\nimport random\nimport torch\nimport time\n\nimport _init_paths\nfrom opt import parse_opt\nfrom datasets.factory import get_db\nfrom utils.logging import Logger\nfrom utils.meter import AverageMeter\nfrom utils.osutils import mkdir_if_missing, save_checkpoint,...
[ [ "torch.cuda.manual_seed_all", "numpy.random.seed", "numpy.sum", "torch.no_grad", "torch.manual_seed", "numpy.argmax", "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.utils.data.DataLoader", "torch.nn.DataParallel" ] ]
vanshverma01/Geometric-Brownian-Motion
[ "6723987dccb9b3bda149f72551c8169a12eff6f1" ]
[ "main.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nmu = 0.1\nn = 1000\nt = 1\nm = 100\ns0 = 100\nsigma = 0.3\ndt = t/n\nSt = np.exp(\n (mu - sigma ** 2 / 2) * dt\n + sigma * np.random.normal(0, np.sqrt(dt), size=(m, n)).T\n)\nSt = np.vstack([np.ones(m), St])\nSt = s0 * St.cumprod(axis=0)\ntime = np.linspac...
[ [ "numpy.full", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "numpy.ones", "matplotlib.pyplot.ylabel", "numpy.sqrt", "matplotlib.pyplot.show", "numpy.linspace" ] ]
NJUDCA/NER
[ "bbefca537e2eae17cc0117a069c4fe4f39db0afb" ]
[ "processor/data.py" ]
[ "\"\"\"Created by PeterLee, on Dec. 17.\"\"\"\nimport pickle, random\nimport numpy as np\nimport logging\n\n\ndef build_embedding_source(source_path, vocab_path, embedding_path):\n n_char, n_dim = 0, 0\n char2id = {}\n with open(source_path, encoding='utf-8') as fr:\n first_line = fr.readline()\n ...
[ [ "numpy.float32", "numpy.random.uniform", "numpy.savetxt", "numpy.reshape" ] ]
kracon7/lcp-physics
[ "463d9602350b854464a027b2c57faae412fa2691", "463d9602350b854464a027b2c57faae412fa2691" ]
[ "lcp_physics/physics/constraints.py", "tests/test_action_constraint.py" ]
[ "import pygame\n\nimport torch\n\nfrom .utils import Indices, Defaults, cart_to_polar, polar_to_cart\n\n\nX = Indices.X\nY = Indices.Y\nDIM = Defaults.DIM\n\n\nclass Joint:\n \"\"\"Revolute joint.\n \"\"\"\n def __init__(self, body1, body2, pos):\n self.static = False\n self.num_constraints =...
[ [ "torch.cat", "torch.eye" ], [ "matplotlib.path.Path", "matplotlib.pyplot.colorbar", "numpy.zeros_like", "torch.stack", "torch.sqrt", "torch.rand", "numpy.random.seed", "matplotlib.pyplot.savefig", "torch.var_mean", "matplotlib.pyplot.close", "matplotlib.pypl...
dsctt/habitat-lab
[ "acecaf9b709e08f3d303f624bae43305d66185cd" ]
[ "habitat/tasks/rearrange/rearrange_sim.py" ]
[ "#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nfrom collections import defaultdict\nfrom typing import Any, Dict, List, Optional, Tuple, Union\n\nimport mag...
[ [ "numpy.array", "numpy.random.randn", "numpy.zeros" ] ]
charlesjhill/lightning-flash
[ "2b19acbb5d627c609f2f7e13b48006e157781718", "2b19acbb5d627c609f2f7e13b48006e157781718" ]
[ "tests/data/test_data_pipeline.py", "tests/data/test_process.py" ]
[ "# Copyright The PyTorch Lightning 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/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "torch.Size", "torch.rand", "torch.nn.Linear", "torch.nn.MSELoss", "numpy.random.uniform", "torch.tensor" ], [ "torch.nn.Linear", "torch.nn.MSELoss", "torch.arange" ] ]
Pasha62/refactoring-task-at-19
[ "50e67e4c3004e255869e18bfdf1be7c059486ce1" ]
[ "filter_1.py" ]
[ "from PIL import Image\nimport numpy as np\nimg = Image.open(\"img2.jpg\")\narr = np.array(img)\na = len(arr)\na1 = len(arr[1])\ni = 0\nwhile i < a:\n j = 0\n while j < a1:\n s = 0\n for n in range(i, min(i + 10, a - 1)):\n for d1 in range(j, j + 10):\n n1 = arr[n][d1][...
[ [ "numpy.array" ] ]
micha7a/surface-reconstruction
[ "00094419bb7967ea0cd781c1520ed62926fcc848" ]
[ "simulate_alpha_less_than_alpha_c.py" ]
[ "import numpy as np\nfrom unwarping_functions import *\n\n# --------------------------------------------------------#\n# Settings\n# --------------------------------------------------------#\n\nK = 5\nnp.random.seed(100)\niter_max = 10000\nnoise_num = 100\nSNR = np.linspace(-20, 100, noise_num)\natLeastOneSol = Tru...
[ [ "numpy.max", "numpy.random.normal", "numpy.linalg.norm", "numpy.argmin", "numpy.random.seed", "numpy.min", "numpy.std", "numpy.random.uniform", "numpy.savez", "numpy.abs", "numpy.linspace" ] ]
mrlooi/maskrcnn-benchmark
[ "135168ddda9436eead21fc945c192cffd8421e6a", "135168ddda9436eead21fc945c192cffd8421e6a" ]
[ "maskrcnn_benchmark/modeling/roi_heads/keypoint_head/keypoint_head.py", "tests/test_rpn_post_processor.py" ]
[ "import torch\n\nfrom .roi_keypoint_feature_extractors import make_roi_keypoint_feature_extractor\nfrom .roi_keypoint_predictors import make_roi_keypoint_predictor\nfrom .inference import make_roi_keypoint_post_processor\nfrom .loss import make_roi_keypoint_loss_evaluator\n\n\nclass ROIKeypointHead(torch.nn.Module)...
[ [ "torch.no_grad" ], [ "torch.zeros", "numpy.max", "numpy.array", "torch.rand", "numpy.zeros", "numpy.min" ] ]
kim66003/ML4QS_group25
[ "cd7f838e95f1583701892175670d7d0c8da0e1be" ]
[ "Python3Code/Chapter7/Evaluation.py" ]
[ "##############################################################\n# #\n# Mark Hoogendoorn and Burkhardt Funk (2017) #\n# Machine Learning for the Quantified Self #\n# Springer ...
[ [ "numpy.square", "sklearn.metrics.confusion_matrix", "sklearn.metrics.mean_squared_error", "numpy.array", "sklearn.metrics.accuracy_score", "sklearn.metrics.mean_absolute_error", "numpy.absolute", "sklearn.metrics.precision_score", "sklearn.metrics.f1_score", "sklearn.metric...
xDiaym/poom
[ "8f0e59bc0acc39b77fe761f9c1e2386e37bc6d78" ]
[ "setup.py" ]
[ "import numpy\nfrom setuptools import setup\nfrom setuptools.extension import Extension\n\nfrom Cython.Build import cythonize # isort: skip strange build system bug\n\n\ndef read(filename: str) -> str:\n with open(filename, \"r\", encoding=\"utf8\") as fp:\n return fp.read()\n\n\nextensions = [\n Exte...
[ [ "numpy.get_include" ] ]
PandoraLS/SpeechEnhancement
[ "f548eaafbe524a40c8cfd2221f7adf3a444b7a7d" ]
[ "joint_train.py" ]
[ "# -*- coding: utf-8 -*-\n# Author:sen\n# Date:2020/3/22 15:47\n\nimport argparse\nimport os\nimport json5\nimport torch\nimport numpy as np\nfrom torch.utils.data import DataLoader\nfrom util.utils import initialize_config\nfrom trainer.trainer import JointTrainer\n\n# TODO 目前还未将joint_loss_function写成一个总的Class,只是嵌入...
[ [ "numpy.random.seed" ] ]
Vita98/EnergyLoadForecasting
[ "759fe9a64234230453cec1805c01f5aa182ec7b5" ]
[ "grid_search.py" ]
[ "# grid search sarima hyperparameters\nfrom math import sqrt\nfrom multiprocessing import cpu_count\nfrom joblib import Parallel\nfrom joblib import delayed\nfrom warnings import catch_warnings\nfrom warnings import filterwarnings\nfrom statsmodels.tsa.statespace.sarimax import SARIMAX\nfrom sklearn.metrics import ...
[ [ "sklearn.metrics.mean_squared_error" ] ]
JPVentura135/astropy
[ "cb6588a246235d69f5ae929e27e8cc528faa038b", "cb6588a246235d69f5ae929e27e8cc528faa038b" ]
[ "astropy/io/fits/tests/test_table.py", "astropy/coordinates/tests/test_solar_system.py" ]
[ "# Licensed under a 3-clause BSD style license - see PYFITS.rst\n\nimport contextlib\nimport copy\nimport gc\nimport pickle\nimport re\n\nimport pytest\nimport numpy as np\nfrom numpy import char as chararray\n\ntry:\n import objgraph\n HAVE_OBJGRAPH = True\nexcept ImportError:\n HAVE_OBJGRAPH = False\n\nf...
[ [ "numpy.append", "numpy.array", "numpy.isnan", "numpy.array_equal", "numpy.zeros", "numpy.rec.recarray.field", "numpy.any", "numpy.ndarray", "numpy.rec.array", "numpy.arange", "numpy.char.array", "numpy.where", "numpy.absolute", "numpy.all", "numpy.dtype"...
wms2537/incubator-mxnet
[ "b7d7e02705deb1dc4942bf39efc19f133e2181f7" ]
[ "tests/python/unittest/test_gluon.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.array", "numpy.random.rand", "numpy.asarray", "numpy.ones", "numpy.prod", "numpy.random.randint" ] ]
voxie-viewer/voxie
[ "d2b5e6760519782e9ef2e51f5322a3baa0cb1198", "d2b5e6760519782e9ef2e51f5322a3baa0cb1198" ]
[ "filters/digitalvolumecorrelation/perftest/fftgputest/plot_timing.py", "filters/tomopy_misc_phantom.py" ]
[ "from pathlib import Path\n#\n# Copyright (c) 2014-2022 The Voxie Authors\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rig...
[ [ "matplotlib.pyplot.subplot", "matplotlib.pyplot.setp", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.show", "matplotlib.ticker.StrMethodFormatter" ], [ "numpy.square", "numpy.array", "numpy.asarray", "numpy.zeros", "numpy.tensordot", "numpy.radians", "num...
lusi1990/ImageProcessing100Wen
[ "3682e1d68a1b8472818402df2cc75ded82bb1805", "3682e1d68a1b8472818402df2cc75ded82bb1805", "3682e1d68a1b8472818402df2cc75ded82bb1805", "3682e1d68a1b8472818402df2cc75ded82bb1805", "3682e1d68a1b8472818402df2cc75ded82bb1805" ]
[ "Question_41_50/answers_py/answer_44.py", "Question_81_90/answers/answer_82.py", "Question_31_40/answers_py/answer_40.py", "Question_31_40/answers_py/_answer_40.py", "Question_91_100/answers/answer_91.py" ]
[ "import cv2\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef Canny(img):\n\n\t# Gray scale\n\tdef BGR2GRAY(img):\n\t\tb = img[:, :, 0].copy()\n\t\tg = img[:, :, 1].copy()\n\t\tr = img[:, :, 2].copy()\n\n\t\t# Gray scale\n\t\tout = 0.2126 * r + 0.7152 * g + 0.0722 * b\n\t\tout = out.astype(np.uint8)\n\n\t...
[ [ "numpy.max", "numpy.zeros_like", "numpy.array", "numpy.sin", "numpy.zeros", "numpy.sum", "numpy.exp", "numpy.where", "numpy.arctan", "numpy.sqrt", "numpy.clip", "numpy.cos", "numpy.expand_dims", "numpy.maximum" ], [ "matplotlib.pyplot.subplot", "...
oneflyingfish/tvm
[ "500ad0a4c6f88300fe624f7c07e15fd1fda17668" ]
[ "tests/python/relay/test_op_level1.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.concatenate", "numpy.ones_like", "numpy.dot", "numpy.random.rand", "numpy.copy", "numpy.exp", "numpy.random.uniform", "numpy.sqrt", "numpy.random.random", "numpy.maximum" ] ]
kovanostra/message-passing-nn
[ "6617a4753173c8fffc60140b9d8d0f497b33aed4" ]
[ "data/test_training_dataset.py" ]
[ "import torch as to\n\nBASE_GRAPH = to.tensor([[0, 1, 1, 0],\n [1, 0, 1, 0],\n [1, 1, 0, 1],\n [0, 0, 1, 0]])\nBASE_GRAPH_NODE_FEATURES = to.tensor([[1, 2], [1, 1], [2, 0.5], [0.5, 0.5]])\nBASE_GRAPH_EDGE_FEATURES = to.tensor([[[0.0, 0.0], [1.0, 2...
[ [ "torch.tensor" ] ]
osswangxining/iot-app-enabler-conversation
[ "d2a174af770a496ef220330cb6d5428f5f0114f6" ]
[ "conversationinsights-mynlu/_pytest/test_featurizers.py" ]
[ "from __future__ import unicode_literals\nfrom __future__ import print_function\nfrom __future__ import division\nfrom __future__ import absolute_import\nimport os\n\nimport numpy as np\nimport pytest\n\nfrom mynlu.tokenizers.mitie_tokenizer import MitieTokenizer\nfrom mynlu.tokenizers.spacy_tokenizer import SpacyT...
[ [ "numpy.allclose", "numpy.array" ] ]
gallanoe/tinygrad
[ "0cf21881b710dd55614a1eb19c5ca0e7081cb8b5" ]
[ "examples/efficientnet.py" ]
[ "# load weights from\n# https://github.com/lukemelas/EfficientNet-PyTorch/releases/download/1.0/efficientnet-b0-355c32eb.pth\n# a rough copy of\n# https://github.com/lukemelas/EfficientNet-PyTorch/blob/master/efficientnet_pytorch/model.py\nimport os\nGPU = os.getenv(\"GPU\", None) is not None\nimport sys\nimport io...
[ [ "numpy.max", "numpy.array", "numpy.asarray", "numpy.set_printoptions", "numpy.argmax", "numpy.moveaxis" ] ]
MuchToMyDelight/tvm
[ "474bc4e761e3bc87d69419c376042c19b6b7dbbe", "474bc4e761e3bc87d69419c376042c19b6b7dbbe" ]
[ "tests/python/contrib/test_ethosn/infrastructure.py", "tests/python/relay/test_json_runtime.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.array", "numpy.ones", "numpy.reshape", "numpy.zeros" ], [ "numpy.random.uniform" ] ]
rjx678/facenet_demo
[ "c804eb3aa176e07470c8db40e30c1697fa3d3823" ]
[ "src/align/align_dataset_mtcnn.py" ]
[ "\"\"\"Performs face alignment and stores face thumbnails in the output directory.\"\"\"\n# MIT License\n# \n# Copyright (c) 2016 David Sandberg\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# i...
[ [ "numpy.asarray", "numpy.zeros", "numpy.minimum", "tensorflow.Graph", "scipy.misc.imresize", "scipy.misc.imread", "tensorflow.ConfigProto", "numpy.random.randint", "numpy.transpose", "numpy.argmax", "scipy.misc.imsave", "numpy.power", "numpy.squeeze", "tensor...
OceanSnape/twembeddings
[ "5b18db7427221fa64c4978a0b7f77b78802a101c" ]
[ "twembeddings/build_features_matrix.py" ]
[ "# -*- coding: utf-8 -*-\nimport argparse\nimport logging\nimport pandas as pd\nfrom .embeddings import TfIdf, W2V, BERT, SBERT, Elmo, ResNetLayer, DenseNetLayer, USE\nfrom scipy.sparse import issparse, save_npz, load_npz\nimport numpy as np\nimport os\nimport re\nimport csv\nfrom unidecode import unidecode\nfrom d...
[ [ "scipy.sparse.issparse", "scipy.sparse.load_npz", "numpy.load", "numpy.save", "pandas.read_csv", "scipy.sparse.save_npz" ] ]
zeta1999/OpenJij
[ "0fe03f07af947f519a32ad58fe20423919651634" ]
[ "openjij/sampler/cmos_annealer.py" ]
[ "# Copyright 2019 Jij 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 to in ...
[ [ "numpy.max", "numpy.array", "numpy.log", "numpy.sum", "numpy.min", "numpy.abs" ] ]
happy-beans/pylearning
[ "b20ef32ea65954d6b37e1026a6293a7c4d1d4f81" ]
[ "statistics/s1.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport math\n\n# 合計\ndef getSum(ar):\n return np.sum(ar)\n\n# 平均\ndef getAvg(ar):\n return np.average(ar)\n\n# 偏差\ndef getDev(ar):\n a = getAvg(ar)\n d = []\n for i in ar:\n d.append(i - a)\n\n return d\n\n# 分散\ndef getV...
[ [ "numpy.average", "numpy.sum", "numpy.std", "numpy.var" ] ]
marcosboggia/gui_automation
[ "2adabfa71b00945ada04e619c1a36b124c1dda66" ]
[ "gui_automation/background_handler.py" ]
[ "# Made by Marcos Boggia\r\nimport io\r\nimport cv2\r\nimport numpy as np\r\nfrom PIL import Image\r\nimport win32gui\r\nimport win32ui\r\nfrom ctypes import windll\r\nfrom time import sleep\r\nfrom gui_automation.handler import Handler\r\n\r\n\r\nclass BackgroundHandlerWin32(Handler):\r\n \"\"\"\r\n Handler ...
[ [ "numpy.array" ] ]
stephenjfox/trax
[ "918b1ce2ad63a24cb957ebc8e8ea0af1ee272666", "918b1ce2ad63a24cb957ebc8e8ea0af1ee272666" ]
[ "trax/data/text_encoder_test.py", "trax/data/tf_inputs.py" ]
[ "# coding=utf-8\n# Copyright 2022 The Trax 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 required by app...
[ [ "tensorflow.compat.v1.test.get_temp_dir", "tensorflow.compat.v1.gfile.MakeDirs", "tensorflow.compat.v1.test.main" ], [ "tensorflow.nest.pack_sequence_as", "tensorflow.image.resize_with_crop_or_pad", "tensorflow.io.gfile.GFile", "numpy.random.choice", "tensorflow.image.random_fl...