repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
5had3z/TensorRT | [
"8561894f7373c5c87a0b67c9a8661b345971aa09"
] | [
"tools/Polygraphy/polygraphy/backend/pyt/runner.py"
] | [
"#\n# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use 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 ... | [
[
"torch.no_grad"
]
] |
sdytkht/se2se | [
"91a5d69c15746a3f5b620d4dcc4a0b5783737702",
"91a5d69c15746a3f5b620d4dcc4a0b5783737702"
] | [
"translate2/numberout.py",
"translate2/seq2seq_model.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Mar 28 00:02:08 2017\n\n@author: kht\n\"\"\"\nimport tensorflow as tf\nimport translate as tl\nimport numpy as np\n\ndef weight_variable(shape):\n initial = tf.truncated_normal(shape, stddev=0.1)\n return tf.Variable(initial)\n\ndef bias_variable(shape):\n i... | [
[
"tensorflow.initialize_all_variables",
"numpy.zeros",
"tensorflow.argmax",
"tensorflow.Session",
"tensorflow.Variable",
"tensorflow.train.Saver",
"tensorflow.matmul",
"tensorflow.truncated_normal",
"tensorflow.constant",
"tensorflow.log",
"tensorflow.placeholder",
"... |
erdiolmezogullari/AttentionWalk | [
"d8c8297018374d965c0a024c3f1833f54347504e"
] | [
"src/attentionwalk.py"
] | [
"\"\"\"AttentionWalk class.\"\"\"\n\nimport torch\nimport numpy as np\nimport pandas as pd\nfrom tqdm import trange\nfrom utils import read_graph, feature_calculator, adjacency_opposite_calculator\n\nclass AttentionWalkLayer(torch.nn.Module):\n \"\"\"\n Attention Walk Layer.\n For details see the paper.\n ... | [
[
"numpy.concatenate",
"torch.sigmoid",
"pandas.DataFrame",
"torch.FloatTensor",
"torch.mm",
"torch.abs",
"torch.nn.functional.softmax",
"torch.nn.init.uniform_",
"torch.Tensor",
"torch.mean",
"torch.sum"
]
] |
jbrown15/RaaLabs-TSIClient | [
"5d0c4bdd130647e01552e878f2594e1978546054"
] | [
"TSIClient/TSIClient.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nimport os\nimport json\nimport pandas as pd\nimport requests\nimport logging\nfrom TSIClient.exceptions import TSIEnvironmentError\nfrom TSIClient.exceptions import TSIStoreError\nfrom TSIClient.exceptions import TSIQueryError\n\n\nclass TSIClient():\n \"\"\"TSIC... | [
[
"pandas.DataFrame"
]
] |
felipeek/bullet3 | [
"6a59241074720e9df119f2f86bc01765917feb1e"
] | [
"examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_derpy.py"
] | [
"\"\"\"This file implements the functionalities of a minitaur derpy using pybullet.\n\nIt is the result of first pass system identification for the derpy robot. The\n\n\n\"\"\"\nimport math\n\nimport os, inspect\ncurrentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))\nparentdir = os.... | [
[
"numpy.zeros"
]
] |
gzerveas/TransformChrome | [
"ab1046009aff2ec863aa65223dcfcd750d41ab86"
] | [
"v2PyTorch/evaluate.py"
] | [
"import numpy\nimport torch\nimport scipy \nimport scipy.sparse as sp\nimport logging\nfrom six.moves import xrange\nfrom collections import OrderedDict\nimport sys\nimport pdb\nfrom sklearn import metrics\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom pdb import set_trace as stop\n\n\n... | [
[
"numpy.array",
"numpy.nan_to_num",
"sklearn.metrics.precision_recall_curve",
"numpy.median",
"numpy.mean",
"sklearn.metrics.auc",
"sklearn.metrics.roc_auc_score",
"numpy.var"
]
] |
MoisesFreitas1/DeeperSystems_Task1 | [
"e1ea248c76db72297ad7ff40da645d41d88c031a"
] | [
"task1_watchers.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Mar 5 14:36:24 2020\n\n@author: Moises\n\"\"\"\n\nimport pandas as pd\nimport json\n\ndf_json = pd.read_json('source_file_2.json')\ndf_json = df_json.sort_values(by ='priority')\ndf_json = pd.concat([df_json], ignore_index=True)\n\nwatchers =... | [
[
"pandas.DataFrame",
"pandas.read_json",
"pandas.concat"
]
] |
ppeigne/DQN-reimplementation | [
"ce5e11f9b6c7c0dc42f9a65fee872a70ac5c6415"
] | [
"memory.py"
] | [
"import numpy as np\nimport torch as T\n\nfrom typing import Tuple\n\nclass Memory():\n def __init__(self, size:int, state_shape: Tuple[int, ...]) -> None:\n self.size = size\n self.current_states = T.zeros((size, *state_shape), dtype=T.float32)\n self.actions = T.zeros(size, dtype=T.int64)\... | [
[
"torch.zeros",
"torch.tensor",
"numpy.random.choice"
]
] |
MalekNaimi/VGGish-Model | [
"61369097fe669c642f15a94f964e9130b0218756"
] | [
"non-overlap/evaluate_acc.py"
] | [
"from tqdm import tqdm\nimport numpy as np\nfrom collections import Counter\nimport random\n\nwith open('/content/VGGish-Model/non-overlap/test_clip_length.txt','r') as f:\n line = f.readline().split()\ntest_clip_length = [int(x) for x in line]\n\nwith open('/content/VGGish-Model/non-overlap/test_preds.txt','r')... | [
[
"numpy.sum",
"numpy.mean",
"numpy.asarray",
"numpy.zeros"
]
] |
tusharganguli/brain-tokyo-workshop | [
"4ccee864229598f5af29af56197fb5fc7240c1c9"
] | [
"WANNRelease/WANN/wann_src/dataGatherer.py"
] | [
"import os\nimport numpy as np\nimport copy\nfrom .ind import exportNet\nimport logging\nfrom wann_train import rank\n\n\nclass DataGatherer():\n ''' Data recorder for WANN algorithm'''\n def __init__(self, filename, hyp): \n \"\"\"\n Args:\n filename - (string) - path+prefix of file output destination... | [
[
"numpy.array",
"numpy.savetxt",
"numpy.asarray",
"numpy.median",
"numpy.shape",
"numpy.argmax",
"numpy.append"
]
] |
sieniven/detect-obstacles-ros | [
"2fe2e502781060da83e4840538c779808553dbfb"
] | [
"calibration/src/calibration/calibration/publish_camera_info.py"
] | [
"# basic Python frameworks\nimport argparse\nimport yaml\nimport numpy as np\n\n# ROS2 libraries\nimport rclpy\n\n# import messages\nfrom sensor_msgs.msg import CameraInfo\n\n\ndef main():\n \"\"\"\n main function to publish camera info ros2 messages\n \"\"\"\n rclpy.init(args=None)\n parser = argpar... | [
[
"numpy.array"
]
] |
kellymarchisio/graspologic | [
"9aaca9067142c2e83d4cbc6bfa41738e64b3c066"
] | [
"graspologic/match/qap.py"
] | [
"# adapted from scipy.optimze.quadratic_assignment()\n# will live here temporalily until this function is officially released\n# original code can be found here\n# https://github.com/scipy/scipy/blob/master/scipy/optimize/_qap.py\n\nimport operator\n\nimport numpy as np\nfrom scipy._lib._util import check_random_st... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.linalg.norm",
"numpy.isclose",
"numpy.zeros",
"numpy.argmin",
"numpy.sum",
"numpy.copy",
"numpy.ones",
"scipy.optimize.OptimizeResult",
"numpy.eye",
"scipy.optimize.linear_sum_assignment",
"numpy.arange",
"scipy._li... |
XDong18/dla | [
"063f1facc2bc49b2ca3a6bb9c87977b6f194505e"
] | [
"dataset_coco.py"
] | [
"from pycocotools.coco import COCO\nimport os\nimport os.path as osp\nimport sys\nimport torch\nimport torch.utils.data as data\nimport cv2\nimport numpy as np\nfrom PIL import Image\nimport data_transforms as transforms\n\n\ndef f_print(*obj):\n fn='./output.log'\n # print(obj)\n with open(fn, 'a+') as f:... | [
[
"numpy.array",
"numpy.zeros",
"torch.from_numpy",
"numpy.where",
"numpy.transpose"
]
] |
2392863668/tensorFlow | [
"6743031da633d1ce284a606c49eb00e793c1d729"
] | [
"tensorflow/python/keras/_impl/keras/datasets/imdb.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... | [
[
"numpy.concatenate",
"numpy.random.seed",
"numpy.load",
"numpy.random.shuffle",
"tensorflow.python.keras._impl.keras.utils.data_utils.get_file",
"tensorflow.python.util.tf_export.tf_export"
]
] |
cogito233/text-autoaugment | [
"cae3cfddaba9da01cf291f975e5cf4f734634b51"
] | [
"utils/raw_data_utils.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom sklearn.model_selection import StratifiedShuffleSplit, KFold\nimport torchtext\nimport csv\nimport os\nimport numpy as np\nimport random\nimport pandas as pd\nimport re\nfrom theconf import Config a... | [
[
"numpy.array"
]
] |
leifdenby/numpy | [
"4750c2810c5e0943cbea8e2acc0337c4e66a9bb2"
] | [
"benchmarks/benchmarks/bench_ufunc.py"
] | [
"from __future__ import absolute_import, division, print_function\n\nfrom .common import Benchmark, squares_\n\nimport numpy as np\n\n\nufuncs = ['abs', 'absolute', 'add', 'arccos', 'arccosh', 'arcsin',\n 'arcsinh', 'arctan', 'arctan2', 'arctanh', 'bitwise_and',\n 'bitwise_not', 'bitwise_or', 'bit... | [
[
"numpy.divide",
"numpy.count_nonzero",
"numpy.add",
"numpy.asarray",
"numpy.ones",
"numpy.seterr",
"numpy.nonzero"
]
] |
Astroua/LocalGroup-VLA | [
"4920341c9e25343d724fb4a2e37cdcd234201047",
"4920341c9e25343d724fb4a2e37cdcd234201047"
] | [
"14A-235/HI/imaging/ebhis_regrid_m31.py",
"15A-175/HI/imaging/HI_single_channel_clean.py"
] | [
"\n'''\nRegrid the EBHIS data to match the 14A footprint.\n'''\n\nfrom astropy.io import fits\nfrom astropy.wcs import WCS\nfrom spectral_cube import SpectralCube\nfrom astropy.utils.console import ProgressBar\nimport numpy as np\nimport os\nimport astropy.units as u\n\nfrom cube_analysis.io_utils import create_hug... | [
[
"numpy.arange"
],
[
"numpy.allclose",
"numpy.save"
]
] |
JustinGOSSES/pyrolite | [
"21eb5b28d9295625241b73b820fc8892b00fc6b0"
] | [
"pyrolite/comp/codata.py"
] | [
"import numpy as np\nimport pandas as pd\nimport scipy.stats as scpstats\nimport scipy.special as scpspec\n\n# from .renorm import renormalise, close\nfrom ..util.math import orthogonal_basis_default, orthogonal_basis_from_array\nimport logging\n\nlogging.getLogger(__name__).addHandler(logging.NullHandler())\nlogge... | [
[
"numpy.divide",
"scipy.stats.boxcox",
"numpy.array",
"numpy.log",
"numpy.zeros",
"numpy.sum",
"numpy.nansum",
"numpy.exp",
"numpy.eye",
"numpy.apply_along_axis",
"numpy.arange",
"scipy.special.inv_boxcox",
"numpy.linspace",
"numpy.nanmax",
"numpy.squeeze... |
jennan/crash_prediction | [
"498b59704ed2aca61c78e4eb7c5558abe9edaffc"
] | [
"notebooks/02_crash_severity.py"
] | [
"# # Exploration of the crash severity information in CAS data\n#\n# In this notebook, we will explore the severity of crashes, as it will be the\n# target of our predictive models.\n\nfrom pathlib import Path\n\nimport numpy as np\nimport pandas as pd\nimport scipy.stats as st\nimport matplotlib.pyplot as plt\nimp... | [
[
"pandas.read_csv",
"pandas.qcut",
"matplotlib.pyplot.subplots",
"scipy.stats.binom"
]
] |
semihcanturk/PyTorch-VAE | [
"ee881337f75cc47f54e164142073714eed43dd0a"
] | [
"run.py"
] | [
"import yaml\nimport argparse\nimport numpy as np\n\nfrom models import *\nfrom experiment import VAEXperiment\nimport torch.backends.cudnn as cudnn\nfrom pytorch_lightning import Trainer\nfrom pytorch_lightning.loggers import TestTubeLogger\nfrom pytorch_lightning.callbacks import ModelCheckpoint\n\nif __name__ ==... | [
[
"numpy.random.seed"
]
] |
LendelTheGreat/weak-segmentation | [
"0ff6015f1af741cfb50ef8fb6f55cea822f68f7a"
] | [
"models/dummynet.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass DummyNet(nn.Module):\n def __init__(self):\n super(DummyNet, self).__init__()\n self.conv1 = nn.Conv2d(3, 10, kernel_size=5, padding=2)\n self.conv2 = nn.Conv2d(10, 5, kernel_size=5, padding=2)\n self.softm... | [
[
"torch.nn.Conv2d",
"torch.nn.Softmax2d"
]
] |
Euclideon/vaultsdkpython | [
"cea55dead80fc32618e72158c2eab783833e16c1"
] | [
"viewport_experimental.py"
] | [
"\"\"\"\nmodule containing experimental features relating to extending viewports\n\"\"\"\nfrom pygletExample import *\n\nclass VDKViewPort3D(VDKViewPort):\n \"\"\"\n Viewport quad with 3D faces, used for constructing ViewPrisms\n \"\"\"\n def __init__(self, width, height, centreX, centreY, parent, horiz... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.cross"
]
] |
federicoBetti/DataScienceCompetition_FutureSales | [
"f78e38f39b5ecda2a67b4bfbf476cdc6a4a41460"
] | [
"src/final_solution/param_search.py"
] | [
"import os\n\nimport hyperopt\nimport pandas as pd\nfrom hyperopt import fmin, tpe, STATUS_OK, Trials\nfrom hyperopt import hp\nfrom hyperopt.pyll import scope\nfrom sklearn.linear_model import LinearRegression\nfrom xgboost import XGBRegressor\n\nfrom src.utils.memory_managment import save_object\n\n\ndef trainXGB... | [
[
"sklearn.svm.LinearSVR",
"sklearn.neural_network.MLPRegressor",
"sklearn.linear_model.LinearRegression"
]
] |
YangRui2015/d3rlpy | [
"da778b2a2b0afbafe25395296baecd0d4d0cd0d5",
"da778b2a2b0afbafe25395296baecd0d4d0cd0d5"
] | [
"d3rlpy/algos/torch/awr_impl.py",
"tests/preprocessing/test_scalers.py"
] | [
"from abc import ABCMeta, abstractmethod\nfrom typing import Any, Optional, Sequence\n\nimport numpy as np\nimport torch\nfrom torch.optim import Optimizer\n\nfrom ...augmentation import AugmentationPipeline\nfrom ...gpu import Device\nfrom ...models.builders import (\n create_categorical_policy,\n create_squ... | [
[
"torch.no_grad"
],
[
"torch.rand",
"torch.randint",
"torch.all",
"numpy.random.randint",
"torch.tensor",
"numpy.all",
"numpy.random.random"
]
] |
zibneuro/udvary-et-al-2022 | [
"8b456c41e72958677cb6035028d9c23013cb7c7e"
] | [
"structural_model/constants.py"
] | [
"import numpy as np\n\n\ndef getLayerDepths():\n name_depthRange = {}\n name_depthRange[\"L1\"] = [0, 157]\n name_depthRange[\"L2\"] = [157, 367]\n name_depthRange[\"L23\"] = [157, 576]\n name_depthRange[\"L3\"] = [367, 576]\n name_depthRange[\"L4\"] = [576, 855]\n name_depthRange[\"L5A\"] = [8... | [
[
"numpy.array"
]
] |
rodrigoberriel/pytorch | [
"97e86cf3197823cc598e6380ed47bcc385e50077"
] | [
"torch/quantization/observer.py"
] | [
"import re\nimport warnings\nfrom abc import ABCMeta, abstractmethod\nfrom collections import OrderedDict\nfrom functools import partial\nfrom typing import Any, List, Tuple, Optional, Dict, Union\n\nimport torch\nimport torch.nn as nn\nfrom .utils import check_min_max_valid, calculate_qmin_qmax\n\n\nclass _Partial... | [
[
"torch.round",
"torch.finfo",
"torch.ones",
"torch.jit.is_scripting",
"torch.sum",
"torch.Size",
"torch.iinfo",
"torch.ceil",
"torch.tensor",
"torch._aminmax",
"torch.zeros_like",
"torch.zeros",
"torch.min",
"torch.max",
"torch.clamp",
"torch.nn.fact... |
Piko-Piko-Pon-Taro/navict-recommender | [
"7eeaf0f77e500c1c0ecb15f9613aa08c2ef5c83c"
] | [
"models/networks/simple_nn.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"CBOW Embedding\"\"\"\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision.models as models\n\nfrom models.base_model import BaseModel\nfrom models.networks.cbow_embedder import Net as CBOW\n\n\nclass Net(nn.Module):\n \"\"\"Network for CBOW\"... | [
[
"torch.nn.Linear",
"torch.device",
"torch.nn.Dropout",
"torch.nn.Softmax",
"torch.cuda.is_available",
"torch.load",
"torch.sum"
]
] |
NIA-Adp-Healthcare/test-project | [
"4ee172cdff14827b6946e672144ee381647d82ad"
] | [
"2.DataPrepare/split_c18.py"
] | [
"\r\nimport sys\r\nimport pandas as pd\r\nimport os\r\nimport glob\r\nfrom sklearn.model_selection import train_test_split\r\n\r\n\r\n# split_dataset(img_list, ALL_TEST, ALL_VALID, ALL_TRAIN)\r\n\r\n\r\ndef split_dataset(file_list, test_rid_list, valid_rid_list, train_rid_list):\r\n print(\"FILES\", len(file_lis... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
mihaigalos/DrivingKalman | [
"c6bff74d1c7cd1994fe941a5a95a3a0e260c00d1"
] | [
"driving_kalman.py"
] | [
"# Adapted from https://stackoverflow.com/questions/47210512/using-pykalman-on-raw-acceleration-data-to-calculate-position\n# on dataset from https://github.com/mmalekzadeh/motion-sense\n\nfrom pykalman import KalmanFilter\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom numpy import genfromtxt\n\n\nAccX_... | [
[
"matplotlib.pyplot.show",
"numpy.genfromtxt",
"matplotlib.pyplot.subplots",
"numpy.zeros"
]
] |
YZArren/ETCI2021 | [
"6dffb759b3439bc597e835f8dbd610ab4706e269"
] | [
"src/training/network_training/nnUNetTrainerV2_DP.py"
] | [
"# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany\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.cuda.is_available",
"torch.cuda.amp.autocast"
]
] |
hcongvan/emotion-recognition-neural-networks | [
"e98b1ce21599e83fccb97a31386ecd8ebfc6d3b3"
] | [
"poc.py"
] | [
"# Proof-of-concept\nimport cv2\nimport sys\nfrom constants import *\nfrom emotion_recognition import EmotionRecognition\nimport numpy as np\nimport pdb\n\ncascade_classifier = cv2.CascadeClassifier(CASC_PATH)\n\ndef brighten(data,b):\n datab = data * b\n return datab \n\ndef format_image(image):\n if l... | [
[
"numpy.argmax"
]
] |
ajlee21/snorkeling | [
"93ca5269199a55ed2093334cb32b6d3120ae3535"
] | [
"compound_disease/compound_treats_disease/edge_prediction_experiment/edge_prediction_experiment.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# # Compound Treats Disease Edge Prediction\n\n# This notebook is designed to take the next step moving from predicted sentences to edge predictions. After training the discriminator model, each sentences contains a confidence score for the likelihood of mentioning a relat... | [
[
"pandas.DataFrame.from_records",
"sklearn.metrics.precision_recall_curve",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"pandas.np.absolute",
"sklearn.metrics.auc",
"matplotlib.pyplot.show",
"pandas.read_csv",
"sklearn.metrics.roc_curve"
]
] |
yyxx1997/pytorch | [
"3d9fca2119c260317c06b11aa8bdb9b29b4c8cca"
] | [
"bert-sst2/bert_sst2.py"
] | [
"# -*- coding: utf-8 -*-\n# @Time : 2021/1/11 9:09\n# @Author : yx\n# @File : bert_sst2.py\n\nimport torch\nimport torch.nn as nn\nfrom torch.optim import Adam\nfrom torch.utils.data import Dataset, DataLoader\nfrom transformers import BertModel\nfrom tqdm import tqdm\nimport os\nimport time\nfrom transformers impo... | [
[
"torch.nn.Linear",
"torch.no_grad",
"torch.cuda.is_available",
"torch.tensor",
"torch.utils.data.DataLoader",
"torch.nn.CrossEntropyLoss"
]
] |
liubaoryol/InfoGAIL | [
"89f553da1ed415f8383c0f9e8c3774debc628dcd"
] | [
"wgail_info_0/models.py"
] | [
"from utils import *\nimport numpy as np\nimport time\nimport math\nimport argparse\nfrom keras.initializers import normal, identity, uniform\nfrom keras.models import model_from_json\nfrom keras.models import Sequential, Model\nfrom keras.layers import Dense, BatchNormalization, Activation, Convolution2D, MaxPooli... | [
[
"tensorflow.exp",
"numpy.exp",
"tensorflow.gradients",
"tensorflow.reshape",
"tensorflow.keras.applications.resnet50.ResNet50",
"tensorflow.global_variables_initializer",
"tensorflow.cast",
"tensorflow.compat.v1.placeholder",
"numpy.concatenate",
"tensorflow.shape",
"nu... |
doublechenching/ship_detection | [
"1ba4926e0d28043863df05ae8afc3d5b336b350d"
] | [
"submission_patch.py"
] | [
"#encoding: utf-8\nfrom __future__ import print_function\nfrom utils import init_env\ninit_env('1')\nfrom config import config as cfg\nfrom models.patch_dense_unet import dense121_unet\nfrom dataset.data import compose_ndcube, decompose_ndimage\nimport os\nimport glob\nimport numpy as np\nfrom dataset.data import r... | [
[
"pandas.DataFrame",
"numpy.sum",
"numpy.stack",
"numpy.unique",
"numpy.expand_dims",
"numpy.flip"
]
] |
vanttec/rb_missions | [
"f05384f84a256b9f64defaef625bee689b79701f"
] | [
"scripts/auto_nav_guidance.py"
] | [
"#!/usr/bin/env python\n\nimport rospy\nfrom std_msgs.msg import String\nfrom std_msgs.msg import Float64\nfrom std_msgs.msg import Int32\nfrom custom_msgs.msg import obj_detected\nfrom custom_msgs.msg import obj_detected_list\nfrom geometry_msgs.msg import Pose2D\nimport numpy as np\nimport math\nimport time\n#imp... | [
[
"numpy.argsort"
]
] |
Ehsan-Tavan/Emoji-Prediction | [
"f79e19ac3b975b7d43bb1971f12afeffda1a072d"
] | [
"src/emoji_prediction/config/ABCDM_config.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# pylint: disable-msg=no-member\n\n\"\"\"\nABCDM_config.py is a module for ABCDM model config\n\"\"\"\n\nimport torch\n\n__author__ = \"Ehsan Tavan\"\n__project__ = \"Persian Emoji Prediction\"\n__credits__ = [\"Ehsan Tavan\"]\n__license__ = \"Public Domain\"\n__ve... | [
[
"torch.cuda.is_available"
]
] |
vandalt/ImPlaneIA | [
"72b22e487ef45a8a665e4a6a88a91e99e382fdd0",
"72b22e487ef45a8a665e4a6a88a91e99e382fdd0"
] | [
"nrm_analysis/misctools/mask_definitions.py",
"nrm_analysis/misctools/matrixDFT.py"
] | [
"#! /usr/bin/env python\nfrom __future__ import print_function\nimport numpy as np\nimport math\nimport sys\nimport time\nfrom nrm_analysis.misctools.utils import makedisk, rotate2dccw\nfrom astropy.io import fits\nfrom copy import copy\n\"\"\"\n\n================\nNRM_mask_definitions\n================\n\nA module... | [
[
"numpy.array",
"numpy.loadtxt",
"numpy.ceil"
],
[
"numpy.dot",
"numpy.exp",
"numpy.isscalar",
"numpy.arange",
"numpy.sqrt",
"numpy.outer"
]
] |
Ehnryu/archives | [
"36f5d1b8b0168ada3a1a25fbe3112709f4134652"
] | [
"CV19Dash/_notebooks/covid_overview.py"
] | [
"import pandas as pd\n\n\nbase_url = 'https://raw.githubusercontent.com/pratapvardhan/notebooks/master/covid19/'\npaths = {\n 'mapping': base_url + 'mapping_countries.csv',\n 'overview': base_url + 'overview.tpl'\n}\n\n\ndef get_mappings(url):\n df = pd.read_csv(url, encoding='utf-8')\n return {\n ... | [
[
"pandas.to_datetime",
"pandas.read_csv",
"pandas.Timedelta"
]
] |
maua-maua-maua/nvGAN | [
"edea24c58646780c9fb8ea942e49708ce9d62421"
] | [
"calc_metrics.py"
] | [
"# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n#\n# NVIDIA CORPORATION and its licensors retain all intellectual property\n# and proprietary rights in and to this software, related documentation\n# and any modifications thereto. Any use, reproduction, disclosure or\n# distribution o... | [
[
"torch.device",
"torch.distributed.init_process_group",
"torch.multiprocessing.set_start_method",
"torch.multiprocessing.spawn",
"torch.empty"
]
] |
tommydino93/tutorials | [
"aca1f3c44e6697029a8b81c86497ca19bf433698"
] | [
"3d_classification/ignite/densenet_evaluation_dict.py"
] | [
"# Copyright 2020 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 i... | [
[
"numpy.array",
"torch.cuda.is_available"
]
] |
paleozogt/opencv | [
"1f214d232daa6f6a4d0f297327e656f638e8e13a"
] | [
"modules/python/test/test_houghcircles.py"
] | [
"#!/usr/bin/python\n\n'''\nThis example illustrates how to use cv2.HoughCircles() function.\n'''\n\n# Python 2/3 compatibility\nfrom __future__ import print_function\n\nimport cv2\nimport numpy as np\nimport sys\nfrom numpy import pi, sin, cos\n\nfrom tests_common import NewOpenCVTests\n\ndef circleApproximation(ci... | [
[
"numpy.array",
"numpy.sin",
"numpy.cos"
]
] |
priyavrat-misra/fashion-mnist | [
"9e9d18612b7556dbff5849be87cb35c296993d9e"
] | [
"network.py"
] | [
"import torch.nn as nn\n\n\nclass Network(nn.Module):\n def __init__(self):\n super().__init__()\n self.layer1 = nn.Sequential(\n nn.Conv2d(in_channels=1, out_channels=8,\n kernel_size=5, stride=1, padding=2),\n nn.BatchNorm2d(num_features=8),\n ... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.BatchNorm1d"
]
] |
michaelneale/mljar-supervised | [
"3192c91979b31810b249767a63e60ee74068c668"
] | [
"tests/tests_preprocessing/test_preprocessing_categorical_integers.py"
] | [
"import unittest\nimport tempfile\nimport numpy as np\nimport pandas as pd\nfrom supervised.preprocessing.preprocessing_categorical import PreprocessingCategorical\n\n\nclass PreprocessingCategoricalIntegersTest(unittest.TestCase):\n def test_constructor_preprocessing_categorical(self):\n \"\"\"\n ... | [
[
"pandas.DataFrame"
]
] |
Dingyuan-Zheng/ctf-UDA | [
"3e3c67f68d7eb0b52a16a259e5a77e153062c4fd"
] | [
"examples/mmt_train_kmeans.py"
] | [
"from __future__ import print_function, absolute_import\nimport argparse\nimport os.path as osp\nimport random\nimport numpy as np\nimport sys\n\nfrom sklearn.cluster import KMeans\nfrom sklearn.preprocessing import normalize\n\nimport torch\nfrom torch import nn\nfrom torch.backends import cudnn\nfrom torch.utils.... | [
[
"numpy.random.seed",
"sklearn.cluster.KMeans",
"torch.optim.Adam",
"torch.manual_seed",
"sklearn.preprocessing.normalize",
"torch.nn.DataParallel"
]
] |
namyoungkim/NyFlow | [
"d6c749e5a88e1ef3b6c73a1f927ab83abe1d7a3f"
] | [
"nyflow/core_simple.py"
] | [
"import weakref\nimport numpy as np\nimport contextlib\n\n\n# =============================================================================\n# Config\n# =============================================================================\nclass Config:\n enable_backprop = True\n\n\n@contextlib.contextmanager\ndef using... | [
[
"numpy.array",
"numpy.ones_like",
"numpy.isscalar"
]
] |
Somanji0520/adversarial-robustness-toolbox | [
"e23a686aea861066e42c793a81ea2d6b1efea872"
] | [
"tests/attacks/inference/attribute_inference/test_baseline.py"
] | [
"# MIT License\n#\n# Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2021\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n# documentation files (the \"Software\"), to deal in the Software without restriction, including without limita... | [
[
"numpy.concatenate",
"numpy.delete",
"numpy.argmax"
]
] |
sisl/neat | [
"42758d910f453686366eddfd1aed440e34c94828"
] | [
"aim_mt_2d/architectures/controller.py"
] | [
"from collections import deque\n\nimport numpy as np\nimport torch \nfrom torch import nn\n\n\nclass PIDController(object):\n def __init__(self, K_P=1.0, K_I=0.0, K_D=0.0, n=20):\n self._K_P = K_P\n self._K_I = K_I\n self._K_D = K_D\n\n self._window = deque([0 for _ in range(n)], maxl... | [
[
"numpy.mean"
]
] |
scharlton2/modflow6 | [
"83ac72ee3b6f580aaffef6352cf15c1697d3ce66",
"83ac72ee3b6f580aaffef6352cf15c1697d3ce66",
"83ac72ee3b6f580aaffef6352cf15c1697d3ce66"
] | [
"autotest/test_gwf_sfr_badfactor.py",
"autotest/test_gwf_utl01_binaryinput.py",
"autotest/test_gwf_uzf02.py"
] | [
"import os\nimport pytest\nimport sys\nimport numpy as np\nimport shutil\nimport subprocess\n\ntry:\n import flopy\nexcept:\n msg = \"Error. FloPy package is not available.\\n\"\n msg += \"Try installing using the following command:\\n\"\n msg += \" pip install flopy\"\n raise Exception(msg)\n\nfrom ... | [
[
"numpy.arange"
],
[
"numpy.linspace",
"numpy.ones",
"numpy.zeros"
],
[
"numpy.array",
"matplotlib.pyplot.savefig",
"numpy.genfromtxt",
"matplotlib.pyplot.legend",
"numpy.ones",
"matplotlib.pyplot.figure",
"numpy.allclose",
"numpy.arange",
"numpy.linspace... |
silviaelisabeth/Noise-vs-Resolution | [
"cc317f52a15263e4abb5cd94c8c524e18a6dfa85"
] | [
"functions_NoiseStudy.py"
] | [
"__author__ = 'Silvia E Zieger'\r\n__project__ = 'noise vs resolution'\r\n\r\n\"\"\"Copyright 2020. All rights reserved.\r\n\r\nThis software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable \r\nfor any damages arising from the use of this software.\r\nPermis... | [
[
"numpy.tile",
"numpy.exp",
"numpy.mean",
"matplotlib.pylab.show",
"matplotlib.pylab.tight_layout",
"pandas.concat",
"numpy.divide",
"pandas.DataFrame",
"numpy.flipud",
"matplotlib.pylab.subplots_adjust",
"numpy.arange",
"numpy.sqrt",
"numpy.column_stack",
"s... |
hheorton/geo_data_group | [
"7f62cda797d0d7a10c1578f162b35d7f484865ec"
] | [
"grid_set-2019.py"
] | [
"# here is the class that holds all the data days/months\n# it has all the gridding scripts needed\n# it will save load all the data/days/months as needed\n\nimport numpy as np\nimport pandas as pd\nimport datetime\nimport copy\nfrom netCDF4 import Dataset\nfrom numba import jit\nfrom scipy import stats\nimport dat... | [
[
"numpy.ones_like",
"numpy.double",
"numpy.tan",
"scipy.ndimage.filters.gaussian_filter",
"numpy.load",
"numpy.mean",
"numpy.nanmean",
"numpy.cos",
"numpy.deg2rad",
"numpy.gradient",
"scipy.spatial.Delaunay",
"numpy.concatenate",
"numpy.zeros_like",
"numpy.si... |
chang010453/GRP-HAI | [
"60f7c7633e33dbdd852f5df3e0a3d1017b6b2a22",
"60f7c7633e33dbdd852f5df3e0a3d1017b6b2a22"
] | [
"lib_drl/nets/resnet_v1.py",
"lib_drl/layer_utils/proposal_target_layer.py"
] | [
"# --------------------------------------------------------\n# Tensorflow Faster R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Zheqi He and Xinlei Chen\n# --------------------------------------------------------\nfrom __future__ import absolute_import\nfrom __future__ import divisi... | [
[
"tensorflow.contrib.slim.python.slim.nets.resnet_utils.conv2d_same",
"tensorflow.contrib.slim.l2_regularizer",
"tensorflow.contrib.slim.python.slim.nets.resnet_v1.resnet_v1",
"tensorflow.contrib.slim.variance_scaling_initializer",
"tensorflow.contrib.slim.max_pool2d",
"tensorflow.concat",
... |
brian15co/bokeh | [
"6cecb7211277b9d838039d0eb15e50a10f9ac3d1",
"6cecb7211277b9d838039d0eb15e50a10f9ac3d1"
] | [
"bokeh/tests/test_properties.py",
"bokeh/protocol.py"
] | [
"import unittest\nimport numpy as np\n\nfrom bokeh.properties import (\n HasProps, Int, Array, String, Enum, Float, DataSpec, ColorSpec, DashPattern\n)\n\nclass Basictest(unittest.TestCase):\n\n def test_simple_class(self):\n class Foo(HasProps):\n x = Int(12)\n y = String(\"hello... | [
[
"numpy.array"
],
[
"numpy.isinf",
"numpy.isnan",
"numpy.isposinf",
"numpy.isneginf",
"numpy.timedelta64",
"numpy.dtype",
"numpy.datetime64"
]
] |
lbeerendonk/blackwhite | [
"4ec0deced93da59218a90838bf60d10a981da37a"
] | [
"staircase_bw_new.py"
] | [
"\"\"\"\nStaircase (3-up, 1-down) for auditory detection or discrimination.\nRuns on Python 2.7 because some dependencies (pygaze) do not work with Python 3.\nBecomes compatible with Python 3 by changing all instances of \"raw_input\" to \"input\".\n\nCreated by Lola Beerendonk 28-05-2019\n\nCopyright (c) 2019; All... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.random.rand",
"numpy.ones",
"matplotlib.pyplot.subplots",
"numpy.mean",
"numpy.random.shuffle",
"numpy.arange"
]
] |
arnabbiswas1/k_tab_aug_muticlass_rmse_logloss_weightedf1_stratified_tsfresh_cesium | [
"13db3cb9d0b2f25181ccf4b1316e12425abfc276",
"13db3cb9d0b2f25181ccf4b1316e12425abfc276",
"13db3cb9d0b2f25181ccf4b1316e12425abfc276"
] | [
"src/scripts/lgb_benchmark_kfold.py",
"src/scripts/xgb_ts_log_loss_SK_top_5.py",
"src/scripts/lgb_ts_f1_weighted_SK_10_top_5_features.py"
] | [
"\"\"\"\nLGB Benchamrk with KFold\n\"\"\"\n\nimport os\nfrom datetime import datetime\nfrom timeit import default_timer as timer\n\nfrom sklearn.model_selection import KFold\n\nimport src.common as common\nimport src.config.constants as constants\nimport src.modeling.train_util as model\nimport src.munging.process_... | [
[
"sklearn.model_selection.KFold"
],
[
"pandas.read_parquet",
"sklearn.model_selection.StratifiedKFold",
"numpy.argmax"
],
[
"pandas.read_parquet",
"sklearn.model_selection.StratifiedKFold",
"numpy.argmax"
]
] |
defgsus/elastipy | [
"c1144ab39fa70571ba0e02ccf41d380a8a1bd730"
] | [
"elastipy/aggregation/converter.py"
] | [
"from copy import copy, deepcopy\nfrom itertools import chain\nimport fnmatch\nfrom typing import Sequence, Union, Optional, Iterable, Tuple, TextIO, Any, Mapping, List\n\nfrom .helper import dict_rows_to_list_rows, create_matrix, remove_matrix_axis\n\n\nclass ConverterMixin:\n \"\"\"\n Interface that uses Vi... | [
[
"pandas.to_datetime",
"pandas.DataFrame",
"numpy.dtype"
]
] |
shpotes/License-Plate-Recognition | [
"fed40cb1299ec6885bd8bebc47cb1db5d3ccd50a"
] | [
"util/dataset.py"
] | [
"import os, random, cv2\nimport numpy as np\n\ndef one_hot(class_numbers, num_classes=None):\n if num_classes is None:\n num_classes = np.max(class_numbers) + 1\n return np.eye(num_classes, dtype=float)[class_numbers]\n\nclass DataSet:\n def __init__(self, img_size, train, data_dir='.', validation=T... | [
[
"numpy.max",
"numpy.array",
"numpy.eye",
"numpy.random.randint",
"numpy.vstack"
]
] |
5aurabhpathak/src | [
"dda72beba2aaae67542a2f10e89048e86d04cb28"
] | [
"ai_ml_projects/masters_courses/image_and_vision_processing/intensityscale.py"
] | [
"#!/bin/env python3.5\nfrom matplotlib import pyplot as pl\nfrom numpy import max, min\n\ndef disp(im, n, t):\n pl.subplot(120 + n)\n pl.title(t)\n pl.axis('off')\n pl.imshow(im, pl.get_cmap('Greys_r'))\n\nim = pl.imread('data/cameraman.tif').astype('uint16')\nprint('In=\\n',im)\ndisp(im,1, 'input')\n\n... | [
[
"numpy.max",
"matplotlib.pyplot.get_cmap",
"matplotlib.pyplot.title",
"numpy.min",
"matplotlib.pyplot.imread",
"matplotlib.pyplot.show",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.subplot"
]
] |
dendisuhubdy/evolve | [
"54e0aa05b8df5f7833186b32462629ddb9198eea"
] | [
"tests/unittests/algo/test_dehb.py"
] | [
"\"\"\"Perform integration tests for `orion.algo.dehb`.\"\"\"\n\nimport itertools\nfrom typing import ClassVar\n\nimport numpy\nimport pytest\n\nfrom orion.algo.dehb.dehb import IMPORT_ERROR, UnsupportedConfiguration\nfrom orion.core.utils import backward, format_trials\nfrom orion.testing.algo import BaseAlgoTests... | [
[
"numpy.cumsum"
]
] |
Alehud/QuSpin | [
"c72d5fb2b2e9cd9a37d6917bba0337faf3b6c201"
] | [
"tests/expm_multiply_parallel_batch_test.py"
] | [
"from __future__ import print_function, division\n\nimport sys,os\nqspin_path = os.path.join(os.getcwd(),\"../\")\nsys.path.insert(0,qspin_path)\n\n#print(os.environ[\"OMP_NUM_THREADS\"])\nfrom quspin.basis import spin_basis_1d\nfrom quspin.operators import hamiltonian\nfrom quspin.tools.evolution import expm_multi... | [
[
"numpy.random.normal",
"numpy.linalg.norm",
"numpy.log",
"numpy.random.seed",
"scipy.sparse.linalg.expm_multiply",
"scipy.sparse.eye",
"numpy.random.randint"
]
] |
xuedong/rlss2019 | [
"d7468c2fcf269d8afd6fb0f44993aa9797867944"
] | [
"Machine Learning Summer School 2019 (Moscow, Russia)/tutorials/bayesian_deep_learning/mlss2019bdl/bdl/bernoulli.py"
] | [
"import torch\nimport torch.nn.functional as F\n\nfrom torch.nn import Linear, Conv2d\n\nfrom .base import FreezableWeight, PenalizedWeight\n\n\nclass DropoutLinear(Linear, FreezableWeight):\n \"\"\"Linear layer with dropout on inputs.\"\"\"\n def __init__(self, in_features, out_features, bias=True, p=0.5):\n... | [
[
"torch.nn.functional.dropout",
"torch.no_grad",
"torch.full_like",
"torch.nn.functional.linear",
"torch.nn.functional.dropout2d",
"torch.bernoulli",
"torch.nn.functional.conv2d"
]
] |
1990chs/pymapdl-reader | [
"6fa369c9019ac87f13b9a505d66e6399f36f1a66"
] | [
"doc/source/conf.py"
] | [
"# -*- coding: utf-8 -*-\nimport warnings\nimport os\n\nimport pyvista\nimport numpy as np\n\nfrom ansys.mapdl import reader as pymapdl_reader\n\n# -- pyvista configuration ---------------------------------------------------\n# Manage errors\npyvista.set_error_output_file('errors.txt')\n# Ensure that offscreen rend... | [
[
"numpy.array"
]
] |
Guliisgreat/PReMVOS | [
"b177e4d7c2aab40f93e181a8282ca72c5d789cb9"
] | [
"refinement/networks/deeplab_xception.py"
] | [
"import math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.utils.model_zoo as model_zoo\n\n\nclass SeparableConv2d(nn.Module):\n def __init__(self, inplanes, planes, kernel_size=3, stride=1, padding=0, dilation=1, bias=False):\n super(SeparableConv2d, self).__init__()... | [
[
"torch.cat",
"torch.nn.functional.upsample",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.no_grad",
"torch.utils.model_zoo.load_url",
"torch.nn.init.kaiming_normal_",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.AdaptiveAvgPool2d",
"torch.randn"
]
] |
hillmich/quantum-benchmarks-1 | [
"e7ab97e004f638d8681b5ee9cbbe662d64bc3378"
] | [
"bin/utils/plot_utils.py"
] | [
"from typing import List\n\nimport pandas as pd\nimport os\nimport json\n\nROOT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))\nIMAGE_PATH = os.path.join(ROOT_PATH, 'images')\n\nCOLOR = {\n 'yao': 'tab:red',\n 'yao (cuda)': 'tab:orange',\n 'yao x 1000': 'tab:blue',\n 'yao x ... | [
[
"pandas.DataFrame"
]
] |
littlebee/shelly-bot | [
"e25f2759bf1c7ac61bacbe70221910184e49beba"
] | [
"util/debug/ai_performance.py"
] | [
"#!/usr/bin/env python3\nimport os\nimport time\nimport cv2\nimport pickle\nimport face_recognition\nimport numpy\n\n# last n seconds to use for fps calc\nFPS_WINDOW = 60\n\n# if true, use face_recognition.face_distance to determin known faces\nUSE_FACE_DISTANCE = os.getenv('USE_FACE_DISTANCE') == '1' or False\n\ni... | [
[
"numpy.argmin"
]
] |
bstraus1/hyppo | [
"cf0ebed8fdb23078447a06ceb4eed4aca92a287c"
] | [
"hyppo/independence/tests/test_utils.py"
] | [
"import numpy as np\nimport pytest\nfrom numpy.testing import assert_raises\nfrom sklearn.ensemble import RandomForestRegressor\n\nfrom ...tools.common import _check_kernmat\nfrom .._utils import _CheckInputs, sim_matrix\n\n\nclass TestErrorWarn:\n \"\"\"Tests errors and warnings.\"\"\"\n\n def test_error_not... | [
[
"numpy.arange",
"sklearn.ensemble.RandomForestRegressor"
]
] |
naveenjafer/language | [
"efc5183855a7aeecac3e81fe12ce60fc824f8ca7",
"efc5183855a7aeecac3e81fe12ce60fc824f8ca7"
] | [
"language/question_answering/bert_joint/run_nq.py",
"language/conpono/evals/run_hellaswag.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unl... | [
[
"tensorflow.compat.v1.gfile.MakeDirs",
"tensorflow.contrib.tpu.TPUEstimatorSpec",
"tensorflow.compat.v1.logging.info",
"tensorflow.compat.v1.transpose",
"tensorflow.compat.v1.nn.bias_add",
"tensorflow.contrib.tpu.TPUEstimator",
"tensorflow.compat.v1.matmul",
"tensorflow.compat.v1.t... |
LukasBeiske/aict-tools | [
"ccf61c051c58040cf4b676180ae7184021d1b81b"
] | [
"tests/test_results.py"
] | [
"import tempfile\nimport os\nfrom click.testing import CliRunner\nimport shutil\nimport pandas as pd\nimport numpy as np\n\n\ndef test_energy_regression_results():\n from aict_tools.scripts.train_energy_regressor import main as train\n from aict_tools.io import read_telescope_data\n from aict_tools.apply i... | [
[
"numpy.testing.assert_array_almost_equal",
"pandas.read_csv"
]
] |
zigoom/DrawAndPainting_Pytorch | [
"690de052f1ef1f9b5dc4012a003e87200d6ba892"
] | [
"Model/nets.py"
] | [
"import torchvision.models as models\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\ndef resnet18(numclasses, pretrained=False):\n model = models.resnet18(pretrained)\n conv1_out_channels = model.conv1.out_channels\n model.conv1 = nn.Conv2d(1, conv1_out_channels, kernel_size=3,\n ... | [
[
"torch.nn.Linear",
"torch.nn.Conv2d",
"torch.nn.ReLU",
"torch.nn.MaxPool2d"
]
] |
nestauk/ai_covid_19 | [
"4367b1c7a110094f090167dbe02a1c47ce27e0e9"
] | [
"ai_covid_19/transformers/nlp.py"
] | [
"#Various functions and utilities that we use to work with text\nimport re\nimport string\nfrom string import punctuation\nfrom string import digits\nimport pandas as pd\nimport numpy as np\nfrom nltk.corpus import stopwords\nfrom sklearn.feature_extraction.text import TfidfVectorizer\nfrom gensim import corpora, m... | [
[
"pandas.DataFrame",
"sklearn.feature_extraction.text.TfidfVectorizer",
"pandas.Series"
]
] |
fangchenplus/CarND-Behavioral-Cloning-P3 | [
"06664d942674d978fe3346e3c168df63ba071f9d"
] | [
"gpu_test.py"
] | [
"import tensorflow as tf\ntf.config.experimental.list_physical_devices()"
] | [
[
"tensorflow.config.experimental.list_physical_devices"
]
] |
KshitizSharmaV/Quant_Platform_Python | [
"e56c4046ff8807c3c16d6a9293b5cb5dfe6f0cd0",
"d784aa0604d8de5ba5ca0c3a171e3556c0cd6b39"
] | [
"lib/python3.6/site-packages/statsmodels/sandbox/pca.py",
"lib/python3.6/site-packages/statsmodels/sandbox/tsa/example_arma.py"
] | [
"#Copyright (c) 2008 Erik Tollerud (etolleru@uci.edu)\n\nfrom statsmodels.compat.python import zip\nimport numpy as np\n\n\nclass Pca(object):\n \"\"\"\n A basic class for Principal Component Analysis (PCA).\n\n p is the number of dimensions, while N is the number of data points\n \"\"\"\n _colors=('... | [
[
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.arrow",
"numpy.mean",
"numpy.zeros_like",
"numpy.atleast_2d",
"numpy.array",
"numpy.zeros",
"numpy.std",
"numpy.isscalar",
"numpy.argsort",
"matplotlib.pyplot.clf",
"numpy.cov",
"numpy.sum",
"matplotlib.pyplot.yli... |
jeremymcrae/dnm_cohorts | [
"e968357797d2d370b44904129c32c2e74b36b903"
] | [
"dnm_cohorts/de_novos/mcrae_nature.py"
] | [
"\nimport logging\n\nimport pandas\n\nfrom dnm_cohorts.de_novo import DeNovo\n\nurl = 'https://static-content.springer.com/esm/art%3A10.1038%2Fnature21062/MediaObjects/41586_2017_BFnature21062_MOESM34_ESM.xlsx'\n\nasync def mcrae_nature_de_novos(result):\n \"\"\" load de novo mutations from McRae et al Nature 20... | [
[
"pandas.read_excel"
]
] |
natewachter/astr-119-session-3 | [
"0c26350d543195c6a593eef1a6f590ca35644ca2"
] | [
"data_types.py"
] | [
"import numpy as np\n\n#integers\n\ni = 10 # integer\nprint(\"The data type of i is \",type(i)) # integer\n\n\na_i = np.zeros(i,dtype=int) # declare an array of zeros\nprint(\"The data type of a_i is \",type(a_i)) #np.ndarray\nprint(\"The data type of a_i[0] is\", type(a_i[0])) #int64\n\n\n#floats\n\nx = ... | [
[
"numpy.zeros"
]
] |
Jfeatherstone/pepe | [
"4d28cab830ff2a94d3cfc06c680bde05d92b2cdb",
"4d28cab830ff2a94d3cfc06c680bde05d92b2cdb"
] | [
"pepe/analysis/ForceBalance.py",
"pepe/auto/ForceSolve.py"
] | [
"\"\"\"\nMethods to gauge how well force balance is satisfied for an ensemble,\nand to convert between polar and cartesian systems.\n\"\"\"\n\nimport numpy as np\n\nimport numba\n\ndef polarToCartesian(force, alpha, beta, collapse=True):\n \"\"\"\n Convert a set of forces defined in polar coordinates (f, a, b... | [
[
"numpy.array",
"numpy.sin",
"numpy.zeros_like",
"numpy.zeros",
"numpy.arcsin",
"numpy.sum",
"numpy.shape",
"numpy.cos",
"numpy.sqrt"
],
[
"numpy.zeros_like",
"numpy.isnan",
"numpy.array",
"numpy.sin",
"numpy.zeros",
"matplotlib.pyplot.get_current_fig... |
bigaidream-projects/citylearn-2020-pikapika | [
"8c9389eb4b4e979faf269b8c0ce87b499af97ac1"
] | [
"pretrain_AE.py"
] | [
"from torch.optim import Adam\nfrom torch.nn.functional import l1_loss\nfrom torch.distributions import kl_divergence, Normal\nfrom pathlib import Path\nimport numpy as np\nimport torch\nfrom torch.utils.tensorboard import SummaryWriter\nfrom citylearn import CityLearn\n\nfrom utils.standardization import normalize... | [
[
"torch.nn.Dropout",
"numpy.array",
"torch.min",
"numpy.zeros",
"torch.max",
"torch.nn.functional.l1_loss",
"numpy.random.randint",
"torch.ones_like",
"torch.utils.tensorboard.SummaryWriter"
]
] |
nimasadri11/capreolus | [
"27b081ec1a37d2af6afa6b61eb1cb7cc4ec9db1c"
] | [
"capreolus/reranker/ptparade.py"
] | [
"import torch\nfrom torch import nn\nfrom transformers import BertModel, ElectraModel\nfrom transformers.models.bert.modeling_bert import BertLayer\n\nfrom capreolus import ConfigOption, Dependency\nfrom capreolus.reranker import Reranker\n\n\nclass PTParade_Class(nn.Module):\n def __init__(self, extractor, conf... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.nn.Parameter",
"torch.nn.init.normal_",
"torch.tensor"
]
] |
antonykamp/sfepy | [
"8213d3c8cc2825602b41dc65eb543b575856ca8c"
] | [
"sfepy/discrete/common/dof_info.py"
] | [
"\"\"\"\nClasses holding information on global DOFs and mapping of all DOFs -\nequations (active DOFs).\n\nHelper functions for the equation mapping.\n\"\"\"\nimport numpy as nm\nimport scipy.sparse as sp\n\nfrom sfepy.base.base import assert_, Struct, basestr\nfrom sfepy.discrete.functions import Function\nfrom sf... | [
[
"scipy.sparse.coo_matrix",
"numpy.compress",
"numpy.empty",
"numpy.setdiff1d",
"numpy.zeros",
"numpy.union1d",
"numpy.ones",
"numpy.where",
"numpy.sign",
"numpy.arange",
"numpy.ravel",
"numpy.argwhere",
"numpy.repeat",
"numpy.unique"
]
] |
euyuil/akshare | [
"5205796b53a29259831c11413004e405f8a16368"
] | [
"akshare/stock_feature/stock_board_concept_ths.py"
] | [
"#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n\"\"\"\nDate: 2021/10/30 17:10\nDesc: 同花顺-板块-概念板块\nhttp://q.10jqka.com.cn/gn/detail/code/301558/\n\"\"\"\nimport os\nfrom datetime import datetime\n\nimport pandas as pd\nimport requests\nfrom bs4 import BeautifulSoup\nfrom py_mini_racer import py_mini_racer\nfrom tqd... | [
[
"pandas.to_datetime",
"pandas.DataFrame",
"pandas.to_numeric",
"pandas.read_html"
]
] |
rtg0795/model-analysis | [
"0f73989a2dfe1e56548f1ccd0001d98846f89e05",
"0f73989a2dfe1e56548f1ccd0001d98846f89e05"
] | [
"tensorflow_model_analysis/api/model_eval_lib.py",
"tensorflow_model_analysis/metrics/multi_class_confusion_matrix_plot_test.py"
] | [
"# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"tensorflow.version.VERSION.split",
"tensorflow.io.gfile.makedirs",
"tensorflow.io.gfile.exists"
],
[
"numpy.array",
"tensorflow.test.main"
]
] |
jzheng84/singleshotpose | [
"5d23bcd348dce8c0eeb6c90d1cdc1a0a4d4c32cb"
] | [
"utils.py"
] | [
"import sys\nimport os\nimport time\nimport math\nimport torch\nimport numpy as np\nfrom PIL import Image, ImageDraw, ImageFont\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nimport cv2\nfrom scipy import spatial\n\nimport struct \nimport imghdr \n\ndef get_all_files(directory):\n files =... | [
[
"scipy.spatial.cKDTree",
"numpy.arccos",
"numpy.min",
"torch.exp",
"torch.sum",
"numpy.max",
"torch.sigmoid",
"torch.nn.Softmax",
"torch.autograd.Variable",
"torch.FloatTensor",
"numpy.transpose",
"numpy.array",
"numpy.reshape",
"numpy.zeros",
"torch.max... |
malin1993ml/QueryBot5000 | [
"7aace45fc9e13019931f73f837c8feb10a3cd142"
] | [
"forecaster/Utilities.py"
] | [
"import numpy as np\nfrom torch.autograd import Variable\nimport math\nimport torch\nimport matplotlib.pyplot as plt \nimport os\n\ndef onehot(X, dim):\n Xind = np.zeros(dim)\n Xind[X, np.arange(dim[1])] = 1\n return Xind\n\ndef flat_prod(X,Y):\n XY = np.zeros((X.shape[0]*Y.shape[0], X.shape[1]))\n f... | [
[
"numpy.zeros",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.close",
"matplotlib.pyplot.set_cmap",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.show",
"numpy.kron",
"matplotlib.pyplot.imshow"
]
] |
gureann/MSKit | [
"8b360d38288100476740ad808e11b6c1b454dc2c"
] | [
"mskit/ms_pred/pdeep.py"
] | [
"import os\nimport re\nfrom collections import defaultdict\n\nimport pandas as pd\n\nfrom mskit import rapid_kit\nfrom mskit.post_analysis.spectronaut import SpectronautLibrary\nfrom ._pdeep_constant import BasicpDeepInfo\nfrom ._pdeep_constant import MOD\n\n\ndef intprec_to_pdeep_test(intprec_list):\n \"\"\"\n ... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"pandas.Series"
]
] |
Adamkomar95/gans-clip-pw | [
"14694abd3a793b3e0fdfed76e2e12908e91ea484"
] | [
"source/models/gans/VQGAN/utils.py"
] | [
"\nimport os\nfrom imageio import imread, imsave\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport torch\nimport torch.nn.functional as F\n\ndef plot_text(txt, size=224):\n fig = plt.figure(figsize=(1,1), dpi=size)\n fontsize = size//len(txt) if len(txt) < 15 else 8\n plt.text(0.5, 0.5, txt, f... | [
[
"matplotlib.pyplot.text",
"numpy.array",
"torch.min",
"torch.max",
"matplotlib.pyplot.figure",
"numpy.fmod",
"numpy.where",
"numpy.remainder",
"numpy.arange",
"torch.load",
"numpy.dstack",
"numpy.issubdtype",
"numpy.meshgrid",
"matplotlib.pyplot.axis"
]
] |
austinbyersking/sp500Dashboard-main | [
"0e2ee26207c51592ea925e8fbf9303f45b2e3c31"
] | [
"apps/financeDashboard.py"
] | [
"import streamlit as st\nimport yfinance as yf\nimport pandas as pd\n\ndef app():\n st.title('Finance Dashboard')\n\n #Tickers\n snp500 = pd.read_csv(\"Datasets/SP500.csv\")\n tickers = snp500['Symbol'].sort_values().tolist()\n\n\n #Dropdown menu\n dropdown = st.multiselect('Pick your assets', \n ... | [
[
"pandas.to_datetime",
"pandas.read_csv"
]
] |
GHzytp/atomai | [
"30eab2e5b9cb508247341b1dea8215123b4bf995"
] | [
"test/models/test_loaders.py"
] | [
"import sys\n\nimport numpy as np\nimport pytest\nfrom numpy.testing import assert_, assert_array_equal, assert_equal\n\nsys.path.append(\"../../../\")\n\nfrom atomai.models import (VAE, ImSpec, Segmentor, jrVAE, jVAE, load_ensemble,\n load_model, load_pretrained_model, rVAE)\nfrom atomai.... | [
[
"numpy.isnan",
"numpy.testing.assert_equal",
"numpy.testing.assert_",
"numpy.random.randint",
"numpy.random.random"
]
] |
trex47/MD-copy | [
"915919ce1f541f93d35ebfa1461350d861a3e6a7"
] | [
"sample-input-h2.py"
] | [
"from mmd.molecule import Molecule \nfrom mmd.postscf import PostSCF\nimport numpy as np\n\nh2 = \"\"\"\n0 1\nH 0.000000000 0.000000000 -0.368652\nH 0.000000000 0.000000000 0.368652\n\"\"\"\n\n# init molecule and build integrals\nmol = Molecule(geometry=h2,basis='6-311G**')\n\n# do the SCF\nmol.RHF... | [
[
"numpy.savetxt"
]
] |
BAAI-WuDao/BriVL | [
"8d2c2487284f4b5c015fa3cc19b99c9171cc1ffa"
] | [
"BriVL-code-inference/evaluation/XYB_box_extract.py"
] | [
"import sys\nimport os\nsys.path.append(os.path.abspath(os.path.dirname(os.path.realpath(__file__))+'/'+'..')) \nimport os\nimport time\nimport argparse\nimport torch\nimport json\nfrom tqdm import tqdm\nimport math\nimport numpy as np\nimport random\n\nfrom utils import getLanMask\nfrom models import build_network... | [
[
"torch.device",
"torch.cuda.manual_seed",
"numpy.random.seed",
"torch.no_grad",
"numpy.save",
"torch.manual_seed",
"torch.cuda.set_device",
"torch.nn.DataParallel"
]
] |
chidiugonna/DTI-hippo | [
"3215df591d80c646cd3726e36ea7783dff049ed1"
] | [
"FC/createFCMatrix.py"
] | [
"import os\nimport datetime\nfrom nilearn import signal as sgl\nfrom nilearn import image as img\nfrom nilearn import plotting as plot\nfrom nilearn import datasets\nfrom nilearn import input_data\nfrom nilearn.connectome import ConnectivityMeasure\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot ... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"numpy.fill_diagonal"
]
] |
wangxiaoyunNV/cugraph | [
"97f75de40362740928b45b61e713ff4dae1cbf55"
] | [
"python/cugraph/cugraph/tests/test_graph_store.py"
] | [
"# Copyright (c) 2022, NVIDIA CORPORATION.\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 ... | [
[
"numpy.arange"
]
] |
kuleafenu/covid19-severity-prediction | [
"ebe2e938bbeb70d3dde53c1943f0cfdc02df5098"
] | [
"modeling/fit_and_predict.py"
] | [
"import copy\nimport numpy as np\nimport pandas as pd\nfrom os.path import join as oj\nimport os\nfrom collections import Counter\nfrom models import exponential_modeling\nimport pmdl_weight\nimport datetime\nfrom models.shared_models import SharedModel\nfrom collections import defaultdict\nimport inspect\nimport s... | [
[
"pandas.read_pickle",
"numpy.array",
"numpy.isnan",
"numpy.log"
]
] |
ebenjaminrandall/QAMAS_book | [
"8a6b78fbf3564ce313380619900f2de5fcbe9035"
] | [
"QAMAS/_build/jupyter_execute/BuildingModel.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# # Building a model of oxidative ATP synthesis from energetic components \n# \n# Simulations in the preceding section illustrate how matrix ATP and ADP concentrations are governed by the contributors to the proton motive force. They also show how the matrix ATP/ADP ratio ... | [
[
"numpy.array",
"numpy.log",
"numpy.exp",
"matplotlib.pyplot.subplots",
"scipy.integrate.solve_ivp",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
fehiepsi/probability | [
"9deb067891a974ec9ee1636167b0b0fce9f44a40"
] | [
"tensorflow_probability/python/distributions/hidden_markov_model.py"
] | [
"# Copyright 2018 The TensorFlow Probability 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 a... | [
[
"tensorflow.exp",
"tensorflow.ones_like",
"tensorflow.reshape",
"tensorflow.zeros_like",
"tensorflow.broadcast_to",
"tensorflow.broadcast_static_shape",
"tensorflow.control_dependencies",
"tensorflow.one_hot",
"tensorflow.einsum",
"tensorflow.rank",
"tensorflow.shape",
... |
dtylor/WalkAsString | [
"88841062b2eaa343da0661c3fe31acc4a7d1a0b8"
] | [
"module.py"
] | [
"from n2v import node2vec\nfrom sklearn.cluster import KMeans\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.decomposition import PCA\nimport networkx as nx\nimport pandas as pd\nimport numpy as np\nfrom graphwave import graphwave\nfrom graphwave.utils import utils\nfrom sklearn.decomposition impor... | [
[
"numpy.array",
"sklearn.preprocessing.StandardScaler",
"pandas.DataFrame",
"sklearn.cluster.KMeans",
"numpy.linspace",
"sklearn.decomposition.PCA"
]
] |
batuhan-baskurt/AICITY2020_DMT_VehicleReID | [
"3f18b61f0dbf1fbac1f2adb0dbb07a8b647e1747"
] | [
"train.py"
] | [
"import os\nfrom torch.backends import cudnn\nfrom utils.logger import setup_logger\nfrom datasets import make_dataloader\nfrom model import make_model\nfrom solver import make_optimizer, WarmupMultiStepLR\nfrom loss import make_loss\nfrom processor import do_train\nimport random\nimport torch\nimport numpy as np\n... | [
[
"torch.manual_seed",
"torch.cuda.manual_seed",
"torch.cuda.manual_seed_all",
"numpy.random.seed"
]
] |
valeoai/3DGenZ | [
"3368585e10f127f7a0d71af98994a6cff5235dab"
] | [
"3DGenZ/genz3d/fkaconv/lightconvpoint/knn/sampling_fps_op.py"
] | [
"import torch\nimport math\nfrom torch_geometric.nn.pool import fps\nfrom lightconvpoint.knn import knn\n\nimport importlib\nknn_c_func_spec = importlib.util.find_spec('lightconvpoint.knn_c_func')\n\nif knn_c_func_spec is not None:\n knn_c_func = importlib.util.module_from_spec(knn_c_func_spec)\n knn_c_func_s... | [
[
"torch.arange"
]
] |
chenwydj/dynamic_light_unfolding | [
"607371b9176e10ebfcc1f350511dae4ead260aa2",
"607371b9176e10ebfcc1f350511dae4ead260aa2"
] | [
"EnlightenGAN/data/unaligned_dataset.py",
"bdd/encoding/models/encnet.py"
] | [
"import torch\nfrom torch import nn\nimport os.path\nimport torchvision.transforms as transforms\nfrom EnlightenGAN.data.base_dataset import BaseDataset, get_transform\nfrom EnlightenGAN.data.image_folder import make_dataset\nimport random\nfrom PIL import Image\nimport PIL\nfrom pdb import set_trace as st\nimport ... | [
[
"torch.zeros",
"numpy.array",
"torch.min",
"torch.max",
"numpy.round",
"torch.unsqueeze",
"torch.ones",
"torch.from_numpy",
"torch.nn.ReflectionPad2d",
"torch.LongTensor",
"numpy.unique"
],
[
"torch.nn.Linear",
"torch.nn.functional.relu_",
"torch.cat",
... |
radhasaraf/ds595-rl | [
"3360d01da8a292358d000da2df3f2e65875fbae9",
"3360d01da8a292358d000da2df3f2e65875fbae9"
] | [
"Project3/dqn_model.py",
"Project1/mdp_dp.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport torch\nfrom torch import nn, Tensor\n\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n\n\nclass DQN(nn.Module):\n \"\"\"\n Initialize a deep Q-learning network\n Architecture reference: Original paper for DQN\n (https... | [
[
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.cuda.is_available",
"torch.nn.Linear"
],
[
"numpy.set_printoptions",
"numpy.linalg.norm",
"numpy.zeros"
]
] |
rock-learning/approxik | [
"877d50d4d045457593a2fafefd267339a11de20f"
] | [
"evaluation/viapoint_environment.py"
] | [
"# Authors: Alexander Fabisch <afabisch@informatik.uni-bremen.de>\n\nimport numpy as np\nfrom scipy.spatial.distance import cdist\nfrom bolero.environment import Environment\nfrom bolero.utils.log import get_logger\nimport matplotlib.pyplot as plt\nfrom mpl_toolkits.mplot3d import axes3d\nfrom pytransform.rotations... | [
[
"numpy.linalg.norm",
"numpy.empty",
"numpy.asarray",
"numpy.zeros",
"numpy.sum",
"matplotlib.pyplot.figure",
"numpy.diff",
"numpy.isfinite",
"numpy.clip",
"numpy.linspace",
"matplotlib.pyplot.subplot"
]
] |
sallysyw/vision | [
"bf073e785528970e6a1605e411e4fc382d686dc7"
] | [
"setup.py"
] | [
"import distutils.command.clean\nimport distutils.spawn\nimport glob\nimport os\nimport shutil\nimport subprocess\nimport sys\n\nimport torch\nfrom pkg_resources import parse_version, get_distribution, DistributionNotFound\nfrom setuptools import setup, find_packages\nfrom torch.utils.cpp_extension import BuildExte... | [
[
"torch.utils.cpp_extension.CppExtension",
"torch.cuda.is_available",
"torch.utils.hipify.hipify_python.hipify",
"torch.utils.cpp_extension.BuildExtension.with_options"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.