repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
amirabbasasadi/taug | [
"d729ef59a67723eb084e314b7339bb2cd317c6b8"
] | [
"tests/test_augmentation.py"
] | [
"from augmentts.augmenters.vae import LSTMVAE, VAEAugmenter\nimport numpy as np\n\ndata = np.random.normal(size=(40, 1, 100))\n\nvae = LSTMVAE(series_len=100)\naugmenter = VAEAugmenter(vae)\naugmenter.fit(data, epochs=50, batch_size=32)\n\nsamples = augmenter.sample(n=10)\nprint(samples.shape)"
] | [
[
"numpy.random.normal"
]
] |
CS-UIT-AI-CLUB/CRAFT | [
"0f5b2bfbc4e41745d41b6ce02dc3086da22cea41"
] | [
"file_utils.py"
] | [
"# -*- coding: utf-8 -*-\nimport os\nimport numpy as np\nimport cv2\nimport imgproc\n\n\n# borrowed from https://github.com/lengstrom/fast-style-transfer/blob/master/src/utils.py\ndef get_files(img_dir):\n imgs, masks, xmls = list_files(img_dir)\n return imgs, masks, xmls\n\ndef list_files(in_path):\n img_... | [
[
"numpy.array"
]
] |
Kjeanclaude/tensorflow | [
"81b25af56ee95e61d271846cbbcb695faa21b37e"
] | [
"tensorflow/python/framework/ops.py"
] | [
"# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.core.framework.tensor_shape_pb2.TensorShapeProto",
"tensorflow.python.framework.tensor_shape.unknown_shape",
"tensorflow.python.framework.dtypes.as_dtype",
"tensorflow.python.framework.op_def_registry.get_registered_ops",
"tensorflow.core.framework.versions_pb2.VersionDef",
"te... |
gkfthddk/keras | [
"46d96c65d69c39df298800336bbb4d867a2561fb",
"46d96c65d69c39df298800336bbb4d867a2561fb",
"46d96c65d69c39df298800336bbb4d867a2561fb",
"46d96c65d69c39df298800336bbb4d867a2561fb"
] | [
"drrun2.py",
"drrun4.py",
"ensrun.py",
"getsaver.py"
] | [
"#!/usr/bin/python2.7\n'''Trains a simple convnet on the MNIST dataset.\n\nGets to 99.25% test accuracy after 12 epochs\n(there is still a lot of margin for parameter tuning).\n16 seconds per epoch on a GRID K520 GPU.\n'''\n#python jetdual.py --save dualn2200 --network nnn2 --pt 200 --epoch 50 --stride 2 --gpu 3\n#... | [
[
"numpy.concatenate",
"sklearn.metrics.roc_auc_score",
"sklearn.metrics.roc_curve"
],
[
"numpy.concatenate",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.tick_pa... |
xlthu/pytorch-models | [
"3a1fdd33f94a4ca038f2b10d3a6b0b73b079a1ea"
] | [
"seq2seq.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torchseq.utils.functional import softmax_mask\n\nclass Encoder(nn.Module):\n def __init__(self, n_tokens, embed_dim, hidden_dim, n_layers, dropout):\n super(Encoder, self).__init__()\n self.n_tokens = n_tokens\n self.embed_dim = embed_dim\n s... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.mul",
"torch.nn.GRU",
"torch.nn.init.constant_",
"torch.nn.init.orthogonal_",
"torch.nn.Tanh",
"torch.nn.init.normal_",
"torch.concat",
"torch.nn.init.uniform_",
"torch.empty",
"torch.nn.Embedding",
"torch.sum"
]
] |
ben-dichter-consulting/ndx-experimenters | [
"9da4cc0ee0df8389f0f1ec6876ae6179dd147b27"
] | [
"src/pynwb/ndx_experimenters/test.py"
] | [
"from ndx_experimenters import NWBFile\n\nfrom pynwb import NWBHDF5IO\nfrom datetime import datetime\n\nfrom numpy.testing import assert_array_equal\n\nsession_start_time = datetime.now().astimezone()\nnwb = NWBFile('session_description', 'identifier', session_start_time, experimenters=['a', 'b'])\n\nwith NWBHDF5IO... | [
[
"numpy.testing.assert_array_equal"
]
] |
btwardow/dml4rec | [
"3bc2ca4d85ef9f8d94f0ee0a07d1d67cec671e66"
] | [
"experiments/prepare_rsc15_dataset.py"
] | [
"import os\n\nimport numpy as np\nimport pandas as pd\nimport datetime as dt\nimport rec.model as model\nimport gzip\n\nfrom rec.dataset.dataset import Dataset\n\nPATH_TO_ORIGINAL_DATA = 'data/rsc15/raw/'\nPATH_TO_PROCESSED_DATA = 'data/dataset/rsc15/'\nsessions_jsonl = PATH_TO_PROCESSED_DATA + 'sessions.jsonl'\nse... | [
[
"numpy.in1d",
"pandas.read_csv"
]
] |
jinyiY/desitarget | [
"546a85a3feb9754a2406ebfb2b9890514f47b3bf"
] | [
"py/desitarget/mock/sky.py"
] | [
"import numpy as np\nimport healpy as hp\n\ndef _random_theta_phi(nside, pix):\n theta, phi = hp.pix2ang(nside, pix, nest=True)\n dpix = np.sqrt(hp.nside2pixarea(nside))\n theta += np.random.uniform(-dpix/2, dpix/2, size=len(theta))\n phi += np.random.uniform(-dpix/2, dpix/2, size=len(phi)) * np.cos(np.... | [
[
"numpy.where",
"numpy.in1d",
"numpy.cos",
"numpy.degrees"
]
] |
haje01/ray | [
"d20696300e2c4aad90c0deece2b3af7e70fc6056"
] | [
"python/ray/tests/test_failure.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport json\nimport os\nimport pyarrow.plasma as plasma\nimport pytest\nimport sys\nimport tempfile\nimport threading\nimport time\n\nimport numpy as np\nimport redis\n\nimport ray\nimport ray.ray_cons... | [
[
"numpy.copy",
"numpy.zeros"
]
] |
rkkirpane/Best-Projects-ga-learner-dsmp-repo | [
"b9d52a29eff734696ae269cafc8407d2121b40b0"
] | [
"pandas-project/code.py"
] | [
"# --------------\n# Import packages\nimport numpy as np\nimport pandas as pd\nfrom scipy.stats import mode \npath\nbank=pd.read_csv(path)\nprint(bank.head())\n\n# code starts here\ncategorical_var=bank.select_dtypes(include = 'object')\nprint(categorical_var)\nnumerical_var=bank.select_dtypes(include = 'number')\n... | [
[
"pandas.read_csv"
]
] |
fwtan/models | [
"d0e9833d33a7a699c80a60fd1d342eb2e923d755",
"d0e9833d33a7a699c80a60fd1d342eb2e923d755",
"f82ade4777a5e91adac4438cf4a59172d026670b"
] | [
"research/delf/delf/python/detect_to_retrieve/extract_gldv1_boxes_and_features.py",
"research/delf/delf/python/detect_to_retrieve/perform_retrieval_delg_global.py",
"orbit/utils/common.py"
] | [
"# Copyright 2017 The TensorFlow Authors All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requi... | [
[
"tensorflow.python.platform.app.run"
],
[
"tensorflow.io.gfile.GFile",
"numpy.zeros",
"tensorflow.python.platform.app.run",
"tensorflow.io.gfile.makedirs",
"tensorflow.io.gfile.exists",
"numpy.argsort"
],
[
"tensorflow.Variable",
"tensorflow.is_tensor",
"tensorflow.... |
terrenceedmonds/transformers | [
"1c19b423bf274a465f95725a79819bf82f71329e"
] | [
"src/transformers/models/dpr/modeling_tf_dpr.py"
] | [
"# coding=utf-8\n# Copyright 2018 DPR Authors, The Hugging Face 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# Unle... | [
[
"tensorflow.TensorSpec",
"tensorflow.convert_to_tensor",
"tensorflow.zeros",
"tensorflow.ones",
"tensorflow.reshape",
"tensorflow.squeeze",
"tensorflow.split"
]
] |
jrober84/parsityper | [
"4e3dd97c6993f829aeae09d3305c0a5b47ab5f4f"
] | [
"parsityper/tuner.py"
] | [
"#!/usr/bin/python\n\nfrom argparse import (ArgumentParser)\nimport logging, os, re, datetime, time\nimport pandas as pd\nfrom parsityper.helpers import init_console_logger,read_fasta, read_samples\nimport multiprocessing as mp\nfrom multiprocessing import Pool\nfrom parsityper.scheme import parseScheme, constructS... | [
[
"pandas.DataFrame.from_dict",
"pandas.read_csv"
]
] |
lgbouma/cdips | [
"187e15e620cd44160372dbfa9da989d38722c3e5"
] | [
"cdips/utils/mamajek.py"
] | [
"\"\"\"\n1d interpolation functions based off the Pecaut & Mamajek (2013) tables:\nhttp://www.pas.rochester.edu/~emamajek/EEM_dwarf_UBVIJHK_colors_Teff.txt\n\nContents:\n get_interp_mass_from_rstar\n get_interp_rstar_from_teff\n get_interp_BmV_from_Teff\n get_interp_BpmRp_from_Teff\n get_interp_BmV_f... | [
[
"numpy.array",
"scipy.interpolate.interp1d",
"scipy.optimize.newton",
"numpy.diff",
"numpy.abs",
"pandas.read_csv"
]
] |
kerryvernebegeman/Kerry-Verne-Begeman | [
"eb6ee851003d435c5658f9cc0a41d72ea8addceb"
] | [
"copy_weights.py"
] | [
"# ~~~ aydao ~~~~ 2020 ~~~\n#\n# Copy over the weights (trainables in G, D, Gs) to another network\n#\nimport warnings\nwarnings.filterwarnings('ignore', category=FutureWarning)\nwarnings.filterwarnings('ignore', category=DeprecationWarning)\nimport tensorflow as tf\ntf.compat.v1.logging.set_verbosity(tf.compat... | [
[
"tensorflow.compat.v1.logging.set_verbosity",
"tensorflow.Session",
"tensorflow.device"
]
] |
ricklentz/openpilot | [
"d2735d73fc488f0da98073268eb266d492be37f9"
] | [
"selfdrive/car/volkswagen/carstate.py"
] | [
"import numpy as np\nfrom cereal import car\nfrom selfdrive.config import Conversions as CV\nfrom selfdrive.car.interfaces import CarStateBase\nfrom opendbc.can.parser import CANParser\nfrom opendbc.can.can_define import CANDefine\nfrom selfdrive.car.volkswagen.values import DBC_FILES, CANBUS, NetworkLocation, Tran... | [
[
"numpy.mean"
]
] |
stefanbuck/h2o-3 | [
"012c6108392ddf7ad3a2d12d79fec9d141324f1c"
] | [
"h2o-py/tests/testdir_misc/pyunit_explain.py"
] | [
"from __future__ import print_function\nimport sys, os, collections\n\nsys.path.insert(1, os.path.join(\"..\", \"..\", \"..\"))\nimport matplotlib\nmatplotlib.use(\"Agg\") # remove warning from python2 (missing TKinter)\nimport h2o\nimport matplotlib.pyplot\nfrom tests import pyunit_utils\nfrom h2o.automl import H... | [
[
"matplotlib.use",
"matplotlib.pyplot.close"
]
] |
lukasz-kozlowski/biopython | [
"6b601cf09234e1e82cfc94ad5030389036cb6343",
"6b601cf09234e1e82cfc94ad5030389036cb6343"
] | [
"Bio/PDB/QCPSuperimposer/__init__.py",
"Bio/Align/substitution_matrices/__init__.py"
] | [
"# Copyright (C) 2015, Anuj Sharma (anuj.sharma80@gmail.com)\n#\n# This file is part of the Biopython distribution and governed by your\n# choice of the \"Biopython License Agreement\" or the \"BSD 3-Clause License\".\n# Please see the LICENSE file that should have been included as part of this\n# package.\n\n\"\"\... | [
[
"numpy.array",
"numpy.dot",
"numpy.inner"
],
[
"numpy.array",
"numpy.asarray",
"numpy.ndarray.__array_prepare__",
"numpy.ndarray.__repr__",
"numpy.ix_",
"numpy.ndarray.__array_wrap__",
"numpy.ndarray.__getitem__",
"numpy.ndarray.__setitem__",
"numpy.issubdtype",... |
chengdongliang/neural_sp | [
"0a1d677208cc378e513e6fe814bae5c64967c988"
] | [
"neural_sp/datasets/asr/dataset.py"
] | [
"# Copyright 2018 Kyoto University (Hirofumi Inaguma)\n# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n\n\"\"\"Custom Dataset.\"\"\"\n\nimport kaldiio\nimport numpy as np\nimport os\nfrom numpy.lib.index_tricks import AxisConcatenator\nimport pandas as pd\nfrom torch.utils.data import Dataset\n\nfrom n... | [
[
"numpy.zeros",
"numpy.random.seed",
"numpy.random.permutation",
"pandas.concat",
"pandas.read_csv"
]
] |
ahoudard/wgenpatex | [
"a540d43bd9ba66aa8947773a67f7cef4874c4634"
] | [
"wgenpatex.py"
] | [
"import torch\nfrom torch import nn\nfrom torch.autograd.variable import Variable\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport math\nimport time\nimport model\nfrom os import mkdir\nfrom os.path import isdir\n\nDEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\nprint(DEVICE)\n\nd... | [
[
"torch.cat",
"torch.stack",
"torch.nn.Unfold",
"torch.ones",
"torch.cuda.is_available",
"torch.optim.ASGD",
"torch.sum",
"matplotlib.pyplot.savefig",
"numpy.save",
"torch.tensor",
"matplotlib.pyplot.axis",
"torch.zeros",
"numpy.zeros",
"torch.max",
"torc... |
2black0/yoloface | [
"4b918a8e2894919372c7aa15ffad68fbdba0a24c"
] | [
"test-rcnn.py"
] | [
"import cv2\nimport face_recognition\nimport numpy as np\n\nvideo_capture=cv2.VideoCapture(0)\n\nknown_face_encodings=[]\nknown_face_names=[]\n\nimage_g=face_recognition.load_image_file(r'''samples/meeting_11_304.jpg''')\nimage_g_encoding=face_recognition.face_encodings(image_g)[0]\n\nknown_face_encodings=[image_g_... | [
[
"numpy.argmin"
]
] |
houssamn/P1_Facial_Keypoints | [
"d08f676bdd7aac568f917685ca49527c29a43f1b"
] | [
"facepoint/model_trainer.py"
] | [
"import os\nimport torch\nimport torch.nn as nn\n\n\nMODEL_DIR = \"saved_models\"\nMODEL_NAME = \"facenet.pt\"\n\nclass ModelTrainer:\n \n def __init__(self, net, optimizer, criterion, train_loader, val_loader):\n self.net = net\n self.optimizer = optimizer\n self.criterion = criterion\n ... | [
[
"torch.nn.init.xavier_normal_"
]
] |
quangnguyendang/Reinforcement_Learning | [
"2551ce95068561c553500838ee6b976f001ba667"
] | [
"Chapter10_On_Policy_Control_with_Approximation/Mountain_Car_1_Step_Semi_Gradient_SARSA_RBF_Linear_Appr.py"
] | [
"# Example 10.1 page 198 in Reinforcement Learning: An Introduction Book\n# PhD Student: Nguyen Dang Quang, Computer Science Department, KyungHee University, Korea.\n# 1-step Semi Gradient SARSA Implementation for MountainCar-v0 environment\n# RBF Feature Vector Generated for Linear Approximation\n# Reference from ... | [
[
"numpy.random.rand",
"sklearn.kernel_approximation.RBFSampler",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"numpy.random.randint",
"numpy.transpose",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
idavidrein/SentEval | [
"fcac5a5c0598f2cad4239cc98ed3415671372b58"
] | [
"senteval/snli.py"
] | [
"# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n#\n\n'''\nSNLI - Entailment\n'''\nfrom __future__ import absolute_import, division, unicode_literals\n\nimport codecs\ni... | [
[
"numpy.abs",
"numpy.vstack"
]
] |
rajkaramchedu-nvidia/cudf | [
"b06e0ef22c5271697d0533c1bb0355964f51cc41"
] | [
"python/cudf/cudf/tests/test_rolling.py"
] | [
"import numpy as np\nimport pandas as pd\nimport pytest\n\nimport cudf\nfrom cudf.tests.utils import assert_eq\n\n\n@pytest.mark.parametrize(\n \"data,index\",\n [\n ([], []),\n ([1, 1, 1, 1], None),\n ([1, 2, 3, 4], pd.date_range(\"2001-01-01\", \"2001-01-04\")),\n ([1, 2, 4, 9, 9... | [
[
"numpy.array",
"pandas.DatetimeIndex",
"pandas.DataFrame",
"pandas.date_range",
"pandas.Timestamp",
"pandas.Series"
]
] |
Philyzh8/scMGCA | [
"0e1e85ae2530f3ed985e4b5920a8c15bfacf4e18"
] | [
"scMGCA/layers.py"
] | [
"from tensorflow.keras import activations, constraints, initializers, regularizers\nimport tensorflow as tf\nfrom tensorflow.keras.layers import Layer, InputSpec\nimport tensorflow.keras.backend as K\n\n\nclass ClusteringLayer(Layer):\n def __init__(self, weights=None, alpha=1.0, **kwargs):\n if 'input_sh... | [
[
"tensorflow.keras.backend.expand_dims",
"tensorflow.keras.backend.sum",
"tensorflow.keras.initializers.get",
"tensorflow.keras.activations.get",
"tensorflow.keras.regularizers.get",
"tensorflow.keras.backend.transpose",
"tensorflow.matmul",
"tensorflow.transpose",
"tensorflow.k... |
poorna-kumar/cs231n | [
"426e014b3f320c76d5f3767378d0f88854efcadd"
] | [
"general_utils.py"
] | [
"import torch\n\n\ndef convert_to_np(obj, device):\n if torch.is_tensor(obj):\n data = obj.data\n # If running on GPU, we need to call .cpu() to copy the tensor to host memory\n # before we can convert it to numpy\n if 'cuda' in device.type:\n data = data.cpu()\n ret... | [
[
"torch.is_tensor"
]
] |
hanswenzel/opticks | [
"b75b5929b6cf36a5eedeffb3031af2920f75f9f0"
] | [
"examples/Geant4/CerenkovStandalone/QCtxTest.py"
] | [
"#!/usr/bin/env python\n\"\"\"\n\n::\n\n ipython -i QCtxTest.py\n\n\"\"\"\nimport os, logging, numpy as np\nimport matplotlib.pyplot as plt\nlog = logging.getLogger(__name__)\n\n#np.set_printoptions(suppress=False, precision=8) \nnp.set_printoptions(suppress=True, precision=4) \n\nclass QCtxTest(object):\n ... | [
[
"numpy.set_printoptions",
"numpy.linspace",
"matplotlib.pyplot.subplots",
"numpy.histogram"
]
] |
lyjeff/2021-training-courses | [
"21b2160da81d8934d93b7d93b1d8e8853a115d16"
] | [
"libs/functional.py"
] | [
"from typing import List, Union, Tuple\n\nimport numpy as np\nimport random\nfrom tqdm import tqdm\n\n\nclass Variable:\n\n def __init__(self, value=None, grad=None):\n self.value = value\n self.grad = grad\n\n\nclass Polynomial:\n\n def __init__(self, a: List = None):\n self.coef = np.ar... | [
[
"numpy.array",
"numpy.empty",
"numpy.sum",
"numpy.multiply",
"numpy.power"
]
] |
peendebak/core_tools | [
"2e43edf0bbc1d7ceb7042559db499535e8f6a076"
] | [
"core_tools/data/SQL/buffer_writer.py"
] | [
"import numpy as np\n\n\nclass buffer_reference:\n\t'''\n\tobject in case a user want to take a copy of the reader/writer\n\t'''\n\tdef __init__(self, data):\n\t\tself.buffer = data\n\t\tself.buffer_lambda = buffer_reference.__empty_lambda\n\n\t@property\n\tdef data(self):\n\t\treturn self.buffer_lambda(self.buffer... | [
[
"numpy.average",
"numpy.full",
"numpy.ones",
"numpy.frombuffer"
]
] |
OSeMOSYS/otoole | [
"77606e9966fc8bce0bd7471049d0051f3ca9aff3"
] | [
"src/otoole/write_strategies.py"
] | [
"import logging\nimport os\nimport pandas as pd\nfrom json import dump\nfrom typing import Any, TextIO\n\nfrom otoole.input import WriteStrategy\nfrom otoole.read_strategies import CSV_TO_EXCEL\nfrom otoole.utils import read_packaged_file\n\nlogger = logging.getLogger(__name__)\n\n\nclass WriteExcel(WriteStrategy):... | [
[
"pandas.ExcelWriter"
]
] |
gonsoomoon-ml/aws-ai-ml-workshop-kr | [
"cf5653364d4f24066b7ad371bd0f7230758ab49c"
] | [
"sagemaker/sm-special-webinar/lab_3_pipeline/src/preprocessing.py"
] | [
"import argparse\nimport os\nimport requests\nimport tempfile\nimport subprocess, sys\n\nimport pandas as pd\nimport numpy as np\nfrom glob import glob\n\nfrom sklearn.compose import ColumnTransformer\nfrom sklearn.impute import SimpleImputer\nfrom sklearn.pipeline import Pipeline\nfrom sklearn.preprocessing import... | [
[
"numpy.concatenate",
"sklearn.impute.SimpleImputer",
"pandas.DataFrame",
"sklearn.compose.ColumnTransformer",
"pandas.concat",
"pandas.read_csv",
"sklearn.preprocessing.OneHotEncoder"
]
] |
crmauceri/DepthAwareCNN-pytorch1.5 | [
"6d9b0cf001d7482df7d4cd7240fc36cbfc8356f9"
] | [
"depthaware/models/ops/depthconv/functional.py"
] | [
"import torch\nfrom torch.autograd import Function\n\nif torch.cuda.is_available():\n import depthconv\n\nclass DepthconvFunction(Function):\n @staticmethod\n def outputSize(input, weight, stride, padding, dilation):\n weight_size = [(weight.size(i+2)-1)*(dilation[i]-1) + weight.size(i+2) for i in r... | [
[
"torch.zeros",
"torch.cuda.is_available"
]
] |
maguangyan/pclpy_tutorial | [
"9ce54d1f1a70cf379b5954ad4d8bed3210e06a4c"
] | [
"tutorial/04_Visualization/03_pcl_visualizer_demo.py"
] | [
"# -*- coding: utf-8 -*-\n# @Time : DATE:2021/9/20\n# @Author : yan\n# @Email : 1792659158@qq.com\n# @File : 01_cloud_viewer.py\n\nimport pclpy\nfrom pclpy import pcl\nimport numpy as np\nimport sys\n\n\ndef printUsage(progName):\n # 帮助函数\n print('Usage:', progName, ' [options]\\n',\n \"Options:\\n\"... | [
[
"numpy.uint8",
"numpy.deg2rad",
"numpy.linspace"
]
] |
PRamoneda/mir_eval | [
"ffb77ba720d4d0cea030fc6e3d034913510e21d6"
] | [
"tests/test_tempo.py"
] | [
"#!/usr/bin/env python\n'''\nUnit tests for mir_eval.tempo\n'''\nimport warnings\n\nimport numpy as np\nimport mir_eval\nfrom nose.tools import raises\nimport json\nimport glob\n\n\nA_TOL = 1e-12\n\n\ndef _load_tempi(filename):\n\n values = mir_eval.io.load_delimited(filename, [float] * 3)\n\n return np.conca... | [
[
"numpy.concatenate",
"numpy.allclose",
"numpy.array"
]
] |
deliahu/cortex | [
"89115b43d4628c6f95a881c0409ecc3f78ab11e6"
] | [
"examples/sklearn/iris-classifier/trainer.py"
] | [
"# WARNING: you are on the master branch; please refer to examples on the branch corresponding to your `cortex version` (e.g. for version 0.18.*, run `git checkout -b 0.18` or switch to the `0.18` branch on GitHub)\n\nimport boto3\nimport pickle\n\nfrom sklearn.datasets import load_iris\nfrom sklearn.model_selectio... | [
[
"sklearn.model_selection.train_test_split",
"sklearn.linear_model.LogisticRegression",
"sklearn.datasets.load_iris"
]
] |
joelberkeley/trieste | [
"6c0bd5b8cd93c141bdfd7d58a4b7b39e3a7e4378"
] | [
"trieste/bayesian_optimizer.py"
] | [
"# Copyright 2020 The Trieste Contributors\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... | [
[
"tensorflow.print"
]
] |
disguise6/cm-FaceRecognition | [
"6ec216e1fd462bd3888d40d9ea288406e45a9b70"
] | [
"core/light_cnn.py"
] | [
"'''\r\n implement Light CNN\r\n @author: Alfred Xiang Wu\r\n @date: 2017.07.04\r\n'''\r\n\r\nimport math\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\n\r\nclass mfm(nn.Module):\r\n def __init__(self, in_channels, out_channels, kernel_size=3, stride=1, padding=1, type=1)... | [
[
"torch.nn.Linear",
"torch.nn.functional.avg_pool2d",
"torch.nn.MaxPool2d",
"torch.max",
"torch.nn.Sequential",
"torch.nn.functional.dropout",
"torch.split",
"torch.nn.Conv2d",
"torch.nn.functional.max_pool2d"
]
] |
amifunny/DeepForest | [
"63cfbed9859de6674604a7d4106a6deb008ef5be"
] | [
"tests/test_preprocess.py"
] | [
"# test preprocessing\nimport glob\nimport os\n\nimport numpy as np\nimport pandas as pd\nimport pytest\nfrom PIL import Image\n\nfrom deepforest import get_data\nfrom deepforest import preprocess\nfrom deepforest import utilities\n\n\n@pytest.fixture()\ndef config():\n config = utilities.read_config(get_data(\"... | [
[
"pandas.DataFrame",
"numpy.array",
"pandas.read_csv"
]
] |
yy-zhou/SVM-Spam-SMS-classifier | [
"e6ac70be8fa54f7e7ab4fead06489d4d70985dd3"
] | [
"classifier_main.py"
] | [
"__author__ = 'BorisMirage'\n# --- coding:utf-8 ---\n\n'''\nCreate by BorisMirage\nFile Name: classifier_main\nCreate Time: 2018-12-02 16:23\n'''\n\nimport classifier_bayes\nimport classifier_svm\nimport numpy as np\nimport read_data_file\n\n\ndef bayes(training, training_label, test_set, test_label_set, vocabulary... | [
[
"numpy.mean",
"numpy.zeros"
]
] |
kingofsandvich/Program-for-Stylizing-Musical-Compositions-Based-on-Machine-Learning | [
"bd730427a82bdc379177c5f7d33274ed8c9afe72"
] | [
"cyclegan/classifier.py"
] | [
"import os\nimport numpy as np\nfrom random import shuffle\nfrom collections import namedtuple\nfrom glob import glob\nimport tensorflow as tf\nfrom tensorflow.keras.optimizers import Adam\n\nfrom module import build_generator, build_discriminator_classifier, softmax_criterion\nfrom utils import get_now_datetime, s... | [
[
"numpy.random.normal",
"numpy.array",
"tensorflow.GradientTape",
"tensorflow.train.CheckpointManager",
"tensorflow.argmax",
"numpy.load",
"numpy.mean",
"tensorflow.cast",
"numpy.argmax",
"numpy.abs",
"tensorflow.nn.softmax",
"tensorflow.keras.optimizers.Adam",
"... |
bjfranks/Classification-AD | [
"4eecd6648bb6b54662944921924c8960c2ca236c"
] | [
"src/datasets/cifar100.py"
] | [
"from torch.utils.data import Subset\nfrom PIL import Image\nfrom torchvision.datasets import CIFAR100\nfrom base.torchvision_dataset import TorchvisionDataset\n\nimport numpy as np\nimport torch\nimport torchvision.transforms as transforms\nimport random\n\n\nclass CIFAR100_Dataset(TorchvisionDataset):\n\n def ... | [
[
"torch.utils.data.Subset",
"numpy.array",
"torch.randn_like"
]
] |
looselyconnected/fastai | [
"12d38d760393f1a677cc825d99283c8efcffbef5",
"12d38d760393f1a677cc825d99283c8efcffbef5"
] | [
"stock/train.py",
"common/data.py"
] | [
"import pandas as pd\nimport numpy as np\nimport argparse\nimport pdb\nfrom tensorflow.python import keras\nfrom tensorflow.python.keras import optimizers\n\nfrom stock.data import Fields as fld, get_ticker_df, index_to_map\nfrom common.lgb import LGBModel\nfrom common.nn import NNModel\n\n\ndef get_delta_columns(p... | [
[
"pandas.to_datetime",
"numpy.array",
"pandas.DataFrame",
"tensorflow.python.keras.layers.Dropout",
"tensorflow.python.keras.optimizers.Adam",
"tensorflow.python.keras.regularizers.l2",
"pandas.read_csv"
],
[
"sklearn.metrics.mean_squared_error",
"numpy.log",
"pandas.Dat... |
NolanRus/avatar-generator | [
"b73b289137b8c25f56f3ac397a781d870d0b096f"
] | [
"hair_classifier.py"
] | [
"import cv2\nimport numpy as np\nfrom evaluate import evaluate\n\n\nimport math\n\n\nHAIR_COLORS = {\n 0: (43, 45.9, 100),\n 1: (33, 69.8, 100),\n 2: (20, 80.2, 92.9),\n 3: (13, 78.1, 75.3),\n 4: (38, 76.9, 84.7),\n 5: (18, 68.9, 63.1),\n 6: (22, 69.2, 35.7),\n 7: (6, 33.3, 11.8),\n 8: (2... | [
[
"numpy.array"
]
] |
breakds/phasic-policy-gradient | [
"ee03bf65cd36f92a3dddf3915e048e0cc7b85c04"
] | [
"phasic_policy_gradient/torch_util.py"
] | [
"import collections\nimport functools\nimport itertools\nimport math\nimport os\nimport platform\nfrom contextlib import contextmanager\nimport re\n\nimport numpy as np\nimport torch as th\nimport torch.distributed as dist\nimport torch.distributions as dis\nimport torch.nn.functional as F\nfrom . import logger\nfr... | [
[
"torch.nn.Linear",
"torch.distributed.get_world_size",
"torch.cat",
"torch.distributions.Categorical",
"torch.stack",
"torch.distributions.Bernoulli",
"torch.cuda.is_available",
"numpy.zeros_like",
"torch.is_tensor",
"pandas.DataFrame",
"torch.distributed.init_process_g... |
isabella232/lasr | [
"1d8404232d2e51c330bdf83416343eda0290bcc0"
] | [
"third_party/ext_utils/badja_data.py"
] | [
"# GNU GPL header\n# \n# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU General Public License\n# version 2 as published by the Free Software Foundation.\n# \n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without... | [
[
"numpy.array"
]
] |
nmsl-nthu/PCC_Arena | [
"23efd951aba4f816b10d74023011fce864996ba2"
] | [
"evaluator/evaluate_pc_video.py"
] | [
"import os\r\nimport sys\r\nfrom pyemd import emd_samples\r\nimport numpy as np\r\nimport subprocess as sp\r\nimport re\r\nimport logging\r\nimport argparse\r\nfrom plyfile import PlyData, PlyElement\r\nimport glob\r\n\r\nlogging.basicConfig(\r\n level=logging.INFO,\r\n format='%(asctime)s.%(msecs)03d %(level... | [
[
"numpy.array",
"numpy.mean",
"numpy.expand_dims"
]
] |
tobywise/nilearn | [
"7941c13ba98bc3ec69a829abc11366d901f10a43"
] | [
"nilearn/decomposition/canica.py"
] | [
"\"\"\"\nCanICA\n\"\"\"\n\n# Author: Alexandre Abraham, Gael Varoquaux,\n# License: BSD 3 clause\n\nimport warnings as _warnings\nimport numpy as np\n\nfrom operator import itemgetter\n\nfrom scipy.stats import scoreatpercentile\nfrom sklearn.decomposition import fastica\nfrom joblib import Memory, delayed, Paralle... | [
[
"scipy.stats.scoreatpercentile",
"numpy.iinfo",
"sklearn.utils.check_random_state",
"numpy.abs"
]
] |
tanghaoyu258/ACRM-for-moment-retrieval | [
"a5757c3e33621cefc3489c13c260667882c82e34"
] | [
"modeling/dynamic_filters/mlp.py"
] | [
"import torch\nimport torch.nn as nn\n\nclass MLP(nn.Module):\n def __init__(self, cfg):\n super(MLP, self).__init__()\n\n self.input_dim = cfg.DYNAMIC_FILTER.MLP.INPUT_DIM\n self.output_dim = cfg.DYNAMIC_FILTER.MLP.OUTPUT_DIM\n\n self.mlp = nn.Sequential(\n nn.... | [
[
"torch.nn.Linear",
"torch.nn.Tanh"
]
] |
janash/sample_package_2021 | [
"29fa098dafe46d82c075e58e3d65f2153909fa82"
] | [
"sample_package_2021/io/pdb.py"
] | [
"\"\"\"\nFunctions for reading and writing pdbs\n\"\"\"\n\nimport numpy as np\n\ndef open_pdb(f_loc):\n # This function reads in a pdb file and returns the atom names and coordinates.\n with open(f_loc) as f:\n data = f.readlines()\n c = []\n sym = []\n for l in data:\n if \"ATOM\" in l... | [
[
"numpy.array"
]
] |
EFeru/ScottPlot | [
"84c30a1089c085ca23f3fbc09fffd08e4bfb778f"
] | [
"dev/python/equal-axis/demo.py"
] | [
"import matplotlib.pyplot as plt\nxs = [-10, 10, 10, -10, -10]\nys = [-10, -10, 10, 10, -10]\nplt.plot(xs, ys, '.-', lw=5, ms=20)\nplt.grid(alpha=.5, ls='--')\nplt.gca().axis('equal')\nplt.show()"
] | [
[
"matplotlib.pyplot.grid",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show"
]
] |
Ephecina/Karel-van-de-Plassche-QLKNN-develop-copy | [
"57db64875f5d478dc0ac7d0e89fcbabf7d318a3a"
] | [
"training/nn_primitives.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport subprocess\nimport json\nimport pandas as pd\n\ndef scale_panda(panda, factor, bias):\n if isinstance(panda, pd.Series):\n filter = panda.index\n if isinstance(panda, pd.DataFrame):\n filter = panda.columns\n panda = factor[filter] * panda ... | [
[
"tensorflow.reduce_min",
"tensorflow.summary.scalar",
"tensorflow.summary.histogram",
"tensorflow.matmul",
"tensorflow.Variable",
"numpy.mean",
"numpy.std",
"tensorflow.constant",
"tensorflow.reduce_max",
"tensorflow.name_scope",
"tensorflow.reduce_mean",
"tensorflo... |
ideaconsult/tf_kit | [
"24f8506cf73bd57f26315e0d2a73db8a70d4a608"
] | [
"tf_persist.py"
] | [
"#\n# General TensorFlow made-easy tools, primary focused on architecture building.\n#\n# Copyright (C) 2017, IDEAConsult Ltd.\n# Author: Ivan (Jonan) Georgiev\n\"\"\"\nThe TensorFlow persistent provides this, placeholder class:\n\n@@RestoredModel\n@@WrappedModel\n\n\"\"\"\n\nimport tensorflow as tf\nfrom tensorflo... | [
[
"tensorflow.train.export_meta_graph",
"tensorflow.trainable_variables",
"tensorflow.zeros",
"tensorflow.train.latest_checkpoint",
"tensorflow.summary.scalar",
"tensorflow.python.platform.tf_logging.info",
"tensorflow.get_default_graph",
"tensorflow.train.import_meta_graph",
"te... |
BachiLi/graphics | [
"228472e31327635e80220a740f13d672252bec9f",
"228472e31327635e80220a740f13d672252bec9f"
] | [
"tensorflow_graphics/geometry/representation/tests/triangle_test.py",
"tensorflow_graphics/util/test_case.py"
] | [
"#Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to... | [
[
"tensorflow.abs",
"numpy.array",
"tensorflow.convert_to_tensor",
"numpy.zeros_like",
"numpy.zeros",
"numpy.random.randint",
"numpy.sqrt",
"numpy.random.random"
],
[
"tensorflow.executing_eagerly",
"tensorflow.compat.v1.set_random_seed",
"tensorflow.compat.v1.placeho... |
yradeva93/random-grouping | [
"4955f8734bdd95f0e9fffaed6336c851bea156a0"
] | [
"src/algorithm.py"
] | [
"from itertools import combinations\nfrom itertools import count\n\nimport numpy as np\n\n\ndef find_best_matching(candidates, matchings_history, penalty_func=None):\n \"\"\"Find best (matching) candidate from list given some metric.\n\n Args:\n candidates (list): List of matching candidates.\n ... | [
[
"numpy.bincount",
"numpy.argmin",
"numpy.random.seed",
"numpy.random.shuffle",
"numpy.tril",
"numpy.array_split"
]
] |
cinjon/ml-capsules-inverted-attention-routing | [
"978b0f58eba1007bcef0b6cb045f3d2040f76a31"
] | [
"misc/flow2img.py"
] | [
"import argparse\nimport os\nimport json\nimport sys\n\nimport cv2\nimport numpy as np\n\n\ndef create_flow2img_dir(phase_dir=None, subdir=None, output_dir=None, input_dir=None):\n \"\"\"\n Args:\n phase_dir: The directory of directory of flow npys.\n subdir: The particular subdir within that phase_... | [
[
"numpy.zeros"
]
] |
spital/audio | [
"414f4f774e9b649bf17c523fbd56b2c54c493508"
] | [
"torchaudio/prototype/ctc_decoder/ctc_decoder.py"
] | [
"import itertools as it\nfrom collections import namedtuple\nfrom typing import Dict, List, Optional, Union, NamedTuple\n\nimport torch\nfrom torchaudio._torchaudio_decoder import (\n _CriterionType,\n _LM,\n _KenLM,\n _LexiconDecoder,\n _LexiconDecoderOptions,\n _SmearingMode,\n _Trie,\n _D... | [
[
"torch.IntTensor",
"torch.full"
]
] |
AssemSadek/habitat-lab | [
"0e1d2afe04b5856e6b5b3fc561adcea414091be4"
] | [
"examples/tutorials/nb_python/Habitat_Lab.py"
] | [
"# ---\n# jupyter:\n# accelerator: GPU\n# colab:\n# collapsed_sections: []\n# name: Habitat Lab\n# provenance: []\n# jupytext:\n# cell_metadata_filter: -all\n# formats: nb_python//py:percent,colabs//ipynb\n# notebook_metadata_filter: all\n# text_representation:\n# extension: ... | [
[
"numpy.array",
"numpy.random.seed",
"matplotlib.pyplot.figure",
"numpy.finfo",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.subplot"
]
] |
garagonc/simulation-engine | [
"c129f0bf601e0d56d924c9e5fa2cf94f7e31a356"
] | [
"gesscon/gessconConnnector.py"
] | [
"import datetime\nimport logging\nimport json\nimport os\n\nimport numpy as np\nimport time\n\nlogging.basicConfig(format='%(asctime)s %(levelname)s %(name)s: %(message)s', level=logging.DEBUG)\nlogger = logging.getLogger(__file__)\n\nfrom gesscon.MQTTClient import MQTTClient\nfrom data_management.utils import Util... | [
[
"numpy.square",
"numpy.sqrt"
]
] |
tanmaya48/cv-tricks.com | [
"df831a73a99226026fda353c65b1a11cc6f18c9a"
] | [
"hungarian_net/models.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch_scatter\nfrom torch.nn import functional as F\nclass FCStack(nn.Module):\n def __init__(self, in_channels, list_out_channels, batch_norm=True):\n super(FCStack, self).__init__()\n\n layers = []\n for out_channels in list_out_channels:\n ... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.Sequential",
"torch.nn.ReLU",
"torch.nn.BatchNorm1d"
]
] |
skelwadkar/COVID-19_project | [
"61e315e6d1de872f4b6fec27432ae202bbc6f69b"
] | [
"covsirphy/util/map.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\nimport matplotlib\nimport japanmap\nimport pandas as pd\n\n\ndef jpn_map(prefectures, values, title, cmap_name=\"Reds\", filename=None):\n \"\"\"\n Show colored Japan prefecture map.\n @prefectur... | [
[
"matplotlib.cm.ScalarMappable",
"matplotlib.pyplot.colorbar",
"matplotlib.cm.get_cmap",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.tick_params",
"matplotlib.pyplot.show",
"matplotlib.pyplot.clf"... |
francescotonini/depthconv | [
"3488ba1e76d379717ca6a674cf54b719d968dcb4"
] | [
"depthavgpooling/setup.py"
] | [
"from setuptools import setup\nfrom torch.utils.cpp_extension import BuildExtension, CUDAExtension\n\nsetup(\n name='depthavgpooling_cuda',\n ext_modules=[\n CUDAExtension('depthavgpooling_cuda', [\n 'depthavgpooling_cuda.cpp',\n 'depthavgpooling_cuda_kernel.cu'\n ])\n ]... | [
[
"torch.utils.cpp_extension.CUDAExtension"
]
] |
emadphysics/moving_object_detector_and_counter | [
"581f2e6da31fd4544f5f0d954915de326d0286c0"
] | [
"Moving_Object_Detector.py"
] | [
"import numpy as np\nimport argparse\nimport imutils\nimport time\nimport cv2\nimport os\nfrom tqdm import tqdm\nfrom collections import Counter\n\n#Accept arguements from user\nap = argparse.ArgumentParser()\nap.add_argument(\"-i\", \"--input\", required=True,\n\thelp=\"path to input video\")\nap.add_argument(\"-o... | [
[
"numpy.random.seed",
"numpy.array",
"numpy.argmax"
]
] |
iMerica/posthog | [
"a73a3ba35c4b3fd1d06200ed56a12c96be5e1abe"
] | [
"posthog/api/action.py"
] | [
"from posthog.models import Event, Team, Action, ActionStep, Element, User\nfrom rest_framework import request, serializers, viewsets, authentication # type: ignore\nfrom rest_framework.response import Response\nfrom rest_framework.decorators import action # type: ignore\nfrom rest_framework.exceptions import Authe... | [
[
"pandas.DataFrame",
"pandas.date_range"
]
] |
ai-se/heroes_compsci | [
"126de39b24336fa689150fe8779be7ac84b664db"
] | [
"old/old py/api_access.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Aug 29 11:36:45 2018\n\n@author: suvod\n\"\"\"\nfrom __future__ import division\nimport git_access\nimport json\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport math\nimport networkx as nx\n\nclass git_api_access(object):\n \n d... | [
[
"pandas.DataFrame"
]
] |
wjguan/phenocell | [
"80ff7a0b5cc9e1ecedd8fe488b81a3df120096d9"
] | [
"clarity/IO/IO.py"
] | [
"import sys\nself = sys.modules[__name__]\n\nimport os\nimport glob\nimport re\nimport numpy\nimport importlib\nimport shutil\nimport cv2\nfrom tqdm import tqdm\n\npointFileExtensions = [\"csv\", \"txt\", \"npy\", \"ims\"]\npointFileTypes = [\"CSV\", \"NPY\", \"Imaris\"]\npointFileExtensionToType = {\"csv\" : \"CSV... | [
[
"numpy.array",
"numpy.logical_and"
]
] |
KKallidromitis/contr_np | [
"50c16281098cf4995182f843df794a03cde088ba"
] | [
"contrnp/npf/neuralproc/convnp.py"
] | [
"\"\"\"Module for convolutional [conditional | latent] neural processes\"\"\"\nimport logging\nimport math\nfrom functools import partial\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom npf.architectures import CNN, ResConvBlock, SetConv, discard_ith_arg\nfrom npf.utils.initialization ... | [
[
"torch.zeros",
"torch.cat"
]
] |
Pompeiro/portfolio | [
"20b7ffb0a061be7ed0950e87f94164409fef2318"
] | [
"portfolio/utils/utils.py"
] | [
"import pathlib\n\nimport cv2 as cv\nimport numpy as np\nfrom django.conf import settings\n\n\ndef get_matched_image(image, needle, threshold=0.95):\n if not needle:\n return image\n else:\n needle_path = pathlib.PurePath(\n settings.STATIC_ROOT\n + f\"/images/templatematch... | [
[
"numpy.where"
]
] |
NCAR/mlmicrophysics | [
"45e1bac65a68e4c2656f70d17b4289576a3258ad"
] | [
"mlmicrophysics/data.py"
] | [
"import s3fs\nimport numpy as np\nimport pandas as pd\nimport xarray as xr\nfrom glob import glob\nfrom os.path import join, exists\nfrom sklearn.preprocessing import StandardScaler, RobustScaler, MaxAbsScaler, MinMaxScaler\nfrom operator import lt, le, eq, ne, ge, gt\n\nscalers = {\"MinMaxScaler\": MinMaxScaler,\n... | [
[
"numpy.histogram",
"numpy.count_nonzero",
"numpy.maximum",
"numpy.random.choice",
"numpy.zeros",
"numpy.round",
"pandas.DataFrame",
"numpy.where",
"numpy.arange",
"pandas.concat",
"pandas.read_csv",
"pandas.read_parquet",
"numpy.unique",
"numpy.isin"
]
] |
reconrus/ssd.pytorch | [
"b02f565e512bf168272188529b0da7df5effedd7"
] | [
"data/voc0712.py"
] | [
"\"\"\"VOC Dataset Classes\n\nOriginal author: Francisco Massa\nhttps://github.com/fmassa/vision/blob/voc_dataset/torchvision/datasets/voc.py\n\nUpdated by: Ellis Brown, Max deGroot\n\"\"\"\nfrom .config import HOME\nimport os.path as osp\nimport sys\nimport torch\nimport torch.utils.data as data\nimport cv2\nimpor... | [
[
"numpy.array",
"numpy.expand_dims",
"torch.from_numpy"
]
] |
dsinghnegi/attari_RL_agent | [
"d94fef6246829e553514400d86d507c218a3a816"
] | [
"train_a3c.py"
] | [
"import argparse\nimport os\nimport re\n\nimport numpy as np\nimport torch\nimport torch.multiprocessing as _mp\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom torch.utils.tensorboard import SummaryWriter\n\nimport environment\nimport tpu\nfrom models import A3C\nfrom optim import SharedAdam\nfrom... | [
[
"torch.zeros",
"torch.device",
"torch.nn.functional.log_softmax",
"torch.multiprocessing.get_context",
"numpy.sign",
"torch.cuda.is_available",
"torch.nn.functional.softmax",
"torch.utils.tensorboard.SummaryWriter"
]
] |
SeanTater/cabarrus | [
"14bf04c07e84c38f52deae72679d1da11b55c4bb"
] | [
"tasks/exp-rand-idx-task.py"
] | [
"#!/usr/bin/python\nimport numpy as np\nimport scipy as sp\nimport scipy.linalg\nimport sqlite3\nimport os\nunif = np.random.uniform\nvocab = 10000\n\ndef zero_is_one(a):\n a[a==0]=1\n return a\n\nl1_norm = lambda x: x / zero_is_one(x.sum(axis=1).reshape(-1, 1))\nl2_norm = lambda x: x / zero_is_one(np.sqrt((x... | [
[
"numpy.random.normal",
"numpy.array",
"numpy.sign",
"numpy.std",
"numpy.random.uniform",
"scipy.linalg.qr",
"numpy.abs",
"numpy.random.pareto"
]
] |
XezXey/guided-diffusion | [
"5e156d0c1135e3432c33e5a5efb382f2095d9a59",
"5e156d0c1135e3432c33e5a5efb382f2095d9a59"
] | [
"guided_diffusion/script_util.py",
"guided_diffusion/resample.py"
] | [
"import argparse\nimport inspect\n\nfrom . import gaussian_diffusion as gd\nfrom .respace import SpacedDiffusion, space_timesteps\nfrom .unet import SuperResModel, UNetModel, EncoderUNetModel\n\nNUM_CLASSES = 1000\n\n\ndef diffusion_defaults():\n \"\"\"\n Defaults for image and classifier training.\n \"\"\... | [
[
"numpy.random.seed",
"torch.manual_seed",
"torch.cuda.manual_seed",
"torch.cuda.manual_seed_all"
],
[
"torch.zeros",
"torch.distributed.get_world_size",
"numpy.zeros",
"numpy.sum",
"numpy.ones",
"torch.distributed.all_gather",
"numpy.mean",
"torch.from_numpy",
... |
Ryan0v0/BUAA_DataMining | [
"fdd5f79b511fd6302f9c1f2e18a809720e97dc74"
] | [
"utils/loss_functions.py"
] | [
"from __future__ import division\nimport numpy as np\nfrom utils import accuracy_score\n\nclass Loss(object):\n def loss(self, y_true, y_pred):\n return NotImplementedError()\n\n def gradient(self, y, y_pred):\n raise NotImplementedError()\n\n def acc(self, y, y_pred):\n return 0\n\ncl... | [
[
"numpy.argmax",
"numpy.power",
"numpy.log",
"numpy.clip"
]
] |
konatasick/face-of-art | [
"ffa62a579cc8bc389e2088923736c4947a1fad70",
"ffa62a579cc8bc389e2088923736c4947a1fad70"
] | [
"ops.py",
"old/temp/create_art_data.py"
] | [
"import tensorflow as tf\nimport numpy as np\n\n\ndef conv_relu_pool(input, conv_ker, conv_filters, conv_stride=1, conv_padding='SAME',\n conv_ker_init=tf.random_normal_initializer(0.01), conv_bias_init=tf.zeros_initializer(),\n pool_size=2, pool_stride=2, pool_padding='same', va... | [
[
"tensorflow.zeros_initializer",
"tensorflow.constant_initializer",
"tensorflow.nn.relu",
"numpy.zeros",
"tensorflow.layers.max_pooling2d",
"tensorflow.variable_scope",
"tensorflow.layers.conv2d",
"tensorflow.layers.conv2d_transpose",
"tensorflow.random_normal_initializer"
],
... |
jczaja/Paddle | [
"b15c675530db541440ddb5b7e774d522ecaf1533"
] | [
"python/paddle/v2/fluid/tests/test_gaussian_random_op.py"
] | [
"# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve.\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 r... | [
[
"numpy.std",
"numpy.mean"
]
] |
Poojitha1999/nasrl-without-training | [
"0b48f6ad379635ea3598ec9b4637272b0da71240"
] | [
"searchRL/train.py"
] | [
"import numpy as np\nimport csv\n\n# import tensorflow as tf\n# from keras import backend as K\nimport tensorflow.compat.v1 as tf\ntf.disable_v2_behavior()\nfrom tensorflow.compat.v1.keras import backend as K\n\nfrom keras.datasets import cifar10\nfrom keras.utils import to_categorical\n\nfrom controller import Con... | [
[
"tensorflow.compat.v1.disable_v2_behavior",
"tensorflow.compat.v1.Session",
"tensorflow.compat.v1.keras.backend.set_session"
]
] |
dc2016bte0006/Pytorch-HW-Maths-Equation-Solver | [
"87896d97d4549d0fafafb0ccb7db8dff44c0a737"
] | [
"Train.py"
] | [
"'''\nPython 3.6 \nPytorch >= 0.4\nWritten by Hongyu Wang in Beihang university\n'''\nimport torch\ntorch.cuda.empty_cache()\nimport math\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nimport numpy\nimport torch.utils.data as data\nfrom data_iterator import dataIterato... | [
[
"torch.nn.NLLLoss",
"torch.zeros",
"torch.cat",
"numpy.array",
"torch.max",
"torch.tanh",
"torch.nn.init.xavier_uniform_",
"torch.ones",
"torch.cuda.empty_cache",
"torch.LongTensor",
"torch.utils.data.DataLoader",
"torch.load",
"torch.nn.ZeroPad2d",
"torch.m... |
marcinz/legate.pandas | [
"94c21c436f59c06cfba454c6569e9f5d7109d839"
] | [
"tests/pandas/df_duplicate.py"
] | [
"# Copyright 2021 NVIDIA Corporation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or ... | [
[
"pandas.DataFrame"
]
] |
syeminpark/Python_Unity_UDP---test | [
"bc88c68271aaf20ace0c960a569bc526c203228f"
] | [
"face_spoofing.py"
] | [
"import numpy as np\nimport cv2\nfrom sklearn.externals import joblib\nfrom face_detector import get_face_detector, find_faces\n\ndef calc_hist(img):\n \"\"\"\n To calculate histogram of an RGB image\n\n Parameters\n ----------\n img : Array of uint8\n Image whose histogram is to be calculated... | [
[
"sklearn.externals.joblib.load",
"numpy.array",
"numpy.mean",
"numpy.zeros"
]
] |
yuiant/omeganlp | [
"4258958b6d84a664d6fca0ca32a927a725b392c4"
] | [
"omeganlp/data/processor/__init__.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nfrom abc import ABCMeta, abstractmethod\nfrom typing import Any\n\nimport torch\n\n\nclass BaseDataProcessor(metaclass=ABCMeta):\n @abstractmethod\n def processing(self, example: Any, is_train: bool = False):\n \"\"\"\n example --> fe... | [
[
"torch.save",
"torch.load"
]
] |
jgieseler/solarmach | [
"bebc6107d4f073a60018b2d20e4b2c7817e3dcc6"
] | [
"solarmach/__init__.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\nfrom pkg_resources import get_distribution, DistributionNotFound\ntry:\n __version__ = get_distribution(__name__).version\nexcept DistributionNotFound:\n pass # package is not installed\n\nimport math\nfrom copy import deepcopy\n\nimport ast... | [
[
"numpy.max",
"matplotlib.pyplot.arrow",
"matplotlib.patches.FancyArrow",
"pandas.DataFrame.from_dict",
"matplotlib.pyplot.savefig",
"matplotlib.legend_handler.HandlerPatch",
"numpy.degrees",
"numpy.radians",
"numpy.arange",
"matplotlib.pyplot.Circle",
"matplotlib.pyplot... |
punit-haria/multimodal-learning | [
"d14eea53741f3c38a4cee3c3a160573ba6cd409a"
] | [
"code/models/layers.py"
] | [
"import tensorflow as tf\nimport numpy as np\nfrom models import sequential as sq\n\n\ndef seq_encoder(x, slens, vocab_size, embed_size, n_units, n_z, n_layers, init, scope):\n \"\"\"\n RNN encoder using GRUs.\n \"\"\"\n with tf.variable_scope(scope):\n\n nonlin = tf.nn.elu\n bidirectional... | [
[
"tensorflow.exp",
"tensorflow.constant_initializer",
"tensorflow.nn.conv2d",
"tensorflow.contrib.layers.xavier_initializer",
"tensorflow.matmul",
"numpy.min",
"tensorflow.reshape",
"tensorflow.nn.moments",
"tensorflow.reverse",
"tensorflow.sqrt",
"tensorflow.nn.embeddin... |
pydae/pydae | [
"8076bcfeb2cdc865a5fc58561ff8d246d0ed7d9d"
] | [
"examples/machines/vsc/vsc_lcl.py"
] | [
"import numpy as np\nimport numba\nimport scipy.optimize as sopt\nimport json\n\nsin = np.sin\ncos = np.cos\natan2 = np.arctan2\nsqrt = np.sqrt \n\n\nclass vsc_lcl_class: \n\n def __init__(self): \n\n self.t_end = 10.000000 \n self.Dt = 0.0010000 \n self.decimation = 10.000000 \n self... | [
[
"numpy.ceil",
"numpy.zeros",
"numpy.block",
"numpy.copy",
"numpy.ones",
"numpy.eye",
"numpy.abs",
"numpy.linalg.solve",
"scipy.optimize.root",
"numpy.hstack",
"numpy.dtype",
"numpy.vstack"
]
] |
tsuga/jismesh | [
"a885ae4783f6b73fa2ff326a53a3c9b6e02c6bec"
] | [
"tests/test_to_meshlevel.py"
] | [
"# -*- coding: utf-8 -*-\nimport numpy as np\nfrom nose.tools import raises, timed, eq_\nfrom jismesh import utils as ju\n\ndef _data_scalar():\n return [\n ({'meshcode': 5339}, 1),\n ({'meshcode': 53392}, 40000),\n ({'meshcode': 5339235}, 20000),\n ({'mes... | [
[
"numpy.array"
]
] |
chrislangst/scalable-data-science | [
"c7beee15c7dd14d27353c4864d927c1b76cd2fa9"
] | [
"db/2/2/052_DLbyABr_02a-Keras-DFFN.py"
] | [
"# Databricks notebook source\n# MAGIC %md\n# MAGIC \n# MAGIC # [SDS-2.2, Scalable Data Science](https://lamastex.github.io/scalable-data-science/sds/2/2/)\n# MAGIC \n# MAGIC This is used in a non-profit educational setting with kind permission of [Adam Breindel](https://www.linkedin.com/in/adbreind).\n# MAGIC This... | [
[
"numpy.shape",
"numpy.sqrt",
"sklearn.model_selection.train_test_split",
"pandas.read_csv",
"pandas.get_dummies"
]
] |
XHYsdjkdsjsk2021/Yolox_xhy | [
"a60f585d4d2bf36f9fa90b0a078efb7b315e0118"
] | [
"tools/eval.py"
] | [
"#!/usr/bin/env python3\r\n# -*- coding:utf-8 -*-\r\n# Copyright (c) Megvii, Inc. and its affiliates.\r\n\r\nfrom loguru import logger\r\n\r\nimport torch\r\nimport torch.backends.cudnn as cudnn\r\nfrom torch.nn.parallel import DistributedDataParallel as DDP\r\n\r\nfrom yolox.core import launch\r\nfrom yolox.exp im... | [
[
"torch.nn.parallel.DistributedDataParallel",
"torch.cuda.device_count",
"torch.manual_seed",
"torch.cuda.set_device",
"torch.load"
]
] |
carpyncho/yeolde_carpyncho | [
"fba72ebf9d4a3e4e4ea18160310058c6812a0457"
] | [
"carpyncho1/carpyncho/cube/management/commands/tocube.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n#==============================================================================\n# DOCS\n#==============================================================================\n\n\"\"\"Move data\n\n\"\"\"\n\n\n#=============================================================... | [
[
"numpy.average",
"numpy.max",
"numpy.min",
"numpy.split"
]
] |
ultrafive/riscv-pvp | [
"843e38422c3d545352b955764927d5e7847e5453",
"843e38422c3d545352b955764927d5e7847e5453"
] | [
"rvpvp/isa/rvv/vmxxx_vim.py",
"rvpvp/isa/rvv/vmxxx_vi.py"
] | [
"from ...isa.inst import *\nimport numpy as np\n\nclass Vmadc_vim(Inst):\n name = 'vmadc.vim'\n # vmadc.vim vd, vs2, imm, v0 \n def golden(self): \n if self['vl']==0:\n return self['ori']\n if self['ori'].dtype != np.uint8:\n self['ori'].dtype = np.uint8\n bi... | [
[
"numpy.unpackbits",
"numpy.packbits"
],
[
"numpy.unpackbits",
"numpy.packbits"
]
] |
branislav1991/MicroscopyUNet | [
"3c28fa3ea7efa855633eec6605f09866c5f8e645"
] | [
"models/unet/model.py"
] | [
"import numpy as np\r\nimport tensorflow as tf\r\n\r\nimport math\r\n\r\nfrom tqdm import tqdm\r\nfrom skimage import io\r\nfrom skimage.transform import resize\r\nfrom skimage.morphology import label\r\n\r\nfrom models.unet.common import IoU, mIoU, dice, SEGMENTATION_THRESHOLD\r\nfrom models.unet.data_provider imp... | [
[
"tensorflow.image.resize_bilinear",
"tensorflow.summary.FileWriter",
"tensorflow.contrib.layers.xavier_initializer",
"numpy.mean",
"tensorflow.assign_add",
"tensorflow.local_variables_initializer",
"tensorflow.global_variables_initializer",
"tensorflow.Summary",
"tensorflow.sha... |
wouterpeere/pygfunction | [
"6ac885b8b8a9532ed4aa2a748a0561a55ee515c2"
] | [
"pygfunction/examples/fluid_temperature.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\" Example of simulation of a geothermal system and comparison between\n single and double U-tube pipe configurations.\n\n The g-function of a single borehole is calculated for boundary condition of\n uniform borehole wall temperature along the borehole. Then, the borehole\n ... | [
[
"numpy.ceil",
"numpy.array",
"numpy.sin",
"numpy.zeros",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"numpy.cos",
"numpy.linspace",
"numpy.floor"
]
] |
ncfrey/matminer | [
"5a688de8f2c7eaf5109d34d58ab7875cfe980e48"
] | [
"matminer/featurizers/site/tests/test_fingerprint.py"
] | [
"import unittest\n\nimport numpy as np\nimport pandas as pd\nfrom pymatgen.util.testing import PymatgenTest\n\nfrom matminer.featurizers.site.fingerprint import (\n AGNIFingerprints,\n OPSiteFingerprint,\n CrystalNNFingerprint,\n VoronoiFingerprint,\n ChemEnvSiteFingerprint,\n)\nfrom matminer.featuri... | [
[
"pandas.DataFrame",
"numpy.exp",
"numpy.sqrt",
"numpy.cos",
"numpy.logspace"
]
] |
microsoft/KID | [
"a23e9d819b53605b6426170124feed10288c6f8b"
] | [
"KID/agent/kid_agent.py"
] | [
"import colorama\nimport spacy\nimport torch\nimport torch.nn.functional as F\nfrom nltk.corpus import stopwords\nfrom spacy.pipeline import EntityRuler\nfrom spacy.tokens import Token\nfrom transformers import GPT2Tokenizer\n\nfrom KID.agent import BaseAgent\nfrom KID.agent.agent_utils import calc_banned_ngram_tok... | [
[
"torch.cat",
"torch.sum",
"torch.multinomial",
"torch.nn.functional.softmax",
"torch.empty",
"torch.topk"
]
] |
eth-nn/beatsaver-Predictor | [
"406da15ed6d6cec7263817f8cc29c7c8242226cb"
] | [
"project-code/scripts/mongoInterface.py"
] | [
"import pymongo\nimport csvHandler as fiHandl\nimport pandas as pd\nimport numpy as np\nfrom pymongo import MongoClient\nimport pandasCleaning as pdClean\nimport hashlib\nimport pickle\nfrom datetime import datetime\n\n# To setup a local db for testing use\n# docker run -d -p 27017-27019:27017-27019 --net-alias mon... | [
[
"pandas.DataFrame"
]
] |
newsch/hairy_plotter | [
"305bda0442f5caf99d64af0ef01c0ed8b19cc61b"
] | [
"font.py"
] | [
"#!/usr/bin/env python3\nfrom typing import List, Dict, Tuple, NamedTuple, Generator, Mapping, Iterable\n\nimport matplotlib.pyplot as plt\n\nimport gcode as g\n\n\nCoordinate = Tuple[int, int]\nPath = List[Coordinate]\nCharpath = List[Path]\n\nclass Glyph(NamedTuple):\n left: int\n right: int\n paths: Cha... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.axis"
]
] |
cjx93/pytorch | [
"913ad7e335ff52fb5a02a06525fcc45cfe4385ff"
] | [
"ex04_fashion_inf_val.py"
] | [
"import torch\nfrom torch import nn, optim\nimport torch.nn.functional as F \nfrom torchvision import datasets, transforms\nimport numpy as np \nfrom collections import OrderedDict\nimport os.path\nimport matplotlib.pyplot as plt \n\ntorch.manual_seed(7)\n\nclass Layer(nn.Module):\n def __init__(self):\n ... | [
[
"torch.nn.NLLLoss",
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.save",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"torch.no_grad",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.load",
"matplotlib.pyplot.show",
"torch.exp"
]
] |
ViCCo-Group/THINGSvision | [
"27273564631605639287f9b3bd3c57ba8cdb720f"
] | [
"thingsvision/model_class.py"
] | [
"import re\nfrom typing import Tuple, List, Iterator, Dict, Any\n\nimport numpy as np \n\nfrom PIL import Image\nfrom numpy.core.fromnumeric import resize\n\nimport tensorflow as tf\nfrom tensorflow import keras\nimport tensorflow.keras.applications as tensorflow_models\nfrom tensorflow.keras import layers\n\nimpor... | [
[
"torch.nn.Linear",
"torch.device",
"torch.cat",
"torch.unique",
"numpy.asarray",
"torch.no_grad",
"tensorflow.keras.models.Model",
"torch.hub.load_state_dict_from_url",
"torch.load",
"torch.nn.functional.softmax",
"tensorflow.nn.softmax",
"numpy.vstack"
]
] |
BieglersGroup/NewCuterDEP | [
"194be01b1011958d129064f2c6f928d3f5b35895"
] | [
"performance_py/plot_performance1.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport re\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport subprocess\nimport sys\n\n__author__ = \"David Thierry\" #: @2018\n\n\ndef main():\n permuted = True\n vanilla_name = \"vanilla\" #: ch... | [
[
"matplotlib.pyplot.setp",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.close",
"numpy.min",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.ylabel",
"numpy.lin... |
aolopez/SimpleML | [
"9e3237c243863400372a493164a107b74f770ef0"
] | [
"simpleml/tests/unit/test_projected_splits.py"
] | [
"'''\nProjected Split related tests\n'''\n\n__author__ = 'Elisha Yadgaran'\n\n\nimport unittest\nimport pandas as pd\nimport numpy as np\n\nfrom unittest.mock import MagicMock, patch, PropertyMock\nfrom abc import ABCMeta, abstractmethod\n\nfrom simpleml.datasets.base_dataset import Dataset\nfrom simpleml.datasets.... | [
[
"pandas.testing.assert_frame_equal",
"numpy.ones",
"pandas.testing.assert_series_equal",
"numpy.testing.assert_equal"
]
] |
doizuc/HyperInSPACE | [
"79c2d83f14387ddb3d687d1ba0137c4e5c136862"
] | [
"Source/ZhangRho.py"
] | [
"# import argparse\nimport collections\nfrom functools import partial\nimport pathlib\nimport sys\nimport time\n\nimport numpy as np\nfrom scipy.interpolate import interpn\nimport xarray as xr\n\nfrom Utilities import Utilities # optional, see printProgressBar below\n\nπ = np.pi\n\ndb_path = './Data/Zhang_rho_db.ma... | [
[
"numpy.arccos",
"numpy.ones_like",
"numpy.argmin",
"numpy.tan",
"numpy.exp",
"numpy.mean",
"numpy.cos",
"numpy.deg2rad",
"numpy.sin",
"numpy.swapaxes",
"numpy.arange",
"numpy.conj",
"numpy.sqrt",
"numpy.array",
"numpy.reshape",
"numpy.matmul",
"n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.