repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
sbis04/blazepose-oak | [
"a991abf4d190a172d4264011520503e529fc465a"
] | [
"BlazeposeDepthai.py"
] | [
"'''\n@author: geaxgx, Soumi7, sbis04\n'''\n\n# import time\nimport argparse\nimport csv\nimport os\nfrom math import acos, atan2\nfrom pathlib import Path\nimport numpy as np\nimport cv2\nimport depthai as dai\nimport numpy as np\nimport open3d as o3d\nimport subprocess as sp\n\nimport mediapipe_utils as mpu\nfrom... | [
[
"numpy.hstack",
"numpy.dot",
"numpy.expand_dims",
"numpy.abs",
"numpy.asarray",
"numpy.degrees",
"numpy.linalg.norm",
"numpy.arccos",
"numpy.copy",
"numpy.array"
]
] |
beetrootpaul/corrscope | [
"ca3d4ae61e66de2907fd01004afe23af8f5d374a",
"ca3d4ae61e66de2907fd01004afe23af8f5d374a"
] | [
"corrscope/generate/__init__.py",
"corrscope/utils/scipy/signal.py"
] | [
"from typing import List\n\nimport attr\nimport matplotlib as mpl\nimport matplotlib.colors\nimport numpy as np\n\nTWOPI = 2 * np.pi\n\n\n@attr.dataclass\nclass Palette:\n unclipped: np.ndarray\n clipped: List[str]\n\n\ndef gen_circular_palette() -> Palette:\n \"\"\"Return a palette of 12 *distinct* colors... | [
[
"numpy.linspace",
"numpy.clip",
"numpy.min",
"numpy.cos",
"matplotlib.colors.to_hex",
"numpy.sin",
"numpy.ones",
"numpy.max",
"numpy.column_stack"
],
[
"numpy.asarray",
"numpy.fft.irfft",
"numpy.fft.rfft"
]
] |
ss892714028/3d_search | [
"e8ff3d5790d5fa072ade04f4fbb71688f980f2e4"
] | [
"preprocess_npy.py"
] | [
"import glob as glob\nimport numpy as np\nimport os\nimport pymesh\nimport traceback\nfrom logging import Logger\nfrom config import SEARCH_FEATURE_PATH, LOAD_FEATURE_PATH\nimport getopt\nimport sys\n\n\ndef find_neighbor(faces, faces_contain_this_vertex, vf1, vf2, except_face):\n for i in (faces_contain_this_ve... | [
[
"numpy.savez",
"numpy.sqrt",
"numpy.min",
"numpy.concatenate",
"numpy.max",
"numpy.array"
]
] |
robinvanemden/TotemBobbiScripts | [
"675774ab407dce762d1d4dd20a68fc41a9676cf8"
] | [
"import_bobbi.py"
] | [
"#######################################################################\n#\n# import_bobbi.py\n#\n# Code: Robin van Emden - robin at pavlov.tech - 2017\n#\n# Totem Bobbi: http://www.totemopenhealth.com/\n#\n#######################################################################\n\nimport pandas as pd\nimport ma... | [
[
"pandas.read_csv",
"pandas.read_pickle",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show"
]
] |
EnriqueL8/qiskit-terra | [
"08b801f1f8598c4e44680b4a75c232ed92db0262",
"08b801f1f8598c4e44680b4a75c232ed92db0262"
] | [
"qiskit/providers/basicaer/unitary_simulator.py",
"qiskit/quantum_info/operators/scalar_op.py"
] | [
"# -*- coding: utf-8 -*-\n\n# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2017.\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.\... | [
[
"numpy.einsum",
"numpy.reshape",
"numpy.eye",
"numpy.linalg.norm",
"numpy.shape",
"numpy.array"
],
[
"numpy.eye",
"numpy.product",
"numpy.abs",
"numpy.conjugate"
]
] |
M155K4R4/TabR | [
"907a4d10589f29ab6a3774ef4c3fdeca98becfbc"
] | [
"Chapter08/ch02_predict.py"
] | [
"import matplotlib\nmatplotlib.use('Agg')\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# initialization\nnp.random.seed(100)\nalpha, sigma = 0.5, 0.5\nbeta = [1, 2.5]\nsize = 100\n\n# Predictor variable\nX1 = np.random.randn(size)\nX2 = np.random.randn(size) * 0.37\n\n# Simulate outcome variable\nY = a... | [
[
"numpy.random.seed",
"matplotlib.use",
"matplotlib.pyplot.subplots",
"numpy.random.randn",
"matplotlib.pyplot.grid"
]
] |
SNSerHello/detectron2 | [
"3cc9908ba3301785ec946ae7e37d7091fa1d5045"
] | [
"projects/DensePose/densepose/modeling/hrfpn.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n\"\"\"\nMIT License\nCopyright (c) 2019 Microsoft\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including withou... | [
[
"torch.nn.ConvTranspose2d",
"torch.cat",
"torch.nn.init.constant_",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.init.kaiming_normal_"
]
] |
Fuinn/mos-examples | [
"e7badef779f0918c6d09a52db00eb8f890234b57"
] | [
"examples/cvxpy/maxflow/maxflow_model.py"
] | [
"#@ Model: Max flow\n#@ Description: Model to find maximum flow across a network $$\\max x_{50}$$$$\\sum_k x_{ki}=\\sum_j x_{ij},\\quad\\forall i$$$$0 \\leq x_{ij} \\leq k_{ij},\\quad\\forall i,j$$\n\nimport cvxpy as cp\nimport numpy as np\nimport json\n\n\n#@ Helper Object: k\n#@ Description: Capacity of edges\nk ... | [
[
"numpy.array"
]
] |
helgeerbe/pi3d | [
"4ddc3cd6aab139602b4283015049e372a0c3530a"
] | [
"pi3d/util/Utility.py"
] | [
"import copy\nimport bisect\n\nfrom ctypes import c_float\nfrom numpy import subtract, dot, divide, sqrt as npsqrt\nfrom math import sqrt, sin, cos, tan, radians, pi, acos\n\nfrom pi3d.util.Ctypes import c_bytes\n\ndef normalize_v3(arr):\n ''' Normalize a numpy array of 3 component vectors shape=(n,3) '''\n l... | [
[
"numpy.dot",
"numpy.subtract",
"numpy.sqrt",
"numpy.divide"
]
] |
larsoner/statsmodels | [
"898ddfc483c45bb0f8e5156dd8506abda84c9b63"
] | [
"statsmodels/regression/recursive_ls.py"
] | [
"\"\"\"\nRecursive least squares model\n\nAuthor: Chad Fulton\nLicense: Simplified-BSD\n\"\"\"\nfrom __future__ import division, absolute_import, print_function\n\nfrom warnings import warn\nfrom statsmodels.compat.collections import OrderedDict\n\nimport numpy as np\nimport pandas as pd\nfrom statsmodels.regressio... | [
[
"scipy.stats.norm.ppf",
"numpy.inner",
"numpy.sqrt",
"numpy.asarray",
"numpy.arange",
"numpy.eye",
"numpy.cumsum",
"pandas.DataFrame",
"numpy.std",
"numpy.asanyarray",
"numpy.array",
"numpy.zeros"
]
] |
marioguenzel/arr_curve | [
"af3b59cb4f5eaab52d12232c7ac1d63cd8e978f9"
] | [
"schedTest/OurAnalysis.py"
] | [
"# Schedulability test from our paper.\n\nimport itertools\nimport math\nimport numpy as np\n\n\ndef _WCRT_bound(\n ind, # index of task under analysis\n tasks, # set of tasks\n arr, # arrival curves\n xvec, # vector of x\n wcrtvec, # vector of WCRT bounds for higher priority tasks\n inda # ... | [
[
"numpy.log",
"numpy.exp"
]
] |
RedFT/HexTiler | [
"e31d27b37db100b2cabd25803489e53cf41b8b52"
] | [
"hextiler/selection_tile.py"
] | [
"import numpy as np\n\nimport hexy as hx\nfrom hextiler.draw import make_hex_surface\n\n\nclass SelectionTile(hx.HexTile):\n def __init__(self, axial_coordinates, border_color, radius):\n self.axial_coordinates = np.array([axial_coordinates])\n self.cube_coordinates = hx.axial_to_cube(self.axial_co... | [
[
"numpy.array"
]
] |
MalcolmSlaney/audio-to-tactile | [
"8c1fa37509aa53307f24dc7d54e99f730a8bcc1f"
] | [
"extras/python/phonetics/classify_phoneme_test.py"
] | [
"# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n# use this file except in compliance with the License. You may obtain a copy of\n# the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"numpy.random.rand",
"numpy.random.seed"
]
] |
Micro-Masters/AI | [
"0696efd4114d5a7a5d659c9ab77dff6feb3abdd9"
] | [
"misc/ObservationsResearch/random_agent_obs.py"
] | [
"# Copyright 2017 Google Inc. 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 required by app... | [
[
"numpy.random.randint",
"numpy.random.choice"
]
] |
AngusG/bn-adversarial-spheres | [
"91425eb95eba85c2977584d7d6a19f60fbd819ab"
] | [
"create_dataframe_fig6.py"
] | [
"import os\nimport argparse\nimport numpy as np\nfrom numpy.linalg import det, inv\nimport pandas as pd\n\n# for linear model\nimport torch\nimport torch.nn as nn\nimport torch.utils.data\n\nfrom ReLUNetwork import ReLUNetwork\n\nif __name__ == '__main__':\n\n parser = argparse.ArgumentParser(description='PyTorc... | [
[
"torch.nn.Softmax",
"torch.nn.CrossEntropyLoss",
"numpy.random.get_state",
"torch.max",
"numpy.random.seed",
"torch.manual_seed",
"torch.utils.data.TensorDataset",
"numpy.eye",
"torch.utils.data.DataLoader",
"numpy.linalg.norm",
"numpy.random.shuffle",
"torch.tensor... |
Wang-Yiran/insightface | [
"c2d9247f5e21a474084626660f3bce7f09edbfb2"
] | [
"src/api/face_model.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom scipy import misc\nimport sys\nimport os\nimport argparse\nimport tensorflow as tf\nimport numpy as np\nimport mxnet as mx\nimport random\nimport sklearn\nfrom sklearn.decomposition import PCA\nfr... | [
[
"numpy.square",
"numpy.dot",
"tensorflow.Graph",
"numpy.expand_dims",
"numpy.power",
"numpy.fliplr",
"numpy.asarray",
"numpy.squeeze",
"numpy.subtract",
"tensorflow.ConfigProto",
"numpy.max",
"sklearn.preprocessing.normalize",
"numpy.argmax",
"numpy.copy",
... |
pydojo/numexpr_zh | [
"3cc8eaa534373a80140229ef7ab79d1210f934a2"
] | [
"numexpr/necompiler.py"
] | [
"###################################################################\n# Numexpr - Fast numerical array expression evaluator for NumPy.\n#\n# License: MIT\n# Author: See AUTHORS.txt\n#\n# See LICENSE.txt and LICENSES/*.txt for details about copyright and\n# rights to use.\n#############################... | [
[
"numpy.asarray",
"numpy.array",
"numpy.float32"
]
] |
janzill/fast-trips | [
"02597df56ed152e9993374ba0502d0de444da234"
] | [
"tests/test_distance.py"
] | [
"from __future__ import print_function\nimport os\n\nimport numpy as np\nimport pandas as pd\nimport partridge as ptg\nimport pytest\n\nfrom fasttrips import Trip\nfrom fasttrips import Util\n\nTEST_NETWORKS = {\"Seattle_Region\": \"psrc_1_1\",\n \"Springfield\" : \"vermont\"}\n\nEXAMPLES_DIR = ... | [
[
"pandas.DataFrame"
]
] |
PatKing27/polarimetry-analysis | [
"0103b401c96b99fdba373205be274bc9e7350940"
] | [
"Rotator.py"
] | [
"#*******************************Rotator.py*************************************#\n#\n# Author: Patrick King, Date: 02/06/18\n#\n# Update (PKK) 04/17/18: Updates to ensure compatibility with Observer and\n# Observable.\n#\n#******************************************************************************#\n\nfrom ma... | [
[
"scipy.ndimage.interpolation.rotate",
"numpy.deg2rad",
"numpy.shape"
]
] |
intsco/deep-learning-v2-pytorch | [
"00c8e371b6dc783fc5638348d93c862de3609765"
] | [
"project-bikesharing/my_answers.py"
] | [
"import numpy as np\n\n\nclass NeuralNetwork(object):\n def __init__(self, input_nodes, hidden_nodes, output_nodes, learning_rate):\n # Set number of nodes in input, hidden and output layers.\n self.input_nodes = input_nodes\n self.hidden_nodes = hidden_nodes\n self.output_nodes = out... | [
[
"numpy.dot",
"numpy.multiply",
"numpy.random.normal",
"numpy.outer",
"numpy.exp",
"numpy.zeros"
]
] |
gehuangyi20/random_spiking | [
"c98b550420ae4061b9d47ca475e86c981caf5514",
"c98b550420ae4061b9d47ca475e86c981caf5514"
] | [
"RsNet/plot_transferability.py",
"RsNet/utils.py"
] | [
"import os\nimport sys\nimport matplotlib.pyplot as plt\nimport csv\nimport numpy as np\nimport json\nimport math\n\nargc = len(sys.argv)\nif argc < 2:\n print('usage: plot_transferability [dir] [filename]')\n sys.exit()\n\n_dir = sys.argv[1]\nimg_filename = sys.argv[2] if argc >= 3 else 'summary.png'\n\nconf... | [
[
"numpy.asarray",
"matplotlib.pyplot.figure"
],
[
"tensorflow.python_io.tf_record_iterator",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"numpy.argmax"
]
] |
anhnt170489/FunMOT | [
"6eb794bd485be42270eaee3804e13d38a897a945"
] | [
"src/lib/tracking_utils/evaluation.py"
] | [
"import os\nimport numpy as np\nimport copy\nimport motmetrics as mm\n\nmm.lap.default_solver = 'lap'\n\nfrom tracking_utils.io import read_results, unzip_objs\n\n\nclass Evaluator(object):\n\n def __init__(self, data_root, seq_name, data_type):\n self.data_root = data_root\n self.seq_name = seq_na... | [
[
"numpy.asarray",
"numpy.copy",
"numpy.isnan",
"pandas.ExcelWriter"
]
] |
binh-vu/sm-table | [
"d4fc761bc0ad71e4a1252dc06f363861a2a6712c"
] | [
"grams/algorithm/type_feature.py"
] | [
"from collections import defaultdict\nfrom typing import Dict, List\n\nimport networkx as nx\nimport numpy as np\n\nfrom grams.algorithm.data_graph import CellNode\nfrom grams.algorithm.literal_match import TextParser\nfrom grams.algorithm.semantic_graph import SGColumnNode\nfrom grams.inputs.linked_table import Li... | [
[
"numpy.mean"
]
] |
SJ-YI/HSRDEV | [
"8fa42bc41e337f0777e6980b37907dbd3c1067da"
] | [
"Run/datarecv.py"
] | [
"#!/usr/bin/env python\n# Copyright (C) 2016 Toyota Motor Corporation\nimport controller_manager_msgs.srv\nimport rospy\nimport math\nimport time\nimport datetime\n\nimport trajectory_msgs.msg\nimport actionlib\nimport control_msgs.msg\nimport geometry_msgs.msg\nimport os\nimport sys\nimport signal\n\nfrom sensor_m... | [
[
"numpy.fromstring"
]
] |
nam1665/voice_clone | [
"7808d6f80aa9bbaffe367fde07b1c6f96cd3697e"
] | [
"synthesizer/inference.py"
] | [
"from synthesizer.hparams import hparams\nfrom synthesizer.synthesizer import Synthesizer\nfrom synthesizer import audio\nfrom pathlib import Path\nfrom typing import Union, List\nimport tensorflow as tf\nimport numpy as np\nimport librosa\n\n_model = None # type: Synthesizer\nsample_rate = hparams.sample_rate\n\... | [
[
"tensorflow.train.get_checkpoint_state",
"tensorflow.reset_default_graph",
"numpy.abs"
]
] |
zprobs/representation-algorithm | [
"182219265f6056f01f04ed728200d35837b30932"
] | [
"tests/test.py"
] | [
"import unittest\nimport numpy as np\nimport pygambit\nimport os\n\nfrom representation import build_representation\n\n\nclass TestRepresentation(unittest.TestCase):\n def test_empty(self):\n empty_game = pygambit.Game.new_tree()\n empty_game.title = 'EFG'\n self.assertEqual(build_representa... | [
[
"numpy.array"
]
] |
vtlim/GLIC | [
"90e00e7030748c70ad284cda8785745b6c16ecbb"
] | [
"archive/contact_map.py"
] | [
"\n# https://contact-map.readthedocs.io/en/latest/examples/nb/contact_map.html\n\nimport os\nimport sys\nimport matplotlib.pyplot as plt\nimport mdtraj as md\nfrom contact_map import ContactMap, ContactFrequency, ContactDifference\n\ndef map_contacts(fname):\n\n traj = md.load(fname)\n contacts = ContactMap(t... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.ylabel"
]
] |
LihengXu/WPSS | [
"40eaa809ffb19447ab3c583440a1875c49523c10"
] | [
"controller.py"
] | [
"import numpy as np\nimport time\nimport pprint\nfrom collections import OrderedDict\nfrom keras import backend as K\nimport tensorflow as tf\nimport os\n\n\nclass StateSpace:\n \"\"\"\n State Space manager\n\n Provides utilit functions for holding \"states\" / \"actions\" that the controller\n must use... | [
[
"tensorflow.nn.dynamic_rnn",
"numpy.asarray",
"tensorflow.reduce_sum",
"tensorflow.cast",
"numpy.zeros_like",
"tensorflow.summary.scalar",
"tensorflow.Variable",
"tensorflow.get_collection",
"numpy.arange",
"tensorflow.layers.dense",
"tensorflow.train.exponential_decay"... |
mzurzolo/STBS | [
"0e3b5fcb88f7d488029ba71012787f36a2d97c70"
] | [
"Python/Projects/project3/project3.backup.py"
] | [
"\"\"\"Import statements tell python what packages you'll be using.\n\nYou can use 'as' to change how you refer to the package. In this file,\nI import matplotlib.pyplot as plt so I don't have to type out\n'matplotlib.pyplot' every time I want to use it.\n\"\"\"\nimport pandas as pd\nimport numpy as np\nimport matp... | [
[
"pandas.read_csv",
"numpy.linspace",
"numpy.cos",
"pandas.DataFrame",
"numpy.sin",
"matplotlib.pyplot.show"
]
] |
CameronPeloquin/Meteorite-Analysis | [
"095d567d1ae1dee795ded02abbcaa7596f8a33bc"
] | [
"plot_bar.py"
] | [
"\"\"\"\nContains code to plot a barplot of the counts for meteors in\nlow and high areas of population and vegetation.\n\"\"\"\nimport numpy as np\nimport pandas as pd\nimport geopandas as gpd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\n# Latitude above antarctica to filter out meteor strikes from i... | [
[
"matplotlib.pyplot.subplots",
"pandas.DataFrame",
"numpy.full",
"numpy.concatenate",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.close",
"matplotlib.pyplot.show"
]
] |
kuasho/scenario_runner | [
"600398852ab2dfac419b2cc8b6f0df8420b2bd0e"
] | [
"src/openface_utils/carla_utils.py"
] | [
"#!/usr/bin/env python \n# Javier Araluce\n\n# Copyright (c) 2019 Computer Vision Center (CVC) at the Universitat Autonoma de\n# Barcelona (UAB).\n#\n# This work is licensed under the terms of the MIT license.\n# For a copy, see <https://opensource.org/licenses/MIT>.\n\n# Allows controlling a vehicle with a keyboar... | [
[
"numpy.reshape",
"numpy.dtype",
"numpy.array",
"numpy.zeros",
"numpy.fabs"
]
] |
hvanwyk/quadmesh | [
"df4676dd469c2d3539443156df260e027e1bf871"
] | [
"tests/test_mesh/test_quadcell.py"
] | [
"from mesh import Vertex, HalfEdge, QuadCell\nfrom mesh import convert_to_array\nfrom assembler import GaussRule\nfrom plot import Plot\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport unittest\n\n\n\n\nclass TestQuadCell(unittest.TestCase):\n \"\"\"\n Test QuadCell Class\n \"\"\" \n def t... | [
[
"numpy.linalg.det",
"numpy.array",
"numpy.random.rand",
"numpy.allclose"
]
] |
softwaresaved/international-survey-lib | [
"79755294ecd6c6bd740cff4094b8a2417f6ede92"
] | [
"plotting.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport math\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom .likertScalePlot import likert_scale, get_colors\n\n\ndef plot_numeric_var(df):\n \"\"\"\n \"\"\"\n print(df.describe())\n n_bins = 40\n y_label = 'Frequenc... | [
[
"matplotlib.pyplot.legend",
"pandas.read_csv",
"matplotlib.pyplot.title",
"numpy.arange",
"matplotlib.pyplot.subplots",
"pandas.set_option",
"matplotlib.pyplot.xticks"
]
] |
iamryanmurray/metis | [
"97621bd7b9f7ed88cd27df877050926aa6425823"
] | [
"3-McNulty/random_forest_cv.py"
] | [
"from data_clean_script import *\nfrom sklearn.metrics import roc_curve, auc, roc_auc_score\nfrom sklearn.model_selection import RandomizedSearchCV\nfrom sklearn.ensemble import RandomForestClassifier\nimport matplotlib.pyplot as plt\nimport pickle\n\n\nX,y = split_with_bow()\nX_train, X_test, y_train, y_test = res... | [
[
"sklearn.model_selection.RandomizedSearchCV",
"sklearn.ensemble.RandomForestClassifier"
]
] |
JunnYu/GlyceBert_tokenizer | [
"27ded9d20421e274ec2e7139e9c79da56d8ad42f"
] | [
"src/chinesebert/modeling_chinesebert.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n@file : modeling_glycebert.py\n@author: zijun\n@contact : zijun_sun@shannonai.com\n@date : 2020/9/6 18:50\n@version: 1.0\n@desc : ChineseBert Model\n\"\"\"\nimport warnings\n\nimport torch\nfrom torch import nn\nfrom torch.nn import CrossEntropyLoss, MSELoss\nfrom transformers.m... | [
[
"torch.nn.CrossEntropyLoss",
"torch.nn.Dropout",
"torch.ones",
"torch.zeros",
"torch.tensor",
"torch.nn.Linear",
"torch.nn.MSELoss"
]
] |
patrickvonplaten/google-research | [
"2c0043ecd507e75e2df9973a3015daf9253e1467"
] | [
"tf3d/instance_segmentation/postprocessor_test.py"
] | [
"# coding=utf-8\n# Copyright 2020 The Google Research Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"numpy.array",
"tensorflow.random.uniform",
"tensorflow.test.main"
]
] |
chrisabbott/corenet | [
"1ba76ac7bad6b00d8b601eac83f105b83a6362a9"
] | [
"corenet/data/scene.py"
] | [
"# Copyright 2021 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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"torch.as_tensor"
]
] |
voschezang/Holographic-Projector-Simulations | [
"e127cf86093f15ed68c36592591e2eee196b5705"
] | [
"py/surf.py"
] | [
"import numpy as np\nimport subprocess\nimport os\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as tck\nfrom mpl_toolkits.mplot3d import Axes3D\nimport matplotlib.pyplot as plt\nfrom matplotlib import cm\nfrom matplotlib.ticker import LinearLocator, FormatStrFormatter\n\n# local\nimport plot\nimport an... | [
[
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.tight_layout",
"numpy.sqrt",
"matplotlib.pyplot.title",
"numpy.clip",
"numpy.linspace",
"matplotlib.pyplot.figure",
"numpy.ceil",
"matplotlib.ticker.EngFormatter",
"numpy.log10",
"matplotlib.pyplot.close",
"matplotlib.p... |
Nas-virat/CPE101 | [
"0d121540408fae12fb122876e3d6a7a3ad1b7503"
] | [
"augment.py"
] | [
"import cv2\nimport random\nimport numpy as np\nfrom tf_pose import common\nimport os\n\ndef fill(img, h, w):\n img = cv2.resize(img, (h, w), cv2.INTER_CUBIC)\n return img\n\ndef rotation(img, angle):\n angle = int(random.uniform(-angle, angle))\n h, w = img.shape[:2]\n M = cv2.getRotationMatrix2D((... | [
[
"numpy.array",
"numpy.float32"
]
] |
StevenKe8080/recognition_gender | [
"1cb226edd2c8bb2c678fc022847312fe36c75194"
] | [
"image_train.py"
] | [
"import random\nimport numpy as np\nfrom handle_image import get_file\nfrom sklearn.model_selection import train_test_split\nfrom keras.utils import np_utils\nfrom keras.models import Sequential,load_model\nfrom keras.layers import Dense,Activation,Convolution2D,MaxPooling2D,Flatten,Dropout\nfrom keras.optimizers i... | [
[
"numpy.argmax"
]
] |
lavanyashukla/ml-fairness-gym | [
"fb68b379d4284b7af746b2a051d518b3bd45ab00"
] | [
"agents/allocation_agents_test.py"
] | [
"# coding=utf-8\n# Copyright 2019 The ML Fairness Gym Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"numpy.abs",
"numpy.all",
"numpy.std",
"numpy.equal",
"numpy.array",
"numpy.sum",
"numpy.isclose"
]
] |
jhosoume/pymfe | [
"b454f8a5470ebd4dbbeb1a7e5570443dd65fdf9a"
] | [
"pymfe/statistical.py"
] | [
"\"\"\"A module dedicated to the extraction of statistical metafeatures.\"\"\"\nimport typing as t\nimport warnings\n\nimport numpy as np\nimport scipy\nimport sklearn.preprocessing\nimport sklearn.cross_decomposition\n\nimport pymfe._summary as _summary\n\n\nclass MFEStatistical:\n \"\"\"Keep methods for metafe... | [
[
"numpy.dot",
"numpy.asarray",
"numpy.all",
"numpy.max",
"numpy.argmin",
"numpy.any",
"numpy.exp",
"numpy.square",
"scipy.stats.trim_mean",
"numpy.unique",
"numpy.tril_indices",
"numpy.flatnonzero",
"numpy.asfarray",
"numpy.linalg.det",
"numpy.argmax",
... |
liulhdarks/code2vec | [
"e9be5bd56990f47a0c4d27c61b317a06d85c470d"
] | [
"model/main.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\n__author__ = 'lihua.llh'\n\nimport tensorflow as tf\nimport numpy as np\nfrom model.datas import *\nfrom model.model import *\nfrom model.iterator import *\nfrom sklearn.metrics import precision_score,... | [
[
"sklearn.metrics.f1_score",
"tensorflow.group",
"tensorflow.summary.scalar",
"tensorflow.graph_util.convert_variables_to_constants",
"tensorflow.Variable",
"tensorflow.ConfigProto",
"numpy.argmax",
"tensorflow.Session",
"tensorflow.train.Saver",
"tensorflow.app.run",
"t... |
NicEscobar/InertialNavigation | [
"85dffed6cf5c4063a097c3c9305f4ec92ce53623"
] | [
"main.py"
] | [
"#python3 main.py --device=/dev/ttyACM1 --baudrate=115200\n#https://www.youtube.com/watch?v=UGjjP45wrKQ\n\nfrom filtros import Filtros\nfrom sensores import Sensores\nfrom gps import GPS\nfrom calc_algebra import Calc_Algebra\n\nimport time\nimport RPi.GPIO as gpio\nimport threading\nimport sys, os\nimport numpy as... | [
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.Figure",
"matplotlib.use",
"pandas.DataFrame",
"matplotlib.pyplot.show"
]
] |
SGyutan/streamlit_aggrid | [
"3459b39c9f6109975fc99be2818738009fd039f1"
] | [
"tut_2.py"
] | [
"# tut1.py\r\nimport pandas as pd\r\nimport streamlit as st\r\nfrom st_aggrid import AgGrid\r\nfrom st_aggrid.grid_options_builder import GridOptionsBuilder\r\n\r\nst.set_page_config(page_title=\"Netflix Shows\", layout=\"wide\") \r\nst.title(\"Netlix shows analysis\")\r\n\r\nshows = pd.read_csv(\"netflix_titles.cs... | [
[
"pandas.read_csv"
]
] |
jimmycdunn/transition-risk-tool | [
"64dfcfdb84f24ae3cccc58ad966170223c9f0dfc"
] | [
"ffequity/utils/dataframefile.py"
] | [
"import pandas as pd\nfrom datetime import datetime, date\n\n\nclass DataFrameFileException(Exception):\n pass\n\n\nclass DataFrameFile:\n \"\"\" Wrapper around dataframe supporting file operations\"\"\"\n def __init__(self, data=None):\n self.data = data\n\n def read(self, fileName):\n \"... | [
[
"pandas.read_csv"
]
] |
benpetit/cs379c | [
"81a67d49188bc7358653bd24dd9d8bb2e9264aba"
] | [
"network.py"
] | [
"import numpy as np\nimport tensorflow as tf\nimport tensorflow.contrib.layers as layers\n\nfrom rlsaber.tf_util import lstm, batch_to_seq, seq_to_batch\n\n\ndef make_cnn(convs, padding, inpt, initializer=None):\n if initializer is None:\n initializer = tf.orthogonal_initializer(np.sqrt(2.0))\n out = i... | [
[
"tensorflow.contrib.layers.convolution2d",
"tensorflow.nn.softmax",
"tensorflow.concat",
"tensorflow.distributions.Normal",
"numpy.sqrt",
"tensorflow.zeros_initializer",
"tensorflow.exp",
"tensorflow.contrib.layers.fully_connected",
"tensorflow.orthogonal_initializer",
"ten... |
omjawade/Medidoc | [
"ff36c8404b9cb943398f9aae3eec18ed1bf29f49"
] | [
"DiabetesLinearReg.py"
] | [
"import pandas as pd\r\nfrom sklearn.linear_model import LinearRegression\r\nimport pickle\r\nfrom sklearn import svm\r\ndf = pd.read_csv(\"data/diabetes.csv\")\r\n#use required features\r\n# cdf = df[['ENGINESIZE','CYLINDERS','FUELCONSUMPTION_COMB','CO2EMISSIONS']]\r\n\r\n#Training Data and Predictor Variable\r\n#... | [
[
"pandas.read_csv",
"sklearn.svm.SVC"
]
] |
yashchandak/GNN | [
"818d1aa25bd50a65bff3577758306d2e6c591100",
"818d1aa25bd50a65bff3577758306d2e6c591100",
"818d1aa25bd50a65bff3577758306d2e6c591100"
] | [
"Sample_Run/Seq_att/cells.py",
"Sample_Run/Dynamic_Bi/__main__.py",
"Sample_Run/Seq_Dynamic/Eval_utils.py"
] | [
"import tensorflow as tf\nfrom tensorflow.python.ops.rnn_cell import RNNCell\nimport numpy as np\n\n\nclass MyLSTMCell(RNNCell):\n '''Vanilla LSTM implemented with same initializations as BN-LSTM'''\n\n def __init__(self, num_units):\n self.num_units = num_units\n\n @property\n def state_size(sel... | [
[
"numpy.linalg.svd",
"tensorflow.get_variable",
"tensorflow.constant",
"tensorflow.concat",
"tensorflow.matmul",
"tensorflow.sigmoid",
"numpy.random.normal",
"tensorflow.tanh",
"numpy.identity",
"numpy.prod",
"tensorflow.split",
"numpy.zeros"
],
[
"tensorflow... |
franprix/intake-excel | [
"b2c56d4513bef66240f476f31d7fdb72911da53d"
] | [
"tests/test_intake_excel.py"
] | [
"import pandas as pd\n\nimport intake\nfrom intake_excel import ExcelSource\n\nfrom .utils import temp_plain_excel, df\n\ndef test_fixture(temp_plain_excel):\n d2 = pd.read_excel('temp_plain_excel.xlsx')\n assert df.equals(d2)\n\ndef test_simple(temp_plain_excel):\n d2 = ExcelSource('temp_plain_excel.xlsx'... | [
[
"pandas.read_excel"
]
] |
aureguerrero/sahi | [
"fe3e8521d9ac91d7c2f431a8907bb4b8af668d30"
] | [
"sahi/prediction.py"
] | [
"# OBSS SAHI Tool\n# Code written by Fatih C Akyon, 2020.\n\nimport copy\nfrom typing import Dict, List, Optional, Union\n\nimport numpy as np\nfrom PIL import Image\nfrom osgeo import gdal, ogr\nimport matplotlib.pyplot as plt\nfrom sklearn.linear_model import HuberRegressor\nfrom sklearn.linear_model import Theil... | [
[
"numpy.poly1d",
"numpy.expand_dims",
"numpy.sqrt",
"numpy.max",
"numpy.zeros_like",
"numpy.mean",
"numpy.where",
"numpy.stack",
"numpy.zeros",
"sklearn.linear_model.TheilSenRegressor",
"numpy.min",
"scipy.ndimage.rotate",
"numpy.array",
"numpy.fft.ifft2",
... |
joshuahigginson1/Python_Colour_Tools | [
"ded69c0ab92e62c0b5472bb3c9cf63089b1b844b"
] | [
"application/modules/average_colour.py"
] | [
"\"\"\"Task: This module finds the average colour of a polygon selection.\"\"\"\n\n# Imports --------------------------------------------------------------\nfrom skimage import draw\nimport numpy\n\n\n# Functions ------------------------------------------------------------\n\ndef ave_colour_from_selection(image, po... | [
[
"numpy.average"
]
] |
gaugup/DiCE | [
"41dfde376ec3e5471d8e04899e639d2621b987f3"
] | [
"tests/test_dice_interface/test_dice_pytorch.py"
] | [
"import numpy as np\nimport pytest\n\nimport dice_ml\nfrom dice_ml.utils import helpers\n\ntorch = pytest.importorskip(\"torch\")\n\n@pytest.fixture\ndef pyt_exp_object():\n backend = 'PYT'\n dataset = helpers.load_adult_income_dataset()\n d = dice_ml.Data(dataframe=dataset, continuous_features=['age', 'ho... | [
[
"numpy.random.seed"
]
] |
billgoo/Rutgers-CS596-Topics-in-the-Foundations-of-Computer-Science | [
"ba4dbe59ef3a4ab625cee47e6a21886785dc19d5"
] | [
"Assignments/hw4_solution/problem3.py"
] | [
"import random\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.scale as sc\n\n# numpy.random.normal(loc=0.0, scale=1.0, size=(m, n, k))\nLENGTH = 5\nTHETA_STAR = np.array([25, 22, 16, 132, 66])\nMU = 0.01\n\ndef generate_samples(t, length):\n X = np.random.normal(size=(t, length))\n W ... | [
[
"matplotlib.pyplot.semilogy",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"numpy.linalg.norm",
"matplotlib.pyplot.plot",
"numpy.random.normal",
"matplotlib.pyplot.xlabel",
"numpy.array",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
mike-holcomb/tensorflow | [
"a331eaf593bb91eaafd8953f1bd7d502eaeee53a"
] | [
"tensorflow/contrib/distribute/python/keras_correctness_test_base.py"
] | [
"# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"numpy.sum",
"numpy.random.seed",
"tensorflow.python.data.ops.dataset_ops.Dataset.from_tensor_slices",
"tensorflow.python.eager.test.main",
"numpy.reshape",
"numpy.asarray",
"numpy.random.choice",
"tensorflow.python.keras.backend.set_image_data_format",
"tensorflow.python.keras... |
Thanh-Nguyen91/Facial_keypoints_detection | [
"fe0a55d9cbb0d55f1d35fe21189a8edb0fb7e637"
] | [
"models.py"
] | [
"## TODO: define the convolutional neural network architecture\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n# can use the below import should you choose to initialize the weights of your Net\nimport torch.nn.init as I\n\n\nclass Net(nn.Module):\n\n def __init__(self):\n super(N... | [
[
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.Dropout",
"torch.nn.Conv2d"
]
] |
UM-LoCoLab/NeuroLocoMiddleware | [
"0dfedeed8d6d8a41518b357b33ee92324b5029c3"
] | [
"test/test_linear_filter.py"
] | [
"from FindLibrariesWarning import *\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport LinearFilter as lf\nimport SysID as sid\nimport frequency_analysis as fa\n\n\n\ndef run_test(times, chirp, system, axs, **kwargs):\n\tN = len(times)\n\tus, ys = np.zeros((N,)), np.zeros((N,))\n\tfor i, t in enumerate(ti... | [
[
"numpy.linspace",
"numpy.logspace",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"numpy.zeros",
"matplotlib.pyplot.figure"
]
] |
SharpZKing/PaddleX | [
"e1306a90811df2cca24fa5fb3bfdf5a170037f17"
] | [
"paddlex/interpret/core/_session_preparation.py"
] | [
"#copyright (c) 2020 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 required ... | [
[
"numpy.load",
"numpy.array"
]
] |
hannah-thompson/Sound-Visualization | [
"040e13febd5220378e1df2d3e227dc32624aa6b2"
] | [
"code/bokeh_practice.py"
] | [
"import pyaudio\nimport wave\nfrom bokeh.layouts import gridplot\nfrom bokeh.plotting import figure, output_file, show\nimport numpy as np\n\n\n# example code for PyAudio\n#p = pyaudio.PyAudio()\n\n#stream = p.open() # need to put arguments in here\n\n# Code to play around with Bokeh\n\n# fake data\nN = 100\nx = np... | [
[
"numpy.linspace",
"numpy.sin"
]
] |
dsei210s19-applied-ml-and-dm/OPTMOD | [
"85edea79284097cfaeeaa8eb0be3c9595b4a733f"
] | [
"tests/test_multiply.py"
] | [
"import optmod\nimport unittest\nimport numpy as np\n\nclass TestMultiply(unittest.TestCase):\n\n def test_contruction(self):\n\n x = optmod.variable.VariableScalar(name='x')\n f = optmod.function.multiply([x, optmod.expression.make_Expression(1.)])\n self.assertTrue(isinstance(f, optmod.fun... | [
[
"numpy.random.random",
"numpy.sin"
]
] |
vrushank-agrawal/video_editor_BX23 | [
"3a458114f499e0ba3d1c61afde2b9d30bc76459b"
] | [
"src/audio/aubio/python/tests/test_onset.py"
] | [
"#! /usr/bin/env python\n\nfrom numpy.testing import TestCase, assert_equal, assert_almost_equal\nfrom aubio import onset, fvec\n\nclass aubio_onset_default(TestCase):\n\n def test_members(self):\n o = onset()\n assert_equal ([o.buf_size, o.hop_size, o.method, o.samplerate],\n [1024,512,... | [
[
"numpy.testing.assert_equal"
]
] |
xinkeyu/stanfordnlp | [
"f678a6c4003c2e48caf7957b9aba8bc8fa9a3327"
] | [
"stanfordnlp/models/pos/data.py"
] | [
"import random\nimport torch\n\nfrom stanfordnlp.models.common.data import map_to_ids, get_long_tensor, get_float_tensor, sort_all\nfrom stanfordnlp.models.common import conll\nfrom stanfordnlp.models.common.vocab import PAD_ID, VOCAB_PREFIX\nfrom stanfordnlp.models.pos.vocab import CharVocab, WordVocab, XPOSVocab,... | [
[
"torch.eq"
]
] |
KarolBedkowski/marketools | [
"4f4a25407916bf9077c7e264ab6e6053d893b218"
] | [
"tests/test_analysis/test_moving_average.py"
] | [
"import pytest\nfrom marketools.analysis.moving_average import simple_moving_average, weighted_moving_average, exponential_moving_average\nimport pandas as pd\nimport numpy as np\n\n\n@pytest.fixture\ndef NineDayPrices():\n prices = np.array([3.37, 4.21, 4.10, 3.90, 3.79, 3.76, 3.65, 3.75, 3.88])\n df = pd.Da... | [
[
"numpy.array",
"pandas.DataFrame"
]
] |
sachio222/aha4 | [
"ec378fe1bace85e325ad7cb8686b8ba321dc97d0"
] | [
"train.py"
] | [
"\"\"\"\nTitle: train.py\nAuthor: J. Krajewski\nCopyright: 2020\nLicense:\nDescription: Training for model implemented from 2019 paper\n \"AHA an Artificial Hippocampal Algorithm for Episodic Machine \n Learning\" by Kowadlo, Ahmed and Rawlinson.\n\n Runs image through EC, DG / E... | [
[
"torch.cuda.manual_seed",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.nn.BCELoss",
"torch.no_grad",
"torch.cuda.is_available",
"torch.nn.MSELoss"
]
] |
tupui/ray | [
"c5edd82c63438ae15be18a605eea4a962870a4be"
] | [
"python/ray/data/tests/test_dataset.py"
] | [
"import math\nimport os\nimport random\nimport requests\nimport time\n\nimport numpy as np\nimport pandas as pd\nimport pyarrow as pa\nimport pyarrow.parquet as pq\nimport pytest\n\nimport ray\n\nfrom ray.tests.conftest import * # noqa\nfrom ray.data.dataset import Dataset, _sliding_window\nfrom ray.data.datasourc... | [
[
"numpy.testing.assert_equal",
"pandas.concat",
"pandas.testing.assert_series_equal",
"numpy.testing.assert_array_almost_equal",
"numpy.array_equal",
"pandas.Series",
"torch.cat",
"numpy.arange",
"numpy.int32",
"pandas.DataFrame",
"torch.tensor",
"numpy.testing.asser... |
normster/weird-airflow | [
"c39e4f6aa45d0f7581410e9c0f42ab56cbf30785"
] | [
"airflow/www/views.py"
] | [
"# -*- coding: utf-8 -*-\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 agreed to in wri... | [
[
"pandas.set_option",
"pandas.to_datetime"
]
] |
Abner0627/Traffic-Sign-Classifier | [
"c11ea480c842a25696653ee1275ca15a1891d067"
] | [
"func.py"
] | [
"import numpy as np\n\n\ndef _norm(x, Z=True):\n x_n = np.zeros_like(x)\n for n in range(x.shape[0]):\n xs = x[n,...]\n for i in range(xs.shape[0]):\n xss = xs[i,:,:]\n x_mu = np.mean(xss)\n if Z:\n x_std = np.std(xss)\n x_n[n,i,:,:]... | [
[
"numpy.dot",
"numpy.min",
"numpy.max",
"numpy.std",
"numpy.mean",
"numpy.zeros_like",
"numpy.random.rand",
"numpy.zeros"
]
] |
xumingze0308/eLR-WACV2018 | [
"ac2ef36f6272f02c44fb862c9f6d63140349eb6b"
] | [
"tools/pretrained_spatial_temporal_rnn_bidir/eval.py"
] | [
"import os\nimport os.path as osp\nimport sys\nimport time\n\nimport torch\nimport torch.nn as nn\nimport torch.utils.data as data\nfrom torch.nn.utils.rnn import pack_padded_sequence\n\nimport _init_paths\nimport utils as utl\nfrom configs.hmdb51 import parse_hmdb51_args as parse_args\nfrom datasets import HMDB51D... | [
[
"torch.nn.Softmax",
"torch.LongTensor",
"torch.zeros",
"torch.load",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.set_grad_enabled",
"torch.cuda.is_available"
]
] |
AhmedIdr/FARM | [
"b65c6985f9301e6e8c1cd491124477098ff1621d"
] | [
"farm/infer.py"
] | [
"import os\nimport torch\n\nfrom torch.utils.data.sampler import SequentialSampler\n\nfrom farm.data_handler.dataloader import NamedDataLoader\nfrom farm.modeling.adaptive_model import AdaptiveModel\n\nfrom farm.utils import initialize_device_settings\nfrom farm.data_handler.processor import Processor\nfrom farm.ut... | [
[
"torch.utils.data.sampler.SequentialSampler",
"torch.no_grad"
]
] |
Cloud-PG/smart-cache | [
"467987abece3fd4830fd615288046359761229f8"
] | [
"scripts/DataAnalysis/clean_csv.py"
] | [
"import gzip\nfrom os import path, walk, makedirs\nfrom sys import argv\n\nimport pandas as pd\n\n\ndef main():\n source_folder = argv[1]\n out_folder = f\"{source_folder}_clean\"\n makedirs(out_folder, exist_ok=True)\n for root, _, files in walk(source_folder):\n for file_ in files:\n ... | [
[
"pandas.read_csv"
]
] |
chyld/pytorch-image-classification | [
"484fe1b5bb234e4bf8b38938aae0bdfa3613d0d7"
] | [
"network.py"
] | [
"import torch\nfrom torch import nn\nfrom torch import optim\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nfrom torchvision import datasets, transforms, models\nfrom collections import OrderedDict\nimport numpy as np\n\n\nclass Network:\n\n ### -------------------------------------------... | [
[
"torch.nn.NLLLoss",
"torch.nn.Dropout",
"torch.nn.LogSoftmax",
"torch.exp",
"torch.nn.Linear",
"torch.save",
"torch.FloatTensor",
"torch.cuda.is_available",
"torch.topk",
"torch.nn.ReLU",
"numpy.array",
"torch.autograd.Variable"
]
] |
Cl3V0r/MLSeminar | [
"d05f171a9b7d773ea123e1919e07312a7f0c9fe8"
] | [
"python/RNN.py"
] | [
"import pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Dropout, Flatten, SimpleRNN, LeakyReLU, LSTM, SpatialDropout1D, Conv1D, MaxPooling1D\nfrom keras.preprocessing.text import one_hot, Tokenizer\nfrom keras.preprocessing.sequ... | [
[
"matplotlib.pyplot.legend",
"sklearn.metrics.confusion_matrix",
"matplotlib.pyplot.plot",
"sklearn.metrics.classification_report",
"matplotlib.pyplot.tight_layout",
"pandas.read_csv",
"matplotlib.pyplot.close",
"numpy.count_nonzero",
"matplotlib.pyplot.figure",
"matplotlib.... |
2piruben/langil | [
"e2e41d8d00f7de9a1ba1c014d4bac8b364dbd856"
] | [
"examples/CellCycleVariability/bursttrans.py"
] | [
"import numpy as np\nfrom math import factorial\n\ndef f(p,k,d):\n return k[:-1]/(k[1:]+p*d[1:]) \n # f has one elements rest than the rest\n\ndef sumfact(p,beta,r,k,d):\n\n s = np.zeros(len(k)-1)\n for j in range(p):\n s = s + factorial(p)/factorial(j)*beta[1:]**(p-j-1)*factorial_moment(j,... | [
[
"numpy.arange",
"numpy.cumsum",
"numpy.ones"
]
] |
crate19970523/keras_yolov3_01 | [
"fc62c3c520ffc9339b798344911aa45973157250"
] | [
"yolo.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nClass definition of YOLO_v3 style detection model on image and video\n\"\"\"\n\nimport colorsys\nimport os\nfrom timeit import default_timer as timer\n\nimport numpy as np\nfrom keras import backend as K\nfrom keras.models import load_model\nfrom keras.layers import Input\nfrom PIL... | [
[
"numpy.expand_dims",
"numpy.random.seed",
"numpy.asarray",
"numpy.random.shuffle",
"numpy.floor",
"numpy.array"
]
] |
mkskeller/EzPC | [
"f3cbdd46d014aee819c4a877911a709dffd345e5"
] | [
"Athos/TFCompiler/DumpTFMtData.py"
] | [
"'''\r\n\r\nAuthors: Nishant Kumar.\r\n\r\nCopyright:\r\nCopyright (c) 2018 Microsoft Research\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without ... | [
[
"tensorflow.compat.v1.get_default_graph",
"numpy.nditer",
"tensorflow.compat.v1.rsqrt",
"tensorflow.compat.v1.shape",
"tensorflow.compat.v1.disable_eager_execution"
]
] |
rob-nn/BuildingMachineLearningSystemsWithPython | [
"cf02b13a569126a46cf75200e85be3ecb410fc64"
] | [
"ch02/threshold.py"
] | [
"# This code is supporting material for the book\n# Building Machine Learning Systems with Python\n# by Willi Richert and Luis Pedro Coelho\n# published by PACKT Publishing\n#\n# It is made available under the MIT License\n\nimport numpy as np\n\n\n# This function was called ``learn_model`` in the first edition\nde... | [
[
"numpy.mean"
]
] |
JuliaChae/M3D-RPN-Waymo | [
"e73cba585563a094f67a2ba184a22330c134857c",
"e73cba585563a094f67a2ba184a22330c134857c"
] | [
"eval/rotate_iou.py",
"scripts/config/kitti_3d_multi_main.py"
] | [
"#####################\n# Based on https://github.com/hongzhenwang/RRPN-revise\n# Licensed under The MIT License\n# Author: yanyan, scrin@foxmail.com\n#####################\nimport math\n\nimport numba\nimport numpy as np\nfrom numba import cuda\n\n@numba.jit(nopython=True)\ndef div_up(m, n):\n return m // n + (... | [
[
"numpy.zeros"
],
[
"numpy.array"
]
] |
viz4biz/PyDataNYC2015 | [
"066154ea9f1837c355e6108a28b85889f3020da3"
] | [
"vtklib/datasources.py"
] | [
"\"\"\"\nData sources\n\"\"\"\n\nimport math\nimport numpy\n\nft = lambda n: n / 10.\n\n\ndef f(x, y):\n \"\"\"\n sample func\n \"\"\"\n return x * x - y * y\n\n\ndef fx(x, y):\n \"\"\"\n sample func\n \"\"\"\n return 2 * x - 2 * y\n\n\ndef g(x, y):\n \"\"\"\n sample func\n \"\"\"\n... | [
[
"matplotlib.mlab.griddata",
"numpy.linspace",
"numpy.random.seed",
"numpy.arange",
"numpy.sin",
"numpy.random.uniform",
"numpy.exp",
"numpy.random.randint"
]
] |
weslowrie/pymor | [
"6e283d03b413db5bb58e6d67ef467456d3a2bbf2",
"6e283d03b413db5bb58e6d67ef467456d3a2bbf2",
"e8b18d2d4c4b5998f0bd84f6728e365e0693b753"
] | [
"src/pymor/algorithms/gram_schmidt.py",
"src/pymor/algorithms/sylvester.py",
"src/pymortests/sylvester.py"
] | [
"# This file is part of the pyMOR project (http://www.pymor.org).\n# Copyright 2013-2020 pyMOR developers and contributors. All rights reserved.\n# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)\n\nimport numpy as np\n\nfrom pymor.core.defaults import defaults\nfrom pymor.core.exception... | [
[
"numpy.delete",
"numpy.abs"
],
[
"scipy.linalg.qz",
"scipy.linalg.schur"
],
[
"scipy.sparse.issparse",
"numpy.random.seed",
"numpy.eye",
"scipy.sparse.diags",
"numpy.ones",
"scipy.sparse.linalg.norm",
"numpy.random.randn",
"scipy.linalg.norm"
]
] |
TeamLasalle/RL-Project | [
"5a094c3fffa24a8e2f47952f0579339917a95636"
] | [
"python/RL/train.py"
] | [
"#-*- coding: utf-8 -*-\n\nfrom __future__ import print_function\n\nimport os\nimport time\nimport sys\nimport copy\n\nsys.path.append(\"python\")\nfrom model import Seq2Seq_chatbot\n# from inference import Inference\nfrom data_reader import Data_Reader\nimport data_parser\nimport config\nimport re\n\nfrom gensim.m... | [
[
"tensorflow.Graph",
"numpy.sum",
"tensorflow.InteractiveSession",
"numpy.asarray",
"numpy.ones",
"numpy.exp",
"numpy.max",
"numpy.random.normal",
"tensorflow.global_variables_initializer",
"tensorflow.train.Saver",
"tensorflow.get_default_graph",
"numpy.array",
... |
gag/onnx-coreml | [
"f6d331d0dc381d9c469e5c21a006ee6f5c704742"
] | [
"onnx_coreml/_transformers.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nfrom typing import Sequence, Text, Dict, List, Tuple\nimport numpy as np\n\nfrom onnx import TensorProto\n\nfrom ._graph import Graph, Node\n\n\nclass NodesFuse... | [
[
"numpy.expand_dims",
"numpy.take",
"numpy.multiply",
"numpy.asarray",
"numpy.squeeze",
"numpy.concatenate",
"numpy.transpose",
"numpy.zeros"
]
] |
ralzakark/keras-YOLOv3-model-set | [
"711fbc5298a94e3c0394fdfaecb777a3ef0aeb50"
] | [
"yolo3/loss.py"
] | [
"# -*- coding=utf-8 -*-\n#!/usr/bin/python3\n\nimport math\nimport tensorflow as tf\nfrom tensorflow.keras import backend as K\nfrom yolo3.postprocess import yolo3_decode\n\ndef softmax_focal_loss(y_true, y_pred, gamma=2.0, alpha=0.25):\n \"\"\"\n Compute softmax focal loss.\n Reference Paper:\n \"F... | [
[
"tensorflow.keras.backend.binary_crossentropy",
"tensorflow.keras.backend.floatx",
"tensorflow.minimum",
"tensorflow.keras.backend.log",
"tensorflow.keras.backend.dtype",
"tensorflow.keras.backend.maximum",
"tensorflow.boolean_mask",
"tensorflow.while_loop",
"tensorflow.keras.b... |
klydd/kalyumbasic-generator | [
"d676c7b110879e9470de0550325f137d0ac8f30b"
] | [
"generate_model.py"
] | [
"import markovify\nimport pandas as pd\nimport numpy as np\nimport pickle\nimport re\n\n\ndef generate_source_text():\n data = pd.read_csv('data.csv')\n data.dropna(inplace=True)\n\n split_lines = [line.splitlines() for line in data['text'].values.tolist()]\n lines = np.concatenate(split_lines)\n bad... | [
[
"numpy.concatenate",
"pandas.read_csv"
]
] |
sakost/cyberlifeNEAT | [
"90c3a11e015e63233bfd8f5992b493e8696c6138"
] | [
"game.py"
] | [
"from abc import ABC\nfrom collections import namedtuple\nfrom enum import IntEnum, auto\n\nimport numpy as np\nimport pygame as pg\n\npg.init()\nfont_style = pg.font.SysFont(\"bahnschrift\", 13)\n\n\nGameAction = namedtuple('GameAction', ['cell_id', 'dx', 'dy'])\n\n\ndef find_cell(game, xr, yr):\n for cell in g... | [
[
"numpy.random.shuffle",
"numpy.random.randint"
]
] |
ukaukaaaa/YoloAll | [
"7f98a6c32fe90c4cf54f65e52731ae880a6c047d"
] | [
"model_zoo/ScaledYolov4/models/common.py"
] | [
"# This file contains modules common to various models\nimport math\n\nimport torch\nimport torch.nn as nn\n\n# from mc.build.lib.mish_mish import MishCuda as Mish\nfrom utils.activations import Mish\n\ndef autopad(k, p=None): # kernel, padding\n # Pad to 'same'\n if p is None:\n p = k // 2 if isinsta... | [
[
"torch.nn.Sequential",
"torch.nn.ReLU6",
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.Identity",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
iuming/AI_Computer_Systems | [
"b47c4914a23acfdc469e1a80735bf68191b2acba"
] | [
"AICSE-demo-student/demo/yolov3/yolov3-release/evaluate.py"
] | [
"#! /usr/bin/env python\n# coding=utf-8\n\nimport cv2\nimport os\nimport shutil\nimport numpy as np\nimport tensorflow as tf\nimport core.utils as utils\nimport time\nimport argparse\nfrom core.config import cfg\nfrom core.yolov3 import YOLOV3\n\nclass YoloTest(object):\n def __init__(self):\n self.input_... | [
[
"tensorflow.Graph",
"tensorflow.import_graph_def",
"numpy.reshape",
"tensorflow.ConfigProto",
"tensorflow.Session",
"tensorflow.GraphDef",
"numpy.array"
]
] |
IgoshinLab/pix2pixHD-HE | [
"f4d61cc101ce8af3f236d578feef3a7a048bb41d"
] | [
"dataloaders/utils/general/helperFunctions.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torch import autograd\nfrom torch.autograd import Variable\n\n\ndef calc_gradient_penalty(model, real_data, fake_data, conditional_data, use_cuda=False):\n '''\n Copied from https://github.com/caogang/wgan-gp\n '''\n LAMBDA = 10\n BATCH_SIZE = real_data.... | [
[
"torch.sum",
"torch.rand",
"torch.autograd.Variable"
]
] |
laurelkeys/intimo | [
"f5c8200e52e4aeb9c04b4988a61dbc66c04f8255"
] | [
"misc/hide.py"
] | [
"import os\nimport cv2\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport soundfile as sf\nimport sounddevice as sd\n\nfrom sys import argv\nfrom codec import *\nfrom converter import *\nfrom scipy.io.wavfile import write\n\ndef print_stats(arr, arr_name=''):\n print(f'{arr_name}:', arr.dtype, arr.sh... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.show",
"matplotlib.pyplot.axis"
]
] |
kenakai16/gpointconv | [
"dcdb079ff00ce1c13b426e7604278fa4326d8ba7"
] | [
"eval_cls_gconv.py"
] | [
"import argparse\nimport os\nimport sys\nimport numpy as np \nimport torch\nimport torch.nn.parallel\nimport torch.utils.data\nimport torch.nn.functional as F\nfrom model.group_pointconv import GroupPointConvDensityClsSsg as GroupPointConvDensityClsSsg\nfrom data_utils.ModelNetDataLoader import ModelNetDataLoader\n... | [
[
"numpy.dot",
"torch.load",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.from_numpy",
"numpy.cos",
"numpy.sin",
"torch.matmul",
"torch.no_grad",
"torch.cuda.is_available",
"torch.cuda.manual_seed_all",
"torch.device",
"numpy.array",
"numpy.zeros... |
hwfan/STRAPS-3DHumanShapePose | [
"ed12f1b52de43ca77a7ad8566314e9bbd1a364af"
] | [
"models/resnet.py"
] | [
"\"\"\"\nCopied from pytorch source code (I've just removed the final FC layer).\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nimport torch.utils.model_zoo as model_zoo\n\n\n__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',\n 'resnet152', 'resnext50_32x4d', 'resnext101_32x8d',\n ... | [
[
"torch.nn.Sequential",
"torch.nn.init.constant_",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.AdaptiveAvgPool2d",
"torch.flatten",
"torch.nn.ReLU",
"torch.utils.model_zoo.load_url",
"torch.nn.init.kaiming_normal_"
]
] |
boangri/uai-thesis-notebooks | [
"f287cef36d1533d2526d0d71da0c55e8b633e8c2"
] | [
"Pong/pong_karpathy.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# https://gist.github.com/karpathy/a4166c7fe253700972fcbc77e4ea32c5\n\n# In[ ]:\n\n\n\"\"\" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. \"\"\"\nimport numpy as np\n# import cPickle as pickle\nimport pickle\nimport gym\n\n# hyperparameters\n... | [
[
"numpy.dot",
"numpy.sqrt",
"numpy.random.uniform",
"numpy.std",
"numpy.zeros_like",
"numpy.random.randn",
"numpy.mean",
"numpy.outer",
"numpy.exp",
"numpy.zeros",
"numpy.vstack"
]
] |
xieldy/DeGAN | [
"9b480ae2dfa5c0303ca433404c015604e3926274"
] | [
"Other_networks_used/lenet_half.py"
] | [
"import torch \nimport torch.nn as nn\n\nclass LeNet_half(nn.Module):\n def __init__(self, num_classes=10):\n super(LeNet_half, self).__init__()\n\n self.conv1 = nn.Conv2d(1, 3, 5, stride=1, padding=0)\n self.conv1.bias.data.normal_(0, 0.1)\n self.conv1.bias.data.fill_(0) \n \n... | [
[
"torch.nn.Softmax",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.MaxPool2d",
"torch.nn.ReLU"
]
] |
entangle2giraffe/scikitlearn_demo | [
"506cb424cc52d6706cc0694dec0f2f533f755954"
] | [
"poly/app.py"
] | [
"import matplotlib.pyplot as plt\r\nimport numpy as np\r\nfrom sklearn.linear_model import LinearRegression\r\nfrom sklearn.metrics import r2_score, mean_squared_error, mean_absolute_error\r\nfrom sklearn.preprocessing import PolynomialFeatures\r\nimport sys\r\n\r\n# Import the local module\r\n# The module import p... | [
[
"sklearn.metrics.r2_score",
"numpy.power",
"numpy.arange",
"sklearn.metrics.mean_absolute_error",
"sklearn.preprocessing.PolynomialFeatures",
"sklearn.metrics.mean_squared_error",
"matplotlib.pyplot.plot",
"numpy.asanyarray",
"sklearn.linear_model.LinearRegression",
"matplo... |
jha-vikas/pyTorch-implementations | [
"b43ade6f457c661a6bd43209e7affd43a1381e7e"
] | [
"dataset/MNIST/process.py"
] | [
"import os\nimport torch\nfrom torchvision.datasets.mnist import read_image_file, read_label_file\n\nraw_folder = \"raw\"\nprocessed_folder = \"processed\"\ntraining_file = 'training.pt'\ntest_file = 'test.pt'\n\n### Code from https://github.com/pytorch/vision/blob/7d4154735f421b254c408c16e0980b1ca0dd9b8e/torchvisi... | [
[
"torch.save"
]
] |
penguinwang96825/nlp4ml | [
"0a2ffcc53fad493584c649f9dc87ab344c3e814b"
] | [
"nlp4ml/main.py"
] | [
"import swifter\nimport pandas as pd\nimport numpy as np\nfrom pprint import pprint\nfrom sklearn.tree import DecisionTreeClassifier\nfrom sklearn.tree import ExtraTreeClassifier\nfrom sklearn.pipeline import Pipeline\nfrom sklearn.datasets import make_classification\nfrom gensim.models import KeyedVectors\n\nfrom ... | [
[
"pandas.read_csv"
]
] |
LuzieH/pytpt | [
"7c4c3542bffcc4f94b9c74a423cb5b2cd97a366b"
] | [
"src/pytpt/finite.py"
] | [
"import numpy as np\nfrom inspect import isfunction\n#from scipy.linalg import solve\n\n\nclass tpt:\n '''Calculates committor probabilities and A->B transition statistics of\n time-homogeneous or time-inhomogeneous Markov chain models over a\n finite time interval {0,...,N-1} of size N.\n\n based on:\n... | [
[
"numpy.ix_",
"numpy.savez",
"numpy.multiply",
"numpy.isnan",
"numpy.arange",
"numpy.size",
"numpy.nansum",
"numpy.where",
"numpy.zeros",
"numpy.sum"
]
] |
nik-hil/imaterialist-fashion-2019-FGVC6 | [
"77e63f2cfb18ea0d85a74b31d882300148c7496f"
] | [
"util.py"
] | [
"\nimport numpy as np\nimport pandas as pd\n\nfrom pathlib import Path\nfrom fastai.vision import *\nfrom fastai.callbacks.hooks import *\nfrom fastai.utils.mem import *\n\nfrom itertools import groupby\nfrom progressbar import ProgressBar\nimport cv2\nimport os\nimport json\nimport torchvision\nfrom datetime impor... | [
[
"numpy.asarray",
"numpy.dstack",
"pandas.DataFrame",
"numpy.full",
"numpy.append",
"numpy.copy",
"numpy.ravel",
"numpy.array",
"numpy.where"
]
] |
Hyper-Devil/opencv-python | [
"c1bdf36295bc01184165d172bd0bae5d61abdda0"
] | [
"6.wrapPerspective.py"
] | [
"import cv2\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nimg2 = cv2.imread(r'D:\\master\\opencv-python\\image\\sudoku.jpg')\nimg = cv2.cvtColor(img2, cv2.COLOR_BGR2RGB) # matplotlib的图像为RGB格式\nrows, cols, ch = img.shape\n\npts1 = np.float32([[223, 490], [563, 455], [186, 847], [577, 848]])\npts2 = np.flo... | [
[
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplot",
"numpy.float32",
"matplotlib.pyplot.show"
]
] |
dnolivieri/MResVgene | [
"08d5cc2368b051ab64ac593b8ebb1b725265f30a"
] | [
"mresvgene/PDT3method.py"
] | [
"#!/usr/bin/env python\n\"\"\"\n dnolivieri: updated ...4 dec 2015\n * used to generate the \"positive\" multiresolution signals.\n - based upon loci.\n\n\"\"\"\nimport numpy as np\nimport sys\nimport itertools\nfrom Bio import SeqIO\nfrom Bio.Seq import Seq\nfrom scipy import *\nimport struct\nimport re... | [
[
"numpy.hstack",
"numpy.array",
"numpy.sqrt"
]
] |
mahmoud-al-najar/DSPEB | [
"9eecb7d9bdef4ba2c3ec72a25fe6a159ecc75105"
] | [
"create_dataset.py"
] | [
"import os\nimport time\nimport gdal\nimport shutil\nimport random\nimport numpy as np\nimport pandas as pd\nimport datagen_config as cfg\n\nfrom utilities.data_io import make_tarfile\nfrom utilities.common import get_blue_ratio, make_datagen_log_file\nfrom utilities.data_io import parse_sentinel2_tiles_metadata_fr... | [
[
"numpy.arange",
"numpy.save",
"pandas.DataFrame",
"numpy.min"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.