repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
amanchamola/color-detection
[ "e87a02009fa34e831a1a757483918458fda5fe16" ]
[ "Color detection/color_detection.py" ]
[ "import cv2\r\nimport pandas as pd\r\n\r\n\r\nimg_path = 'pic2.jpg'\r\n\r\ncsv_path = 'colors.csv'\r\n\r\n\r\nindex = ['color', 'color_name', 'hex', 'R', 'G', 'B']\r\n\r\ndf = pd.read_csv(csv_path, names=index, header=None)\r\n\r\n\r\nimg = cv2.imread(img_path)\r\n\r\nimg = cv2.resize(img,(800,600))\r\n\r\n\r\nclic...
[ [ "pandas.read_csv" ] ]
Hymwgk/REGNet_for_3D_Grasping
[ "90d2aabeba32c6899b7b8bb8c1ce4ff73c227859" ]
[ "test.py" ]
[ "import argparse\r\nimport os\r\nimport pickle, copy\r\n\r\nimport torch\r\nimport torch.utils.data\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nimport torch.optim as optim\r\nimport numpy as np\r\nimport open3d\r\nfrom tensorboardX import SummaryWriter\r\nfrom torch.optim.lr_scheduler import Step...
[ [ "numpy.array", "torch.cuda.manual_seed", "numpy.load", "torch.cuda.set_device", "torch.Tensor", "torch.set_grad_enabled" ] ]
rplom/turicreate
[ "eb6711aa74a4f6edd7e6107ca818f1054bff8c04" ]
[ "src/python/turicreate/toolkits/object_detector/object_detector.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright © 2017 Apple Inc. All rights reserved.\n#\n# Use of this source code is governed by a BSD-3-clause license that can\n# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause\n\"\"\"\nClass definition and utilities for the object detection toolkit.\n...
[ [ "numpy.concatenate", "numpy.array", "numpy.asarray", "numpy.zeros", "numpy.copy", "numpy.tile", "numpy.arange", "numpy.sqrt", "numpy.clip" ] ]
SaraLatif99/car-classification
[ "27b017e9cba66935c0f715d5584cfd7fe7bd4653", "27b017e9cba66935c0f715d5584cfd7fe7bd4653" ]
[ "car_classifier/copy_images_for_prefilter.py", "car_classifier/quiz.py" ]
[ "\"\"\"\nOnly for model case, else top 300 makes no sense for classes\n\"\"\"\n\nimport os\nfrom shutil import copy2\nimport pandas as pd\n\nIMAGE_DIR = 'data/car-classifier-raw/' # Directory images are stored in\nSTORAGE_DIR = 'data/' # Directory to store split images\n\n# Load prediction file created using note...
[ [ "pandas.read_csv" ], [ "numpy.max", "tensorflow.keras.preprocessing.image.load_img", "matplotlib.pyplot.figure", "tensorflow.keras.models.load_model", "tensorflow.keras.preprocessing.image.img_to_array", "numpy.argmax", "matplotlib.pyplot.show", "matplotlib.pyplot.axis", ...
vsokhatskyi/catalyst
[ "8516b9d44546600ad597a1fffdf03b7eb23c5e98" ]
[ "catalyst/contrib/models/sequential.py" ]
[ "from typing import Dict, List, Union # isort:skip\nfrom collections import OrderedDict\nfrom copy import deepcopy\n\nimport torch\nimport torch.nn as nn\n\nfrom catalyst import utils\nfrom catalyst.contrib.registry import MODULES\n\n\ndef _process_additional_params(params, layers):\n if isinstance(params, List...
[ [ "torch.nn.Sequential" ] ]
caishenghang/oneflow
[ "db239cc9f98e551823bf6ce2d4395bd5c339b1c5" ]
[ "oneflow/python/test/ops/test_non_distribute_optimizer.py" ]
[ "\"\"\"\nCopyright 2020 The OneFlow Authors. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by ap...
[ [ "numpy.ones" ] ]
Taiji-pipeline/Taiji-utils
[ "f5e009cf7a9a683f7e43bf97fb33c758ba13d97b" ]
[ "python/taiji-utils/taiji_utils/Normalization.py" ]
[ "import numpy as np\nfrom statsmodels.nonparametric.kernel_regression import KernelReg\n\nfrom .Utils import readMatrix\n\ndef fitSmooth(X, Y, newX, output=None):\n X = X[..., np.newaxis]\n if output is not None:\n import matplotlib.pyplot as plt\n plt.figure()\n X_plot = np.linspace(np.m...
[ [ "numpy.max", "numpy.array", "numpy.random.seed", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.close", "numpy.min", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotli...
shiningliang/Multi-level-Causality-Detection-Network
[ "126a11735781224aaa31af37728e6dd0b2e511c2" ]
[ "utils/figure_analyze.py" ]
[ "import seaborn as sns\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\nsns.set_context(context=\"talk\")\nplt.switch_backend('agg')\n\nresults = pd.read_csv(\"analysis.csv\")\n\nplt.rcParams[\"font.family\"] = \"Times New Roman\"\nfig, axes = plt.subplots(nrows=2, ncols=2, figsize=(20, 10))\nsns.set(style=...
[ [ "matplotlib.pyplot.switch_backend", "pandas.read_csv", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.subplots" ] ]
ethinallen/campus_simulation
[ "414ec93bcf6d671971f33be97aa6b53d36b808cb" ]
[ "scripts/campus.py" ]
[ "import numpy as np\nfrom building import building\nimport pandas as pd\nimport numpy as np\nimport datetime\nimport time\nimport dateutil.parser\nfrom dateutil.parser import parse\nimport os\n\nimport meerschaum as mrsm\n\nclass campus:\n\n # initialize the sensor based on type and set age to 0\n def __init_...
[ [ "pandas.DataFrame", "numpy.int64" ] ]
ksk0014/tensorflow
[ "6732ac1789d1b4b29de5f83ee58e6e69e26cf095" ]
[ "tensorflow/python/eager/function.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.eager.tape.stop_recording", "tensorflow.python.eager.context.context", "tensorflow.python.eager.tape.should_record_backprop", "tensorflow.python.framework.composite_tensor.replace_composites_with_components", "tensorflow.python.util.tf_inspect.FullArgSpec", "tensorflow.p...
laleph/holoviews
[ "7c06dbd63945fd66e63b17060956634be3ba17fe" ]
[ "tests/testbokehgraphs.py" ]
[ "from __future__ import absolute_import\n\nfrom unittest import SkipTest\n\nimport numpy as np\nfrom holoviews.core.data import Dataset\nfrom holoviews.core.options import Store\nfrom holoviews.element import Graph, TriMesh, circular_layout\nfrom holoviews.element.comparison import ComparisonTestCase\nfrom holoview...
[ [ "numpy.array", "numpy.arange", "numpy.random.rand", "numpy.zeros" ] ]
tingsyo/dlgridsat
[ "2d94808df663c39931b404deee44849aad104e52" ]
[ "utils/pretrained2_encode_preproc_gridsatb1.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n'''\nThis script provide functions which encode pre-processed NOAA-GridSat-B1 \ndataset into vectors of length 2048.\n\nThe autoencoder is developed and teset with Tensorflow(2.5.0), \nCUDA 11.1/11.3 with cuDNN 8.1.0/8.2.0.\n'''\nimport numpy as np\nimport pandas as ...
[ [ "numpy.array", "tensorflow.convert_to_tensor", "pandas.DataFrame", "numpy.load", "numpy.save", "numpy.stack" ] ]
luhouxiang/rqrobot
[ "0b0094b0e2d061e628c570a06a7620e5fb48d342" ]
[ "rqrobot/model/instrument.py" ]
[ "# -*- coding: utf-8 -*-\n#\n# Copyright 2017 Ricequant, 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 requir...
[ [ "numpy.isnan" ] ]
tambetm/playground
[ "606b568ea1e4fe82b93d93f482e96b585fc69de7" ]
[ "pommerman/forward_model.py" ]
[ "from collections import defaultdict\n\nimport numpy as np\n\nfrom . import constants\nfrom . import characters\nfrom . import utility\n\n\nclass ForwardModel(object):\n \"\"\"Class for helping with the [forward] modeling of the game state.\"\"\"\n\n def run(self, num_times, board, agents, bombs, items, flame...
[ [ "numpy.array", "numpy.zeros_like", "numpy.zeros", "numpy.where" ] ]
maxsch3/batchflow
[ "2d36fad3f4a816cef82c1902e52a43a051ea1892" ]
[ "keras_batchflow/base/batch_shapers/var_shaper.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom numbers import Number\n\nfrom .encoder_adaptor import IEncoderAdaptor\nfrom .numpy_encoder_adaptor import NumpyEncoderAdaptor\nfrom .pandas_encoder_adaptor import PandasEncoderAdaptor\n\n\nclass VarShaper:\n\n \"\"\"\n This class is a wrapper around encoder. It a...
[ [ "numpy.array", "numpy.isscalar", "numpy.repeat", "numpy.squeeze", "numpy.expand_dims" ] ]
ERIGrid/NA4-Summerschool_Aug18
[ "270cde89393b8fb96f3c620316db198c25d7ee87" ]
[ "DoE-exercises/dtu_mosaik/mosaik_building.py" ]
[ "\"\"\"\n An entity which mimics a building with an internal temperature and constant proportional heat loss.\n Note that parameters which couple to the temperature (proportional to x, zs) are expressed in degrees celcius per hour.\n That is, they state how much a value of, e.g. x=1.0 will cause the temper...
[ [ "pandas.HDFStore" ] ]
racinger/PySyft
[ "dc0ba29df83de3bd0cf59956b433b418a9731baa" ]
[ "syft/frameworks/torch/tensors/interpreters/multi_pointer.py" ]
[ "import torch\nfrom typing import List\nfrom typing import Union\n\nimport syft as sy\nfrom syft.frameworks.torch.tensors.interpreters.abstract import AbstractTensor\nfrom syft.frameworks.torch.tensors.interpreters import AdditiveSharingTensor\nfrom syft.workers import BaseWorker\nfrom syft.frameworks.torch.overloa...
[ [ "torch.eq" ] ]
autopawn/meanpress
[ "ae9f94ab3b7b2ac136124f710d08790d4d510ee8" ]
[ "meanpress/compression_maxv.py" ]
[ "import sys\n\nimport numpy as np\n\nfrom numba import jit\n\nfrom .compression_general import *\n\n@jit(nopython=True)\ndef bit_cost(xs):\n \"\"\"\n Max bits required to represent up to the given numbers\n \"\"\"\n bits = np.zeros(xs.shape,dtype=np.int32)\n bits[xs>=1] = 1\n bits[xs>=2] = 2\n ...
[ [ "numpy.concatenate", "numpy.array", "numpy.uint32", "numpy.zeros", "numpy.random.seed", "numpy.sum", "numpy.random.randint", "numpy.all", "numpy.int32", "numpy.random.random" ] ]
Danxuan-Liu/diversification-code
[ "53a2e0216e731d7d693086b81e32e2a61b322b4e" ]
[ "Experiment_letor/greedy_ls.py" ]
[ "# This is a sample Python script.\n\n# Press Shift+F10 to execute it or replace it with your code.\n# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.\nimport datetime\nimport os\nimport random\nimport argparse\nimport numpy as np\nimport sys\nimport copy\n\nfrom os ...
[ [ "numpy.argmax", "numpy.mean" ] ]
yannra/netket
[ "7adc7ba04ff8e912629952cf4fa0e3f27148c424", "7adc7ba04ff8e912629952cf4fa0e3f27148c424" ]
[ "scripts/qgps_2d_36_j1_j2_no_msr.py", "netket/custom/sweep_opt.py" ]
[ "import numpy as np\nimport netket as nk\nimport sys\nimport mpi4py.MPI as mpi\nimport symmetries\n\n\nN = int(sys.argv[1])\nJ2 = float(sys.argv[2])\n\nJ1 = 1.0\n\nif mpi.COMM_WORLD.Get_rank() == 0:\n with open(\"result.txt\", \"w\") as fl:\n fl.write(\"N, energy (real), energy (imag), energy_error\\n\")\...
[ [ "numpy.imag", "numpy.save", "numpy.real", "numpy.zeros" ], [ "numpy.copyto", "numpy.isfinite", "numpy.zeros" ] ]
ilyamirin/OrganGrinder
[ "7cff1a399d1439a06ee0ba90428a6542ebddb966" ]
[ "src/lstm.py" ]
[ "import numpy\nfrom keras.utils import np_utils\nfrom tensorflow.keras.callbacks import ModelCheckpoint\nfrom tensorflow.keras.layers import Activation\nfrom tensorflow.keras.layers import BatchNormalization as BatchNorm\nfrom tensorflow.keras.layers import Dense\nfrom tensorflow.keras.layers import Dropout\nfrom t...
[ [ "numpy.reshape", "tensorflow.keras.layers.Activation", "tensorflow.keras.callbacks.ModelCheckpoint", "tensorflow.keras.layers.Dropout", "tensorflow.keras.layers.Dense", "tensorflow.keras.models.Sequential", "tensorflow.keras.layers.LSTM", "tensorflow.keras.layers.BatchNormalization...
rldejournett1/great_expectations
[ "57dcf939df8f8b77be55ef03ff99a98687acb407" ]
[ "tests/checkpoint/test_checkpoint.py" ]
[ "import logging\nimport os\nimport unittest.mock as mock\nfrom typing import List, Union\n\nimport pandas as pd\nimport pytest\nfrom ruamel.yaml import YAML\nfrom ruamel.yaml.comments import CommentedMap\n\nimport great_expectations as ge\nimport great_expectations.exceptions as ge_exceptions\nfrom great_expectatio...
[ [ "pandas.DataFrame" ] ]
future-daydayup/XLearning
[ "a4fa2a8c47d13fd86f1e39bd23c1a43ea5d4082c" ]
[ "examples/tensorflow/dataDeal.py" ]
[ "import numpy as np\nimport os\n\nclass trainData:\n def __init__(self, fileStr, batch_size):\n self.fileStr = os.listdir(fileStr)\n self.batch_size = batch_size\n self.batch = []\n self.cache = []\n self.count_batch = 0\n self.flag = 0\n self.inc = -1\n self.iter_num = 0\n\n for s in se...
[ [ "numpy.zeros" ] ]
sankhaMukherjee/ConvTD
[ "bbe03db50932ca33ae5a0d0e3f1b8d818344a06a" ]
[ "dataGeneration/multiExp.py" ]
[ "import numpy as np\nfrom scipy.integrate import odeint\n\ndef dy(y, t):\n\n p = {}\n p['k1'] = 0.005\n p['k2'] = 0.05\n p['k3'] = 0.003\n p['d'] = 0.01\n p['km'] = 2.0\n\n dydt = np.zeros(y.shape)\n\n dydt[0] = - p['k1']*y[0]\n dydt[1] = ( p['k1']*y[0] - p['k2']*y[1] + p['k3']*y[2] \n...
[ [ "numpy.concatenate", "scipy.integrate.odeint", "numpy.array", "numpy.zeros", "numpy.random.uniform", "numpy.linspace" ] ]
eivan/MegaDepth
[ "d2671bae67f3c45f607da1e4a80a483692f0e8d9" ]
[ "predict_depth.py" ]
[ "import torch\nfrom pathlib import Path\nimport sys\nimport math\nfrom torch.autograd import Variable\nimport numpy as np\nfrom options.train_options import TrainOptions\n\nfrom data.data_loader import CreateDataLoader\nfrom models.models import create_model\nfrom skimage import io\nfrom skimage.transform import re...
[ [ "torch.squeeze", "torch.cuda.is_available", "numpy.transpose", "numpy.amax", "torch.exp" ] ]
Gilbert-Zhu/Stochastic-Simulation
[ "a7e5ea23ae21db61075e35fe2dc42d51abbf8caf" ]
[ "HW1/HW1Q3.py" ]
[ "import numpy as np\nnp.random.seed(1) # fix random number seed\nXlist = [] # list to keep samples of # customers\nArealist = [] # list to keep samples of average # customers\n\nfor reps in range(0,30):\n clock = 0 # initialize clock\n X = 0 # initialize X\n T = 100000 # Total time unit\n NextArrival = ...
[ [ "numpy.random.seed", "numpy.min", "numpy.random.exponential", "numpy.mean" ] ]
huseinzol05/malaya-boilerplate
[ "c962cbd5332e9f5c0418edfa54e9e34022cb647c" ]
[ "malaya_boilerplate/frozen_graph.py" ]
[ "import os\n\ntry:\n os.environ['TF_FORCE_GPU_ALLOW_GROWTH'] = 'true'\nexcept BaseException:\n pass\n\nimport logging\nimport numpy as np\nimport tensorflow as tf\nimport struct\nfrom operator import itemgetter\nfrom tensorflow.core.framework import types_pb2, graph_pb2, attr_value_pb2\nfrom .utils import ava...
[ [ "tensorflow.io.gfile.GFile", "tensorflow.range", "tensorflow.compat.v1.make_tensor_proto", "numpy.reshape", "tensorflow.compat.v1.ConfigProto", "tensorflow.Graph", "tensorflow.import_graph_def", "tensorflow.compat.v1.GraphDef", "tensorflow.compat.v1.Session", "tensorflow.py...
DSIP-UPatras/ICASSP2019_TCN
[ "cd28909ccf3696b835446cbec2f15eb60610a2af" ]
[ "code/script_experiment.py" ]
[ "\nimport numpy as np\nimport tensorflow as tf\nimport random\n\n# The below is necessary in Python 3.2.3 onwards to\n# have reproducible behavior for certain hash-based operations.\n# See these references for further details:\n# https://docs.python.org/3.4/using/cmdline.html#envvar-PYTHONHASHSEED\n# https://github...
[ [ "tensorflow.set_random_seed", "numpy.max", "sklearn.metrics.confusion_matrix", "numpy.array", "tensorflow.get_default_graph", "numpy.random.seed", "numpy.min", "tensorflow.ConfigProto", "numpy.argmax" ] ]
leizhenyu-lzy/DrowsyDrivingDetect
[ "9416769c4ceb5c5775cb98e7ccb11faa0fd760dd" ]
[ "KeyPointsDetect/ToolFunction.py" ]
[ "# 1950083 自动化 刘智宇\nimport torch\nimport os\nimport cv2 as cv\nimport numpy as np\nimport pandas as pd\nfrom Consts import *\n\n\n\"\"\"\nname: count_files\nfunctional: count number of files in a directory(use:os.walk)\ninputs: root_dir\noutputs: number of files in the directory\n\"\"\"\ndef count_file...
[ [ "numpy.concatenate", "numpy.reshape", "torch.cuda.is_available", "numpy.append", "pandas.read_csv", "torch.reshape" ] ]
jbclements/RacketFrames
[ "07ed04b93fbbc214a72ec28ab4f99f0e36ed3f18" ]
[ "racketframes/benchmark/Pandas/indexing/multi_index_object.py" ]
[ "import string\n\nimport numpy as np\nimport pandas.util.testing as tm\nfrom pandas import date_range, MultiIndex\n\nfrom .pandas_vb_common import setup # noqa\n\n\nclass GetLoc(object):\n\n goal_time = 0.2\n\n def setup(self):\n self.mi_large = MultiIndex.from_product(\n [np.arange(1000), ...
[ [ "numpy.array", "numpy.random.rand", "numpy.random.choice", "pandas.date_range", "numpy.random.permutation", "pandas.MultiIndex.from_arrays", "numpy.random.randint", "pandas.MultiIndex.from_product", "pandas.MultiIndex", "numpy.arange", "pandas.util.testing.makeStringInd...
DEVHEE/ai-robot-hand-with-raspberry-pi
[ "d556706c6f7ae33d893f8411b06d4a5d6ba0625d" ]
[ "software/mask_recognition/train_mask_recongition.py" ]
[ "\"\"\"\nai-robot-hand-with-raspberry-pi\nCOPYRIGHT © 2021 KIM DONGHEE. ALL RIGHTS RESERVED.\n\"\"\"\n\n'''\nUsed dataset: https://www.kaggle.com/omkargurav/face-mask-dataset\n'''\n\n# Import modules.\nimport os\nimport argparse\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom imutils import paths\nfrom t...
[ [ "tensorflow.keras.utils.to_categorical", "tensorflow.keras.preprocessing.image.load_img", "tensorflow.keras.applications.mobilenet_v2.preprocess_input", "tensorflow.keras.layers.AveragePooling2D", "tensorflow.keras.models.Model", "tensorflow.keras.layers.Dense", "matplotlib.pyplot.save...
Nevronas/skeleton
[ "51a1fffdd09d67d8c4806d1375932352ef8a47d1" ]
[ "small_proj/src/model.py" ]
[ "import torch\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\n\n# First define all the layers.\n\nclass conv_bn(torch.nn.Module):\n def __init__(self, inp_ch, outp_ch):\n super(conv_bn, self).__init__()\n self.conv = torch.nn.Sequential(\n torch.nn.Conv2d(inp...
[ [ "torch.nn.Linear", "torch.nn.Conv2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
cali-li/nlp-recipes
[ "558d822be6d50ed0f571f4b96a689e64a8440e2d" ]
[ "utils_nlp/models/bert/sequence_classification.py" ]
[ "# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\n\nfrom collections import namedtuple\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch.utils.data import DataLoader, RandomSampler, SequentialSampler, TensorDataset\nfrom pytorch_pretrained_bert.m...
[ [ "numpy.concatenate", "torch.utils.data.RandomSampler", "torch.nn.Softmax", "torch.nn.CrossEntropyLoss", "torch.utils.data.SequentialSampler", "torch.no_grad", "torch.cuda.empty_cache", "torch.cuda.is_available", "torch.tensor", "torch.utils.data.DataLoader", "torch.Tens...
nagnath001/domain-classification-text
[ "1ef43a009d0999f40ea9f6c8d2b4c93d9b845838" ]
[ "code.py" ]
[ "# --------------\nimport pandas as pd\r\nimport os\r\nimport numpy as np\r\nimport warnings\r\nwarnings.filterwarnings(\"ignore\")\r\n\r\n\r\n# path_train : location of test file\r\n# Code starts here\r\n\r\n#Loading data\r\ndf = pd.read_csv(path_train)\r\nprint(df.head())\r\n\r\n#Function to create new column\r\n...
[ [ "sklearn.preprocessing.LabelEncoder", "sklearn.metrics.accuracy_score", "sklearn.naive_bayes.MultinomialNB", "sklearn.linear_model.LogisticRegression", "sklearn.feature_extraction.text.TfidfVectorizer", "sklearn.model_selection.train_test_split", "pandas.read_csv", "sklearn.svm.Lin...
boisgera/ash
[ "f4a288b45450dc7e421dcbcc97f009538939fc74" ]
[ "videos/lti-balls.py" ]
[ "#!/usr/bin/env python\n\n# Python Standard Library\npass\n\n# Third-Party Libraries\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib.colors import to_rgb\n\n\n# Local Library\nimport mivp\n\n\n# ------------------------------------------------------------------------------\ngrey_4 = to_rgb(\"#...
[ [ "numpy.array", "numpy.sin", "numpy.vectorize", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "numpy.arange", "numpy.sqrt", "numpy.cos", "matplotlib.colors.to_rgb", "numpy.linspace", "numpy.meshgrid", "matplotlib.pyplot.axis" ] ]
XingwenZhang/tutorials
[ "514a513f2839106603fea2bba6b8908725f874fc" ]
[ "beginner_source/deploy_seq2seq_hybrid_frontend_tutorial.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nDeploying a Seq2Seq Model with TorchScript\n==================================================\n**Author:** `Matthew Inkawhich <https://github.com/MatthewInkawhich>`_\n1.2, this tutorial was updated to work with PyTorch 1.2\n\"\"\"\n\n\n#############################################...
[ [ "torch.nn.Linear", "torch.device", "torch.nn.Dropout", "torch.cat", "torch.zeros", "torch.nn.GRU", "torch.nn.functional.softmax", "torch.max", "torch.FloatTensor", "torch.ones", "torch.unsqueeze", "torch.nn.utils.rnn.pad_packed_sequence", "torch.LongTensor", ...
Ghost---Shadow/gpt-neox
[ "1391b197ac79b8d4b88a0e97d1e98371d8b61fef" ]
[ "megatron/model/transformer.py" ]
[ "# coding=utf-8\n#\n# Copyright 2021 Biderman et al. This file is based on code by the authors denoted below and has been modified from its original version.\n#\n# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use...
[ [ "torch.nn.Dropout", "torch.cat", "torch.stack", "torch._C._jit_set_profiling_executor", "torch.no_grad", "torch.enable_grad", "torch._C._jit_override_can_fuse_on_gpu", "torch.cuda.current_device", "torch.nn.functional.linear", "torch._C._jit_set_profiling_mode", "torch....
krikra/scipy
[ "ab5e425a48646d55c414bcc326607679f30d6bea" ]
[ "scipy/interpolate/fitpack2.py" ]
[ "\"\"\"\nfitpack --- curve and surface fitting with splines\n\nfitpack is based on a collection of Fortran routines DIERCKX\nby P. Dierckx (see http://www.netlib.org/dierckx/) transformed\nto double routines by Pearu Peterson.\n\"\"\"\n# Created by Pearu Peterson, June,August 2003\nfrom __future__ import division, ...
[ [ "numpy.concatenate", "numpy.array", "numpy.asarray", "numpy.zeros", "numpy.broadcast_arrays", "numpy.diff", "numpy.resize", "numpy.ravel", "numpy.alltrue", "numpy.isfinite", "numpy.issubclass_" ] ]
naykun/MusicResearch
[ "97bd64f23710c9f45634da0fd4674172746cfaf5" ]
[ "Polyphony_Dataset_Convertor/old/polyphony_lib.py" ]
[ "# Copyright 2016 Google Inc. 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 required by appli...
[ [ "tensorflow.logging.debug" ] ]
openvisual/TensorFlow-2.x-YOLOv3
[ "f0b8b74dc557c1ba79154373c904f865ae60bbc4" ]
[ "yolov3/utils.py" ]
[ "#================================================================\n#\n# File name : utils.py\n# Author : PyLessons\n# Created date: 2020-09-27\n# Website : https://pylessons.com/\n# GitHub : https://github.com/pythonlessons/TensorFlow-2.x-YOLOv3\n# Description : additional yolov3 and yo...
[ [ "numpy.product", "numpy.minimum", "numpy.copy", "numpy.exp", "numpy.finfo", "numpy.concatenate", "numpy.full", "tensorflow.shape", "tensorflow.concat", "numpy.logical_and", "tensorflow.constant", "numpy.argmax", "numpy.logical_or", "numpy.array", "tensor...
samlaf/python-control
[ "c49b55b1f8dfe8e74c562d6a83bf5359343cdccb" ]
[ "control/tests/ctrlutil_test.py" ]
[ "import unittest\nimport numpy as np\nfrom control.ctrlutil import *\n\nclass TestUtils(unittest.TestCase):\n def setUp(self):\n self.mag = np.array([1, 10, 100, 2, 0.1, 0.01])\n self.db = np.array([0, 20, 40, 6.0205999, -20, -40])\n\n def check_unwrap_array(self, angle, period=None):\n i...
[ [ "numpy.testing.assert_array_almost_equal", "numpy.array", "numpy.linspace" ] ]
wookayin/tensorflow-plot
[ "70dbe9100b6e438f961a8efe8ccec0a77ffd1aec" ]
[ "tfplot/contrib_test.py" ]
[ "'''Unit Test for tfplot.contrib'''\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport unittest\nimport os\nimport scipy.misc\n\nimport numpy as np\nimport tensorflow as tf\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # filter out INFO and WARN ...
[ [ "numpy.eye" ] ]
lperezmo/epistasis
[ "4f751d9e2d9ca632a7b688cf32bd950ad7c2a754" ]
[ "epistasis/models/nonlinear/spline.py" ]
[ "import numpy as np\n\nfrom .minimizer import Minimizer\nfrom .ordinary import EpistasisNonlinearRegression\nfrom epistasis.models import EpistasisLinearRegression\nfrom epistasis.models.utils import (arghandler, FittingError)\nfrom scipy.interpolate import UnivariateSpline\nfrom lmfit import Parameter, Parameters\...
[ [ "numpy.delete", "numpy.zeros", "scipy.interpolate.UnivariateSpline", "numpy.copy", "scipy.interpolate.UnivariateSpline._from_tck", "numpy.argsort", "numpy.unique" ] ]
Real-Silverywing/pytorch_classification
[ "4aabb1777c29a239d8175bbdcde9989e54b8c71c" ]
[ "train.py" ]
[ "# -*- coding:utf-8 -*-\n# @time :2020.02.09\n# @IDE : pycharm\n# @author :lxztju\n# @github : https://github.com/lxztju\n\nimport argparse\nimport os\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport math\n\nfrom data import train_dataloader,train_datasets,val_dataloader,val_datasets\nimpor...
[ [ "torch.max", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "torch.cuda.is_available", "torch.load", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "torch.nn.CrossEntropyLoss", "matplotlib.pyplot.subplot" ] ]
roeymarinov/TNE
[ "bbe431bd8c0fdea9978cfec4a97bb0bcdb02b58c" ]
[ "tne/modeling/models/tne_coupled_tuples.py" ]
[ "import logging\nfrom typing import Any, Dict, List\n\nimport numpy as np\nimport torch\nfrom allennlp.data import TextFieldTensors, Vocabulary\nfrom allennlp.models.model import Model\nfrom allennlp.modules import FeedForward\nfrom allennlp.modules import Seq2SeqEncoder, TimeDistributed, TextFieldEmbedder\nfrom al...
[ [ "torch.zeros", "torch.nn.Dropout", "torch.nn.CrossEntropyLoss", "torch.no_grad", "torch.unsqueeze", "torch.tensor", "torch.ones_like", "torch.argmax" ] ]
ferrocactus/cellar
[ "d1733d4643b3a4c960529806d4904ab3b3c54666" ]
[ "src/utils/tools.py" ]
[ "import itertools\nimport json\nimport re\nimport os\n\n\nfrom typing import Optional, Union\nfrom anndata import AnnData\nfrom sklearn.neighbors import NearestNeighbors\nfrom sklearn.neighbors import kneighbors_graph\n\nfrom ast import literal_eval\nfrom functools import reduce\n\nimport anndata\nimport numpy as n...
[ [ "numpy.max", "numpy.append", "numpy.array", "numpy.bincount", "numpy.array_equal", "numpy.zeros", "numpy.char.upper", "numpy.std", "numpy.where", "numpy.char.replace", "sklearn.neighbors.kneighbors_graph", "numpy.average", "numpy.around", "numpy.unique" ] ...
Manny810/seesaw
[ "b722f1f67760d4831987910891fc5c3537f7ff42" ]
[ "seesaw/search_loop_models.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport math\nfrom torch.utils.data import Subset\nfrom tqdm.auto import tqdm\nimport pyroaring as pr\nimport sys\nfrom torch.utils.data import TensorDataset\nfrom torch.utils.data import Subset\nfrom torch.utils.data import DataLoader\n\nimport ...
[ [ "torch.nn.Linear", "torch.stack", "numpy.minimum", "torch.ones", "numpy.where", "torch.nn.MarginRankingLoss", "numpy.linalg.norm", "torch.is_tensor", "pandas.DataFrame", "numpy.arange", "torch.utils.data.DataLoader", "torch.tensor", "numpy.zeros", "numpy.arg...
mayhallgroup/PsiEmbed
[ "6a82ac5e762d07aa645a2eb59956fb430ed1d04b" ]
[ "src/embedding_methods.py" ]
[ "import numpy as np\nimport psi4\nimport scipy.linalg\nimport sys\nfrom pyscf import gto, dft, scf, lib, mp, cc\n#import os\n\nclass Embed:\n \"\"\" Class with package-independent embedding methods.\"\"\"\n\n def __init__(self, keywords):\n \"\"\"\n Initialize the Embed class.\n\n Paramet...
[ [ "numpy.concatenate", "numpy.zeros", "numpy.linalg.eigh", "numpy.linalg.det", "numpy.prod", "numpy.einsum", "numpy.linalg.svd", "numpy.sqrt", "numpy.argpartition", "numpy.hstack", "numpy.linalg.inv" ] ]
paul-shannon/slexil2
[ "53f53482ea9d92510b17595f6275cedcfefde2e8" ]
[ "slexil/ijalLine.py" ]
[ "\n'''\n******************************************************************\nSLEXIL—Software Linking Elan XML to Illuminated Language\nCopyright (C) 2019 Paul Shannon and David Beck\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as publis...
[ [ "pandas.DataFrame", "pandas.concat" ] ]
asmerdov/CS_GO_Sensors_Data_Analysis
[ "82669ae925258e2d6f29e8c55dfe682c0c1558e2" ]
[ "ResultsAnalysis.py" ]
[ "import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport os\nimport joblib\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.optim import Adam, SGD\nimport tqdm\nimport itertools\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.neighbors imp...
[ [ "matplotlib.ticker.MultipleLocator", "pandas.DataFrame", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.legend", "matplotlib.pyplot.interactive", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.pyplot.tick_params", "matplotlib...
ZackWolf614/BlackBird
[ "1575127c611be0f9aa606a25f898b58b5f1afd9d" ]
[ "src/Blackbird.py" ]
[ "from DynamicMCTS import DynamicMCTS as MCTS\nfrom RandomMCTS import RandomMCTS\nfrom FixedMCTS import FixedMCTS\nfrom Network import Network\nfrom NetworkFactory import NetworkFactory\nfrom DataManager import Connection\nfrom proto.state_pb2 import State\nfrom collections import defaultdict\n\nimport functools\nim...
[ [ "numpy.array", "numpy.set_printoptions", "numpy.sum", "numpy.seterr", "numpy.frombuffer", "numpy.hstack", "numpy.vstack" ] ]
fangqyi/sandbox-society
[ "c9510890576fad1037474340194d0b5342a9b45f" ]
[ "neural_mmo/forge/ethyr/torch/policy/embed.py" ]
[ "from pdb import set_trace as T\nimport numpy as np\n\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\n\nfrom neural_mmo.forge.blade.io import node\n\nclass Embedding(nn.Module):\n def __init__(self, var, dim):\n '''Pytorch embedding wrapper that subtracts the min'''\n super()....
[ [ "torch.nn.Linear", "torch.cat", "torch.stack", "torch.nn.Embedding" ] ]
spectralDNS/shenfun
[ "2164596ccf906242779d9ec361168246ee6214d8" ]
[ "shenfun/utilities/lagrangian_particles.py" ]
[ "import numpy as np\nfrom mpi4py import MPI\n\ncomm = MPI.COMM_WORLD\n\n__all__ = ['LagrangianParticles']\n\nclass LagrangianParticles:\n \"\"\"Class for tracking Lagrangian particles\n\n Parameters\n ----------\n points : array\n Initial location of particles. (D, N) array, with N particles in D...
[ [ "numpy.sin", "numpy.zeros", "numpy.round", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "numpy.cos", "matplotlib.pyplot.show", "numpy.linspace" ] ]
ExObsSim/ExoRad2-public
[ "d00f95343fa86eae093abbf3ce9b3e579f9fb826" ]
[ "exorad/tasks/loadSource.py" ]
[ "import numpy as np\nfrom astropy import units as u\n\nfrom exorad.models.source import Star, CustomSed\nfrom exorad.tasks.task import Task\nimport os\n\nclass LoadSource(Task):\n \"\"\"\n Updates target with its source and return the source Sed\n\n Parameters\n ----------\n target: Target Class\n ...
[ [ "numpy.log10" ] ]
Kanaricc/M3TR
[ "c341ec1ebac598a1cf0c0c9085c98f4ebf4c2780" ]
[ "models/vit_utils/efficient.py" ]
[ "import torch\r\nfrom torch import nn\r\nfrom einops import rearrange, repeat\r\nfrom einops.layers.torch import Rearrange\r\n\r\nclass ViT(nn.Module):\r\n def __init__(self, *, image_size, patch_size, num_classes, dim, transformer, pool = 'cls', channels = 3):\r\n super().__init__()\r\n assert ima...
[ [ "torch.nn.Linear", "torch.nn.Identity", "torch.cat", "torch.nn.LayerNorm", "torch.randn" ] ]
tinhangchui/robo-gym
[ "6053c60d1a118f6872fce8c7c09a2130f6b51eff" ]
[ "meta_ifo/robo-gym/train_beosim.py" ]
[ "import os\nimport glob\nimport time\nfrom datetime import datetime\nimport torch\nimport numpy as np\nimport gym\nfrom IPython import embed\nimport robo_gym\nfrom robo_gym.wrappers.exception_handling import ExceptionHandling\nfrom PPO import PPO\nimport numpy as np\nfrom robo_gym.wrappers.taskEnv import MoveObject...
[ [ "torch.manual_seed", "numpy.array", "numpy.linalg.norm", "numpy.random.seed" ] ]
jacobbieker/Wide_ASPECS
[ "79ba3f9d42861ebdd9b731b7c4a41857a04cef40" ]
[ "independent/match_sources.py" ]
[ "\"\"\"\n\nThis is focused on matching sources in the catalog to those detected in the cubes\n\n\"\"\"\nimport numpy as np\nfrom scipy.interpolate import interp2d, interp1d\n\nimport astropy.units as u\nfrom astropy.table import Table, vstack\nfrom astropy.coordinates import SkyCoord, Angle, SkyOffsetFrame, ICRS, D...
[ [ "numpy.int", "numpy.zeros", "numpy.round", "numpy.nonzero", "numpy.arange", "numpy.abs", "numpy.linspace" ] ]
hugolarzabal/hackathonbaobab2020
[ "288e533bbe0a6fa2832fc388301d46b2a3b2169d" ]
[ "core/batch.py" ]
[ "# /usr/bin/python3\n\nfrom . import experiment as exp\nfrom . import tools as di\n\nimport pytups.tuplist as tl\nimport pytups.superdict as sd\n\nimport orloge as ol\nimport os\nimport zipfile\nimport pandas as pd\nimport shutil\nimport re\n\n\nclass Batch(object):\n \"\"\"\n This is a group of experiments.\...
[ [ "pandas.DataFrame", "pandas.MultiIndex.from_tuples", "pandas.concat" ] ]
Originofamonia/SHOT
[ "d79909009e5dd06658fa15e951fed97f1a89496b" ]
[ "digit/data_load/utils.py" ]
[ "import os\nimport os.path\nimport hashlib\nimport gzip\nimport errno\nimport tarfile\nimport zipfile\n\nimport torch\nfrom torch.utils.model_zoo import tqdm\n\n\ndef gen_bar_updater():\n pbar = tqdm(total=None)\n\n def bar_update(count, block_size, total_size):\n if pbar.total is None and total_size:\...
[ [ "torch.utils.model_zoo.tqdm" ] ]
JohnySilva/mlhep-2021-comp2-code
[ "3b4f91e91a8ad833f6e4bd7d21af5cd1adba4da7" ]
[ "idao/model.py" ]
[ "import pytorch_lightning as pl\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\n#%%\n\nclass Print(nn.Module):\n \"\"\"Debugging only\"\"\"\n\n def forward(self, x):\n print(x.size())\n return x\n\nclass Clamp(nn.Module):\n \"\"\"Clamp energy output\"\"\"\n\n def...
[ [ "torch.nn.Linear", "torch.sigmoid", "torch.nn.Dropout", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.clamp", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.Flatten" ] ]
StonedCoal/OakNet-Multiroom-Audio-System
[ "2d1a71c70055e2646187efb5955aa48de3076ca6" ]
[ "Receiver/audioBackendPyAudio.py" ]
[ "import pyaudio\nimport audioop\nimport array\nimport datetime\nimport network\nfrom datetime import timedelta, datetime\nimport asyncio\n\nimport pyaudio\n\nimport numpy\n\np = pyaudio.PyAudio()\ninfo = p.get_host_api_info_by_index(0)\nnumdevices = info.get('deviceCount')\navailableInputDevices = dict()\navailabl...
[ [ "numpy.dtype", "numpy.frombuffer" ] ]
yanpei18345156216/COMBO_Python3
[ "666a116dfece71e6236291e89ea2ab4d6db0ead9" ]
[ "combo/blm/lik/linear.py" ]
[ "import numpy as np\n\n\nclass linear(object):\n def __init__(self, basis, params=None, bias=None):\n self.basis = basis\n self.nbasis = basis.nbasis\n self._init_params = params\n self.bias = bias\n self.params = params\n\n if params is None:\n self.params = ...
[ [ "numpy.copy", "numpy.zeros" ] ]
tteeoo/robotfrost
[ "5dfd13e1338e84a3eb5cbcc23100328967566b49" ]
[ "robotfrost.py" ]
[ "#!/usr/bin/env python3\nimport argparse\n\n# Define args\nparser = argparse.ArgumentParser()\nparser.add_argument(\n '-e',\n '--epochs',\n type = int,\n help = 'the number of epochs to go through when training',\n default = 20\n)\nparser.add_argument(\n '-b',\n '--batch-size',\n type = int,...
[ [ "torch.device" ] ]
zfjsail/transfer
[ "2cc2a73b579fb57714079f94a9f4ffe6b8a4acb4" ]
[ "train_cnn_match.py" ]
[ "from __future__ import unicode_literals\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport argparse\nfrom os.path import join\nimport os\nimport numpy as np\nimport time\n\nimport torch\nfrom torch.utils.data import DataLoader\nimport torch.optim as optim\nimport torch.nn.functional ...
[ [ "numpy.max", "numpy.array", "numpy.zeros_like", "torch.cuda.manual_seed", "numpy.isnan", "sklearn.metrics.precision_recall_curve", "numpy.random.seed", "sklearn.metrics.precision_recall_fscore_support", "torch.manual_seed", "torch.cuda.is_available", "numpy.argmax", ...
EricZhu-42/KDD_Cup_2020_Adversial_Attack_on_Graph_Data
[ "854cc664ab9fb4dd65df9e15c1a087c4ec972724" ]
[ "utils/utils.py" ]
[ "import numpy as np\nimport scipy.sparse as sp\nimport torch\nimport torch.nn.functional as F\nimport torch.sparse as ts\nfrom sklearn.model_selection import train_test_split\n\ndef encode_onehot(labels):\n eye = np.eye(labels.max() + 1)\n onehot_mx = eye[labels]\n return onehot_mx\n\ndef tensor2onehot(lab...
[ [ "torch.cat", "torch.cuda.is_available", "torch.LongTensor", "torch.eye", "torch.nn.functional.nll_loss", "torch.exp", "torch.Size", "scipy.sparse.diags", "numpy.log", "torch.FloatTensor", "torch.typename", "scipy.sparse.eye", "numpy.arange", "scipy.sparse.cs...
Xiaosheng-Zhao/21cmDELFI
[ "6f7662aadc8f38920de1258199963d3a289df727" ]
[ "tutorial/Active_learning.py" ]
[ "import logging, sys, os\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pydelfi.priors as priors\nimport pydelfi.ndes as ndes\nimport pydelfi.delfi as delfi\nimport tensorflow as tf\nimport pickle\nfrom getdist import plots, MCSamples\nimport getdist\n\nlogger = logging.getLogger('21cmFAST')\nlogger.s...
[ [ "numpy.array", "numpy.load" ] ]
felixdittrich92/DeepLearning-tensorflow-keras
[ "2880d8ed28ba87f28851affa92b6fa99d2e47be9" ]
[ "7_DeepLearning-GANs/04_Generative_Adversarial_Attacks/plotting.py" ]
[ "import matplotlib.pyplot as plt\r\n\r\ndef plot_img(image, cmap=\"gray\"):\r\n plt.imshow(image.squeeze(), cmap=cmap)\r\n plt.axis(\"off\")\r\n plt.show()\r\n\r\ndef plot_attack(image_true, image_adversarial):\r\n # Plot the attack\r\n plt.figure()\r\n plt.subplot(1, 3, 1)\r\n plt.title(\"Orig...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.pyplot.axis", "matplotlib.pyplot.subplot" ] ]
nilanjan-cse/google-research
[ "e727e8e9e6286a058515308d814eace3eb07fcdf" ]
[ "graph_compression/compression_lib/compression_op.py" ]
[ "# coding=utf-8\n# Copyright 2020 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...
[ [ "tensorflow.compat.v1.assign", "tensorflow.compat.v1.transpose", "tensorflow.compat.v1.matmul", "tensorflow.compat.v1.less", "numpy.linalg.norm", "tensorflow.compat.v1.logical_and", "tensorflow.compat.v1.sqrt", "numpy.sqrt", "tensorflow.compat.v1.compat.v1.get_variable", "t...
matejklemen/morphological-dependency-parsing
[ "2ab24b8621debe6e3288ade01c9604a06f9bd453" ]
[ "supar/modules/biaffine.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport torch\nimport torch.nn as nn\n\n\nclass Biaffine(nn.Module):\n \"\"\"\n Biaffine layer for first-order scoring.\n\n This function has a tensor of weights `W` and bias terms if needed.\n The score `s(x, y)` of the vector pair `(x, y)` is computed as `x^T W y`,\n in w...
[ [ "torch.ones_like", "torch.nn.init.zeros_", "torch.Tensor", "torch.einsum" ] ]
bsugerman/falcon
[ "8990cc1874b75773a27eb7838610e4052c6020c8" ]
[ "eval.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCalculate mAP for YOLO model on some annotation dataset\n\"\"\"\nimport os, argparse, time\nimport numpy as np\nimport operator\nfrom operator import mul\nfrom functools import reduce\nfrom PIL import Image\nfrom collections import OrderedDict\nimport matplo...
[ [ "matplotlib.pyplot.text", "tensorflow.import_graph_def", "matplotlib.pyplot.gcf", "tensorflow.lite.python.interpreter.Interpreter", "matplotlib.pyplot.fill_between", "numpy.arange", "matplotlib.pyplot.gca", "numpy.array", "numpy.zeros", "tensorflow.GraphDef", "matplotli...
skymind-talent/openCV-python-labs
[ "5506831e8454633a3419349fdb01fda8a83c6e37" ]
[ "src/Day 2/3_filter/sharpening/custom_2D_kernel.py" ]
[ "import cv2\r\nimport numpy as np\r\n\r\nimage = cv2.imread(r'C:\\Users\\harrizazham98\\Desktop\\OpenCVForPython\\resources\\Day 2\\wood.jpg')\r\n\r\n# Print error message if image is null\r\nif image is None:\r\n print('Could not read image')\r\n\r\n\"\"\"\r\nApply sharpening using kernel\r\n\"\"\"\r\nkernel3 =...
[ [ "numpy.array" ] ]
gabriel-milan/distributed-systems
[ "7c016eb5dda7ae7d68c33fc3048397aae9b9bc5f" ]
[ "tp2/semaphores/plot_chart.py" ]
[ "import matplotlib.pyplot as plt\n\ndata = {\n 1: {\n (1, 1) : 6.274645810597576,\n (2, 1) : 6.468804593296954,\n (4, 1) : 6.574014662398258,\n (8, 1) : 6.604240996198496,\n (16,1) : 6.628235584497451,\n (1, 2) : 4.215760689496529,\n (1, 4) : 3.710197771602543,\n (1, 8) : 3.698875323397806,...
[ [ "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.show" ] ]
TuongL94/MasterThesis
[ "25cc6e4d43d49777f28ac31ed3a5a0c6c7d90bf9" ]
[ "SiameseFingerprint/fingerprint_parser.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Feb 2 15:31:04 2018\n\n@author: Tuong Lam & Simon Nilsson\n\"\"\"\n\nimport imageio as imio\nimport numpy as np\nimport re\nimport os\nimport sys\n\ndef fingerprint_parser(index_file_dir, index_file_name):\n \"\"\" Parser for Precise Biometrics fingerprint databa...
[ [ "numpy.array", "numpy.save" ] ]
Srheft/desispec
[ "f7adfd70e245cfe861b1e6eb781d1216017bed28" ]
[ "py/desispec/bootcalib.py" ]
[ "\"\"\"\ndesispec.bootcalib\n==================\n\nUtility functions to perform a quick calibration of DESI data\n\nTODO:\n1. Expand to r, i cameras\n2. QA plots\n3. Test with CR data\n\"\"\"\nfrom __future__ import print_function, absolute_import, division\n\nimport numpy as np\nimport copy\nimport pdb\nimport imp...
[ [ "matplotlib.pyplot.xlim", "numpy.minimum", "numpy.median", "numpy.min", "numpy.exp", "numpy.mean", "numpy.where", "numpy.sort", "matplotlib.pyplot.imshow", "numpy.max", "numpy.zeros_like", "matplotlib.font_manager.FontProperties", "numpy.log", "numpy.unravel...
sandialabs/shadow
[ "a817e43b1051ded51e471bb31346ea7d710d3dd2" ]
[ "src/shadow/mt.py" ]
[ "import torch\nimport numpy as np\nimport copy\nimport shadow.losses\nimport shadow.module_wrapper\n\n\ndef ema_update_model(student_model, ema_model, alpha, global_step):\n r\"\"\"Exponential moving average update of a model.\n\n Update `ema_model` to be the moving average of consecutive `student_model` upda...
[ [ "torch.randn_like", "torch.no_grad", "numpy.isclose" ] ]
Data-Science-Community-SRM/Forecasting-US-Elections
[ "ccde6973e8b40efeb3e8f7fa96babe9f7b52b6be" ]
[ "Extraction/Extracting Tweets/Scrape Trump.py" ]
[ "import tweepy \nimport pandas as pd\n\nconsumer_key= \"XXX\"\nconsumer_secret = \"XXX\"\naccess_token =\"XXX\"\naccess_token_secret= \"XXX\"\n\nauth = tweepy.OAuthHandler(consumer_key, consumer_secret) \n# authentication of access token and secret \nauth.set_access_token(access_token, access_token_secret) \napi =...
[ [ "pandas.DataFrame" ] ]
PMitura/smiles-neural-network
[ "8182c221e59186fc3084a2726cf38c73b5b9a1d3" ]
[ "rnn/rnn.py" ]
[ "import data, utility, metrics\nimport time\n\nimport numpy as np\nfrom math import sqrt, exp, log, ceil\nfrom scipy.stats.stats import pearsonr\nfrom sklearn.metrics import roc_auc_score\n\nimport db.db as db\nimport visualization\n\nfrom config import config as cc\nimport yaml\n\nimport pandas as pd\n\nimport soc...
[ [ "numpy.random.seed", "pandas.DataFrame", "numpy.power", "numpy.floor" ] ]
wergeld/my_ml_service
[ "6bfade2db0f609e45938ff27e2b4c985f8eafa41" ]
[ "backend/server/apps/endpoints/views.py" ]
[ "import json\r\nfrom numpy.random import rand\r\nfrom rest_framework import views, status\r\nfrom rest_framework.response import Response\r\nfrom apps.ml.registry import MLRegistry\r\nfrom server.wsgi import registry\r\n\r\nfrom rest_framework import viewsets\r\nfrom rest_framework import mixins\r\nfrom rest_framew...
[ [ "numpy.random.rand" ] ]
lianming03/deep_sort_pytorch
[ "968e393f51f22a0b998170c1b3de4db2d330eb98" ]
[ "deep_sort/deep/test.py" ]
[ "import torch\r\nimport torch.backends.cudnn as cudnn\r\nimport torchvision\r\n\r\nimport argparse\r\nimport os\r\n\r\nfrom model import Net\r\n\r\nparser = argparse.ArgumentParser(description=\"Train on market1501\")\r\nparser.add_argument(\"--data-dir\",default='data',type=str)\r\nparser.add_argument(\"--num-clas...
[ [ "torch.cat", "torch.save", "torch.no_grad", "torch.cuda.is_available", "torch.tensor", "torch.load" ] ]
Ant1ng2/nums
[ "f04097f25b63d0654b230d801967bb64acf00436" ]
[ "tests/core/array/test_ho_ops.py" ]
[ "# coding=utf-8\n# Copyright (C) 2020 NumS Development 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 requir...
[ [ "numpy.product", "numpy.log", "numpy.sum", "numpy.mean", "numpy.std" ] ]
jiangnanboy/CNN4IE
[ "dcbd46fea0023d88b485b479bf65c56df9609efa" ]
[ "cnn4ie/dcnn/model.py" ]
[ "import torch\nimport torch.nn.functional as F\nimport torch.nn as nn\nfrom cnn4ie.util import crf\nfrom cnn4ie.dcnn.dynamic_conv import DynamicConv1dTBC\n\nDEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\n\n\n\nclass Encoder(nn.Module):\n def __init__(self, emb_dim, hid_dim, n_layers, kern...
[ [ "torch.nn.Linear", "torch.nn.functional.glu", "torch.nn.Dropout", "torch.arange", "torch.FloatTensor", "torch.cuda.is_available", "torch.nn.Embedding" ] ]
snasiriany/parasol
[ "88b99704676fb1253b8bc6402665a3174a00072d" ]
[ "parasol/gym/mujoco/cartpole.py" ]
[ "import os\n\nimport cv2\nimport numpy as np\nimport scipy.misc\n\nfrom deepx import T\nfrom gym import utils\nfrom gym.envs.mujoco import mujoco_env\n\nfrom ..gym_wrapper import GymWrapper\n\n\n__all__ = ['Cartpole']\n\n\nclass GymCartpole(mujoco_env.MujocoEnv, utils.EzPickle):\n\n def __init__(self, *args, **k...
[ [ "numpy.square", "numpy.isfinite", "numpy.concatenate", "numpy.abs" ] ]
emmazmi/research-template
[ "ec175fb580075de5e7673ba1114ec11d86b72dec" ]
[ "analysis/report.py" ]
[ "import pandas as pd\n\ndata = pd.read_csv(\"output/input.csv\")\n\ndata['covid_date'] = pd.to_datetime(data['covid_date'])\ndata['long_covid_date'] = pd.to_datetime(data['long_covid_date'])\n\ndata['time'] = data['long_covid_date'] - data['covid_date']\n\ndata.to_csv(\"output/times.csv\")\n\n#fig = data.time.plot....
[ [ "pandas.to_datetime", "pandas.read_csv" ] ]
86sanj/datasetinsights
[ "892e2ed3a2facf97cfa3a883700830d959a0c49b" ]
[ "datasetinsights/datasets/unity_perception/tables.py" ]
[ "import json\nimport logging\nimport pathlib\nfrom collections import namedtuple\nfrom enum import Enum\n\nimport pandas as pd\n\nfrom .validation import verify_version\n\nlogger = logging.getLogger(__name__)\nSCHEMA_VERSION = \"0.0.1\" # Synthetic dataset schema version\n\n\nclass FileType(Enum):\n BINARY = \"...
[ [ "pandas.json_normalize" ] ]
ghostofsheep/asl-ml-immersion
[ "4ed74c9fb67d570a498219b347b905e82f525d6e" ]
[ "notebooks/tfx_pipelines/guided_projects/guided_project_2_solution/models/preprocessing.py" ]
[ "# Copyright 2021 Google LLC. 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 required by appl...
[ [ "tensorflow.SparseTensor" ] ]
bmi-imaginelab/CD-Net-Histopathology-Representation-Learning-using-Pyramidal-Context-Detail-Network
[ "cc4dad85cdeea7295cb48f6f947fd1ac25d8862e" ]
[ "vision_transformer.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\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 ...
[ [ "torch.nn.Linear", "torch.rand", "torch.nn.Dropout", "torch.cat", "torch.nn.functional.normalize", "torch.nn.Identity", "torch.zeros", "torch.nn.init.constant_", "torch.nn.Sequential", "torch.linspace", "torch.nn.Conv2d", "torch.nn.BatchNorm1d", "torch.nn.GELU" ...
xueeinstein/jax
[ "6388f7ef32659d8ab4ac5970a186cab23875c178" ]
[ "jax/test_util.py" ]
[ "# Copyright 2018 Google LLC\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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.testing.assert_allclose", "numpy.equal", "numpy.array", "numpy.isnan", "numpy.asarray", "numpy.errstate", "numpy.random.RandomState", "numpy.testing.assert_equal", "numpy.shape", "numpy.where", "numpy.subtract", "numpy.prod", "numpy.isscalar", "numpy....
bobhonores/aipnd-image-classifier
[ "5c012626250088b1d958fdb8aaddf2145db23cbe" ]
[ "imagedataloader.py" ]
[ "import torch\nfrom torchvision import datasets, transforms\n\n\ndef create_dataloaders(image_data_directory):\n data_transforms = {'train': transforms.Compose([transforms.RandomRotation(30),\n transforms.RandomResizedCrop(\n ...
[ [ "torch.utils.data.DataLoader" ] ]
shivam-raj/EfficientDet
[ "37fa8dfeb1573129f498e1b431bf0780654faed7" ]
[ "model.py" ]
[ "from functools import reduce\n\nimport tensorflow as tf\nfrom tensorflow.keras import layers\nfrom tensorflow.keras import initializers\nfrom tensorflow.keras import models\nfrom tfkeras import EfficientNetB0, EfficientNetB1, EfficientNetB2\nfrom tfkeras import EfficientNetB3, EfficientNetB4, EfficientNetB5, Effic...
[ [ "tensorflow.nn.swish", "tensorflow.keras.initializers.VarianceScaling", "tensorflow.keras.layers.SeparableConv2D", "tensorflow.keras.layers.Input", "tensorflow.keras.layers.Activation", "tensorflow.keras.layers.Reshape", "tensorflow.keras.models.Model", "tensorflow.keras.layers.Con...
shijieS/simple-faster-rcnn-pytorch
[ "a6abad5f2882d68ed1c52f4d0817411d37495d7e" ]
[ "utils/array_tool.py" ]
[ "\"\"\"\ntools to convert specified type\n\"\"\"\nimport torch as t\nimport numpy as np\n\n\ndef tonumpy(data):\n if isinstance(data, np.ndarray):\n return data\n if isinstance(data, t._C._TensorBase):\n return data.cpu().numpy()\n if isinstance(data, t.autograd.Variable):\n return ton...
[ [ "torch.autograd.Variable", "torch.from_numpy" ] ]
jerabaul29/python_script_debugger
[ "eb6368a41e4f7bb1f8a255705a0274d9dd712607" ]
[ "example/matplotlib_bugged.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\n\na = np.array([1, 2, 3])\nb = np.array([2, 4, 7, 9, 9])\n\nplt.figure()\nplt.plot(a, b)\nplt.show()\n\n" ]
[ [ "matplotlib.pyplot.show", "numpy.array", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure" ] ]
akalia77/Grid_Surppresion
[ "c9b97c660cf62f448448f88643cc1884a1556c8e" ]
[ "keras_test.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Dec 7 15:17:41 2020\n\n@author: dhkim\n\"\"\"\n\nimport tensorflow as tf\n\ngpus = tf.config.experimental.list_physical_devices('GPU')\nif gpus:\n try:\n tf.config.experimental.set_memory_growth(gpus[0], True)\n except RuntimeError as e:\n # 프로그램 시작시에 메모리 증가...
[ [ "tensorflow.matmul", "tensorflow.config.experimental.set_memory_growth", "tensorflow.debugging.set_log_device_placement", "tensorflow.constant", "tensorflow.config.experimental.list_physical_devices" ] ]
utiasSTARS/graphIK
[ "df5ca000485593540113dad42940680919dc4eb9" ]
[ "experiments/tro2020/planar_chain.py" ]
[ "import numpy as np\nimport networkx as nx\nimport pickle\n\nfrom graphik.graphs.graph_base import RobotPlanarGraph\nfrom graphik.robots.robot_base import RobotPlanar\nfrom graphik.utils.utils import list_to_variable_dict, make_save_string\nfrom graphik.utils.experiments import (\n run_multiple_experiments,\n ...
[ [ "numpy.random.seed", "numpy.ones", "numpy.random.rand" ] ]
Ouranosinc/dcvar
[ "494c850164a9f553eeeba66c6cc90fe398eb2094" ]
[ "xclim/sdba/properties.py" ]
[ "# noqa: D205,D400\n\"\"\"\nProperties Submodule\n====================\nSDBA diagnostic tests are made up of statistical properties and measures. Properties are calculated on both simulation\nand reference datasets. They collapse the time dimension to one value.\n\nThis framework for the diagnostic tests was inspir...
[ [ "scipy.stats.spearmanr", "numpy.isnan", "numpy.expand_dims", "scipy.stats.pearsonr" ] ]
Hcnaeg/DI-engine
[ "aba0c629f87649854091e9e59d948f83962e3e1e" ]
[ "ding/entry/serial_entry_guided_cost.py" ]
[ "from ding.policy.base_policy import Policy\nfrom typing import Union, Optional, List, Any, Tuple\nimport os\nimport copy\nimport torch\nimport logging\nfrom functools import partial\nfrom tensorboardX import SummaryWriter\nimport numpy as np\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom ding.envs...
[ [ "torch.load" ] ]
mpia3/SysAg
[ "ba2a95d401f86d2db82a2f97e44c2bcd778adadf" ]
[ "MaskDetection/utils/anchor_decode.py" ]
[ "# -*- coding:utf-8 -*-\nimport numpy as np\n\n\ndef decode_bbox(anchors, raw_outputs, variances=[0.1, 0.1, 0.2, 0.2]):\n '''\n Decode the actual bbox according to the anchors.\n the anchor value order is:[xmin,ymin, xmax, ymax]\n :param anchors: numpy array with shape [batch, num_anchors, 4]\n :para...
[ [ "numpy.concatenate", "numpy.array", "numpy.exp" ] ]
PlainConcepts/ARLIE
[ "10b8992b0820e08fb649805e8bc12ff0509d78d9" ]
[ "arlie/arlie/envs/lunar_lander/env.py" ]
[ "import os\nimport subprocess\nimport time\n\nimport grpc\nimport gym\nimport numpy as np\nfrom arlie.envs.base_reward import BaseReward\nfrom arlie.envs.lunar_lander.python_protos import Lunar3D_pb2, Lunar3D_pb2_grpc\nfrom gym import spaces\n\n\nclass LunarLander(gym.Env):\n\n metadata = {\"render.modes\": [\"h...
[ [ "numpy.array" ] ]
CJCascalheira/ml-gender-dysphoria
[ "2b20c19020342bd5b3c09aa0c107f26770aa541c" ]
[ "src/dass/classifier_depression.py" ]
[ "\"\"\"\nSVM classifier for the DASS labels.\n\nTrains a depression classifier.\n\"\"\"\n\n# region PREPARE WORKSPACE\n\n# Load dependencies\nimport os\nimport pandas as pd\nimport numpy as np\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.svm import SVC\nfrom sklearn.model_selection import KFo...
[ [ "sklearn.model_selection.cross_validate", "sklearn.metrics.precision_score", "numpy.mean", "sklearn.model_selection.KFold", "sklearn.svm.SVC", "sklearn.metrics.accuracy_score", "numpy.std", "sklearn.model_selection.train_test_split", "pandas.read_csv", "sklearn.metrics.f1_s...
MKrinitskiy/Antarctic-mesocyclones-detection-Retinanet
[ "8da29c8ceb639c140c2bc6b264d21b638b9b806c" ]
[ "utils/scaling.py" ]
[ "import numpy as np\n\ndef scale_btd(data):\n data_scaled_01 = (data+80.)/(5.5+80.)\n data_scaled01_inv = 1.001-data_scaled_01\n data_scaled01_inv_log = np.log(data_scaled01_inv)\n data_scaled2 = 1. - (data_scaled01_inv_log - np.log(0.001))/(-np.log(0.001))\n return data_scaled2\n\ndef scale_btd_back...
[ [ "numpy.exp", "numpy.log", "numpy.minimum" ] ]
shuxinyin/Loss-Set-Pytorch
[ "0dc125a2c245f589e346d2d9a4c94aaad08f0667", "0dc125a2c245f589e346d2d9a4c94aaad08f0667" ]
[ "unbalanced_loss/dice_loss.py", "unbalanced_loss/GHM_loss.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\n\n\nclass BinaryDiceLoss(nn.Module):\n \"\"\"\n Args:\n ignore_index: Specifies a target value that is ignored and does not contribute to the input gradient\n reduction: Specifies the reduction to apply to...
[ [ "torch.zeros", "torch.rand", "numpy.array", "torch.sigmoid", "torch.mul", "torch.randint", "torch.nn.Conv3d", "torch.nn.functional.softmax" ], [ "torch.zeros", "torch.nn.functional.binary_cross_entropy_with_logits", "torch.sigmoid", "torch.sqrt", "torch.clam...