repo_name stringlengths 8 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
riels89/gunpowder | [
"e523b49ca846a9fd46ab6fc0dd1040cc4a4d53b4"
] | [
"tests/cases/specified_location.py"
] | [
"# from .provider_test import ProviderTest, TestSource\nfrom gunpowder import (BatchProvider, ArrayKeys, ArraySpec, Roi, Batch,\n Coordinate, SpecifiedLocation, build,\n BatchRequest, Array, ArrayKey)\nimport numpy as np\nimport unittest\n\n\nclass TestSourceSpecifiedLoca... | [
[
"numpy.prod"
]
] |
joshes/ocp | [
"e04056d008616eaf5058b7851d8ac29b8f2da473"
] | [
"ocpmodels/trainers/forces_trainer.py"
] | [
"\"\"\"\nCopyright (c) Facebook, Inc. and its affiliates.\n\nThis source code is licensed under the MIT license found in the\nLICENSE file in the root directory of this source tree.\n\"\"\"\n\nimport os\nfrom collections import defaultdict\n\nimport numpy as np\nimport torch\nimport torch_geometric\nfrom torch.util... | [
[
"torch.cuda.empty_cache",
"torch.utils.data.DataLoader",
"numpy.load",
"torch.sum",
"torch.split",
"torch.tensor",
"torch.cuda.amp.autocast",
"numpy.array",
"torch.LongTensor",
"torch.cat",
"numpy.unique",
"numpy.savez_compressed"
]
] |
naivelogic/ZeroWaste3D | [
"915d4a37563db8481c8631ab0e34cfd0512941f8"
] | [
"DataManager/Legacy/create_dataset/generate_mask_db.py"
] | [
"#%%\nimport sys, os, glob\nimport numpy as np\nsys.path.append(\"../\") # go to parent dir\n\nfrom utils.coco_manager import MaskManager\n\n\n## Create Train/Val/Test/ Datasets\n#Train: 80% \n#Val: 18%\n#Test: 2%\n\n#%%\nDATASET_VERSON = 'ds2'\nDATASET_PATH = f'/mnt/zerowastepublic/02-datasets/{DATASET_VERS... | [
[
"sklearn.model_selection.train_test_split"
]
] |
bobrokerson/libraries | [
"996509d341af7108a24053eb88431ec6afbb0f25"
] | [
"assignment/min_nonsmooth_fun.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jan 21 15:36:06 2022\n\n@author: bobrokerson\n\"\"\"\n# part of code from task #1\n\nfrom math import sin, exp\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef func(x):\n return sin(x / 5.) * exp(x / 10.) + 5. * exp(-x/ 2.)\n\n... | [
[
"numpy.zeros",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.axis",
"scipy.optimize.minimize",
"numpy.arange",
"scipy.optimize.differential_evolution",
"matplotlib.pyplot.show",
"matplotlib.pyplot.plot"
]
] |
Poezedoez/NearestNeighBERT-Faiss | [
"802c9528105295abe28be8624c7582a3c0f68835"
] | [
"nearest_neighbert/evaluate.py"
] | [
"from sklearn.metrics import precision_recall_fscore_support as prfs\nimport numpy as np\nimport json\nimport argparse\nfrom typing import List, Tuple, Dict\nimport sys\n\n# From spert.evaluator class\n# https://github.com/markus-eberts/spert/blob/master/spert/evaluator.py\n\ndef _get_row(data, label):\n row = [... | [
[
"sklearn.metrics.precision_recall_fscore_support"
]
] |
eternagame/KaggleOpenVaccine | [
"de252988b92dc2c673a80347deb8827a12aa2ad8"
] | [
"data/mRNA_233x_data/reformat_kazuki2.py"
] | [
"import numpy as np\nimport pandas as pd\nimport gzip\n\ninput_file = 'predictions/2nd-place-233-seq.csv'\nnickname='kazuki2'\n\ndf = pd.read_csv('../233x_sequences_degdata_081120.csv')\ndf1 = pd.read_csv(input_file)\n\ndf1['ID'] = [int(x.split('_')[0]) for x in df1['id_seqpos']]\ndf1['seqpos'] = [int(x.split('_')[... | [
[
"pandas.read_csv",
"numpy.savetxt",
"numpy.ones",
"numpy.isnan"
]
] |
karl-zhao/benchmarking-gnns-pyg | [
"23d2c823f16ead554b22ff31c41d5bd8074b133e"
] | [
"nets/SBMs_node_classification/mo_net.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n# from torch_scatter import scatter_add\n# from num_nodes import maybe_num_nodes\nimport dgl\nfrom torch_geometric.nn.conv import MessagePassing\nimport numpy as np\nimport torch.nn as nn\nfrom torch import Tensor\n# from torch_geometric.utils i... | [
[
"torch.nn.Linear",
"torch.nn.functional.dropout",
"torch.nn.BatchNorm1d",
"torch.bincount",
"torch.nn.Embedding",
"torch.nn.CrossEntropyLoss",
"torch.nn.functional.relu",
"torch.nn.Tanh",
"torch.nn.ModuleList",
"torch.unique",
"torch.zeros"
]
] |
teo-milea/federated | [
"ce0707a954a531860eb38864b44d7b748fd62aa7"
] | [
"tensorflow_federated/python/core/impl/execution_contexts/async_execution_context_test.py"
] | [
"# Copyright 2021, The TensorFlow Federated Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by a... | [
[
"tensorflow.constant",
"tensorflow.test.main"
]
] |
naylor-b/blue | [
"709401e535cf6933215abd942d4b4d49dbf61b2b"
] | [
"openmdao/matrices/dense_matrix.py"
] | [
"\"\"\"Define the DenseMatrix class.\"\"\"\nfrom __future__ import division, print_function\nimport numpy as np\nfrom numpy import ndarray\nfrom six import iteritems\n\nfrom scipy.sparse import coo_matrix\n\nfrom openmdao.matrices.coo_matrix import COOMatrix\n\n# NOTE: DenseMatrix is inherited from COOMatrix so tha... | [
[
"numpy.ma.array",
"numpy.ma.dot",
"numpy.zeros",
"numpy.ma.filled"
]
] |
WERimagin/baseline_CoQA | [
"d11d19283b4c9b9b15cfcdb96bf5cd262bb953e8"
] | [
"rc/models/drqa.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom .layers import SeqAttnMatch, StackedBRNN, LinearSeqAttn, BilinearSeqAttn\nfrom .layers import weighted_avg, uniform_weights, dropout\n\n\nclass DrQA(nn.Module):\n \"\"\"Network for the Document Reader module of DrQA.\"\"\"\n _RNN_TYPE... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.functional.dropout"
]
] |
YNYuan/OpenChem | [
"4364af6d92ae183aac0bea35726d7ae0ee518920"
] | [
"openchem/layers/ipd.py"
] | [
"# modified from https://github.com/tkipf/gae/blob/master/gae/layers.py\n\nimport torch\nimport torch.nn as nn\n\nclass InnerProductDecoder(nn.Module):\n \"\"\"Decoder model layer for link prediction.\"\"\"\n def __init__(self, input_dim, act=nn.functional.sigmoid):\n super(InnerProductDecoder, self)._... | [
[
"torch.mm"
]
] |
TomLXXVI/pypeflow | [
"49e42621180ec3125afa238d3ca56ae9f3a7662a"
] | [
"source_code/pypeflow/utils/pump_curve.py"
] | [
"\"\"\"\n## Pump curve fitting and drawing\n\n- Establish an equation for the pump curve from measured points on the curve in the pump's data sheet\n- Get the coefficients of the 2nd order polynomial describing the pump curve and determined via curve fitting\n- Draw the pump curve in a diagram\n\n\"\"\"\nfrom typin... | [
[
"numpy.array",
"numpy.linspace"
]
] |
junaid340/AnomalyDetection-In-SurveillanceVideos | [
"758cb507b8f106eb0d4366c3301ee7be355a40b3"
] | [
"Deploy_Model.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Thu Apr 2 20:56:50 2020\r\n@author: junaid\r\n\"\"\"\r\nimport cv2\r\nimport Model_Wrapper as mp\r\nfrom tensorflow.keras.models import load_model\r\nfrom PreProcessing_V5 import Fit_Preprocessing, GlobalNormalization, ToJson\r\nfrom PreProcessing_V5 import ReadFile... | [
[
"numpy.load",
"numpy.zeros",
"tensorflow.keras.models.load_model",
"tensorflow.test.is_built_with_cuda",
"numpy.expand_dims",
"numpy.shape",
"tensorflow.test.is_gpu_available"
]
] |
utsav-akhaury/Computational-Electromagnetics-FDTD-Analysis | [
"add2df141ba9c6414b19ac55d24c4251bbd05430"
] | [
"homog_gau_abc.py"
] | [
"\r\n#------------------ Gaussian pulse propagation in a homogeneous medium terminated with Absorbing Boundary Condition (ABC)\r\n\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\n#----- Medium ----------\r\nlength = 2 \r\neps0 = 8.854e-12\r\nmeu0 = 4*np.pi*1e-7\r\nepsr = 1\r\nmeur = 1\r\nep... | [
[
"numpy.zeros",
"matplotlib.pyplot.grid",
"numpy.copy",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.show",
"numpy.power",
"matplotlib.pyplot.ylim",
"numpy.sqrt",
"numpy.linspace"
]
] |
lebrice/avalanche | [
"fe7e1e664ab20697343495fbe1328a20215feffb"
] | [
"avalanche/benchmarks/datasets/core50/core50.py"
] | [
"################################################################################\n# Copyright (c) 2021 ContinualAI. #\n# Copyrights licensed under the MIT License. #\n# See the accompanying LICENSE file for terms. ... | [
[
"torch.utils.data.dataloader.DataLoader",
"matplotlib.pyplot.show",
"torch.squeeze"
]
] |
LTHODAVDOPL/tensorflow | [
"73083d29afe770870742a9d19555686886e76f6d"
] | [
"tensorflow/python/framework/function_test.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... | [
[
"numpy.sum",
"tensorflow.python.framework.function._from_definition",
"tensorflow.core.framework.function_pb2.GradientDef",
"tensorflow.python.ops.math_ops.tanh",
"numpy.random.seed",
"tensorflow.python.ops.variable_scope.variable_scope",
"tensorflow.python.ops.gradients_impl.gradients... |
kmakeev/RLs | [
"c47e9b504db157731c26d7c881719a4fb54cc355"
] | [
"mlagents/trainers/tests/test_ghost.py"
] | [
"import pytest\n\nimport numpy as np\n\nimport yaml\n\nfrom mlagents.trainers.ghost.trainer import GhostTrainer\nfrom mlagents.trainers.ghost.controller import GhostController\nfrom mlagents.trainers.behavior_id_utils import BehaviorIdentifiers\nfrom mlagents.trainers.ppo.trainer import PPOTrainer\nfrom mlagents.tr... | [
[
"numpy.testing.assert_array_equal"
]
] |
abdolence/analytics-zoo | [
"364856abcbe9aff7f7b6cf9b9f8648d51e07ca64",
"364856abcbe9aff7f7b6cf9b9f8648d51e07ca64"
] | [
"pyzoo/zoo/util/tf_graph_util.py",
"pyzoo/zoo/examples/anomalydetection/anomaly_detection.py"
] | [
"# This file is adapted from https://github.com/tensorflow/tensorflow/blob/master\n# /tensorflow/python/framework/graph_util_impl.py\n#\n# Copyright 2015 The TensorFlow Authors, 2019 Analytics Zoo Authors.\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not... | [
[
"tensorflow.python.util.deprecation.deprecated",
"tensorflow.python.platform.tf_logging.info",
"tensorflow.python.util.tf_export.tf_export",
"tensorflow.core.framework.node_def_pb2.NodeDef",
"tensorflow.python.framework.tensor_util.make_tensor_proto",
"tensorflow.core.framework.graph_pb2.G... |
uzck/tf_net_parser | [
"5e9da1e8a317ef24c2f1577a56d6445e432b1f5d"
] | [
"utils.py"
] | [
"import os\nimport numpy as np \nimport matplotlib.image as mpimg\nimport matplotlib.pyplot as plt\nimport cv2\nimport tensorflow as tf\nfrom PIL import Image\n\ndef image_to_ndarray(image_path: str) -> np.ndarray:\n \"\"\"\n Args:\n image_path: 图片文件路径\n \"\"\"\n pass\n\ndef read_image(image_path... | [
[
"tensorflow.pad",
"numpy.load",
"numpy.save",
"numpy.savez",
"tensorflow.train.latest_checkpoint",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.show",
"numpy.shape",
"tensorflow.train.Saver",
"numpy.pad",
"matplotlib.image.imread"
]
] |
Kelvin-spacy/CogAlg | [
"e0f44a8746ba33a07864505d6e2ae959859024b0"
] | [
"frame_2D_alg/class_cluster.py"
] | [
"\"\"\"\nProvide a base class for cluster objects in CogAlg.\nFeatures:\n- Unique instance ids per class.\n- Instances are retrievable by ids via class.\n- Reduced memory usage compared to using dict.\n- Methods generated via string templates so overheads caused by\ndifferences in interfaces are mostly eliminated.\... | [
[
"numpy.arctan2"
]
] |
juvenilehex/ml2 | [
"57fa64660a87b2e432872c06414d1a86846ce380"
] | [
"hunkim/ml_lab_03_02.py"
] | [
"# 참고자료\n# 모두를 위한 머신러닝/딥러닝 강의\n# 홍콩과기대 김성훈\n# http://hunkim.github.io/ml\n\nimport tensorflow as tf\nimport matplotlib.pyplot as plt\n\nx_data = [1., 2., 3.]\ny_data = [1., 2., 3.]\n\nW = tf.Variable(tf.random_uniform([1], -10.0, 10.0))\n\nX = tf.placeholder(tf.float32)\nY = tf.placeholder(tf.float32)\n\n\nhypothes... | [
[
"tensorflow.placeholder",
"tensorflow.global_variables_initializer",
"tensorflow.reduce_mean",
"tensorflow.random_uniform",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"tensorflow.square",
"tensorflow.Session",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel"
... |
fusion-flap/flap_apdcam | [
"fce208414044fb288328090ba697e8e2482e1c75"
] | [
"apdcam_control/apdcam10g_channel_map.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sun Feb 27 12:51:00 2022\n\n@author: Zoletnik\n\"\"\"\nimport numpy as np\n\ndef apdcam10g_channel_map(camera_type=None,camera_version=1):\n \"\"\"\n Returns a 2D matrix with the ADC channel numbers as one looks onto the detector.\n\n Parameters\n ----------\... | [
[
"numpy.ndarray",
"numpy.arange",
"numpy.transpose",
"numpy.array"
]
] |
RulerOf/keras-yolo3 | [
"8d091cf42b2f126626ad8610adf31293225b7daa"
] | [
"scripts/evaluate.py"
] | [
"\"\"\"\nEvaluation of predictions againsts given dataset (in TXT format the same as training).\nWe expect that the predictions are in single folder and image names in dataset are the same\n\n python evaluate.py \\\n --path_dataset ../model_data/VOC_2007_train.txt \\\n --path_results ../results \\\... | [
[
"pandas.read_csv",
"pandas.DataFrame",
"pandas.set_option"
]
] |
b2-hive/CONTRE | [
"9176861400fcc5887d8a8944ee2c636ba09aa239"
] | [
"contre/training.py"
] | [
"import root_pandas\nimport basf2_mva\nimport b2luigi\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\n\n\ndef split_sample(\n ntuple_file,\n train_size,\n test_size,\n random_seed=42):\n \"\"\"Split rootfile and return dataframes. Select 0th candidate.\"\"\... | [
[
"pandas.DataFrame",
"sklearn.model_selection.train_test_split"
]
] |
masonng-astro/nicerpy_xrayanalysis | [
"c21c7c9bc5570c63c986197fb363ae80691515d5"
] | [
"Lv3_presto_candidates.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jul 5 1:28pm 2019\n\nScript to automate getting pulsation candidates of a certain frequency range,\nand reporting other germane information?\n\n\"\"\"\nfrom __future__ import division, print_function\nimport numpy as np\nfrom scipy import stats... | [
[
"numpy.where",
"numpy.float",
"numpy.genfromtxt"
]
] |
gradientzero/dq0-sdk | [
"90856dd5ac56216971ffe33004447fd037a21660"
] | [
"dq0/sdk/examples/newsgroups/_data/generate_preprocessed_dataset.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"20Newsgroups Data Source.\n\nThis is a data source example known from the Scikit-learn API:\nhttps://scikit-learn.org/stable/datasets/index.html#the-20-newsgroups-text-dataset\n\nThe 20 newsgroups dataset comprises around 18000 newsgroups posts on 20 topics\nsplit in two subsets: one... | [
[
"pandas.read_csv",
"pandas.concat",
"sklearn.model_selection.train_test_split"
]
] |
village-people/flying-pig | [
"c86b589aadb02dbfd42a917a388c2b8488ecd338"
] | [
"ai_challenge/methods/dqn.py"
] | [
"\"\"\" Deep Q-Learning policy evaluation and improvement\n\"\"\"\nimport torch\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nfrom termcolor import colored as clr\n\n\nclass DQNPolicyImprovement(object):\n \"\"\" Deep Q-Learning training method. \"\"\"\n\n ... | [
[
"torch.zeros",
"torch.autograd.Variable",
"torch.nn.functional.smooth_l1_loss"
]
] |
cnavarreteliz/Datos-COVID19 | [
"4383c6a82f5ec41d55875daf6ce2d2ed71785aa4"
] | [
"src/bulk_producto2.py"
] | [
"import pandas as pd\nimport glob\nimport re\n\ndf = []\nfor file in glob.glob(\"../output/producto2/*.csv\"):\n date = re.search(\"\\d{4}-\\d{2}-\\d{2}\", file).group(0).replace(\"-\", \"/\")\n fragment = pd.read_csv(file)\n fragment[\"Fecha\"] = date\n df.append(fragment)\n\ndf = pd.concat(df)\n\n# Re... | [
[
"pandas.read_csv",
"pandas.read_excel",
"pandas.concat"
]
] |
streeve/PI3NN | [
"f7f08a195096e0388bb9230bc67c6acd6f41581a",
"f7f08a195096e0388bb9230bc67c6acd6f41581a",
"f7f08a195096e0388bb9230bc67c6acd6f41581a"
] | [
"NeurIPS_2021/Figure_1/DER_cubic/trainers/evidential_V2.py",
"NeurIPS_2021/Figure_1/DER_cubic/trainers/bbbp.py",
"ICLR_2022/Flight_delay/PIVEN/PIVEN_flight_delay.py"
] | [
"import numpy as np\nimport tensorflow as tf\nimport time\nimport datetime\nimport os\nimport sys\nimport h5py\nfrom pathlib import Path\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\nimport evidential_deep_learning as edl\nfrom .util import normalize, gallery\n\nclass Evidential:\n def __init__(self, ... | [
[
"tensorflow.reduce_max",
"numpy.log",
"tensorflow.convert_to_tensor",
"tensorflow.Variable",
"matplotlib.pyplot.plot",
"tensorflow.split",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.gca",
"numpy.random.choice",
"matplotlib.pyplot.title",
"tensorflow.GradientTape",
... |
savindi-wijenayaka/transformer_old | [
"016960521eaaf5393c9fad1c4db15338455213f8"
] | [
"tests/test_modeling_prophetnet.py"
] | [
"# coding=utf-8\n# Copyright 2020 The HuggingFace Inc. team, The Microsoft Research 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/LI... | [
[
"torch.ones_like",
"torch.ones",
"torch.Size",
"torch.manual_seed",
"torch.no_grad",
"torch.tensor",
"torch.all",
"torch.isnan",
"torch.cat",
"torch.allclose"
]
] |
adityasaxena26/OpenAI-Gym-Taxi-v2-Task | [
"e6061b39134c511de47b490f034317466c3c892e"
] | [
"agent.py"
] | [
"import numpy as np\nfrom collections import defaultdict\n\nclass Agent:\n\n def __init__(self, nA=6):\n \"\"\"\n Initialize agent.\n\n Params\n ======\n nA: number of actions available to the agent\n \"\"\"\n self.nA = nA\n self.Q = defaultdict(lambda: np.... | [
[
"numpy.random.choice",
"numpy.zeros"
]
] |
astrobeard/VICEdev | [
"c78804ec63b48a760ce3e50b8d3afc7b699ec75f"
] | [
"starbursts/plots/mpl.SFEoscil.py"
] | [
"\nimport visuals \nimport matplotlib.pyplot as plt \nfrom matplotlib.ticker import FormatStrFormatter \nimport vice \nimport sys \nimport warnings \nwarnings.filterwarnings(\"ignore\") \n\nif __name__ == \"__main__\": \n\taxes = visuals.subplots(1, 3, figsize = (21, 7)) \n\taxes.insert(1, visuals.append_subplot_be... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.clf"
]
] |
ryanirl/ml-basics | [
"e143eacf6338877d8111d1c0ee56853475efa914"
] | [
"logistic_regression/logistic_regression.py"
] | [
"import numpy as np\nfrom sklearn.datasets import make_blobs\nimport matplotlib.pyplot as plt\n\n\n### --- Gather Dataset --- ###\n\nn = 100\nX, y = make_blobs(n_samples = n, centers = 2)\n\ny = y[:, np.newaxis]\n\n\n### --- Build Model --- ###\n\ndef sigmoid(z): \n return 1.0 / (1.0 + np.exp(-z))\n\nclass Logis... | [
[
"numpy.random.uniform",
"numpy.sum",
"numpy.exp",
"matplotlib.pyplot.show",
"numpy.log",
"matplotlib.pyplot.suptitle",
"sklearn.datasets.make_blobs",
"matplotlib.pyplot.plot",
"numpy.linspace",
"matplotlib.pyplot.scatter"
]
] |
colliner/spektral | [
"b776200fd1fa820f05b559f0c1c6265e0eca4894"
] | [
"spektral/layers/convolutional/gat_conv.py"
] | [
"import tensorflow as tf\nfrom tensorflow.keras import backend as K\nfrom tensorflow.keras import initializers, regularizers, constraints\nfrom tensorflow.keras.layers import Dropout\n\nfrom spektral.layers import ops\nfrom spektral.layers.convolutional.conv import Conv\nfrom spektral.layers.ops import modes\n\n\nc... | [
[
"tensorflow.zeros",
"tensorflow.keras.initializers.get",
"tensorflow.keras.layers.Dropout",
"tensorflow.shape",
"tensorflow.reshape",
"tensorflow.keras.backend.is_sparse",
"tensorflow.keras.constraints.get",
"tensorflow.ones",
"tensorflow.nn.softmax",
"tensorflow.reduce_mea... |
Abrahamma97/keras-onnx | [
"c08d52bf4d4ec2bba69ec4ffd2ea14f47fecb1f5",
"e49ef6163e1f2be017fff96f908eaea819f6e0b4"
] | [
"applications/nightly_build/test_lsgan.py",
"tests/test_cgan.py"
] | [
"###############################################################################\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for\n# license information.\n##########################################################################... | [
[
"numpy.random.rand",
"numpy.prod"
],
[
"numpy.random.rand",
"tensorflow.__version__.split",
"numpy.prod"
]
] |
Izecson/sockeye-1.16.6 | [
"f84044d4a64b2bcf744ccd4f94b16f8133d1f383"
] | [
"test/unit/test_attention.py"
] | [
"# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\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. A copy of the License\n# is located at\n#\n# http://aws.amazon.com/apache2.0/\n# \n# or in the \"... | [
[
"numpy.random.randint",
"numpy.isclose",
"numpy.asarray"
]
] |
yileiCao/shareTheBest | [
"ef62396a7884954dd6464d2dd78e232273e1060b"
] | [
"trilinear_cpp/setup.py"
] | [
"from setuptools import setup\nimport torch\nfrom torch.utils.cpp_extension import BuildExtension, CUDAExtension, CppExtension\n\nif torch.cuda.is_available():\n print('Including CUDA code.')\n setup(\n name='trilinear',\n ext_modules=[\n CUDAExtension('trilinear', [\n ... | [
[
"torch.utils.cpp_extension.CUDAExtension",
"torch.cuda.is_available",
"torch.utils.cpp_extension.CppExtension"
]
] |
jfajkowski/stock-market-forecasting | [
"6a0ae5a0cfe39263a0f448f062cd01283281a0d8"
] | [
"scripts/model/bigram_svm/train_model.py"
] | [
"import pandas as pd\nfrom sklearn.feature_extraction.text import CountVectorizer, TfidfTransformer\nfrom sklearn.metrics import accuracy_score\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.pipeline import Pipeline\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.svm import SVC\... | [
[
"sklearn.svm.SVC",
"sklearn.feature_extraction.text.CountVectorizer",
"pandas.read_csv",
"sklearn.feature_extraction.text.TfidfTransformer",
"sklearn.preprocessing.StandardScaler",
"sklearn.model_selection.train_test_split"
]
] |
wilson1yan/SLM-Lab | [
"1f110288d2d3dde1fb00d415aeb95ce554170813"
] | [
"slm_lab/agent/algorithm/dqn.py"
] | [
"from slm_lab.agent import net\nfrom slm_lab.agent.algorithm import policy_util\nfrom slm_lab.agent.algorithm.sarsa import SARSA\nfrom slm_lab.agent.net import net_util\nfrom slm_lab.lib import logger, util\nfrom slm_lab.lib.decorator import lab_api\nimport numpy as np\nimport pydash as ps\nimport torch\n\nlogger =... | [
[
"torch.tensor"
]
] |
Connossor/bokeh | [
"092e5dc0f62be13d87af5bf2b5a85ec57fd9f14e"
] | [
"examples/plotting/file/stocks.py"
] | [
"import numpy as np\n\nfrom bokeh.layouts import gridplot\nfrom bokeh.plotting import figure, show, output_file\nfrom bokeh.sampledata.stocks import AAPL, GOOG, IBM, MSFT\n\ndef datetime(x):\n return np.array(x, dtype=np.datetime64)\n\np1 = figure(x_axis_type=\"datetime\", title=\"Stock Closing Prices\")\np1.gri... | [
[
"numpy.array",
"numpy.ones",
"numpy.convolve"
]
] |
samtx/pyapprox | [
"c926d910e30fbcfed7d0621175d3b0268d59f852"
] | [
"pyapprox/optimization.py"
] | [
"import numpy as np\nfrom scipy.optimize import minimize, Bounds\nfrom functools import partial\nfrom scipy.stats import gaussian_kde as KDE\nfrom pyapprox.configure_plots import *\nimport scipy.stats as ss\nfrom pyapprox.utilities import get_all_sample_combinations\n\ndef approx_jacobian(func, x, *args, epsilon=np... | [
[
"numpy.ones",
"numpy.random.seed",
"numpy.asarray",
"scipy.stats.gaussian_kde",
"numpy.isscalar",
"numpy.absolute",
"scipy.stats.mstats.mquantiles",
"numpy.where",
"numpy.linspace",
"numpy.mean",
"numpy.zeros",
"scipy.optimize.fmin_slsqp",
"numpy.random.normal",... |
santisoler/xarray | [
"2bb5d20fb2b4158390ab05aa6bf598b78f2caa9d"
] | [
"xarray/tutorial.py"
] | [
"\"\"\"\nUseful for:\n\n* users learning xarray\n* building tutorials in the documentation.\n\n\"\"\"\nimport os\nimport pathlib\n\nimport numpy as np\n\nfrom .backends.api import open_dataset as _open_dataset\nfrom .backends.rasterio_ import open_rasterio as _open_rasterio\nfrom .core.dataarray import DataArray\nf... | [
[
"numpy.arange",
"numpy.linspace",
"numpy.random.randn",
"numpy.zeros"
]
] |
hassenmorad/Home-to-Income-Ratio | [
"777754693150ed6f777d084dbace7b8189317c55"
] | [
"Scripts/mort_by_pop_den_5yr_0816.py"
] | [
"# Mortgagea share of income by population density\nimport pandas as pd\nimport numpy as np\nimport array\n\nfile = pd.read_csv('county_rent_mort_inc_units_5yr.csv')\n\nyrs_dict = {}\nfor year in range(2008, 2017):\n print(year)\n yr_df = file[file.Year == year].dropna(subset=['Housing_Den'])\n yr_df.Total... | [
[
"pandas.read_csv",
"pandas.DataFrame",
"numpy.median",
"numpy.full"
]
] |
ryu57/pyHalo | [
"61b9ab49d76f3552f5680b2e457fbd3e49b9cc89"
] | [
"pyHalo/Rendering/MassFunctions/power_law.py"
] | [
"import numpy as np\nfrom pyHalo.Rendering.MassFunctions.mass_function_utilities import integrate_power_law_analytic\nfrom pyHalo.Rendering.MassFunctions.mass_function_utilities import WDM_suppression\n\nclass GeneralPowerLaw(object):\n\n \"\"\"\n This class handles computations of a double power law mass fun... | [
[
"numpy.any",
"numpy.random.poisson",
"numpy.exp",
"numpy.log",
"numpy.random.rand",
"numpy.array",
"numpy.where",
"numpy.round"
]
] |
shinylin/tw-stock-collect-forecast | [
"6af2715a848336d90aaf21f8f93ed1c3568c3fa8"
] | [
"collect/TwHistory.py"
] | [
"import calendar\nimport math\nimport pandas as pd\nimport time\nimport twstock\nimport requests\nfrom datetime import datetime, timedelta\nfrom dateutil import relativedelta\nfrom db.Connection import session\nfrom enum import Enum\nfrom model.StockHistory import StockHistory\nfrom sys import float_info\nfrom tali... | [
[
"pandas.to_datetime"
]
] |
erwinvanthiel/ASL | [
"1b8846919f4bcf7bf65881faf254395cb01f8ae3"
] | [
"mlc-pgd-multi-label.py"
] | [
"import os\nimport torch\nfrom src.helper_functions.helper_functions import parse_args\nfrom src.loss_functions.losses import AsymmetricLoss, AsymmetricLossOptimized\nfrom src.models import create_model\nimport argparse\nimport matplotlib\nimport torchvision.transforms as transforms\nfrom pgd import create_targeted... | [
[
"torch.sum",
"torch.utils.data.DataLoader",
"matplotlib.pyplot.legend",
"torch.load",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"torch.cuda.is_available",
"matplotlib.pyplot.ylabel",
"numpy.array",
"torch.clone",
"matplotlib.pyplot.xlabel"
]
] |
ZERO2ER0/OpticalNN | [
"56e34a02d9855951fc3a28d0bfddcdbad85a0c90"
] | [
"onn/onn.py"
] | [
"\"\"\"\nreplace first layer of AlexNet with optical setup\nAdapted other layers of AlexNet code from AlexNet.py, code written by Frederik Kratzert at\nhttps://kratzert.github.io/2017/02/24/finetuning-alexnet-with-tensorflow.html\n\"\"\"\nimport tensorflow as tf\nimport numpy as np\nIterator = tf.data.Iterator\n\n\... | [
[
"tensorflow.reshape",
"tensorflow.image.flip_left_right",
"tensorflow.variable_scope",
"tensorflow.concat",
"tensorflow.split",
"tensorflow.image.flip_up_down",
"tensorflow.nn.dropout",
"tensorflow.nn.max_pool",
"tensorflow.constant",
"tensorflow.transpose",
"numpy.load... |
naviocean/imgclsmob | [
"f2993d3ce73a2f7ddba05da3891defb08547d504",
"f2993d3ce73a2f7ddba05da3891defb08547d504",
"f2993d3ce73a2f7ddba05da3891defb08547d504",
"f2993d3ce73a2f7ddba05da3891defb08547d504",
"f2993d3ce73a2f7ddba05da3891defb08547d504"
] | [
"gluon/gluoncv2/models/fdmobilenet.py",
"train_pt.py",
"train_ke.py",
"chainer_/chainercv2/models/seresnet_cifar.py",
"tensorflow2/tf2cv/models/inceptionresnetv1.py"
] | [
"\"\"\"\n FD-MobileNet for ImageNet-1K, implemented in Gluon.\n Original paper: 'FD-MobileNet: Improved MobileNet with A Fast Downsampling Strategy,'\n https://arxiv.org/abs/1802.03750.\n\"\"\"\n\n__all__ = ['fdmobilenet_w1', 'fdmobilenet_w3d4', 'fdmobilenet_wd2', 'fdmobilenet_wd4', 'get_fdmobilenet']\n\ni... | [
[
"numpy.prod"
],
[
"numpy.random.randint",
"numpy.random.seed",
"torch.nn.CrossEntropyLoss"
],
[
"numpy.random.randint",
"numpy.random.seed"
],
[
"numpy.zeros"
],
[
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.ReLU",
"tensorflow.keras.backend.g... |
haowei01/translate | [
"e413a981667f1038ea9ab01bd9c6d0c013b03b0c"
] | [
"pytorch_translate/rnn.py"
] | [
"#!/usr/bin/env python3\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.onnx.operators\nfrom fairseq import utils\nfrom fairseq.models import (\n FairseqEncoder,\n FairseqModel,\n register_model,\n register_model_architecture,\n)\nfrom pytorch_tr... | [
[
"torch.ones",
"torch.nn.LSTM",
"torch.Tensor",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.nn.functional.dropout",
"torch.nn.utils.rnn.PackedSequence",
"torch.arange",
"torch.nn.ModuleList",
"torch.zeros",
"torch.cat",
"torch.nn.utils.rnn.pad_packed_sequence",
... |
remo-rcm/pyremo2 | [
"59bd18d411944205db93c062439172f91ba99f83"
] | [
"pyremo/core/exp.py"
] | [
"\"\"\"Module for working and parsing Remo output files.\n\"\"\"\nimport os\nfrom pathlib import Path\n\nimport pandas as pd\nimport parse\nfrom tqdm import tqdm\n\nfile_pattern = \"e{usr_nr:3d}{exp_nr:3d}{type:1}{date}\"\nefile_pattern = \"e{usr_nr:3d}{exp_nr:3d}{type:1}_c{code:3d}_{date}\"\n\ndate_patterns = [\"%... | [
[
"pandas.to_datetime",
"pandas.Int64Dtype",
"pandas.DataFrame"
]
] |
LemonLison/pystruct | [
"23c6d8f6ab34a88b63386a595debbfdfa13345fe"
] | [
"pystruct/learners/n_slack_ssvm.py"
] | [
"######################\n# (c) 2012 Andreas Mueller <amueller@ais.uni-bonn.de>\n# License: BSD 3-clause\n#\n# Implements structured SVM as described in Tsochantaridis et. al.\n# Support Vector Machines Learning for Interdependent\n# and Structures Output Spaces\n\nfrom time import time\n\nimport numpy as np\nimport... | [
[
"numpy.vstack",
"numpy.ones",
"numpy.sum",
"numpy.eye",
"numpy.zeros",
"sklearn.utils.gen_even_slices",
"sklearn.externals.joblib.delayed",
"numpy.ravel",
"numpy.arange",
"numpy.hstack",
"numpy.where",
"sklearn.externals.joblib.Parallel",
"numpy.array",
"num... |
ANazaret/scVI | [
"94a4a31b48b468da63417ef191db35b8bc98fbc6"
] | [
"tests/dataset/test_dataset.py"
] | [
"from unittest import TestCase\n\nimport numpy as np\nimport copy\n\nfrom scvi.dataset import CortexDataset, GeneExpressionDataset\nfrom scvi.dataset.dataset import remap_categories, CellMeasurement\n\n\nclass TestGeneExpressionDataset(TestCase):\n def test_populate_from_data(self):\n data = np.ones((25, ... | [
[
"numpy.ones",
"numpy.zeros",
"numpy.squeeze",
"numpy.exp",
"numpy.arange",
"numpy.random.randint"
]
] |
zhanglei1172/bbobenchmark | [
"841bffdddc1320ac2676e378d20f8b176a7e6cf7"
] | [
"examples/transfer_bo.py"
] | [
"import numpy as np\n# import matplotlib.pyplot as plt\nfrom xbbo.configspace.space import DenseConfiguration, DenseConfigurationSpace\nfrom ConfigSpace.hyperparameters import UniformFloatHyperparameter\nfrom ConfigSpace.conditions import LessThanCondition\n\n# from xbbo.search_algorithm.transfer_tst_optimizer impo... | [
[
"numpy.random.RandomState",
"numpy.cos"
]
] |
Femi-Tofade/Plagiarism_detector | [
"026164ec11415bc566f4d817dc79c9cecf06a0c0"
] | [
"source_pytorch/predict.py"
] | [
"# import libraries\r\nimport os\r\nimport numpy as np\r\nimport torch\r\nfrom six import BytesIO\r\n\r\n# import model from model.py, by name\r\nfrom model import BinaryClassifier\r\n\r\n# default content type is numpy array\r\nNP_CONTENT_TYPE = 'application/x-npy'\r\n\r\n\r\n# Provided model load function\r\ndef ... | [
[
"numpy.load",
"numpy.save",
"torch.cuda.is_available",
"torch.load"
]
] |
rryoung98/pennylane | [
"0c1c805fd5dfce465a8955ee3faf81037023a23e"
] | [
"tests/templates/test_layers/test_particle_conserving_u2.py"
] | [
"# Copyright 2018-2021 Xanadu Quantum Technologies Inc.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by ap... | [
[
"numpy.random.normal",
"numpy.allclose",
"numpy.array",
"numpy.random.random"
]
] |
cce-bigdataintro-1160/spring2019 | [
"e55b24bda61bbc87ad39dfec93c68a8f2da77831"
] | [
"class5-notebook/6-pandas_creating_series.py"
] | [
"#!/usr/bin/env python3\n\nimport numpy as np\nimport pandas as pd\n\n\ndef pretty_print(name, to_print):\n print(f'{name}:')\n print(f'{to_print}\\n\\n')\n\n\norders = pd.Series(data=[300.50, 60, 123.40, 60, np.nan],\n index=['Customer 1', 'Customer 2', 'Customer 3', 'Customer 4', 'Customer... | [
[
"pandas.Series"
]
] |
csherwood-usgs/CoastCam | [
"aa4de7c02ee0d719d89f13409319a44dba5eb768"
] | [
"original_code/calibration.py"
] | [
"import datetime\nfrom pathlib import Path\n\nimport numpy as np\nimport scipy.io\n\n\nclass CameraCalibration(object):\n \"\"\"Camera calibration saved in .mat file and method to assemble Projective (P) martrix.\n\n Notes:\n - Inspired by example code + notes from CiRC which are derived from Hartley a... | [
[
"numpy.eye",
"numpy.matmul",
"numpy.zeros",
"numpy.cos",
"numpy.nansum",
"numpy.array",
"numpy.sin"
]
] |
fcole90/interactive_bayesian_optimization | [
"a7aabdd22e84e89e4e1a1c13afee2ba13cad2eb5"
] | [
"interactive_bayesian_optimisation/libs/io.py"
] | [
"\"\"\"Functions for input/output\"\"\"\n\nimport os\nimport logging\nfrom interactive_bayesian_optimisation import config\nfrom interactive_bayesian_optimisation.libs import utils\n\nimport numpy as np\nfrom flask import json\nimport simplejson.errors\nimport yaml\n\n\ndef get_file_item_max(file_dir, min_val=0):\n... | [
[
"numpy.max"
]
] |
BlairLee/dataset-insights | [
"892e2ed3a2facf97cfa3a883700830d959a0c49b"
] | [
"datasetinsights/estimators/deeplab.py"
] | [
"import copy\nimport logging\n\nimport numpy as np\nimport torch\nimport torchvision\nfrom ignite.metrics import Loss\nfrom torchvision import transforms as T\nfrom torchvision.transforms import functional as F\n\nimport datasetinsights.constants as const\nfrom datasetinsights.data.datasets import Dataset\nfrom dat... | [
[
"torch.load",
"torch.optim.lr_scheduler.LambdaLR",
"torch.save",
"torch.no_grad",
"numpy.asarray",
"torch.nn.functional.cross_entropy"
]
] |
pirun/waveform_analysis | [
"66809614b1fc985e694af1720341035316a5ac8e"
] | [
"waveform_analysis/_common.py"
] | [
"#!/usr/bin/env python\n\nfrom numpy import array_equal, polyfit, sqrt, mean, absolute, log10, arange\nimport numpy as np\nfrom scipy.stats import gmean\n\ntry:\n from soundfile import SoundFile\n wav_loader = 'pysoundfile'\nexcept:\n try:\n from scikits.audiolab import Sndfile\n wav_loader =... | [
[
"scipy.stats.gmean",
"numpy.ravel",
"numpy.arange",
"numpy.log10",
"scipy.io.wavfile.read",
"numpy.absolute",
"numpy.array_equal",
"numpy.mean"
]
] |
luxufan/CS131_release | [
"e8a92582cfffee3ba6bb43f757bcb520785b6f04"
] | [
"hw1_release/filters.py"
] | [
"\"\"\"\nCS131 - Computer Vision: Foundations and Applications\nAssignment 1\nAuthor: Donsuk Lee (donlee90@stanford.edu)\nDate created: 07/2017\nLast modified: 10/16/2017\nPython Version: 3.5+\n\"\"\"\n\nimport numpy as np\n\n\ndef conv_nested(image, kernel):\n \"\"\"A naive implementation of convolution filter.... | [
[
"numpy.sum",
"numpy.zeros",
"numpy.linalg.svd",
"numpy.flip",
"numpy.std",
"numpy.pad",
"numpy.mean"
]
] |
aaryapatil/specdims | [
"acfc644aa06b13c8b34cde984e207b42e948af41"
] | [
"delfiSpec/specproc.py"
] | [
"# Import dependencies\nimport numpy as np\nfrom apogee.spec import continuum\nfrom apogee.tools import bitmask as bm\n\nfrom .util import get_DR_slice, bitsNotSet\n\n# Future: Define a class for spectra - spectra, error and weight\n\ndef process_spectra(spectra_info=None, badcombpixmask=4351, minSNR=50.):\n con... | [
[
"numpy.where",
"numpy.place",
"numpy.median",
"numpy.squeeze"
]
] |
yhCyan/graph-tensor-propagation | [
"b216fb24c5b9ea21d7b338ac24b272b0f346fcc3"
] | [
"exp_gqa/main.py"
] | [
"import os\nimport json\nimport torch\nimport sys\nimport time\nimport random\nimport numpy as np\n\nfrom tqdm import tqdm, trange\nimport torch.multiprocessing as mp\nimport torch.distributed as dist\nfrom torch.utils.tensorboard import SummaryWriter\nfrom apex.parallel import DistributedDataParallel as DDP\nfrom ... | [
[
"torch.cuda.manual_seed_all",
"torch.load",
"torch.multiprocessing.spawn",
"torch.manual_seed",
"torch.distributed.init_process_group",
"numpy.random.seed"
]
] |
tomelf/cnit-623 | [
"edf25f0b216b2480f7b651d3b94c1377dff721c0"
] | [
"task3_doc2vec_svm.py"
] | [
"import data_loader\nimport numpy as np\nimport pandas as pd\nimport re\nimport os.path\n\nfrom itertools import product\nfrom string import ascii_lowercase\n\nfrom sklearn.pipeline import Pipeline, FeatureUnion\nfrom sklearn.decomposition import PCA, TruncatedSVD\nfrom sklearn.metrics import roc_auc_score, accurac... | [
[
"sklearn.svm.SVC",
"sklearn.metrics.classification_report",
"pandas.read_csv",
"pandas.DataFrame",
"sklearn.model_selection.GridSearchCV"
]
] |
srmainwaring/python-ignition | [
"720f2e6d8e675ed7e10488caf11ef7e93e519d58"
] | [
"python/rover_publisher.py"
] | [
"#!/usr/bin/env python\n\n# Copyright (C) 2022 Rhys Mainwaring\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... | [
[
"scipy.spatial.transform.Rotation.from_euler"
]
] |
dima137/iact_dnn | [
"b0e71877cd3d6e9a1b8871dc0cbd85c16c29a84d"
] | [
"iact_dnn_utils.py"
] | [
"import numpy as np\nimport h5py\nimport time\nimport os\n\n\n# functions (to be moved to utils.py)\ndef add_meta_keys(fn, pars_keys, image_keys=[]):\n with h5py.File(fn, 'r') as f:\n for key in f.keys():\n if key not in pars_keys and key not in image_keys:\n pars_keys.append(key... | [
[
"numpy.ones",
"numpy.sum",
"numpy.heaviside",
"numpy.ceil",
"numpy.zeros",
"numpy.arange"
]
] |
Enopoletus/enopoletus.github.io | [
"2701900dbc0f7f4dd1ec1c78d8be14095eafad28"
] | [
"employmonth.py"
] | [
"import pandas as pd\nimport matplotlib.pyplot as plt, mpld3\nimport numpy as np\nimport scipy.signal as sp\nimport matplotlib.ticker as plticker\ndf=pd.read_csv('numbers2.csv')\ndf.columns=['DATE', 'EMPLOYEES']\ndf.DATE=pd.to_datetime(df.DATE)\ndf.EMPLOYEES=np.log(df.EMPLOYEES)\ntrend=sp.savgol_filter(df.EMPLOYEES... | [
[
"scipy.signal.savgol_filter",
"matplotlib.pyplot.xticks",
"pandas.read_csv",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.subplots",
"numpy.arange",
"pandas.to_datetime",
"numpy.log",
"matplotlib.pyplot.plot"
]
] |
dolaameng/tensorflow_cookbook | [
"ca9bcb892239e9276e9348689e06cd6d1edd19ef"
] | [
"02_TensorFlow_Way/01_Operations_as_a_Computational_Graph/01_operations_on_a_graph.py"
] | [
"# Operations on a Computational Graph\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.python.framework import ops\nops.reset_default_graph()\n\n# Create graph\nsess = tf.Session()\n\n# Create tensors\n\n# Create data to feed in\nx_vals = np.array([1., 3., 5., 7., 9.])... | [
[
"tensorflow.placeholder",
"tensorflow.train.SummaryWriter",
"tensorflow.python.framework.ops.reset_default_graph",
"tensorflow.mul",
"tensorflow.Session",
"numpy.array",
"tensorflow.merge_all_summaries",
"tensorflow.constant"
]
] |
glotzerlab/freud-examples | [
"589a66d7732ab1eeb097957938e766688c084ab1"
] | [
"archive/demos/afrl_helpers.py"
] | [
"import matplotlib.colors as mplColors\nimport numpy as np\nfrom bokeh.io import output_notebook\nfrom bokeh.plotting import figure\nfrom bokeh.resources import INLINE\nfrom freud import box\nfrom matplotlib import cm\n\noutput_notebook(resources=INLINE)\n\n# define vertices for hexagons\nverts = [\n [0.53728496... | [
[
"numpy.ones",
"numpy.sum",
"numpy.load",
"numpy.zeros",
"numpy.einsum",
"matplotlib.colors.Normalize",
"numpy.cos",
"numpy.copy",
"numpy.add",
"numpy.angle",
"numpy.array",
"numpy.sin",
"numpy.where",
"numpy.unique"
]
] |
umutcanceyhan7/python_survival_game | [
"43437c14be5e96817f96e4571000197acf5d90ac"
] | [
"ceng113_hw5_260201003.py"
] | [
"# Umutcan CEYHAN 260201003 \nimport numpy\n\nclass Game():\n def __init__(self,map_width,map_height,init_time, action_cost):\n # The Game initializes map parameters.\n self.mapwidth = map_width\n self.mapheight = map_height\n # The Game initializes its map with all empty squares.\n ... | [
[
"numpy.zeros",
"numpy.in1d",
"numpy.array",
"numpy.where",
"numpy.random.randint",
"numpy.unique"
]
] |
shaoliangliang1996/pyBKT | [
"1354f95d7db6dd217c1a58cabc9c1352141ad4fd"
] | [
"source-py/pyBKT/util/metrics.py"
] | [
"import numpy as np\nimport sklearn.metrics as sk\n\nSUPPORTED_METRICS = ['accuracy', 'auc', 'rmse']\n\ndef error_check(flat_true_values, pred_values):\n if len(flat_true_values) != len(pred_values):\n raise ValueError(\"preds and true values need to have same shape\")\n\ndef accuracy(flat_true_values, pr... | [
[
"sklearn.metrics.roc_auc_score",
"numpy.delete"
]
] |
tasbolat1/DGflow | [
"6ce22095a0d33f4da3c15f093aa365ba6cabbac9"
] | [
"conditional_batchnorm.py"
] | [
"import torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn import init\n\n\nclass ConditionalBatchNorm2d(nn.BatchNorm2d):\n\n \"\"\"Conditional Batch Normalization\"\"\"\n\n def __init__(self, num_features, eps=1e-05, momentum=0.1,\n affine=False, track_running_stats=True):\n ... | [
[
"torch.nn.BatchNorm2d",
"torch.rand",
"torch.no_grad",
"torch.tensor",
"torch.nn.Embedding",
"torch.nn.functional.batch_norm",
"torch.nn.init.ones_",
"torch.nn.init.zeros_"
]
] |
timothymillar/sgkit | [
"a3a5e961b6b21ff7de235075955c0f797ad5027c"
] | [
"sgkit/model.py"
] | [
"from typing import Any, Dict, Hashable, List, Optional\n\nimport numpy as np\nimport xarray as xr\n\nfrom .typing import ArrayLike\nfrom .utils import create_dataset\n\nDIM_VARIANT = \"variants\"\nDIM_SAMPLE = \"samples\"\nDIM_PLOIDY = \"ploidy\"\nDIM_ALLELE = \"alleles\"\nDIM_GENOTYPE = \"genotypes\"\n\n\ndef cre... | [
[
"numpy.isnan"
]
] |
fperez/nipy | [
"559f17150bd9fa8ead4fd088b330d7cf7db7aa79"
] | [
"nipy/io/tests/test_save.py"
] | [
"# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\nimport os\nfrom tempfile import mkstemp\nimport numpy as np\n\nfrom nipy.testing import assert_true, assert_false, assert_equal, \\\n assert_array_almost_equal, funcfile\n\n\nfrom nipy.io.api impo... | [
[
"numpy.array",
"numpy.allclose",
"numpy.random.standard_normal",
"numpy.asarray"
]
] |
marcovirgolin/pyNSGP | [
"4a9634161012d6ab39ce3d304dba943b6f7d9b29"
] | [
"pynsgp/Selection/Selection.py"
] | [
"import numpy as np\nfrom copy import deepcopy\nfrom numpy.random import randint\n\ndef TournamentSelect( population, how_many_to_select, tournament_size=4 ):\n\tpop_size = len(population)\n\tselection = []\n\n\twhile len(selection) < how_many_to_select:\n\n\t\tbest = population[randint(pop_size)]\n\t\tfor i in ran... | [
[
"numpy.random.randint"
]
] |
Aparna-Sakshi/sktime | [
"419d347f062320290fb65e4afec72b82179e63bf"
] | [
"sktime/classification/feature_based/tests/test_fresh_prince.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"FreshPRINCE test code.\"\"\"\nimport numpy as np\nfrom numpy import testing\nfrom sklearn.metrics import accuracy_score\n\nfrom sktime.classification.feature_based import FreshPRINCE\nfrom sktime.datasets import load_unit_test\n\n\ndef test_fresh_prince_on_unit_test_data():\n \"\"... | [
[
"numpy.argmax",
"numpy.random.RandomState",
"sklearn.metrics.accuracy_score",
"numpy.testing.assert_array_almost_equal",
"numpy.array"
]
] |
carderne/msoa-income | [
"2cfaef3e1942ba6f97b963cbc02472a154fae6d6"
] | [
"join.py"
] | [
"import sys\n\nimport pandas as pd\nimport geopandas as gpd\n\n\ndef main(csv, gpkg, out):\n df = pd.read_csv(csv).assign(\n Income=lambda x: pd.to_numeric(x.Income.str.replace(\",\", \"\"))\n )\n\n gpd.read_file(gpkg).get([\"MSOA01CD\", \"geometry\"]).merge(\n df, how=\"inner\", left_on=\"MS... | [
[
"pandas.read_csv"
]
] |
SamanKhamesian/Human-Activity-Recognition-Time-Series-Classification | [
"1b1d8474997ddf3c0f22791acecdfd823b9de5fd"
] | [
"Source/lstm.py"
] | [
"import os\n\nimport tensorflow as tf\nfrom keras.layers import LSTM, Dense, Dropout\nfrom keras.models import Sequential\n\nfrom Source.config import Model\nfrom Source.driver import Driver\n\ntf.logging.set_verbosity(tf.logging.ERROR)\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'\n\n\ndef run():\n dataset = Driver... | [
[
"tensorflow.logging.set_verbosity"
]
] |
UWSEDS-aut17/uwseds-group-maximize-savings-in-clean-energy | [
"c485c5e1f5bea1135b013835d28227f858a68c4d"
] | [
"sundial/price_model/parameter_tuning.py"
] | [
"import numpy as np\nfrom matplotlib import pyplot as plt\nimport seaborn as sns\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\nfrom sklearn import linear_model\nfrom sklearn import neighbors\nfrom sklearn import svm\nfrom sklearn.model_selection import GridSearchCV\nfrom sundial.price_... | [
[
"matplotlib.pyplot.legend",
"sklearn.neighbors.KNeighborsRegressor",
"pandas.read_csv",
"matplotlib.pyplot.figure",
"sklearn.svm.SVR",
"sklearn.linear_model.LinearRegression",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"matplotlib.pyp... |
yosukefk/plotter | [
"16127ee7fc3105c717e92875ee3d61477bd41533"
] | [
"demo/work_pretty_trio.py"
] | [
"#!/usr/bin/env python3\nimport sys\n\nplotterdir = '..'\nsys.path.insert(0, plotterdir)\n\nfrom plotter import calpost_reader\nimport plotter.plotter_multi as plotter_multi\nfrom plotter.plotter_util import LambertConformalTCEQ\nfrom plotter.plotter_background import BackgroundManager\nimport cartopy.crs as ccrs\n... | [
[
"matplotlib.colors.ListedColormap"
]
] |
humans-to-robots-motion/lgp | [
"f62da0c0cb7a209eb90848cce8eddc91c14fa099"
] | [
"lgp/geometry/transform.py"
] | [
"import numpy as np\nfrom pyrieef.geometry.differentiable_geometry import DifferentiableMap\n\n\nclass LinearTranslation(DifferentiableMap):\n \"\"\"\n Simple linear translation\n \"\"\"\n\n def __init__(self, p0=np.zeros(2)):\n assert isinstance(p0, np.ndarray)\n self._p = p0\n\n def f... | [
[
"numpy.eye",
"numpy.zeros"
]
] |
MGarrod1/rgg_ensemble_analysis | [
"679ea7b11c0eae4d92eef9f08fe9c63dcfd3837c"
] | [
"rgg_ensemble_analysis/Statistics_Computation.py"
] | [
"\"\"\"\n\nFunctions to compute various statistics of the data\nand their associated errors.\n\n\"\"\"\n\n\n#Compute statistics about the variance of an estimator:\n\nimport numpy as np \nfrom scipy import stats\nimport math\n\n#The following functions as involved in estimating the standard \n\ndef Moment(Sample,k)... | [
[
"numpy.var",
"scipy.stats.sem",
"numpy.sort",
"numpy.std",
"scipy.stats.spearmanr",
"numpy.mean"
]
] |
liggest/RGBDFace | [
"75768b1848f03d3e9d53913546b19cce0b1ada67"
] | [
"RGBDFace/utils/face.py"
] | [
"import numpy as np\n# import open3d as o3d\nimport face_recognition\n# import cv2\nfrom skimage import draw #,morphology\n\n\n# from .depth import depthPreprocess\nfrom .image import getConvexHullMask,getMaskedImg2, maskClosing,maskDilation,maskErosion\n\ndef faceLandmarks(image):\n '''\n 人脸边框+特征点\n '... | [
[
"numpy.zeros_like",
"numpy.sum",
"numpy.asarray",
"numpy.int_",
"numpy.isnan",
"numpy.where",
"numpy.linalg.norm",
"numpy.mean"
]
] |
defensetongxue/pyGAT | [
"5677b15be986b0650b883cdd20dbfb1bb486d6f5"
] | [
"utils.py"
] | [
"import numpy as np\nimport scipy.sparse as sp\nimport torch\nimport json as js\nimport pandas as pd \ndef encode_onehot(labels):\n # The classes must be sorted before encoding to enable static class encoding.\n # In other words, make sure the first class always maps to index 0.\n classes = sorted(list(set... | [
[
"numpy.eye",
"numpy.ones",
"pandas.read_csv",
"numpy.dtype",
"numpy.isinf",
"scipy.sparse.csr_matrix",
"scipy.sparse.diags",
"scipy.sparse.eye",
"numpy.power",
"numpy.array",
"numpy.where",
"torch.LongTensor"
]
] |
wnorris/models | [
"a5e4965d1f4e4b02d51aa344336b6fff53af7c17"
] | [
"official/projects/yt8m/dataloaders/yt8m_input_test.py"
] | [
"# Copyright 2022 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.io.gfile.makedirs",
"tensorflow.test.main"
]
] |
ruoxinx/site-dust-detect | [
"f1b4c71f3ce5c325b25e26e9d663e3c1f7096ce7"
] | [
"demo/yolo.py"
] | [
"import colorsys\nimport os\n\nimport numpy as np\nfrom keras import backend as K\nfrom keras.layers import Input\nfrom keras.models import load_model\nfrom PIL import Image, ImageDraw, ImageFont\n\nfrom nets.yolo3 import yolo_body, yolo_eval\nfrom utils.utils import letterbox_image\n\nclass YOLO(object):\n _def... | [
[
"numpy.random.shuffle",
"numpy.floor",
"numpy.random.seed",
"numpy.expand_dims",
"numpy.array"
]
] |
MuawizChaudhary/STARTUP | [
"5cfa6694a4ffa6ffd3cc22deceb4626fd008ee83"
] | [
"teacher_miniImageNet/datasets/cifar_few_shot.py"
] | [
"# This code is modified from https://github.com/facebookresearch/low-shot-shrink-hallucinate\n\nimport torch\nfrom PIL import Image\nimport numpy as np\nimport torchvision.transforms as transforms\nimport additional_transforms as add_transforms\nfrom abc import abstractmethod\nfrom torchvision.datasets import CIFA... | [
[
"torch.utils.data.DataLoader",
"torch.randperm"
]
] |
thadanipaarth/Non-Invasive-Public-Safety-Detection-System | [
"760b79c295e31003c7d0e826fe9214a73245c344"
] | [
"Scripts/training_mask_detection_model.py"
] | [
"from tensorflow.keras.preprocessing.image import ImageDataGenerator\nfrom tensorflow.keras.applications import MobileNetV2\nfrom tensorflow.keras.layers import AveragePooling2D\nfrom tensorflow.keras.layers import Dropout\nfrom tensorflow.keras.layers import Flatten\nfrom tensorflow.keras.layers import Dense\nfrom... | [
[
"sklearn.preprocessing.LabelBinarizer",
"tensorflow.keras.utils.to_categorical",
"tensorflow.keras.optimizers.Adam",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.applications.mobilenet_v2.preprocess_input",
"tensorflow.keras.preprocessing.imag... |
jaywilhelm/OpenUxAS | [
"76b08d94c4c51ca51d9f79c9db03d7344e9d6552"
] | [
"examples/02_Example_WaterwaySearch/dubinsUAV.py"
] | [
"from matplotlib import pyplot as plt\nfrom shapely.geometry import Point\nfrom shapely.geometry.polygon import Polygon\n#from lineSegmentAoE import *\nimport numpy as np\nimport sys\n\nclass dubinsUAV():\n\n def __init__(self, position, velocity, heading, dt=0.1):\n\n self.velocity = velocity\n se... | [
[
"numpy.sqrt",
"numpy.arctan2",
"numpy.append",
"numpy.rad2deg",
"numpy.abs",
"numpy.cos",
"numpy.array",
"numpy.sin",
"numpy.deg2rad"
]
] |
lucifer2859/sac-discrete-pytorch | [
"c6f367d95bdc5cee8b3d6e5a01172bb99af5b171"
] | [
"sacd/agent/sacd.py"
] | [
"import os\nimport numpy as np\nimport torch\nfrom torch.optim import Adam\n\nfrom .base import BaseAgent\nfrom sacd.model import TwinnedQNetwork, CategoricalPolicy\nfrom sacd.utils import disable_gradients\n\n# If you want to use Prioritized Experience Replay(PER), N-step return \n# or Dueling Networks, change use... | [
[
"torch.sum",
"torch.min",
"torch.no_grad",
"torch.optim.Adam",
"torch.ByteTensor",
"numpy.log",
"torch.zeros",
"torch.mean"
]
] |
freenowill/autoVC-WavRNN | [
"871a7ae5671e81fe4396cbc6f89a90009b01049b"
] | [
"vocoder/inference_wavrnn.py"
] | [
"from vocoder.models.fatchord_version import WaveRNN\r\nfrom vocoder import hparams as hp\r\nimport torch\r\n\r\n\r\n_model = None # type: WaveRNN\r\n\r\ndef load_model(weights_fpath, verbose=True):\r\n global _model\r\n \r\n if verbose:\r\n print(\"Building Wave-RNN\")\r\n _model = WaveRNN(\r\... | [
[
"torch.from_numpy",
"torch.load"
]
] |
Peyo-Supp/Master-Production-Planning-Algorithm | [
"c91bf9304bcf1ad7ecdf6729ee483a6e3de45a38"
] | [
"Discount_bracket_replenishment.py"
] | [
"import pandas as pd\nimport math as m\nimport numpy as np\n\n\"\"\"\nalgorithm that calculate the best alternative from supplier order bracket based on data provided.\n\n\"\"\"\n\n#input data here!\n# demand_in_cases =\n# order_cost =\n# cost_per_case =\n# bracket_cost = []\n# bracket_minimum = []\n# holding_rate ... | [
[
"numpy.sqrt",
"pandas.DataFrame",
"numpy.array"
]
] |
teamcfe/AI-as-an-API | [
"a291fc0e6ec380139599a948f2efd58923c70784"
] | [
"app/ml.py"
] | [
"import json\nimport numpy as np\n\nfrom typing import Optional, List\nfrom pathlib import Path\nfrom dataclasses import dataclass # pip install dataclasses\n\nfrom tensorflow.keras.models import load_model\nfrom tensorflow.keras.preprocessing.sequence import pad_sequences\nfrom tensorflow.keras.preprocessing.text ... | [
[
"tensorflow.keras.preprocessing.text.tokenizer_from_json",
"tensorflow.keras.models.load_model",
"tensorflow.keras.preprocessing.sequence.pad_sequences",
"numpy.argmax"
]
] |
31337mbf/MLAlgorithms | [
"3c8e16b8de3baf131395ae57edd479e59566a7c6"
] | [
"mla/rbm.py"
] | [
"# coding:utf-8\nimport logging\n\nimport numpy as np\nfrom scipy.special import expit\n\nfrom mla.base import BaseEstimator\nfrom mla.utils import batch_iterator\n\nnp.random.seed(9999)\nsigmoid = expit\n\n\"\"\"\nReferences:\nA Practical Guide to Training Restricted Boltzmann Machines https://www.cs.toronto.edu/~... | [
[
"numpy.random.random_sample",
"numpy.sum",
"numpy.zeros",
"numpy.random.randn",
"numpy.random.seed",
"numpy.dot"
]
] |
kurtmaia/JointSBM | [
"516daa6249694118cca4db2a4a92e0ef7164166f"
] | [
"jointSBM.py"
] | [
"import numpy as np \nimport scipy as sp\n\nfrom numpy.linalg import inv, cholesky\nfrom scipy.linalg import eig\nfrom sklearn.metrics.cluster import normalized_mutual_info_score as nmi\nfrom sklearn.metrics.cluster import adjusted_rand_score as ari\nfrom sklearn.metrics.cluster import contingency_matrix\nfrom skle... | [
[
"numpy.sum",
"numpy.diag",
"sklearn.cluster.KMeans",
"sklearn.metrics.cluster.contingency_matrix",
"sklearn.metrics.cluster.normalized_mutual_info_score",
"numpy.argmin",
"scipy.sparse.linalg.eigs",
"sklearn.metrics.cluster.adjusted_rand_score",
"numpy.ndarray",
"numpy.rand... |
DeepPSP/cpsc2021 | [
"165790be750421eb0e0f0fe3129d03dddc250ada"
] | [
"score_2021.py"
] | [
"#!/usr/bin/env python3\n\nimport numpy as np\nimport json\nimport os\nimport sys\n\nimport scipy.io as sio\nimport wfdb\n\n\"\"\"\nWritten by: Xingyao Wang, Chengyu Liu\n School of Instrument Science and Engineering\n Southeast University, China\n chengyu@seu.edu.cn\n\"\"\"\n\n... | [
[
"scipy.io.loadmat",
"numpy.zeros",
"numpy.diff",
"numpy.dstack",
"numpy.array",
"numpy.where",
"numpy.mean"
]
] |
kamal-rahimi/SentenceCorrection | [
"19138ebbdf1073f070a1982d3991de063c0d27d7"
] | [
"process_sentence.py"
] | [
"\"\"\"\nEstimates the likihood of an input senetnce and finds an order of words\nthat is most likely in the longuage model\n\"\"\"\n\nimport os\nimport argparse\nimport pickle\n\nfrom keras.models import load_model\nfrom keras.preprocessing.sequence import pad_sequences\nfrom keras import backend as k\n\nimport nu... | [
[
"numpy.array",
"numpy.argmax"
]
] |
wjwyyjr/Gem5_task_graph | [
"0e233b5053d6dcd518a2ad6fddd23eaeb9c3a8ee"
] | [
"my_scripts/10_03/different_memory_access/plot.py"
] | [
"from io import SEEK_CUR\nfrom os import name\nfrom types import FunctionType\nimport matplotlib.pyplot as plt\nfrom matplotlib.pyplot import legend, plot, xticks\n\n## class for plot function\nclass PlotFunction():\n \"\"\"Make Data visualization Easier !\"\"\"\n def __init__(self, y_data, x_label, y_label, ... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.gca",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.pie",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.xlabel"
]
] |
ruihan0495/EfficientDet | [
"f61b77343a9782d85747ced6704c35a49528934a"
] | [
"utils/graph_funcs.py"
] | [
"import tensorflow as tf\n############################################################\n# Miscellenous Graph Functions\n############################################################\n\ndef trim_zeros_graph(boxes, name='trim_zeros'):\n \"\"\"Often boxes are represented with matrices of shape [N, 4] and\n are p... | [
[
"tensorflow.divide",
"tensorflow.minimum",
"tensorflow.stack",
"tensorflow.shape",
"tensorflow.multiply",
"tensorflow.expand_dims",
"tensorflow.cast",
"tensorflow.abs",
"tensorflow.concat",
"tensorflow.boolean_mask",
"tensorflow.constant",
"tensorflow.split",
"t... |
lp2333/PARL | [
"f508bc6085420431b504441c7ff129e64826603e"
] | [
"parl/env/tests/continuous_wrappers_test.py"
] | [
"# Copyright (c) 2018 PaddlePaddle 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 ... | [
[
"numpy.array"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.