repo_name stringlengths 8 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
maccam912/Oddyssey | [
"a9d1eca9ea1dfabd9873eb842eae03f2ed83d405"
] | [
"src/GameManager/gui/subscreen.py"
] | [
"import numpy as np\n\nclass SubScreen():\n def __init__(self, x, y, width, height, curses):\n self.x = x\n self.y = y\n self.width = width\n self.height = height\n self.curses = curses\n \n def put_char(self, x, y, char=' ', foreground='white', background='transparent'):... | [
[
"numpy.ceil"
]
] |
davidliyutong/Flint | [
"4e2552dac8d781c21e8998ad68bbf1b986b09258"
] | [
"test/test43_tf_official.py"
] | [
"from models import Linear3\nfrom core.Optimizers import sgd, bgd\nfrom core.Functions import one_hot_f\nimport numpy as np\nfrom tensorflow import keras\nfrom core.Dataloader import batch_iterator\n\n\ndef test(model, test_inputs, test_labels):\n num_of_sample = test_inputs.shape[0]\n cnt_correct, cnt_tot = ... | [
[
"numpy.expand_dims",
"numpy.argmax"
]
] |
vishalbelsare/neupy | [
"684313cdaddcad326f2169384fb15ec3aa29d991"
] | [
"tests/layers/test_reshape_layer.py"
] | [
"import numpy as np\n\nfrom neupy import layers\n\nfrom base import BaseTestCase\n\n\nclass ReshapeLayerTestCase(BaseTestCase):\n def test_reshape_layer_1d_shape(self):\n x = np.random.random((5, 4, 3, 2, 1))\n\n input_layer = layers.Input((4, 3, 2, 1))\n reshape_layer = layers.Reshape()\n ... | [
[
"numpy.random.random"
]
] |
baender/gimli | [
"eb9a2204669cf11209b9577472f61ac70217a191"
] | [
"pygimli/physics/traveltime/raplot.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\"WRITEME\"\"\"\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nimport pygimli as pg\n\nfrom pygimli.viewer.mpl import createColorBar # , updateColorBar\n\nfrom .ratools import shotReceiverDistances\n\n\ndef drawTravelTimeData(ax, data, t=None):\n ... | [
[
"numpy.arange",
"numpy.unique",
"numpy.loadtxt",
"numpy.absolute"
]
] |
saraswat/TensorLog | [
"c56cebfa33b5123d5340a7b429e333da09d223d8"
] | [
"tensorlog/testxcomp.py"
] | [
"# (C) William W. Cohen and Carnegie Mellon University, 2017\n\nimport logging\nimport numpy as np\nimport os\nimport unittest\nimport sys\nimport collections\nimport tempfile\n\nfrom tensorlog import xctargets\n\nif xctargets.tf:\n import tensorflow as tf\n from tensorlog import tensorflowxcomp\nelse: \n tensor... | [
[
"tensorflow.placeholder",
"tensorflow.global_variables_initializer",
"tensorflow.logging.set_verbosity",
"tensorflow.nn.softmax",
"tensorflow.trainable_variables",
"tensorflow.Graph",
"tensorflow.cast",
"numpy.clip",
"tensorflow.train.GradientDescentOptimizer",
"tensorflow.... |
Mu-L/kedro | [
"a925fd59187a642e124527f0f1097e92ea8d1819"
] | [
"tests/extras/datasets/pandas/test_json_dataset.py"
] | [
"from pathlib import Path, PurePosixPath\n\nimport pandas as pd\nimport pytest\nfrom adlfs import AzureBlobFileSystem\nfrom fsspec.implementations.http import HTTPFileSystem\nfrom fsspec.implementations.local import LocalFileSystem\nfrom gcsfs import GCSFileSystem\nfrom pandas.testing import assert_frame_equal\nfro... | [
[
"pandas.DataFrame",
"pandas.testing.assert_frame_equal"
]
] |
acezen/graph-learn | [
"77bd92f960e4d178a3606444684f7f04c7f5b738"
] | [
"examples/data/cora.py"
] | [
"# Copyright 2020 Alibaba Group Holding Limited. 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# Unle... | [
[
"numpy.dtype",
"numpy.isinf",
"scipy.sparse.csr_matrix",
"scipy.sparse.diags",
"numpy.power",
"numpy.array",
"numpy.genfromtxt"
]
] |
zjzh/chainer | [
"e9da1423255c58c37be9733f51b158aa9b39dc93"
] | [
"tests/chainer_tests/functions_tests/pooling_tests/test_unpooling_2d.py"
] | [
"import unittest\n\nimport numpy\nimport six\n\nimport chainer\nfrom chainer.backends import cuda\nfrom chainer import functions\nfrom chainer import gradient_check\nfrom chainer import testing\nfrom chainer.testing import attr\nfrom chainer_tests.functions_tests.pooling_tests import pooling_nd_helper\n\n\n@testing... | [
[
"numpy.random.uniform",
"numpy.array",
"numpy.zeros"
]
] |
Substancia/FDTD-Huygens-metasurface | [
"dfb46f43c0653b394b63e7af92a331ae4824d9be"
] | [
"quartz_sphere.py"
] | [
"from fdtd_venv import fdtd_mod as fdtd\nfrom numpy import arange, flip, meshgrid, array\nfrom matplotlib.pyplot import plot, show\n\ndef main():\n\tgrid = fdtd.Grid(shape=(200, 200, 1), grid_spacing=155e-9)\n\n\tlens_width = 10\n\tlens_order = 3\n\tlens_radius = 25\n\tx, y = arange(-90, 90, 1), arange(lens_radius-... | [
[
"numpy.arange",
"numpy.meshgrid",
"numpy.flip"
]
] |
medicode/tensor2tensor | [
"3386fa537957fcf8133536322fcadec0630dde11"
] | [
"tensor2tensor/utils/usr_dir.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Tensor2Tensor 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 requir... | [
[
"tensorflow.logging.info"
]
] |
dmitryduev/broker | [
"7b9582fae6cd37bbd334bca228ef429d96e0e498",
"7b9582fae6cd37bbd334bca228ef429d96e0e498"
] | [
"kowalski/alert_watcher_zuds.py",
"kowalski/dev/ingest_known_lenses_20180901.py"
] | [
"import argparse\nimport os\nimport sys\nimport io\nimport time\nimport json\nfrom bson.json_util import dumps\nimport traceback\n\nimport confluent_kafka\nfrom ast import literal_eval\nimport avro.schema\nimport fastavro\nimport subprocess\nimport datetime\nimport multiprocessing\n# import threading\n\nimport pymo... | [
[
"numpy.rint",
"numpy.sign",
"numpy.zeros",
"tensorflow.keras.models.load_model",
"numpy.floor",
"numpy.cos",
"numpy.abs",
"numpy.expand_dims",
"numpy.log10",
"numpy.sqrt",
"numpy.sin",
"numpy.pad",
"numpy.nan_to_num",
"numpy.linalg.norm"
],
[
"numpy.... |
jshede/Cirq | [
"5db0f6aa8c009735a9ce0b0b7909ffe2532c396d"
] | [
"cirq/google/api/v1/programs.py"
] | [
"# Copyright 2018 The Cirq Developers\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law o... | [
[
"numpy.packbits",
"numpy.asarray",
"numpy.unpackbits",
"numpy.shape",
"numpy.pad",
"numpy.frombuffer"
]
] |
gideont/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10 | [
"f8b24ccba44e3a55cc20da2ed0ad44d7ad2216bf"
] | [
"detect_single_image.py"
] | [
"######## Image Object Detection Using Tensorflow-trained Classifier #########\n#\n# Author: Evan Juras\n# Date: 1/15/18\n# Description: \n# This program uses a TensorFlow-trained neural network to perform object detection.\n# It loads the classifier and uses it to perform object detection on an image.\n# It draws ... | [
[
"tensorflow.compat.v1.GPUOptions",
"numpy.squeeze",
"tensorflow.io.gfile.GFile",
"tensorflow.compat.v1.ConfigProto",
"tensorflow.Graph",
"numpy.expand_dims",
"tensorflow.compat.v1.GraphDef",
"tensorflow.import_graph_def",
"tensorflow.compat.v1.logging.set_verbosity"
]
] |
farzana0/pgm_graph_inference | [
"37f1ea68f191d4f3021e7fdc8dd246d945e37ead"
] | [
"experiments/saved_exp_res/exp_helpers.py"
] | [
"\"\"\"\n\nExperiment specifications:\nan experiment is defined by train,test dataset pair,\neach dataset is loaded from graphical_models/datasets.\nAuthors: kkorovin@cs.cmu.edu\n\n\"\"\"\n\nimport os\nimport numpy as np\n\nfrom graphical_models import BinaryMRF\nfrom inference import get_algorithm\nfrom graphical_... | [
[
"numpy.load"
]
] |
jasperroebroek/sklearn-quantile | [
"d357240527f32b04b0fec3dcd308bb23de517209"
] | [
"tests/test_weighted_quantile.py"
] | [
"import numpy as np\nimport pytest\n\nfrom sklearn_quantile.utils import weighted_quantile\n\nfrom numpy.testing import assert_equal\nfrom numpy.testing import assert_array_almost_equal\nfrom numpy.testing import assert_almost_equal\nfrom numpy.testing import assert_raises\n\n\ndef test_quantile_equal_weights():\n ... | [
[
"numpy.testing.assert_raises",
"numpy.ones",
"numpy.quantile",
"numpy.ones_like",
"numpy.random.RandomState",
"numpy.arange",
"numpy.testing.assert_array_almost_equal",
"numpy.sort"
]
] |
ghanashyamchalla/cis_interface | [
"7b59439276eacb66f1f6ea4177d3a85cc061eed5"
] | [
"yggdrasil/drivers/CModelDriver.py"
] | [
"import os\nimport re\nimport warnings\nimport copy\nimport shutil\nimport subprocess\nimport numpy as np\nimport sysconfig\nfrom collections import OrderedDict\nfrom yggdrasil import platform, tools\nfrom yggdrasil.drivers.CompiledModelDriver import (\n CompiledModelDriver, CompilerBase, ArchiverBase)\nfrom ygg... | [
[
"numpy.dtype",
"numpy.distutils.misc_util.get_numpy_include_dirs"
]
] |
marcoabrate/transformers | [
"3f77c26d74e1282955fefa8dfff2451e44f6d4a9"
] | [
"src/transformers/trainer.py"
] | [
"# coding=utf-8\n# Copyright 2020-present the HuggingFace Inc. team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unles... | [
[
"torch.cuda.amp.GradScaler",
"torch.distributed.get_rank",
"torch.distributed.get_world_size",
"torch.utils.data.distributed.DistributedSampler",
"torch.utils.data.sampler.SequentialSampler",
"torch.no_grad",
"torch.tensor",
"torch.utils.data.dataloader.DataLoader",
"torch.util... |
arpitdm/nifty | [
"763792d2ddc72f2af8c6d1372c5ed8d04c741ae1"
] | [
"models/fairgnn.py"
] | [
"import torch.nn as nn\nfrom models import *\nimport torch\nimport gc\n\ndef get_model(nfeat, args):\n if args.model == \"gcn\":\n model = GCN_Body(nfeat,args.num_hidden,args.dropout)\n elif args.model == \"gat\":\n heads = ([args.num_heads] * args.num_layers) + [args.num_out_heads]\n mo... | [
[
"torch.sigmoid",
"torch.nn.Linear",
"torch.mean"
]
] |
buchgr/tensorflow | [
"2938772a08ed02ced4663ca38168ab3f82e8f81b"
] | [
"tensorflow/python/keras/saving/model_architectures.py"
] | [
"# Copyright 2020 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.python.keras.Input",
"tensorflow.python.keras.layers.Dense",
"tensorflow.python.keras.layers.Embedding",
"tensorflow.python.keras.layers.concatenate",
"tensorflow.python.keras.layers.LSTM",
"tensorflow.python.keras.layers.LSTMCell",
"tensorflow.python.keras.layers.BatchNorm... |
gvashishtha/azureml-examples | [
"dc7ee4c01410757beeaa52a4f696882ca38e0be7"
] | [
"code/deployment/triton/bidaf_utils.py"
] | [
"\"\"\"score_bidaf.py\n\nScoring script for use with the Bi-directional Attention Flow model from the ONNX model zoo.\nhttps://github.com/onnx/models/tree/master/text/machine_comprehension/bidirectional_attention_flow\n\"\"\"\n\nimport json\nimport nltk\nimport numpy as np\nimport os\n\nfrom nltk import word_tokeni... | [
[
"numpy.array"
]
] |
wi1k1n/nrf-accelerations | [
"3075d63177e8ac04ee91784d5b0c56379335740f"
] | [
"util/visualize_light_samples.py"
] | [
"import argparse, sys, os, os.path as op, json, subprocess\nimport numpy as np\nimport open3d as o3d\nimport plotly.graph_objects as go\n\nPATH = 'D:\\\\edu\\\\UniBonn\\\\Study\\\\thesis\\\\codes\\\\NSVF\\\\'\n# PATH2MODEL = 'D:\\\\edu\\\\UniBonn\\\\Study\\\\thesis\\\\codes\\\\blender\\\\projects\\\\brdf_sphere\\\\... | [
[
"numpy.linalg.norm"
]
] |
evenrus/myeloma_SNV | [
"b8faa365babcc5583bc7b8431e4c5053acb35cb9"
] | [
"myeloma_snv/commands.py"
] | [
"\"\"\"variants_process main command.\"\"\"\n\nimport timeit\nimport re\nfrom datetime import datetime\nfrom os.path import join\nimport pandas as pd\nimport numpy as np\nimport pybedtools as pyb\n\nSTART = timeit.default_timer()\n\n## IMPORT VARIANTS FILE\ndef import_variants(path):\n \"\"\"\n Determine file... | [
[
"pandas.Series",
"pandas.read_csv",
"pandas.read_excel",
"pandas.merge",
"pandas.isnull",
"numpy.where"
]
] |
rubyvanrooyen/katdal | [
"e90bca3c2cd6305492d03ddc9aa48e67c1800428"
] | [
"katdal/h5datav2.py"
] | [
"################################################################################\n# Copyright (c) 2011-2021, National Research Foundation (SARAO)\n#\n# Licensed under the BSD 3-Clause License (the \"License\"); you may not use\n# this file except in compliance with the License. You may obtain a copy\n# of the Lice... | [
[
"numpy.ones",
"numpy.zeros",
"numpy.packbits",
"numpy.ones_like",
"numpy.arange",
"numpy.unpackbits",
"numpy.array",
"numpy.isscalar",
"numpy.bitwise_and",
"numpy.unique"
]
] |
Statfactory/ColdBrew | [
"ee16eee73e8dc89646abd6ee3e19858e49c6ffb7"
] | [
"cortado/cutcovfactor.py"
] | [
"from cortado.abstractfactor import AbstractFactor\nimport numpy as np\nfrom cortado.seq import Seq\nfrom cortado.funcslicer import FuncSlicer\nfrom cortado.consts import HEADLENGTH, SLICELEN, MISSINGLEVEL\nfrom numba import jit\nfrom numba.typed import Dict\nfrom numba import types\n\n@jit(nopython=True, cache=Fal... | [
[
"numpy.empty",
"numpy.searchsorted",
"numpy.isnan"
]
] |
primasanjaya/muat-github | [
"4603c6c960188643fb38d8dba82e0dcc1ba00b40",
"4603c6c960188643fb38d8dba82e0dcc1ba00b40"
] | [
"main_old.py",
"dataset/pcawgtcga_dataloader.py"
] | [
"# make deterministic\r\nfrom mingpt.utils import set_seed\r\nset_seed(42)\r\n#frompc\r\n\r\nimport numpy as np\r\nimport torch\r\nimport torch.nn as nn\r\nfrom torch.nn import functional as F\r\nimport math\r\nfrom torch.utils.data import Dataset\r\n\r\nfrom mingpt.model import *\r\n\r\nfrom mingpt.trainer import ... | [
[
"pandas.DataFrame"
],
[
"pandas.read_csv",
"pandas.DataFrame",
"torch.tensor",
"numpy.asarray",
"numpy.argmax",
"numpy.round",
"numpy.pad"
]
] |
Bartosz-D3V/ml-dataset-analysis | [
"cb2458dcb7cecba01f52be5b12e816ca00ce7da4"
] | [
"bike-sharing-demand/one_hot_encoder_transformer.py"
] | [
"import pandas as pd\nfrom sklearn.base import BaseEstimator, TransformerMixin\n\n\nclass OneHotEncoderTransformer(BaseEstimator, TransformerMixin):\n\n def __init__(self, columns) -> None:\n self.columns = columns\n\n def fit(self, X, y=None):\n return self\n\n def transform(self, X, y=None)... | [
[
"pandas.get_dummies"
]
] |
payoto/graphcore_examples | [
"46d2b7687b829778369fc6328170a7b14761e5c6",
"46d2b7687b829778369fc6328170a7b14761e5c6"
] | [
"applications/tensorflow/detection/yolov3/log.py",
"applications/pytorch/miniDALL-E/train.py"
] | [
"# Copyright (c) 2021 Graphcore Ltd. 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 ... | [
[
"numpy.sum",
"numpy.histogram",
"tensorflow.trainable_variables",
"numpy.max",
"tensorflow.HistogramProto",
"tensorflow.pywrap_tensorflow.NewCheckpointReader",
"numpy.min",
"numpy.prod",
"numpy.array",
"numpy.linalg.norm",
"numpy.isnan",
"tensorflow.Summary"
],
... |
rehohoho/mmsegmentation | [
"a73ae7a421e07741fda62c9d81b335cbc4b7f7d6"
] | [
"mmseg/models/decode_heads/knet_head.py"
] | [
"# Copyright (c) OpenMMLab. All rights reserved.\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom mmcv.cnn import ConvModule, build_activation_layer, build_norm_layer\nfrom mmcv.cnn.bricks.transformer import (FFN, TRANSFORMER_LAYER,\n MultiheadAtten... | [
[
"torch.nn.init.xavier_uniform_",
"torch.nn.Linear",
"torch.nn.init.normal_",
"torch.nn.ModuleList",
"torch.einsum",
"torch.cat",
"torch.nn.functional.interpolate"
]
] |
tsutterley/captoolkit | [
"314c4d34f49012c25286478c943b0ab13c893c62"
] | [
"captoolkit/readgla12.py"
] | [
"#!/usr/bin/env python\r\n\"\"\"\r\n Reads GLA12 Release 634 HDF5.\r\n \r\n Reads several files in parallel if njobs > 1 is specified.\r\n \r\n Extracts a subset of the data based on a mask.tif file.\r\n \r\n Example:\r\n \r\n python readgla.py /mnt/devon-r0/shared_data/icesat/GLAH12.034/... | [
[
"numpy.vstack",
"numpy.ones",
"numpy.flipud",
"numpy.zeros",
"numpy.empty",
"numpy.invert",
"numpy.modf",
"numpy.abs",
"numpy.size",
"scipy.ndimage.map_coordinates",
"numpy.arange",
"numpy.isnan",
"numpy.round",
"numpy.where",
"numpy.meshgrid",
"nump... |
mathyouf/GPT-Games | [
"bf6e558bf6ec92d1fba97770587610da0f3447eb"
] | [
"src/interactive_conditional_samples.py"
] | [
"#!/usr/bin/env python3\n\nimport fire\nimport json\nimport os\nimport re\nimport numpy as np\nimport tensorflow as tf\n\nimport model, sample, encoder\n\ndef modify_raw_text(raw_text, interviewer, interviewee):\n return interviewer+\": \\\"\" + raw_text + \"\\\" \"+ interviewee +\":\\\"\"\n\ndef interact_model(... | [
[
"tensorflow.placeholder",
"numpy.random.seed",
"tensorflow.Graph",
"tensorflow.set_random_seed",
"tensorflow.train.Saver"
]
] |
rparini/cxroots | [
"037247fc47b29781b9cc66857a8395283e8ecc86"
] | [
"cxroots/tests/test_deriv.py"
] | [
"import pytest\nimport numpy as np\nfrom numpy import cos, sin\n\nfrom cxroots import Circle, Rectangle\nfrom cxroots import CxDerivative\n\n@pytest.mark.parametrize('C', [\n pytest.param(Circle(0, 2), id='circle'),\n pytest.param(Rectangle([-1.5,1.5],[-2,2]), id='rect'),\n pytest.param(None, id='default')... | [
[
"numpy.array",
"numpy.sin",
"numpy.cos"
]
] |
kingagla/reviews_classification | [
"9bf9636035bf14fb3ce151d075a6c04f4cdbfde6"
] | [
"scripts/models/01_prepare_and_save_models.py"
] | [
"import os\nimport pickle\nimport pandas as pd\nfrom sklearn.cluster import DBSCAN\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.metrics import classification_report\nfrom sklearn.preprocessing import LabelEncoder\nfrom tensorflow.keras.callbacks import ModelCheckpoint\nfrom tensorflow.keras.la... | [
[
"tensorflow.keras.models.Sequential",
"pandas.read_pickle",
"tensorflow.keras.layers.Dropout",
"sklearn.metrics.classification_report",
"sklearn.cluster.DBSCAN",
"pandas.DataFrame",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.preprocessing.LabelEncoder",
"tensorflow.ker... |
Jarino/cgp-optimization | [
"3b50813a591c3535c7846b7e8acf5f5959122d02"
] | [
"tengp_eval/optimizers/sa.py"
] | [
"from configparser import ConfigParser\n\nimport numpy as np\nfrom sklearn.metrics import mean_squared_error, r2_score\nimport pygmo as pg\n\nfrom tengp.individual import IndividualBuilder, NPIndividual\nfrom tengp import Parameters, FunctionSet\nfrom tengp_eval.coevolution import TrainersSet, GaPredictors\n\n\ndef... | [
[
"sklearn.metrics.mean_squared_error"
]
] |
THU-DA-6D-Pose-Group/Self6D-Diff-Renderer | [
"408330a9c7d7010a5af0a5b0b469f1ef695d18de",
"408330a9c7d7010a5af0a5b0b469f1ef695d18de"
] | [
"core/dr_utils/dib_renderer_x/utils/sphericalcoord.py",
"core/dr_utils/dib_renderer_x/renderer/texrender_batch.py"
] | [
"# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.\n\n# Permission is hereby granted, free of charge, to any person obtaining a\n# copy of this software and associated documentation files (the \"Software\"),\n# to deal in the Software without restriction, including without limitation\n# the rights to u... | [
[
"numpy.arctan2",
"numpy.transpose",
"numpy.zeros",
"numpy.arccos",
"numpy.stack",
"numpy.linalg.norm"
],
[
"torch.ones_like",
"torch.cat"
]
] |
gioramponi/LOGEL | [
"e862324816c57dd5d07691ee8583259a6a62116c"
] | [
"gridworld/lfl/mdp_utils.py"
] | [
"\"\"\"utils for entropy-regularized discrete MDPs.\"\"\"\n\nfrom __future__ import print_function\nimport numpy as np\n\n\ndef softmax(x, tau=1.):\n e = np.exp(x * tau)\n z = -np.log(sum(e))\n return np.exp(x * tau + z)\n\n\ndef score_policy(pi, r, p, alpha, gamma):\n \"\"\"Returns expected score J(pi)... | [
[
"numpy.tile",
"numpy.zeros",
"numpy.exp",
"numpy.log",
"numpy.random.rand"
]
] |
b3ttin4/network_simulation_and_analysis | [
"56ec3fd497ad95eee6eec00042d332133495288e"
] | [
"network_model/tools/bn_tools_t.py"
] | [
"import numpy as np\n\n\n# Nonlinearity functions (Numpy implementation)\nnl_linear = lambda x: x\nnl_tanh = lambda x: np.tanh(x)\nnl_sigmoid = lambda x: 1./(1+np.exp(-x)) \nnl_rect = lambda x: np.clip(x, 0, np.inf)\n#nl_rect = lambda x: np.clip(x, -np.inf, np.inf)\nnl_shallow_rect = lambda x: np.clip(0.1*x, 0, np.... | [
[
"numpy.tile",
"numpy.exp",
"numpy.arange",
"matplotlib.pyplot.show",
"numpy.clip",
"numpy.tanh"
]
] |
project-k-0-1/project-k | [
"fa5be043a3c82daee992d28db25519e2b1b53289"
] | [
"sa_numeric.py"
] | [
"\"\"\" Numerical functions \"\"\"\nimport math\nimport numpy as np\nimport pymysql.cursors\nfrom sa_db import sa_db_access\nACCESS_OBJ = sa_db_access()\nDB_USR = ACCESS_OBJ.username()\nDB_PWD = ACCESS_OBJ.password()\nDB_NAME = ACCESS_OBJ.db_name()\nDB_SRV = ACCESS_OBJ.db_server()\n\ndef get_pct_change(ini_val, new... | [
[
"numpy.std"
]
] |
parachutel/garage | [
"e9d4301278f5dd31e3cbd20df1422befa2d0b6c4"
] | [
"tests/benchmarks/test_benchmark_trpo.py"
] | [
"'''\nThis script creates a regression test over garage-TRPO and baselines-TRPO.\n\nUnlike garage, baselines doesn't set max_path_length. It keeps steps the action\nuntil it's done. So we introduced tests.wrappers.AutoStopEnv wrapper to set\ndone=True when it reaches max_path_length. We also need to change the\ngar... | [
[
"tensorflow.Graph",
"tensorflow.compat.v1.Session"
]
] |
zahrag/3DHARSOM | [
"f934d0b5786d2edac29a7a18be31fa74aafcb881"
] | [
"codes/SOM.py"
] | [
"\n\"\"\"\n Author: Zahra Gharaee.\n This code is written for the 3D-Human-Action-Recognition Project, started March 14 2014.\n \"\"\"\n\nimport numpy as np\nfrom numpy import linalg as LA\n\n\nclass SOM:\n\n def __init__(self, learning, outputsize_x, outputsize_y, inputsize, sigma, softmax_exponent, ma... | [
[
"numpy.sum",
"numpy.zeros",
"numpy.exp",
"numpy.argmax",
"numpy.max",
"numpy.expand_dims",
"numpy.random.rand",
"numpy.array"
]
] |
JPLMLIA/libeos | [
"3ad25c22159edf79d407454e32b8f07333cb57c2"
] | [
"pims/els_data.py"
] | [
"# Cassini CAPS ELS data reader\n# Modeled after Gary's MDIS reader\n# Kiri Wagstaff, 11/28/18\n\nimport os\nfrom datetime import datetime\nfrom collections import defaultdict\nimport numpy as np\nfrom pds.core.parser import Parser\nfrom scipy.interpolate import interp1d\n\nGEOMFILE = os.path.join(\n os.path.dir... | [
[
"numpy.load",
"numpy.sum",
"scipy.interpolate.interp1d",
"numpy.dtype",
"numpy.fromstring"
]
] |
Shuai-Xie/openseg.pytorch | [
"79116a58782ccd2150f9eb9054e70cfd42fc9773"
] | [
"lib/loss/loss_helper.py"
] | [
"##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n## Created by: Donny You, RainbowSecret\n## Microsoft Research\n## yuyua@microsoft.com\n## Copyright (c) 2019\n##\n## This source code is licensed under the MIT-style license found in the\n## LICENSE file in the root directory of this sou... | [
[
"torch.FloatTensor",
"torch.nn.functional.softmax",
"torch.nn.CrossEntropyLoss",
"torch.cuda.current_device",
"torch.nn.functional.cross_entropy",
"torch.softmax",
"torch.nn.functional.interpolate"
]
] |
paulfioravanti/Reinforcement-Learning-In-Motion | [
"e09afd23b82040d76c95875b077ba0a5af517470"
] | [
"Unit-7-The-Cartpole/q_learning.py"
] | [
"import gym\nimport numpy as np\nfrom util import plot_running_average\n\n# pylint: disable-msg=redefined-outer-name\ndef max_action(estimates, state):\n values = np.array([estimates[state, i] for i in range(2)])\n action = np.argmax(values)\n return action\n\ndef get_state(observation):\n cart_x, cart_... | [
[
"numpy.zeros",
"numpy.argmax",
"numpy.random.random",
"numpy.linspace",
"numpy.digitize"
]
] |
vardhanaleti/AdversarialQuerying | [
"f2ed5960f345ba448eeb4c9a1f5c819c41d092da"
] | [
"models/R2D2_embedding.py"
] | [
"import torch.nn as nn\nimport torch\nimport math\n\n# Embedding network used in Meta-learning with differentiable closed-form solvers\n# (Bertinetto et al., in submission to NIPS 2018).\n# They call the ridge rigressor version as \"Ridge Regression Differentiable Discriminator (R2D2).\"\n \n# Note that they use a... | [
[
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.Softmax",
"torch.reshape",
"torch.nn.Conv2d",
"torch.einsum",
"torch.nn.Softplus",
"torch.nn.ReLU",
"torch.nn.Dropout",
"torch.nn.LeakyReLU"
]
] |
brianjo/pytorch | [
"fd8004b42e2a2348ec8837e3fb524b960c1b4cdb"
] | [
"torch/testing/_internal/distributed/distributed_test.py"
] | [
"import copy\nimport itertools\nimport math\nimport os\nimport random\nimport sys\nimport tempfile\nimport time\nfrom collections import namedtuple\nfrom contextlib import contextmanager, suppress\nfrom datetime import timedelta\nfrom functools import reduce\nfrom typing import Union, NamedTuple, Callable, Any\n\ni... | [
[
"torch.distributed.distributed_c10d._get_default_group",
"torch.distributed.distributed_c10d.get_world_size",
"torch.cuda.manual_seed",
"torch.nn.functional.softmax",
"torch.rand",
"torch.distributed.is_gloo_available",
"torch.nn.Conv2d",
"torch.cat",
"torch.cuda.amp.GradScaler... |
lacrosse91/scikit-learn | [
"2a67d88258264eb2b6dfad221be8f8d61684dcba"
] | [
"sklearn/datasets/_twenty_newsgroups.py"
] | [
"\"\"\"Caching loader for the 20 newsgroups text classification dataset.\n\n\nThe description of the dataset is available on the official website at:\n\n http://people.csail.mit.edu/jrennie/20Newsgroups/\n\nQuoting the introduction:\n\n The 20 Newsgroups data set is a collection of approximately 20,000\n n... | [
[
"numpy.searchsorted",
"numpy.in1d",
"numpy.arange",
"numpy.array",
"numpy.concatenate",
"scipy.sparse.vstack"
]
] |
ZiningWang/Sparse_Pooling | [
"a160ddf9a03ef53bad630b4ac186a8437bd0475c"
] | [
"MV3D_TF_release/lib/datasets/voc_eval.py"
] | [
"# --------------------------------------------------------\n# Fast/er R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Bharath Hariharan\n# --------------------------------------------------------\n\nimport xml.etree.ElementTree as ET\nimport os\nimport pickle\nimport numpy as np\nim... | [
[
"numpy.sum",
"numpy.sort",
"numpy.cumsum",
"numpy.zeros",
"numpy.maximum",
"numpy.finfo",
"numpy.argsort",
"numpy.argmax",
"numpy.arange",
"numpy.where",
"numpy.max",
"numpy.array",
"numpy.concatenate",
"numpy.minimum"
]
] |
sadams2013/pvtools | [
"12bd9334a1335972519c81d0c01c6308aa597c39"
] | [
"pvtools.py"
] | [
"# Import standard libraries.\nimport json\n\n# Import external libraries.\nimport numpy as np\nimport pandas as pd\n\nclass dbSNP:\n \"\"\"Store dbSNP data for a gene.\n\n Parameters\n ----------\n dbsnp_file : str\n Path to a dbSNP file containing variant information.\n\n Attributes\n ---... | [
[
"pandas.read_table",
"pandas.DataFrame"
]
] |
vishalbelsare/tsa | [
"203e602fe5fc95b89afb454156fc7e4faee90f2a"
] | [
"src/main/python/thalesians/tsa/optimization/visual.py"
] | [
"import itertools\nimport time\nimport warnings\n\nimport numpy as np\nimport matplotlib.colors\nimport matplotlib.pyplot as plt\n\nimport thalesians.tsa.checks as checks\nimport thalesians.tsa.numpyutils as npu\nimport thalesians.tsa.utils as utils\n\ndef _aggregate(aggregate_func, data, empty_aggregate):\n if ... | [
[
"matplotlib.pyplot.figure",
"numpy.size"
]
] |
MUYANGGUO/HPC | [
"ab95d18d4054b892269dd439470548abd06f5512"
] | [
"projects/1-molecular-dynamics/check.py"
] | [
"\nif __name__ == \"__main__\":\n import sys\n import json\n import numpy as np\n\n firstline = sys.stdin.readline()\n obj = json.loads(firstline)\n\n Np = obj['num_points']\n dt = obj['dt']\n L = obj['L']\n Nt = obj['num_steps']\n Nint = obj['step_chunk']\n k = obj['k']\n d = o... | [
[
"numpy.ones",
"numpy.zeros",
"numpy.ndarray",
"numpy.array",
"numpy.polyfit",
"numpy.linspace",
"numpy.mean"
]
] |
hiroyasuakada/ros_start | [
"10221ad2bcaefa4aaadc6c90424a3751126ac256"
] | [
"scripts/gan/cycle_gan/train.py"
] | [
"import os\nimport random\nimport itertools\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.utils.data\nimport torchvision.transforms as transforms\nfrom torchvision.utils import make_grid\nfrom torch.autograd import Variable\nfrom PIL import Image\nimport matplotlib.pyplot as plt\nfrom tenso... | [
[
"torch.utils.data.DataLoader",
"torch.manual_seed",
"numpy.random.seed",
"torch.device"
]
] |
ziyedy/category-priornet | [
"5aa080eeff936ce3939f0d5458a2936677c15726"
] | [
"lib/prior/priorNet.py"
] | [
"import sys\n\nsys.path.append(\"../../\")\nimport lib.gcn3d as gcn3d\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass PriorEncoder(nn.Module):\n def __init__(self, support_num: int, neighbor_num: int):\n super(PriorEncoder, self).__init__()\n\n self.neighbor_num =... | [
[
"torch.randn",
"torch.nn.Linear",
"torch.nn.functional.relu"
]
] |
yulong314/mmpose | [
"cdfce789d0e48dd868c70a405a7d7f3da2b4ebe3"
] | [
"mmpose/datasets/datasets/hand/freihand_dataset.py"
] | [
"# Copyright (c) OpenMMLab. All rights reserved.\nimport os\nfrom collections import OrderedDict\n\nimport numpy as np\n\nfrom mmpose.datasets.builder import DATASETS\nfrom .hand_base_dataset import HandBaseDataset\n\n\n@DATASETS.register_module()\nclass FreiHandDataset(HandBaseDataset):\n \"\"\"FreiHand dataset... | [
[
"numpy.array",
"numpy.ones",
"numpy.zeros",
"numpy.minimum"
]
] |
gonsoomoon/tensorflow-workshop-for-sagemaker | [
"985ab3853c16f4833caeae6382ccfc4474ac8e98"
] | [
"training_script/cifar10_keras_sm.py"
] | [
"# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of this\n# software and associated documentation files (the \"Software\"), to deal in the Software\n# without restriction, including without limitation the ri... | [
[
"tensorflow.data.TFRecordDataset",
"tensorflow.random_crop",
"tensorflow.image.random_flip_left_right",
"tensorflow.reshape",
"tensorflow.image.resize_image_with_crop_or_pad",
"tensorflow.logging.set_verbosity",
"tensorflow.parse_single_example",
"tensorflow.decode_raw",
"tenso... |
slimnsour/datman | [
"6ac4827e2ae20401eb4b048d42bdfca5db5d3de9"
] | [
"bin/dm_link.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nRenames (links) exam zip archives by consulting a lookup table.\n\nThis program looks up the proper name in a table that lists the original exam\narchive name, and the target name.\n\nUsage:\n dm_link.py [options] <study>\n dm_link.py [options] <study> <zipfile>\n\nArguments:\n... | [
[
"pandas.read_csv"
]
] |
haggaila/qiskit-dynamics | [
"fd20314e2b591c35323782bc429d9f928fdb9a12"
] | [
"test/dynamics/solvers/test_solver_classes.py"
] | [
"# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2021.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modifications or ... | [
[
"numpy.array",
"numpy.eye",
"numpy.kron",
"numpy.abs"
]
] |
Sourodip-ghosh123/Fruits-360 | [
"f15ce919757f0a0ce057f4ba4b49ce3d5aba53e2"
] | [
"ResNet50 V2/resnet50_v2_model.py"
] | [
"from keras.applications.resnet_v2 import ResNet50V2\nmodel=ResNet50V2(include_top=True, weights=None, input_tensor=None, input_shape=(100,100,3),classes=41)\nmodel.summary()\n\nmodel.compile(loss='categorical_crossentropy',\n optimizer='adam',\n metrics=['accuracy'])\nprint('Compiled!')\n... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel"
]
] |
gandreassi/ImmoKaa | [
"904115e5a6f91ca78b41aebdaf4ffe3934a4c318"
] | [
"ImmoKaa/scraper.py"
] | [
"from bs4 import BeautifulSoup\nimport urllib.request as urllib2\nimport random\nfrom random import choice\nimport pandas as pd\nimport copy, time, sys, shutil, os, yaml, json\nimport datetime as dt\nfrom glob import glob\nimport regex\n\nclass scraper():\n \n criteria = None\n df = None\n df_pre = None... | [
[
"pandas.read_csv",
"pandas.to_datetime",
"pandas.concat",
"pandas.DataFrame.from_dict"
]
] |
yxia-fb/shaDow-GNN | [
"2b867011c7084d4ed1b407e29f3ee09632fcc3dc"
] | [
"shaDow/utils.py"
] | [
"import os\nimport torch\nimport glob\n\nimport numpy as np\nimport scipy.sparse as sp\nimport yaml\nfrom sklearn.preprocessing import StandardScaler\n\nfrom shaDow.globals import git_rev, timestamp, Logger\nfrom torch_scatter import scatter\n\nfrom copy import deepcopy\n\nfrom typing import List, Union\nfrom shaDo... | [
[
"numpy.vstack",
"numpy.load",
"torch.FloatTensor",
"scipy.sparse.dia_matrix",
"torch.Size",
"numpy.ones",
"numpy.zeros",
"torch.load",
"scipy.sparse.csr_matrix",
"numpy.asarray",
"numpy.where",
"torch.from_numpy",
"numpy.clip",
"numpy.power",
"sklearn.pr... |
dmuehlemann/RPGV | [
"18b4216e6cedce40a020a57e1822a363a8a6b60c"
] | [
"3_ gph-low-pass-filter.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sam Aug 7 11:50:05 2020\n\n@author: Dirk\n\nThis scripts applies a 10day low pass filter to the ERA5 gph daily means\n\n\"\"\"\n\nimport scipy.signal as signal\nimport matplotlib.pyplot as plt\nfrom pathlib import Path\nimport xarray as xr\n\n\n#Define input and output ... | [
[
"matplotlib.pyplot.legend",
"scipy.signal.butter",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel"
]
] |
endremborza/data-bevy | [
"25398124595ffddc201de6a748e84bb24d5885b2"
] | [
"staging/stop_detection/stops.py"
] | [
"from dataclasses import dataclass\nfrom datetime import datetime\n\nimport datazimmer as dz\nimport pandas as pd\nfrom colassigner import ColAssigner, get_all_cols\n\n\nclass NoStops(Exception):\n pass\n\n\n@dataclass\nclass DaySetup:\n work_start: int\n work_end: int\n home_arrive: int\n home_depar... | [
[
"pandas.NamedAgg"
]
] |
zhubonan/castepxbin | [
"24b875cf44b83d5eac75b52cf45e378a3361e90e"
] | [
"castepxbin/pdos.py"
] | [
"\"\"\"\nReader module for CASTEP pdos_bin\n\nWritten based on the example `pdos_bin.f90` file in open-source OptaDos code\n\"\"\"\nfrom enum import Enum, unique\nimport numpy as np\nfrom scipy.io import FortranFile\n\n\n@unique\nclass SpinEnum(Enum):\n \"\"\"\n Enum type for Spin. Only up and down.\n Usa... | [
[
"numpy.zeros",
"numpy.histogram",
"numpy.dtype",
"numpy.where",
"numpy.unique"
]
] |
TwinMooon/transformers-plus-performers | [
"c17d6473deb5316363f60bb2ddd1007d4364abe4"
] | [
"src/transformers/modeling_tf_performer_attention.py"
] | [
"from typing import Optional, Union\nimport logging\nimport numpy as np\nimport tensorflow as tf\n\n\nfrom .configuration_performer_attention import PerformerAttentionConfig\nfrom .modeling_utils import (\n find_pruneable_heads_and_indices,\n prune_linear_layer\n)\n\nKERNEL_CALLABLES = {\n 'cosh': lambda x... | [
[
"tensorflow.linalg.diag",
"tensorflow.reshape",
"tensorflow.abs",
"numpy.log",
"tensorflow.concat",
"tensorflow.nn.softmax",
"tensorflow.reduce_sum",
"tensorflow.device",
"tensorflow.keras.layers.Dense",
"tensorflow.constant",
"tensorflow.transpose",
"tensorflow.ker... |
ChaplinMarchais/cortana-intelligence-product-detection-from-images | [
"2e5370098f9f83cd27cdaba2eab675f3c30ae157"
] | [
"technical_deployment/train_model/imdb_data.py"
] | [
"# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# --------------------------------------------------------\n\nfrom __future__ import print_function\nfrom builtins import... | [
[
"numpy.cumsum",
"numpy.zeros",
"numpy.maximum",
"numpy.argsort",
"numpy.argmax",
"numpy.max",
"numpy.array",
"numpy.finfo",
"numpy.loadtxt",
"numpy.minimum"
]
] |
disktnk/chainer-compiler | [
"5cfd027b40ea6e4abf73eb42be70b4fba74d1cde"
] | [
"ch2o/tests/syntax/MultiFunction.py"
] | [
"# coding: utf-8\n\nimport chainer\nimport chainer.links as L\n\n# Network definition\n\n\nclass A(chainer.Chain):\n\n def __init__(self):\n super(A, self).__init__()\n with self.init_scope():\n self.l0 = L.Linear(7)\n self.l1 = L.Linear(5)\n\n def g(self, y):\n retu... | [
[
"numpy.random.seed",
"numpy.random.rand"
]
] |
888dahong888/open3dTest | [
"cf28df9f9f5d24b1ca614414804a1c18d349467c"
] | [
"test01.py"
] | [
"#读写点云,网格,图片文件\n\nimport numpy as np\nimport open3d as o3d\npcd=o3d.io.read_point_cloud(\"data/rs1.pcd\")\n\nprint(pcd) #打印点云数量\n\n#可视化一下\no3d.visualization.draw_geometries([pcd])\n \n#下采样\ndownpcd = pcd.voxel_down_sample(voxel_size=0.05)\no3d.visualization.draw_geometries([downpcd])\n \n#计算法向量\ndownpcd.estima... | [
[
"numpy.asarray"
]
] |
INK-USC/shifted-label-distribution | [
"3cf2b7ced3b2e18234db405f6014f049c4830d71"
] | [
"NeuralATT/train.py"
] | [
"'''\nTraining script with ramdom splitting dev set\n'''\n__author__ = 'Maosen'\nimport torch\nfrom model import Model, Wrapper\nimport utils\nfrom utils import Dataset\nimport argparse\nimport pickle\nimport numpy as np\nfrom tqdm import tqdm\nimport logging\nimport os\nimport random\n\ntorch.backends.cudnn.determ... | [
[
"numpy.load",
"torch.manual_seed",
"torch.cuda.is_available",
"numpy.random.seed"
]
] |
xiaoMrzhang/mmdetection3d | [
"1e7695297e60afe3e09834de1582c3437086ed49"
] | [
"mmdet3d/models/backbones/second_ran.py"
] | [
"from mmcv.cnn import build_conv_layer, build_norm_layer\nfrom mmcv.runner import load_checkpoint, force_fp32\nfrom torch import nn as nn\nimport torch\nimport numpy as np\n\nfrom mmdet.models import BACKBONES\nfrom mmdet3d.utils.soft_mask import SoftMask\n\n@BACKBONES.register_module()\nclass SECOND_RAN(nn.Module)... | [
[
"torch.log",
"torch.nn.ModuleList",
"torch.nn.Sequential",
"torch.nn.ReLU",
"torch.pow"
]
] |
ZJU-lishuang/mmaction2 | [
"ee34d952e792fd1adea2c2e397b29faff68eaec9"
] | [
"tests/test_models/test_recognizers/test_recognizer2d.py"
] | [
"import torch\n\nfrom mmaction.models import build_recognizer\nfrom ..base import generate_recognizer_demo_inputs, get_recognizer_cfg\n\n\ndef test_tsn():\n config = get_recognizer_cfg('tsn/tsn_r50_1x1x3_100e_kinetics400_rgb.py')\n config.model['backbone']['pretrained'] = None\n\n recognizer = build_recogn... | [
[
"torch.no_grad"
]
] |
yikir/mmdetection | [
"dfceb61b0252f81b010f550f2acbe46c7dad6ef6"
] | [
"port.py"
] | [
"#!/usr/bin/env python\n# -*- coding: UTF-8 -*-\n\n# n(net) o(oil) h(hang) r(rust) 检测模块\nimport os\nimport sys\ncurrent_dir = os.path.dirname(os.path.abspath(__file__))\nsys.path.append(current_dir)\n\nfrom mmdet.models import build_detector\nimport mmcv\nimport torch\nimport cv2\nimport time\nimport json\nfrom mmc... | [
[
"numpy.vstack",
"numpy.ascontiguousarray",
"torch.no_grad",
"numpy.asarray",
"numpy.array",
"numpy.concatenate",
"numpy.full"
]
] |
balakrishnan273818/AdvancedLaneDetection | [
"c0993aa9422654258a41fe9616ab4e24b29e6a7a"
] | [
"examples/unwanted/example.py"
] | [
"'''\ndef warper(img, src, dst):\n\n # Compute and apply perpective transform\n img_size = (img.shape[1], img.shape[0])\n M = cv2.getPerspectiveTransform(src, dst)\n warped = cv2.warpPerspective(img, M, img_size, flags=cv2.INTER_NEAREST) # keep same size as input image\n\n return warped\n'''\n\nimpo... | [
[
"numpy.zeros"
]
] |
DanielSun94/kgenlu | [
"bbf377c6740040cb1a8b656785e7c5bfdb8371d5"
] | [
"src/test/rnn_test.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nNLP From Scratch: Translation with a Sequence to Sequence Network and Attention\n*******************************************************************************\n**Author**: `Sean Robertson <https://github.com/spro/practical-pytorch>`_\n\nThis is the third and final tutorial on doi... | [
[
"torch.nn.NLLLoss",
"torch.nn.Linear",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.switch_backend",
"torch.no_grad",
"torch.tensor",
"torch.nn.Embedding",
"matplotlib.pyplot.subplots",
"torch.nn.LogSoftmax",
"torch.nn.GRU",
"torch.nn.functional.relu",
"matplotlib... |
theKasra/14-puzzle-problem-bidirectionalsearch | [
"f6fe4e0d8a1db1b1675933d8b2461981ac08686b"
] | [
"Project_2.py"
] | [
"from copy import deepcopy\r\nfrom collections import deque\r\nimport time\r\nimport numpy as np\r\n\r\nclass Node:\r\n def __init__(self, parent, grid):\r\n self.parent = parent\r\n self.grid = grid\r\n\r\ndef print_answer(p1, p2):\r\n initial_to_middle = []\r\n while p1:\r\n initial_... | [
[
"numpy.matrix"
]
] |
cloudcomputinghust/IoT | [
"5db3f9078be427fa23549add1747a067c2add767"
] | [
"test-component/draw_graph_2.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nfrom influxdb import InfluxDBClient\nimport time\nimport datetime\nimport collections\n\n\ntime_min = '2017-04-03 16:35:00'\ntime_max = '2017-04-03 22:35:00'\ntime_min_2 = '2017-04-06 09:30:00'\ntime_max_2 = '2017-04-06 14:30:00'\n# time_min = '2017-03-25 00:00:... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.yscale",
"matplotlib.pyplot.title",
"numpy.arange",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
... |
slipperlobster/flipper | [
"527952a74bc76f76cf3a2d25755386f8db285885"
] | [
"jesse/indicators/gatorosc.py"
] | [
"from collections import namedtuple\n\nimport numpy as np\nimport talib\n\nfrom jesse.helpers import get_candle_source, np_shift\nfrom jesse.helpers import slice_candles\n\nGATOR = namedtuple('GATOR', ['upper', 'lower', 'upper_change', 'lower_change'])\n\n\ndef gatorosc(candles: np.ndarray, source_type: str = \"clo... | [
[
"numpy.arange",
"numpy.abs"
]
] |
legend-of-zyda/LuxPythonEnvGym | [
"7d818b5943dad1b7fae3c66b612aae93c743bd0e"
] | [
"examples/agent_policy.py"
] | [
"import sys\nimport time\nfrom functools import partial # pip install functools\nimport copy\nimport random\n\nimport numpy as np\nfrom gym import spaces\n\nfrom luxai2021.env.agent import Agent, AgentWithModel\nfrom luxai2021.game.actions import *\nfrom luxai2021.game.game_constants import GAME_CONSTANTS\nfrom lu... | [
[
"numpy.sum",
"numpy.zeros",
"numpy.argmin",
"numpy.argmax",
"numpy.delete",
"numpy.array",
"numpy.concatenate"
]
] |
pritesh-mehta/dwi-utilities | [
"f1e307fcf51ef4e4cc95ac311f031e3521c1fbbf"
] | [
"dwi_utilities/comp_high_b.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\n@author: pritesh-mehta\n\"\"\"\n\nimport numpy as np\nfrom scipy.optimize import curve_fit\nfrom pathlib import Path\nfrom argparse import ArgumentParser\n\nfrom dwi_utilities.monoexponential_decay import log_func, func\nimport dwi_utilities.nifti_utilities as nutil\n\ndef comp_hig... | [
[
"numpy.zeros",
"scipy.optimize.curve_fit",
"numpy.exp",
"numpy.log",
"numpy.shape",
"numpy.array"
]
] |
SarderLab/HistomicsTK_PodoSighter | [
"9a75302f645bfb3dfd9688d247388c9948f4eadb"
] | [
"histomicstk/deeplab/utils/get_dataset_colormap.py"
] | [
"# Lint as: python2, python3\n# 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/L... | [
[
"numpy.arange",
"numpy.max",
"numpy.asarray",
"numpy.zeros"
]
] |
Jasonandy/Python-X | [
"2f02b9a17bd5495dd1f8746b191f11ec2d7bccbe"
] | [
"cn/opencv/finger/finger.py"
] | [
"import cv2 as cv\nimport numpy as np\nimport math\nimport time\n\ncapture = cv.VideoCapture(0)\n\n# video = \"http://admin:admin@10.242.200.134:8081/\" # admin是账号:admin是密码 后面是局域网\n# capture = cv.VideoCapture(video)\n\n\n# 获得欧几里距离\ndef _get_eucledian_distance(vect1, vect2):\n distant = vect1[0] - vect2[0]\n ... | [
[
"numpy.ones",
"numpy.square"
]
] |
winnerineast/pythia | [
"b6fe288405490f6e02a3e59dbf32a181aee35645"
] | [
"pythia/utils/general.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\nimport collections\nimport gc\nimport os\nfrom bisect import bisect\n\nimport requests\nimport torch\nimport tqdm\nimport yaml\nfrom torch import nn\n\n\ndef lr_lambda_update(i_iter, cfg):\n if (\n cfg[\"training_parameters\"][\"use_warmup\"] is True\n ... | [
[
"torch.cuda.memory_cached",
"torch.is_tensor",
"torch.cuda.max_memory_allocated",
"torch.cuda.memory_allocated",
"torch.cuda.max_memory_cached"
]
] |
Qianna00/mmdetection | [
"31e7dff4c61000002d27117543b85e68d2619b4c"
] | [
"mmdet/models/detectors/two_stage_with_MetaEmbedding.py"
] | [
"import torch\nimport torch.nn as nn\nimport numpy as np\n\n# from mmdet.core import bbox2result, bbox2roi, build_assigner, build_sampler\nfrom ..builder import DETECTORS, build_backbone, build_head, build_neck\nfrom .base import BaseDetector\nfrom tqdm import tqdm\nfrom mmdet.datasets import build_dataloader, buil... | [
[
"torch.unsqueeze",
"torch.randn",
"torch.set_grad_enabled",
"torch.zeros",
"torch.tensor",
"torch.cuda.is_available",
"numpy.array",
"numpy.unique"
]
] |
BUPT-GAMMA/GammaGL | [
"2b9f32e1ac3533cb75a063243e8a2fa654466d18"
] | [
"profiler/mpops/ms_gpu.py"
] | [
"# !/usr/bin/env python3\n# -*- coding:utf-8 -*-\n\n# @Time : 2022/04/14 08:36\n# @Author : clear\n# @FileName: ms_gpu.py\n\nimport os\nos.environ['TL_BACKEND'] = 'mindspore'\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = \"1\"\n\nimport sys\nsys.path.insert(0, os.path.abspath('../../'))\nimport time\nimport numpy as ... | [
[
"numpy.random.randn",
"numpy.load",
"numpy.max",
"numpy.argsort"
]
] |
karimul/ebm-sampling | [
"c8c8565a21fde52ac71598f20625857c4ccb8b67"
] | [
"sampling/resgld.py"
] | [
"import torch\nimport numpy as np\nfrom autograd.numpy import sqrt\n\ndef gen_image_resgld(label, FLAGS, model, im_neg, num_steps, sample=False):\n\n im_noise = torch.randn_like(im_neg).detach()\n\n T_multiply=0.9\n T = 0.9\n var=0.1\n resgld_beta_high = im_neg\n resgld_beta_low = im_neg\n swap... | [
[
"numpy.random.uniform",
"torch.clamp",
"torch.randn_like",
"torch.exp"
]
] |
jkkummerfeld/lamb | [
"769adaa76394dc74746c2fd8d31afe9c3ca7895b"
] | [
"lamb/nascell.py"
] | [
"# Copyright 2018 DeepMind Technologies Limited. 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# Unles... | [
[
"tensorflow.compat.v1.zeros_initializer",
"tensorflow.compat.v1.matmul",
"tensorflow.compat.v1.split",
"tensorflow.compat.v1.nn.rnn_cell.LSTMStateTuple",
"tensorflow.compat.v1.nn.bias_add",
"tensorflow.compat.v1.get_variable"
]
] |
sert121/ivy | [
"286f86e487b0c83d46a3ef8d30aa96316337db32"
] | [
"ivy/functional/backends/tensorflow/array_api/linear_algebra.py"
] | [
"# global\nimport tensorflow as tf\nfrom tensorflow.python.types.core import Tensor\nfrom typing import Union, Optional, Tuple, Literal\n\n# local\nfrom ivy import inf\n\n\n# noinspection PyUnusedLocal,PyShadowingBuiltins\ndef vector_norm(x: Tensor,\n axis: Optional[Union[int, Tuple[int]]] = None, \n... | [
[
"tensorflow.cast",
"tensorflow.abs",
"tensorflow.linalg.norm",
"tensorflow.expand_dims"
]
] |
ddboline/kaggle_predict_west_nile | [
"b4dbb3eed450beaf2b73d2a772e0fb3266926418"
] | [
"feature_extraction.py"
] | [
"#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri May 1 16:28:06 2015\n\n@author: ddboline\n\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport csv\nimport gzip\n\nimport numpy as... | [
[
"pandas.read_csv",
"numpy.abs",
"numpy.cos",
"numpy.isnan",
"numpy.sin"
]
] |
neulab/idiomata-bot | [
"f397e49fb9d1d59b9b74e0e528a72307637a18e9"
] | [
"lang_id.py"
] | [
"import numpy as np\nimport iso639\nfrom collections import defaultdict\n\nall_langs = ('cay', 'dan', 'deu', 'eng', 'fra', 'kwk', 'see', 'swe')\n\ncodelang = [('cay', 'Cayuga'), ('see', 'Seneca'), ('other', 'Other')]\ncode2lang_dict = {c:l for (c,l) in codelang}\nlang2code_dict = {l:c for (c,l) in codelang}\n\ndef ... | [
[
"numpy.sum",
"numpy.max",
"numpy.exp"
]
] |
drat/Neural-Voice-Cloning-With-Few-Samples | [
"4febde43ccc143fc88d74d5fa0c5a117636778b4"
] | [
"Modules/Attention.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport sys\n\nfrom Modules.MultiHeadAttention import MultiHeadAttention\n\nclass Attention(nn.Module):\n def __init__(self, dim):\n super(Attention, self).__init__()\n\n self.encoders = self._build_model(dim)\n\n def _build_m... | [
[
"torch.nn.ModuleList"
]
] |
galvinw/fairmotdocker | [
"032d50a4025788b97ca36b0d97b7df15ddb5986c"
] | [
"monoloco/monoloco/visuals/plot_3d_box.py"
] | [
"\nimport numpy as np\n\n\ndef correct_boxes(boxes, hwls, xyzs, yaws, path_calib):\n\n with open(path_calib, \"r\") as ff:\n file = ff.readlines()\n p2_str = file[2].split()[1:]\n p2_list = [float(xx) for xx in p2_str]\n P = np.array(p2_list).reshape(3, 4)\n boxes_new = []\n for idx in rang... | [
[
"numpy.vstack",
"numpy.ones",
"numpy.transpose",
"numpy.any",
"numpy.cos",
"numpy.max",
"numpy.min",
"numpy.array",
"numpy.sin"
]
] |
Ditskih/Project | [
"87170245e55e615b0a14966d60afe41caece0434"
] | [
"processingfcmsvd.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Thu Feb 21 15:38:52 2019\r\n\r\n@author: Ditskih\r\n\"\"\"\r\nimport os\r\nimport json\r\nimport re\r\nimport csv\r\nfrom nltk.tokenize import word_tokenize\r\nfrom nltk.stem import WordNetLemmatizer\r\nfrom sklearn.feature_extraction.text import CountVectorizer\r\n#... | [
[
"scipy.sparse.csr_matrix",
"numpy.ones",
"sklearn.feature_extraction.text.TfidfVectorizer",
"sklearn.random_projection.GaussianRandomProjection"
]
] |
hengma1001/molecules | [
"c6694cc77ef1eb246f3fdab1f201481d1bcaa07c"
] | [
"molecules/utils/callback.py"
] | [
"import os\nimport time\nimport torch\n\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n\nclass Callback:\n def __init__(self): pass\n def on_train_begin(self, logs): pass\n def on_train_end(self, logs): pass\n def on_epoch_begin(self, epoch, logs): pass\n def on_epoch_end... | [
[
"torch.save",
"torch.cuda.is_available"
]
] |
bemrdo/CTF-2019 | [
"424512f7c43278d72091aa737da78907c14f9fc1"
] | [
"watevrCTF-2019/challenges/web/NewPwd/train.py"
] | [
"import requests\nimport urllib.parse\nimport base64\nimport json\nimport io\nimport numpy as np\nfrom PIL import Image\nimport cv2.cv2 as cv\nfrom solve import *\n\ndef combine_and_show_alphabet():\n imgTop = np.empty((50, 0))\n imgBottom = np.empty((50, 0))\n for char in alphabet[:16]:\n imgTop = ... | [
[
"numpy.rot90",
"numpy.min",
"numpy.empty"
]
] |
ToddSmall/beanmachine | [
"85768bd1785bf6a8b3760a04f37a8fca69b4e4ca"
] | [
"src/beanmachine/ppl/inference/tests/inference_test.py"
] | [
"# Copyright (c) Meta Platforms, Inc. and affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport math\nimport sys\n\nimport beanmachine.ppl as bm\nimport pytest\nimport torch\nimport torch.distributions as dist\nfrom bea... | [
[
"torch.distributions.Uniform",
"torch.tensor",
"torch.distributions.Normal"
]
] |
hzyjerry/InfoGAIL | [
"89bf3bee42242f4a8a41401d17296773294e6b6a"
] | [
"wgail_info_2/preprocess.py"
] | [
"from keras.applications.resnet50 import ResNet50\nfrom keras.preprocessing import image\nfrom keras.applications.resnet50 import preprocess_input\nfrom keras.models import Model\nimport numpy as np\nimport time\nimport cv2\n\n\ndef collect_demo(path, num_patch, aux_dim, action_dim):\n\n for i in range(num_patch... | [
[
"numpy.concatenate",
"numpy.expand_dims",
"numpy.zeros"
]
] |
anlavandier/dask-image | [
"a858c61ac5beb7de7d7644d7e85714b5c16c2a7a"
] | [
"tests/test_dask_image/test_ndfilters/test__conv.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport pytest\nimport numpy as np\nimport scipy.ndimage\n\nimport dask.array as da\n\nimport dask_image.ndfilters\n\n\n@pytest.mark.parametrize(\n \"da_func\",\n [\n (dask_image.ndfilters.convolve),\n (dask_image.ndfilters.correlate),\n ]\n)\n@... | [
[
"numpy.ones",
"numpy.random.seed",
"numpy.random.random",
"numpy.arange",
"numpy.stack",
"numpy.concatenate"
]
] |
ViniViniAntunes/Prevendo_Valor_de_Aluguel_em_SP | [
"e37d54da0b2c8ce3c6ddb4ec45191b069834427c"
] | [
"Previsao_valor_aluguel/app.py"
] | [
"# Importando as bibliotecas necessárias\nimport pandas as pd\nimport streamlit as st\nimport plotly.express as px\nfrom sklearn.ensemble import RandomForestRegressor\n\n# Criando uma função para carregar o dataset\n#@st.cache # Notação para ficar em cache\ndef get_data():\n return pd.read_csv(\"model/data_deplo... | [
[
"pandas.read_csv",
"sklearn.ensemble.RandomForestRegressor"
]
] |
LucasLorenc/tensorflow | [
"10a7b61cdf55d13c85c2a3cc5ca669e3d9ea8e11"
] | [
"tensorflow/python/keras/layers/core.py"
] | [
"# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.keras.backend.track_variable",
"tensorflow.python.util.nest.flatten",
"tensorflow.python.keras.constraints.get",
"tensorflow.python.keras.backend.image_data_format",
"tensorflow.python.keras.regularizers.L1L2",
"tensorflow.python.framework.tensor_shape.dimension_value",
... |
QuantumQuadrate/Rearrangement | [
"5f8d64bd18a471a488747ed8d17b00304b4ab293"
] | [
"PythonRearrangement/setup.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Aug 22 13:22:01 2018\n\n@author: Cody\n\"\"\"\n\nfrom setuptools import setup\nfrom setuptools import Extension\nfrom Cython.Distutils import build_ext\nimport numpy as np\n\n\nsetup(\n cmdclass = {'build_ext': build_ext},\n ext_modules = [Extension(\"Rearrange... | [
[
"numpy.get_include"
]
] |
Lechatelia/Welding_Joints | [
"7cb5b8ac4c961c4080e1590934c24130bfde3a26"
] | [
"ceshi.py"
] | [
"import cv2\r\nimport tensorflow as tf\r\nimport numpy as np\r\nimport random\r\n\r\ny = tf.constant([1,2,3,4,5,6], name='y',dtype=tf.float32)\r\ny_ = tf.constant([0,1,2,3,4,5], name='Y_',dtype=tf.float32)\r\ny = tf.reshape(y,[2,3])\r\ny_ = tf.reshape(y_,[2,3])\r\nz= tf.constant([1,2], name='z',dtype=tf.float32)\r\... | [
[
"tensorflow.reshape",
"tensorflow.subtract",
"tensorflow.multiply",
"numpy.abs",
"tensorflow.Session",
"numpy.array",
"tensorflow.constant"
]
] |
WeiyuCheng/FIA-KDD-19 | [
"18f29f8babbf1c505973a8a62ac48c6ca34ccd8a"
] | [
"src/scripts/RQ1.py"
] | [
"from __future__ import division\nfrom __future__ import print_function\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\nimport numpy as np\nimport argparse\nimport os\nfrom scipy.stats import pearsonr\nimport sys\n\nsys.path.append(\"..\")\nfrom scripts.load_movielens import load_m... | [
[
"scipy.stats.pearsonr",
"numpy.zeros",
"numpy.savez",
"numpy.random.choice",
"numpy.max",
"numpy.array"
]
] |
eyyupdirek/Rawpythn | [
"e66f0adcb8be514f349796d8ecad0a398412409d"
] | [
"rawpython.py"
] | [
"import pandas as pd\nimport numpy as np\nts = pd.Series(np.random.randn(1000),index=pd.date_range('1/1/2000', periods=1000))\n\nts\n"
] | [
[
"numpy.random.randn",
"pandas.date_range"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.