repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
sshreyas267/CoviBuddy
[ "bbaf7a89ccef359375fb32d72647704e854c3928" ]
[ "chatbot/ml_model.py" ]
[ "#RANDOM FOREST \nimport pandas as pd\nimport numpy as np\nimport os\nfrom sklearn.preprocessing import LabelEncoder\nfrom sklearn.ensemble import RandomForestClassifier\n\nclass Mlmodel:\n\ty_train_symp = []\n\ty_train =[]\n\ty_dict = {}\n\tclassifier= RandomForestClassifier(n_estimators= 10, criterion=\"entropy\"...
[ [ "sklearn.preprocessing.LabelEncoder", "sklearn.ensemble.RandomForestClassifier", "numpy.ravel", "pandas.read_csv", "numpy.unique" ] ]
cpath-ukk/Artifact
[ "652d59b4bf1f548c184607ac6fbc10dd107e3982" ]
[ "02_jpeg/2_script_jpeg.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\n@author: yuri tolkach\n\"\"\"\n\n# =============================================================================\n# 2. JPEG compression\n# =============================================================================\n\n\n#Parameters\n#Number of gaussian lev...
[ [ "tensorflow.keras.models.load_model", "numpy.float32", "numpy.expand_dims" ] ]
fcakyon/cifar100-resnet
[ "23bcc0c32daed62244c1d992879ee7b3152ef8b0" ]
[ "dataset.py" ]
[ "import torch\nimport torchvision\n\n\nclass Cifar100Dataset:\n def __init__(\n self,\n batch_size: int = 256,\n input_size: int = 32,\n num_workers=2,\n transforms=None,\n ):\n\n self.trainset = torchvision.datasets.CIFAR100(\n root=\"./data/CIFAR100\",\n ...
[ [ "torch.utils.data.DataLoader" ] ]
MadBad3/faursound_core
[ "c34f3504cb590c76ba5fd5128fefb0add98c1c79" ]
[ "test/test_inference.py" ]
[ "import pytest, os, shutil, numpy as np\nimport sys\nsys.path.append((os.path.dirname(os.path.dirname(__file__))))\nfrom inference import inference\nfrom mock import patch\nfrom etiltWav import etiltWav\n\ntest_folder_location = os.path.dirname(__file__)\npath = os.path.join(test_folder_location, r'folder')\npath2l...
[ [ "numpy.asarray" ] ]
p0l0satik/PlaneDetector
[ "60d7330537b90ff0ca74247cd6dac2ca7fc627bc" ]
[ "src/utils/annotations.py" ]
[ "import numpy as np\nimport cv2\n\n\ndef draw_polygone(image, plane):\n contours = np.array(plane.points).astype(dtype=np.float)\n color_tuple = tuple([int(part) for part in plane.color])\n cv2.fillPoly(image, pts=np.int32([contours]), color=color_tuple)\n return image\n\n\ndef draw_polygones(planes, im...
[ [ "numpy.int32", "numpy.array", "numpy.zeros" ] ]
vondrejc/sfepy
[ "8e427af699c4b2858eb096510057abb3ae7e28e8" ]
[ "sfepy/mesh/mesh_tools.py" ]
[ "from sfepy.discrete.fem import FEDomain\nimport scipy.sparse as sps\nimport numpy as nm\nfrom sfepy.base.compat import factorial\nfrom sfepy.base.base import output\nfrom numpy.core import intc\nfrom numpy.linalg import lapack_lite\n\ndef elems_q2t(el):\n\n nel, nnd = el.shape\n if nnd > 4:\n q2t = nm...
[ [ "numpy.concatenate", "numpy.array", "numpy.ones_like", "numpy.zeros", "numpy.ascontiguousarray", "numpy.ones", "numpy.where", "scipy.sparse.identity", "numpy.arange", "numpy.mod" ] ]
Matos-V/PDS_UFCG
[ "b5ed435086ebfa40c213c8f74b18c8143bf45ed1" ]
[ "Filtros/Python/filtro_tipo_1.py" ]
[ "#%%\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom numpy import ones,zeros\n# %%\nplt.rcParams['lines.linewidth'] = 3\nplt.rcParams['font.size'] = 20\nplt.rcParams['figure.figsize'] = [16,12]\n#%%\n\nM = 64\nN = M + 1\n\nomega_p = 5\nomega_r = 3.5\nomega_s = 30\n\nkp = int(np.floor(N*omega_p/omega_s))\...
[ [ "numpy.concatenate", "numpy.zeros", "matplotlib.pyplot.stem", "matplotlib.pyplot.grid", "numpy.sum", "numpy.ones", "numpy.real", "matplotlib.pyplot.subplots", "numpy.unwrap", "numpy.fft.fft", "numpy.arange", "numpy.abs", "numpy.cos", "numpy.imag", "numpy...
tngTUDOR/presamples
[ "beb7ec1720b28bb45f45b4250661c03e94366fbf" ]
[ "presamples/models/kronecker_delta.py" ]
[ "from .inventory_base import InventoryBaseModel\nfrom stats_arrays import uncertainty_choices\nimport numpy as np\n\n\nclass KroneckerDelta(InventoryBaseModel):\n \"\"\"A model that choose only one input from multiple possibilities at each iteration. All other possible inputs are set to zero. See `Kronecker delt...
[ [ "numpy.array", "numpy.arange", "numpy.absolute" ] ]
QuantumRoboticsURC/qrteam
[ "49320e6b63589b5f6930dd6314502b8c25a7ff38" ]
[ "qr_rover_nav_difusa/src/qr_rover_nav_difusa/fuzzy.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport numpy as np\n\n#\n# Función singleton(x, x0): función de pertenencia singleton.\n# Argumentos:\n# x: int, float, numpy.ndarray\n# Contiene los valores de x en el universo de discurso\n# para los cuales se evalúa su valor de pertenencia.\n# x0:...
[ [ "numpy.exp", "numpy.zeros" ] ]
Leguark/map2loop
[ "365dde4490f50ad73612120a7d4bee61e54a9a18", "365dde4490f50ad73612120a7d4bee61e54a9a18" ]
[ "notebooks/fpqSegmentLengthHist.py", "map2loop/m2l_geometry.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jul 28 14:02:57 2020\n\nfpqSegmentLengthHist\n\nplots a histogram of segment lengths, from an input file of x,y nodes \n\ninput:\n name of ascii text file of x,y nodes \n \noptions:\n -Bn, number of bins \n\n@author: davidhealy\n\"\"...
[ [ "matplotlib.pylab.title", "matplotlib.pylab.hist", "matplotlib.pylab.subplots", "matplotlib.pylab.savefig" ], [ "pandas.merge", "pandas.DataFrame.from_dict", "pandas.DataFrame", "pandas.concat", "pandas.read_csv" ] ]
EastMagica/SpectralMethod
[ "fbed7fa236c26cfe5cc77d65e4309fd33dca3e3b" ]
[ "example/KdV/run.py" ]
[ "#!/usr/bin/python\n# -*- coding:utf-8 -*-\n# @author : east\n# @time : 2020/7/27 21:49\n# @file : run.py.py\n# @project : SpectralMethod\n# @software : PyCharm\n\nimport numpy as np\nfrom scipy.integrate import solve_ivp\nimport matplotlib.pyplot as plt\n\nfrom rkm.erk import erk\nfrom rkm.plot import i...
[ [ "numpy.array", "numpy.flipud", "numpy.fft.fft", "numpy.arange", "numpy.linspace", "numpy.fft.fftfreq" ] ]
nicksawhney/world-models
[ "1f443a50728c9312f7c977afd4deb3ae32aed95f" ]
[ "model.py" ]
[ "#python model.py car_racing --filename ./controller/car_racing.cma.4.32.best.json --render_mode --record_video\n#xvfb-run -a -s \"-screen 0 1400x900x24\" python model.py car_racing --filename ./controller/car_racing.cma.4.32.best.json --render_mode --record_video\n\n\nimport numpy as np\nimport random\nimport json...
[ [ "numpy.concatenate", "numpy.product", "numpy.array", "numpy.matmul", "numpy.zeros", "numpy.random.seed", "numpy.random.randn", "numpy.exp", "numpy.mean" ] ]
regodme/JAQS
[ "3b23269e289c88bcd366d51dc63bde65666d6ba5" ]
[ "jaqs/trade/backtest.py" ]
[ "# encoding: utf-8\n\"\"\"\nClasses defined in backtest module are responsible to run backtests.\n\nThey follow a fix procedure, from loading data to looping through\ndata and finally save backtest results.\n\n\"\"\"\n\nfrom __future__ import print_function, unicode_literals\nimport six\nimport abc\nfrom collection...
[ [ "pandas.DataFrame", "pandas.tseries.offsets.BDay", "numpy.logical_and", "numpy.intersect1d", "pandas.Series", "pandas.tseries.offsets.Week", "pandas.tseries.offsets.Day", "pandas.tseries.offsets.BMonthBegin" ] ]
LiuHao-THU/frame3d
[ "2c3e35a6ab3226a963257c689ee177d69dead001" ]
[ "resnet50.py" ]
[ "\"\"\"\r\nA Trainable ResNet Class is defined in this file\r\nAuthor: Kaihua Tang\r\n\"\"\"\r\nimport math\r\nimport numpy as np\r\nimport tensorflow as tf\r\nfrom functools import reduce\r\nfrom configs import configs\r\nclass ResNet:\r\n\t# some properties\r\n \"\"\"\r\n Initialize function\r\n \"\"\"\r...
[ [ "tensorflow.contrib.layers.batch_norm", "tensorflow.constant_initializer", "tensorflow.nn.conv2d", "tensorflow.matmul", "numpy.load", "tensorflow.reshape", "tensorflow.nn.softmax", "tensorflow.nn.avg_pool", "tensorflow.concat", "tensorflow.contrib.layers.variance_scaling_in...
robsfletch/bts
[ "c03d821b048fdc2b2735fd77bd193443d40468fc" ]
[ "src/models/value_function.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\ndef generate_policy(probs, max_period):\n num_choices = 2\n\n max_streak = max_period\n num_states = max_streak + 1\n\n ## Get array of choices and possible states\n max_streaks = np.array(range(0, num_states))\n streaks = np.array(range(0, n...
[ [ "numpy.array", "numpy.zeros", "numpy.minimum", "numpy.tile", "numpy.mean", "numpy.einsum", "numpy.argmax", "numpy.amax", "numpy.meshgrid", "numpy.maximum" ] ]
2series/Autonomous-Flight-Engineer
[ "bcb3ed6002908f04a32e1cd746d3505c2dd41853" ]
[ "Project 3 - Controller/FCND-Controls/controls_flyer.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nStarter code for the controls project.\nThis is the solution of the backyard flyer script,\nmodified for all the changes required to get it working for controls.\n\"\"\"\n\nimport time\nfrom enum import Enum\n\nimport numpy as np\n\nfrom udacidrone import Drone\nfrom unity_drone im...
[ [ "numpy.array", "numpy.linalg.norm" ] ]
whydontyoubuildit/wooden-music-visualizer
[ "fdf29e8ee79210f1c57b64693505698f81f301c7" ]
[ "visualizer.py" ]
[ "import errno\nimport math\nimport librosa\nimport numpy as np\nimport scipy.signal\nimport tempfile\nimport os\nimport shutil\nimport multiprocessing\nfrom multiprocessing import Pool\nimport subprocess\nimport sys\nimport argparse\nfrom pathlib import Path\n\nfrom PIL import Image\nfrom PIL import ImageChops\n\n#...
[ [ "numpy.max", "numpy.sqrt", "numpy.array_split" ] ]
hurdol80/rltrader
[ "3291eefd451328aaaa8e033f451a4a4c28a00502" ]
[ "agent.py" ]
[ "import numpy as np\r\nimport utils\r\n\r\n\r\nclass Agent:\r\n # 에이전트 상태가 구성하는 값 개수\r\n STATE_DIM = 2 # 주식 보유 비율, 포트폴리오 가치 비율\r\n\r\n # 매매 수수료 및 세금\r\n TRADING_CHARGE = 0.00015 # 거래 수수료 0.015%\r\n # TRADING_CHARGE = 0.00011 # 거래 수수료 0.011%\r\n # TRADING_CHARGE = 0 # 거래 수수료 미적용\r\n TRADING_...
[ [ "numpy.max", "numpy.isnan", "numpy.random.rand", "numpy.random.randint", "numpy.argmax" ] ]
mbcel/KP2D
[ "567c3f2c500198396e0542e9374d6ecd160285fe" ]
[ "kp2d/networks/keypoint_net.py" ]
[ "# Copyright 2020 Toyota Research Institute. All rights reserved.\n\nimport os\nfrom math import pi\n\nimport torch\nimport torch.nn.functional as F\nfrom PIL import Image\nimport future\n\nfrom kp2d.kp2d.utils.image import image_grid\n\n\nclass KeypointNet(torch.nn.Module):\n \"\"\"\n Keypoint detection net...
[ [ "torch.cat", "torch.nn.MaxPool2d", "torch.norm", "torch.nn.LeakyReLU", "torch.nn.BatchNorm2d", "torch.clamp", "torch.ones", "torch.nn.PixelShuffle", "torch.unsqueeze", "torch.nn.Conv2d", "torch.nn.functional.grid_sample", "torch.nn.Dropout2d" ] ]
thomasaimondy/MDN-SNN
[ "3ca8309525f6015dd1f86ef92d3d33013749cccc" ]
[ "SNN.py" ]
[ "import torch\nimport torch.nn as nn\nfrom block import FC_block\n\nclass SNN(nn.Module):\n def __init__(self, hyperparams):\n super(SNN, self).__init__()\n self.hyperparams = hyperparams\n if self.hyperparams[5] == 'Cifar10':\n self.hidden_size = 1500\n else:\n ...
[ [ "torch.nn.ModuleList" ] ]
violynn/models
[ "21b56ce5fb06eb906912ed0b735e1ab596d3b390" ]
[ "research/object_detection/obRec/model_main.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.estimator.RunConfig", "tensorflow.app.run", "tensorflow.train.latest_checkpoint", "tensorflow.estimator.train_and_evaluate" ] ]
Archaeoraptor/AMI_morality_prediction
[ "8563bec25f3fcbd4ca31e5bc3fc7cf6749fb700a" ]
[ "xgb.py" ]
[ "\nimport pandas as pd\n# pd.options.mode.chained_assignment = None\nimport numpy as np\nimport lightgbm as lgb\n\n\nfrom sklearn import preprocessing\nfrom sklearn.model_selection import train_test_split,cross_val_score,cross_val_predict\nfrom sklearn.ensemble import RandomTreesEmbedding, RandomForestClassifier, G...
[ [ "sklearn.preprocessing.LabelEncoder", "sklearn.metrics.precision_score", "sklearn.metrics.accuracy_score", "sklearn.metrics.recall_score", "sklearn.model_selection.train_test_split", "pandas.read_csv", "sklearn.metrics.f1_score", "sklearn.metrics.roc_auc_score", "sklearn.metric...
weiguang-zz/pylivetrader-1
[ "39cdfdc6a72f3517571040fd2099cd41c6bf9a04" ]
[ "pylivetrader/testing/smoke/backend.py" ]
[ "from pylivetrader import api\nfrom pylivetrader.assets import Asset\n\nimport pylivetrader.protocol as zp\nfrom pylivetrader.assets import Equity\nfrom pylivetrader.finance.order import (\n Order as ZPOrder,\n ORDER_STATUS as ZP_ORDER_STATUS,\n)\nfrom pylivetrader.backend.base import BaseBackend\nimport pand...
[ [ "numpy.sin", "pandas.Timestamp.now", "pandas.Timestamp", "pandas.MultiIndex.from_product", "pandas.concat" ] ]
ilyakava/detectron2
[ "4320d466962fff8661924bc77b8d352e53b5f8a6" ]
[ "detectron2/structures/boxes.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\nimport math\nimport numpy as np\nfrom enum import IntEnum, unique\nfrom typing import List, Tuple, Union\nimport torch\nfrom torch import device\n\nfrom detectron2.utils.env import TORCH_VERSION\n\n_RawBoxType = Union[List[float], Tuple[float, ...], torch.Tensor,...
[ [ "torch.zeros", "torch.device", "torch.cat", "torch.cos", "torch.min", "torch.sin", "torch.max", "numpy.asarray", "torch.isfinite", "torch.tensor", "torch.as_tensor", "torch.empty" ] ]
cedubois/covid19model-fr-regions-results
[ "5372f02c4aff1ee826ca5e1cc2f595abba421e89" ]
[ "reports/all_zone_report/generate_all_zone_md_report.py" ]
[ "# To add a new cell, type '# %%'\n# To add a new markdown cell, type '# %% [markdown]'\n\n# %%\nimport os\nfrom functools import partial\n\n\n# %%\nfrom matplotlib import pyplot as plt\nimport matplotlib\nimport pandas as pd\nfrom numpy import unique\n\n\n# %%\nfrom model_analysis import * \n\n# %% [markdown]\n# #...
[ [ "numpy.unique" ] ]
ettiee/tfx
[ "8e60b158df72d1e6811ade1c934f68d08df25a0c" ]
[ "tfx/components/transform/executor.py" ]
[ "# Lint as: python2, python3\n# Copyright 2019 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\...
[ [ "tensorflow.compat.v1.global_variables_initializer", "tensorflow.compat.v1.Graph", "tensorflow.io.FixedLenFeature", "tensorflow.io.gfile.isdir", "tensorflow.io.gfile.makedirs", "tensorflow.compat.v1.Session", "tensorflow.compat.v1.tables_initializer" ] ]
osmanmusa/learned_iterative_algorithms
[ "e8063fd7332d2f455a1eee03ebf0f940bbe6fb74" ]
[ "LAMP.py" ]
[ "#!/usr/bin/python\nfrom __future__ import division\nfrom __future__ import print_function\n\"\"\"\nThis file serves as an example of how to \na) select a problem to be solved \nb) select a network type\nc) train the network to minimize recovery MSE\n\n\"\"\"\nimport numpy as np\nimport os\n\nos.environ['TF_CPP_MIN...
[ [ "numpy.random.seed", "tensorflow.set_random_seed" ] ]
sbranson/online_crowdsourcing
[ "d1f7c814bb60aae9cf5e76e0b299713246f98ce3" ]
[ "crowdsourcing/util/multibox/model.py" ]
[ "import tensorflow as tf\n\nslim = tf.contrib.slim\n\n\ndef block35(net, scale=1.0, activation_fn=tf.nn.relu, scope=None, reuse=None):\n \"\"\"Builds the 35x35 resnet block.\"\"\"\n with tf.variable_scope(scope, 'Block35', [net], reuse=reuse):\n with tf.variable_scope('Branch_0'):\n tower_conv = slim.conv...
[ [ "tensorflow.shape", "tensorflow.concat", "tensorflow.sigmoid", "tensorflow.reshape", "tensorflow.variable_scope" ] ]
azdaly/sentence-transformers
[ "d365d14e6eb3a79b7589c6404020833d5bda7322" ]
[ "sentence_transformers/util.py" ]
[ "import requests\nfrom torch import Tensor, device\nfrom typing import Tuple, List\nfrom tqdm import tqdm\nimport sys\nimport importlib\nimport os\nimport torch\nimport numpy as np\nimport queue\n\ndef pytorch_cos_sim(a: Tensor, b: Tensor):\n \"\"\"\n Computes the cosine similarity cos_sim(a[i], b[j]) for all...
[ [ "numpy.argpartition", "torch.stack", "numpy.nan_to_num" ] ]
LuMelon/Rumor_RvNN
[ "939831b6338ab48ec1754bc915512f1de07b5486" ]
[ "torch_model/BU_RvNN.py" ]
[ "#-*- encoding: utf8\r\n\r\n__doc__ = \"\"\"Tree GRU aka Recursive Neural Networks.\"\"\"\r\nimport sys\r\nimport numpy as np\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\n\r\nclass Node_tweet(object):\r\n def __init__(self, idx=None):\r\n self.children = []\r\n sel...
[ [ "torch.zeros", "numpy.random.normal", "numpy.array", "torch.nn.Dropout", "torch.tensor" ] ]
MathGaron/pytorch_toolbox
[ "2afd13e50ba71dfce66467a4b070d9b922668502", "2afd13e50ba71dfce66467a4b070d9b922668502" ]
[ "pytorch_toolbox/visualization/train_plots.py", "pytorch_toolbox/probe/runtime.py" ]
[ "import seaborn as sns\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nsns.set_style(\"whitegrid\")\n\n\ndef train_plot(training_logger, validation_logger, order=None):\n\n keys = list(training_logger.keys())\n keys.remove(\"Process Time\")\n keys.remove(\"Load Time\")\n\n if order is not None:\...
[ [ "matplotlib.pyplot.title" ], [ "matplotlib.pyplot.xlabel", "torch.FloatTensor", "numpy.arange", "matplotlib.pyplot.ylabel", "torch.sum" ] ]
BuildACell/vivarium-bioscrape
[ "3ed35babb1cdf018cc71841e3bff928ba384632d" ]
[ "vivarium_bioscrape/composites/bioscrape_connector.py" ]
[ "\"\"\"\n===================\nBioscrape Connector\n===================\n\nrun with:\n> python -m vivarium_bioscrape.composites.bioscrape_connector\n\"\"\"\nimport os\n\nimport numpy as np\n\n# vivarium core imports\nfrom vivarium.library.schema import array_from, array_to\nfrom vivarium.core.engine import pp\nfrom ...
[ [ "numpy.sum", "numpy.array", "numpy.dot", "numpy.abs" ] ]
voirtimid/sentiment-analysis-amazon-reviews
[ "edb43205a5f9399ef2e6c6aa78350a0d043edfb5" ]
[ "refactored_main.py" ]
[ "from dealWithLexicons_afinn_nrc_ import *\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom tqdm import tqdm\nfrom nltk.tokenize import word_tokenize\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Dropout\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics im...
[ [ "numpy.array", "matplotlib.pyplot.xlim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.savefig", "sklearn.metrics.accuracy_score", "matplotlib.pyplot.show", "matp...
gregdurham/yolact
[ "a7991516668c84c0de001a1cae3df5898dfdbcc1" ]
[ "data/config.py" ]
[ "from backbone import ResNetBackbone, VGGBackbone, ResNetBackboneGN, DarkNetBackbone\nfrom math import sqrt\nimport torch\n\n# for making bounding boxes pretty\nCOLORS = ((244, 67, 54),\n (233, 30, 99),\n (156, 39, 176),\n (103, 58, 183),\n ( 63, 81, 181),\n ( 33,...
[ [ "torch.nn.functional.relu", "torch.nn.functional.softmax" ] ]
chrieke/solaris
[ "9cfc10c759c50c73042a44d3b61a8b3e5e01be0b" ]
[ "solaris/nets/metrics.py" ]
[ "from tensorflow.keras import backend as K\nfrom tensorflow import keras\n\n\ndef get_metrics(framework, config):\n \"\"\"Load model training metrics from a config file for a specific framework.\n \"\"\"\n training_metrics = []\n validation_metrics = []\n\n # TODO: enable passing kwargs to these metr...
[ [ "tensorflow.keras.backend.cast", "tensorflow.keras.backend.sum", "tensorflow.keras.backend.stack", "tensorflow.keras.backend.flatten", "tensorflow.keras.backend.epsilon", "tensorflow.keras.backend.mean" ] ]
WenRichard/compare-aggreate
[ "2544468842ac0f991bede858c6cc4943ae22d640" ]
[ "Demo3/Utils.py" ]
[ "# -*- coding: utf-8 -*-\n# @Time : 2018/12/21 11:12\n# @Author : Alan\n# @Email : xiezhengwen2013@163.com\n# @File : Utils.py\n# @Software: PyCharm\n\nimport tensorflow as tf\nimport time\nfrom datetime import timedelta\nimport numpy as np\nfrom collections import defaultdict\nimport pickle\nimport os\nfr...
[ [ "tensorflow.trainable_variables", "tensorflow.multiply", "tensorflow.shape", "numpy.array", "tensorflow.subtract", "tensorflow.equal", "numpy.shape", "tensorflow.clip_by_value", "tensorflow.name_scope", "tensorflow.reduce_sum", "tensorflow.cast" ] ]
predsci/PsiPy
[ "87f9cdfaffb3bec6a1c05e367a5e7ac597b413d2" ]
[ "psipy/model/tests/test_mas.py" ]
[ "import astropy.units as u\nimport numpy as np\nimport pytest\nimport xarray as xr\n\nfrom psipy.model import base, mas\n\n\ndef test_mas_model(mas_model):\n # Check that loading a single file works\n assert isinstance(mas_model, base.ModelOutput)\n assert \"MAS output in directory\" in str(mas_model)\n ...
[ [ "numpy.allclose" ] ]
tingkai-zhang/reclib
[ "3c56dd7f811ab4d4f9f692efd0ee5e171a5f818b" ]
[ "reclib/training/metrics/perplexity.py" ]
[ "import torch\nfrom overrides import overrides\n\nfrom reclib.training.metrics.average import Average\nfrom reclib.training.metrics.metric import Metric\n\n\n@Metric.register(\"perplexity\")\nclass Perplexity(Average):\n \"\"\"\n Perplexity is a common metric used for evaluating how well a language model\n ...
[ [ "torch.exp" ] ]
libeineu/SDT-Training
[ "65518a000fad2359df8783120c4a71011c534f88" ]
[ "fairseq/models/transformer.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the LICENSE file in\n# the root directory of this source tree. An additional grant of patent rights\n# can be found in the PATENTS file in the same directory.\n\nimport math\n\nimport ...
[ [ "torch.nn.Linear", "torch.nn.ModuleList", "torch.nn.init.constant_", "torch.nn.functional.dropout", "torch.FloatTensor", "torch.nn.init.xavier_uniform_", "torch.nn.init.normal_", "torch.nn.functional.linear", "torch.Tensor", "torch.nn.Embedding" ] ]
fzh0917/STMTrack
[ "61730c19ec0eaea393fa3119b8d71023e1173d5b" ]
[ "videoanalyst/model/loss/loss_impl/sigmoid_ce_centerness.py" ]
[ "# -*- coding: utf-8 -*\nimport numpy as np\n\nimport torch\nimport torch.nn.functional as F\n\nfrom ...module_base import ModuleBase\nfrom ..loss_base import TRACK_LOSSES\nfrom .utils import SafeLog\n\neps = np.finfo(np.float32).tiny\n\n\n@TRACK_LOSSES.register\nclass SigmoidCrossEntropyCenterness(ModuleBase):\n ...
[ [ "torch.nn.functional.binary_cross_entropy_with_logits", "numpy.random.rand", "numpy.finfo", "numpy.random.randint", "torch.tensor", "torch.nn.functional.binary_cross_entropy" ] ]
zarqabiqbal/BSRUI
[ "a90adf8d49e54ee88ab403a4bb9a30a29b7accf9" ]
[ "scripts/label_image.py" ]
[ "#!/usr/bin/python\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport argparse,random\nimport time\nimport matplotlib.pyplot as plt\n\nimport numpy as np\nimport tensorflow as tf\n#for removing CPU problem\nimport os\nos.environ['TF_CPP_MIN_LO...
[ [ "tensorflow.image.resize_bilinear", "matplotlib.pyplot.xlim", "tensorflow.import_graph_def", "tensorflow.image.decode_gif", "tensorflow.image.decode_jpeg", "tensorflow.cast", "tensorflow.read_file", "matplotlib.pyplot.savefig", "tensorflow.subtract", "matplotlib.pyplot.tigh...
rtg0795/transform
[ "ee1a769f0e359a8722dca7b434a3b499396a140f" ]
[ "tensorflow_transform/output_wrapper.py" ]
[ "# Copyright 2018 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 appl...
[ [ "tensorflow.python.framework.ops.executing_eagerly_outside_functions", "tensorflow.io.gfile.GFile", "tensorflow.size", "tensorflow.data.TFRecordDataset", "numpy.asarray", "tensorflow.concat", "tensorflow.version.VERSION.split", "tensorflow.io.gfile.glob", "tensorflow.compat.v1....
guanbin1994/arm_fracture_fpn
[ "9aa59b6d1a8a780addb5c7c3f37ed96b736483f5" ]
[ "lib/model/utils/net_utils.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport numpy as np\nimport scipy\nimport colorsys\nimport random\nimport torchvision.models as models\nfrom model.utils.config import cfg\nfrom model.roi_crop.functions.roi_crop import RoICropFunction\nimport...
[ [ "torch.cat", "numpy.random.rand", "numpy.asarray", "numpy.zeros", "numpy.minimum", "numpy.round", "torch.stack", "torch.save", "scipy.misc.imresize", "torch.abs", "numpy.where", "torch.nn.functional.grid_sample", "numpy.sqrt", "torch.nn.functional.max_pool2d...
alex-hayhoe/aitlas-docker
[ "57686f9c18f28c884511fc0c84618506cbf61eae" ]
[ "aitlas/datasets/camvid.py" ]
[ "import csv\nimport os\nimport numpy as np\n\nfrom ..base import BaseDataset\nfrom ..utils import image_loader\nfrom .schemas import SegmentationDatasetSchema\n\nLABELS = ['sky', 'building', 'column_pole', 'road', 'sidewalk', 'tree', 'sign', 'fence',\n 'car', 'pedestrian', 'byciclist', 'void']\n\n\"\"\"\nF...
[ [ "numpy.stack" ] ]
joselynzhao/ATM
[ "bc20a1fe347f3ee52fc82daeb2d0617b9e7eb689" ]
[ "atm08.py" ]
[ "from __future__ import print_function, absolute_import\nfrom reid.snatch import *\nfrom reid import datasets\nfrom reid import models\nimport numpy as np\nimport torch\nimport argparse\nimport os\n\nfrom reid.utils.logging import Logger\nimport os.path as osp\nimport sys\nfrom torch.backends import cudnn\nfrom rei...
[ [ "numpy.max", "numpy.array", "numpy.min" ] ]
sspak9/ml
[ "11de7f7c3dc4a50e162a40f5c84796fec9ea21df" ]
[ "cnn_multi.py" ]
[ "# if using tensorflow, import keras as tf.keras\r\nimport os\r\nimport numpy as np\r\n#import keras\r\n\r\nimport tensorflow as tf\r\nfrom tensorflow import keras\r\n\r\nimport numpy as np\r\n\r\nfrom tensorflow import keras\r\nfrom matplotlib import pyplot as plt\r\n\r\n# print some info\r\nprint('backend:', kera...
[ [ "tensorflow.keras.utils.to_categorical", "tensorflow.keras.backend.image_data_format", "tensorflow.keras.layers.Dense", "tensorflow.keras.models.Sequential", "matplotlib.pyplot.xticks", "matplotlib.pyplot.colorbar", "tensorflow.keras.layers.Conv2D", "numpy.argmax", "matplotlib....
YuetingLi666/pygsp
[ "9c0dc1860e946f0194924be0ecd7509beaf0350d" ]
[ "pygsp/graphs/minnesota.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport numpy as np\nfrom scipy import sparse\n\nfrom pygsp import utils\nfrom . import Graph # prevent circular import in Python < 3.5\n\n\nclass Minnesota(Graph):\n r\"\"\"Minnesota road network (from MatlabBGL).\n\n Parameters\n ----------\n connected : bool\n If Tr...
[ [ "scipy.sparse.lil_matrix", "numpy.array", "scipy.sparse.csc_matrix" ] ]
Koensw/cv-project
[ "de7f4ac5b25ba1d6a26c9d642f1f7d7a1603742e" ]
[ "train.py" ]
[ "from __future__ import print_function\nimport sys\nif len(sys.argv) != 2:\n print('ERROR: pass solver prototxt as argument')\n sys.exit(1)\n\nprint(\"Loading libraries\")\n\nimport matplotlib\nmatplotlib.use(\"Agg\")\n\nimport os\nimport caffe\nimport numpy as np\n\n## ADD PATHS\ndef addPath(path):\n if p...
[ [ "matplotlib.use", "numpy.set_printoptions" ] ]
firmamentqj/AlignPS
[ "4aa8e4d200eea19269048c4382def8c4990001f4", "4aa8e4d200eea19269048c4382def8c4990001f4", "4aa8e4d200eea19269048c4382def8c4990001f4" ]
[ "mmdet/apis/test.py", "mmdet/models/necks/fpn_dcn_full.py", "mmdet/models/dense_heads/anchor_free_head_reid.py" ]
[ "import os.path as osp\nimport pickle\nimport shutil\nimport tempfile\nimport time\n\nimport mmcv\nimport torch\nimport torch.distributed as dist\nfrom mmcv.runner import get_dist_info\n\nfrom mmdet.core import encode_mask_results, tensor2imgs\n\n\ndef single_gpu_test(model,\n data_loader,\n ...
[ [ "torch.zeros", "torch.no_grad", "torch.distributed.all_gather", "torch.full", "torch.tensor", "torch.distributed.barrier", "torch.distributed.broadcast" ], [ "torch.nn.functional.relu", "torch.nn.functional.interpolate", "torch.nn.functional.max_pool2d", "torch.nn.M...
Kivo0/vision
[ "6cc4970b3a01d3357af038c3d4b6a81f9fb74357" ]
[ "torchvision/datasets/utils.py" ]
[ "import os\nimport os.path\nimport hashlib\nimport errno\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:\n pbar.total = total_size\n progress_bytes ...
[ [ "torch.utils.model_zoo.tqdm" ] ]
MStaniek/joeynmt
[ "a3151cec04ace0921bb36f44abf6ea17dbe3bde6" ]
[ "joeynmt/prediction.py" ]
[ "# coding: utf-8\n\nimport torch\n\nfrom joeynmt.constants import PAD_TOKEN\nfrom joeynmt.helpers import load_data, arrays_to_sentences, bpe_postprocess, \\\n load_config, get_latest_checkpoint, make_data_iter, \\\n load_model_from_checkpoint, store_attention_plots\nfrom joeynmt.metrics import bleu, chrf, tok...
[ [ "torch.no_grad", "torch.exp" ] ]
minhoolee/onnx-darknet
[ "d0227c305710b740e6b06315d83b021a183bfdaf" ]
[ "onnx_darknet/handlers/backend/relu.py" ]
[ "import numpy as np\n\nimport onnx_darknet.darknet.darknet_ctypes as dn\n\nfrom onnx_darknet.handlers.backend_handler import BackendHandler\nfrom onnx_darknet.handlers.handler import onnx_op\nfrom onnx_darknet.handlers.handler import darknet_func\n\n\n@onnx_op(\"Relu\")\nclass Relu(BackendHandler):\n\n @classmet...
[ [ "numpy.empty" ] ]
MasazI/SageMaker-MLWorkFlow-XGBoost-sdkv2
[ "68c2e883793881aad743bd7ce9a538182141b41a" ]
[ "processing.py" ]
[ "input_file = '/opt/ml/processing/input/churn.txt';\ntrain_file = '/opt/ml/processing/output/data/train.csv'\nvalidation_file = '/opt/ml/processing/output/data/validation.csv'\ntest_file = '/opt/ml/processing/output/data/test.csv'\n\nimport pandas as pd\nimport numpy as np\nchurn = pd.read_csv(input_file)\nchurn = ...
[ [ "pandas.read_csv", "pandas.get_dummies" ] ]
Young-Excavator/meta_LSM
[ "1b9c8b006c4f899034714b334656b3fc7ca521dc" ]
[ "meta_learner.py" ]
[ "\"\"\"\nUsage Instructions:\n\n\"\"\"\nimport csv\nimport numpy as np\n# import pickle\nimport random\nimport tensorflow as tf\n\nimport pandas as pd\n\nfrom maml import MAML\nfrom scene_sampling import SLICProcessor, TaskSampling\n\nfrom tensorflow.python.platform import flags\n\nfrom utils import tasksbatch_gene...
[ [ "tensorflow.train.start_queue_runners", "numpy.mean", "tensorflow.python.platform.flags.DEFINE_float", "tensorflow.python.platform.flags.DEFINE_string", "tensorflow.nn.softmax", "tensorflow.global_variables_initializer", "tensorflow.InteractiveSession", "tensorflow.python.platform....
LLNL/RASE
[ "6e3452c35297709de3de8d9318c25e6346214c79" ]
[ "src/view_results_dialog.py" ]
[ "###############################################################################\n# Copyright (c) 2018-2021 Lawrence Livermore National Security, LLC.\n# Produced at the Lawrence Livermore National Laboratory\n#\n# Written by J. Chavez, S. Czyz, G. Kosinovsky, V. Mozin, S. Sangiorgio.\n# RASE-support@llnl.gov.\n#\n...
[ [ "matplotlib.figure.Figure", "pandas.unique", "matplotlib.backends.backend_qt5agg.FigureCanvas", "matplotlib.backends.backend_qt5agg.NavigationToolbar2QT" ] ]
kexinchenn/LEAP
[ "97ba277dae29f1111c03dce6484d4104a575ea21" ]
[ "leap_ec/real_rep/problems.py" ]
[ "#!/usr/bin/env python3\n\"\"\" This module contains a variety of classic real-valued optimization\nproblems that frequently occur in research benchmarks.\n\nIt also contains helpers for translating, rotating, and visualizing them.\n\"\"\"\nimport warnings\n\nfrom matplotlib import pyplot as plt\nfrom mpl_toolkits....
[ [ "numpy.random.normal", "numpy.array", "numpy.linalg.norm", "numpy.dot", "numpy.matmul", "numpy.sum", "matplotlib.pyplot.figure", "numpy.random.uniform", "numpy.arange", "numpy.isscalar", "numpy.cos", "numpy.power", "numpy.sqrt", "numpy.abs", "numpy.meshg...
bosskwei/naive_ssd
[ "cdaf61f75674be2a9d7babbb8953d1b367505512" ]
[ "ssd256_1.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as patches\nimport xml.etree.ElementTree as etree\nimport torch\nfrom torch import nn\nfrom torch import optim\nfrom torch.utils import data\nfrom torchvision import models\nfrom scipy import misc\nfrom skimage import io, transform\n\n\...
[ [ "torch.cat", "matplotlib.pyplot.text", "numpy.minimum", "torch.nn.BatchNorm2d", "numpy.multiply", "torch.load", "matplotlib.patches.Rectangle", "torch.nn.CrossEntropyLoss", "numpy.divide", "numpy.less", "torch.nn.MaxPool2d", "matplotlib.pyplot.subplots", "numpy....
dungvtdev/upsbayescpm
[ "f6ee877c689046d3c57a2ac06742cfe4a0b6550e", "f6ee877c689046d3c57a2ac06742cfe4a0b6550e" ]
[ "bayespy/inference/vmp/nodes/tests/test_categorical.py", "bayespy/utils/optimize.py" ]
[ "################################################################################\n# Copyright (C) 2014 Jaakko Luttinen\n#\n# This file is licensed under the MIT License.\n################################################################################\n\n\n\"\"\"\nUnit tests for `categorical` module.\n\"\"\"\n\nim...
[ [ "numpy.random.dirichlet", "numpy.array", "numpy.log", "numpy.ones", "numpy.exp" ], [ "numpy.linalg.norm", "scipy.optimize.minimize" ] ]
STAC-USC/PyNNK_graph_construction
[ "7548722d9421e4abbc36936c828d48bfc1c8dd34" ]
[ "approximate_nnk/approximate_nnk_solver.py" ]
[ "# __author__ = \"shekkizh\"\n# \"\"\"Custom solver for solving batched nnk objective - motivated by ISTA algorithm\"\"\"\n\nimport torch\n\n\n@torch.no_grad()\ndef approximate_nnk(AtA, b, x_init, x_tol=1e-6, num_iter=100, eta=0.05, normalize=False):\n \"\"\"\n Solves an approximation to Non-Negative Kernel r...
[ [ "torch.no_grad", "torch.bmm", "torch.linalg.eigvals" ] ]
o-P-o/statsmodels
[ "ee9f5c0bd7ee7f646bdbaf31fbc295e5a0ab02f8" ]
[ "statsmodels/tools/validation/validation.py" ]
[ "from typing import Any, Optional\nfrom collections.abc import Mapping\n\nimport numpy as np\nimport pandas as pd\n\n\ndef _right_squeeze(arr, stop_dim=0):\n \"\"\"\n Remove trailing singleton dimensions\n\n Parameters\n ----------\n arr : ndarray\n Input array\n stop_dim : int\n Dim...
[ [ "numpy.asarray", "numpy.reshape", "numpy.ascontiguousarray", "pandas.DataFrame", "numpy.real", "pandas.Series", "numpy.imag" ] ]
accsc/gips
[ "6b20b2b0fa76ee24b04237b1edd5c8a26738d460" ]
[ "gips/datastrc/gdat_fit_lib.py" ]
[ "import numpy as np\n#sasa_grid is depracted\n#from gips.grid_solvent.spatial import sasa_grid\nfrom gips.grid_solvent.spatial import sasa_softgrid\n\nfrom gips import FLOAT\nfrom gips import DOUBLE\n\nclass gdat_fit_lib(object):\n\n def __init__(self, gdatarec_dict,\n gdata_dict,\n ...
[ [ "numpy.arange", "numpy.zeros" ] ]
June01/WFSAL-icmr21
[ "86fd6e9e34483ea17e088e4c1ee8f66edf3aecce" ]
[ "dataset/collation.py" ]
[ "import torch\nimport sys\nsys.path.append('..')\n\n# def collate(batch):\n# \"\"\"A custom collate function for dealing with batches of features that have a different number of associated targets\n# (action instances).\n# \"\"\"\n# max_len = max([len(feat) for feat,_,_ in batch])\n#\n# features...
[ [ "torch.Tensor", "torch.tensor" ] ]
maximoskp/guitar_tab_transcription
[ "2c4e3b4feb8b2c35020db050c89d33c5165798b1" ]
[ "flat_tab_in_CNN/train_tab_flat_CNN_out.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Oct 3 07:30:57 2021\n\n@author: user\n\"\"\"\n\nimport numpy as np\nimport sys\nif sys.version_info >= (3,8):\n import pickle\nelse:\n import pickle5 as pickle\nimport tensorflow as tf\nfrom tensorflow import keras\nimport os\nimport matplotlib.pyplot as plt\n...
[ [ "tensorflow.keras.layers.Lambda", "tensorflow.keras.callbacks.CSVLogger", "tensorflow.keras.layers.Reshape", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Dropout", "tensorflow.keras.callbacks.ModelCheckpoint", "tensorflow.keras.layers.Conv2DTranspose", "tensorflow.kera...
a1004123217/pytorch-mobile
[ "97974af3259a2073efbc334d57841efbd3eaadfb" ]
[ "models/imagenet/arch/tests/test_fbnet_v2_fbnet_builder.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\nimport unittest\n\nimport torch\n\nimport mobile_cv.arch.fbnet_v2.fbnet_builder as fbnet_builder\n\n\ndef _build_model(arch_def, dim_in):\n arch_def = fbnet_builder.unify_arch_def(arch_def, [\"blocks\"])\n torch...
[ [ "torch.manual_seed", "torch.Size", "torch.arange" ] ]
ulda/remi
[ "0d4668204cf7f2ac68f497df4777a759c3888c28" ]
[ "editor/widgets/toolbox_opencv.py" ]
[ "# -*- coding: utf-8 -*-\nimport remi\nimport remi.gui as gui\nimport cv2\nfrom threading import Timer, Thread\nimport traceback\nimport time\nimport math\nimport base64\nimport numpy as np\n\nb64encoded_sample_icon = \"iVBORw0KGgoAAAANSUhEUgAAADwAAAAuCAYAAAB04nriAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAFnQAABZ0B24EKIgAA...
[ [ "numpy.fromstring" ] ]
naveenrc/YelpChallenge
[ "f56e979db235faf703b70533b7253b66c182e90e" ]
[ "classifier/classifier.py" ]
[ "from tensorflow.python.framework import ops\nimport tensorflow as tf\nfrom utilities import model as md\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom sklearn.model_selection import train_test_split\nimport os\nimport time\nimport cv2\n\n\ndef model(photos_train, Y_train, photos_test, Y_test, learning_...
[ [ "tensorflow.set_random_seed", "tensorflow.train.AdamOptimizer", "matplotlib.pyplot.xlabel", "tensorflow.argmax", "tensorflow.Session", "numpy.save", "tensorflow.python.framework.ops.reset_default_graph", "matplotlib.pyplot.ylabel", "sklearn.model_selection.train_test_split", ...
mesur-io/perceiver-pytorch
[ "188158299f90b4e8874614dbc2cb050336e1c4df" ]
[ "perceiver_pytorch/perceiver_pytorch.py" ]
[ "from math import pi, log\nfrom functools import wraps\n\nimport torch\nfrom torch import nn, einsum\nimport torch.nn.functional as F\n\nfrom einops import rearrange, repeat\n\n# helpers\n\ndef exists(val):\n return val is not None\n\ndef default(val, d):\n return val if exists(val) else d\n\ndef cache_fn(f):...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.LayerNorm", "torch.nn.Dropout", "torch.nn.ModuleList", "torch.einsum", "torch.finfo", "torch.nn.functional.gelu", "torch.linspace", "torch.meshgrid", "torch.randn" ] ]
jmontag43/udacity_quadcopter
[ "a48dbcf98891946bcc1f8c659d94270a2b5c50a7" ]
[ "agent.py" ]
[ "import copy\nimport numpy as np\nimport random\n\nfrom collections import namedtuple, deque\nfrom keras import layers, models, optimizers\nfrom keras import backend as K\n\nclass ReplayBuffer:\n \n def __init__(self, buffer_size, batch_size):\n self.memory = deque(maxlen=buffer_size)\n self.bat...
[ [ "numpy.array", "numpy.ones", "numpy.reshape", "numpy.vstack" ] ]
kyuyeonpooh/objects-that-sound
[ "962031567f7e5657637d5518dff4f9a44af1c7eb" ]
[ "model/avenet.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom subnet import ImageConvNet, AudioConvNet\n\n\nclass AVENet(nn.Module):\n def __init__(self):\n super(AVENet, self).__init__()\n\n # image subnetwork\n self.icn = ImageConvNet()\n self.img_pool = nn.AdaptiveM...
[ [ "torch.nn.Linear", "torch.rand", "torch.nn.AdaptiveMaxPool2d" ] ]
briandersn/mlperf_inference
[ "2fafad415c620647566343090cdfed0cfeee4dba" ]
[ "v0.5/classification_and_detection/python/main.py" ]
[ "\"\"\"\nmlperf inference benchmarking tool\n\"\"\"\n\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport argparse\nimport array\nimport collections\nimport json\nimport logging\nimport os\nimport threading\nimport time\nfrom queue import Queue\...
[ [ "numpy.percentile", "numpy.array", "numpy.mean" ] ]
Bhaskers-Blu-Org1/ImageNet-Robustness
[ "2e95b2f1aa22fb6a3aef05854ac59da617614e89" ]
[ "test_IterFGSM.py" ]
[ "import os\nimport sys\nimport tensorflow as tf\nimport numpy as np\nimport random\nimport time\n\nfrom setup_imagenet import ImageNet, ImageNetModel\n\nfrom Iter_FGSM_attack import Iter_FGSM\n\nfrom utils_for_test import linf_loss, l0_loss, l1_loss, l2_loss, dump, generate_data\n\n\ndef main(args):\n\n with tf....
[ [ "tensorflow.set_random_seed", "numpy.array", "numpy.isnan", "numpy.random.seed", "tensorflow.Session", "numpy.mean", "numpy.std", "numpy.argmax", "numpy.sort", "numpy.argsort" ] ]
dennismalmgren/homework
[ "d46c7a2845f4fc3bab319d3855705a43bc25c1fc" ]
[ "hw4/model_based_policy.py" ]
[ "import tensorflow as tf\nimport numpy as np\n\nimport utils\n\n\nclass ModelBasedPolicy(object):\n\n def __init__(self,\n env,\n init_dataset,\n horizon=15,\n num_random_action_selection=4096,\n nn_layers=1):\n self._cost_fn ...
[ [ "tensorflow.zeros", "tensorflow.train.AdamOptimizer", "tensorflow.concat", "tensorflow.random_uniform", "tensorflow.Session", "numpy.shape", "tensorflow.placeholder", "tensorflow.losses.mean_squared_error", "tensorflow.tile", "tensorflow.argmin", "tensorflow.global_vari...
369tanya/healthcheck
[ "e1f3ff82037af457a31b65bb7170e72cb14517dd" ]
[ "app.py" ]
[ "# Importing essential libraries\nfrom flask import Flask, render_template, request, redirect, url_for, flash\nimport pickle\nimport numpy as np\nimport joblib\nfrom tensorflow.keras.models import load_model\nfrom PIL import Image\nimport tensorflow as tf\n\n\napp = Flask(__name__)\napp.secret_key = 'O.\\x89\\xcc\\...
[ [ "tensorflow.keras.models.load_model", "numpy.array", "numpy.asarray" ] ]
nathan-blanc/PyFR
[ "8b77eec80707760b529fac2a081abfb5ab8bc916", "8b77eec80707760b529fac2a081abfb5ab8bc916" ]
[ "pyfr/backends/cuda/driver.py", "pyfr/solvers/navstokes/inters.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom ctypes import (POINTER, cast, c_char, c_char_p, c_int, c_size_t, c_uint,\n c_void_p, pointer)\n\nimport numpy as np\n\nfrom pyfr.ctypesutil import LibWrapper\n\n\n# Possible CUDA exception types\nclass CUDAError(Exception): pass\nclass CUDAInvalidValue(CUDAError):...
[ [ "numpy.array", "numpy.prod", "numpy.dtype" ], [ "numpy.sin", "numpy.cos" ] ]
wassemalward/pyGeoStatistics
[ "25cd4b74855ddb5763d87388502424a9742d37ce" ]
[ "pygeostatistics/sgsim.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nSequential Gaussian Simulation\n\nCreated on Sun Dec 4 2016\n\"\"\"\nfrom __future__ import absolute_import, division, print_function\n\n__author__ = \"yuhao\"\n\nimport json\nimport os\nimport time\nfrom collections import namedtuple\nfrom itertools import product\n\nimport matplo...
[ [ "numpy.ones_like", "numpy.random.rand", "numpy.exp", "numpy.finfo", "numpy.cos", "numpy.deg2rad", "numpy.dtype", "scipy.linalg.solve", "numpy.full_like", "numpy.full", "numpy.sin", "numpy.histogram", "numpy.vectorize", "matplotlib.pyplot.subplots", "nump...
qzhu2017/pyXtal
[ "acb8d527a5badef5812e8112e1a8ffd9a62cfbf4" ]
[ "pyxtal/symmetry.py" ]
[ "\"\"\"\nModule for storing & accessing symmetry group information, including\n - Group class\n - Wyckoff_Position class.\n - Hall class\n\"\"\"\n# Imports ------------------------------\n# Standard Libraries\nimport numpy as np\nfrom pkg_resources import resource_filename as rf\nfrom copy import deepcopy\...
[ [ "numpy.dot", "numpy.argmin", "numpy.min", "numpy.random.random", "numpy.linalg.norm", "numpy.linalg.matrix_rank", "pandas.DataFrame", "numpy.eye", "numpy.argmax", "numpy.sqrt", "numpy.linalg.inv", "numpy.mod", "numpy.array", "numpy.zeros", "numpy.round",...
MrrTmob/khmer-tts
[ "a5709146935b02d95821c4b770758b203110da1e" ]
[ "utils.py" ]
[ "import argparse\nimport logging\n\nimport cv2 as cv\nimport librosa\nimport matplotlib.pylab as plt\nimport numpy as np\nimport torch\n\nfrom config import sampling_rate\n\n\ndef clip_gradient(optimizer, grad_clip):\n \"\"\"\n Clips gradients computed during backpropagation to avoid explosion of gradients.\n...
[ [ "numpy.max", "matplotlib.pylab.savefig", "torch.max", "torch.autograd.Variable", "torch.save", "torch.no_grad", "torch.cuda.LongTensor", "numpy.min", "torch.from_numpy", "torch.cuda.is_available", "matplotlib.pylab.title" ] ]
TBarasch/Workflows_Group_306
[ "b117fca36f066d8ff818d8f2ae3ba0fe78fd9dee" ]
[ "src/model.py" ]
[ "\n#author : Simardeep Kaur\n#date : 25 January, 2020\n\n\"\"\" Runs classification model on the cleaned data to get the accuarcy on the test results\n\nUsage: src/model.py --train_file=<train_file> --test_file=<test_file>\n\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nimport altair as alt\nfrom sklearn.ense...
[ [ "sklearn.metrics.plot_confusion_matrix", "sklearn.ensemble.RandomForestClassifier", "matplotlib.pyplot.savefig", "sklearn.linear_model.LogisticRegression", "sklearn.model_selection.GridSearchCV", "pandas.read_csv" ] ]
guikunchen/SGG_from_NLS
[ "e0be872411306ea9760f359e3426512fcf18132f" ]
[ "maskrcnn_benchmark/modeling/roi_heads/relation_head/roi_relation_predictors.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom torch.nn.utils.rnn import pad_sequence\n\nfrom maskrcnn_benchmark.modeling import registry\nfrom maskrcnn_benchmark.layers import smooth_l1_loss, kl_div_loss, entr...
[ [ "torch.nn.Linear", "torch.nonzero", "torch.cat", "torch.zeros", "torch.nn.functional.binary_cross_entropy_with_logits", "torch.stack", "torch.sigmoid", "torch.max", "torch.arange", "torch.nn.utils.rnn.pad_sequence", "torch.no_grad", "torch.nn.ReLU", "torch.tenso...
DynamicYieldProjects/funnel-rocket
[ "70963fddc0881cebdc6da1af2654d412f95d660c" ]
[ "tests/test_registration_task.py" ]
[ "# Copyright 2021 The Funnel Rocket Maintainers\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 a...
[ [ "numpy.isnan" ] ]
lgrozinger/pyolin
[ "dde2eab39671a768d9572019355d4fbb1c7a094e", "dde2eab39671a768d9572019355d4fbb1c7a094e" ]
[ "pyolin/gate.py", "pyolin/prediction.py" ]
[ "import numpy\nimport scipy.optimize as optim\nimport matplotlib.pyplot as plt\n\nimport pyolin.utils as utils\n\nfrom math import log10 as log\nfrom math import log as ln\nfrom math import exp\n\n\nclass Gate:\n def __init__(self, name, iptg, rpu_in, rpu_out):\n self.iptg = iptg\n self.rpu_in = rp...
[ [ "numpy.array", "scipy.optimize.least_squares", "matplotlib.pyplot.subplots" ], [ "numpy.array", "numpy.linalg.norm", "numpy.sum", "numpy.exp", "matplotlib.pyplot.figure", "matplotlib.pyplot.show" ] ]
BUAA503Control/PX4-Offboard-Python
[ "e1b1c0ddd37837d981e60324cda0edd10c821dc3" ]
[ "src/offb_py/src/scripts/offb_reciever.py" ]
[ "#!/usr/bin/env python\n\nimport rospy\nimport numpy\nfrom geometry_msgs.msg import *\nfrom mavros_msgs.srv import CommandBool\nfrom mavros_msgs.srv import SetMode\nfrom mavros_msgs.msg import State\n\ncurrent_state = State()\npose = PoseStamped()\nvel = TwistStamped()\nvel.twist.linear.x = 0\nvel.twist.linear.y = ...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.zeros" ] ]
la3lma/danspeech
[ "acd9dd1e2b9750292bd27c97ee25cf65edc196f2" ]
[ "danspeech/audio/parsers.py" ]
[ "from abc import ABC, abstractmethod\n\nimport torch\n\nimport scipy\nimport numpy as np\nimport librosa\n\nwindows = {'hamming': scipy.signal.hamming, 'hann': scipy.signal.hann, 'blackman': scipy.signal.blackman,\n 'bartlett': scipy.signal.bartlett}\n\n\nclass AudioParser(ABC):\n \"\"\"\n Abstract ...
[ [ "numpy.concatenate", "torch.FloatTensor", "numpy.mean", "numpy.log1p", "numpy.std" ] ]
hihunjin/perlin-noise-python-numpy
[ "67e410a8e87ed31f973c863cb609a0822fff9129" ]
[ "perlin_noise.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\nfrom itertools import product, count\n\nfrom matplotlib.colors import LinearSegmentedColormap\n\n\n# it produce more vectors pointing diagonally than vectors pointing along\n# an axis\n# # generate uniform unit vectors\n# def generate...
[ [ "numpy.sin", "numpy.matmul", "numpy.zeros", "matplotlib.pyplot.figure", "numpy.random.uniform", "numpy.arange", "numpy.cos", "numpy.meshgrid", "matplotlib.pyplot.axis", "matplotlib.pyplot.imshow" ] ]
victor-shepardson/word-vector-experiments
[ "154f59a47c2b2f6d349e39cab0d11a341bc160c0" ]
[ "util/util.py" ]
[ "import numpy as np\nimport libvictor as lv\nfrom tqdm import tqdm_notebook\nfrom tqdm import tqdm as tqdm_text\nimport pandas as pd\nfrom collections import defaultdict\n\ndef make_pbar(verbose, notebook):\n def dummy(x, **kwargs):\n return x\n if verbose: return tqdm_notebook if notebook else tqdm_te...
[ [ "numpy.max", "numpy.array", "numpy.random.choice", "numpy.random.seed", "numpy.bincounts", "numpy.mean", "numpy.std", "numpy.power", "pandas.read_csv" ] ]
pbretz99/bayesian_examples
[ "c94322b61da0566d1e8dd436191077f5bc6b904b" ]
[ "RWWN_vel.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Fri Feb 19 13:52:52 2021\r\n\r\n@title: Random Walk With Noise\r\n@author: Philip Bretz\r\n\"\"\"\r\n\r\n'''\r\nThe code below simulates a random walk with \r\nnoise. The Kalman filter is then applied to \r\nthe simulated data.\r\n'''\r\n\r\nimport numpy as np\r\n\r\...
[ [ "numpy.array" ] ]
abogdanova/FedMed
[ "72f238c31b6714c664e1b0e40204f9528f764182" ]
[ "federated-0.4.0/tensorflow_federated/python/core/impl/graph_utils.py" ]
[ "# Lint as: python3\n# Copyright 2018, The TensorFlow Federated 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# ...
[ [ "tensorflow.data.Iterator.from_string_handle", "numpy.array", "tensorflow.data.Dataset.range", "tensorflow.data.Dataset.from_tensor_slices", "numpy.zeros", "tensorflow.constant", "tensorflow.placeholder", "tensorflow.contrib.framework.is_tensor" ] ]
DerekRay/2020-instanceSeg
[ "a08ad95e64726db53cc32a5f90aaa13ae3cdb6a3" ]
[ "dvis_network.py" ]
[ "import torch, torchvision\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torchvision.models.resnet import Bottleneck\nimport torch.backends.cudnn as cudnn\nimport torch.utils.model_zoo as model_zoo\nfrom typing import List\nfrom collections import defaultdict\nimport os\nfrom backbone import constru...
[ [ "torch.zeros", "torch.device", "torch.cat", "torch.set_default_tensor_type", "torch.nn.functional.interpolate", "torch.utils.model_zoo.load_url", "torch.nn.init.xavier_uniform_", "torch.cuda.device_count", "torch.cuda.current_device", "torch.nn.Conv2d", "torch.cuda.is_a...
andreifoldes/rbm
[ "892e01252e1c81b639c695785608ca85ebee26fd" ]
[ "tfrbm/reg_rbm.py" ]
[ "import numpy as np\nimport tensorflow as tf\nimport tensorflow_probability as tfp\nfrom .rbm import RBM\nfrom .util import sample_bernoulli, sample_gaussian\n\ntfd = tfp.distributions\ndist = tfd.Normal(loc=0., scale=1.)\n\n\n\nclass RegRBM(RBM):\n def __init__(self, n_visible, n_hidden, t=1e-3, lam=1e-3, samp...
[ [ "tensorflow.shape", "tensorflow.matmul", "tensorflow.transpose", "tensorflow.reduce_mean", "tensorflow.square" ] ]
avamys/CapacityBasedLearning
[ "1f24f3f5d18dd38e2ed6abdd6126490de89fa9e6", "1f24f3f5d18dd38e2ed6abdd6126490de89fa9e6" ]
[ "tests/test_data_preprocessing.py", "src/models/network.py" ]
[ "import pandas as pd\nimport numpy as np\nimport unittest\nfrom unittest.mock import patch\nfrom src.data.preprocessing import DataPreprocessor\n\n\nclass TestDataPreprocessor(unittest.TestCase):\n def setUp(self):\n self.dp = DataPreprocessor('extreme')\n\n def test_read_data(self):\n X, y = se...
[ [ "pandas.DataFrame", "numpy.array", "numpy.isnan", "pandas.Series" ], [ "torch.zeros", "torch.nn.Linear", "torch.nonzero", "torch.stack", "torch.nn.ModuleList", "torch.nn.Sequential", "torch.nn.ModuleDict", "torch.ones", "torch.nn.functional.linear", "tor...
msakai/DeepSentinel
[ "b090a74a54b4f162ce6f078b57976353dc276dec" ]
[ "tests/models/dnn/model/test_loss_calculator.py" ]
[ "from unittest.mock import MagicMock, patch, call\n\nimport pytest\nimport numpy as np\n\nimport chainer\nfrom chainer import Variable\n\nfrom deep_sentinel.models.dnn.model import loss_calculator\n\nchainer.global_config.train = False\nchainer.global_config.enable_backprop = False\n\n\ndef to_variable(arr, astype=...
[ [ "numpy.array" ] ]
alefefreire/MLtraining
[ "8465cad0121898454b05c80d5ab4b0a48b3e85f6" ]
[ "my_utils.py" ]
[ "import pandas as pd\r\nimport numpy as np\r\nfrom scipy.stats import mode, gaussian_kde\r\nfrom scipy.optimize import minimize, shgo\r\nfrom sklearn.metrics import mean_squared_error as mse\r\nfrom sklearn.metrics import mean_absolute_error as mae\r\nfrom sklearn.model_selection import KFold,StratifiedKFold\r\nfro...
[ [ "matplotlib.pyplot.style.context", "numpy.mean", "pandas.concat", "sklearn.metrics.f1_score", "matplotlib.pyplot.xticks", "sklearn.model_selection.StratifiedKFold", "pandas.DataFrame", "sklearn.metrics.fbeta_score", "numpy.arange", "matplotlib.pyplot.tight_layout", "mat...
teju85/cuml
[ "91ddc9eb557d7dc948e8394755890ee4a3102efd" ]
[ "python/cuml/preprocessing/model_selection.py" ]
[ "# Copyright (c) 2019, NVIDIA CORPORATION.\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 l...
[ [ "numpy.arange" ] ]
argriffing/numpy
[ "da6e4c71aa229b8bdb18d643456cda4594e6384a" ]
[ "numpy/distutils/misc_util.py" ]
[ "from __future__ import division, absolute_import, print_function\n\nimport os\nimport re\nimport sys\nimport imp\nimport copy\nimport glob\nimport atexit\nimport tempfile\nimport subprocess\nimport shutil\n\nimport distutils\nfrom distutils.errors import DistutilsError\ntry:\n from threading import local as tlo...
[ [ "numpy.distutils.core.Extension", "numpy.distutils.system_info.system_info.saved_results.items", "numpy.get_include", "numpy.distutils.compat.get_exception", "numpy.distutils.npy_pkg_config.read_config", "numpy.distutils.core.get_distribution" ] ]
KarrLab/Kinetic-Datanator
[ "8aff047fd117033b98eca8ee3b21a8f07c430dec" ]
[ "datanator/data_source/protein_localization/victoria_insert_neg_wo_outer_membrane.py" ]
[ "import pandas as pd\r\nfrom pymongo import MongoClient\r\nfrom datanator_query_python.util import mongo_util\r\nfrom datanator_query_python.config import config\r\n\r\nclass insert_neg_wo_outer_membrane(mongo_util.MongoUtil):\r\n def __init__(self,\r\n MongoDB=None,\r\n db=None,\...
[ [ "pandas.notnull", "pandas.read_csv" ] ]
Bakikii/Franks-TrackPY
[ "964a3aec9ef4a1894713afb4dbb215bb57dbaedc" ]
[ "trackpy/framewise_data.py" ]
[ "from __future__ import (absolute_import, division, print_function,\n unicode_literals)\nimport six\nimport logging\nimport os\nfrom abc import ABCMeta, abstractmethod, abstractproperty\nimport warnings\n\nimport pandas as pd\n\nfrom .utils import pandas_concat\n\nlogger = logging.getLogger(_...
[ [ "pandas.HDFStore", "pandas.DataFrame", "pandas.get_store" ] ]
RoyRGitHub/STDL-Project
[ "bae689ea12682bb60f6e1ed19677d2ae2238cda7" ]
[ "executionModule.py" ]
[ "import torch\r\nfrom torch.utils.data import Dataset, DataLoader\r\nfrom torch.utils.data import random_split\r\nimport torchvision\r\nimport numpy as np\r\nimport pandas as pd\r\nfrom sklearn.decomposition import NMF\r\nfrom deepNetworkArchitechture import *\r\nfrom projectUtilities import *\r\n\r\nimport matplot...
[ [ "matplotlib.use", "torch.nn.Linear", "numpy.savetxt", "torch.nn.MSELoss", "numpy.matmul", "pandas.DataFrame", "torch.no_grad", "torch.split", "numpy.mean", "torch.utils.data.DataLoader", "numpy.average", "numpy.vstack" ] ]
NemoHimma/ZeroRL
[ "c37cb3105981b7d9331749941df3e3f449976fde" ]
[ "Discrete_Algo/Train_Rainbow.py" ]
[ "import os, glob\nimport numpy as np\nimport torch\nfrom tqdm import tqdm\n\nfrom timeit import default_timer as timer\nfrom datetime import timedelta\n\nfrom utils.hyperparameters import Config\nfrom utils.plot import plot_all_data\n\nfrom envs.AtariEnv import PrepareAtariEnv\n\nfrom agents.RainbowAgent import Rai...
[ [ "torch.cuda.is_available" ] ]
wesselb/neuralprocesses
[ "d5461e210e1e8176a3027dc485714b6903070654" ]
[ "train.py" ]
[ "import lab.torch as B\nimport numpy as np\nimport torch\nimport stheno\n\nfrom neuralprocesses.data import GPGenerator\nfrom neuralprocesses.gnp import GNP\n\nif torch.cuda.is_available():\n device = \"cuda\"\nelse:\n device = \"cpu\"\n\n\ngen = GPGenerator(kernel=stheno.EQ().stretch(0.25) + 0.05 ** 2 * sthe...
[ [ "torch.distributions.MultivariateNormal", "torch.cuda.is_available" ] ]
kkaytekin/3detr
[ "11aff837e29242d1df3a1a97dbe3949989aa1d12" ]
[ "utils/misc.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\nimport torch\nimport numpy as np\nfrom collections import deque\nfrom typing import List\nfrom tridetr.utils.dist import is_distributed, barrier, all_reduce_sum\n\n\ndef my_worker_init_fn(worker_id):\n np.random.seed(np.random.get_state()[1][0] + worker_id)\n\...
[ [ "torch.abs", "numpy.random.get_state", "torch.tensor", "torch.clamp" ] ]