repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
zmic/stylegan2-zmic | [
"49e1ee8f617598dfccfde7815a231b42d4a1e222"
] | [
"dnnlib/tflib/custom_ops.py"
] | [
"# Copyright (c) 2019, NVIDIA Corporation. All rights reserved.\n#\n# This work is made available under the Nvidia Source Code License-NC.\n# To view a copy of this license, visit\n# https://nvlabs.github.io/stylegan2/license.html\n\n\"\"\"TensorFlow custom ops builder.\n\"\"\"\n\nimport os\nimport re\nimport uuid\... | [
[
"tensorflow.sysconfig.get_include",
"tensorflow.load_op_library",
"tensorflow.python.client.device_lib.list_local_devices",
"tensorflow.sysconfig.get_lib"
]
] |
cguccione/q2-feature-table | [
"90b75bb4848371bd640fe7c4baf14bc448d597c9"
] | [
"q2_feature_table/tests/test_rename.py"
] | [
"# ----------------------------------------------------------------------------\n# Copyright (c) 2016-2022, QIIME 2 development team.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file LICENSE, distributed with this software.\n# -------------------------------------... | [
[
"pandas.Index",
"numpy.array",
"pandas.Series"
]
] |
ninikolov/lha | [
"b209684b8709e191e026892c5918b53402024e51"
] | [
"tools/embeddings.py"
] | [
"\"\"\"Code for computing embeddings of text.\"\"\"\n\nimport numpy as np\nfrom lha.preprocessing.clean_text import clean_text\nimport logging\nlogging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)\n\n\nEMBED_MODES = [\"avg\", \"sent2vec\"]\n\n\ndef get_word_vectors(txt, vector... | [
[
"numpy.ones",
"numpy.mean",
"numpy.argsort",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
siddhantsrvstv284/Image-Classifier | [
"35c1ad22e352cd307a5eb9e621ca718a5ccc8604"
] | [
"train_utils.py"
] | [
"\nimport torch\nimport numpy as np\nfrom torch import nn\nfrom torch import optim\nimport torch.nn.functional as F\nfrom PIL import Image\n\nfrom torchvision import datasets, transforms, models\n\ndef load_data(data_dir):\n train_dir = data_dir + '/train'\n valid_dir = data_dir + '/valid'\n test_dir = dat... | [
[
"torch.utils.data.DataLoader"
]
] |
lordfjw/OptimalGradCheckpointing | [
"c6914657c20097bc58a43c5f17e5696170137446"
] | [
"graph.py"
] | [
"from torch import nn as nn\nfrom torch.utils.checkpoint import checkpoint\nfrom queue import Queue\nimport networkx as nx\nimport torch\nimport torch.nn.functional as F\nfrom net.layer import TupleConstruct, TupleIndexing, Mul2, Add2, BasicIdentity, Cat, ListConstruct, Flatten, View, FunctionWrapperV2\nfrom copy i... | [
[
"torch.nn.Sequential",
"torch.nn.ReLU",
"torch.no_grad"
]
] |
akiraenduo/mytutorials | [
"8ede39030b1302c265b10832951ccb4efeb4b200"
] | [
"nbs/utils/utils.py"
] | [
"from __future__ import division\nimport torch\nimport numpy as np\nimport cv2\n\n\ndef nms(bbox, thresh, score=None, limit=None):\n \"\"\"Suppress bounding boxes according to their IoUs and confidence scores.\n Args:\n bbox (array): Bounding boxes to be transformed. The shape is\n :math:`(R... | [
[
"numpy.maximum",
"numpy.minimum",
"torch.max",
"torch.cat",
"numpy.asarray",
"torch.min",
"numpy.ones",
"numpy.random.rand",
"numpy.prod",
"numpy.count_nonzero",
"numpy.random.uniform",
"torch.prod",
"numpy.zeros",
"numpy.where",
"numpy.random.randint"
... |
xx812/CLBlast | [
"fc627d1fa19abad88485dc6d13bd0d3e65e52e7f"
] | [
"src/pyclblast/samples/override_parameters.py"
] | [
"#!/usr/bin/env python\n\n# This file is part of the CLBlast project. The project is licensed under Apache Version 2.0.\n# This file follows the PEP8 Python style guide and uses a max-width of 100 characters per line.\n#\n# Author(s):\n# Cedric Nugteren <www.cedricnugteren.nl>\n\nimport numpy as np\nimport pyopen... | [
[
"numpy.random.rand",
"numpy.empty"
]
] |
liuruoze/HierNet-SC2 | [
"7abfde0088e90416f11922d67c0f09659c7ecf81"
] | [
"mine_from_replay.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\" Transform replay data: \"\n\nimport shutil\nimport csv\nimport os\nimport sys\nimport traceback\nimport random\nimport pickle\nimport enum\nimport copy\n\nfrom absl import flags\nfrom absl import app\nfrom tqdm import tqdm\n\nimport matplotlib.pyplot as plt\n\nf... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.show"
]
] |
eveiramirez/python_class | [
"7a3830cc92dc842b853b243c6b01e06993faa97e"
] | [
"Python2/tareas/tarea_7.py"
] | [
"\"\"\"\n\nNAME\n tarea_7.py\n\nVERSION\n [1.0]\n\nAUTHOR\n Ignacio Emmanuel Ramirez Bernabe\n\nCONTACT\n iramirez@lcg.unam.mx\n\nGITHUB\n https://github.com/eveiramirez/python_class/blob/master/Python2/tareas/tarea_7.py\n\nDESCRIPTION\n Este programa contiene arrays estruc... | [
[
"numpy.array"
]
] |
CVML-Lab-NUS/Complex-gated-recurrent-neural-networks | [
"ea8733a8236be742a29769741cb82de2ce70147a"
] | [
"test/hilbert.py"
] | [
"import numpy as np\nimport tensorflow as tf\nfrom IPython.core.debugger import Tracer\ndebug_here = Tracer()\n\n\n# ## numpy hilbert transform ##\ndef np_hilbert(xr):\n n = xr.shape[0]\n # fft over columns.\n x = np.fft.fft(xr.transpose()).transpose()\n h = np.zeros([n])\n if n > 0 and 2*np.fix(n/... | [
[
"tensorflow.Graph",
"tensorflow.constant",
"tensorflow.transpose",
"tensorflow.stack",
"numpy.stack",
"tensorflow.zeros_like",
"tensorflow.Session",
"tensorflow.Tensor.get_shape",
"tensorflow.variable_scope",
"numpy.fix",
"numpy.array",
"numpy.zeros"
]
] |
sangminwoo/BotoxNet-Trash-Classfication | [
"62b27e23a54d921382c6f0ef3a4e0cbe89fca060"
] | [
"resnet.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.utils.model_zoo as model_zoo\nfrom attention import AttentionModule\n#from cbam import CBAM\nfrom SE import SELayer\nimport matplotlib.pyplot as plt\n\n__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',\n ... | [
[
"torch.nn.Sequential",
"torch.nn.init.constant_",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.AvgPool2d",
"torch.nn.Linear",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.utils.model_zoo.load_url",
"torch.nn.init.kaiming_normal_"
]
] |
cantugba/Github_Tag_Analysis | [
"9ac76872e2977e67176ecd2119e76823f96516aa"
] | [
"apriori.py"
] | [
"#%%\n\nfrom apyori import apriori\nimport csv\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nall_items = set() # Tüm ögeler\nwith open(\"TestDatas/All_Data.csv\") as f:\n reader = csv.reader(f, delimiter=\",\") # her bir tag virgülle ayrıldıgı için burada belirtiyorum\n for i,... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.interactive",
"pandas.DataFrame",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
iceshade000/MMCGAN | [
"addd41a8c19d9e898804bd34cafcb644cd7a87cf"
] | [
"layers.py"
] | [
"''' Layers\n This file contains various layers for the BigGAN models.\n'''\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch.nn import init\nimport torch.optim as optim\nimport torch.nn.functional as F\nfrom torch.nn import Parameter as P\n\nfrom sync_batchnorm import SynchronizedBatchNorm2d ... | [
[
"torch.mean",
"torch.nn.functional.batch_norm",
"torch.ones",
"torch.zeros",
"torch.randn",
"torch.nn.Conv2d.__init__",
"torch.tensor",
"torch.nn.Embedding.__init__",
"torch.matmul",
"torch.rsqrt",
"torch.nn.functional.relu",
"torch.no_grad",
"torch.nn.functiona... |
DimitriPapadopoulos/nmrglue | [
"f47397dcda84854d2136395a9998fe0b57356cbf"
] | [
"nmrglue/analysis/peakpick.py"
] | [
"\"\"\"\nPeak picking routines, lineshape parameter guessing, and related functions.\n\"\"\"\n\nimport numpy as np\nimport scipy.ndimage as ndimage\n\nfrom .analysisbase import ndwindow_index, valid_pt\nfrom .lineshapes1d import gauss, ls_str2class\nfrom .segmentation import find_all_downward, find_all_upward\nfrom... | [
[
"scipy.ndimage.binary_dilation",
"numpy.ma.less",
"scipy.ndimage.minimum_filter",
"numpy.rec.array",
"scipy.ndimage.maximum_filter",
"scipy.ndimage.label",
"numpy.bitwise_and",
"numpy.ma.greater",
"numpy.array",
"numpy.sum",
"numpy.bitwise_or"
]
] |
Ericsong2333/partia-flood-warning-system | [
"545a257f601535c62b3341059fdf2203e06c8e17"
] | [
"floodsystem/analysis.py"
] | [
"import matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\ndef polyfit(dates, levels, p):\r\n return np.poly1d(np.polyfit(np.array(dates)-min(dates), levels,p)),min(dates)\r\n\r\n"
] | [
[
"numpy.array"
]
] |
ebagdasa/pytorch-privacy | [
"767eec77463286ff8ff29e826d7d037aa9b3530e"
] | [
"training.py"
] | [
"import json\nfrom datetime import datetime\nimport argparse\nimport torch\nfrom tensorboardX import SummaryWriter\nfrom helper import Helper\nfrom models.simple import Net, NetTF\nimport torch.nn as nn\nimport torch.optim as optim\nfrom tqdm import tqdm as tqdm\nimport yaml\nimport logging\n\nlogger = logging.getL... | [
[
"torch.optim.lr_scheduler.MultiStepLR",
"torch.mean",
"torch.nn.CrossEntropyLoss",
"torch.max",
"torch.zeros_like",
"torch.cuda.FloatTensor",
"torch.no_grad",
"torch.FloatTensor",
"torch.cuda.is_available"
]
] |
wyb330/multi-speaker-tacotron-tensorflow | [
"4644d0b2bbce5c351a3f8d3af94ff7461b07a6d6"
] | [
"models/rnn_wrappers2.py"
] | [
"import numpy as np\nimport tensorflow as tf\nfrom tensorflow.contrib.rnn import RNNCell\nfrom .modules2 import prenet\n\n\nclass DecoderPrenetWrapper(RNNCell):\n '''Runs RNN inputs through a prenet before sending them to the cell.'''\n\n def __init__(self, cell, is_training):\n super(DecoderPrenetWrap... | [
[
"tensorflow.concat"
]
] |
killvxk/iust_deep_fuzz | [
"32dbf8df3e436f2be7ff0e6129893fb9be4dccdf"
] | [
"test_pycharm.py"
] | [
"\nimport sys\nimport os\nimport random\nimport numpy as np\n\nimport pdf_object_extractor_2\n\nstr1= 'ali'\n# print('Hello')\n\ndef funv(arg1, arg2):\n print(arg1+arg2)\n# funv(2,3)\n\nseq1 = 'x obj yobjzobjcdoj'\n\n# print(seq1.count('obj'))\n\nsample = np.random.multinomial(1, [1/6.]*6)\nprint('sample 10',sam... | [
[
"numpy.random.multinomial"
]
] |
pdn4kd/isochoric-expander | [
"56bfdc3c7efb3a242ff4ae4c556d70bb7f171e5f",
"56bfdc3c7efb3a242ff4ae4c556d70bb7f171e5f"
] | [
"planetsen.py",
"planetsfp.py"
] | [
"'''Attempts to generate configuration files for a given list of stars and their associated planets.'''\nimport numpy as np\nimport datetime\n\n#initializing\nstars = np.genfromtxt(\"planets.csv\", delimiter=',', names=True, dtype=(\"U23\", \"U9\", int, float, float, float, float, float, float, float, float, float,... | [
[
"numpy.arange",
"numpy.genfromtxt"
],
[
"numpy.arange",
"numpy.genfromtxt"
]
] |
hanlint/composer | [
"83d96b7efde533cbc2fff7dd7e0769da2b177807"
] | [
"composer/algorithms/mixup/mixup.py"
] | [
"# Copyright 2021 MosaicML. All Rights Reserved.\n\n\"\"\"Core MixUp classes and functions.\"\"\"\n\nfrom __future__ import annotations\n\nimport logging\nfrom typing import Optional, Tuple\n\nimport numpy as np\nimport torch\n\nfrom composer.core import Algorithm, Event, State\nfrom composer.loggers import Logger\... | [
[
"torch.randperm",
"numpy.random.beta",
"torch.Tensor"
]
] |
Erotemic/utool | [
"9fbbceefed71ab4b38ab806b998fefc9b873f205"
] | [
"utool/Preferences.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nFIXME:\n This class is very old, convoluted, and coupled.\n It really needs to be rewritten efficiently.\n the __setattr__ __getattr__ stuff needs to be redone, and\n DynStruct probably needs to go away.\n\"\"\"\nfrom __future__ import absolute_import, division, print_f... | [
[
"numpy.array"
]
] |
MSiam/segment-any-moving_detectron | [
"ce3a68ef114a2af9e07d7d2240ac3822e150b686"
] | [
"lib/datasets/roidb.py"
] | [
"# Copyright (c) 2017-present, Facebook, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicabl... | [
[
"numpy.sum",
"numpy.argsort",
"numpy.array",
"numpy.histogram",
"numpy.where",
"numpy.zeros"
]
] |
MichaelKonobeev/derl | [
"2b9e1b2e989889a60dac2f9235f549dcec7ee554"
] | [
"derl/env/normalize.py"
] | [
"\"\"\" MuJoCo env wrappers. \"\"\"\n# Adapted from https://github.com/openai/baselines\nimport gym\nimport numpy as np\n\n\nclass RunningMeanVar:\n \"\"\" Computes running mean and variance.\n\n Args:\n eps (float): a small constant used to initialize mean to zero and\n variance to 1.\n shape tuple(in... | [
[
"numpy.square",
"numpy.savez",
"numpy.expand_dims",
"numpy.sqrt",
"numpy.clip",
"numpy.ones",
"numpy.mean",
"numpy.var",
"numpy.load",
"numpy.zeros"
]
] |
Napnel/DRL-Trading | [
"3eacb6462846af18dcfdad4db6971bc29509af3f"
] | [
"summarize_performance.py"
] | [
"import argparse\nimport glob\nimport os\nimport pickle\nfrom pathlib import Path\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nfrom empyrical import annual_return, max_drawdown, sharpe_ratio\n\npd.options.display.float_format = \"{:.2f}\".format\n\nparser = argparse.ArgumentParser()\... | [
[
"pandas.concat",
"pandas.Series",
"matplotlib.pyplot.subplots",
"pandas.DataFrame",
"matplotlib.pyplot.style.context",
"numpy.nanmean",
"matplotlib.pyplot.close"
]
] |
mourga/variational-lstm | [
"61bdcf55c38de9dda29a35e8171d52f4b770af41"
] | [
"locked_dropout.py"
] | [
"import torch.nn as nn\nfrom torch.autograd import Variable\n\n\"\"\"\nCode from https://github.com/salesforce/awd-lstm-lm\npaper: https://arxiv.org/pdf/1708.02182.pdf (see Section 4.2)\n\"\"\"\n\n\nclass LockedDropout(nn.Module):\n \"\"\"\n This function applies dropout to the input tensor x.\n The shape ... | [
[
"torch.autograd.Variable"
]
] |
weilonghu/Active-BERT-NER | [
"4aa345fca7559e7e4a3931561448fcf7fd384307"
] | [
"evaluate.py"
] | [
"\"\"\"Evaluate the model\"\"\"\n\nimport argparse\nimport random\nimport logging\nimport os\n\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nfrom tqdm import trange\n\nfrom sequence_tagger import BertOnlyForSequenceTagging as BertForSequenceTagging\n\nfrom seqeval.metrics import f1_score, clas... | [
[
"torch.nn.functional.log_softmax",
"torch.manual_seed",
"torch.nn.DataParallel",
"torch.no_grad",
"torch.cuda.manual_seed_all",
"torch.cuda.is_available",
"torch.cuda.device_count",
"numpy.where"
]
] |
julian-carpenter/beta-TCVAE | [
"572d9e31993ccce47ef7a072a49c027c9c944e5e"
] | [
"nn/visualize.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom matplotlib.cm import tab10\nfrom matplotlib.axes._axes import _log as matplotlib_axes_logger\n\nmatplotlib_axes_logger.setLevel('ERROR')\n\n\ndef image_grid(img, grid_size=25, ttl=None):\n \"\"\"Return a grid of the images as a mat... | [
[
"matplotlib.pyplot.box",
"numpy.sqrt",
"numpy.linspace",
"numpy.unique",
"numpy.squeeze",
"matplotlib.axes._axes._log.setLevel",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.register_cmap",
"numpy.floor",
"numpy.array",
"matplotlib.pyplot.figure"
]
] |
closerbibi/bv_detection | [
"9bf9e75e26587ddeb9a3d39415408f7b7e5ffd7d"
] | [
"lib/datasets/imdb.py"
] | [
"# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# --------------------------------------------------------\n\nimport os\nimport os.path as osp\nimport PIL\nfrom utils.cy... | [
[
"numpy.hstack",
"numpy.arange",
"numpy.sort",
"numpy.zeros_like",
"numpy.zeros",
"numpy.where",
"numpy.vstack"
]
] |
TimotheeMickus/onmt-selectrans | [
"ae73ba90161d1a1e663e05fe750734849b373713"
] | [
"onmt/modules/multi_headed_attn.py"
] | [
"\"\"\" Multi-Head Attention module \"\"\"\nimport math\nimport torch\nimport torch.nn as nn\n\nfrom onmt.utils.misc import generate_relative_positions_matrix,\\\n relative_matmul\n# from onmt.utils.misc import aeq\n\n\nclass MultiHeadedAttention(nn.Module):\n \"\"\"Multi-Head Attentio... | [
[
"torch.nn.Softmax",
"torch.nn.Dropout",
"torch.nn.Embedding",
"torch.nn.Sigmoid",
"torch.nn.Linear",
"torch.matmul"
]
] |
Ascend/mindspore | [
"1509d3f848e6685660194d9f58646fc73ae0f0f0"
] | [
"tests/st/ops/gpu/test_cholesky_op.py"
] | [
"# Copyright 2020 Huawei Technologies Co., Ltd\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable l... | [
[
"numpy.array",
"scipy.linalg.cholesky",
"numpy.linalg.cholesky"
]
] |
derrowap/DNC-TensorFlow | [
"3e9ad109f8101265ae422ba9c20e058aa70ef7df"
] | [
"src/testing/external_memory_test.py"
] | [
"\"\"\"Tests the ExternalMemory class implementation.\"\"\"\n\nimport tensorflow as tf\nimport unittest\n\nfrom .. dnc import external_memory\nfrom numpy.testing import assert_array_almost_equal\n\n\ndef suite():\n \"\"\"Create testing suite for all tests in this module.\"\"\"\n suite = unittest.TestSuite()\n... | [
[
"tensorflow.Graph",
"tensorflow.constant",
"tensorflow.Session",
"numpy.testing.assert_array_almost_equal"
]
] |
qgallouedec/stable-baselines3-contrib | [
"bec00386d14b505015c54413cd5cd968e6f85c72"
] | [
"sb3_contrib/common/maskable/distributions.py"
] | [
"from abc import ABC, abstractmethod\nfrom typing import List, Optional, Tuple\n\nimport numpy as np\nimport torch as th\nfrom gym import spaces\nfrom stable_baselines3.common.distributions import Distribution\nfrom torch import nn\nfrom torch.distributions import Categorical\nfrom torch.distributions.utils import ... | [
[
"torch.distributions.utils.logits_to_probs",
"torch.tensor",
"torch.nn.Linear",
"torch.as_tensor",
"torch.where",
"torch.unbind",
"torch.argmax"
]
] |
siyuzhou/NRI | [
"9d7d52b3d8fdc150ff91408ac0edce6e0ddda1bc"
] | [
"lstm_baseline.py"
] | [
"from __future__ import division\nfrom __future__ import print_function\n\nimport time\nimport argparse\nimport pickle\nimport os\nimport datetime\n\nimport torch.optim as optim\nfrom torch.optim import lr_scheduler\n\nfrom utils import *\nfrom modules import *\n\nparser = argparse.ArgumentParser()\nparser.add_argu... | [
[
"torch.optim.lr_scheduler.StepLR"
]
] |
Patrickgsheng/GCN_detection_benchmark | [
"ded59653accc61aeeb8e437c2ea9203e4fe9e500"
] | [
"gcn/load_cora_data.py"
] | [
"import json\nimport networkx as nx\nfrom networkx.readwrite import json_graph\nimport numpy as np\nimport scipy.sparse as sp\nimport os\nfrom matplotlib import pyplot as plt\n\ndef sample_mask(idx, l):\n \"\"\"Create mask.\"\"\"\n mask = np.zeros(l)\n mask[idx] = 1\n return np.array(mask, dtype=np.bool... | [
[
"numpy.sort",
"scipy.sparse.csr_matrix",
"numpy.delete",
"numpy.count_nonzero",
"numpy.load",
"numpy.array",
"numpy.zeros",
"numpy.vstack"
]
] |
ZilongJi/HippocampalSWRDynamics | [
"cda23b7fcc8a97222238a26c15d011d3593be39b"
] | [
"replay_structure/read_write.py"
] | [
"import pickle\nimport compress_pickle\nimport os\nimport numpy as np\nimport pandas as pd\nfrom typing import Optional, Union\n\nfrom replay_structure.metadata import (\n DATA_PATH,\n Likelihood_Function,\n RESULTS_PATH,\n DATA_PATH_O2,\n RESULTS_PATH_O2,\n Model_Name,\n Momentum,\n Data_Ty... | [
[
"numpy.append",
"numpy.array",
"pandas.read_csv",
"numpy.full"
]
] |
CnBDM-Su/kdd2021_lsc_sy | [
"7e7be19a3c9751355470f4e60c518d077572281f"
] | [
"examples/lsc/mag240m/year_voting.py"
] | [
"import time\nimport argparse\nfrom tqdm import tqdm\n\nimport torch\nimport numpy as np\nimport pandas as pd\n\nfrom ogb.lsc import MAG240MDataset, MAG240MEvaluator\nfrom root import ROOT\n\nif __name__ == '__main__':\n parser = argparse.ArgumentParser()\n parser.add_argument('--device', type=int, default=0)... | [
[
"numpy.unique",
"torch.manual_seed",
"numpy.concatenate",
"torch.cuda.is_available",
"numpy.load"
]
] |
jokva/windrose | [
"99a2f636a6558a29e7ded63d0d233f25dc7986b6"
] | [
"samples/example_pdf_by.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import print_function\n\n\"\"\"\nExample to create a PDF\nMonthly windrose axe\nOne figure per year\n\"\"\"\n\n\nimport click\n\nimport datetime\n# import time\n\nfrom math import pi\n\n# import matplotlib\nimport matplotlib.pyplot as plt\n# import ... | [
[
"matplotlib.backends.backend_pdf.PdfPages",
"pandas.read_csv",
"pandas.to_datetime",
"pandas.Series",
"numpy.unique",
"matplotlib.pyplot.subplots",
"numpy.cos",
"numpy.sin",
"matplotlib.pyplot.show"
]
] |
cmkumar87/corvid | [
"164113c5e0f0f9c7463f43213f38aeeeb6d5b05e"
] | [
"tests/test_semantic_table/test_semantic_table.py"
] | [
"\"\"\"\n\n\n\"\"\"\n\nimport unittest\n\nfrom numpy.testing import assert_array_equal\n\nfrom corvid.semantic_table.semantic_table import Cell, Table, SemanticTable, \\\n IdentitySemanticTable, LabelCollapseSemanticTable, NormalizationError\n\n\nclass TestSemanticTable(unittest.TestCase):\n def setUp(self):\... | [
[
"numpy.testing.assert_array_equal"
]
] |
rcooke-ast/VICE | [
"762911eb4192c7206ce2ae36b645d120ed889cb7"
] | [
"migration/src/plots/plots/metallicity_gradient.py"
] | [
"r\"\"\"\nThis script produces a 4x2 panel figure comparing the model-predicted radial\nabundance gradients of four models in [O/H], [Fe/H], and [O/Fe].\n\nIn Johnson et al. (2021), this script produces Fig. 9.\n\"\"\"\n\nfrom ..._globals import ZONE_WIDTH\nfrom .. import env\nfrom ..utils import zheights\nfrom .ut... | [
[
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure"
]
] |
Palash-Vishnani/cupy | [
"45b685319ae24db2bc002a97e072ebe630ade0f2"
] | [
"cupyx/scipy/sparse/linalg/_solve.py"
] | [
"import numpy\n\nimport cupy\nfrom cupy import cusparse\nfrom cupy.cuda import cusolver\nfrom cupy.cuda import device\nfrom cupy.cuda import runtime\nfrom cupy.linalg import _util\nfrom cupyx.scipy import sparse\n\nimport warnings\ntry:\n import scipy.sparse\n import scipy.sparse.linalg\n scipy_available =... | [
[
"numpy.promote_types",
"numpy.empty"
]
] |
johannah/robotics-rl-srl | [
"d8c5ed9a43e4506bc5962f3f83e13f535140938b"
] | [
"environments/dataset_generator.py"
] | [
"from __future__ import division, absolute_import, print_function\n\nimport argparse\nimport glob\nimport multiprocessing\nimport os\nimport shutil\nimport time\n\nimport numpy as np\nfrom gym.spaces import prng\nfrom stable_baselines import PPO2\nfrom stable_baselines.common.vec_env import DummyVecEnv, VecNormaliz... | [
[
"numpy.savez",
"numpy.concatenate",
"numpy.load",
"numpy.random.RandomState",
"numpy.sum"
]
] |
malibuber/btc_price_prediction | [
"da508a029a14e316c1be9f941515fa80352abf9f"
] | [
"bitcoin_price_updown/denemeler.py"
] | [
"\r\n############## .63 3 input\r\n######################################\r\n\r\nimport pandas as pd\r\nimport talib\r\n#nltk.download('punkt')\r\n#notclean = pd.read_csv(\"../twitterdata/tweet_t.csv\" , usecols=['dt', 'text' , 'vader' , 'polarity' ,'sensitivity'])\r\ndef signal1_tweet_vol():\r\n notclean = p... | [
[
"pandas.merge",
"pandas.read_csv",
"pandas.to_datetime",
"pandas.concat",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.layers.Dense",
"pandas.Grouper",
"sklearn.model_selection.train_test_split",
"pandas.DataFrame",
"sklearn.metrics.confusion_matrix",
"numpy.... |
cnktysz/qiskit-machine-learning | [
"de370a614bdebc825eae8b47a107545d0a7ad71d"
] | [
"qiskit_machine_learning/connectors/torch_connector.py"
] | [
"# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2021.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modifications or ... | [
[
"torch.einsum",
"torch.Tensor",
"torch.sparse_coo_tensor"
]
] |
daghan/jann | [
"1ce6a74a99313038e5823e760395f9c303ea5b5f"
] | [
"Jann/utils.py"
] | [
"import io\nimport csv\nimport pickle\nimport hashlib\nimport argparse\nimport numpy as np\nfrom tqdm import tqdm\nimport tensorflow as tf\nimport sentencepiece as spm\nimport tensorflow_hub as hub\nfrom annoy import AnnoyIndex\n\n\ndef parse_arguments(arguments=None):\n \"\"\"Parse the command line arguments.\"... | [
[
"tensorflow.Graph",
"tensorflow.device",
"tensorflow.sparse_placeholder",
"tensorflow.placeholder",
"tensorflow.ConfigProto",
"tensorflow.global_variables_initializer",
"tensorflow.logging.info",
"tensorflow.logging.set_verbosity",
"tensorflow.Session",
"numpy.array",
"... |
pyaf/severstal-steel-defect-detection | [
"68a0df4164e84803b6cba78597a079d3736b4e00"
] | [
"ensemble.py"
] | [
"import pdb\nimport os\nimport cv2\nimport time\nfrom glob import glob\nimport torch\nimport scipy\nimport pandas as pd\nimport numpy as np\nfrom tqdm import tqdm\nimport torch.backends.cudnn as cudnn\nfrom torch.utils.data import DataLoader\nfrom argparse import ArgumentParser\nimport albumentations\nfrom albument... | [
[
"torch.set_default_tensor_type",
"pandas.read_csv",
"torch.load",
"numpy.unique",
"sklearn.metrics.cohen_kappa_score",
"scipy.optimize.minimize",
"numpy.mean",
"torch.device",
"numpy.array",
"torch.stack"
]
] |
WChCh/incubator-superset | [
"f59ed026e4b26c80a50f79d726969a21cb37e1e5"
] | [
"superset/views/core.py"
] | [
"# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y... | [
[
"pandas.DataFrame.from_records"
]
] |
sd2001/DANCE2LIVE-Hackerearth | [
"8aeb6b1022054b621a6246753b8421e0402cb0a7"
] | [
"directing.py"
] | [
"import os\r\nimport pandas as pd\r\nimport shutil\r\ndata=pd.read_csv(r'DanceForms/train.csv')\r\ntrain_img_dir='DanceForms/train'\r\n\r\n#print(data.head(10))\r\n\r\n\r\nfor i in os.listdir(train_img_dir):\r\n for img in data['Image']:\r\n if str(i)==str(img):\r\n name=data.loc[data['Image']=... | [
[
"pandas.read_csv"
]
] |
maituoy/BayesianOpt4dftu | [
"cdd80ab1cfc3bc2f5469202f0bce59d30580bac3"
] | [
"BayesOpt4dftu/core.py"
] | [
"import os\nimport json\nimport bayes_opt\nimport subprocess\nimport numpy as np\nimport pandas as pd\nimport pymatgen as mg\nimport xml.etree.ElementTree as ET\n\nfrom ase import Atoms, Atom\nfrom ase.calculators.vasp.vasp import Vasp\nfrom ase.dft.kpoints import *\n\nfrom pymatgen.io.vasp.inputs import Incar, Kpo... | [
[
"numpy.linspace",
"numpy.concatenate",
"numpy.max",
"numpy.mean",
"numpy.where",
"pandas.read_csv",
"matplotlib.pyplot.subplot",
"numpy.argmax",
"matplotlib.gridspec.GridSpec",
"matplotlib.pyplot.subplots_adjust",
"numpy.column_stack",
"matplotlib.pyplot.figure",
... |
AdrienCorenflos/PFlow | [
"ec5f43a5e20d1280260e482ee0f9139fb9d1ca2b"
] | [
"pflow/optimal_transport/recentering.py"
] | [
"import numpy as np\nimport torch\n\nfrom pflow.base import BaseReweight, NoResampling\nfrom pflow.optimal_transport.transportation_plan import Transport\nfrom pflow.resampling.systematic import SystematicResampling\nfrom pflow.utils.fix_for_geomloss_losses import SamplesLoss\n\n\ndef _learn(x, logw, loss, optim_kw... | [
[
"torch.optim.Adam",
"torch.normal",
"numpy.log",
"numpy.linspace",
"torch.full_like"
]
] |
davidwaroquiers/atomate2 | [
"208ace348f8684ea9fde584dd3551d87e380a810"
] | [
"tests/vasp/jobs/test_core.py"
] | [
"from pytest import approx\n\n\ndef test_static_maker(mock_vasp, clean_dir, si_structure):\n from jobflow import run_locally\n\n from atomate2.vasp.jobs.core import StaticMaker\n from atomate2.vasp.schemas.task import TaskDocument\n\n # mapping from job name to directory containing test files\n ref_p... | [
[
"numpy.allclose"
]
] |
MaksTarnavskyi/improve-sequence-tagging | [
"faad3ffb79dba75de46b310c5102738602542ef4"
] | [
"utils/preprocess_lines_for_predict.py"
] | [
"import argparse\nimport os\nimport time\nimport datetime\n\nfrom difflib import SequenceMatcher\nfrom multiprocessing import Pool, cpu_count\n\nimport spacy\nnlp = spacy.load(\"en_core_web_sm\", exclude=['tagger', 'parser', 'ner', 'lemmatizer', 'textcat', 'custom'])\nnlp.add_pipe('sentencizer')\n\nimport numpy as ... | [
[
"numpy.array_split"
]
] |
abc123yuanrui/introtodeeplearning | [
"97d51ef3de77ed74abd6bab4973664d0cc06771e"
] | [
"mitdeeplearning/lab1.py"
] | [
"import os\nimport regex as re\nimport subprocess\nimport urllib\nimport numpy as np\nimport tensorflow as tf\n\nfrom IPython.display import Audio\n\n\ncwd = os.path.dirname(__file__)\n\ndef load_training_data():\n with open(os.path.join(cwd, \"data\", \"irish.abc\"), \"r\") as f:\n text = f.read()\n s... | [
[
"numpy.array",
"tensorflow.shape"
]
] |
kouohhashi/PySyft | [
"7415961b459f1d25f762467b346b7b94c1d6943f"
] | [
"syft/frameworks/torch/tensors/interpreters/precision.py"
] | [
"import torch\nimport warnings\n\nimport syft\nfrom syft.frameworks.torch.nn import nn\nfrom syft.frameworks.torch.tensors.interpreters.additive_shared import AdditiveSharingTensor\nfrom syft.generic.frameworks.hook import hook_args\nfrom syft.generic.frameworks.overload import overloaded\nfrom syft.generic.pointer... | [
[
"torch.sigmoid",
"torch.eye",
"torch.tensor"
]
] |
pigtamer/SNIPER | [
"714e7399bee1e85854b3895ecaef7b143562eab4",
"95a4c773a6e855290504932fb43adeb39f029239"
] | [
"configs/faster/default_configs.py",
"lib/nms/setup_linux.py"
] | [
"# --------------------------------------------------------------\n# SNIPER: Efficient Multi-Scale Training\n# Licensed under The Apache-2.0 License [see LICENSE for details]\n# by Mahyar Najibi\n# --------------------------------------------------------------\n\nimport yaml\nimport numpy as np\nfrom easydict impor... | [
[
"numpy.array"
],
[
"numpy.get_numpy_include",
"numpy.get_include"
]
] |
ankona/Learning-OpenCV-4-Computer-Vision-with-Python-Third-Edition | [
"ee29cfefb4f21ba5acf6222aa69ef1c05c8fc05d"
] | [
"chapter07/non_max_suppression.py"
] | [
"# import the necessary packages\nimport numpy as np\n\n# Malisiewicz et al.\n# Python port by Adrian Rosebrock\n# https://www.pyimagesearch.com/2015/02/16/faster-non-maximum-suppression-python/\ndef non_max_suppression_fast(boxes, overlapThresh):\n # if there are no boxes, return an empty list\n if len(boxes) ==... | [
[
"numpy.argsort",
"numpy.where",
"numpy.maximum",
"numpy.minimum"
]
] |
lukerohrerUCSD/pytorch-wavenet | [
"14e6bd0fb453cc5bb760cfa14aa6256d14b2a40b"
] | [
"wavenet_training.py"
] | [
"import torch\nimport torch.optim as optim\nimport torch.utils.data\nimport time\nfrom datetime import datetime\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom model_logging import Logger\nfrom wavenet_modules import *\n\n\ndef print_last_loss(opt):\n print(\"loss: \", opt.losses[-1])... | [
[
"torch.max",
"torch.eq",
"torch.sum",
"torch.utils.data.DataLoader",
"torch.save"
]
] |
erikgeiser/law | [
"2c8a0d5161ea2b44063a79860f2bebdf66ff67d4"
] | [
"law/contrib/keras/formatter.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"\nKeras target formatters.\n\"\"\"\n\nfrom law.target.formatter import Formatter\nfrom law.target.file import get_path\n\n\nclass ModelFormatter(Formatter):\n\n @classmethod\n def accepts(cls, path):\n return get_path(path).endswith(\".h5\")\n\n @classmethod\n de... | [
[
"tensorflow.keras.models.load_model"
]
] |
thanhhocse96/hcmut-simple-qna-nlp | [
"695578ea41e52a29499b69a82397e39a35b87ed9"
] | [
"utils/corpus_loader.py"
] | [
"import pandas as pd\n\nfrom utils.no_accent_vietnamese import no_accent_vietnamese\n\nfrom baseNLP.corpus import Corpus\nfrom baseNLP.word import Word\n\nimport constants as const\n\ndef category_define(cat_string):\n if cat_string == \"N\":\n return const.WORD_CAT.NOUN\n if cat_string == \"V\":\n ... | [
[
"pandas.read_csv"
]
] |
zhang-free/S_Test | [
"1e8bf7d9227e8371349c7d4009d8778b65875c99"
] | [
"run.py"
] | [
"# -*- coding: utf-8 -*-\n\n# * Copyright (c) 2009-2018. Authors: see NOTICE file.\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/licen... | [
[
"numpy.ones"
]
] |
MattTurnock/PlanetarySciencesMatt | [
"81954d2182d9577bd7327a98c45963ae42968df4"
] | [
"Ass4/Q1.py"
] | [
"from astropy import units as u\nfrom json_to_dict import constants\nimport numpy as np\npi = np.pi\n\n######################################################################################\n\ndef get_K(Ms, Mp, P, i, e=0*u.one, G=constants[\"G\"]):\n top = (2*pi*G)**(1/3) * Mp * np.sin(i)\n bottom = P**(1/3) ... | [
[
"numpy.sqrt",
"numpy.linspace",
"numpy.sin",
"numpy.argmin",
"numpy.array"
]
] |
cwerner/dataflow | [
"15195d020649da82783113b6c24bc529b91af5f3"
] | [
"flow.py"
] | [
"import html\nimport io\nfrom pathlib import Path\nfrom typing import Optional, Union\n\nimport pandas as pd\nimport numpy as np\n\nimport pendulum\nimport prefect\nfrom prefect import Flow, task, unmapped\nfrom prefect.core.parameter import Parameter\nfrom prefect.engine.results import S3Result\nfrom prefect.engin... | [
[
"pandas.read_csv",
"pandas.DataFrame",
"numpy.ones"
]
] |
rdrussotto/xarray | [
"92e4a43544c8e330543fd6e1bc527e4c504a53f5"
] | [
"xarray/tests/test_missing.py"
] | [
"import itertools\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nimport xarray as xr\nfrom xarray.core.missing import (\n NumpyInterpolator,\n ScipyInterpolator,\n SplineInterpolator,\n _get_nan_block_lengths,\n get_clean_interp_index,\n)\nfrom xarray.core.pycompat import dask_array_typ... | [
[
"pandas.isnull",
"pandas.Timestamp",
"numpy.arange",
"numpy.random.shuffle",
"numpy.full",
"numpy.timedelta64",
"numpy.random.randn",
"numpy.testing.assert_allclose",
"pandas.date_range",
"pandas.to_timedelta",
"numpy.array",
"numpy.random.RandomState"
]
] |
ldelzott/ByteTrack | [
"5f8ab49a913a551d041918607a0bd2473602ad39"
] | [
"exps/example/mot/yolox_x_mix_det.py"
] | [
"# encoding: utf-8\nimport os\nimport random\nimport torch\nimport torch.nn as nn\nimport torch.distributed as dist\n\nfrom yolox.exp import Exp as MyExp\nfrom yolox.data import get_yolox_datadir\n\nclass Exp(MyExp):\n def __init__(self):\n super(Exp, self).__init__()\n self.num_classes = 1\n ... | [
[
"torch.utils.data.SequentialSampler",
"torch.utils.data.DataLoader",
"torch.distributed.get_world_size",
"torch.utils.data.distributed.DistributedSampler"
]
] |
danbirks/PredictCode | [
"b4d7010d13706c771ba57437e9c7589e5c94329b"
] | [
"sandbox/debugPHS.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Mar 14 14:37:28 2019\n\n@author: Dustin\n\"\"\"\n\n\n\n# Some fairly standard modules\nimport os, csv, lzma\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib\nimport descartes\nfrom itertools import product\nfrom collections import Counter\nimpo... | [
[
"numpy.random.seed",
"matplotlib.colors.LinearSegmentedColormap",
"numpy.timedelta64",
"numpy.floor",
"numpy.array"
]
] |
miguelsousa/robothon | [
"f2ac88884e04a6e77f79c91e1709ab8c84f46043"
] | [
"GlyphProofer/dist/GlyphProofer.app/Contents/Resources/lib/python2.6/numpy/testing/noseclasses.py"
] | [
"# These classes implement a doctest runner plugin for nose.\n# Because this module imports nose directly, it should not\n# be used except by nosetester.py to avoid a general NumPy\n# dependency on nose.\n\nimport os\nimport doctest\n\nfrom nose.plugins import doctests as npd\nfrom nose.plugins.errorclass import Er... | [
[
"numpy.set_printoptions",
"numpy.get_printoptions"
]
] |
jz1248/fpn.pytorch | [
"5fa7a97d9ff37caf2d37f16faf25b21db11be546"
] | [
"lib/model/rpn/proposal_layer_fpn.py"
] | [
"# --------------------------------------------------------\n# Faster R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick and Sean Bell\n# --------------------------------------------------------\n# -------------------------------------------... | [
[
"numpy.array",
"torch.zeros",
"torch.sort",
"torch.cat"
]
] |
trisongz/tpubar | [
"adf44909a9a1afb30aeb38664200f372a1d7f34d"
] | [
"tpubar/network.py"
] | [
"\nimport os\nimport sys\nimport re\nimport calendar\nimport collections\nimport simdjson as json\nimport time\n\nimport google.auth\n\nfrom datetime import datetime\nfrom google.cloud import monitoring_v3\nfrom google.protobuf.json_format import MessageToJson\nfrom tpubar import env\n\nif env['profiler']:\n fro... | [
[
"tensorflow.python.framework.errors.UnavailableError"
]
] |
ss-sathishsampath/Supervised-Learning-Algorithms | [
"e61df170a9baadbe72e5f268f2033445bc716a4d"
] | [
"executables/Boosting.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n@author : Sathish Sampath(ss.sathishsampath@gmail.com)\n\n\"\"\"\n\n\nimport sklearn.model_selection as ms\nfrom sklearn.ensemble import AdaBoostClassifier\nfrom helpers import dtclf_pruned\nimport pandas as pd\nfrom helpers import basicResults,makeTimingCurve,iterationLC\nfrom sk... | [
[
"sklearn.preprocessing.StandardScaler",
"pandas.read_hdf",
"sklearn.ensemble.AdaBoostClassifier",
"sklearn.model_selection.train_test_split"
]
] |
Grade-pan/python-base | [
"bcb69052a6e9299dee45b91468e30b1305d82db3"
] | [
"Numpy/test5.py"
] | [
"import numpy as np\n\nprint(np.log(np.PZERO))\n# 负零是有限数。\nprint(np.NZERO)\nprint(np.PZERO)\n# 欧拉常数\nprint(np.e)\nprint(6 / 5)\n"
] | [
[
"numpy.log"
]
] |
oucxlw/ConferencingSpeech2021 | [
"617df8116c0510b2addadb1de374d7b50eea4f2b"
] | [
"simulation/mix_wav.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\" simulate train and dev set, use multiprocessing.Pool to accelerate the pipline;\nit's not totally random\n@author: nwpuykjv@163.com\n arrowhyx@foxmail.com\n\"\"\"\n\n\nimport numpy as np\nimport math\nimport soundfile as sf\nimport scipy.signal as sps\... | [
[
"numpy.maximum",
"numpy.abs",
"numpy.pad",
"numpy.finfo",
"numpy.max",
"numpy.argmax",
"numpy.mean",
"numpy.transpose",
"numpy.random.uniform",
"numpy.zeros",
"scipy.signal.oaconvolve"
]
] |
tonygrey/klsh | [
"77dbcd2bdd3f04e4d9add136201afda31c964580"
] | [
"klsh/kernels.py"
] | [
"import numpy as np\nfrom scipy import fftpack, signal\n\n__all__ = [\"crosscorr_kernel\", \"crosscorr_similarity\"]\n\n\ndef pairwise_correlate_slow(X, Y, mode='full'):\n X, Y = map(np.atleast_2d, (X, Y))\n assert X.ndim == 2\n assert Y.ndim == 2\n\n Y = Y[:, ::-1]\n\n first_result = signal.fftconvo... | [
[
"numpy.log2",
"numpy.sqrt",
"scipy.signal.fftconvolve",
"numpy.asarray",
"numpy.issubdtype",
"numpy.fft.fftn",
"numpy.fft.ifftn",
"numpy.fft.irfftn",
"numpy.exp",
"numpy.zeros",
"numpy.fft.rfftn"
]
] |
hotpxl/nebuchadnezzar | [
"b26e0f19b9fdfeb8baa094e0f5ee2526cefb6409"
] | [
"stats/data.py"
] | [
"import json\nimport os.path\nimport numpy as np\n\np = os.path.dirname(os.path.realpath(__file__))\n\ndef sse_indices():\n with open(os.path.join(p, '../data/sse_50.json')) as f:\n sse_indices = json.load(f)\n return np.asarray(sse_indices)\n\ndef get_merged(index, *fields):\n with open(os.path.joi... | [
[
"numpy.asarray"
]
] |
THasthika/pytorch-lightning | [
"c502e47abf115fb8c7b82bc537f72481441ed8bb"
] | [
"pytorch_lightning/utilities/imports.py"
] | [
"# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law... | [
[
"torch.profiler.kineto_available"
]
] |
WozzyaQ/tkinter-budget-app | [
"ec62ff9de03bc7d85958b2d9a3b3934c8b13c44a"
] | [
"main.py"
] | [
"import datetime\nimport tkinter as tk\nfrom tkinter import messagebox\nfrom tkinter import ttk\nfrom tkinter.font import Font\n\nimport matplotlib\nfrom matplotlib import pyplot as plt\nfrom matplotlib.backends.backend_tkagg import FigureCanvasTkAgg\nimport numpy as np\nimport budget\n\nmatplotlib.use(\"TkAgg\")\n... | [
[
"matplotlib.use",
"matplotlib.pyplot.subplots",
"matplotlib.backends.backend_tkagg.FigureCanvasTkAgg"
]
] |
mleila/surname_predictor | [
"76ad33bd8c5a0bf3e10c6f7808d5deb2b7e75558"
] | [
"surnames/data.py"
] | [
"import torch\nimport pandas as pd\n\nfrom surnames.vectorizers import SurnameClassificationVectorizer\nfrom surnames.constants import (\n TRAIN,\n VALID,\n TEST,\n SURNAME,\n ORIGIN,\n X_DATA,\n Y_TARGET\n )\n\n\nclass SurnameClassificationDataset(torch.utils.data.Dataset):\n\n def __ini... | [
[
"torch.utils.data.DataLoader"
]
] |
MAADDS/Skyless-YOLOP | [
"44b948522d93273c988f6fa92a5c29fa14461336"
] | [
"skydetection/sky_detector/detector.py"
] | [
"import cv2\nfrom statistics import median\nfrom scipy.signal import medfilt\nfrom scipy import ndimage\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\n\ndef cal_skyline(mask):\n h, w = mask.shape\n greatest = 0\n zerolist = []\n zerolist2 = []\n print(w) \n for i in range(w):\n ... | [
[
"matplotlib.pyplot.imshow",
"scipy.signal.medfilt",
"numpy.mean",
"matplotlib.pyplot.show",
"numpy.where"
]
] |
mbeacom/superset | [
"8dfe2b70b2ee85c8cfe79a7a37eefaa790158bf1"
] | [
"superset/connectors/sqla/models.py"
] | [
"from datetime import datetime\nimport logging\nimport sqlparse\nfrom past.builtins import basestring\n\nimport pandas as pd\n\nfrom sqlalchemy import (\n Column, Integer, String, ForeignKey, Text, Boolean,\n DateTime,\n)\nimport sqlalchemy as sa\nfrom sqlalchemy import asc, and_, desc, select\nfrom sqlalchem... | [
[
"pandas.read_sql_query",
"pandas.DataFrame"
]
] |
JarvisDevon/Restricted_Boltzmann_Machine | [
"b712778bb4dc7a9858746bac32b418315f053b56"
] | [
"RBM_movie.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\nimport pickle\nimport gzip\n\nnp.set_printoptions(threshold=np.inf)\n\nf = open('data/ACML_Movies.csv', 'r')\nmovie_strngs = f.read()\nmovie_strngs = movie_strngs.split('\\n')\nmovie_strngs = movie_strngs[1:]\nmovie_strngs = movie_str... | [
[
"numpy.dot",
"matplotlib.pyplot.imshow",
"numpy.set_printoptions",
"numpy.exp",
"numpy.max",
"numpy.copy",
"matplotlib.pyplot.axis",
"numpy.savetxt",
"numpy.random.uniform",
"numpy.array",
"numpy.zeros",
"matplotlib.pyplot.figure"
]
] |
bouillealpha/gluon-ts | [
"f155dd3ca12894a08dbd06094f0673305551c128"
] | [
"src/gluonts/mx/trainer/_base.py"
] | [
"# Copyright 2018 Amazon.com, Inc. or its affiliates. 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# A copy of the License is located at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# or ... | [
[
"numpy.prod",
"numpy.isfinite"
]
] |
alisonrib17/ACM-Paper | [
"5fb1a8240825e58ed524c880f11152eed7904c3b"
] | [
"Spanish/TaskB/svm.py"
] | [
"# -*- coding: utf-8 -*-\n\n#@author: alison\n\nimport re\nimport string\nimport pickle\nimport numpy as np\nimport pandas as pd\nfrom nltk.corpus import stopwords\nfrom sklearn.svm import LinearSVC\nfrom nltk.stem import PorterStemmer, SnowballStemmer\nfrom nltk.tokenize import TweetTokenizer\nfrom sklearn.feature... | [
[
"sklearn.feature_extraction.text.CountVectorizer",
"pandas.read_csv",
"sklearn.svm.LinearSVC"
]
] |
tamnguyenvan/mobilenetv3-face | [
"7f3d95b500d6523d0077e3f6ea905499e7915417"
] | [
"engine.py"
] | [
"import math\nimport sys\nimport time\n\nimport torch\nimport torchvision.models.detection.mask_rcnn\nimport utils\nfrom coco_eval import CocoEvaluator\nfrom coco_utils import get_coco_api_from_dataset\n\n\ndef train_one_epoch(model, optimizer, data_loader, device, epoch, print_freq, scaler=None):\n model.train(... | [
[
"torch.cuda.synchronize",
"torch.optim.lr_scheduler.LinearLR",
"torch.inference_mode",
"torch.cuda.amp.autocast",
"torch.set_num_threads",
"torch.cuda.is_available",
"torch.device",
"torch.get_num_threads"
]
] |
wzy2009520/vnpy | [
"c7049a4ae910b74e1ebd89bdcafc38076951cee5"
] | [
"vn.trader/ctaAlgo/strategyAtrRsi.py"
] | [
"# encoding: UTF-8\n\n\"\"\"\n一个ATR-RSI指标结合的交易策略,适合用在股指的1分钟和5分钟线上。\n\n注意事项:\n1. 作者不对交易盈利做任何保证,策略代码仅供参考\n2. 本策略需要用到talib,没有安装的用户请先参考www.vnpy.org上的教程安装\n3. 将IF0000_1min.csv用ctaHistoryData.py导入MongoDB后,直接运行本文件即可回测策略\n\n\"\"\"\n\n\nfrom ctaBase import *\nfrom ctaTemplate import CtaTemplate\n\nimport talib\nimport numpy... | [
[
"numpy.zeros"
]
] |
takuseno/nnabla-ext-cuda | [
"f64c1bcc04a26efcac785ca72dc81120b99329a8"
] | [
"python/test/cuda/test_large_blocks.py"
] | [
"# Copyright (c) 2017 Sony 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 requir... | [
[
"numpy.zeros"
]
] |
sagarchotalia/astropy | [
"b49ad06b4de9577648a55d499d914e08baeef2c6"
] | [
"astropy/modeling/core.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\n\"\"\"\nThis module defines base classes for all models. The base class of all\nmodels is `~astropy.modeling.Model`. `~astropy.modeling.FittableModel` is\nthe base class for all fittable models. Fittable models can be linear or\nnonlinear in a reg... | [
[
"numpy.rollaxis",
"numpy.diag",
"numpy.sqrt",
"numpy.ndim",
"numpy.ceil",
"numpy.size",
"numpy.asanyarray",
"numpy.shape",
"numpy.any",
"numpy.mean",
"numpy.array",
"numpy.zeros",
"numpy.empty"
]
] |
AlexRookie/neurocluster | [
"685e4c2930e7af68b09a5ae8ed7008936d6e49d4"
] | [
"MATLAB_path_generation/network_lvq.py"
] | [
"import sys\nsys.path.append(\"./libraries/Modified-SOM\")\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom detection.competitive_learning import SOM, CombineSomLvq\n\nfrom sklearn.preprocessing import LabelEncoder\nfrom sklearn.metrics import confusion_matrix, accuracy_score\n\nclass Network:\n def ... | [
[
"numpy.asarray",
"sklearn.preprocessing.LabelEncoder",
"numpy.random.permutation",
"numpy.ascontiguousarray"
]
] |
Femi123p/Cluster-py | [
"7af0ef5a4c06a2641cec9f0d916987eca678c619"
] | [
"cluster_gmm.py"
] | [
"from __future__ import division, print_function\r\nfrom elasticsearch import Elasticsearch\r\nimport numpy as np\r\nimport json\r\nfrom sklearn.feature_extraction.text import CountVectorizer\r\nfrom sklearn.mixture import GaussianMixture\r\n\r\n\r\n\r\n\r\n\r\nes=Elasticsearch() #elasticsea... | [
[
"sklearn.feature_extraction.text.CountVectorizer",
"sklearn.mixture.GaussianMixture"
]
] |
viniciusguigo/FastMOT | [
"9f544c89e5d3e6dca711abee90ac604ed661397f"
] | [
"fastmot/models/calibrator.py"
] | [
"import os\nimport numpy as np\nimport pycuda.driver as cuda\nimport pycuda.autoinit\nimport tensorrt as trt\nimport cv2\n\n\nclass SSDEntropyCalibrator(trt.IInt8EntropyCalibrator2):\n def __init__(self, model_shape, data_dir, cache_file):\n # Whenever you specify a custom constructor for a TensorRT class... | [
[
"numpy.random.choice"
]
] |
julio-cmdr/rljax | [
"cbca4638deb6d4e960e71a862573129ba4c5ea79"
] | [
"rljax/algorithm/base_class/q_learning.py"
] | [
"import os\nfrom abc import abstractmethod\n\nimport numpy as np\n\nfrom rljax.algorithm.base_class.base_algoirithm import OffPolicyAlgorithm\nfrom rljax.util import fake_state, load_params, save_params\n\n\nclass QLearning(OffPolicyAlgorithm):\n \"\"\"\n Base class for discrete Q-learning algorithms.\n \"... | [
[
"numpy.array",
"numpy.random.rand",
"numpy.clip"
]
] |
ngchc/deepBoosting | [
"13b3515c16f0d9a0a92b990dfb5eef09ec1a7298"
] | [
"train/model.py"
] | [
"\"\"\"\nThe core Boosting Network Model\n\"\"\"\n\nimport tensorflow as tf\nimport numpy as np\nfrom ops import *\n\n\nclass Net(object):\n\tdef __init__(self, data, label, wl):\n\t\t\"\"\"\n\t\tArgs: [0, 1]\n\t\t data : [batch_size, height, width, channels] float32\n\t\t label: [batch_size, height, width, chann... | [
[
"tensorflow.transpose",
"tensorflow.concat",
"tensorflow.get_collection",
"tensorflow.summary.image",
"tensorflow.truncated_normal_initializer",
"tensorflow.nn.l2_loss",
"tensorflow.name_scope",
"tensorflow.add_to_collection"
]
] |
ojaswa-privado/ReAgent | [
"e990e66f69369cbe89212e334191180716c9bf4e"
] | [
"reagent/model_utils/seq2slate_utils.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\nimport copy\nimport logging\nimport math\nfrom enum import Enum\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nlogger = logging.getLogger(__name__)\n\nPADDING_SYMBOL = 0\nDECODER_START_SYMBO... | [
[
"torch.matmul",
"torch.nn.functional.softmax",
"torch.ones",
"torch.zeros"
]
] |
tzongshiuan/tensorflow_introduction_demo | [
"ef31ac2752f09db727c4ca6de76d216f6ca23504"
] | [
"get_file_2.py"
] | [
"import tensorflow as tf\nimport random as r\nimport cv2\nimport numpy as np\nimport skimage.io as io\nfrom matplotlib import pyplot as plt\nimport os\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'\n\n\ndef get_file(file_dir):\n # The images in each subfolder\n global fileNames\n images = []\n # The subfolde... | [
[
"tensorflow.train.Example",
"numpy.arange",
"tensorflow.python_io.TFRecordWriter",
"numpy.append",
"numpy.random.permutation",
"tensorflow.train.BytesList",
"numpy.array",
"tensorflow.train.Int64List"
]
] |
knok/transformers | [
"23a2cea8cb95864ddb7e7e80e126e4f083640882"
] | [
"src/transformers/modeling_distilbert.py"
] | [
"# coding=utf-8\n# Copyright 2019-present, the HuggingFace Inc. team, The Google AI Language Team and Facebook, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http:/... | [
[
"torch.nn.Softmax",
"torch.nn.Dropout",
"torch.nn.CrossEntropyLoss",
"torch.ones",
"numpy.power",
"numpy.cos",
"torch.nn.Embedding",
"torch.nn.LayerNorm",
"numpy.sin",
"torch.nn.Linear",
"torch.matmul",
"torch.arange",
"torch.nn.ReLU",
"torch.nn.MSELoss"
]... |
rouzbeh-afrasiabi/BertFineTuning | [
"848f24920850d6f0be4c4aee7de96e2332404e8b"
] | [
"BertFineTuning/duplicate_detection.py"
] | [
"from BertFineTuning.utils import *\nfrom BertFineTuning.model_config import*\n\nimport os\nimport sys\nimport numpy as np\nimport pandas as pd\nfrom collections import OrderedDict\nfrom pycm import *\n\nimport torch\nif(torch.cuda.is_available()):\n torch.cuda.current_device()\nfrom torch import nn\nfrom torch.... | [
[
"torch.nn.BatchNorm1d",
"torch.max",
"numpy.random.seed",
"torch.cuda.current_device",
"torch.load",
"torch.manual_seed",
"torch.nn.PReLU",
"torch.cuda.empty_cache",
"torch.nn.Linear",
"torch.no_grad",
"numpy.mean",
"torch.cuda.manual_seed_all",
"torch.cuda.is_a... |
muradtuk/UnifiedFramework | [
"07dd7cf50552fa87fd875818eead03a2fe9e5073"
] | [
"RegressionProblems.py"
] | [
"import numpy as np\nimport scipy as sp\nimport cvxpy as cp\nimport time\nfrom MainProgram import Utils\nimport PointSet\n\n\nclass RegressionProblem(object):\n def __init__(self, p_norm=2):\n assert(p_norm < 0, 'p_norm must be a positive scalar!')\n self.p_norm = p_norm\n self.coef_ = None\... | [
[
"numpy.hstack",
"numpy.dot",
"numpy.linalg.norm",
"scipy.optimize.minimize",
"scipy.optimize.approx_fprime"
]
] |
hao-qiang/pix2pix_keras | [
"70a008e1d7da181c536012e6f005bfb3d8d62084"
] | [
"data_utils.py"
] | [
"import numpy as np\nimport cv2\nimport scipy.misc\n\n\ndef normalization(img):\n # rescale input img within [-1,1]\n return img / 127.5 - 1\n\n\ndef inverse_normalization(img):\n # rescale output img within [0,1], then saving by 'scipy.misc.imsave'\n return (img + 1.) / 2.\n\n\ndef read_one_img(img_dir... | [
[
"numpy.concatenate",
"numpy.zeros",
"numpy.random.choice"
]
] |
AlexanderSouthan/pyAnalytics | [
"18038b2cda75a99280d3cdd68d61e601eefa0fe0"
] | [
"src/pyAnalytics/raman_data.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nFor inspection of confocal LSM and Raman datasets. \n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nimport glob\nimport imageio\nimport spc\nfrom tqdm import tqdm\n\n# import own modules#############################\nfrom .spectroscopy_data import spectroscopy_data\nfrom .confo... | [
[
"numpy.fromfile",
"pandas.MultiIndex.from_frame",
"pandas.Series",
"numpy.arange",
"numpy.around",
"numpy.shape",
"numpy.repeat",
"numpy.zeros"
]
] |
tcq1/programmingfordatascience | [
"20a6a251bd2309b0b07d9779fd4b5b1f1c4ee540"
] | [
"04_regression/regression.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\n\nfrom scipy.optimize import minimize\nfrom timeit import default_timer as timer\n\n\nlam1 = None\nlam2 = None\nlam3 = None\n\n\ndef get_random_start_params(min_val, max_val):\n \"\"\" Generates random start values for x and y\n \"\"\"\n return np.array... | [
[
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.show",
"numpy.sum",
"numpy.loadtxt",
"numpy.random.randint"
]
] |
JJuOn/Few-shot_Class_Incremental_Learning | [
"a2178051a6fefcd73b60f5e4236116bf828a801c"
] | [
"util.py"
] | [
"import torch\nimport torch.nn as nn\nimport numpy as np\nimport pickle\nimport os\nimport argparse\n\n\n\nclass LabelSmoothing(nn.Module):\n \"\"\"\n NLL loss with label smoothing.\n \"\"\"\n def __init__(self, smoothing=0.0):\n \"\"\"\n Constructor for the LabelSmoothing module.\n ... | [
[
"torch.mean",
"torch.nn.functional.log_softmax",
"numpy.asarray",
"torch.nn.BCEWithLogitsLoss",
"torch.no_grad"
]
] |
mayi140611/mayiexamples | [
"221cf9e8916d81198df7355894ec59dc334ae0af"
] | [
"models_deep_learning/AutodiffEngine/autodiff_test.py"
] | [
"import autodiff as ad\nimport numpy as np\n\n\ndef test_identity():\n x2 = ad.Variable(name=\"x2\")\n y = x2\n\n grad_x2, = ad.gradients(y, [x2])\n\n executor = ad.Executor([y, grad_x2])\n x2_val = 2 * np.ones(3)\n y_val, grad_x2_val = executor.run(feed_dict={x2: x2_val})\n\n assert isinstance... | [
[
"numpy.log",
"numpy.random.random",
"numpy.ones_like",
"numpy.array_equal",
"numpy.abs",
"numpy.matmul",
"numpy.ones",
"numpy.transpose",
"numpy.exp",
"numpy.array",
"numpy.zeros",
"numpy.sum"
]
] |
ashaazami/keras-onnx | [
"4a220193a3e2d6eb3bcb76dcf3be39a4b1f84f09"
] | [
"keras2onnx/_builtin.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##########################################################################... | [
[
"numpy.arange",
"numpy.dtype",
"numpy.iinfo",
"numpy.count_nonzero",
"numpy.isscalar",
"numpy.array"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.