repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
brunasenra/Store_Sales_Prediction
[ "6f7371188e37ebb905e171bd8afaae9e41f5cdf5" ]
[ "API/rossmann/Rossmann.py" ]
[ "import pickle\nimport inflection\nimport pandas as pd\nimport numpy as np\nimport math\nimport datetime\n\nclass Rossmann(object):\n def __init__(self):\n self.home_path = 'C:/Users/bruna/OneDrive/Favoritos compartilhados\\DATA SCIENCE\\BRUNA\\DATA SCIENCE\\PROJECTS\\Store_Sales_Prediction'\n \n ...
[ [ "pandas.to_datetime", "numpy.sin", "numpy.expm1", "numpy.cos", "pandas.get_dummies" ] ]
Huangheyl/Paddle
[ "c560a7d57aad990f374ebadd330351f18e2ca65f", "a1b640bc66a5cc9583de503e7406aeba67565e8d", "c560a7d57aad990f374ebadd330351f18e2ca65f" ]
[ "python/paddle/fluid/tests/unittests/test_jit_save_load.py", "python/paddle/fluid/framework.py", "python/paddle/fluid/tests/unittests/dist_fleet_ctr_ps_gpu.py" ]
[ "# Copyright (c) 2020 PaddlePaddle 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 re...
[ [ "numpy.random.seed", "numpy.random.random" ], [ "numpy.dtype" ], [ "numpy.array", "numpy.mean" ] ]
AlohaBazinga/Surgery-Robot-Detection-Segmentation
[ "f42a3562cbb6a77ba195f5aa4828876afaf02500" ]
[ "surgery.py" ]
[ "\"\"\"\nMask R-CNN\nTrain on the surgery robot dataset.\n\nCopyright (c) 2018 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\n------------------------------------------------------------\n\nUsage: import the module (see Jupyter notebooks for examples), or ru...
[ [ "numpy.concatenate", "numpy.array", "numpy.reshape", "numpy.zeros", "numpy.sum", "matplotlib.pyplot.close", "numpy.where", "numpy.argsort", "matplotlib.pyplot.clf" ] ]
sniafas/mlflow
[ "c577c7f199d9efa076344785dabb2121edb7e6c8" ]
[ "mlflow/pyfunc/__init__.py" ]
[ "\"\"\"\nThe ``python_function`` model flavor serves as a default model interface for MLflow Python models.\nAny MLflow Python model is expected to be loadable as a ``python_function`` model.\n\nIn addition, the ``mlflow.pyfunc`` module defines a generic :ref:`filesystem format\n<pyfunc-filesystem-format>` for Pyth...
[ [ "pandas.isnull", "pandas.DataFrame", "numpy.array" ] ]
pearsonlab/python-neo
[ "8915dfe9e55fd3a36be83d820bdd83ab085e9402" ]
[ "neo/io/neuroexplorerio.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nClass for reading data from NeuroExplorer (.nex)\n\nDocumentation for dev :\nhttp://www.neuroexplorer.com/code.html\n\nDepend on:\n\nSupported : Read\n\nAuthor: sgarcia,luc estebanez\n\n\"\"\"\n\nimport os\nimport struct\n\nimport numpy as np\nimport quantities as pq\n\nfrom neo.io...
[ [ "numpy.array", "numpy.dtype" ] ]
sam-cts/logistic_lda
[ "405caf212ba0def212feb82f8d9aaec1e491f735" ]
[ "logistic_lda/utils.py" ]
[ "\"\"\"\nCopyright 2019 Twitter, Inc.\nLicensed under the Apache License, Version 2.0\nhttp://www.apache.org/licenses/LICENSE-2.0\n\"\"\"\n\nimport numpy as np\nimport tensorflow as tf\n\n\ndef softmax_cross_entropy(targets, logits):\n \"\"\"\n Implements a simple softmax cross entropy.\n\n $$-\\sum_i t_{ni} \\c...
[ [ "tensorflow.reduce_logsumexp", "tensorflow.contrib.lookup.KeyValueTensorInitializer", "tensorflow.reduce_sum" ] ]
sguada/circuit_training
[ "220ca925c83cdc6e67181c305da577f305c602b3" ]
[ "circuit_training/learning/train_ppo_lib.py" ]
[ "# coding=utf-8\n# Copyright 2021 The Circuit Training Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unles...
[ [ "tensorflow.repeat", "tensorflow.shape", "tensorflow.nest.flatten", "tensorflow.nest.map_structure" ] ]
troywinter/airflow
[ "ba66ba0d97941c55d9f00f66329a9d3c7ad673e7" ]
[ "airflow/providers/salesforce/hooks/salesforce.py" ]
[ "#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\")...
[ [ "pandas.to_datetime", "pandas.DataFrame.from_records", "pandas.Series" ] ]
Lzc06/vega
[ "df51ed9c1d6dbde1deef63f2a037a369f8554406" ]
[ "vega/algorithms/nas/esr_ea/esr_search.py" ]
[ "# -*- coding:utf-8 -*-\n\n# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.\n# This program is free software; you can redistribute it and/or modify\n# it under the terms of the MIT License.\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; withou...
[ [ "numpy.asarray", "numpy.min", "numpy.save", "numpy.stack", "numpy.random.randint", "numpy.cumsum", "pandas.read_csv" ] ]
mwdchang/delphi
[ "c6177f2d614118883eaaa7f5300f3e46f10ddc7e" ]
[ "scripts/data_processing/process_climis_unicef_ieconomics_data.py" ]
[ "\"\"\" Script for cleaning data for 12 month evaluation. \"\"\"\n\nimport os\nimport re\nimport sys\nimport numpy as np\nimport pandas as pd\nfrom pprint import pprint\nfrom glob import glob\nfrom typing import List, Dict\nfrom delphi.utils.shell import cd\nfrom delphi.paths import data_dir, south_sudan_data\nfrom...
[ [ "pandas.isnull", "pandas.read_table", "pandas.DataFrame", "pandas.read_excel", "numpy.mean", "pandas.concat", "pandas.read_csv" ] ]
rndtestnt/riskAnalysis
[ "36601374b60efd3f7680adee84e9e54e2f2b52a2" ]
[ "train.py" ]
[ "import os\nimport warnings\nimport sys\n\nimport pandas as pd\nimport numpy as np\nfrom itertools import cycle\nimport matplotlib.pyplot as plt\nfrom sklearn.metrics import mean_squared_error, mean_absolute_error, r2_score\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.linear_model import Elas...
[ [ "sklearn.metrics.mean_squared_error", "sklearn.model_selection.train_test_split", "numpy.random.seed", "sklearn.linear_model.ElasticNet", "sklearn.metrics.mean_absolute_error", "sklearn.metrics.r2_score", "pandas.read_csv" ] ]
alexcwsmith/scTriangulate
[ "ec014a4c575f4fd3270922ee9197493a6ec0846c" ]
[ "sctriangulate/metrics.py" ]
[ "import scanpy as sc\nimport pandas as pd\nimport numpy as np\nimport anndata as ad\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport sys\nimport gseapy as gp\nimport math\nimport os\n\ndef check_filter_single_cluster(adata,key):\n vc = adata.obs[key].value_counts()\n exclude_clusters= vc.loc[vc...
[ [ "sklearn.metrics.confusion_matrix", "sklearn.linear_model.HuberRegressor", "numpy.min", "numpy.mean", "numpy.count_nonzero", "pandas.DataFrame", "numpy.nonzero", "numpy.arange", "sklearn.linear_model.RANSACRegressor", "sklearn.model_selection.StratifiedShuffleSplit", "n...
DSimonne/bcdi
[ "5740a75576d7c3760ac72358acfb51321d51f82b", "5740a75576d7c3760ac72358acfb51321d51f82b", "5740a75576d7c3760ac72358acfb51321d51f82b" ]
[ "bcdi/postprocessing/facet_recognition.py", "bcdi/graph/graph_utils.py", "scripts/utils/bcdi_crop_npz.py" ]
[ "# -*- coding: utf-8 -*-\n\n# BCDI: tools for pre(post)-processing Bragg coherent X-ray diffraction imaging data\n# (c) 07/2017-06/2019 : CNRS UMR 7344 IM2NP\n# (c) 07/2019-05/2021 : DESY PHOTON SCIENCE\n# authors:\n# Jerome Carnis, carnis_jerome@yahoo.fr\n\"\"\"Functions related to facet recognit...
[ [ "numpy.dot", "matplotlib.pyplot.connect", "numpy.median", "numpy.copy", "numpy.rint", "numpy.multiply", "matplotlib.patches.Ellipse", "scipy.ndimage.measurements.center_of_mass", "scipy.interpolate.griddata", "numpy.gradient", "scipy.signal.convolve", "numpy.concate...
vinnamkim/examples
[ "f1838619141d7f2a2553f7282c642a6f51a4df48", "f1838619141d7f2a2553f7282c642a6f51a4df48" ]
[ "regression/main.py", "word_language_model/main.py" ]
[ "#!/usr/bin/env python\nfrom __future__ import print_function\nfrom itertools import count\n\nimport torch\nimport torch.nn.functional as F\n\nPOLY_DEGREE = 4\nW_target = torch.randn(POLY_DEGREE, 1) * 5\nb_target = torch.randn(1) * 5\n\n\ndef make_features(x):\n \"\"\"Builds features i.e. a matrix with columns [...
[ [ "torch.randn" ], [ "torch.device", "torch.no_grad", "torch.save", "torch.manual_seed", "torch.cuda.is_available", "torch.LongTensor", "torch.onnx.export", "torch.load", "torch.nn.CrossEntropyLoss" ] ]
skmatz/frcnn
[ "eae9d42f964a5883f72dc294984c019b3c75e837" ]
[ "frcnn/viewer.py" ]
[ "\"\"\"Module for (demo) viewer.\"\"\"\n\nimport os\nfrom dataclasses import dataclass\nfrom glob import glob\nfrom logging import getLogger\nfrom os.path import basename, join\nfrom typing import List, Optional, Tuple\n\nimport cv2\nimport numpy as np\nimport seaborn as sns\nimport torch\nimport torch.cuda\nimport...
[ [ "torch.no_grad", "torch.cuda.is_available", "torch.load" ] ]
zhangqx/movie_recommender
[ "93eddb89f7ac2a8358bbe5c91b26e7e2b4184c38" ]
[ "wang/trainModel.py" ]
[ "import os\n#\n#\n# % matplotlib inline\n# % config InlineBackend.figure_format = 'retina'\nimport matplotlib\nmatplotlib.use('TkAgg')\nimport matplotlib.pyplot as plt\nimport time\nimport datetime\nimport numpy as np\nfrom sklearn.model_selection import train_test_split\nimport pandas as pd\nimport pickle\nimport ...
[ [ "tensorflow.nn.conv2d", "tensorflow.train.import_meta_graph", "tensorflow.contrib.layers.fully_connected", "tensorflow.reshape", "tensorflow.nn.embedding_lookup", "tensorflow.losses.mean_squared_error", "tensorflow.global_variables_initializer", "tensorflow.concat", "tensorflow...
santamm/DeepNet
[ "fd05804200eb1bd62fb3a80a793b22794e4ec7d2" ]
[ "dnn_utils.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport h5py\n\n\ndef sigmoid(Z):\n \"\"\"\n Implements the sigmoid activation in numpy\n\n Arguments:\n Z -- numpy array of any shape\n\n Returns:\n A -- output of sigmoid(z), same shape as Z\n cache -- returns Z as well, useful during backp...
[ [ "numpy.divide", "matplotlib.pyplot.subplot", "numpy.array", "numpy.dot", "numpy.zeros", "numpy.log", "numpy.random.seed", "numpy.sum", "numpy.random.randn", "numpy.exp", "matplotlib.pyplot.figure", "numpy.where", "numpy.sqrt", "matplotlib.pyplot.show", "...
akusumoto/sample_dash
[ "431d4b8a0e524ed8eb6f616594afbb67f5dcd428" ]
[ "extract.py" ]
[ "import numpy as np\r\n\r\n\r\ndef random(texture, num):\r\n# idx = np.random.choice(texture.shape[0], num, replace=False) # 乱数を抽出するときに重複を許さない場合(ただし、サンプル数が少ないとエラーになりやすい)\r\n idx = np.random.choice(texture.shape[0], num) # 乱数を抽出するときに重複を許す場合(ただし、サンプル数が少ない時でも安定)\r\n return texture[idx]\r\n\r\n\r\ndef stat(tex...
[ [ "numpy.random.choice" ] ]
paulc/streamlit-hello
[ "f41623efe049db982ac63af725ee2316477360e3" ]
[ "t1.py" ]
[ "\nimport streamlit as st\nimport pandas as pd\n\nst.write(\"Here's our first attempt at using data to create a table:\")\nst.write(pd.DataFrame({\n 'first column': [1, 2, 3, 4],\n 'second column': [10, 20, 30, 40]\n}))\n\n" ]
[ [ "pandas.DataFrame" ] ]
a8/discovergy
[ "7766a6eb74e8c3cf9b09dfdac21d79b31f5922e5" ]
[ "src/discovergy/utils.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"\n\nDiscovergy shared helper code\n\n\"\"\"\n__author__ = \"Frank Becker <fb@alien8.de>\"\n__copyright__ = \"Frank Becker\"\n__license__ = \"mit\"\n\nimport gzip\nimport json\nimport os\nimport re\nimport sys\n\nfrom contextlib import ContextDecorator\nfrom pathlib import Path\nfro...
[ [ "pandas.read_hdf" ] ]
hssinejihene/deepchem-1.1.0
[ "6efbe6b638b77bb2685ac617f4d6649755c01335", "6efbe6b638b77bb2685ac617f4d6649755c01335" ]
[ "deepchem/nn/model_ops.py", "examples/benchmark2.py" ]
[ "\"\"\"Ops for graph construction.\n\nLarge amounts of code borrowed from Keras. Will try to incorporate into\nDeepChem properly.\n\"\"\"\nfrom __future__ import print_function\nfrom __future__ import division\nfrom __future__ import unicode_literals\n\nimport os\nimport sys\nimport traceback\nimport numpy as np\ni...
[ [ "tensorflow.exp", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.constant_initializer", "tensorflow.matmul", "tensorflow.train.AdagradOptimizer", "tensorflow.nn.moments", "tensorflow.reshape", "tensorflow.sqrt", "tensorflow.clip_by_value", "tensorflow.cast",...
gzhu06/TDspkr-mismatch-study
[ "1106a988e15a111646981c5b6fb30219d1ff6e8a" ]
[ "backbones/aggregator/ECAPA-TDNN.py" ]
[ "'''\nReference: https://github.com/lawlict/ECAPA-TDNN\n'''\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n''' Res2Conv1d + BatchNorm1d + ReLU\n'''\nclass Res2Conv1dReluBn(nn.Module):\n '''\n in_channels == out_channels == channels\n '''\n def __init__(self, channels, kernel_...
[ [ "torch.zeros", "torch.nn.Linear", "torch.cat", "torch.nn.ModuleList", "torch.nn.Conv1d", "torch.split", "torch.nn.BatchNorm1d", "torch.nn.functional.relu", "torch.sum" ] ]
Solid-Mechanics/matplotlib-4-abaqus
[ "96bdd150fcd92fa155dfc7b13d930bab394e8e47", "96bdd150fcd92fa155dfc7b13d930bab394e8e47" ]
[ "matplotlib/collections.py", "matplotlib/axis.py" ]
[ "\"\"\"\nClasses for the efficient drawing of large collections of objects that\nshare most properties, e.g., a large number of line segments or\npolygons.\n\nThe classes are not meant to be as flexible as their single element\ncounterparts (e.g., you may not be able to select all line styles) but\nthey are meant t...
[ [ "matplotlib.transforms.Bbox.unit", "matplotlib.artist.Artist.update_from", "matplotlib.artist.kwdoc", "numpy.concatenate", "matplotlib.cbook.is_string_like", "numpy.empty", "matplotlib.mlab.contiguous_regions", "matplotlib.transforms.IdentityTransform", "numpy.sqrt", "matpl...
waterfallhyb/portfolio-examples
[ "46ff40f593c88979495f0987f857d056f8addaf7" ]
[ "tensorflow2/ABC_COVID-19/ABC_IPU.py" ]
[ "# Copyright 2020 Graphcore Ltd.\r\n\"\"\"\r\nABC algorithm for COVID-19 modelling, replicated across multiple IPUs.\r\n\r\nSee README for model background.\r\n\"\"\"\r\n\r\nimport numpy as np\r\nimport os\r\nimport time as time\r\nfrom tensorflow.python import ipu\r\nimport tensorflow as tf\r\nimport tensorflow_pr...
[ [ "tensorflow.ones", "tensorflow.function", "tensorflow.reshape", "tensorflow.sqrt", "tensorflow.clip_by_value", "tensorflow.stack", "tensorflow.control_dependencies", "tensorflow.identity", "tensorflow.cast", "tensorflow.no_op", "tensorflow.shape", "tensorflow.concat...
oesteban/dipy
[ "57f7ec926f914d72f7f2f8feb8ccb51ab827895d", "57f7ec926f914d72f7f2f8feb8ccb51ab827895d" ]
[ "dipy/reconst/tests/test_shore_odf.py", "dipy/reconst/shore.py" ]
[ "import numpy as np\r\nfrom dipy.data import get_sphere, get_3shell_gtab, get_isbi2013_2shell_gtab\r\nfrom dipy.reconst.shore import ShoreModel\r\nfrom dipy.reconst.shm import QballModel, sh_to_sf\r\nfrom dipy.reconst.peaks import gfa, peak_directions\r\nfrom numpy.testing import (assert_equal,\r\n ...
[ [ "numpy.testing.run_module_suite", "numpy.testing.assert_equal", "numpy.testing.assert_almost_equal", "numpy.isreal", "numpy.random.random" ], [ "numpy.array", "numpy.dot", "numpy.empty", "numpy.isnan", "numpy.zeros", "scipy.special.gamma", "numpy.round", "nu...
andmikey/kedro
[ "9b4e4135720609d44ffdf5248246fe805f0b5469" ]
[ "kedro/extras/datasets/pandas/sql_dataset.py" ]
[ "# Copyright 2018-2019 QuantumBlack Visual Analytics Limited\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# THE SOFTWARE IS P...
[ [ "pandas.read_sql_table", "pandas.read_sql_query" ] ]
jensenjhwang/TensorNetwork
[ "35d1247cc3fb80768965f7429ac9b8b914a144a8", "35d1247cc3fb80768965f7429ac9b8b914a144a8" ]
[ "tensornetwork/contractors/opt_einsum_paths/path_contractors_node_test.py", "tensornetwork/backends/numpy/decompositions_test.py" ]
[ "# Copyright 2019 The TensorNetwork Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable...
[ [ "numpy.testing.assert_allclose", "numpy.trace", "numpy.ones", "numpy.eye", "numpy.arange" ], [ "numpy.random.rand", "numpy.zeros", "numpy.testing.assert_almost_equal", "numpy.arange", "numpy.linalg.svd", "tensorflow.test.main", "numpy.diag" ] ]
yiheng-wang-nv/MONAI
[ "885d5b947aeafc1a9bee2899cfd48fff9036e68a" ]
[ "monai/networks/utils.py" ]
[ "# Copyright (c) MONAI Consortium\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# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agreed to in...
[ [ "torch.zeros", "torch.nn.init.constant_", "torch.no_grad", "torch.inverse", "torch.ones", "torch.jit.load", "torch.jit.save", "torch.tensor", "torch.testing.assert_allclose", "torch.cuda.is_available", "torch.jit.script", "torch.set_grad_enabled", "torch.reshape...
jytime/Deep-SfM-Revisited
[ "7645c7d524df8c8798ccc1902c1368b4ed59708a" ]
[ "models/inverse_warp.py" ]
[ "from __future__ import division\nimport torch\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\n\npixel_coords = None\n\n\ndef set_id_grid(depth):\n global pixel_coords\n b, h, w = depth.size()\n i_range = Variable(torch.arange(0, h).view(1, h, 1).expand(1,h,w)).type_as(depth) # [1, ...
[ [ "torch.cat", "torch.stack", "torch.arange", "torch.ones", "torch.nn.functional.grid_sample" ] ]
embracesource-cv-com/ruler_detection
[ "89318b46b213ffb7774119d502b5aa520d34b50a" ]
[ "train.py" ]
[ "import os\nimport argparse\nimport collections\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torchvision import transforms\nimport model\nfrom utils import _transfer_pretrained_weights\nfrom dataloader import CSVDataset, collater, Resizer, AspectRatioBasedSampler, Norm...
[ [ "numpy.mean", "torch.cuda.empty_cache", "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.utils.data.DataLoader", "torch.nn.DataParallel" ] ]
romepeng/jaqsplus
[ "2923c01213d1e2f90ddcd95eb722f8120aa74426" ]
[ "tests/test_dataservice.py" ]
[ "# encoding: UTF-8\r\n\r\nimport pytest\r\nfrom jaqs.data import RemoteDataService\r\n\r\nimport jaqs.util as jutil\r\n\r\nfrom config_path import DATA_CONFIG_PATH\r\ndata_config = jutil.read_json(DATA_CONFIG_PATH)\r\n\r\n\r\ndef test_remote_data_service_daily():\r\n # test daily\r\n res, msg = ds.daily('0024...
[ [ "pandas.concat" ] ]
DANancy/Coding-Playground
[ "b82e3689ccc4771ee59c3472db78333ba17671b9" ]
[ "Omdena Projects/hourly_merge.py" ]
[ "import pandas as pd\r\nimport numpy as np\r\nfrom datetime import datetime\r\n\r\ndef main(consumption_data, weather_data, public_holidays_data, service_location_id):\r\n # Process consumption data\r\n df = consumption_data.astype({'date':'datetime64[ns]'}).rename(columns={'date':'datetime'}).set_index('date...
[ [ "pandas.to_datetime", "pandas.cut", "pandas.DataFrame", "numpy.logical_and", "numpy.where" ] ]
peterzheng98/fuzzy-system
[ "6ae14714c73d9a70b4d4c0a27e9da0d54a0fe5a8" ]
[ "ProcessScripts/DevsetTransform.py" ]
[ "import pandas as pd\nimport sys\nfrom collections import Counter\nfrom tqdm import tqdm\nimport json\n\n\nif __name__ == '__main__':\n filepath = '../datasets/tokenized/in_domain_dev.tsv'\n output_word_cab = '../datasets/tokenized/wordlist.txt'\n df = pd.read_csv(filepath, sep='\\t', header=0)\n\n word...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
kamieen03/style-transfer-server
[ "91727ec62080215a0b870ce043faf0657137b84b" ]
[ "libs/parametric_models.py" ]
[ "import torch\nimport torch.nn as nn\n\nclass encoder3(nn.Module):\n def __init__(self, W, v2):\n super(encoder3,self).__init__() # W - width\n # vgg\n # 224 x 224\n self.conv1 = nn.Conv2d(3,3,1,1,0)\n self.reflecPad1 = nn.ZeroPad2d((1,1,1,1))\n # 226 x 226\n\n ...
[ [ "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.bmm", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.ZeroPad2d", "torch.mean", "torch.nn.UpsamplingNearest2d" ] ]
Neptos/openpilot
[ "01914a1a91ade18bd7aead99e7d1bf38cd22ad89" ]
[ "selfdrive/debug/mpc/tune_longitudinal.py" ]
[ "#! /usr/bin/env python\n# type: ignore\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom selfdrive.controls.lib.longitudinal_mpc import libmpc_py\nfrom selfdrive.controls.lib.drive_helpers import MPC_COST_LONG\n\n# plot liongitudinal MPC trajectory by defining boundary conditions:\n# ego and lead vehicles...
[ [ "matplotlib.pyplot.grid", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.show", "matplotlib.pyplot.subplot" ] ]
Sup3Legacy/TIPE
[ "7e01cef869183c4d609c45d5fcf0bb371a9579f5" ]
[ "creastephGAN2.py" ]
[ "from __future__ import print_function, division\nimport os\nimport random\nimport argparse\nimport torch\nimport pandas as pd\nfrom skimage import io, transform\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom torch.utils.data import Dataset, DataLoader\nimport torchvision.utils as vutils\nimport torch.b...
[ [ "torch.nn.BatchNorm2d", "torch.nn.LeakyReLU", "torch.cuda.is_available", "torch.load", "torch.nn.init.constant_", "torch.nn.ConvTranspose2d", "torch.nn.init.normal_", "numpy.random.randint", "torch.utils.data.DataLoader", "torch.nn.BCELoss", "numpy.transpose", "matp...
unilight/cdvae-vc
[ "6470b0e587d40f6d1d91712a0dacef5ff8d661ce" ]
[ "preprocessing/vcc2018/feature_reader.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import division\n\nimport argparse\nimport os\nimport sys\nimport numpy as np\nimport h5py\nimport logging\nfrom scipy.io import wavfile\nfrom sprocket.speech.synthesizer import Synthesizer\n\nimport tensorflow as tf\n\ndef Segment_feature_reader(\n...
[ [ "numpy.concatenate", "tensorflow.decode_raw", "tensorflow.gfile.Glob", "tensorflow.WholeFileReader", "tensorflow.reshape", "tensorflow.train.string_input_producer", "tensorflow.train.shuffle_batch", "tensorflow.name_scope", "numpy.fromfile", "tensorflow.random_crop", "n...
theainerd/transformers
[ "f7328de46dbeda4992a093a0501932bf0fc7b76f" ]
[ "src/transformers/models/big_bird/modeling_big_bird.py" ]
[ "# coding=utf-8\n# Copyright 2021 Google Research and The HuggingFace Inc. team. 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...
[ [ "torch.nn.Linear", "torch.cat", "torch.einsum", "torch.ones", "torch.transpose", "torch.nn.functional.pad", "torch.nn.CrossEntropyLoss", "numpy.concatenate", "torch.nn.LayerNorm", "torch.minimum", "tensorflow.train.list_variables", "torch.tensor", "numpy.arange"...
itsjatin135s/Ekchhat
[ "66d1d14314c75a2937350a467afa571ed4a32fe4" ]
[ "routes.py" ]
[ "from flask import render_template, redirect, url_for, flash,request\nfrom forms import ContactUsForm,DonateForm,PartnerForm\nfrom models import ContactUs,Donate,Partner\nfrom __init__ import db, app\n\n\nfrom selenium import webdriver\nfrom bs4 import BeautifulSoup\nimport pandas as pd\n\nfrom webdriver_manager.c...
[ [ "pandas.DataFrame" ] ]
oahul14/MetTrack
[ "dce04ad9bb61a0a1c4becafd25c932bb242d73c0" ]
[ "armageddon/ensemble.py" ]
[ "import numpy as np\nimport pandas as pd\nimport scipy.special as ssp\nimport scipy.optimize as sop \n\nclass Dist():\n\n prob_val = 0.1\n\n def __init__(self, prob_vals):\n self.prob_vals = prob_vals\n \n def velocity_dist(self,v):\n return ssp.erf(v/(11*np.sqrt(2))) - (v/11)*(np.sqrt(2/n...
[ [ "numpy.array", "scipy.optimize.newton_krylov", "numpy.setdiff1d", "scipy.optimize.diagbroyden", "pandas.DataFrame", "numpy.exp", "numpy.random.uniform", "numpy.stack", "numpy.sqrt", "numpy.log10" ] ]
usc-isi-i2/missing-fact
[ "834a0b4531170b4a108f765e19d02bd7446e0563", "834a0b4531170b4a108f765e19d02bd7446e0563" ]
[ "missingfact/nn/util.py", "missingfact/models/missing_fact/span_relation_pred_factatt_model.py" ]
[ "import torch\nfrom allennlp.nn.util import replace_masked_values, masked_max\n\n\ndef seq2vec_seq_aggregate(seq_tensor, mask, aggregate, bidirectional, dim=1):\n \"\"\"\n Takes the aggregation of sequence tensor\n\n :param seq_tensor: Batched sequence requires [batch, seq, hs]\n :param mask...
[ [ "torch.cat", "torch.sum" ], [ "torch.cat", "torch.cuda.is_available", "torch.nn.BCEWithLogitsLoss", "torch.nn.functional.softmax", "torch.nn.CrossEntropyLoss", "torch.sum" ] ]
JonathanSum/transformers
[ "27b68f95e4585713b575603545cf520ab9621621" ]
[ "src/transformers/modeling_tf_ctrl.py" ]
[ "# coding=utf-8\n# Copyright 2018 Salesforce and HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. 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...
[ [ "tensorflow.matmul", "tensorflow.ones", "tensorflow.reshape", "tensorflow.keras.layers.Dense", "numpy.cos", "tensorflow.tile", "tensorflow.math.sqrt", "tensorflow.nn.softmax", "tensorflow.stack", "tensorflow.cast", "numpy.concatenate", "numpy.sin", "tensorflow.c...
sunset768541/ctw-baseline
[ "f303f9ae0477ef2aa1fe56426a28e0ed9a0a89f8" ]
[ "detection/prepare_train_data.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport cv2\nimport darknet_tools\nimport json\nimport numpy as np\nimport os\nimport settings\n\nfrom jinja2 import Template\nfrom py...
[ [ "numpy.array" ] ]
fmi-basel/inter-view
[ "e7ebf616ac15eddf1e0d222930750fb4b113d9fa" ]
[ "inter_view/utils.py" ]
[ "import numpy as np\nimport holoviews as hv\nhv.extension('bokeh', logo=False)\nimport param\nimport panel as pn\nimport matplotlib.pyplot as plt\n\nfrom holoviews.operation.datashader import rasterize\nfrom bokeh.models import WheelZoomTool\nfrom holoviews.core import Store\n\nvalid_rgb_options = [\n k for grou...
[ [ "numpy.array", "numpy.asarray", "numpy.zeros", "numpy.rint", "matplotlib.pyplot.get_cmap", "numpy.arange" ] ]
Lukasz1928/mobile-robots-control
[ "81820b35dab10b14f58d66079b0a8f82ef819bee" ]
[ "tests/localization/color/utils/test_color_converter.py" ]
[ "import cv2\nfrom unittest import TestCase\nimport numpy as np\nfrom parameterized import parameterized\nfrom mrc.localization.color.utils.color_converter import ColorConverter\nfrom tests.test_utils.read_image import read_image\n\n\nclass TestColorConverterGrayscale(TestCase):\n def setUp(self):\n self.c...
[ [ "numpy.testing.assert_array_equal" ] ]
michaelbenayoun/optimum
[ "21c5809577e2ef5687f293d31d1d3e28288e1bb7" ]
[ "examples/inc/pytorch/multiple-choice/run_swag.py" ]
[ "#!/usr/bin/env python\n# coding=utf-8\n# Copyright The HuggingFace Team and The HuggingFace Inc. team. 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# ...
[ [ "torch.tensor", "numpy.argmax" ] ]
iankuoli/OSNet-TopDrop
[ "3ab57ba507e9f8939762e27834137172375cd91c", "3ab57ba507e9f8939762e27834137172375cd91c" ]
[ "torchreid/engine/image/viewpoint_aware.py", "torchreid/engine/image/arc_margin.py" ]
[ "from __future__ import division, print_function, absolute_import\n\nfrom ... import metrics\nfrom ...engine.engine import Engine\nfrom ...losses import FocalLoss, CrossEntropyLoss, ALSRLoss\nfrom .vat import VATLoss\n\nimport math\nimport torch\nfrom torch.nn import Parameter\nimport torch.nn.functional as F\nimpo...
[ [ "torch.zeros", "torch.where" ], [ "torch.nn.functional.normalize", "torch.FloatTensor", "torch.nn.init.xavier_uniform_", "torch.where", "torch.pow" ] ]
de9uch1/stanza
[ "cafb7d5004842cd3c8a3ac334ce7649bac928830", "cafb7d5004842cd3c8a3ac334ce7649bac928830" ]
[ "stanza/models/parser.py", "stanza/models/lemma/trainer.py" ]
[ "\"\"\"\nEntry point for training and evaluating a dependency parser.\n\nThis implementation combines a deep biaffine graph-based parser with linearization and distance features.\nFor details please refer to paper: https://nlp.stanford.edu/pubs/qi2018universal.pdf.\n\"\"\"\n\n\"\"\"\nTraining and evaluation for the...
[ [ "torch.cuda.manual_seed", "numpy.random.seed", "torch.manual_seed", "torch.cuda.is_available", "numpy.argmax" ], [ "torch.save", "torch.load" ] ]
pmeier/kornia
[ "57f5aeb605d0c69de88a0a1aa1563cee52d4bfaf", "57f5aeb605d0c69de88a0a1aa1563cee52d4bfaf" ]
[ "kornia/losses/psnr.py", "kornia/filters/kernels.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.nn.functional import mse_loss\n\n\nclass PSNRLoss(nn.Module):\n r\"\"\"Creates a criterion that calculates the PSNR between 2 images. Given an m x n image, the PSNR is:\n\n .. math::\n\n \\text{PSNR} = 10 \\log_{10} \\bigg(\\frac{\\text{MAX}_I^2}{MSE(I,T...
[ [ "torch.nn.functional.mse_loss", "torch.is_tensor", "torch.tensor", "torch.log10" ], [ "torch.zeros", "torch.device", "torch.stack", "torch.arange", "torch.linspace", "torch.clamp", "torch.ones", "torch.tensor" ] ]
learn2free/GeoCAT-examples
[ "3ac152a767e78a362a8ebb6f677005f3de320ca6", "3ac152a767e78a362a8ebb6f677005f3de320ca6", "3ac152a767e78a362a8ebb6f677005f3de320ca6", "3ac152a767e78a362a8ebb6f677005f3de320ca6" ]
[ "Plots/Skew-T/NCL_skewt_3_2.py", "Plots/Overlays/NCL_overlay_1.py", "Plots/Colors/CB_Height.py", "Plots/Polygons/NCL_polyg_18.py" ]
[ "\"\"\"\nNCL_skewt_3_2.py\n=================\nThis script illustrates the following concepts:\n - Drawing Skew-T plots\n - Thinning the wind barbs in a Skew-T plot\n - Customizing the background of a Skew_T plot\n\nSee following URLs to see the reproduced NCL plot & script:\n - Original NCL script: http...
[ [ "matplotlib.lines.Line2D", "numpy.array", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "numpy.linspace" ], [ "matplotlib.pyplot.show", "numpy.arange", "mat...
awwong1/ml-research
[ "6f0bb585fef0c4567a5f02937fea62726b9c88dd" ]
[ "models/cifar/resnet.py" ]
[ "from __future__ import absolute_import\nimport torch.nn as nn\nimport math\n\n\n__all__ = [\"resnet\"]\n\n\nclass BasicBlock(nn.Module):\n expansion = 1\n\n def __init__(self, inplanes, planes, stride=1, downsample=None):\n super(BasicBlock, self).__init__()\n self.conv1 = nn.Conv2d(\n ...
[ [ "torch.nn.Linear", "torch.nn.Sequential", "torch.nn.AvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
goncaloperes/greykite
[ "160bb3ada71e3c778e1fb3d242676c42ff619e3a" ]
[ "greykite/tests/framework/output/test_univariate_forecast.py" ]
[ "import datetime\nimport math\nimport sys\nfrom functools import partial\n\nimport numpy as np\nimport pandas as pd\nimport pytest\nfrom pandas.util.testing import assert_frame_equal\nfrom pandas.util.testing import assert_series_equal\nfrom sklearn.pipeline import Pipeline\n\nfrom greykite.common import constants ...
[ [ "pandas.Index", "numpy.array", "pandas.util.testing.assert_frame_equal", "pandas.DatetimeIndex", "pandas.DataFrame", "pandas.date_range", "pandas.util.testing.assert_series_equal", "numpy.arange", "pandas.Series", "pandas.NamedAgg" ] ]
icyray/proGENTRL
[ "c48305c3411ecb604c4f26f5e6b62f285e42e696" ]
[ "progentrl/gen_rl.py" ]
[ "import os\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.utils.data import Dataset, DataLoader\n\nfrom math import pi, log\nfrom .lp import LP\nfrom .utils import save, load\nimport joblib\nfrom collections import OrderedDict\n\nfrom moses.metrics.utils import get_mol\nimport pytorch...
[ [ "torch.zeros", "torch.cat", "torch.tensor", "torch.utils.data.DataLoader", "torch.randn" ] ]
migvanderlei/dataset-parser
[ "b6febccbdc829737e50640d980b2034d2c54c95a" ]
[ "src/collector.py" ]
[ "import os\nimport json\nimport logging\nfrom pandas import json_normalize\nfrom src.configurable import Configurable\nfrom datetime import datetime\nfrom glob import glob\nfrom concurrent.futures import ThreadPoolExecutor, as_completed\n\nclass Collector(Configurable):\n\n def __init__(self, input_path=None, ou...
[ [ "pandas.json_normalize" ] ]
pelegrichman/IML.HUJI
[ "b8c158b9a6e332313a8a69cbbfd42ed8aede2858" ]
[ "IMLearn/learners/classifiers/perceptron.py" ]
[ "from __future__ import annotations\nfrom typing import Callable, List\nfrom typing import NoReturn\nfrom ...base import BaseEstimator\nimport numpy as np\n\nfrom ...metrics import misclassification_error\n\n\ndef default_callback(fit: Perceptron, x: np.ndarray, y: int):\n pass\n\n\nclass Perceptron(BaseEstimato...
[ [ "numpy.dot", "numpy.zeros" ] ]
vivekparasharr/Social-Text-Web-Data-Analysis
[ "9c19edc2a2917454b558ee7e4464e0c41418b6cd" ]
[ "Twitter-Data-Analysis/twitter_streaming.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun May 28 12:25:54 2017\n\n@author: vivekparashar\n\"\"\"\n\n#Import the necessary methods from tweepy library\nfrom tweepy.streaming import StreamListener\nfrom tweepy import OAuthHandler\nfrom tweepy import Stream\n\n#Variables that contains th...
[ [ "pandas.DataFrame", "matplotlib.pyplot.subplots" ] ]
stevezhangz/ournn
[ "a5d8383971e9a921c38380507f1abbd93a88ca88" ]
[ "losses.py" ]
[ "import numpy as np\nfrom ournn.tools.matrix_tools import dot_mul2d\nimport math\n\n\n\nclass MSE:\n def __init__(self):\n pass\n def loss(self,x,y,delta=1e-3):\n if isinstance(x,int) or isinstance(x,float):\n if isinstance(y, int) or isinstance(y, float):\n return (x-y...
[ [ "numpy.square", "numpy.array", "numpy.log", "numpy.sum", "numpy.exp" ] ]
proy3/Abnormal_Trajectory_Classifier
[ "a6b27c6847262e9703a0f3404c85c135415c1d4c" ]
[ "ALREC_Method/stmarc/train_new_method_v4_for_atd.py" ]
[ "\"\"\"\nTrain Abnormal trajectory detection with deep autoencoder.\n\"\"\"\nimport warnings\nwarnings.simplefilter(action='ignore', category=FutureWarning)\n\nimport ae_utilities as aeu\nimport input_data as data\nimport abnormal_data_generation as adg\nimport dataset_defines as dd\nimport numpy as np\nimport os\n...
[ [ "numpy.max", "numpy.array", "numpy.genfromtxt", "numpy.min", "numpy.mean", "numpy.std" ] ]
ahmdtaha/tf_retrieval_baseline
[ "31b1588f888cecc1d4287f77bd046314956482d5" ]
[ "ranking/semi_hard_triplet.py" ]
[ "import numbers\nimport tensorflow as tf\nfrom tensorflow.python.ops import math_ops\nfrom tensorflow.python.ops import array_ops\nfrom tensorflow.python.framework import dtypes\n\ndef masked_minimum(data, mask, dim=1):\n \"\"\"Computes the axis wise minimum over chosen elements.\n\n Args:\n data: 2-D float `T...
[ [ "tensorflow.matmul", "tensorflow.python.ops.array_ops.where", "tensorflow.python.ops.array_ops.ones", "tensorflow.python.ops.array_ops.ones_like", "tensorflow.python.ops.math_ops.to_float", "tensorflow.python.ops.math_ops.logical_not", "tensorflow.control_dependencies", "tensorflow...
zhuang-group/Mesa
[ "8b7a0db0461de7df5c99d644a60cc7704c67a02a" ]
[ "mesa/custom_bn.py" ]
[ "# Copyright (c) 2021-present, Zhuang AI Group.\n# All rights reserved.\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nif 'mesa' not in __name__:\n import custom_quant\n import packbit\n import native\nelse:\n from . import custom_quant\n from . import native\n from . i...
[ [ "torch.distributed.get_world_size", "torch.cat", "torch.stack", "torch.batch_norm_backward_elemt", "torch.split", "torch.batch_norm_stats", "torch.batch_norm_backward_reduce", "torch.distributed.all_reduce", "torch.batch_norm_elemt", "torch.randn", "torch.empty_like" ...
shyhuai/kfac_pytorch
[ "f5a99366fa94345697432a8aabdc5d370f68d06f" ]
[ "kfac/autograd_hacks.py" ]
[ "\"\"\"\nLibrary for extracting interesting quantites from autograd, see README.md\n\nNot thread-safe because of module-level variables\n\nNotation:\no: number of output classes (exact Hessian), number of Hessian samples (sampled Hessian)\nn: batch-size\ndo: output dimension (output channels for convolution)\ndi: i...
[ [ "torch.symeig", "torch.sqrt", "torch.stack", "torch.nn.functional.unfold", "torch.einsum", "torch.eye", "torch.nn.functional.softmax", "torch.diag", "torch.sum" ] ]
tyuyoshi/pandas
[ "4e034ec0006b6c05160ce67ea1420ce28f295c91" ]
[ "pandas/io/sql.py" ]
[ "\"\"\"\nCollection of query wrappers / abstractions to both facilitate data\nretrieval and to reduce dependency on DB-specific API.\n\"\"\"\n\nfrom __future__ import annotations\n\nfrom contextlib import contextmanager\nfrom datetime import (\n date,\n datetime,\n time,\n)\nfrom functools import partial\n...
[ [ "pandas.core.dtypes.missing.isna", "pandas._libs.lib.infer_dtype", "pandas.errors.AbstractMethodError", "pandas.util.version.Version", "pandas.core.dtypes.common.is_datetime64tz_dtype", "pandas.util._exceptions.find_stack_level", "pandas.compat._optional.import_optional_dependency", ...
Albert-GM/TFM
[ "2574f7cd1411ff253d045c7dff894de36659aae8" ]
[ "src/data/modelling_movement.py" ]
[ "# =============================================================================\n# Makes a model simulating the movement of people between countries.\n# =============================================================================\n\n\nimport pandas as pd\nimport numpy as np\nimport networkx as nx\nimport os\nimpo...
[ [ "pandas.read_pickle", "numpy.sum", "pandas.Series" ] ]
mtoqeerpk/geemap
[ "70ebe305d25a7a5a5191b24595b4180fb7962f52" ]
[ "geemap/geemap.py" ]
[ "\"\"\"Main module for interactive mapping using Google Earth Engine Python API and ipyleaflet.\nKeep in mind that Earth Engine functions use both camel case and snake case, such as setOptions(), setCenter(), centerObject(), addLayer().\nipyleaflet functions use snake case, such as add_tile_layer(), add_wms_layer()...
[ [ "numpy.array", "matplotlib.pyplot.clear", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "matplotlib.pyplot.hist", "numpy.random.uniform", "matplotlib.pyplot.scatter", "numpy.dstack", "matplotlib.pyplot.show", "matplotlib.pyplot.cm.get_cmap", "matplotlib.pyplot.b...
toothache/onnxruntime
[ "217b2c9f931b5b0f704df0c8336def47025d2148", "217b2c9f931b5b0f704df0c8336def47025d2148", "217b2c9f931b5b0f704df0c8336def47025d2148" ]
[ "onnxruntime/core/providers/nuphar/scripts/model_quantizer.py", "orttraining/orttraining/test/python/orttraining_test_ortmodule_autograd.py", "orttraining/orttraining/python/training/ortmodule/_graph_execution_manager.py" ]
[ "# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\n# -*- coding: UTF-8 -*-\nimport argparse\nfrom enum import Enum\nimport json\nimport numpy as np\nimport onnx\nfrom onnx import helper, numpy_helper\nfrom .node_factory import NodeFactory, ensure_opset\n\nclass Quanti...
[ [ "numpy.zeros_like", "numpy.asarray", "numpy.round", "numpy.sum", "numpy.amax", "numpy.abs", "numpy.amin", "numpy.expand_dims" ], [ "torch.nn.Linear", "torch.device", "torch.cuda.current_stream", "torch.FloatTensor", "torch.no_grad", "torch.enable_grad", ...
aolabNeuro/brain-python-interface
[ "11590717e1a1a2d5cc89a0495f02170b1b5f3c08", "11590717e1a1a2d5cc89a0495f02170b1b5f3c08" ]
[ "features/generator_features.py", "riglib/optitrack_client/optitrack.py" ]
[ "'''\nFeatures which have task-like functionality w.r.t. task...\n'''\n\nimport time\nimport tempfile\nimport random\nimport traceback\nimport numpy as np\nimport fnmatch\nimport os\nimport subprocess\nfrom riglib.experiment import traits\n\n\nclass Autostart(traits.HasTraits):\n '''\n Automatically begins th...
[ [ "numpy.copy" ], [ "numpy.divide", "numpy.empty", "pandas.read_csv", "numpy.dtype", "numpy.expand_dims" ] ]
chrisqqq123/FA-Dist-EfficientNet
[ "cb788b0f212d568d9bf04a51516d79fed5383585" ]
[ "test.py" ]
[ "#!/usr/bin/env python3\n\"\"\"Script to test a pytorch model on Cifar100's validation set.\"\"\"\n\nimport argparse\nimport logging\nimport pprint\nimport sys\nimport time\n\nimport torch\nfrom torch import nn\n\nfrom models import model_factory\nimport opts\nimport utils\nimport mul_cifar100\n\n\ndef parse_args(a...
[ [ "torch.no_grad" ] ]
epmcj/nextflix
[ "de15f0a63fe8906a0417da675b9a1c408f71bc79" ]
[ "VideoUtils/codec.py" ]
[ "import numpy as np\nimport structures as st\n\n#return a data object containing an entire frame\ndef decomposeFrame(frame,frameNum):\n\tchannelList = []\n\tif len(frame.shape)==3:\n\t\tfor i in range(frame.shape[2]):\n\t\t\tchannelList.append(decomposeMatrix(frame[:,:,i]))\n\telse:\n\t\tchannelList.append(decompos...
[ [ "numpy.matrix", "numpy.diag" ] ]
LLNL/LBANN
[ "8bcc5d461e52de70e329d73081ca7eee3e5c580a", "8bcc5d461e52de70e329d73081ca7eee3e5c580a" ]
[ "python/lbann/contrib/modules/radial_profile.py", "ci_test/unit_tests/test_unit_layer_softmax.py" ]
[ "import numpy as np\nimport lbann\nimport lbann.modules\n\nclass RadialProfile(lbann.modules.Module):\n \"\"\"Compute average pixel value w.r.t. distance from image center.\n\n We compute the distance between each image pixel and the image\n center. These distances are binned (with a bin size of 1), and th...
[ [ "numpy.zeros", "numpy.tile", "numpy.prod", "numpy.arange", "numpy.transpose", "numpy.sqrt", "numpy.expand_dims" ], [ "numpy.max", "numpy.random.normal", "numpy.random.seed", "numpy.sum", "numpy.mean", "numpy.finfo" ] ]
MoritzTaylor/baselines-tf2
[ "f51e40707b3c3021ae6309788d0cc0f29832dbea" ]
[ "baselines/a2c/utils.py" ]
[ "import os\nimport numpy as np\nimport tensorflow as tf\nfrom collections import deque\n\ndef ortho_init(scale=1.0):\n def _ortho_init(shape, dtype, partition_info=None):\n #lasagne ortho init for tf\n shape = tuple(shape)\n if len(shape) == 2:\n flat_shape = shape\n elif l...
[ [ "tensorflow.assert_less", "numpy.random.normal", "tensorflow.convert_to_tensor", "tensorflow.keras.initializers.Constant", "numpy.prod", "tensorflow.name_scope", "numpy.linalg.svd", "tensorflow.cast" ] ]
ywang-37/EnhancedSiamShipTracking
[ "0b25cf02b6088268a6c374cb20a7f0355bc65b2e" ]
[ "utils/pysot/datasets/vot.py" ]
[ "import os\nimport json\nimport numpy as np\n\nfrom glob import glob\nfrom tqdm import tqdm\n\nfrom .dataset import Dataset\nfrom .video import Video\n\n\nclass VOTVideo(Video):\n \"\"\"\n Args:\n name: video name\n root: dataset root\n video_dir: video directory\n init_rect: init ...
[ [ "numpy.array" ] ]
awesome-archive/ssl-suite
[ "03990c5e86432c3f475971aeaf1ff7f7821ef40c" ]
[ "vat.py" ]
[ "import torch\nfrom homura.modules import cross_entropy_with_softlabels\nfrom torch.distributions import Categorical\nfrom torch.nn import functional as F\n\nfrom backends.loss import _kl, _l2_normalize\nfrom backends.utils import SSLTrainerBase, disable_bn_stats, get_task\n\n\nclass VATTrainer(SSLTrainerBase):\n ...
[ [ "torch.autograd.grad", "torch.no_grad" ] ]
Olalaye/MegEngine
[ "695d24f24517536e6544b07936d189dbc031bbce" ]
[ "imperative/python/megengine/data/collator.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright (c) 2016- Facebook, Inc (Adam Paszke)\n# Copyright (c) 2014- Facebook, Inc (Soumith Chintala)\n# Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert)\n# Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu)\n# Copyright...
[ [ "numpy.array", "numpy.stack" ] ]
wustone1995/speech2face
[ "0eadbc8caf59c58cf5320a0a131a5e6fc9e728b8" ]
[ "preprocess/video_generator.py" ]
[ "import os\r\nimport pickle\r\nimport shutil\r\nimport imageio\r\nimport pandas as pd\r\nimport subprocess\r\nfrom PIL import Image\r\nimport face_recognition\r\nimport numpy as np\r\nimport skimage\r\nimport scipy\r\nfrom keras.engine import Model\r\nfrom keras.layers import Input\r\nfrom keras_vggface.vggface im...
[ [ "numpy.array", "numpy.squeeze", "numpy.zeros" ] ]
silvershine157/transformers
[ "fd01104435914dd65c34026dcec8be008c40ee60" ]
[ "src/transformers/trainer.py" ]
[ "# coding=utf-8\n# Copyright 2020-present the HuggingFace Inc. team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unles...
[ [ "torch.distributed.get_world_size", "torch.cat", "torch.utils.data.dataloader.DataLoader", "torch.utils.data.sampler.RandomSampler", "torch.cuda.amp.autocast", "torch.no_grad", "torch.nn.parallel.DistributedDataParallel", "torch.utils.data.sampler.SequentialSampler", "torch.ten...
MendelXu/ANN
[ "f4eabeb27dbba5c9bdcf83d03776bffa34995666" ]
[ "methods/gan/image_translator.py" ]
[ "#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n# Author: Donny You (youansheng@gmail.com)\n# Class Definition for GAN.\n\n\nimport time\nimport torch\n\nfrom datasets.gan.data_loader import DataLoader\nfrom methods.tools.runner_helper import RunnerHelper\nfrom methods.tools.trainer import Trainer\nfrom models.gan....
[ [ "torch.no_grad" ] ]
JiahuaZhao/HPC-Python-CFD
[ "4fe4db053566603232bf16bdd06f8207cdadde0a" ]
[ "numpy_mpi_numexpr/cfd_mpi_ne.py" ]
[ "\n\n#!/usr/bin/env python\n#\n# CFD Calculation with MPI4PY\n# ===============\n#\n# Simulation of inviscid flow in a 2D box using the Jacobi algorithm.\n#\n# Python version - uses numpy and loops\n#\n# Alejandro Dinkelberg\n#\nimport os\nimport sys\n#import mkl\nimport time\nimport mpi4py.MPI as MPI\n\n# Import n...
[ [ "numpy.array", "numpy.zeros", "numpy.sum", "numpy.power", "numpy.sqrt" ] ]
rmaiko/pyvsim
[ "18d51d8fc3678ffcb08fd0939dc72c1a8834327d" ]
[ "examples/demo2.py" ]
[ "#!/usr/bin/python\n\"\"\"\nPyVSim part2.1\nCopyright 2013 Ricardo Entz\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...
[ [ "numpy.array", "numpy.tile", "numpy.linspace" ] ]
CardiacModelling/model-reduction-manifold-boundaries
[ "88ccb24d0ec9d0742a4a93e820fec7fee1a65b61" ]
[ "Parameter_inference_real_data/figures/plot-complex-ap-supplement-compare.py" ]
[ "import myokit\nimport myokit.pacing as pacing\nimport numpy as np\nimport matplotlib\nimport matplotlib.pyplot as pl\nimport myokit.lib.markov as markov\nimport pints\nimport argparse\nimport os\nimport sys\n\nfrom mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes, inset_axes\nfrom mpl_toolkits.axes_g...
[ [ "numpy.max", "matplotlib.cm.get_cmap", "matplotlib.pyplot.savefig", "matplotlib.pyplot.yticks", "matplotlib.pyplot.subplots", "matplotlib.colors.Normalize", "matplotlib.pyplot.show", "matplotlib.pyplot.xticks" ] ]
xxxhycl2010/pytorch-lightning
[ "7e18b118449133a5184b9014082ff1fb9818cf9b" ]
[ "tests/loggers/test_tensorboard.py" ]
[ "# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "torch.rand", "torch.tensor" ] ]
Jokerakos/ekpa-papadimitriou
[ "fe008b1fc963de4acddd5391a3bb4962bb706c97" ]
[ "model/models.py" ]
[ "import psycopg2\nimport pandas as pd \n\ndef connect_to_db():\n db_connection = psycopg2.connect(\n host=\"***.***.***.**\",\n database=\"********\",\n user=\"*********\",\n password=\"********\")\n db_connection.set_session(autocommit=True)\n cursor = db_connection.cursor()\n cursor.execute('SELEC...
[ [ "pandas.read_csv" ] ]
katarinaslama/transformers-1
[ "a5a8eeb772b185b0746f3ce9be6ae43181d2ca71" ]
[ "tests/test_modeling_gpt2.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl...
[ [ "torch.cat", "torch.ones", "torch.manual_seed", "torch.tensor", "torch.allclose" ] ]
Suerte412/SemSeg
[ "46515f36291bb7e068ceb1b455fe1fc4a26842ef" ]
[ "src/semseg/data/potsdam.py" ]
[ "from os.path import join\n\nimport numpy as np\nimport os \n\nfrom .isprs import IsprsDataset\nfrom .generators import FileGenerator, TRAIN, VALIDATION, TEST\nfrom .utils import (\n save_img, load_img, get_img_size, compute_ndvi, _makedirs,\n save_numpy_array)\n\nPOTSDAM = 'potsdam'\nPROCESSED_POTSDAM = 'pro...
[ [ "numpy.concatenate", "numpy.load", "numpy.zeros", "numpy.squeeze" ] ]
wdd0225/RetinaNet-and-SSD-in-PyTorch-Detectron
[ "4140e197e78dfd59c8f09dcd33e97f6040a0f39e" ]
[ "lib/datasets/coco_train.py" ]
[ "from lib.core import ssd_config as cfg\nimport os\nimport os.path as osp\nimport sys\nimport torch\nimport torch.utils.data as data\nimport torchvision.transforms as transforms\nimport cv2\nimport numpy as np\n\n# def get_label_map(label_file):\n# label_map = {}\n# labels = open(label_file, 'r')\n# for...
[ [ "numpy.array", "numpy.expand_dims", "torch.from_numpy" ] ]
TCatshoek/lstar
[ "042b0ae3a0627db7a412c828f3752a9c30928ec1" ]
[ "experiments/tsp/tsp.py" ]
[ "import tempfile\n\nimport numpy as np\nfrom graphviz import Digraph\n\nfrom equivalencecheckers.bruteforce import BFEquivalenceChecker\n#from experiments.tsp.tsplearner import TSPLearner\nfrom experiments.tsp.tsplearner import TSPLearner\nfrom learners.mealylearner import MealyLearner\nfrom suls.mealymachine impor...
[ [ "numpy.random.seed", "numpy.array", "numpy.random.rand" ] ]
acse-hz6818/Armageddon
[ "de62affe0b3f08cd74090d5d5e9e3c0905c9c8ed" ]
[ "cher2.py" ]
[ "# pylint: disable=invalid-name\r\n\"\"\"\r\nExtension 3:\r\n\r\nInversion to calculate the chern explosion\r\nTry different values of Y and r in order to find the ones that give a result closer to the data \r\n-------------------------\r\nreturns:\r\na graphical output\r\ndf with errors and parameters choosen\r\n\...
[ [ "numpy.array", "scipy.interpolate.interp1d", "matplotlib.pylab.ylabel", "pandas.DataFrame", "numpy.linspace", "matplotlib.pylab.show", "matplotlib.pylab.figure", "matplotlib.pylab.xlabel", "matplotlib.pylab.title", "matplotlib.pylab.plot", "pandas.read_csv" ] ]
sivaramakrishna7/tensor2tensor
[ "eb0118d3f459913133e3d68a96944480a928bff1" ]
[ "tensor2tensor/utils/learning_rate.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Tensor2Tensor 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 requir...
[ [ "tensorflow.floor", "tensorflow.abs", "tensorflow.minimum", "tensorflow.where", "tensorflow.cos", "tensorflow.logging.info", "tensorflow.constant", "tensorflow.log", "tensorflow.to_float", "tensorflow.train.get_or_create_global_step", "tensorflow.maximum", "tensorfl...
SudeepDasari/video_prediction-1
[ "ef0953b514aa1b7a1f5e96fd30aebef01334fb2d", "ef0953b514aa1b7a1f5e96fd30aebef01334fb2d" ]
[ "consol_real_ensemble.py", "runscript_weak.py" ]
[ "import numpy as np\nimport argparse\nimport imageio\n\nif __name__ == '__main__':\n parser = argparse.ArgumentParser()\n parser.add_argument('--log_dirs', nargs='+')\n parser.add_argument('--max_num', type=int, default=32)\n\n args = parser.parse_args()\n\n dirs = args.log_dirs\n big_numpy = None...
[ [ "numpy.concatenate", "numpy.load" ], [ "numpy.array" ] ]
ichalkiad/VW_challenge
[ "c1ff50070d0f7367ccfbf473c69e90fd2be5e85e" ]
[ "src/jetson/Sensors/sensors_simple.py" ]
[ "import paho.mqtt.client as mqtt\nimport ev3dev.ev3 as ev3\nimport ctypes\nimport numpy as np\nimport sys\nimport cv2\nfrom Sensors.mpu6050.mpu6050 import MPU6050\nimport smbus\nfrom Sensors.odometry import Odometry\nimport sys, serial\nfrom serial.tools import list_ports\n\nclass Sensor(object):\n def __init__(...
[ [ "numpy.array" ] ]
drgmk/sdf
[ "a44e66a82f876dda079686b32c767370276c38a1" ]
[ "sdf/analytics.py" ]
[ "'''Analytic routines for debris disks.'''\n\nimport numpy as np\n\nfrom . import photometry\nfrom . import filter\nfrom . import utils\n\nclass BB_Disk(object):\n '''A blackbody disk class.\n \n Takes multiple temperatures, the purpose being for use to show\n disk properties in parameter spaces suc...
[ [ "numpy.max", "numpy.array", "numpy.zeros", "numpy.minimum", "numpy.min", "numpy.invert", "numpy.arange", "numpy.sqrt", "numpy.append", "numpy.linspace", "numpy.meshgrid" ] ]
VidyaKamath1089/models
[ "0e74158f72160a5d25b977de7f6f2cf4d1908dba" ]
[ "official/vision/beta/projects/volumetric_models/modeling/factory_test.py" ]
[ "# Copyright 2021 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.keras.layers.InputSpec", "tensorflow.keras.regularizers.l2", "tensorflow.test.main" ] ]
isabuster/snip
[ "8e7644edd1f4dcca0f833666cf54474bcacf2aea" ]
[ "snip-tensorflow/main.py" ]
[ "import os\nimport sys\nimport argparse\nimport tensorflow as tf\nimport numpy as np\nimport scipy.stats as st\nimport matplotlib.pyplot as plt\n\nfrom dataset import Dataset\nfrom model import Model\nimport prune\nimport train\nimport test\n\n# from tensorflow.python.tools.inspect_checkpoint import print_tensors_i...
[ [ "tensorflow.compat.v1.global_variables_initializer", "matplotlib.pyplot.xlim", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "tensorflow.compat.v1.InteractiveSession", "matplotlib.pyplot.legend", "matplotlib.pyplot.close", "tensorflow.compat.v1.local_variables_initializer",...
bergr7/KNN_from_scratch
[ "8c1e40f89b078a46b27c347d2faa3d3491a47958" ]
[ "knn.py" ]
[ "import numpy as np\nfrom sklearn.metrics import confusion_matrix\n\nclass Knn:\n \"\"\"Classifier implementing the k-nearest neighbors vote.\n\n Parameters\n __________\n :param n_neighbors : int\n Number of neighbors to use.\n\n :param metric : {'manhattan', 'euclidean', 'minkowski'}, defaul...
[ [ "numpy.sum", "sklearn.metrics.confusion_matrix", "numpy.isnan", "numpy.unique" ] ]
ChenYutongTHU/slt
[ "2fb617feccccedb008446d34dcf5b3527b004ce6" ]
[ "signjoey/initialization.py" ]
[ "# coding: utf-8\n\n\"\"\"\nImplements custom initialization\n\"\"\"\n\nimport math\n\nimport torch\nimport torch.nn as nn\nfrom torch import Tensor\nfrom torch.nn.init import _calculate_fan_in_and_fan_out\n\n\ndef orthogonal_rnn_init_(cell: nn.RNNBase, gain: float = 1.0):\n \"\"\"\n Orthogonal initialization...
[ [ "torch.nn.init.orthogonal_", "torch.no_grad", "torch.nn.init.xavier_uniform_", "torch.nn.init._calculate_fan_in_and_fan_out", "torch.nn.init.normal_", "torch.nn.init.uniform_", "torch.nn.init.zeros_" ] ]
hcbh96/Random-Forest-FYP
[ "4af2c85a4f4d998f616751f9c366329bdc559b13", "4af2c85a4f4d998f616751f9c366329bdc559b13" ]
[ "decision_tree.py", "permutations_eda.py" ]
[ "\"\"\"\nIn this file I want to:\n create DT\n Train DT\n Test DT\n Analyse Accurancy\n Analyse Sensitivity\n Analyse Precision\n Check Feature Importance\n\"\"\"\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\nimport numpy as np\nfrom sklearn.tree import DecisionTre...
[ [ "sklearn.metrics.confusion_matrix", "pandas.DataFrame", "pandas.read_excel", "sklearn.tree.DecisionTreeClassifier", "sklearn.model_selection.train_test_split", "sklearn.tree.export_graphviz" ], [ "sklearn.preprocessing.LabelEncoder", "numpy.array", "sklearn.metrics.confusio...
fhoehle/fletcher
[ "09f1c9bc03c1603fa0facefb7a485a84f136a578" ]
[ "tests/test_text.py" ]
[ "import math\nimport string\nfrom typing import Optional, Sequence, Tuple\n\nimport hypothesis.strategies as st\nimport numpy as np\nimport pandas as pd\nimport pandas.testing as tm\nimport pyarrow as pa\nimport pytest\nfrom hypothesis import example, given, settings\n\nimport fletcher as fr\nfrom fletcher.testing ...
[ [ "pandas.isna", "pandas.testing.assert_series_equal", "numpy.dtype", "pandas.Series" ] ]
sgheb/ml-for-asset-managers
[ "53f9ee5a59a00004ac67920ad11e244ffc02a503" ]
[ "code_snippets/chap2.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom sklearn.neighbors import KernelDensity\nfrom scipy.optimize import minimize\nfrom scipy.linalg import block_diag\nfrom sklearn.covariance import LedoitWolf\n\n\ndef fix_shape(x):\n if len(x.shape) == 1:\n x = x.reshape(-1, 1)\n return x\n\n\n# Snippet 2.1\...
[ [ "numpy.dot", "numpy.exp", "numpy.outer", "sklearn.covariance.LedoitWolf", "numpy.random.normal", "pandas.DataFrame", "numpy.linalg.eigh", "scipy.linalg.block_diag", "numpy.linalg.inv", "numpy.diagflat", "numpy.random.shuffle", "sklearn.neighbors.KernelDensity", ...
txyugood/PaddleTableTennis
[ "be4d33b5990da9c75fcd11f341ae09a73bfdbaba" ]
[ "applications/BasketballAction/predict/eval.py" ]
[ "\"\"\"\nget instance for lstm\n根据gts计算每个proposal_bmn的iou、ioa、label等信息\n\"\"\"\nimport os\nimport sys\nimport json\nimport random\nimport pickle\nimport numpy as np\n\nimport io\nsys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding = 'utf-8')\n\ndataset = \"datasets/\"\n\nlabel_index_file = './configs_basketba...
[ [ "numpy.max", "numpy.array", "numpy.minimum", "numpy.arange", "numpy.argmax", "numpy.maximum" ] ]
sotuken2021/s
[ "2b37fdcaa60c1f5ac492edddd4a0960882fbc0aa" ]
[ "07ctc_att_mtl/attention.py" ]
[ "# -*- coding: utf-8 -*-\n\n#\n# Attention (Location aware attention) の実装です.\n# 参考文献\n# - D. Bahdanau, et al., \n# ``End-to-end attention-based large vocabulary speech\n# recognition,''\n# in Proc. ICASSP, 2016.\n# - J. Chorowski, et al.,\n# ``Attention-based models for speech recognition,''\n...
[ [ "torch.nn.Linear", "torch.zeros", "torch.nn.Conv1d", "torch.ones", "torch.nn.functional.softmax", "torch.tanh" ] ]
void-zxh/CS337-SRDGI
[ "e86413affd5867d42f9bbe66030d13b29bd2e067" ]
[ "Dynamic-channels/test.py" ]
[ "import argparse\r\nimport os\r\nimport time\r\n\r\nimport torch\r\nfrom torch.autograd import Variable\r\nfrom dynamic_channels import sample_tiny_sub_channel\r\nfrom model import G\r\nfrom util import is_image, load_image, save_image\r\n\r\nparser = argparse.ArgumentParser(description='DeepRendering-implementatio...
[ [ "torch.autograd.Variable", "torch.cat", "torch.load" ] ]