repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
yangyuchi/ACER | [
"573e00f9515c97c2f9828a39753cfc6f5fc4a511"
] | [
"test.py"
] | [
"# -*- coding: utf-8 -*-\nimport time\nfrom datetime import datetime\nimport gym\nimport tensorflow as tf\n\n\ndef test(args, counter, test_net, global_net, sess):\n tf.set_random_seed(args.seed)\n env = gym.make(args.env)\n env.seed(args.seed)\n\n can_test = True # Test flag\n t_start = 1 # Test s... | [
[
"tensorflow.set_random_seed",
"tensorflow.assign"
]
] |
kingaza/keras-gp | [
"0b62224d2fd727143c70385a0a5b40bdc09c5bd8"
] | [
"kgp/backend/engines.py"
] | [
"\"\"\"\nComputational engines used by GP backends.\n\"\"\"\nimport numpy as np\n\n\nclass Engine(object):\n \"\"\"The base class for computational engines.\n \"\"\"\n def addpath(self, path):\n self._eng.addpath(path)\n\n def eval(self, expr, verbose):\n \"\"\"Evaluate an expression.\n ... | [
[
"numpy.asarray"
]
] |
cfpryor/uncertainty-baselines | [
"07c7abe0a196a6d8b4d3f489deb87caafa7b0e9e"
] | [
"baselines/diabetic_retinopathy_detection/jax_finetune_sngp.py"
] | [
"# coding=utf-8\n# Copyright 2022 The Uncertainty Baselines 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# Unles... | [
[
"numpy.reshape",
"tensorflow.config.experimental.get_visible_devices",
"tensorflow.io.gfile.makedirs",
"numpy.concatenate",
"numpy.array",
"tensorflow.config.experimental.set_visible_devices",
"tensorflow.random.set_seed"
]
] |
Sniperq2/lightkurve | [
"4caf3261dd6c96529704867d4bbf61f7fb86a43b"
] | [
"tests/io/test_cdips.py"
] | [
"import pytest\n\nfrom astropy.io import fits\nimport numpy as np\nfrom numpy.testing import assert_array_equal\n\nfrom lightkurve import search_lightcurve\nfrom lightkurve.io.cdips import read_cdips_lightcurve\nfrom lightkurve.io.detect import detect_filetype\n\n@pytest.mark.remote_data\ndef test_detect_cdips():\n... | [
[
"numpy.testing.assert_array_equal",
"numpy.array_equal"
]
] |
KMKgit/ML | [
"998b6b47584337cb9a3ce5a7e405b973ad2c7a5a"
] | [
"tistory/basic/placeholder.py"
] | [
"import tensorflow as tf\n\na = tf.placeholder(tf.int16)\nb = tf.placeholder(tf.int16)\n\nadd = tf.add(a, b)\nmul = tf.mul(a, b)\n\nwith tf.Session() as sess:\n print (\"Add : %i\" %sess.run(add, feed_dict={a: 2, b: 3}))\n print (\"Mul : %i\" %sess.run(mul, feed_dict={a: 2, b: 3}))"
] | [
[
"tensorflow.Session",
"tensorflow.add",
"tensorflow.placeholder",
"tensorflow.mul"
]
] |
isabella232/fuzzbench | [
"f213bbeb57e27f01d18995120dd124406a6e7a2a"
] | [
"analysis/coverage_data_utils.py"
] | [
"# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"pandas.concat",
"pandas.DataFrame"
]
] |
CruxML/vitis-quantizer | [
"52bb2f8acc7b02ca57d1e282c49b9a61780c5592"
] | [
"vitis_quantizer/graph_transformations/transforms_test.py"
] | [
"# Copyright 2019 Xilinx 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 applicable law or agreed ... | [
[
"tensorflow.test.main"
]
] |
iteal/wormpose | [
"a92c0459f940d6e1f517b90d3a445ad3c0689ed8"
] | [
"wormpose/commands/calibrate_dataset.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"\nCalculates the image similarity on a random selection of labeled frames from a dataset.\n\"\"\"\n\nimport logging\nimport os\nimport random\nfrom argparse import Namespace\nfrom typing import Tuple\n\nimport h5py\nimport numpy as np\n\nfrom wormpose.commands import _log_parameters\... | [
[
"numpy.array",
"numpy.mean",
"numpy.random.seed",
"numpy.random.choice"
]
] |
SayakDas10/TicTacToe-Minimax-AI-GUI | [
"a5b6f36496ab148c0e7089b209b9c44bb49e395e"
] | [
"minimax.py"
] | [
"import numpy as np\nimport time\n\nhuman = 'X'\nai = 'O'\n\n\n# Possible valid moves and the depth is calculated from number of empty cells in the board\ndef GetEmptyCells(board):\n empty =[]\n for i in range(len(board[0])):\n for j in range(len(board[1])):\n if board[i][j] == None:\n ... | [
[
"numpy.random.randint"
]
] |
ccatterina/core | [
"162c39258e68ae42fe4e1560ae91ed54f5662409"
] | [
"homeassistant/components/trend/binary_sensor.py"
] | [
"\"\"\"A sensor that monitors trends in other components.\"\"\"\nfrom collections import deque\nimport logging\nimport math\n\nimport numpy as np\nimport voluptuous as vol\n\nfrom homeassistant.components.binary_sensor import (\n DEVICE_CLASSES_SCHEMA,\n ENTITY_ID_FORMAT,\n PLATFORM_SCHEMA,\n BinarySens... | [
[
"numpy.polyfit",
"numpy.array"
]
] |
DYG111/tensorflow-onnx | [
"7d61571c1a66198440eee969463e83d8bd40c267"
] | [
"tests/test_backend.py"
] | [
"# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT license.\n\nimport os\nimport tempfile\nimport unittest\nfrom collections import namedtuple\n\nimport numpy as np\nimport tensorflow as tf\nimport tf2onnx.utils\nfrom onnx import helper\nfrom tf2onnx.tfonnx import process_tf_grap... | [
[
"tensorflow.concat",
"numpy.linspace",
"tensorflow.nn.max_pool",
"tensorflow.reduce_sum",
"tensorflow.minimum",
"tensorflow.cast",
"numpy.random.random_sample",
"tensorflow.nn.conv2d_transpose",
"tensorflow.tanh",
"tensorflow.pad",
"tensorflow.nn.depthwise_conv2d",
... |
rballester/ttpy | [
"a2fdf08fae9d34cb1e5ba28482e82e04b249911b"
] | [
"setup.py"
] | [
"#!/usr/bin/env python\n\"\"\"TTPY: Python implementation of the Tensor Train (TT) - Toolbox.\n\nPython implementation of the Tensor Train (TT) - Toolbox. It contains several important packages for working with the\nTT-format in Python. It is able to do TT-interpolation, solve linear systems, eigenproblems, solve d... | [
[
"numpy.distutils.misc_util.Configuration",
"numpy.distutils.core.setup"
]
] |
RyanXingQL/MW-GAN | [
"562199344e322919a108048acd55b0dd8820df55"
] | [
"codes/models/modules/Wavelet.py"
] | [
"\r\nimport torch\r\nimport torch.nn as nn\r\n\r\n\r\n\r\ndef default_conv(in_channels, out_channels, kernel_size, bias=True, dilation=1, use_snorm=False):\r\n if use_snorm:\r\n return nn.utils.spectral_norm(nn.Conv2d(\r\n in_channels, out_channels, kernel_size,\r\n padding=(kernel_s... | [
[
"torch.nn.Conv2d",
"torch.zeros",
"torch.cat"
]
] |
lapras-inc/disk-embedding | [
"09b2faaa81f7fc8080a3817961b740232cabe8e4"
] | [
"models/disk_emb_model_orig.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\nDisk Embedding Model Original Version.\n\"\"\"\n\nfrom .dag_emb_model import DAGEmbeddingModel, DAGEmbeddingKeyedVectors\nfrom .metric_space import get_metric_space, QuasimetricSpaceBase, SphericalSpace\nfrom .loss_function import get_loss_function\nimport ... | [
[
"numpy.split",
"numpy.maximum",
"numpy.minimum",
"numpy.arctan",
"numpy.unique",
"numpy.asarray",
"numpy.clip",
"numpy.abs",
"numpy.linalg.norm",
"numpy.stack",
"numpy.ones",
"numpy.concatenate",
"numpy.sin",
"numpy.zeros_like",
"numpy.array",
"numpy... |
djeada/kaggle-titanic | [
"b119e8129bcd04abe96ca74e5d0b09e8b2e43ab6"
] | [
"src/random_forest.py"
] | [
"import joblib\nimport os\nimport pandas as pd\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.model_selection import GridSearchCV\n\n\nclass RandomForest:\n def __init__(self, save_path, features_path, values_path):\n self.create_model(features_path, values_path)\n self.save_res... | [
[
"sklearn.model_selection.GridSearchCV",
"pandas.read_csv",
"sklearn.ensemble.RandomForestClassifier"
]
] |
Gongsta/finding-waldo | [
"5fdab36f15e1018839d1fafbba632f2ecdf0bd40"
] | [
"flann.py"
] | [
"#use: pip install -U opencv-contrib-python==3.4.2.16\n\nimport numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\n\nwaldo = cv2.imread('glasses-cropped.jpg', 0)\nwaldo_background = cv2.imread('find/2.jpg', 0)\n\n#Will return an error if cv2 not installed properly\nsift = cv2.xfeatures2d.SIFT_create()\n\nkp1... | [
[
"matplotlib.pyplot.imshow",
"numpy.int32",
"matplotlib.pyplot.savefig",
"numpy.float32",
"matplotlib.pyplot.show"
]
] |
KingStorm/nussl | [
"78edfdaad16845fc705cefb336a7e6e5923fbcd4"
] | [
"tests/test_transformer_nmf.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport unittest\nimport numpy as np\nimport nussl\n\nimport nimfa\n\n\nclass TransformerNMFUnitTests(unittest.TestCase):\n\n n_attempts = 2\n max_error_pct = 0.05\n n_bases = 2\n n_iters = 100\n\n def test_small_mixture_matrix(self):\n \"\"\"\... | [
[
"numpy.dot",
"numpy.abs",
"numpy.multiply",
"numpy.arange",
"numpy.random.rand"
]
] |
xianpf/xtool | [
"beb6c89eb1a19d386569ab5c428dbc991a3e014c"
] | [
"xtool/qt2image.py"
] | [
"import torch\nfrom PyQt5 import QtWidgets, QtCore\nimport sys\nimport matplotlib.pyplot as plt\nfrom matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas\nfrom PyQt5.QtWidgets import QMainWindow, QComboBox, QLineEdit, QPushButton, QHBoxLayout, QVBoxLayout, QWidget, QLabel, QGroupBox, QSpinBo... | [
[
"matplotlib.backends.backend_qt5.NavigationToolbar2QT",
"matplotlib.patches.Rectangle",
"numpy.shape",
"matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg",
"matplotlib.pyplot.figure"
]
] |
ChrizH/data-science-learning | [
"c5770955256ef535e22346f977fb070db98a135d"
] | [
"cellular automata/blender-scripting/src/conway_4D.py"
] | [
"import bpy\r\nimport sys\r\nimport numpy as np\r\n\r\n# Because Blender is stupid?\r\nfrom __init__ import CONFIG_PATH\r\n\r\nfrom abstract_GOL import AbstractGOL\r\nimport conway_3D\r\nimport gol_utils as utils\r\n\r\n\r\nclass ConwayGOL_4D(AbstractGOL):\r\n def __init__(self, N, config='GOL_4D_standard', seed... | [
[
"numpy.random.choice"
]
] |
Mestway/falx | [
"fcae5e536f44c19780ae9f00b94e397723924757",
"fcae5e536f44c19780ae9f00b94e397723924757"
] | [
"design_exploration/utils.py",
"falx/table/language.py"
] | [
"import csv\nimport json\nimport os\n\nimport pandas as pd\n\ndef absolute_path(p):\n return os.path.join(os.path.dirname(os.path.abspath(__file__)), p)\n\ndef flatten_object(obj):\n\t\"\"\"flatten an object into paths for easier enumeration. \n\t\tArgs: an object\n\t\tReturns:\n\t\t\ta flat object with a list o... | [
[
"pandas.api.types.infer_dtype"
],
[
"pandas.MultiIndex.from_tuples",
"pandas.melt",
"pandas.DataFrame.from_dict"
]
] |
jinnn-dev/learning-by-annotations | [
"7369973c905d64e09c24e4bcfd7589fbbe9a898e"
] | [
"backend/app/core/polygon_extractor.py"
] | [
"from typing import Union\r\n\r\nimport cv2.cv2\r\nimport imutils\r\nimport numpy as np\r\nfrom imutils import contours\r\n\r\nfrom app.schemas.extractor import GrayGroup, ExtractionResult, ImageDimension\r\nfrom app.schemas.polygon_data import Point\r\nfrom app.utils.colored_printer import ColoredPrinter\r\nfrom a... | [
[
"numpy.array",
"numpy.fromstring",
"numpy.nonzero"
]
] |
lrtrct/graby | [
"fa759e47f25beadc5e601939d8c7ea678a0ec5a0"
] | [
"graby.py"
] | [
"#!/usr/bin/python\n\nimport sys\nimport requests\nimport json\nimport pandas as pd\n\ncount = 2122\ncurrency = 'BTC'\n\n###################################################################################\n\n### TO BE UPDATED WITH PERSONAL API KEY (line 25)\n### MORE INFO HERE: https://pro.coinmarketcap.com/signup ... | [
[
"pandas.concat"
]
] |
darrenreger/zEpid | [
"4b5b4ed81933c92bd17d63364df6673d6f9c2ea6"
] | [
"tests/test_doublyrobust.py"
] | [
"import pytest\nimport numpy as np\nimport pandas as pd\nimport numpy.testing as npt\nfrom sklearn.linear_model import LogisticRegression, LinearRegression\n\nimport zepid as ze\nfrom zepid.causal.doublyrobust import TMLE, AIPTW\n\n\nclass TestTMLE:\n\n @pytest.fixture\n def df(self):\n df = ze.load_sa... | [
[
"sklearn.linear_model.LinearRegression",
"sklearn.linear_model.LogisticRegression",
"pandas.DataFrame",
"numpy.testing.assert_allclose"
]
] |
omotayo-alade/ml-death-event-prediction | [
"b8b215d1fdf55183dbe7405af703b2d11dcf5b50"
] | [
"src/scripts/ingest/app.py"
] | [
"import numpy as np\nfrom flask import Flask, request, jsonify, render_template\nimport pickle\n\nmodel = pickle.load(open('outputs/models/model.pkl', 'rb'))\n\napp = Flask(__name__, template_folder='template') #Initialize the flask App\n\n@app.route('/')\ndef home():\n return render_template('index.html')\n\n@a... | [
[
"numpy.array"
]
] |
tongyao-zhu/nslt | [
"fe6ae9a6567bddd31d82c878f8f5b0186ea95243"
] | [
"nslt/utils/misc_utils.py"
] | [
"# Copyright 2017 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl... | [
[
"tensorflow.shape",
"tensorflow.gfile.Exists",
"tensorflow.gfile.GFile",
"tensorflow.ConfigProto",
"tensorflow.Summary.Value",
"tensorflow.contrib.training.HParams"
]
] |
fuhrmanj/TRANSACT_manuscript | [
"71ca2ec42bdd5d547d4b965aa7f84838bfd5b812"
] | [
"deep_learning_CV/GDSC_HMF_cross_validation_with_combat.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n## ComBat correction between GDSC and PDX followed by GDSC cross-validation\n#\n# In this script, I reproduce the pipeline from [Sakelaropoulos et al 2019] \n# for GDSC-PDXE analysis. After correction, I consider one drug and compute \n# for various hyper-parameters of the... | [
[
"matplotlib.pyplot.legend",
"pandas.read_excel",
"numpy.linspace",
"sklearn.linear_model.ElasticNet",
"pandas.MultiIndex.from_tuples",
"sklearn.model_selection.KFold",
"pandas.DataFrame",
"torch.cuda.is_available",
"numpy.var",
"pandas.read_csv",
"matplotlib.pyplot.tigh... |
rameshnair007/SR-cycleGAN | [
"a111131fadb2fca45c6655410107e040d6973351"
] | [
"data/colorization_dataset.py"
] | [
"import os.path\nfrom data.base_dataset import BaseDataset, get_transform\nfrom data.image_folder import make_dataset\nfrom skimage import color # require skimage\nfrom PIL import Image\nimport numpy as np\nimport torchvision.transforms as transforms\n\n\nclass ColorizationDataset(BaseDataset):\n \"\"\"This dat... | [
[
"numpy.array"
]
] |
skumailraza/AANet-MS | [
"f50613cfdcbe217d8d43ffe0f720615c2ebee07e"
] | [
"nets/feature.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom nets.deform import DeformConv2d\n\n\ndef conv1x1(in_channels, out_channels):\n return nn.Sequential(nn.Conv2d(in_channels, out_channels, kernel_size=1, bias=False),\n nn.BatchNorm2d(out_channels),\n ... | [
[
"torch.nn.Sequential",
"torch.nn.ConvTranspose2d",
"torch.cat",
"torch.nn.ConvTranspose3d",
"torch.nn.init.constant_",
"torch.nn.ModuleList",
"torch.nn.Conv2d",
"torch.nn.AvgPool2d",
"torch.nn.functional.relu",
"torch.nn.init.xavier_uniform_",
"torch.nn.LeakyReLU",
... |
FXDecroix/decroix_tech_test_dog | [
"53df869b2b2d570afe6c27ed87de48cb6d495cb4"
] | [
"multires_classif/train_multires.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport os\nimport matplotlib.pyplot as plt\nfrom .set_dataset import load_dataset, split_augment_data\nfrom .set_model import setup_model\nfrom keras.utils import np_utils\nimport pickle\nimport argparse\n\ndef train_model(data_path, res_path, img_resolution, epoc... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylabel"
]
] |
johncolezhang/CV-Project | [
"4a51d5adb32e43962893fd75fe6d68c286875c02"
] | [
"solver.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow as tf\nimport numpy as np\nfrom ops import *\nfrom data import *\nfrom net import *\nfrom utils import *\nimport os\nimport time\nimport data\nfrom restore import readfile\n\n\nflags ... | [
[
"tensorflow.device",
"tensorflow.summary.FileWriter",
"tensorflow.local_variables_initializer",
"tensorflow.train.RMSPropOptimizer",
"tensorflow.train.start_queue_runners",
"tensorflow.train.Coordinator",
"tensorflow.train.exponential_decay",
"tensorflow.ConfigProto",
"tensorfl... |
AaronGrainer/yolact-instance-segmentation | [
"8ea515ae0d0cdecb46aaff2732fe33f8c34a5fd1"
] | [
"yolact.py"
] | [
"import tensorflow as tf\n\nfrom layers.fpn import FeaturePyramidNeck\nfrom layers.head import PredictionModule\nfrom layers.protonet import ProtoNet\nfrom utils.create_prior import make_priors\n\nassert tf.__version__.startswith('2')\n\n\nclass Yolact(tf.keras.Model):\n \"\"\"Creating the YOLCAT Architecture\"\"\... | [
[
"tensorflow.keras.applications.ResNet50",
"tensorflow.concat",
"tensorflow.__version__.startswith",
"tensorflow.keras.initializers.glorot_uniform"
]
] |
KevinQian97/actionpose-release | [
"0bf7ae1c30d1b2a1a6a18fc662e22da519d41e0c"
] | [
"ops/transforms.py"
] | [
"import torchvision\nimport random\nfrom PIL import Image, ImageOps\nimport numpy as np\nimport numbers\nimport math\nimport torch\nimport os\n\nclass ChannelFlip(object):\n\n def __call__(self, vid):\n return vid.permute(3, 0, 1, 2)\n\nclass Resize(object):\n '''\n Resize the input tensor clipped i... | [
[
"numpy.expand_dims",
"numpy.arange",
"torch.from_numpy",
"numpy.concatenate",
"torch.nn.functional.interpolate",
"numpy.array",
"torch.as_tensor"
]
] |
peterbednar/dlgen | [
"7257dc0d75bed0785c1345807a0db77305986653"
] | [
"dlgen/distance.py"
] | [
"import heapq\nimport numpy as np\n\nfrom conllutils import FORM\nfrom conllutils import Sentence, DependencyTree, Instance\nfrom conllutils import _parse_feats\n\n\nDEL = \"del\"\nINS = \"ins\"\nSUB = \"sub\"\nTRN = \"trn\"\n\n\ndef _normalize(dist, n, m):\n return 2*dist / (n + m + dist) if dist != 0 else 0\n\... | [
[
"numpy.zeros",
"numpy.empty"
]
] |
czyzi0/mlp | [
"8acded75681b16d20d0d23b157226554b7026a3d"
] | [
"tests/test_utils.py"
] | [
"import numpy as np\nimport pytest\n\nimport mlp.utils as utils\n\n\n@pytest.mark.parametrize('x, expected_y', [\n (\n np.array([\n [0.8, 0.0, 0.1],\n [0.0, 0.1, 0.9],\n [0.1, 0.2, 0.1],\n ]),\n np.array([\n [1.0, 0.0, 0.0],\n [0.0, 0.0,... | [
[
"numpy.arange",
"numpy.array",
"numpy.allclose"
]
] |
mogproject/spacegraphcats | [
"e21015daa8e2968c3076bd250c553aa20e6d912b"
] | [
"scripts/cluster-vectors.py"
] | [
"#! /usr/bin/env python\nimport numpy\nimport pickle\nimport itertools\nimport time\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.decomposition import PCA\n\nimport hdbscan\nfrom sklearn.manifold import TSNE\n\n\ndef main():\n import argparse\n parser = argparse.ArgumentParser()\n parser.... | [
[
"numpy.load",
"sklearn.preprocessing.StandardScaler",
"sklearn.decomposition.PCA",
"sklearn.manifold.TSNE"
]
] |
joaogui1/jax | [
"3575bc7639a8f222417d33adc2112ebe766770af"
] | [
"tests/api_test.py"
] | [
"# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"numpy.asarray",
"numpy.all",
"numpy.random.randn",
"numpy.tri",
"numpy.exp",
"numpy.arange",
"numpy.eye",
"numpy.float16",
"numpy.sin",
"numpy.float32",
"numpy.zeros",
"numpy.random.rand",
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.random.Ra... |
Naveenal/PythonRobotics | [
"7e697d8e5311e652c539b0a6d883f8af6185b4ed"
] | [
"PathPlanning/RRTStar/rrt_star.py"
] | [
"\"\"\"\n\nPath planning Sample Code with RRT*\n\nauthor: Atsushi Sakai(@Atsushi_twi)\n\n\"\"\"\n\nimport math\nimport os\nimport sys\n\nimport matplotlib.pyplot as plt\n\nsys.path.append(os.path.dirname(os.path.abspath(__file__)) +\n \"/../RRT/\")\n\ntry:\n from rrt import RRT\nexcept ImportError... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.grid"
]
] |
calearning/testGithubClone | [
"bea30a8aa7e2a6dbdece1d5559c8cbc8fb39a7b5"
] | [
"generate_documentation_images.py"
] | [
"from __future__ import print_function, division\nimport imgaug as ia\nfrom imgaug import augmenters as iaa\nfrom imgaug import parameters as iap\nimport numpy as np\nfrom scipy import ndimage, misc\n#from skimage import data\n#import matplotlib.pyplot as plt\n#from matplotlib import gridspec\n#import six\n#import ... | [
[
"scipy.misc.imresize",
"scipy.ndimage.imread",
"numpy.pad",
"numpy.linspace",
"numpy.abs",
"numpy.tile",
"numpy.prod",
"numpy.array",
"numpy.zeros"
]
] |
sandyz1000/Text-Generation-LSTM | [
"c7043eb7020bef43f535134c1cd01799c7ec86ac"
] | [
"doc2vec.py"
] | [
"from __future__ import print_function\n\nimport codecs\nimport time\nimport os\nimport gensim\nimport numpy as np\nfrom nltk.tokenize import RegexpTokenizer, PunktSentenceTokenizer\nfrom six.moves import cPickle\nfrom pathlib import Path\n\nDATA_DIR = Path(\"corpus\")\nSAVE_DIR = Path('save') # directory to store... | [
[
"numpy.array"
]
] |
Dr-Awkward/UdacityImageClassifier | [
"7daf65f62c0bd8e23467472e4bea18fbd1323636"
] | [
"train.py"
] | [
"# Imports here\nimport torch\nfrom torch import nn as nn\nfrom torch import optim as optim\nimport nnModel\nimport helpers.DataLoader\nimport argparse\n\n#######################################################\n# Train a Neural Network using transfer learning:\n# 1. Get the directory to the image files to train wi... | [
[
"torch.nn.NLLLoss"
]
] |
google/crystalvalue | [
"719226fb302d414e94fcdb3ac4b468977f3529ec"
] | [
"src/synthetic_data.py"
] | [
"# Copyright 2021 Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"numpy.random.rand",
"numpy.random.poisson",
"numpy.random.exponential",
"pandas.date_range"
]
] |
b0nce/strange_boostings | [
"c9f03c0a7e2dfb0292b178db5fdfc99f9c7e58eb"
] | [
"strangeboostings/gradient_based.py"
] | [
"import lightgbm as lgb\r\nimport numpy as np\r\nfrom scipy.special import expit as sigmoid\r\nfrom sklearn.base import clone, BaseEstimator, ClassifierMixin\r\nfrom sklearn.linear_model import SGDClassifier\r\nfrom sklearn.utils.validation import check_X_y, check_array, check_is_fitted\r\nfrom sklearn.utils.multic... | [
[
"sklearn.utils.validation.check_is_fitted",
"sklearn.utils.validation.check_array",
"scipy.special.expit",
"sklearn.base.clone",
"sklearn.utils.validation.check_X_y",
"sklearn.utils.multiclass.unique_labels",
"sklearn.linear_model.SGDClassifier"
]
] |
ricklentz/avalanche | [
"ee3baf287d6bd11cb4640d8ad8fd778269920124"
] | [
"avalanche/evaluation/metrics/loss.py"
] | [
"################################################################################\n# Copyright (c) 2021 ContinualAI. #\n# Copyrights licensed under the MIT License. #\n# See the accompanying LICENSE file for terms. ... | [
[
"torch.mean",
"torch.no_grad"
]
] |
dillondaudert/cullpdb_dssp | [
"3dd9623390f5a5ae9c0b2a9aa09e829b268419ef"
] | [
"proteindatasets/cpdb2/make_tfrecords.py"
] | [
"# convert a pandas DataFrame of amino acid sequence, secondary structure\n# sequence pairs into TF records\nfrom pathlib import Path\nimport pandas as pd\nimport numpy as np\nimport tensorflow as tf\nfrom sklearn.model_selection import KFold\nfrom features import prot_to_vector\n\nHOME = str(Path.home())\n\ndef _b... | [
[
"pandas.read_csv",
"numpy.arange",
"sklearn.model_selection.KFold",
"tensorflow.python_io.TFRecordWriter",
"tensorflow.train.BytesList",
"tensorflow.train.FloatList",
"tensorflow.train.Int64List"
]
] |
sonofhypnos/rl-2048-game | [
"7d964fb2c1792fa9715a6487c0980dbd8474b13f"
] | [
"agent.py"
] | [
"\nimport torch\nimport numpy as np\nimport os\n\nclass DQNAgent:\n \n def __init__(self, env, model, target_model, optimizer, loss_function, experience_replay, learning_rate=3e-4, gamma=0.99):\n \n self.env = env\n self.learning_rate = learning_rate\n self.gamma = gamma\n s... | [
[
"torch.LongTensor",
"torch.max",
"torch.load",
"torch.argmax",
"numpy.random.randn",
"torch.FloatTensor",
"torch.cuda.is_available",
"numpy.random.randint",
"torch.no_grad",
"torch.save"
]
] |
rubind/qhy_imaging | [
"c742467b9f74801c590420b4acd3137a26f97666"
] | [
"compute_linearity.py"
] | [
"import glob\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom astropy.io import fits\nimport tqdm\n\nxs = []\nys = []\n\nfor fl in tqdm.tqdm(glob.glob(\"img*fits\")):\n f = fits.open(fl)\n dat = f[0].data\n exptime = f[0].header[\"EXPTIME\"]\n #exptime = np.around(exptime*1000)/1000.\n\n in... | [
[
"numpy.median",
"matplotlib.pyplot.savefig",
"numpy.mean",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.close",
"numpy.argsort",
"matplotlib.pyplot.xscale",
"numpy.array",
"matplotlib.pyplot.ylabel"
]
] |
fquirin/larynx | [
"bc586b60f11dc2c228e07a47736e7a54597f0ad1"
] | [
"larynx/hifi_gan.py"
] | [
"import logging\nimport typing\n\nimport numpy as np\nimport onnxruntime\n\nfrom .audio import audio_float_to_int16, inverse, transform\nfrom .constants import SettingsType, VocoderModel, VocoderModelConfig\n\n_LOGGER = logging.getLogger(\"hifi_gan\")\n\n# -----------------------------------------------------------... | [
[
"numpy.zeros",
"numpy.clip"
]
] |
rouault/s100py | [
"1a12839b35fe85748283d2a7202257c029e09efc"
] | [
"tests/s104/s104_test.py"
] | [
"from collections import namedtuple\nimport pytest\n\nimport os\n\nimport datetime\nimport numpy\nimport h5py\n\nfrom s100py import s104\n\npath_to_current_file = os.path.realpath(__file__)\ncurrent_directory = os.path.dirname(path_to_current_file)\npath_to_s104file = os.path.join(current_directory, \"test_s104.h5\... | [
[
"numpy.array",
"numpy.allclose"
]
] |
obeychoi0120/Yolov5-GradCAM | [
"3f46c1f1daf64e0da782214667172cde4ab9dd35"
] | [
"yolov5/models/tf.py"
] | [
"# YOLOv5 🚀 by Ultralytics, GPL-3.0 license\n\"\"\"\nTensorFlow, Keras and TFLite versions of YOLOv5\nAuthored by https://github.com/zldrobit in PR https://github.com/ultralytics/yolov5/pull/1127\n\nUsage:\n $ python models/tf.py --weights yolov5s.pt\n\nExport:\n $ python path/to/export.py --weights yolov5s.... | [
[
"tensorflow.concat",
"tensorflow.zeros",
"torch.zeros",
"tensorflow.image.non_max_suppression",
"tensorflow.stack",
"tensorflow.keras.activations.swish",
"tensorflow.keras.Sequential",
"tensorflow.pad",
"torch.device",
"tensorflow.image.combined_non_max_suppression",
"t... |
samrullo/deep-learning-from-scratch-3 | [
"47f17a9d25c8d40ac635fde7a0e3aa3937ce5ac0",
"47f17a9d25c8d40ac635fde7a0e3aa3937ce5ac0"
] | [
"practice/steps/step_18_enable_backprop_context.py",
"practice/steps/step_02_00.py"
] | [
"\"\"\"\nhere we introduce technics to save memory\nFor instance in neural networks often we are only interested\nin the gradients of parameters and input variables only\nthe gradients of intermediary variables can be thrown away\nto make room in the memory\n\"\"\"\nimport weakref\nimport numpy as np\nimport contex... | [
[
"numpy.array",
"numpy.ones_like",
"numpy.isscalar",
"numpy.ones"
],
[
"numpy.array"
]
] |
finkbeiner-lab/GEDI-ORDER | [
"d1e9266ba3fccc1df26a348f89fd160599e7a9f5"
] | [
"deprecated/transfer/store_viz_stacks.py"
] | [
"import os\nimport platform\n\nfrom imageio import imread, imwrite\nimport numpy as np\nimport pandas as pd\n\nfrom deprecated.transfer.grads import Grads\nfrom deprecated.transfer.grad_ops import GradOps\nimport glob\nimport param_gedi as param\nfrom pympler import asizeof\n\n\nos_type = platform.system()\nif os_t... | [
[
"pandas.concat",
"numpy.argmax",
"pandas.DataFrame"
]
] |
cosmo-epfl/sklearn-cosmo | [
"1bf9bcfbc38e7881e06496cf780085b3575aaec4"
] | [
"skcosmo/_selection.py"
] | [
"\"\"\"\nSequential selection\n\"\"\"\n\nimport numbers\nimport warnings\nfrom abc import abstractmethod\n\nimport numpy as np\nimport scipy\nfrom scipy.linalg import eigh\nfrom scipy.sparse.linalg import eigsh\nfrom sklearn.base import (\n BaseEstimator,\n MetaEstimatorMixin,\n)\nfrom sklearn.feature_selecti... | [
[
"numpy.diag",
"sklearn.utils.check_random_state",
"sklearn.utils.validation.check_is_fitted",
"numpy.pad",
"numpy.minimum",
"numpy.take",
"sklearn.utils.check_array",
"numpy.arange",
"sklearn.utils._tags._safe_tags",
"sklearn.utils.safe_mask",
"numpy.full",
"scipy.s... |
qnl/pyEPR | [
"3b3d2a1d534bc8f965b9b1f4fafc3a46fe75a5fa"
] | [
"pyEPR/ansys.py"
] | [
"'''\npyEPR.ansys\n 2014-present\n\nPurpose:\n Handles Ansys interaction and control from version 2014 onward.\n Tested most extensively with V2016 and V2019R3.\n\n@authors:\n Originally contributed by Phil Reinhold.\n Developed further by Zlatko Minev, Zaki Leghtas, and the pyEPR team.\n For the ... | [
[
"pandas.read_csv",
"numpy.genfromtxt",
"numpy.size",
"numpy.shape",
"numpy.array",
"numpy.loadtxt"
]
] |
marvinquiet/bart2 | [
"f158bb4fcfc21aabe6f0b2a665911e2b6a4e5a7d"
] | [
"bart2/RPRegress.py"
] | [
"import argparse,math,os,sys,tables\nimport numpy as np\nfrom operator import itemgetter\nfrom sklearn import linear_model, model_selection, metrics\nimport random\n\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\n\n\nUNCHANGED,DOWN,UP,TARGET = 0,1,2,3\nstatdict = { UNCHANGED:'.', DOWN:'... | [
[
"numpy.sqrt",
"numpy.mean",
"numpy.finfo",
"numpy.std",
"matplotlib.pyplot.errorbar",
"matplotlib.pyplot.close",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.logspace",
"matplotlib.pyplot.ylim",
"numpy.median",
"sklearn.metrics.roc_curve",
"matplotlib.pyplo... |
iclr2022submission4/cgca | [
"3e6ea65c0ebf72a8291dde3ffdb06b50e4d2900a"
] | [
"utils/marching_cube.py"
] | [
"import mcubes\nimport torch\nimport trimesh\n\ndef marching_cube(\n query_points: torch.Tensor,\n df: torch.Tensor,\n march_th,\n upsample=1,\n voxel_size=None\n):\n \"\"\"\n Args:\n query_points: (N, 3) torch tensor\n df: (N) torch tensor\n march_th: t... | [
[
"torch.round",
"torch.zeros",
"torch.tensor"
]
] |
jeffra/triton | [
"3195aca4522377ca6eabf4f9ca9054fa245bbba0"
] | [
"python/examples/einsum.py"
] | [
"import triton\nimport torch\nfrom torch.utils.cpp_extension import load\nimport numpy as np\n#import utils\nfrom time import time\n\ntorch.manual_seed(0)\n\n#torch.backends.cudnn.benchmark = True\n\nconfigs = []\n\n# Matrix multiplication\nMNK = [\n (512, 512 ,512), \n (2048, 2048, 2048),\n #(... | [
[
"torch.utils.cpp_extension.load",
"torch.empty",
"torch.manual_seed",
"torch.nn.functional.conv2d",
"torch.einsum",
"torch.from_numpy",
"torch.matmul",
"torch.set_num_threads",
"torch.rand",
"numpy.column_stack",
"numpy.random.randint"
]
] |
colonel8377/hkust_machine_learning | [
"80d880a8bd6a0139d5d5409000f836900855b0ba"
] | [
"top1/src/models/model.py"
] | [
"import torch\nimport logging\nimport os\n\nimport torch\nimport torch.nn as nn\nfrom torch.nn import CrossEntropyLoss\nfrom transformers import (RobertaConfig, RobertaModel)\n\nlogger = logging.getLogger(__name__)\nlogging.basicConfig(format='%(asctime)s - %(levelname)s - %(name)s - %(message)s',\n ... | [
[
"torch.nn.BatchNorm1d",
"torch.nn.CrossEntropyLoss",
"torch.nn.Dropout",
"torch.softmax",
"torch.cat",
"torch.nn.Linear"
]
] |
podaac/l2ss-py | [
"d5005665e1fac53aebc1d0f620e72e46386beb8a"
] | [
"podaac/subsetter/xarray_enhancements.py"
] | [
"# Copyright 2019, by the California Institute of Technology.\n# ALL RIGHTS RESERVED. United States Government Sponsorship acknowledged.\n# Any commercial use must be negotiated with the Office of Technology\n# Transfer at the California Institute of Technology.\n#\n# This software may be subject to U.S. export con... | [
[
"numpy.all",
"numpy.isnan",
"numpy.where",
"numpy.any"
]
] |
NullConvergence/torch_temp | [
"29a0d7190f0be6124f51bd85b8320cd8b3cef29a"
] | [
"mtorch/core/model/metrics/epoch_accuracy.py"
] | [
"import torch\nfrom .base import BaseMetric\n\n\nclass EpochAccuracy(BaseMetric):\n def __init__(self, *args, **kwargs):\n super().__init__(*args, **kwargs)\n\n def forward(self, output, targets, *args, **kwargs):\n assert output.size(0) == targets.size(0)\n with torch.no_grad():\n ... | [
[
"torch.no_grad"
]
] |
nifs-software/nifs-retrieve | [
"4ff9d70a1d2301d7b5762162586388ae67046ad2"
] | [
"demos/rawdata/bolometer.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom nifs.retrieve.rawdata import RawData\n\n\n# Bolomgeter の ショット番号=48000, サブショット番号=1, チャンネル番号=1 のデータを取得\ndata = RawData.retrieve(\"Bolometer\", 48000, 1, 1)\n\nrange = data.params[\"Range\"] # レンジ取得\nrangefactor = data.params[\"RangeFactor\"] # 倍率\nresolutio... | [
[
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
tolkien/misc | [
"84651346a3a0053b6a2af31db26c227a34da33c8"
] | [
"tf/example/tf-math-fn.py"
] | [
"# -*- coding: utf-8 -*-\nimport tensorflow as tf\nimport functions\n\nc2, c3 = tf.constant([1.2, 5.6]), tf.constant([-4, -1, 7])\nv2, v3 = tf.Variable([2.3, 4.5]), tf.Variable([-2, 3, 5])\n\nprint('-----------add_n------------') # same shape aod dtype 덧셈\nfunctions.showOperation(tf.add_n([c2, v2])) ... | [
[
"tensorflow.sign",
"tensorflow.minimum",
"tensorflow.add_n",
"tensorflow.Variable",
"tensorflow.floor",
"tensorflow.square",
"tensorflow.ceil",
"tensorflow.matmul",
"tensorflow.pow",
"tensorflow.exp",
"tensorflow.neg",
"tensorflow.round",
"tensorflow.tan",
"... |
cmlab-mira/MedicalPro | [
"3918c95197fd24406ce2117cc7ff9ce21bb8c620"
] | [
"src/preprocess/mr_ct_both_data_split.py"
] | [
"import argparse\nimport logging\nimport pandas as pd\nfrom pathlib import Path\n\n\ndef main(args):\n mr_df = pd.read_csv(args.mr_csv.as_posix())\n ct_df = pd.read_csv(args.ct_csv.as_posix())\n\n output_dir = args.output_dir\n if not output_dir.is_dir():\n output_dir.mkdir(parents=True)\n spl... | [
[
"pandas.concat"
]
] |
stevenpclark/aoc2021 | [
"726009e5a2a87025943a736e8676784ca7cdc8bd"
] | [
"03/03.py"
] | [
"import numpy as np\n\ndef filter_data(data, use_most_common):\n _, nc = data.shape\n for c in range(nc):\n nr, _ = data.shape\n if nr <= 1:\n break\n \n col_score = sum(data[:,c])/nr\n if use_most_common:\n keep_val = col_score >= 0.5\n else:\n ... | [
[
"numpy.sum",
"numpy.loadtxt"
]
] |
tokusumi/ml-management-tools | [
"7b075306d9df26b4f454f3af9e9c377b60683bba"
] | [
"mlflow/models/cnn.py"
] | [
"from tensorflow import keras\n\n\ndef build_model(hp):\n model = keras.Sequential()\n model.add(\n keras.layers.Conv2D(\n hp.Choice(\"filter\", values=[16, 32, 64]),\n 3,\n activation=hp.Choice(\n \"activation\",\n values=[\"tanh\", \"soft... | [
[
"tensorflow.keras.layers.Dense",
"tensorflow.keras.Sequential",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.layers.MaxPooling2D",
"tensorflow.keras.layers.Flatten"
]
] |
pecheurs/FER2013_project | [
"f07b8f3b8084e4702e13cdcd0e876bb77d153665"
] | [
"Facial_Expression_Recognition/VGGandResNet.py"
] | [
"'''Train Fer2013 with PyTorch.'''\r\n# 10 crop for data enhancement\r\nfrom __future__ import print_function\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.optim as optim\r\nimport torch.nn.functional as F\r\nimport torch.backends.cudnn as cudnn\r\nimport torchvision\r\nimport transforms as transform... | [
[
"torch.nn.CrossEntropyLoss",
"torch.max",
"torch.utils.data.DataLoader",
"torch.cuda.empty_cache",
"torch.no_grad",
"numpy.shape",
"torch.cuda.is_available",
"torch.autograd.Variable"
]
] |
mcx/brax | [
"c7735f34a48c3499516c3359d016057ed653f810"
] | [
"brax/jumpy.py"
] | [
"# Copyright 2022 The Brax 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 applicable law or a... | [
[
"numpy.add.at",
"numpy.amax",
"numpy.vstack",
"numpy.linalg.norm",
"numpy.stack",
"numpy.copy",
"numpy.argpartition",
"numpy.meshgrid",
"numpy.zeros",
"numpy.random.default_rng"
]
] |
Ophois47/Tensor-IMDB | [
"24c605756f2498861991b03ec96f7d6f2893d448"
] | [
"TensorReview.py"
] | [
"import tensorflow as tf\nfrom tensorflow import keras\nimport numpy as np\n\ndata = keras.datasets.imdb\n\n(train_data, train_labels), (test_data, test_labels) = data.load_data(num_words=88000)\n\nword_index = data.get_word_index()\n\nword_index = {k:(v+3) for k, v in word_index.items()}\nword_index[\"<PAD>\"] = 0... | [
[
"tensorflow.keras.models.load_model",
"tensorflow.keras.preprocessing.sequence.pad_sequences"
]
] |
VecchioID/perceptual_decisions | [
"33f6712aa65d53f6b9c3a45c62fe1a31fe208d94"
] | [
"main.py"
] | [
"# -*- coding=utf-8 -*-\n# written by kai zhao\n# This is souce code for Cui, L., Tang, S., Zhao, K., Pan, J., Zhang, Z., Si, B., & Xu, N. L. (2021). \n# Asymmetrical choice-related ensemble activity in direct and indirect-pathway striatal neurons drives perceptual decisions. bioRxiv.\nimport numpy as np\nimport ma... | [
[
"numpy.sqrt",
"numpy.linspace",
"numpy.abs",
"numpy.power",
"numpy.ones",
"numpy.append",
"numpy.random.randn",
"numpy.exp",
"numpy.array",
"numpy.zeros",
"numpy.where",
"matplotlib.pyplot.show"
]
] |
SAP-samples/security-research-dp-hierarchical-text | [
"100a010502013cedcf73c88ec128e8b4d1ab5700"
] | [
"dph/core/parameters/parameters.py"
] | [
"import tensorflow as tf\n\n\nclass Parameters(object):\n def __init__(self):\n self.experiment_name = \"\"\n self.dataset = None\n self.batch_size_train = 32\n self.batch_size_val = 32\n self.num_epochs = 30\n self.features = None\n self.seed = 42\n self.l... | [
[
"tensorflow.config.list_physical_devices"
]
] |
pulkit4tech/Tracking-Visually-Salient-Object | [
"c9d67a2f8eb2929e11155a036bf791d922a992da"
] | [
"tracking.py"
] | [
"import cv2\nimport numpy as np\nimport copy\n\n\nclass MultipleObjectsTracker:\n \"\"\"Multiple-objects tracker\n This class implements an algorithm for tracking multiple objects in\n a video sequence.\n The algorithm combines a saliency map for object detection and\n mean-shift trac... | [
[
"numpy.array"
]
] |
andresDatyra/superset | [
"dd3aaaa42e293f9d21cb6ca614bd84b561e0e9dc"
] | [
"tests/utils_tests.py"
] | [
"# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y... | [
[
"numpy.int64",
"numpy.array",
"numpy.bool_"
]
] |
JustinYuu/pytorch-CIFAR10-playground | [
"854ffcb7857fb1c114f6ac28a0a8fd7f935d7c40"
] | [
"net/resnext.py"
] | [
"import torch.nn as nn\r\nimport torch\r\nimport torch.nn.functional as F\r\n\r\n\r\nclass BottleNeck(nn.Module):\r\n expansion = 2\r\n\r\n def __init__(self, in_channel, cardinality, bottleneck_width, stride=1):\r\n super(BottleNeck, self).__init__()\r\n group_width = bottleneck_width * cardina... | [
[
"torch.nn.Sequential",
"torch.nn.functional.avg_pool2d",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.functional.relu",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
janash/molecool | [
"ab573caecfc47a481349f7694654c3d0491e25b9"
] | [
"molecool/tests/test_measure.py"
] | [
"\"\"\"\nTests for the measure module.\n\"\"\"\n\n# imports\nimport pytest\n\nimport molecool\nimport numpy as np\n\ndef test_calculate_distance():\n\n r1 = np.array([0, 0, 0])\n r2 = np.array([0, 1, 0])\n\n expected_distance = 1\n\n calculated_distance = molecool.calculate_distance(r1, r2)\n\n asser... | [
[
"numpy.array",
"numpy.sqrt"
]
] |
kirichoi/pySME | [
"4879a80cefe131568f8c4d91b52f97fe0c79d315"
] | [
"pysme.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCopyright (c) 2019 Kiri Choi\r\n\r\npySME is a Python script to run R SME package \r\n(https://cran.r-project.org/web/packages/sme/index.html). SME package generates\r\nsmoothing-splines mixed-effects models from metabolomics data. This script \r\nfollows methodology given by B... | [
[
"numpy.linspace",
"pandas.DataFrame",
"numpy.mean",
"numpy.where",
"numpy.divide",
"numpy.square",
"pandas.read_csv",
"numpy.unique",
"numpy.arange",
"scipy.interpolate.CubicSpline",
"matplotlib.pyplot.figure",
"pandas.concat",
"numpy.random.choice",
"numpy.... |
ashwinwadte/sagemaker-deployment | [
"c453bce0a4dfcf45a8eb546048f7080d533cabeb"
] | [
"Project/serve/predict.py"
] | [
"import argparse\nimport json\nimport os\nimport pickle\nimport sys\nimport sagemaker_containers\nimport pandas as pd\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.utils.data\n\nfrom model import LSTMClassifier\n\nfrom utils import review_to_words, convert_and_p... | [
[
"numpy.hstack",
"torch.load",
"torch.from_numpy",
"torch.no_grad",
"torch.cuda.is_available"
]
] |
bt2901/TopicNet | [
"cab4c5a5fa259a5709e736c819598caf84841206"
] | [
"topicnet/cooking_machine/models/blei_lafferty_score.py"
] | [
"import numpy as np\n\nfrom typing import Callable\n\nfrom .base_score import BaseScore\n\n\nclass BleiLaffertyScore(BaseScore):\n \"\"\"\n This score implements method described in 2009 paper\n Blei, David M., and John D. Lafferty. \"Topic models.\" Text Mining.\n Chapman and Hall/CRC, 2009. 101-124.\n ... | [
[
"numpy.log",
"numpy.sum"
]
] |
Stefanlarsson95/CV2 | [
"9be422cdfe75f2c9571367c27808b3ae2b8a824b"
] | [
"old_camera_calibration.py"
] | [
"import numpy as np\nimport cv2\nimport glob\nfrom matplotlib import pyplot as plt\nfrom stereovision.blockmatchers import *\nfrom stereovision.calibration import *\nfrom stereovision.ui_utils import *\n\nblock_matcher = StereoSGBM() # alt StereoBM() Todo fix\ncalibration = StereoCalibration(input_folder='old_ster... | [
[
"numpy.hstack",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.show",
"numpy.zeros",
"numpy.vstack"
]
] |
FSLobao/Spectrum-Cortex | [
"e3eca47a776c6da5769e97e72d9a94be42c6bcfa"
] | [
"compute_channel_distance.py"
] | [
"#!/usr/bin/python3\n\n# # Compute the distance between traces for clustering\n\n# Import standard libraries\nimport pandas as pd\nimport numpy as np\nfrom scipy import signal\nfrom scipy.cluster.hierarchy import dendrogram, linkage\n\nimport matplotlib.pyplot as plt\nimport h5py\n\n# Import specific libraries used... | [
[
"pandas.Series",
"scipy.signal.correlate",
"pandas.DataFrame",
"matplotlib.pyplot.plot",
"numpy.max",
"numpy.mean",
"matplotlib.pyplot.tight_layout",
"numpy.argmax",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.close",
"scipy.cluster.hierarchy.linkage",
"matplotl... |
teamILLO/SDPS-Net | [
"83736700c917325ed419a10d8b6219ce475f4f75"
] | [
"datasets/UPS_Custom_Dataset.py"
] | [
"from __future__ import division\nimport os\nimport numpy as np\nimport scipy.io as sio\nfrom imageio import imread\n\nimport torch\nimport torch.utils.data as data\n\nfrom datasets import pms_transforms\nfrom . import util\nnp.random.seed(0)\n\nclass UPS_Custom_Dataset(data.Dataset):\n def __init__(self, args, ... | [
[
"numpy.concatenate",
"numpy.zeros",
"torch.from_numpy",
"numpy.random.seed"
]
] |
aangelopoulos/conformal_classification | [
"db3a42f47d4f3a4cab33bbf577a1257c08366dfd"
] | [
"experiments/table3.py"
] | [
"import os, sys, inspect\nsys.path.insert(1, os.path.join(sys.path[0], '..'))\nfrom conformal import * \nfrom utils import *\nimport numpy as np\nfrom scipy.special import softmax\nfrom scipy.stats import median_absolute_deviation as mad\nimport torch\nimport torchvision\nimport torchvision.transforms as tf\nimport... | [
[
"torch.cuda.manual_seed",
"numpy.random.seed",
"torch.manual_seed",
"numpy.median",
"torch.utils.data.DataLoader",
"pandas.DataFrame",
"scipy.stats.median_absolute_deviation",
"numpy.round",
"numpy.zeros"
]
] |
cesaraugustomt/sniper-using-yolov5 | [
"7883acbd26dd017679478060c19566dadb3440a2"
] | [
"test.py"
] | [
"import argparse\nimport json\nimport os\nfrom pathlib import Path\nfrom threading import Thread\n\nimport numpy as np\nimport torch\nimport yaml\nfrom tqdm import tqdm\n\nfrom models.experimental import attempt_load\nfrom utils.datasets import create_dataloader\nfrom utils.general import coco80_to_coco91_class, ch... | [
[
"torch.linspace",
"torch.Tensor",
"torch.zeros",
"torch.cat",
"torch.tensor",
"numpy.concatenate",
"torch.unique",
"torch.no_grad",
"numpy.savetxt",
"numpy.zeros"
]
] |
benmaier/networks2021-hons-softwaredemo | [
"f50112bb785123e4beed7077ef75283d72579a20"
] | [
"16_netwulf_epipack_sim.py"
] | [
"# 16\n# start a stochastic simulation on a netwulf-stylized network\n\nimport tacoma as tc\nfrom demo_utils import disp\nimport networkx as nx\nimport netwulf as nw\n\ndtu = tc.load_json_taco('~/.tacoma/dtu_1_weeks.taco')\n\n\ndtu_agg = tc.aggregated_network(dtu)\n\n\nlinks = []\n\nfor key, val in dtu_agg.items():... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.show",
"numpy.mean"
]
] |
ubiquity6/OldMVSNet | [
"27465945c52b8221860b623158a56a641dee5522"
] | [
"mvsnet/preprocess.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nCopyright 2019, Yao Yao, HKUST.\nTraining preprocesses.\n\"\"\"\n\nfrom __future__ import print_function\n\nimport os\nimport time\nimport glob\nimport random\nimport math\nimport re\nimport sys\nimport imageio\n\nimport cv2\nimport numpy as np\nimport tensorflow as tf\nimport scipy.... | [
[
"numpy.expand_dims",
"numpy.sqrt",
"numpy.clip",
"numpy.reshape",
"tensorflow.python.lib.io.file_io.FileIO",
"numpy.flipud",
"numpy.copy",
"numpy.fromstring",
"numpy.mean",
"numpy.var",
"numpy.zeros"
]
] |
vanvalenlab/kiosk-redis-consumer | [
"0f0a76664b8b500abfcd5b8c0bdb4348eea0e799"
] | [
"redis_consumer/consumers/base_consumer_test.py"
] | [
"# Copyright 2016-2021 The Van Valen Lab at the California Institute of\n# Technology (Caltech), with support from the Paul Allen Family Foundation,\n# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.\n# All rights reserved.\n#\n# Licensed under a modified Apache License, Version 2.0 (the \... | [
[
"numpy.testing.assert_array_equal",
"numpy.rollaxis",
"numpy.testing.assert_raises",
"numpy.ones"
]
] |
hyydrra/OmniAnomaly | [
"9aa05298f97ea6c01c4fce40c34b7d77e5f3dbd2"
] | [
"main.py"
] | [
"# -*- coding: utf-8 -*-\nimport logging\nimport os\nimport pickle\nimport sys\nimport time\nimport warnings\nfrom argparse import ArgumentParser\nfrom pprint import pformat, pprint\n\nimport numpy as np\nimport tensorflow as tf\nfrom tfsnippet.examples.utils import MLResults, print_with_title\nfrom tfsnippet.scaff... | [
[
"tensorflow.variable_scope",
"numpy.sum",
"tensorflow.Session"
]
] |
hieunq95/keras-rl | [
"d965ea951220b5ede5ea1e11fab7d7eb45a8c2c5"
] | [
"rl/core.py"
] | [
"# -*- coding: utf-8 -*-\nimport warnings\nfrom copy import deepcopy\n\nimport numpy as np\nfrom keras.callbacks import History\n\nfrom rl.callbacks import (\n CallbackList,\n TestLogger,\n TrainEpisodeLogger,\n TrainIntervalLogger,\n Visualizer\n)\n\n\nclass Agent(object):\n \"\"\"Abstract base c... | [
[
"numpy.int16",
"numpy.zeros_like",
"numpy.float32",
"numpy.isreal",
"numpy.random.randint"
]
] |
zeta1999/Gradient-Free-Optimizers | [
"f6b58e248a6fdfaa7c7d774ae4c0d9b4b67b5e47"
] | [
"gradient_free_optimizers/optimizers/sequence_model/exp_imp_based_opt.py"
] | [
"# Author: Simon Blanke\n# Email: simon.blanke@yahoo.com\n# License: MIT License\n\n\nimport numpy as np\nfrom scipy.stats import norm\n\nfrom .smbo import SMBO\n\n\ndef normalize(array):\n num = array - array.min()\n den = array.max() - array.min()\n\n if den == 0:\n return np.random.random_sample(... | [
[
"scipy.stats.norm.cdf",
"scipy.stats.norm.pdf",
"numpy.isnan",
"numpy.random.random_sample",
"numpy.max",
"numpy.zeros_like",
"numpy.array",
"numpy.isinf"
]
] |
DavidBakerEffendi/palestine-israel-twitter | [
"5620009e06375d66f395d04a7b94bf11ab0f97b6"
] | [
"components/__init__.py"
] | [
"import numpy as np\nimport plotly as py\nimport plotly.graph_objs as go\nimport random\nimport dash_core_components as dcc\nimport dash_html_components as html\nimport dash_bootstrap_components as dbc\nimport datetime as dt\n\nfrom typing import Dict\n\n\ndef plotly_wordcloud(words: Dict[str, int]):\n lower, up... | [
[
"numpy.abs",
"numpy.sum",
"numpy.nan_to_num"
]
] |
rastaman/what2017 | [
"6d134fe87ecdd90a333225822175f003da67fd80"
] | [
"matching/nearest_neighbor.py"
] | [
"'''\nA nearest neighbor learning algorithm to identify closest matching profiles\nusing the TensorFlow library.\n\nAuthor: Detonateur Team\nProject: https://github.com/rastaman/what2017/\n'''\n\nfrom __future__ import print_function\n\nfrom beacoachmate import input_data\nimport numpy as np\nimport tensorflow as t... | [
[
"tensorflow.negative",
"tensorflow.arg_min",
"tensorflow.placeholder",
"tensorflow.global_variables_initializer",
"numpy.argmax",
"tensorflow.Session"
]
] |
PBonnema/Applied-AI-Assignments | [
"f5804a4cea899b7a77981a7d1329750726a6444a"
] | [
"Programming NNs/neuralNetwork.py"
] | [
"from neuron import Neuron\nfrom inputNeuron import InputNeuron\nfrom biasNeuron import BiasNeuron\n\nimport numpy as np\n\nclass NeuronInfo():\n \"\"\"Represents the information needed to instantiate a single neuron.\n So this class doesn't model the neuron itself. It is just a helper class to specify the to... | [
[
"numpy.empty"
]
] |
SherwinRF/greyatom-python-for-data-science | [
"25c1917de00e0f3c2a9b0012b169d194bd339423"
] | [
"Make-Sense-of-Census/code.py"
] | [
"# --------------\r\n# Importing header files\r\nimport numpy as np\r\nimport warnings\r\nwarnings.filterwarnings('ignore')\r\n\r\n#New record\r\nnew_record=[[50, 9, 4, 1, 0, 0, 40, 0]]\r\nnew_record = np.asarray(new_record)\r\n\r\n#Reading file\r\ndata = np.genfromtxt(path, delimiter=\",\", skip_header=1)\r\... | [
[
"numpy.asarray",
"numpy.genfromtxt",
"numpy.concatenate",
"numpy.std",
"numpy.mean",
"numpy.sum"
]
] |
specmicp/relaxNMR | [
"ae37111806a91c6a0b7f4e46ac6f8877819df350"
] | [
"relaxNMR/core/ilt.py"
] | [
"# Copyright (c) 2020 Fabien Georget <fabien.georget@epfl.ch>, EPFL\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright ... | [
[
"numpy.sqrt",
"numpy.eye",
"scipy.optimize.nnls",
"numpy.ones",
"numpy.log10",
"numpy.exp",
"numpy.zeros"
]
] |
chenchr/PoseNet | [
"d8c0d1071db21652a7cb4b2715747ef346c8f706"
] | [
"models/PoseNetC.py"
] | [
"import torch\nimport torch.nn as nn\nimport math\nfrom corr.functions.corr import CorrFunction\n\n__all__ = [\n 'PoseNetC', 'posenetc', 'posenetc_bn'\n]\n\ndef conv(batchNorm, in_planes, out_planes, kernel_size=3, stride=1):\n if batchNorm:\n return nn.Sequential(\n nn.Conv2d(in_planes, out... | [
[
"torch.nn.init.kaiming_normal",
"torch.ones",
"torch.load",
"torch.cat",
"torch.nn.Conv2d",
"torch.nn.LeakyReLU",
"torch.nn.BatchNorm2d"
]
] |
samgregoost/oil_spill_ocean_detection | [
"6b6f364b48081482f484a990afad7d70bf97b773"
] | [
"read_MITSceneParsingData.py"
] | [
"__author__ = 'charlie'\nimport numpy as np\nimport os\nimport random\nfrom six.moves import cPickle as pickle\nfrom tensorflow.python.platform import gfile\nimport glob\n\nimport TensorflowUtils as utils\n\n# DATA_URL = 'http://sceneparsing.csail.mit.edu/data/ADEChallengeData2016.zip'\nDATA_URL = 'http://data.csai... | [
[
"tensorflow.python.platform.gfile.Exists"
]
] |
rahulrawat11/neuralmonkey | [
"8d194701448a7d318396ecf6a82eb2dc6dec9dec"
] | [
"neuralmonkey/decoders/sequence_labeler.py"
] | [
"from typing import cast, Iterable, List, Optional, Union\n\nimport tensorflow as tf\n\nfrom neuralmonkey.dataset import Dataset\nfrom neuralmonkey.model.model_part import ModelPart, FeedDict\nfrom neuralmonkey.encoders.recurrent import RecurrentEncoder\nfrom neuralmonkey.encoders.facebook_conv import SentenceEncod... | [
[
"tensorflow.nn.log_softmax",
"tensorflow.random_uniform_initializer",
"tensorflow.reduce_sum",
"tensorflow.zeros_initializer",
"tensorflow.expand_dims",
"tensorflow.placeholder",
"tensorflow.squeeze",
"tensorflow.nn.sparse_softmax_cross_entropy_with_logits",
"tensorflow.argmax"... |
azadyasar/GPT2 | [
"913590671d731e59815e61bb52645ee291daa970"
] | [
"src/gpt2/data/corpus.py"
] | [
"import torch\nimport threading\nimport time\nfrom gpt2.data import Dataset, VocabYTTM, VocabSP\nfrom typing import Dict, Any, List, Optional, Union\n\nclass TokenizedCorpus(Dataset):\n def __init__(self,\n corpus_path: str,\n vocab: Union[VocabSP, VocabYTTM],\n se... | [
[
"torch.tensor"
]
] |
city292/NAS-Projects | [
"b3977da52d4e017463d7019cc7fb5181b6faf87e"
] | [
"exps/vis/test.py"
] | [
"# python ./exps/vis/test.py\nimport os, sys\nfrom pathlib import Path\nimport torch\nimport numpy as np\nfrom collections import OrderedDict\nlib_dir = (Path(__file__).parent / '..' / '..' / 'lib').resolve()\nif str(lib_dir) not in sys.path: sys.path.insert(0, str(lib_dir))\n\n\ndef test_nas_api():\n from nas_102... | [
[
"torch.load"
]
] |
Online-Trio/projecide_squad | [
"58d8bcd64240d9d8d2b918564e4558ed6eee4ecd"
] | [
"compute_answers_files/model_qa_prediction.py"
] | [
"from settings_file import *\nimport nltk\nfrom tensorflow.python.ops import math_ops, nn_ops\nfrom nltk.corpus import stopwords\nimport spacy\ntry:\n nlp = spacy.load(\"en_core_web_lg\")\nexcept:\n spacy.cli.download(\"en_core_web_lg\")\n nlp = spacy.load(\"en_core_web_lg\")\n\nTOP_K_ANSWERS = 4\nMAX_ANSW... | [
[
"tensorflow.python.ops.math_ops.abs",
"tensorflow.python.ops.nn_ops.relu"
]
] |
charnley/bayes-mndo | [
"38662dd738af7cba73f98ffacc5c719aaa9a036d"
] | [
"src/hmc_optim.py"
] | [
"# %%\nimport json\nimport os\nimport pathlib\nfrom datetime import datetime\nfrom functools import partial\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom chemhelp import mndo, units\nfrom data import load_data, prepare_params\nfrom hmc_utils import get_nuts_kernel, sample_chain, trace_fn_nuts\nfrom objecti... | [
[
"tensorflow.random.truncated_normal",
"numpy.arange",
"tensorflow.cast",
"tensorflow.py_function",
"numpy.zeros",
"tensorflow.summary.create_file_writer"
]
] |
ovvladimir/Opencv_two_cameras | [
"d4ba432aff78db133396ccfc04073ea9374b13ef"
] | [
"main.py"
] | [
"import numpy as np\nimport argparse\nimport pickle\nimport cv2\nimport os\nfrom threading import Thread\nimport pyttsx3\n\nfrom usbcamvideostream import USBCamVideoStream\nfrom fps import FPS\n\nfps = FPS().start()\nblock = True\nname = None\nframes = []\n\n\ndef voice():\n if os.name == 'nt':\n engine =... | [
[
"numpy.array",
"numpy.argmax"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.