repo_name stringlengths 8 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
zengxinzhy/colorization-pytorch | [
"a41e61dfc0d99532728af3cbfd21efbdaf6086c5"
] | [
"util/visualizer.py"
] | [
"import numpy as np\nimport os\nimport ntpath\nimport time\nfrom . import util\nfrom . import html\nfrom PIL import Image\nfrom torchvision import transforms\n\n\ndef imresize(image, size, interp=Image.BICUBIC):\n return transforms.Resize(size=size, interpolation=interp)(image)\n\n# save image to the disk\n\n\nd... | [
[
"numpy.array"
]
] |
carocamargo/pygmt | [
"6139c1735cff7f7d615d243145c21b1efef3f2c6"
] | [
"pygmt/helpers/testing.py"
] | [
"\"\"\"\nHelper functions for testing.\n\"\"\"\nimport inspect\nimport os\nimport string\n\nfrom matplotlib.testing.compare import compare_images\nfrom ..exceptions import GMTImageComparisonFailure\n\n\ndef check_figures_equal(*, extensions=(\"png\",), tol=0.0, result_dir=\"result_images\"):\n \"\"\"\n Decora... | [
[
"matplotlib.testing.compare.compare_images"
]
] |
banasraf/DALI | [
"f834f3e619b15e3df87bf0316ac8806d0998126e"
] | [
"dali/test/python/test_operator_warp.py"
] | [
"# Copyright (c) 2019, 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 req... | [
[
"numpy.matmul",
"numpy.zeros",
"numpy.float32",
"numpy.clip",
"numpy.array"
]
] |
jiangyuang/ModelPruningLibrary | [
"9c8ba5a3c5d118f37768d5d42254711f48d88745"
] | [
"mpl/models/base_model.py"
] | [
"from abc import ABC, abstractmethod\nfrom typing import Union, Sized, List, Tuple\nfrom copy import deepcopy\n\nimport torch\nfrom torch import nn as nn\n\nfrom ..nn.linear import DenseLinear\nfrom ..nn.conv2d import DenseConv2d\nfrom .utils import collect_leaf_modules, is_parameterized\n\n\nclass BaseModel(nn.Mod... | [
[
"torch._C._nn._parse_to",
"torch.no_grad"
]
] |
veqtrus/electricitymap-contrib | [
"4ec4857da1315899159688fe1fb7f95376a6badd"
] | [
"parsers/AX.py"
] | [
"#!/usr/bin/env python3\n# The arrow library is used to handle datetimes\nimport arrow\n# The request library is used to fetch content through HTTP\nimport requests\n\n# Numpy and PIL are used to process the image\nimport numpy as np\nfrom PIL import Image\n\n\ndef _get_masks(session=None):\n Minus = np.array([[... | [
[
"numpy.array"
]
] |
drcastillo/hicss2020 | [
"0a812257215c75054d8b891e23c933d6a8327c0d"
] | [
"utils/helpful_util.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n# Reference:\n\n#from __future__ import print_function\n#from utils.heaton_utils import *\n\nimport numpy as np\nimport warnings\nimport os\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport sys\nimport glob\n#pip install counter\nfrom collections impor... | [
[
"matplotlib.pyplot.tight_layout",
"sklearn.model_selection.learning_curve",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"matplotlib.pyplot.text",
"numpy.... |
shday/dash-bio-1 | [
"81bb6fa257febb59d7841f8c5573e7231f5a9095"
] | [
"tests/integration/test_clustergram.py"
] | [
"import json\nimport pandas as pd\n\nimport dash\nimport dash_html_components as html\nimport dash_bio\n\nfrom common_features import nested_component_layout, nested_component_app_callback\n\n_data = None\n\n_mtcars_data = pd.read_csv(\n \"tests/dashbio_demos/dash-clustergram/data/mtcars.tsv\", delimiter=\"\\t\"... | [
[
"pandas.read_csv"
]
] |
Tim15/MLib | [
"2222dc67ec0cbaf07942371120be1690359e0ab3"
] | [
"MLLib/NeuralNet/net.py"
] | [
"# import curses\r\n# import datetime\r\n#\r\n# stdscr = curses.initscr()\r\n# curses.noecho()\r\n# stdscr.nodelay(1) # set getch() non-blocking\r\n#\r\n# stdscr.addstr(0,0,\"Press \\\"p\\\" to show count, \\\"q\\\" to exit...\")\r\n# line = 1\r\n# try:\r\n# while 1:\r\n# c = stdscr.getch()\r\n# ... | [
[
"numpy.random.seed",
"numpy.exp",
"numpy.random.random",
"numpy.array",
"numpy.dot"
]
] |
zakerifahimeh/FaceLib | [
"bf8eadc26baf04907e3800ada02896ac7056080c"
] | [
"facelib/InsightFace/models/data/config.py"
] | [
"from easydict import EasyDict as edict\nfrom pathlib import Path\nimport torch\nfrom torch.nn import CrossEntropyLoss\n\n\ndef get_config(training=True):\n conf = edict()\n conf.data_path = Path('models/data')\n conf.work_path = Path('weights/')\n conf.model_path = conf.work_path / 'models'\n conf.l... | [
[
"torch.cuda.is_available",
"torch.nn.CrossEntropyLoss"
]
] |
FurkanCan-eee/Convolutional-Neural-Network | [
"e7ee0d94075fa724d394b6a3c32e1b5abfe67285"
] | [
"Transfer Learning with MobileNetV2/MobileNetV2.py"
] | [
"# Packages\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport os\nimport tensorflow as tf\nimport tensorflow.keras.layers as tfl\n\nfrom tensorflow.keras.preprocessing import image_dataset_from_directory\nfrom tensorflow.keras.layers.experimental.preprocessing import RandomFlip, RandomRotation\n\n# Cre... | [
[
"tensorflow.keras.optimizers.Adam",
"matplotlib.pyplot.ylabel",
"tensorflow.Variable",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"tensorflow.keras.Sequential",
"matplotlib.pyplot.title",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.experimental.preproce... |
xiacijie/dace | [
"2d942440b1d7b139ba112434bfa78f754e10bfe5"
] | [
"samples/simple/matmul.py"
] | [
"# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.\nfrom __future__ import print_function\n\nimport argparse\nimport dace\nimport numpy as np\nfrom typing import List\n\n# For optimizations\nfrom dace.transformation.dataflow import (DoubleBuffering, MapCollapse,\n ... | [
[
"numpy.ndarray",
"numpy.linalg.norm",
"numpy.random.rand",
"numpy.zeros"
]
] |
artjoms-formulevics/portfolio-builder | [
"d9aa593d52594b795691f7893bd86740ff0eec84"
] | [
"portfolio-theory/updating_stock_prices.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Dec 1 10:35:28 2020\n\n@author: afo\n\"\"\"\n\nfrom os import listdir\nfrom os.path import isfile, join, abspath\nimport os\nfrom inspect import getsourcefile\nimport pandas as pd\nfrom datetime import datetime, timedelta\nimport pandas_datar... | [
[
"pandas.read_csv",
"pandas.concat"
]
] |
mundanePeo/faceRecognition | [
"f3340343a8448372e1031b16ba3c8928419bb9e6"
] | [
"App/exts/face_sdk/api_usage/face_feature.py"
] | [
"\"\"\"\r\n@author: mjs\r\n@based: JiXuan Xu, Jun Wang\r\n\"\"\"\r\n\r\nimport yaml\r\nimport cv2\r\nimport numpy as np\r\n\r\nfrom .logFile import logger\r\nfrom ..core.model_loader.face_recognition.FaceRecModelLoader import FaceRecModelLoader\r\nfrom ..core.model_handler.face_recognition.FaceRecModelHandler impor... | [
[
"numpy.save"
]
] |
JackBenny39/mmabm | [
"e79d91232016167bff914495ee63e18063a1697b"
] | [
"tests/testLearningMM.py"
] | [
"import random\r\nimport unittest\r\n\r\nimport numpy as np\r\n\r\nfrom mmabm.shared import Side, OType\r\n\r\nfrom mmabm.learner import MarketMakerL\r\n\r\n\r\nclass TestTrader(unittest.TestCase):\r\n \r\n def setUp(self):\r\n self.l1 = self._makeMML(3001, 1)\r\n \r\n self.q1 = {'order_i... | [
[
"numpy.arange",
"numpy.random.seed"
]
] |
Mateo-Lopez-Espejo/context_probe_analysis | [
"55461057fd01f00124aa46682b335313af9cc0f8"
] | [
"scripts/4_sam_data/200221_NTI_CPN_comparison.py"
] | [
"import itertools as itt\r\nimport pathlib as pl\r\n\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nimport pandas as pd\r\nfrom scipy.io import loadmat\r\n\r\nimport src.data.rasters\r\nfrom src.data import dPCA as cdPCA\r\nfrom src.metrics import dprime as cDP\r\nfrom src.data.load import load, get_si... | [
[
"scipy.io.loadmat",
"numpy.sum",
"numpy.empty",
"pandas.DataFrame",
"matplotlib.pyplot.subplots",
"pandas.concat",
"numpy.stack",
"numpy.std",
"numpy.linspace",
"numpy.mean"
]
] |
kastalpes/yt | [
"b1e197ca84433fbd61eaf44b28ff5cdb37981d4c"
] | [
"doc/source/cookbook/time_series.py"
] | [
"import yt\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# Enable parallelism in the script (assuming it was called with\n# `mpirun -np <n_procs>` )\nyt.enable_parallelism()\n\n# By using wildcards such as ? and * with the load command, we can load up a\n# Time Series containing all of these datasets simu... | [
[
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.semilogy",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig"
]
] |
steffenerickson/pytorch | [
"0b656c4c69ce77ecd9aace486e471917e4660746"
] | [
"test/fx2trt/converters/acc_op/test_batchnorm.py"
] | [
"# Owner(s): [\"oncall: aiacc\"]\n\nimport torch\nimport torch.fx.experimental.fx_acc.acc_ops as acc_ops\nfrom torch.testing._internal.common_fx2trt import AccTestCase, InputTensorSpec\nfrom torch.testing._internal.common_utils import run_tests\n\n\nclass TestBatchNormConverter(AccTestCase):\n def test_batchnorm... | [
[
"torch.randn",
"torch.testing._internal.common_utils.run_tests",
"torch.testing._internal.common_fx2trt.InputTensorSpec",
"torch.nn.BatchNorm2d"
]
] |
hieultp/stylegan2-ada-pytorch | [
"d09653fc1c4a8eefe64f29b3e33a2afb3bdd3d22"
] | [
"generate.py"
] | [
"# Copyright (c) 2021, NVIDIA CORPORATION. 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 of this softwa... | [
[
"numpy.sqrt",
"numpy.sum",
"numpy.load",
"numpy.linalg.norm",
"numpy.arccos",
"numpy.cos",
"numpy.copy",
"numpy.random.randn",
"numpy.random.RandomState",
"numpy.abs",
"torch.tensor",
"torch.from_numpy",
"numpy.asarray",
"torch.zeros",
"numpy.sin",
"... |
mgxd/nitransforms | [
"a922f3cb8ee1df5b484f617c34e1816a726e54e0"
] | [
"nitransforms/tests/test_affines.py"
] | [
"import numpy as np\nfrom nibabel.affines import from_matvec\nfrom nibabel.eulerangles import euler2mat\nfrom ..patched import obliquity\n\ndef test_obliquity():\n \"\"\"Check the calculation of inclination of an affine axes.\"\"\"\n from math import pi\n aligned = np.diag([2.0, 2.0, 2.3, 1.0])\n aligne... | [
[
"numpy.diag"
]
] |
lizhihao6/HINet | [
"8c3fb71dc3331be32a9af3e1efe5106a0b26cefe"
] | [
"basicsr/data/reds_dataset.py"
] | [
"# ------------------------------------------------------------------------\n# Copyright (c) 2021 megvii-model. All Rights Reserved.\n# ------------------------------------------------------------------------\n# Modified from BasicSR (https://github.com/xinntao/BasicSR)\n# Copyright 2018-2020 BasicSR Authors\n# ---... | [
[
"torch.zeros_like",
"torch.stack",
"numpy.split"
]
] |
ProFatXuanAll/char-RNN | [
"531f101b3d1ba20bafd28ca060aafe6f583d1efb"
] | [
"test/lmp/model/_lstm_1997/test_pred.py"
] | [
"\"\"\"Test prediction.\n\nTest target:\n- :py:meth:`lmp.model._lstm_1997.LSTM1997.pred`.\n\"\"\"\n\nimport torch\n\nfrom lmp.model._lstm_1997 import LSTM1997\n\n\ndef test_prediction_result(lstm_1997: LSTM1997, batch_cur_tkids: torch.Tensor) -> None:\n \"\"\"Return float tensor with correct shape and range.\"\"\"... | [
[
"torch.ones_like",
"torch.all",
"torch.Size"
]
] |
prteek/sagemaker-boilerplate | [
"372ff5722e5f4b5e2d84008e7186762b5bade2ad"
] | [
"non_linear_model.py"
] | [
"#! /opt/conda/envs/env/bin/python\nimport argparse\nimport os\nfrom sklearn.ensemble import RandomForestClassifier\nimport pandas as pd\nimport joblib\nfrom sklearn.metrics import accuracy_score\n\n\nif __name__ == '__main__':\n \n parser = argparse.ArgumentParser()\n \n parser.add_argument(\"--model-d... | [
[
"sklearn.ensemble.RandomForestClassifier"
]
] |
Anon-Artist/tfx | [
"2692c9ab437d76b5d9517996bfe2596862e0791d"
] | [
"tfx/components/example_validator/component_test.py"
] | [
"# Lint as: python2, python3\n# Copyright 2019 Google LLC. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\... | [
[
"tensorflow.test.main"
]
] |
JouniVatanen/NLP-and-Deep-Learning | [
"2fddcc2c39787713d33d17e80565de4ed073ca60"
] | [
"src/supervised_class/dt.py"
] | [
"# https://deeplearningcourses.com/c/data-science-supervised-machine-learning-in-python\n# https://www.udemy.com/data-science-supervised-machine-learning-in-python\n# Decision Tree for continuous-vector input, binary output\nfrom __future__ import print_function, division\nfrom future.utils import iteritems\nfrom b... | [
[
"numpy.logical_or",
"numpy.log2",
"numpy.zeros",
"numpy.argsort",
"numpy.nonzero",
"numpy.mean"
]
] |
liuhuaijjin/rpn_rois_proposals_layers | [
"c5f9f09b3ae8c52e4b6fa3fda391f993cb7d42c1"
] | [
"lib/net/pcn_coarse.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass Encoder(nn.Module):\n def __init__(self):\n super(Encoder, self).__init__()\n\n # first shared mlp\n self.conv1 = nn.Conv1d(3, 128, 1)\n self.conv2 = nn.Conv1d(128, 256, 1)\n se... | [
[
"torch.nn.Linear",
"torch.load",
"torch.nn.BatchNorm1d",
"torch.no_grad",
"torch.nn.Conv1d",
"torch.max",
"numpy.linspace",
"torch.Tensor"
]
] |
uwmadison-chm/redcap-examples | [
"376d62cf18a7e76265fc251425d2bfae3a2c6521"
] | [
"download_longitudinal.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\nDownloads the data for a longitudinal REDCap project, with each event as \na separate file. Also allows filtering by standard REDCap logic, so you can,\nfor example, exclude non-enrolled participants from your data.\n\nRequires an instrument_download_list_file, which is a CSV file ... | [
[
"pandas.read_csv"
]
] |
mayank42/Earthquake-Signal-Analysis-using-Deep-CNN | [
"fdeca035277acd1b37759c546c90bcdd63168412"
] | [
"pv.py"
] | [
"\"\"\" \npv.py\nPhase Vocoder implementation in Python\n\nThe MIT License (MIT)\n\nCopyright (c) 2015 multivac61\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, inc... | [
[
"numpy.fft.ifft",
"numpy.fft.fft",
"numpy.hanning",
"numpy.zeros"
]
] |
KleinYuan/tf-tailor | [
"70e85643a49ad4484ef856c22a0de2ae8a5a00e9"
] | [
"models/tf_server.py"
] | [
"import tensorflow as tf\n\n\nclass TFServer(object):\n\n\tdef __init__(self, config):\n\t\ttf.reset_default_graph()\n\t\tself.in_progress = False\n\t\tself.prediction = None\n\t\tself.session = None\n\t\tself.graph = None\n\t\tself.frozen = False\n\t\tself.feed_dict = {}\n\t\tself.output_ops = []\n\t\tself.input_o... | [
[
"tensorflow.gfile.GFile",
"tensorflow.device",
"tensorflow.Graph",
"tensorflow.Session",
"tensorflow.import_graph_def",
"tensorflow.get_default_graph",
"tensorflow.reset_default_graph",
"tensorflow.ConfigProto",
"tensorflow.GraphDef"
]
] |
RajaSudalai/Motorcyclist_Helmet_Detection | [
"5f739115ed1453ce01a51204219abe080e159761"
] | [
"mrcnn/model.py"
] | [
"\"\"\"\nMask R-CNN\nThe main Mask R-CNN model implementation.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport os\nimport random\nimport datetime\nimport re\nimport math\nimport logging\nfrom collections import OrderedDict... | [
[
"numpy.sum",
"numpy.ones",
"tensorflow.sparse_tensor_to_dense",
"tensorflow.reduce_max",
"tensorflow.reshape",
"tensorflow.gather_nd",
"tensorflow.round",
"tensorflow.nn.top_k",
"numpy.any",
"tensorflow.logical_and",
"numpy.copy",
"tensorflow.squeeze",
"tensorfl... |
leo6033/Graduation-Project | [
"c1cf68edaffc346b37ac6e615d580cd05c4f0711"
] | [
"TextCNN.py"
] | [
"\"\"\"\n@Description: TextCNN 网络\n@Author: 吕明伟\n@Date: 2021-4-6\n\"\"\"\nfrom tensorflow.keras import Input, Model\nfrom tensorflow.keras.layers import Embedding, Dense, Conv1D, GlobalMaxPooling1D, Concatenate, Dropout\n\nclass TextCNN(object):\n def __init__(self, maxlen, max_features, embedding_dims,\n ... | [
[
"tensorflow.keras.layers.Concatenate",
"tensorflow.keras.layers.Embedding",
"tensorflow.keras.layers.Conv1D",
"tensorflow.keras.Model",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.GlobalMaxPooling1D",
"tensorflow.keras.Input"
]
] |
jtapanes21/RADGIS | [
"2322f75f23cec4dde9f8c7b21d9137f1986e6382"
] | [
"RADGIS/preprocessing/knn.py"
] | [
"from sklearn.neighbors import BallTree\nimport numpy as np\n\n'''\nReturns the KNN and distance in meters to the KNN.\n\nParameters\n ----------\n left_gdf : GeoDataFrame\n the target geodataframe; all columns are kept.\n \n right_gdf : GeoDataFrame\n the geodataframe that is the subject ... | [
[
"sklearn.neighbors.BallTree"
]
] |
bianxg/BackgroundMattingV2 | [
"af15097de99564f5042121601abe4050cc2e3c2e"
] | [
"collect_env.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\r\nimport importlib\r\nimport numpy as np\r\nimport os\r\nimport re\r\nimport subprocess\r\nimport sys\r\nfrom collections import defaultdict\r\nimport PIL\r\nimport torch\r\nimport torchvision\r\nfrom tabulate import tabulate\r\n\r\n__all__ = [\"collect_env_info\... | [
[
"torch.utils.collect_env.get_pretty_env_info",
"torch.tensor",
"torch.cuda.device_count",
"torch.cuda.is_available",
"torch.__config__.show",
"torch.cuda.get_device_capability",
"torch.cuda.get_device_name"
]
] |
ysy9893/object_recognition_with_hand_gesture | [
"fc43211a1e6fe8a19f726f156cf276a8acdcb246"
] | [
"motpy_edit/tracker.py"
] | [
"import uuid\nfrom collections.abc import Iterable\nfrom typing import Any, Optional, Sequence, Union\n\nimport numpy as np\nimport scipy\nfrom filterpy.kalman import KalmanFilter\n\nfrom motpy.core import Box, Detection, Track, Vector, setup_logger\nfrom motpy.metrics import angular_similarity, calculate_iou\nfrom... | [
[
"numpy.array",
"numpy.multiply",
"scipy.optimize.linear_sum_assignment",
"numpy.isnan"
]
] |
borisbolliet/CCL | [
"6ddd35e49f9d2968cef3d3bc1bac8b55dbb4cf91"
] | [
"pyccl/tracers.py"
] | [
"from . import ccllib as lib\nfrom .core import check\nfrom .background import comoving_radial_distance, growth_rate, \\\n growth_factor, scale_factor_of_chi\nfrom .pyutils import _check_array_params, NoneArr\nimport numpy as np\n\n\ndef get_density_kernel(cosmo, dndz):\n \"\"\"This convenience function retur... | [
[
"scipy.interpolate.interp1d",
"numpy.squeeze",
"numpy.atleast_1d",
"numpy.ndim",
"numpy.array",
"numpy.linspace"
]
] |
wilile26811249/ConvMixer | [
"e3a2bcbedb8e8c2b7b5f942ed0ae55473940d47c"
] | [
"utils.py"
] | [
"from typing import List, Optional\n\nimport numpy as np\nimport torch\nfrom torchvision import datasets\nfrom torchvision import transforms as T\n\nclass AverageMeter(object):\n def __init__(self,\n name: str,\n fmt: Optional[str] = ':f',\n ) -> None:\n self.name = name\n self.fmt... | [
[
"torch.utils.data.DataLoader",
"torch.no_grad",
"torch.utils.data.random_split"
]
] |
josesho/bootstrap-contrast | [
"94fa42a5dc4622be016e2e522d1f07b19ba23a8d"
] | [
"setup.py"
] | [
"from setuptools import setup, find_packages\nimport os\n# Taken from setup.py in seaborn.\n# temporarily redirect config directory to prevent matplotlib importing\n# testing that for writeable directory which results in sandbox error in\n# certain easy_install versions\nos.environ[\"MPLCONFIGDIR\"]=\".\"\n\n# Modi... | [
[
"pandas.__version__.split"
]
] |
exenGT/pymatgen | [
"a8ffb820ab8fc3f60251099e38c8888f45eae618"
] | [
"pymatgen/analysis/piezo.py"
] | [
"# Copyright (c) Pymatgen Development Team.\n# Distributed under the terms of the MIT License.\n\n\n\"\"\"\nThis module provides classes for the Piezoelectric tensor\n\"\"\"\nimport warnings\n\nimport numpy as np\n\nfrom pymatgen.core.tensors import Tensor\n\n__author__ = \"Shyam Dwaraknath\"\n__copyright__ = \"Cop... | [
[
"numpy.array",
"numpy.transpose",
"numpy.zeros"
]
] |
j-lazo/lumen_segmentation | [
"442b6e642b4743e6b7bf56ab77e11e8e95062ed7"
] | [
"general/calculate_performance_dataset.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Jun 9 16:18:55 2020\n\n@author: jlazo\n\"\"\"\n\n#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue May 26 01:18:22 2020\n\n@author: jlazo\n\"\"\"\n\nimport os\nimport numpy as np\nimport cv2\nfrom glob import glob\nfrom ... | [
[
"numpy.logical_and",
"numpy.asarray",
"matplotlib.pyplot.subplots",
"sklearn.metrics.accuracy_score",
"numpy.max",
"numpy.min",
"numpy.sqrt",
"sklearn.metrics.recall_score",
"sklearn.metrics.average_precision_score",
"numpy.unique"
]
] |
mrawls/ELCtools | [
"7e15bf24c453ed4300c6f19f01cff74c041158b8"
] | [
"dnu_calculator.py"
] | [
"from __future__ import print_function\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom astropy import units as u\n'''\nMeredith Rawls, 2015\nTakes masses, radii, and chi2s from an ELC run and makes delta_nu distributions.\nAssumes a fixed temperature for each star.\n'''\ndir = '../../RG_ELCmodeling/92467... | [
[
"numpy.sqrt",
"matplotlib.pyplot.figure",
"numpy.median",
"matplotlib.pyplot.show",
"numpy.power",
"matplotlib.pyplot.hist",
"numpy.array",
"numpy.std",
"numpy.genfromtxt",
"matplotlib.pyplot.xlabel",
"numpy.loadtxt"
]
] |
canbakiskan/sparse_coding_frontend | [
"1f62b54824785aa441317ddab1baa3012f2fb401"
] | [
"src/utils/read_datasets.py"
] | [
"import torch\nfrom torchvision import datasets, transforms\n\nimport numpy as np\nfrom os.path import join\nfrom .namers import attack_file_namer\n\n\ndef tiny_imagenet(args):\n\n data_dir = join(args.directory, 'data')\n train_dir = join(data_dir, \"original_datasets\",\n \"tiny-imagenet... | [
[
"torch.utils.data.DataLoader",
"numpy.load",
"torch.cuda.is_available",
"numpy.max",
"torch.utils.data.TensorDataset",
"torch.Tensor"
]
] |
man-vs-electron/datapanels | [
"d656bbd3c6071cc2d26bd27285001aee1fa7c82d"
] | [
"src/datapanels/gameoflife.py"
] | [
"\"\"\" DataPanels implementation of Conway's Game of Life\n\nSee https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life for details about\nthe game.\n\n\"\"\"\nimport random\nfrom typing import Tuple, Set, Optional, Union, List\nimport re\nimport numpy as np\nfrom kivy.lang.builder import Builder\nfrom kivy.propert... | [
[
"numpy.random.randint"
]
] |
chensjtu/poxture | [
"f6abea1216c987f0e4c628b250054d764eaecf2e"
] | [
"models/losses.py"
] | [
"# this code is for calculate the VGGloss, which also called percetual loss.\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torchvision import models\nfrom typing import Union\nimport math\n\nclass VGG19(nn.Module):\n \"\"\"\n Sequential(\n (0): Conv2d(3, 64, kernel_size=... | [
[
"torch.nn.functional.mse_loss",
"torch.ones",
"torch.load",
"torch.nn.L1Loss",
"torch.no_grad",
"torch.nn.Sequential",
"torch.zeros",
"torch.device",
"torch.nn.functional.interpolate"
]
] |
dssg/babies-public | [
"0a03e95992bfd7b7b4c2f11b8a5e2c3961f193c6"
] | [
"webapp/proto.py"
] | [
"import pandas as pd\nimport numpy as np\nimport psycopg2\nfrom sqlalchemy import create_engine\nimport json\nimport sys\nfrom sklearn.externals import joblib\nimport os\n\ndef run_all():\n\n # connect to postgres \n params = json.load(open('/home/ipan/passwords/psql_psycopg2.password', 'r'))\n\n try:\n ... | [
[
"sklearn.externals.joblib.dump",
"pandas.DataFrame",
"sklearn.externals.joblib.load"
]
] |
MingSungChao/IPN-hand | [
"0b061e4438f159e3e312af4959cb424917b5c367"
] | [
"test.py"
] | [
"import torch\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nimport time\nimport os\nimport sys\nimport json\nimport pdb\n\nfrom utils import AverageMeter\n\n\ndef calculate_video_results(output_buffer, video_id, test_results, class_names):\n video_outputs = torch.stack(output_buffer)\n ... | [
[
"torch.stack",
"torch.nn.functional.softmax",
"torch.autograd.Variable",
"torch.no_grad",
"torch.topk",
"torch.mean"
]
] |
mehrdad-shokri/astropy | [
"abd73b51277694338c8eca7639da956dcd06f207"
] | [
"astropy/utils/data_info.py"
] | [
"# -*- coding: utf-8 -*-\n# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\n\"\"\"This module contains functions and methods that relate to the DataInfo class\nwhich provides a container for informational attributes as well as summary info\nmethods.\n\nA DataInfo object is attached to the Quantity,... | [
[
"numpy.dtype",
"numpy.isinf",
"numpy.count_nonzero",
"numpy.atleast_1d",
"numpy.isnan",
"numpy.where"
]
] |
zchvsre/TreeCorr | [
"825dc0a9d4754f9d98ebcf9c26dee9597915d650"
] | [
"treecorr/binnedcorr3.py"
] | [
"# Copyright (c) 2003-2019 by Mike Jarvis\n#\n# TreeCorr is free software: redistribution and use in source and binary forms,\n# with or without modification, are permitted provided that the following\n# conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice, this\n# l... | [
[
"numpy.tile",
"numpy.arcsin",
"numpy.exp",
"numpy.concatenate",
"numpy.linspace"
]
] |
jmrozanec/features-generator | [
"0772394cf1c4a56a88c8a8faba2e5c84b4b2883f"
] | [
"features/feature_generator.py"
] | [
"from sklearn.base import BaseEstimator, TransformerMixin\nfrom feature_generation_strategy import MinFeatureGenerationStrategy, MaxFeatureGenerationStrategy, SumFeatureGenerationStrategy, DiffFeatureGenerationStrategy, ProdFeatureGenerationStrategy, DivFeatureGenerationStrategy, AvgFeatureGenerationStrategy, PCAFe... | [
[
"pandas.DataFrame",
"sklearn.model_selection.train_test_split",
"sklearn.datasets.load_iris"
]
] |
FOLEFAC/InstantReact | [
"ba0e00ef4c84710accfe6b278000da06ee2d6438"
] | [
"test.py"
] | [
"\r\n# Imports\r\n\r\nimport torch\r\nfrom torchvision import datasets, models, transforms # All torchvision modules\r\nimport torch.nn as nn # All neural network modules, nn.Linear, nn.Conv2d, Loss functions,..\r\nimport torch.optim as optim # For all Optimization algorithms, SGD, Adam,...\r\nimport torch.nn.fun... | [
[
"torch.load",
"torch.argmax",
"torch.no_grad",
"torch.cuda.is_available",
"torch.zeros"
]
] |
opengulf/nyc-directories-support-scripts | [
"e22582b8f4cb3c365e9aac1d860d9c36831277a5"
] | [
"py-hocr-detect-columns.py"
] | [
"import numpy as np\nfrom bs4 import BeautifulSoup\nfrom sklearn.cluster import KMeans\nfrom math import sqrt\nfrom statistics import mean\nfrom PIL import Image, ImageOps, ImageDraw\nimport re\nimport json\nimport argparse\nimport os\nimport uuid\nfrom cdparser import Classifier, Features, LabeledEntry, Utils\nimp... | [
[
"numpy.array",
"sklearn.cluster.KMeans"
]
] |
Ben-Foxman/z-quantum-qcbm | [
"6e0aff5283f4a1b2b788317c3a12f8ef8c562a29"
] | [
"src/python/zquantum/qcbm/ansatz.py"
] | [
"import numpy as np\nimport sympy\nfrom zquantum.core.circuit import Circuit, Qubit, Gate, create_layer_of_gates\nfrom zquantum.core.interfaces.ansatz import Ansatz\nfrom zquantum.core.interfaces.ansatz_utils import (\n ansatz_property,\n invalidates_parametrized_circuit,\n)\nfrom typing import Optional, List... | [
[
"numpy.asarray"
]
] |
EmilRyberg/P8LH7Grounding | [
"406fdf4ce9afd160df3d7105fedea563a284974b"
] | [
"webots/controllers/ur_controller/kinematics/kinematics.py"
] | [
"import numpy as np\n\nfrom kinematics.dhparameters import DHParameters\n\n\nclass Kinematics:\n def __init__(self):\n self.joint1_dh = DHParameters(0, 0.1625, 0)\n self.joint2_dh = DHParameters(0, 0, np.pi / 2)\n self.joint3_dh = DHParameters(-0.425, 0, 0)\n self.joint4_dh = DHParame... | [
[
"numpy.array",
"numpy.sin",
"numpy.cos"
]
] |
omkarudawant/ML-Service | [
"cb612585cbe9619b86c6ea44dd9069a1bc28a8f8"
] | [
"backend/server/apps/ml/income_classifier/extra_trees.py"
] | [
"import joblib\nimport pandas as pd\n\n\nclass ExtraTreesClassifier:\n def __init__(self):\n path_to_artifacts = \"../../research/\"\n self.values_fill_missing = joblib.load(path_to_artifacts +\n \"train_mode.joblib\")\n self.encoders = joblib.lo... | [
[
"pandas.DataFrame"
]
] |
rlupat/moanna | [
"81e97b95033a2c1004429c17c41d1c660e62bc83"
] | [
"moanna/helper/SurvivalHelperFunctions.py"
] | [
"def map_label(df, column, mapping):\n df[column] = df[column].replace(mapping)\n return df\n\ndef map_mult_labels(df, columns, labels):\n for column in columns:\n df = map_label(df, labels[column][0], labels[column][1])\n \n return df\n\n#https://stackoverflow.com/questions/26886653/pandas-cr... | [
[
"matplotlib.pyplot.figure",
"matplotlib.pyplot.subplot",
"pandas.DataFrame",
"matplotlib.pyplot.savefig"
]
] |
ment911/entsoe-py | [
"67cb4386796c242c112512fbf1f50b68723c861a"
] | [
"entsoe/entsoe.py"
] | [
"import logging\nfrom functools import wraps\nfrom socket import gaierror\nfrom time import sleep\nfrom typing import Union, Optional, Dict\n\nimport pandas as pd\nfrom pandas.tseries.offsets import YearBegin, YearEnd\nimport pytz\nimport requests\nfrom bs4 import BeautifulSoup\n\nfrom entsoe.exceptions import Inva... | [
[
"pandas.tseries.offsets.YearBegin",
"pandas.tseries.offsets.YearEnd",
"pandas.concat"
]
] |
noemiefedon/BELLA | [
"ca86e5cd6f593478235c64aa4d0409b0e78dbcbb"
] | [
"src/BELLA/results.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nClass for the results of an optimisation with BELLA\r\nwith several ply-drop layout\r\n\"\"\"\r\n__version__ = '2.0'\r\n__author__ = 'Noemie Fedon'\r\n\r\nimport numpy as np\r\n\r\n#import sys\r\n#sys.path.append(r'C:\\BELLA')\r\n#from src.divers.pretty_print import print_lampa... | [
[
"numpy.ones",
"numpy.zeros"
]
] |
lao-jiu/Facecluster | [
"1603c99ae9f1f1d1d37f60ea30b20dde6cd4568e"
] | [
"workflow/mtcnn_detector.py"
] | [
"# coding: utf-8\nimport os\nimport mxnet as mx\nimport numpy as np\nimport math\nimport cv2\nfrom multiprocessing import Pool\nfrom itertools import repeat\ntry:\n from itertools import izip\nexcept ImportError:\n izip = zip\n\nfrom helper import nms, adjust_input, generate_bbox, detect_first_stage_warpper\n... | [
[
"numpy.vstack",
"numpy.linalg.norm",
"numpy.array",
"numpy.zeros",
"numpy.diag",
"numpy.matrix",
"numpy.linalg.det",
"numpy.abs",
"numpy.linalg.svd",
"numpy.mod",
"numpy.hstack",
"numpy.expand_dims",
"numpy.maximum",
"numpy.where",
"numpy.round"
]
] |
braineniac/adapt_kalman | [
"a29a0740420959d2221d548a414031c17fa25cf8"
] | [
"scripts/experiments.py"
] | [
"#!/usr/bin/env python\n\n# Copyright (c) 2019 Daniel Hammer. 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.... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel"
]
] |
gbmarc1/Ax | [
"9428fa64a621cf4562c7e2c63881a0ca2fa2780b"
] | [
"setup.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\nimport subprocess\n\nimport numpy\nfrom Cython.Build import cythonize\nfrom setuptools import find_packages, setup\nfrom setuptools.extension import Extension\n\n\nEXTENSIONS = [\n Extension(\n \"ax.utils.s... | [
[
"numpy.get_include"
]
] |
seralexger/fairlearn | [
"c3ee7b5a45eb3394fc1b8d17b991e3d970970c05"
] | [
"test/unit/metrics/test_metrics_engine_dicts.py"
] | [
"# Copyright (c) Microsoft Corporation and Fairlearn contributors.\n# Licensed under the MIT License.\n\nimport pytest\nimport numpy as np\n\nimport fairlearn.metrics as metrics\n\n# ======================================================\n\ny_true = [0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1]\ny_pred = [... | [
[
"numpy.array"
]
] |
j35tor/federated | [
"d92bfa6b8e3c9ebbac51ff7a3a180c2baaa08730"
] | [
"tensorflow_federated/python/core/impl/tensorflow_context/tensorflow_serialization_test.py"
] | [
"# Copyright 2018, The TensorFlow Federated Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by a... | [
[
"tensorflow.compat.v1.Session",
"tensorflow.data.Dataset.range",
"numpy.int64",
"numpy.arange",
"tensorflow.Graph",
"tensorflow.data.experimental.to_variant",
"tensorflow.cast",
"tensorflow.constant"
]
] |
alessiomora/federated | [
"3b501067ed7062aaec3cc8830aaec0a7cf8f0942",
"3b501067ed7062aaec3cc8830aaec0a7cf8f0942"
] | [
"tensorflow_federated/python/simulation/datasets/file_per_user_client_data.py",
"tensorflow_federated/python/learning/optimizers/optimizer_test.py"
] | [
"# Copyright 2018, The TensorFlow Federated Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by a... | [
[
"tensorflow.constant",
"tensorflow.io.gfile.listdir"
],
[
"tensorflow.zeros"
]
] |
keuntaeklee/pytorch-PPUU | [
"0ba8c953df9cdb1e9937e301ed3384ac6b66ea73"
] | [
"eval_fm.py"
] | [
"import argparse\nimport os\nimport random\n\nimport numpy as np\nimport torch\nimport torch.nn.functional as fun\n\nimport utils\nfrom dataloader import DataLoader\n\nparser = argparse.ArgumentParser(fromfile_prefix_chars='@')\nparser.add_argument('-dataset', type=str, default='i80')\nparser.add_argument('-debug',... | [
[
"torch.cuda.empty_cache",
"torch.nn.functional.mse_loss",
"torch.load",
"torch.manual_seed",
"torch.save",
"numpy.random.seed",
"torch.no_grad",
"torch.arange",
"torch.zeros"
]
] |
nils-werner/librosa | [
"3d57352e6f5b6da151a2dd5d303af985797800aa"
] | [
"tests/test_features.py"
] | [
"#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\n\nfrom __future__ import print_function\nimport warnings\nimport numpy as np\n\nimport pytest\n\nimport librosa\n\nfrom test_core import load, srand\n\n# Disable cache\nimport os\ntry:\n os.environ.pop('LIBROSA_CACHE_DIR')\nexcept KeyError:\n pass\n\n__EXAMPL... | [
[
"numpy.ones",
"numpy.allclose",
"numpy.zeros_like",
"numpy.sum",
"numpy.zeros",
"numpy.var",
"numpy.any",
"numpy.random.randn",
"numpy.abs",
"numpy.ones_like",
"numpy.floor",
"numpy.arange",
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.linspace... |
oliviermailletglas/project_csi4103 | [
"b426f4fb8d909909dd7d1d954fd10d97891c33cb"
] | [
"brachiograph.py"
] | [
"# coding=utf-8\n\nfrom time import sleep\nimport readchar\nimport math\nimport numpy\nimport json\nimport pigpio\nfrom turtle_draw import BrachioGraphTurtle\n\n\ntry:\n pigpio.exceptions = False\n rpi = pigpio.pi()\n rpi.set_PWM_frequency(18, 50)\n pigpio.exceptions = True\n force_virtual = False\n\... | [
[
"numpy.array",
"numpy.polyfit",
"numpy.mean"
]
] |
jackyhuynh/graph_traverse_using_networkx | [
"11988af1324cbd1520102c66776476d91c2d087e"
] | [
"truc_graph_traverse.py"
] | [
"# Required library\nimport matplotlib.pyplot as plt\nimport networkx as nx\n\n\"\"\"\n# openfile read input from textfile\n# In fact, I test the data on different jupiter notebook and come up with the shortest version\n\"\"\"\n\n\ndef openfile(filename):\n with open(filename, \"r\") as file_reader:\n all... | [
[
"matplotlib.pyplot.show"
]
] |
Oewyn/onnxmltools | [
"8dbd844dab77754971f59d4d533e6763ce0b03c2"
] | [
"onnxmltools/convert/common/shape_calculator.py"
] | [
"# -------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for\n# license information.\n# --------------------------------------------------------------------------\n... | [
[
"numpy.concatenate"
]
] |
omikabir/omEngin | [
"b8c04a5c2c12ffc3d0b67c2ceba9e5741d3f9195"
] | [
"Z_ALL_FILE/Jy1/1092020-80-XAQ-Untitled.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[8]:\n\n\nimport pandas as pd\nimport numpy as np\nimport os\nimport sqlite3\n\npt = os.getcwd()\nalarm = pt + \"\\\\C.csv\"\n\n\ndef conv_2_list(ls1, ls2, ls3):\n ToDf = pd.DataFrame(zip(ls1, ls2, l3))\n print(Todf)\n \n\nl0 = [\"0\", \"1\", \"2\", \"3\", \"4... | [
[
"pandas.read_csv"
]
] |
Chenzhoujia/Mobile_hand_tf-gnn-samples-master | [
"56236752bb06bcc60b4befb024cdd100aa9ce9ac"
] | [
"tasks/varmisuse_task.py"
] | [
"import re\nfrom collections import defaultdict\nfrom multiprocessing import Process, Queue, cpu_count\nfrom typing import Any, Dict, Iterable, List, NamedTuple, Set, Iterator\n\nimport tensorflow as tf\nimport numpy as np\nfrom dpu_utils.utils import RichPath\nfrom dpu_utils.codeutils import split_identifier_into_... | [
[
"numpy.ones",
"tensorflow.summary.scalar",
"tensorflow.reduce_max",
"tensorflow.reshape",
"tensorflow.squeeze",
"tensorflow.einsum",
"tensorflow.nn.sparse_softmax_cross_entropy_with_logits",
"tensorflow.nn.softmax",
"tensorflow.reduce_sum",
"tensorflow.nn.dropout",
"ten... |
Mehrad0711/oslo | [
"873d771a68bc380903947010da0b66f58f60e496"
] | [
"oslo/pytorch/kernel_fusion/cuda/fused_normalization.py"
] | [
"import numbers\nfrom typing import Optional, Sequence\n\nimport torch\nfrom torch.nn import functional as F\nfrom torch.nn import init\nfrom torch.nn.parameter import Parameter\n\nfrom oslo.pytorch.kernel_fusion.cuda import CUDA\n\n\ndef _get_autocast_dtypes() -> Sequence[torch.dtype]:\n if torch.cuda.is_bf16_s... | [
[
"torch.Size",
"torch.nn.functional.layer_norm",
"torch.is_autocast_enabled",
"torch.get_autocast_gpu_dtype",
"torch.nn.init.ones_",
"torch.rsqrt",
"torch.cuda.amp.autocast",
"torch.cuda.is_bf16_supported",
"torch.nn.init.zeros_",
"torch.Tensor"
]
] |
DataCanvasIO/YLearn | [
"d65b5afb83deed154c710de9096317165d95014a"
] | [
"tests/metalearner_test.py"
] | [
"from itertools import product\n\nimport pytest\nfrom sklearn import clone\nfrom sklearn.ensemble import GradientBoostingRegressor\nfrom sklearn.linear_model import LinearRegression\n\nfrom ylearn.estimator_model.meta_learner import SLearner, TLearner, XLearner\nfrom . import _dgp\nfrom ._common import validate_lea... | [
[
"sklearn.clone",
"sklearn.linear_model.LinearRegression",
"sklearn.ensemble.GradientBoostingRegressor"
]
] |
stxxllbu/CS224n-winter-together | [
"eae158ed8e88dc7c8638e25bac4c4fc8eeddcc8c"
] | [
"Assignments/assignment4/BobOfRivia/run.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\"\"\"\nCS224N 2019-20: Homework 4\nrun.py: Run Script for Simple NMT Model\nPencheng Yin <pcyin@cs.cmu.edu>\nSahil Chopra <schopra8@stanford.edu>\nVera Lin <veralin@stanford.edu>\n\nUsage:\n run.py train --train-src=<file> --train-tgt=<file> --dev-src=<file> -... | [
[
"torch.load",
"torch.cuda.manual_seed",
"torch.manual_seed",
"torch.no_grad",
"numpy.random.seed",
"numpy.abs",
"numpy.exp",
"torch.device"
]
] |
google-research/understanding-transfer-learning | [
"0e4df444f342784514d91028d0de332103343a94"
] | [
"third_party/fixup_resnet/fixup_resnet_imagenet.py"
] | [
"import torch\nimport torch.nn as nn\nimport numpy as np\n\n\n__all__ = ['FixupResNet', 'fixup_resnet18', 'fixup_resnet34', 'fixup_resnet50', 'fixup_resnet101', 'fixup_resnet152']\n\n\ndef conv3x3(in_planes, out_planes, stride=1):\n \"\"\"3x3 convolution with padding\"\"\"\n return nn.Conv2d(in_planes, out_pl... | [
[
"torch.nn.MaxPool2d",
"torch.ones",
"torch.nn.Linear",
"torch.nn.init.constant_",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.Conv2d",
"torch.nn.Sequential",
"numpy.prod",
"torch.zeros",
"torch.nn.ReLU"
]
] |
Lalala-xnk/Quasi-Attention-ABSA | [
"1eb694e832bbf9687aed719bbcaa657baf0323d3"
] | [
"code/scorer.py"
] | [
"import pandas as pd\nfrom tqdm import tqdm\nfrom model.QACGBERT import *\nfrom util.tokenization import *\nfrom torch.utils.data import DataLoader, TensorDataset\nimport random\nimport warnings\n\nwarnings.filterwarnings('ignore')\n\ncontext_id_map_fiqa = {'stock': 0,\n 'corporate': 1,\n ... | [
[
"pandas.read_csv",
"torch.utils.data.DataLoader",
"torch.utils.data.TensorDataset"
]
] |
bx3/perigee-bandit | [
"73771672abe9321edbb7d455a59bfb072fafa33f"
] | [
"sim/simple_model/loss_functions.py"
] | [
"import torch\nimport sys\n\nCONSTANT = 1e-10\n\nclass ClusterLoss(torch.nn.Module):\n def __init__(self):\n super().__init__()\n self.mse_fn = torch.nn.MSELoss(reduction='sum')\n self.softmax_func = torch.nn.Softmax(dim=0)\n\n # def forward(self, X, H, C, M, T, nM):\n # sim_loss =... | [
[
"torch.nn.MSELoss",
"torch.nn.Softmax",
"torch.tensor",
"torch.norm",
"torch.topk",
"torch.masked_select"
]
] |
instadeepai/EGTA-NMARL | [
"544b2e0e4b5518edefc6819975f9de4573ff434c"
] | [
"egta/envs/tragedy/tests/test_tragedy.py"
] | [
"import torch\n\nfrom ..env import Tragedy\n\ndef test_defaults():\n env = Tragedy(regen_properties={\"type\":\"constant\", \"rate\": 0.075})\n obs = env.reset()\n print(\"start\", obs)\n new_obs, reward, done, _ = env.step(torch.tensor([0,]*4))\n print(\"obs\", new_obs)\n print(\"reward\", reward... | [
[
"torch.tensor"
]
] |
BYUignite/ODT | [
"291d6ff9ae5813aed3135dc22525c9f0fc99282a"
] | [
"post/coldJet/uucl_rxx0.py"
] | [
"#plots U/UcL vs. r/(x-x0)\n#plot file directory/name at end of function definition\n\nfrom __future__ import division\nimport numpy as np\nfrom data_tools import get_inputFileParameter\nimport matplotlib\nmatplotlib.use('PDF') # or Agg (for png), SVG, PS\nimport matplotlib.pyplot as plt\nfrom data_tools im... | [
[
"numpy.empty",
"matplotlib.pyplot.subplots",
"matplotlib.rcParams.update",
"matplotlib.use",
"numpy.loadtxt"
]
] |
mohantyk/srd | [
"4ca6573226edbde80ea3641f50637c53543e1edc"
] | [
"receiver.py"
] | [
"import numpy as np\nfrom scipy import signal\n\nfrom wavegen import cosine_wave\nfrom utilities import power\n\n#-------------------------\n# Helper functions\ndef combine(iterator, num_elems):\n ''' Pairs up a fixed number of elements at a time '''\n window = [iter(iterator)]*num_elems\n for combo in zi... | [
[
"scipy.signal.remez",
"numpy.argmin",
"numpy.correlate",
"scipy.signal.lfilter",
"numpy.array"
]
] |
luke-l7/IML.HUJI | [
"dfa440c0c258c4049a4801c6b240f788b98d4639"
] | [
"IMLearn/learners/regressors/polynomial_fitting.py"
] | [
"from __future__ import annotations\nfrom typing import NoReturn\nfrom . import LinearRegression\nfrom ...base import BaseEstimator\nimport numpy as np\n\n\nclass PolynomialFitting(LinearRegression):\n \"\"\"\n Polynomial Fitting using Least Squares estimation\n \"\"\"\n def __init__(self, k: int) -> Po... | [
[
"numpy.vander"
]
] |
markr-fu-berlin/ParlAI | [
"29743cc7b47c413c2181f68c0b7ef40a6f06a40f"
] | [
"parlai/agents/mlb_vqa/loadstates.py"
] | [
"#!/usr/bin/env python3\n\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree. An additional grant\n# of patent rights can be found in the PATENTS file in the same directory.\n\nimport os\nimport numpy\n\nimport torch\n\nfrom collections... | [
[
"torch.zeros",
"numpy.load",
"torch.from_numpy"
]
] |
jsteggink/trankit | [
"61ef593999bfa29751990d0d4bcf259daed05db4"
] | [
"trankit/adapter_transformers/data/datasets/glue.py"
] | [
"import logging\r\nimport os\r\nimport time\r\nfrom dataclasses import dataclass, field\r\nfrom enum import Enum\r\nfrom typing import List, Optional, Union\r\n\r\nimport torch\r\nfrom filelock import FileLock\r\nfrom torch.utils.data.dataset import Dataset\r\n\r\nfrom ...tokenization_roberta import RobertaTokenize... | [
[
"torch.save",
"torch.load"
]
] |
YeongHyeon/Context-Encoder | [
"30efe975a8970dca0dfa70c09c889efadf7c9c09"
] | [
"source/tf_process.py"
] | [
"import os, inspect, time, math\n\nimport tensorflow as tf\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom random import *\nfrom PIL import Image\nfrom sklearn.decomposition import PCA\n\nPACK_PATH = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))+\"/..\"\n\ndef make_dir(path)... | [
[
"numpy.sum",
"numpy.ones",
"tensorflow.compat.v1.RunOptions",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.title",
"matplotlib.pyplot.hist",
"tensorflo... |
sicara/mentat | [
"fbcfbbe71042740f05e0b1e368bb747c8e0d10ee"
] | [
"tf_explain/utils/image.py"
] | [
"\"\"\" Module for image operations \"\"\"\nimport numpy as np\nimport tensorflow as tf\n\n\ndef apply_grey_patch(image, top_left_x, top_left_y, patch_size):\n \"\"\"\n Replace a part of the image with a grey patch.\n\n Args:\n image (numpy.ndarray): Input image\n top_left_x (int): Top Left X... | [
[
"numpy.array",
"tensorflow.image.per_image_standardization",
"tensorflow.reduce_sum"
]
] |
jiaw-z/FCStereo | [
"f76c3317e0951986b49a3bb794028a8ae067d410"
] | [
"dmb/modeling/stereo/backbones/FC_PSMNet.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom dmb.modeling.stereo.layers.basic_layers import conv_bn, conv_bn_relu, BasicBlock\nfrom dmb.modeling.stereo.layers.basic_layers import conv_in_relu, BasicBlock_IN\n\nclass PSM_Encoder_Instance(nn.Module):\n \"\"\"\n Backbone proposed... | [
[
"torch.no_grad",
"torch.nn.Conv2d",
"torch.nn.Sequential",
"torch.nn.AvgPool2d",
"torch.cat"
]
] |
Talendar/deep_learning_exercises | [
"4c375ac478434d085b4b67b7f631d43da9f8a4a1"
] | [
"3_comparison_mlp_and_rbf/rbf_net/RBFNetwork.py"
] | [
"\"\"\" Implementation of a Radial Basis Function (RBF) Network.\n\n@author Gabriel Nogueira (Talendar)\n@author Marcel Otoboni\n\"\"\"\n\nfrom mlp.multilayer_perceptron import MultilayerPerceptron\nimport numpy as np\nfrom sklearn.cluster import KMeans\n\n\nclass RBFNetwork:\n \"\"\" Implementation of a Radial ... | [
[
"numpy.zeros",
"numpy.exp",
"sklearn.cluster.KMeans",
"numpy.array",
"numpy.linalg.norm"
]
] |
ls-2018/tips | [
"1f5f5195d7181b5dd4616db02166f7f92c97f1cd"
] | [
"AWS/get_data.py"
] | [
"# encoding=utf-8\n\"\"\"\n@Time: 2019/7/8 10:09 \n@Author: liushuo\n@File: get_data.py \n@Desc: \n@Software: PyCharm\n\"\"\"\nimport boto3\nimport pandas as pd\n\n# s3 = boto3.resource('s3')\n# bucket = s3.Bucket('s3-billing')\n# data1 = data2 = None\n# for obj in bucket.objects.all():\n# if '936669166135-aws-... | [
[
"pandas.DataFrame"
]
] |
relacs/rlx2nix | [
"be66f02a78a225b01ee391dd706969c789ce28e8"
] | [
"rlx2nix/converter.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright © 2022, Neuroethology Lab Uni Tuebingen\n#\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted under the terms of the BSD License. See\n# LICENSE file in the root of the Project.\nimport re\nimport os\n... | [
[
"numpy.array",
"numpy.reshape",
"numpy.atleast_2d"
]
] |
LinjianLi/Seq2Seq-PyTorch | [
"671bd10ac1a2620fb4d5ceaacdff9c0e9f4738a2"
] | [
"seq2seq/inputter/embedder.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n################################################################################\n#\n# Copyright (c) 2019 Baidu.com, Inc. All Rights Reserved\n#\n################################################################################\n\"\"\"\nFile: source/encoders/embedder.... | [
[
"torch.nn.init.uniform_",
"torch.tensor"
]
] |
hoelzl/ML-Course | [
"efa7ccb7c6583753675bbcda569d3184d1ca98d2"
] | [
"notebooks/nb074_ensembles.py"
] | [
"# ---\n# jupyter:\n# jupytext:\n# text_representation:\n# extension: .py\n# format_name: percent\n# format_version: '1.3'\n# jupytext_version: 1.13.7\n# kernelspec:\n# display_name: Python 3 (ipykernel)\n# language: python\n# name: python3\n# ---\n\n# %% [markdown] slide... | [
[
"numpy.random.default_rng",
"sklearn.metrics.mean_squared_error",
"sklearn.metrics.mean_absolute_error",
"sklearn.linear_model.LinearRegression",
"numpy.set_printoptions",
"sklearn.tree.DecisionTreeRegressor",
"matplotlib.pyplot.subplots",
"sklearn.datasets.make_regression",
"s... |
MayankR/cmr | [
"6c898a5294954899334d430ec71e0a0692a0d99e"
] | [
"nnutils/loss_utils.py"
] | [
"\"\"\"\nLoss Utils.\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport torch\nfrom . import geom_utils\nimport numpy as np\n\ndef mask_dt_loss(proj_verts, dist_transf):\n \"\"\"\n proj_verts: B x N x 2\n (In normalized coordi... | [
[
"torch.stack",
"torch.nn.L1Loss",
"numpy.log",
"torch.log",
"torch.nn.functional.grid_sample",
"torch.max",
"torch.cat",
"matplotlib.pyplot.figure",
"torch.autograd.Variable",
"torch.gather",
"torch.norm",
"torch.mean",
"torch.unsqueeze",
"numpy.zeros",
... |
jlubo/memory-consolidation-stc | [
"f9934760e12de324360297d7fc7902623169cb4d"
] | [
"analysis/averageWeights.py"
] | [
"######################################################\n### Averages early- and late-phase weight matrices ###\n######################################################\n\n### Copyright 2019-2021 Jannik Luboeinski\n### licensed under Apache-2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n\nimport numpy as np\nfrom... | [
[
"numpy.savetxt",
"numpy.set_printoptions",
"numpy.zeros"
]
] |
tgisaturday/PPAP | [
"bac203b2c98ab9dec7b96ec44fb61cd2d778ab22"
] | [
"image_PPAP/train_ppap.py"
] | [
"import tensorflow as tf\nimport numpy as np\nfrom utils.utils import *\nfrom model import *\nimport sys\nimport os\nimport math\nimport time\nfrom utils.data_helper import data_loader\nfrom model import xavier_init, he_normal_init\n\ndataset = sys.argv[1]\nmodel_name = sys.argv[2]\nprev_iter = int(sys.argv[3])\n\n... | [
[
"tensorflow.summary.scalar",
"tensorflow.reduce_max",
"tensorflow.summary.image",
"numpy.subtract",
"tensorflow.reshape",
"tensorflow.Variable",
"tensorflow.train.global_step",
"numpy.append",
"tensorflow.global_variables_initializer",
"numpy.reshape",
"tensorflow.Graph... |
Chutlhu/python_kickstart | [
"3fa7ee6830fa8c99b7e9887206d7fcda7361d292"
] | [
"src/models/train_model.py"
] | [
"from sklearn import svm\n\ndef train(data, target, C, gamma):\n clf = svm.SVC(C, 'rbf', gamma=gamma)\n clf.fit(data[:90],\n target[:90])\n return clf\n"
] | [
[
"sklearn.svm.SVC"
]
] |
THUDM/cogdl | [
"37359d559ae4f9f2c0c34d851abaa0a0950d120a"
] | [
"cogdl/models/nn/agc.py"
] | [
"import torch\nimport numpy as np\nfrom sklearn.cluster import SpectralClustering\n\nfrom cogdl.utils import spmm\nfrom .. import BaseModel, register_model\n\n\n@register_model(\"agc\")\nclass AGC(BaseModel):\n r\"\"\"The AGC model from the `\"Attributed Graph Clustering via Adaptive Graph Convolution\"\n <ht... | [
[
"numpy.sum",
"numpy.zeros",
"torch.cuda.is_available",
"torch.abs",
"sklearn.cluster.SpectralClustering",
"numpy.mean"
]
] |
zCFD/zutil | [
"aeccc9b3fa337ad68b03d6d21b720b5c1d0d06b8"
] | [
"zutil/__init__.py"
] | [
"\"\"\"\nCopyright (c) 2012-2017, Zenotech Ltd\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n * Redistributions of source code must retain the above copyright\n notice, this list of co... | [
[
"numpy.degrees",
"numpy.zeros_like",
"numpy.interp",
"numpy.dot",
"numpy.zeros",
"numpy.reshape",
"numpy.cross",
"numpy.asarray",
"numpy.ndarray.tolist",
"numpy.arange",
"numpy.max",
"numpy.array",
"numpy.linspace",
"numpy.linalg.norm",
"numpy.mean"
]
... |
allen91wu/Cirq | [
"c33bd9bd6d08650f41b0db5cf69abb3daed72a8f"
] | [
"cirq-core/cirq/optimizers/cphase_to_fsim.py"
] | [
"# pylint: disable=wrong-or-nonexistent-copyright-notice\nfrom typing import Optional, Sequence, Tuple, TYPE_CHECKING\n\nimport numpy as np\n\nfrom cirq import devices, ops, protocols\n\nif TYPE_CHECKING:\n import cirq\n\n\ndef _asinsin(x: float) -> float:\n \"\"\"Computes arcsin(sin(x)) for any x. Return val... | [
[
"numpy.arctan2",
"numpy.cos",
"numpy.exp",
"numpy.tan",
"numpy.sqrt",
"numpy.sin"
]
] |
JamesPerlman/Dain-App | [
"f589abdca8309cfdb6dd106da7c7c4613d152c72"
] | [
"Resblock/BasicBlock.py"
] | [
"import torch.nn as nn\nimport math\nimport torch.utils.model_zoo as model_zoo\nimport torch.nn.init as weight_init\nimport torch\n__all__ = ['MultipleBasicBlock','MultipleBasicBlock_4']\ndef conv3x3(in_planes, out_planes, dilation = 1, stride=1):\n \"3x3 convolution with padding\"\n return nn.Conv2d(in_plane... | [
[
"torch.nn.ReLU",
"torch.nn.Conv2d"
]
] |
qualichat/qualitube | [
"6d1b9b67cc3a6cc41f5d3a6ecfd2d66b3f65c72e"
] | [
"qualitube/video.py"
] | [
"\"\"\"\nMIT License\n\nCopyright (c) 2021 Vítor Mussa\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify,... | [
[
"pandas.DataFrame"
]
] |
MikhailKitikov/DrivingMonitor | [
"0b698d1ba644ce74e1c7d88c3e18a1ef997aabc0"
] | [
"road situation analysis/research/road/state estimation/sdc/linear_movement_model.py"
] | [
"# -*- coding: utf-8 -*-\nimport numpy as np\nfrom .timestamp import Timestamp\nfrom .movement_model_base import MovementModelBase\n\n\nclass LinearMovementModel(MovementModelBase):\n \"\"\"Продвигает автомобиль вперед с его текущей скоростью\"\"\"\n def __init__(self, *args, **kwargs):\n super(LinearM... | [
[
"numpy.sin",
"numpy.zeros_like",
"numpy.cos"
]
] |
ErlingLie/cvat | [
"f053d14955b1e48bf6498466949f4beb1833fe8e"
] | [
"utils/auto_upload/track_on_videos.py"
] | [
"import numpy as np\nimport sys\nimport time\nimport os\nimport json\nimport argparse\n\nfrom sort.sort import Sort\n\ndef track_from_detections(detection_path, output_path, num_classes):\n '''\n Runs tracking on detections and saves result to a json file on form list(class_db)\n Where each class_db is on ... | [
[
"numpy.array"
]
] |
Koomook/nsmc | [
"64fb83769072be3822f663383d0855dd66c92855"
] | [
"code/partition.py"
] | [
"#! /usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport numpy as np; np.random.seed(1234)\nimport pandas as pd\n\n\nntrain = 150000\n\ndata = pd.read_csv('../ratings.txt', sep='\\t', quoting=3)\ndata = pd.DataFrame(np.random.permutation(data))\ntrn, tst = data[:ntrain], data[ntrain:]\n\nheader = 'id document label'.... | [
[
"pandas.read_csv",
"numpy.random.seed",
"numpy.random.permutation"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.