repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
megvii-research/basecls | [
"6b395a0a888370b4523764afb78a5a7634a3f6cd",
"6b395a0a888370b4523764afb78a5a7634a3f6cd"
] | [
"basecls/data/augment.py",
"basecls/models/vit.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) 2021 Facebook, Inc. and its affiliates.\n# Copyright (c) 2020 Ross Wightman\n# This file has been modified by Megvii (\"Megvii Modifications\").\n# All Megvii Modifications are Copyright (c) 2014-2021 Megvii Inc. All rights reserved.\n\"\"\"AutoAugment and RandAugment\n\nAut... | [
[
"numpy.random.choice"
],
[
"numpy.concatenate",
"numpy.split"
]
] |
sertansenturk/tdd_demo | [
"0cc2e0b474613874b244f37e857e5e028a6c2d85"
] | [
"demo/converter.py"
] | [
"from typing import List, Union\n\nimport numpy as np\n\nMIN_AUDIBLE_FREQUENCY = 20 # Hz\nMAX_AUDIBLE_FREQUENCY = 20000 # Hz\nNUM_CENTS_IN_OCTAVE = 1200 # cents\n\n\ndef hz_to_cent(hz_seq: Union[List[float], np.array],\n ref_hz: Union[float, np.float],\n min_hz: Union[float, np.float]... | [
[
"numpy.array",
"numpy.log2"
]
] |
tam17aki/speech_process_exercise | [
"c241becdf0ab1f79f65fc445513df3e0fe7638b7"
] | [
"SpeechAnalysisSynthesis/pysptk_anasyn_lsp.py"
] | [
"#!/usr/bin/env python3\n\n\"\"\" 音声情報処理 n本ノック !! \"\"\"\n\n# MIT License\n\n# Copyright (C) 2020 by Akira TAMAMORI\n\n# Permission is hereby granted, free of charge, to any person\n# obtaining a copy of this software and associated documentation files\n# (the Software\"), to deal in the Software without restrictio... | [
[
"scipy.io.wavfile.write",
"scipy.io.wavfile.read",
"numpy.log"
]
] |
herm1tbear/Twitch-IRC-Logger | [
"53d3c00bd58f5419b442b52d9b9b741932fc5c6a"
] | [
"twitch_api_bot.py"
] | [
"import requests\nimport os\nimport pandas as pd\nimport time\n\nlogs_folder = os.path.join(os.getcwd(), 'logs/')\nextra_info_log = os.path.join(logs_folder, 'extra_info/')\nchannel_info_log = os.path.join(logs_folder, 'channel_info/')\n\nclass TwitchAPIBot():\n \n def __init__(self, token, client_id, refres... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
mwizasimbeye11/forecasting-timeseries-ARIMA-models | [
"e3539862e48299090d018552c4cade174e33f4c9"
] | [
"test.py"
] | [
"from pandas import Series\nfrom pandas import read_csv\nfrom statsmodels.tsa.arima_model import ARIMA\nimport numpy\n\n# create a differenced series\ndef difference(dataset, interval=1):\n\tdiff = list()\n\tfor i in range(interval, len(dataset)):\n\t\tvalue = dataset[i] - dataset[i - interval]\n\t\tdiff.append(val... | [
[
"pandas.Series.from_csv",
"pandas.read_csv",
"numpy.array"
]
] |
bsun0802/Zero-DCE | [
"98ee2f907a4007f84bf0bc32684b74878dc4cad2"
] | [
"code/model.py"
] | [
"import torch\nimport torch.nn as nn\n\n\nclass DCENet(nn.Module):\n '''https://li-chongyi.github.io/Proj_Zero-DCE.html'''\n\n def __init__(self, n=8, return_results=[4, 6, 8]):\n '''\n Args\n --------\n n: number of iterations of LE(x) = LE(x) + alpha * LE(x) * (1-LE(x)).\n ... | [
[
"torch.cat",
"torch.nn.Tanh",
"torch.split",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.pow"
]
] |
sushuang9210/GAIL_LSTM | [
"457ecee9b812b304b6e319d310451a4ad3038e22"
] | [
"tf_rllab/core/network.py"
] | [
"import tf_rllab.core.layers as L\nimport tensorflow as tf\nimport numpy as np\nimport itertools\nfrom rllab.core.serializable import Serializable\nfrom tf_rllab.core.parameterized import Parameterized, Model\nfrom tf_rllab.core.layers_powered import LayersPowered\n\nfrom rllab.baselines.base import Baseline\nfrom ... | [
[
"numpy.concatenate",
"tensorflow.get_default_session",
"tensorflow.shape",
"tensorflow.argmax",
"numpy.mean",
"tensorflow.nn.sigmoid_cross_entropy_with_logits",
"tensorflow.constant",
"numpy.std",
"tensorflow.variable_scope",
"numpy.argmax",
"tensorflow.reduce_sum",
... |
keplaxo/COVID-TWEETS-ANALYSIS | [
"2c8904fa150c15d2350e211c858f434a11f6121e"
] | [
"scripts/deploy/score.py"
] | [
"#!/usr/bin/env python\n\n\"\"\"Model scoring (WIP) - Contributions welcome!!\n\"\"\"\n# import argparse\nimport joblib\nimport json\nimport numpy\n\nfrom azureml.core.model import Model\n\nfrom sklearn import datasets\nfrom sklearn.metrics import accuracy_score\nfrom sklearn.model_selection import train_test_split... | [
[
"sklearn.model_selection.train_test_split",
"numpy.array",
"sklearn.datasets.load_iris",
"sklearn.metrics.accuracy_score"
]
] |
sgwhat/BigDL | [
"25b402666fbb26b0bc18fc8100e9a00469844778"
] | [
"python/nano/test/inc/tf/test_keras_quantize.py"
] | [
"#\n# Copyright 2016 The BigDL 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 ... | [
[
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.keras.losses.BinaryCrossentropy",
"tensorflow.keras.applications.mobilenet_v2.MobileNetV2",
"numpy.random.randint",
"numpy.random.random",
"tensorflow.keras.metrics.CategoricalAccuracy",
"tensorflow.keras.optimizers.Adam"
]
] |
takluyver/pandas | [
"6c820b4b1a3b945d52cffbd9a4d40a582c077b5d"
] | [
"pandas/tools/tests/test_merge.py"
] | [
"# pylint: disable=E1103\n\nimport nose\nimport unittest\n\nfrom numpy.random import randn\nimport numpy as np\nimport random\n\nfrom pandas import *\nfrom pandas.tseries.index import DatetimeIndex\nfrom pandas.tools.merge import merge, concat\nfrom pandas.util.testing import (assert_frame_equal, assert_series_equa... | [
[
"pandas.util.testing.add_nans",
"numpy.array_equal",
"numpy.tile",
"pandas.util.testing.getSeriesData",
"pandas.tools.merge.merge",
"numpy.concatenate",
"numpy.arange",
"numpy.random.randint",
"pandas.util.testing.makeTimeSeries",
"pandas.util.testing.assert_panel_equal",
... |
joschu/Theano | [
"a53650487647b25f4258deef9d91ec950902c610"
] | [
"theano/sandbox/cuda/type.py"
] | [
"\"\"\"Provide CudaNdarrayType\n\"\"\"\nimport os\nimport copy_reg\nimport warnings\n\nimport numpy\n\nimport theano\nfrom theano import Type, Variable\nfrom theano import tensor, config\nfrom theano import scalar as scal\nfrom theano.compat.six import StringIO\n\ntry:\n # We must do those import to be able to c... | [
[
"numpy.asarray",
"numpy.zeros",
"numpy.any",
"numpy.prod",
"numpy.all",
"numpy.dtype"
]
] |
denyhoof/catalyst | [
"a340450076f7846007bc5695e5163e15b7ad9575"
] | [
"examples/distilbert_text_classification/experiment.py"
] | [
"# flake8: noqa\nfrom typing import Dict\nfrom collections import OrderedDict\nfrom pathlib import Path\n\nimport pandas as pd\n\nfrom catalyst.contrib.data.nlp.dataset import TextClassificationDataset\nfrom catalyst.dl import ConfigExperiment\n\n\nclass Experiment(ConfigExperiment):\n \"\"\"\n @TODO: Docs. C... | [
[
"pandas.read_csv"
]
] |
jarrodmcc/OpenFermion-Cirq | [
"d0755e92e68c6de1b52f5004dc5a75b445f01349"
] | [
"openfermioncirq/gates/common_gates_test.py"
] | [
"# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software... | [
[
"scipy.linalg.kron",
"scipy.linalg.expm",
"numpy.array",
"numpy.sqrt"
]
] |
richmanbtc/universal-portfolios | [
"cd9db76e8f039edafe256b9992e4e65bca96ba7d"
] | [
"universal/algos/ons.py"
] | [
"import numpy as np\nfrom cvxopt import matrix, solvers\n\nfrom .. import tools\nfrom ..algo import Algo\n\nsolvers.options[\"show_progress\"] = False\n\n\nclass ONS(Algo):\n \"\"\"\n Online newton step algorithm.\n\n Reference:\n A.Agarwal, E.Hazan, S.Kale, R.E.Schapire.\n Algorithms for Por... | [
[
"numpy.dot",
"numpy.zeros",
"numpy.ones",
"numpy.eye",
"numpy.squeeze"
]
] |
ashish-roopan/fsgan | [
"1582e112d0f59cd32920ac5953baec783e088cad"
] | [
"models/msba.py"
] | [
"\"\"\"\nMulti-Scale Binned Activation.\n\"\"\"\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass MSBA(nn.Module):\n def __init__(self, out_nc=3, bins=64):\n super(MSBA, self).__init__()\n self.in_nc = out_nc * bins\n self.out_nc = out_nc\n self.bins = b... | [
[
"torch.rand",
"torch.cat",
"torch.arange",
"torch.nn.functional.softmax",
"torch.sum"
]
] |
o3seespy/o3seespy | [
"4fdd942370df1ac8d454e361f651405717b8584c"
] | [
"o3seespy/command/recorder.py"
] | [
"from o3seespy.base_model import OpenSeesObject\nimport tempfile\nimport os\n\n\nclass RecorderBase(OpenSeesObject):\n op_base_type = \"recorder\"\n \n \nclass RecorderToArrayCacheBase(RecorderBase): # TODO: implement NodeToArray where data saved to memory and loaded as array without collect\n fname = ... | [
[
"numpy.loadtxt"
]
] |
bishax/pymc3 | [
"7cd66b7ff35659bf6dc7ae100794925e18708781"
] | [
"pymc3/model.py"
] | [
"import collections\nimport functools\nimport itertools\nimport threading\nimport six\n\nimport numpy as np\nimport scipy.sparse as sps\nimport theano.sparse as sparse\nfrom theano import theano, tensor as tt\nfrom theano.tensor.var import TensorVariable\n\nfrom pymc3.theanof import set_theano_conf\nimport pymc3 as... | [
[
"scipy.sparse.issparse",
"numpy.array",
"numpy.empty",
"numpy.asarray",
"numpy.zeros",
"numpy.ones",
"numpy.can_cast",
"numpy.prod",
"numpy.issubdtype",
"numpy.empty_like"
]
] |
yonetaniryo/SaIL | [
"c7404024c7787184c3638e9730bd185373ed0bf6"
] | [
"SaIL/planners/sail_planner.py"
] | [
"#!/usr/bin/env python\n\"\"\"Planner class that derives from search based planner. It defines festure calculation, normalization and \nheuristic calculation.\nThe train and test planner derive from this planner\"\"\"\n\n\nfrom collections import defaultdict\nfrom math import atan2, pi\nimport numpy as np\nimport t... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.asarray",
"numpy.abs",
"numpy.random.sample"
]
] |
icaros-usc/ada_assistance_policy | [
"5bd21fe0bddc99516d71101949cd93220a5eaf10"
] | [
"src/ada_assistance_policy/GoalPredictor.py"
] | [
"import numpy as np\nimport scipy.misc\nimport IPython\n\nlogsumexp = scipy.misc.logsumexp\n\nclass GoalPredictor(object):\n max_prob_any_goal = 0.99\n log_max_prob_any_goal = np.log(max_prob_any_goal)\n def __init__(self, goals):\n self.goals = goals\n self.log_goal_distribution = np.log((1./len(self.goal... | [
[
"numpy.argmax",
"numpy.exp",
"numpy.log"
]
] |
chanzuckerberg/corpora-data-portal | [
"d8901ef978ad96de75510d5eb0e459a4790197ea"
] | [
"scripts/athena.py"
] | [
"import boto3\nfrom uuid import uuid4\nfrom collections import defaultdict\nimport time\nfrom pandas import DataFrame\nimport datetime\nimport numpy as np\nimport pandas\nimport requests\n\npandas.set_option(\n \"display.max_rows\", None, \"display.max_columns\", None, \"display.width\", 1000, \"display.max_colw... | [
[
"pandas.DataFrame.from_dict",
"pandas.set_option"
]
] |
songhappy/ai-matrix | [
"901078e480c094235c721c49f8141aec7a84e70e",
"901078e480c094235c721c49f8141aec7a84e70e"
] | [
"macro_benchmark/Mask_RCNN/mrcnn/model.py",
"macro_benchmark/DeepInterest/din/Dice.py"
] | [
"\"\"\"\nMask R-CNN\nThe main Mask R-CNN model implemenetation.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport os\nimport random\nimport datetime\nimport re\nimport math\nimport logging\nfrom collections import OrderedDic... | [
[
"tensorflow.exp",
"numpy.random.choice",
"tensorflow.image.non_max_suppression",
"numpy.copy",
"tensorflow.unique",
"tensorflow.reshape",
"numpy.where",
"tensorflow.sqrt",
"numpy.sort",
"tensorflow.stack",
"tensorflow.control_dependencies",
"numpy.broadcast_to",
... |
lidar-nevermore/hyp3-lib | [
"bfb2487b6cbc0029eb689bc059890e71b7f60d3c"
] | [
"hyp3lib/geotiff_lut.py"
] | [
"\"\"\"Applies a LUT to a GeoTIFF\"\"\"\n\nimport argparse\nimport os\n\nimport numpy as np\nfrom osgeo import gdal, osr\n\n\ndef geotiff_lut(geotiff, lutFile, outFile):\n\n # Suppress GDAL warnings\n gdal.UseExceptions()\n gdal.PushErrorHandler('CPLQuietErrorHandler')\n\n # Read GeoTIFF and normalize it (if ne... | [
[
"numpy.max",
"numpy.isnan",
"numpy.zeros",
"numpy.genfromtxt",
"numpy.min",
"numpy.mean",
"numpy.std"
]
] |
WingFeiTsang/FedML_FEI | [
"c209fb528a1d0475209f526bd5e51b37c0eb94e7"
] | [
"fedml_api/distributed/fedavg_gRPC/FedAVGAggregator.py"
] | [
"import copy\nimport logging\nimport random\nimport time\n\nimport numpy as np\nimport torch\nimport wandb\n\nfrom .utils import transform_list_to_tensor\n\n\nclass FedAVGAggregator(object):\n def __init__(self, train_global, test_global, all_train_data_num,\n train_data_local_dict, test_data_loc... | [
[
"numpy.random.seed",
"torch.utils.data.Subset",
"torch.utils.data.DataLoader"
]
] |
Detavern/ArkPlanner | [
"41347b4ee6e49cbb023d5e74131044444d3ec532"
] | [
"MaterialPlanning.py"
] | [
"import numpy as np\nimport urllib.request, json, time, os, copy, sys\nfrom scipy.optimize import linprog\nfrom collections import defaultdict as ddict\n\nglobal penguin_url, headers\npenguin_url = 'https://penguin-stats.io/PenguinStats/api/'\nheaders = {'User-Agent':'ArkPlanner'}\n\nPrice = dict()\nwith open('pric... | [
[
"numpy.array",
"numpy.dot",
"numpy.any",
"numpy.where",
"numpy.argmax",
"numpy.append",
"numpy.hstack",
"numpy.vstack"
]
] |
zaxcie/toxiccomment | [
"2c1ed79ccb25dd403aaa5c02dd54d4fdfd8505c9"
] | [
"src/data/create_valset.py"
] | [
"import pandas as pd\nimport random\nfrom math import floor\n\n\ndef train_val_split(df, perc):\n random.seed(966)\n\n pop = int(df.shape[0])\n\n k = floor(pop*perc)\n sample = random.sample(list(range(pop)), k)\n\n train = df[df.index.isin(sample)]\n val = df[~df.index.isin(sample)]\n\n return... | [
[
"pandas.read_csv"
]
] |
ChrisAlbertsen/pandas | [
"da0156a302f3f7c25bfee0b410bb23865b76f3dd"
] | [
"pandas/core/internals/construction.py"
] | [
"\"\"\"\nFunctions for preparing various inputs passed to the DataFrame or Series\nconstructors before passing them to a BlockManager.\n\"\"\"\nfrom __future__ import annotations\n\nfrom collections import abc\nfrom typing import (\n TYPE_CHECKING,\n Any,\n Hashable,\n Sequence,\n cast,\n)\nimport wa... | [
[
"pandas._libs.lib.to_object_array_tuples",
"pandas.core.common.require_length_match",
"pandas.core.dtypes.common.is_named_tuple",
"pandas.core.construction.range_to_ndarray",
"pandas.util._exceptions.find_stack_level",
"pandas.core.internals.blocks.new_block_2d",
"pandas.core.indexes.a... |
PWhiddy/Growing-Neural-Cellular-Automata-Pytorch | [
"73a68e9a9cd0c3c14e590238f098937dc0f5c888"
] | [
"CA_Particles_V3/run_ca_training.py"
] | [
"import torch\nfrom ca_particles import ParticleSimulation, CAModel, CASimulation, CATrainer\n\nif __name__ == '__main__':\n env_size = 24\n cell_dim = 16\n hidden_dim = 512\n batch_size = 32#128\n wall_pad = 2\n train_steps = 4096*4\n seed = 55\n device = torch.device('cuda')\n pretrain_... | [
[
"torch.device",
"torch.load"
]
] |
Naveen-and-Taishi/DeepCorrect | [
"b1ac17927d91f2010888533e1bed014637aa9453"
] | [
"code/simulator.py"
] | [
"import os\nimport tensorflow as tf\nimport numpy as np\nimport random\nimport math\n\nclass Simulator():\n def __init__(self, type) -> None:\n if type == 'D':\n # deuteranope\n self.color_matrix = tf.convert_to_tensor([[1, 0, 0], [0.494207, 0, 1.24827], [0, 0, 1]])\n elif typ... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.linalg.inv",
"tensorflow.matmul",
"tensorflow.transpose",
"tensorflow.reshape"
]
] |
hpecl-sspku/hpecl-2017 | [
"895757eb7d5f984e0268ab99da95663172bc2f50"
] | [
"chatbot/src/Chatbot_ref_002/udc_hparams.py"
] | [
"import tensorflow as tf\nfrom collections import namedtuple\n\n# Model Parameters\ntf.flags.DEFINE_integer(\n \"vocab_size\",\n 91620 ,\n \"The size of the vocabulary. Only change this if you changed the preprocessing\")\n\n# Model Parameters\ntf.flags.DEFINE_integer(\"embedding_dim\", 100, \"Dimensionality of ... | [
[
"tensorflow.flags.DEFINE_float",
"tensorflow.flags.DEFINE_string",
"tensorflow.flags.DEFINE_integer"
]
] |
l-i-e-d-j-i-6-7-8-w-d/python-science-tutorial | [
"a0320a93e9fe93cab45014bd218032b727343de9"
] | [
"pylustrator-example/plot_before.py"
] | [
"# Import packages\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pylustrator\n\n# Use scientific plot style\nplt.style.use('scientific')\n\n# Create dummy data\nx = np.linspace(0, 4*np.pi, 200)\ny1 = np.sin(x)\ny2 = np.cos(x)\n\n# Start pylustrator\npylustrator.start()\n\n# Create panelled figure\nfi... | [
[
"numpy.sin",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.style.use",
"numpy.cos",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
petersvenningsson/izencovich-neuron-fitting | [
"ee22dc478df3113e7fc1ffd43fd71f95e905727c"
] | [
"run_a_model.py"
] | [
"# Author\n# Peter Svenningsson\n# Email\n# peter.o.svenningsson@gmail.com\n###########\n# IMPORTS #\n###########\n# Standard\nimport time\nimport csv\nimport json\n# 3rd party\nimport numpy as np\nimport matplotlib.pyplot as plt\n# Local\nfrom dataset.dataset_QSNMC import QSNMCDataset\nfrom models.izencovich_neuro... | [
[
"matplotlib.pyplot.rcParams.update",
"numpy.zeros_like",
"numpy.ones_like",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.rc"
]
] |
ematvey/kaggle-carvana | [
"fb294276749d8827884e44d42413b2b923f1edf4"
] | [
"models.py"
] | [
"import torch\nimport torch.nn as nn\n\n\ndef conv(*a, **kwa):\n return nn.Conv2d(*a, **kwa)\n\n\ndef convlayer(in_c, out_c, kernel_size=3, stride=1, padding=1):\n return nn.Sequential(\n conv(in_c, out_c, kernel_size=kernel_size,\n stride=stride, padding=padding, bias=True),\n nn.Ba... | [
[
"torch.cat",
"torch.nn.functional.upsample",
"torch.nn.BatchNorm2d",
"torch.nn.ConvTranspose2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.functional.max_pool2d"
]
] |
nagura4000/pi-robot | [
"84ef9969821081527ae0a566d32c351b3a401d9b"
] | [
"inception_v3.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Inception V3 model for Keras.\n\nNote that the input image format for this model is different than for\nthe VGG16 and ResNet models (299x299 instead of 224x224),\nand that the input preprocessing function is also different (same as Xception).\n\n# Reference\n\n- [Rethinking the Incep... | [
[
"numpy.expand_dims"
]
] |
llongquoc/voxceleb_trainer | [
"7442ea6c1a4b4fde3bcec44a4538d6a515e5f292"
] | [
"SpeakerNet.py"
] | [
"#!/usr/bin/python\n#-*- coding: utf-8 -*-\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy, math, pdb, sys, random\nimport time, os, itertools, shutil, importlib\nfrom tuneThreshold import tuneThresholdfromScore\nfrom DatasetLoader import test_dataset_loader\n\nfrom torch.cuda.... | [
[
"torch.nn.functional.normalize",
"torch.cuda.amp.autocast",
"numpy.mean",
"torch.LongTensor",
"torch.utils.data.DataLoader",
"torch.load",
"torch.cuda.amp.GradScaler"
]
] |
hsh1108/EverybodyDanceNow | [
"8101fe9780a369673632a07e2ef9e8fccf730b0d"
] | [
"face_enhancer/enhance.py"
] | [
"import model\nimport dataset\nimport cv2\nfrom trainer import Trainer\nimport os\nfrom tqdm import tqdm\nimport torch\nfrom torch.utils.data import DataLoader\nimport torchvision.transforms as transforms\nimport numpy as np\nfrom PIL import Image\nfrom skimage.io import imsave\nfrom imageio import get_writer\nos.e... | [
[
"torch.device",
"torch.no_grad",
"torch.load"
]
] |
joomcode/spark | [
"adf9b64c0be8e6e5bc6042eaaecd53518fbc5e25"
] | [
"python/pyspark/pandas/generic.py"
] | [
"#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo... | [
[
"pandas.api.types.is_list_like"
]
] |
pedro-r-marques/tensorflow | [
"c5cf654bd0d5eb1e20d7802965ab295032a06c88",
"c5cf654bd0d5eb1e20d7802965ab295032a06c88"
] | [
"tensorflow/python/ops/array_ops.py",
"tensorflow/python/training/tracking/graph_view.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.ops.gen_math_ops.select",
"tensorflow.python.ops.gen_array_ops.list_diff",
"tensorflow.python.ops.gen_array_ops.unique_with_counts",
"tensorflow.python.ops.gen_array_ops.guarantee_const",
"tensorflow.python.framework.tensor_util.constant_value",
"numpy.prod",
"tensor... |
warisqr007/MobileNetV2 | [
"8ac1e537b09a5a67bc2d8a8bf0f159c7198a51ba"
] | [
"train.py"
] | [
"\"\"\"\nTrain the MobileNet V2 model\n\"\"\"\nimport os\nimport sys\nimport argparse\nimport pandas as pd\n\n#from mobilenet_v2 import MobileNetv2\nfrom densemobilenet import DenseNet\n\nfrom keras.optimizers import Adam\nfrom keras.preprocessing.image import ImageDataGenerator\nfrom keras.callbacks import EarlySt... | [
[
"pandas.DataFrame.from_dict"
]
] |
deeprob/Protein-Classification-Tool | [
"d140d4f6336ac8dd8a0172df847d63449a5e0068"
] | [
"model/meta.py"
] | [
"from sklearn.metrics import accuracy_score\nimport numpy as np\n\n\nclass Ensemble:\n def __init__(self, model_preds, ytest=None):\n self.ytest = ytest\n self.model_preds = model_preds\n self.preds = np.array(self._get_predictions())\n if self.ytest is not None:\n self.acc... | [
[
"numpy.array",
"sklearn.metrics.accuracy_score"
]
] |
gabrielgts/itapecerica-simulation | [
"ffb44f54955a5d11eeb1d7c859129902630bfadf"
] | [
"IQA/iqa.py"
] | [
"# Bibliotecas para manuseio dos dados\nimport pandas as pd\nimport numpy as np\n\n# datasheet\ndataset = pd.read_csv(\"parametros_ssinal_trasformed.csv\", encoding='utf8',\n delimiter=';', engine='python')\n\ndataset['Data de Amostragem'] = pd.to_datetime(dataset['Data de Amostragem'])\n\nprin... | [
[
"pandas.to_datetime",
"pandas.DataFrame",
"pandas.read_csv"
]
] |
nakayama-r/Probspace-kiva-3rd | [
"1fe41aa10b4dd2ec992096228a03b85b61a28a2f"
] | [
"easy_gold/model_wrappers.py"
] | [
"# coding:utf-8\r\n\r\nimport os\r\nimport pathlib\r\nimport numpy as np\r\nimport pandas as pd\r\n\r\nimport lightgbm as lgb\r\n\r\nimport pytorch_lightning as pl\r\nfrom pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint\r\nfrom pytorch_lightning.loggers import WandbLogger\r\n\r\n\r\nfrom DNNmodel ... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros",
"pandas.concat",
"pandas.DataFrame",
"pandas.Series",
"pandas.read_csv"
]
] |
headhunterChris/delta | [
"a916e06f55213dcd1fea39a5950927dfed1483c7"
] | [
"delta/models/text_seq2seq_model.py"
] | [
"# Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd.\n# 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.o... | [
[
"tensorflow.constant_initializer",
"tensorflow.keras.layers.add",
"tensorflow.random_uniform_initializer",
"tensorflow.not_equal",
"tensorflow.logging.info",
"tensorflow.keras.layers.Embedding",
"tensorflow.keras.layers.Dropout"
]
] |
Lee0008/Paddle-Lite | [
"76f9d0bedbdee32d67657b2073c82365fbb494a3"
] | [
"lite/tests/unittest_py/op/test_bilinear_interp_op.py"
] | [
"# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"numpy.random.random",
"numpy.random.randint"
]
] |
Josue-Zea/tytus | [
"f9e4be9a8c03eb698fade7a748972e4f52d46685"
] | [
"parser/fase2/team10/sql/Instrucciones/Sql_select/Select.py"
] | [
"from sql.Instrucciones.TablaSimbolos.Instruccion import Instruccion\nfrom sql.storageManager.jsonMode import *\nfrom sql.Instrucciones.Sql_select.OrderBy import OrderBy\nfrom sql.Instrucciones.Sql_select.GroupBy import GroupBy\nfrom sql.Instrucciones.Sql_select.Having import Having\nfrom sql.Instrucciones.Sql_sele... | [
[
"numpy.ascontiguousarray",
"numpy.array",
"numpy.sort",
"numpy.concatenate"
]
] |
pernici/sympy | [
"3a43310f1957a21a6f095fe2801cc05b5268a2c7"
] | [
"sympy/physics/quantum/matrixutils.py"
] | [
"\"\"\"Utilities to deal with sympy.Matrix, numpy and scipy.sparse.\"\"\"\n\nfrom sympy import Matrix, I, Expr, Integer\nfrom sympy.matrices import matrices\nfrom sympy.core.compatibility import all\n\n__all__ = [\n 'numpy_ndarray',\n 'scipy_sparse_matrix',\n 'sympy_to_numpy',\n 'sympy_to_scipy_sparse',... | [
[
"numpy.zeros_like",
"scipy.sparse.eye",
"numpy.eye",
"numpy.allclose",
"scipy.sparse.csr_matrix",
"numpy.kron",
"scipy.sparse.kron"
]
] |
greatji/Learning-based-cost-estimator | [
"53038267942bd067217b8ca914aa67b2459dd479"
] | [
"src/feature_extraction/database_loader.py"
] | [
"import pandas as pd\n\ndef load_dataset(dir_path):\n data = dict()\n data[\"aka_name\"] = pd.read_csv(dir_path + '/aka_name.csv', header=None)\n data[\"aka_title\"] = pd.read_csv(dir_path + '/aka_title.csv', header=None)\n data[\"cast_info\"] = pd.read_csv(dir_path + '/cast_info.csv', header=None)\n ... | [
[
"pandas.read_csv"
]
] |
smspillaz/awd-lstm-lm | [
"2fe0e762823d06ba93b2a0888bad4640ad7d5b7c"
] | [
"main.py"
] | [
"import argparse\nimport time\nimport math\nimport numpy as np\nimport torch\nimport torch.nn as nn\n\nimport data\nimport model as model_module\n\nfrom utils import batchify, get_batch, repackage_hidden\n\nparser = argparse.ArgumentParser(description='PyTorch PennTreeBank RNN/LSTM Language Model')\nparser.add_argu... | [
[
"numpy.random.normal",
"torch.cuda.manual_seed",
"torch.nn.utils.clip_grad_norm_",
"numpy.random.seed",
"torch.save",
"torch.optim.SGD",
"torch.optim.Adam",
"torch.manual_seed",
"torch.cuda.is_available",
"torch.load",
"numpy.random.random"
]
] |
zhaotingchen/FAST-PT | [
"f7fab86bf8a1a14e97c1edb83def82e241798c0f"
] | [
"examples/fastpt_example.py"
] | [
"\"\"\"An example script to run FASTPT\nInitializes and calculates all quantities supported by FASTPT\nMakes a plot for P_22 + P_13\n\"\"\"\nfrom time import time\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport fastpt as fpt\nfrom fastpt import FASTPT\n\n#Version check\nprint('This is FAST-PT versi... | [
[
"matplotlib.pyplot.grid",
"matplotlib.pyplot.legend",
"numpy.loadtxt",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplot"
]
] |
uforodavid/Disaster-response-pipeline | [
"9c3d148d67e3f5c334c8623628922b583637f3a6"
] | [
"data/process_data.py"
] | [
"#python process_data.py disaster_messages.csv disaster_categories.csv DisasterResponse.db\nimport sys\nimport numpy as np\nimport pandas as pd\nfrom sqlalchemy import create_engine\n\ndef load_data(messages_filepath, categories_filepath):\n '''\n This function returns merged dataframe of input dataframes.\n\... | [
[
"pandas.read_csv",
"pandas.merge",
"pandas.concat"
]
] |
EmanuelaBoros/stacked-ner | [
"1fe4d5293badf689a53b10e45ee906e482cbcd5c"
] | [
"models/models.py"
] | [
"# -*- coding: utf-8 -*-\n\nfrom fastNLP.modules import ConditionalRandomField, allowed_transitions\nfrom modules.transformer import TransformerEncoder\nfrom torch import nn\nimport torch\nimport torch.nn.functional as F\n\n\nclass StackedTransformersCRF(nn.Module):\n def __init__(self, tag_vocabs, embed, num_la... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.functional.log_softmax",
"torch.cuda.empty_cache",
"torch.argmax"
]
] |
jarry7/Marmot | [
"d036353a2da64aafea63fc3662605530f05128db"
] | [
"marmot/plottingmodules/generation_unstack.py"
] | [
"\"\"\"Timeseries generation line plots. \n\nThis code creates generation non-stacked line plots.\n\n@author: Daniel Levie\n\"\"\"\nimport logging\nimport pandas as pd\nimport datetime as dt\nimport matplotlib.pyplot as plt\nimport marmot.config.mconfig as mconfig\n\nfrom marmot.plottingmodules.plotutils.plot_libra... | [
[
"pandas.notna",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.ylabel",
"pandas.concat"
]
] |
lorenzosteccanella/machin | [
"9d3ce87dbed820b5019211b0690b54613084d9e4"
] | [
"examples/tutorials/as_fast_as_lightning/programmatic/simple/main.py"
] | [
"from machin.auto.config import (\n generate_algorithm_config,\n generate_env_config,\n generate_training_config,\n launch,\n)\n\nimport torch as t\nimport torch.nn as nn\n\n\nclass SomeQNet(nn.Module):\n def __init__(self, state_dim, action_num):\n super().__init__()\n\n self.fc1 = nn.... | [
[
"torch.nn.Linear"
]
] |
gbouvignies/chemex | [
"b021650928b6db930281957222529bc6bcab8aa2"
] | [
"chemex/experiments/catalog/cpmg_ch3_1h_tq_diff/experiment.py"
] | [
"from __future__ import annotations\n\nfrom dataclasses import dataclass\nfrom functools import reduce\nfrom typing import Literal\n\nimport numpy as np\nfrom numpy.typing import NDArray\n\nfrom chemex.configuration.data import RelaxationDataSettings\nfrom chemex.configuration.experiment import CpmgSettings\nfrom c... | [
[
"numpy.array",
"numpy.flip",
"numpy.take"
]
] |
dakilaledesma/pytorch-image-models | [
"91675fc8b02c9ebfd80a830a0debb229a13c36eb"
] | [
"inference_cpct1.py"
] | [
"#!/usr/bin/env python3\n\"\"\"PyTorch Inference Script\n\nAn example inference script that outputs top-k class ids for images in a folder into a csv.\n\nHacked together by / Copyright 2020 Ross Wightman (https://github.com/rwightman)\n\"\"\"\nimport os\nimport time\nimport argparse\nimport logging\nimport numpy as... | [
[
"numpy.concatenate",
"torch.no_grad"
]
] |
y-jeong/RET-SLR | [
"4163e46b81f19a8a041bb733b10b22ae5d3f249b"
] | [
"src/1DNPSLR.py"
] | [
"# For each given array geometry, this program calculates the extinction cross section, differential scattering cross section (partially driven array), or multi donor-multi acceptor resonance energy transfer (RET) rate\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os\nimport sys\nfrom scipy.constan... | [
[
"numpy.array",
"matplotlib.pyplot.text",
"numpy.empty",
"matplotlib.pyplot.savefig",
"numpy.real",
"matplotlib.pyplot.subplots",
"numpy.shape",
"numpy.loadtxt",
"numpy.arange",
"numpy.imag",
"numpy.linspace",
"matplotlib.pyplot.subplots_adjust"
]
] |
weishancc/COVID19-SA | [
"d4c8e2ed70df67e21e49671d9905312be89e5647"
] | [
"main.py"
] | [
"import os\r\nimport batch\r\nimport preprocessing\r\nimport train\r\nimport predict\r\nimport pandas as pd\r\nfrom matplotlib import pyplot as plt\r\nfrom covidDataset import CovidDataset\r\nfrom torch.utils.data import DataLoader\r\nfrom transformers import BertForSequenceClassification, BertTokenizer\r\nfrom skl... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.savefig",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"matplotlib.pyplot.ylabel"... |
siat-nlp/GALAXY | [
"b1c23f588a37a588b0de7e16f5bcdbeb8a517fd5"
] | [
"galaxy/utils/utils.py"
] | [
"import logging\nimport json\nimport numpy as np\nfrom collections import OrderedDict\nfrom galaxy.utils import ontology\n\n\ndef clean_replace(s, r, t, forward=True, backward=False):\n def clean_replace_single(s, r, t, forward, backward, sidx=0):\n # idx = s[sidx:].find(r)\n idx = s.find(r)\n ... | [
[
"numpy.array"
]
] |
walter-hernandez/nxviz | [
"48963c5b9a6cc3eb8a17fcfacdb51fc41c1c4e7e"
] | [
"examples/circos/group_labels_with_default_legend.py"
] | [
"from random import choice\n\nimport matplotlib.pyplot as plt\nimport networkx as nx\nfrom nxviz.plots import CircosPlot\n\nG = nx.barbell_graph(m1=10, m2=3)\nfor n, d in G.nodes(data=True):\n G.node[n][\"class\"] = choice([\"a\", \"b\", \"c\", \"d\", \"e\"])\n\nc = CircosPlot(\n G,\n node_grouping=\"class... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.show"
]
] |
Aliweka2020/EfficientDETR | [
"6557dca4e969d58f15555fe030a7ad7a0bacef7c"
] | [
"models/backbone.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\"\"\"\nBackbone modules.\n\"\"\"\nfrom collections import OrderedDict\n\nimport torch\nimport torch.nn.functional as F\nimport torchvision\nfrom torch import nn\nfrom torchvision.models._utils import IntermediateLayerGetter\nfrom typing impor... | [
[
"torch.zeros",
"torch.ones"
]
] |
ihpcganck/pp-1.11.12 | [
"e746204b5d86a570f28ecb26433a10264711b9af"
] | [
"phonopy/structure/symmetry.py"
] | [
"# Copyright (C) 2011 Atsushi Togo\n# All rights reserved.\n#\n# This file is part of phonopy.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n#\n# * Redistributions of source code must retain the above copyr... | [
[
"numpy.array",
"numpy.dot",
"numpy.linalg.norm",
"numpy.zeros",
"numpy.rint",
"numpy.eye",
"numpy.abs",
"numpy.floor"
]
] |
juancotrino/Hapi | [
"db65313a333f9b763c1021f84ef656835fb2f855",
"db65313a333f9b763c1021f84ef656835fb2f855"
] | [
"Hapi/riminputs.py",
"Examples/Create Inputs/ExtractParametersBounds.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Feb 15 22:51:02 2020\n\n@author: mofarrag\n\"\"\"\nimport os\nimport numpy as np\nimport pandas as pd\nimport datetime as dt\nfrom scipy.stats import gumbel_r\nimport matplotlib.pyplot as plt\nimport gdal\nimport zipfile\nfrom statsmodels import api as sm\n\n\nclass ... | [
[
"matplotlib.pyplot.annotate",
"matplotlib.pyplot.xlim",
"numpy.where",
"pandas.read_csv",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.tight_layout",
"scipy.stats.gumbel_r.fit",
"numpy.log10",
"matplotlib.pyplot.yscale",
"scipy.stats.gumbel_r.ppf"... |
astromancer/obstools | [
"c83f562a4f602cbe4420bec07308159761818a79"
] | [
"src/obstools/stats.py"
] | [
"import numpy as np\nfrom scipy.spatial.distance import cdist, euclidean\n\n\ndef mad(data, data_median=None, axis=None):\n \"\"\"\n Median absolute deviation\n\n Parameters\n ----------\n data\n data_median\n\n Returns\n -------\n\n \"\"\"\n nans = np.isnan(data)\n if nans.any():\n... | [
[
"numpy.isnan",
"numpy.ma.masked_all",
"scipy.spatial.distance.euclidean",
"numpy.linalg.norm",
"numpy.median",
"numpy.sum",
"numpy.ma.median",
"numpy.ma.MaskedArray",
"numpy.abs",
"numpy.ma.is_masked",
"scipy.spatial.distance.cdist",
"numpy.asanyarray"
]
] |
mehrdad-shokri/WorldModels-1 | [
"fa3d2b95633ad8b7f8d95783aa180369c91b5476"
] | [
"random_rollouts.py"
] | [
"import argparse\nimport os\nimport time\nfrom multiprocessing import cpu_count, Pool\n\nimport gzip\nimport gym\nfrom scipy.misc import imresize\nimport numpy as np\n\nfrom lib.utils import log, mkdir\nfrom lib.constants import DOOM_GAMES\ntry:\n from lib.env_wrappers import ViZDoomWrapper\nexcept Exception as ... | [
[
"numpy.array",
"numpy.asarray",
"numpy.random.seed",
"scipy.misc.imresize",
"numpy.save",
"numpy.random.randint"
]
] |
flyyufelix/sonic_contest | [
"bba80d7049fc1586a42c05905bae75c271657761"
] | [
"anyrl-py/anyrl/models/dqn_dist.py"
] | [
"\"\"\"\nDistributional Q-learning models.\n\"\"\"\n\nfrom abc import abstractmethod\nfrom functools import partial\nfrom math import log\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom .base import TFQNetwork\nfrom .dqn_scalar import noisy_net_dense\nfrom .util import nature_cnn, simple_mlp, take_vector_ele... | [
[
"tensorflow.exp",
"tensorflow.trainable_variables",
"tensorflow.shape",
"tensorflow.expand_dims",
"tensorflow.equal",
"tensorflow.ceil",
"tensorflow.stop_gradient",
"tensorflow.zeros_like",
"tensorflow.variable_scope",
"tensorflow.placeholder",
"tensorflow.reduce_sum",
... |
pourabk-hexaware/insights-teachable-machine-wrapper | [
"a38847dbce76e99656d2c0af9dc72ab9de605290"
] | [
"app.py"
] | [
"from tensorflow.keras.models import load_model\nfrom tensorflow.python.keras.backend import set_session\nimport tensorflow as tf\nfrom flask import Flask, request, render_template, jsonify, send_file, url_for\nimport os\nfrom PIL import Image, ImageOps\nimport numpy as np\nimport math\nimport time\nimport base64\n... | [
[
"numpy.asarray",
"tensorflow.compat.v1.get_default_graph",
"numpy.set_printoptions",
"tensorflow.Session",
"tensorflow.keras.models.load_model",
"numpy.ndarray",
"tensorflow.python.keras.backend.set_session"
]
] |
JoeyZhaoJy/TgDLF | [
"2ea8c883aed715ac7f9dba9b660d0589cd8a89bf"
] | [
"EnLSTM/train.py"
] | [
"import numpy as np\r\nimport torch\r\nfrom torch.autograd import Variable\r\nfrom torch.utils.data import DataLoader\r\nimport time\r\nimport os\r\nimport matplotlib.pyplot as plt\r\nimport pickle\r\nimport json\r\nfrom enn import enn, enrml, lamuda\r\nfrom net import netLSTM_withbn\r\nfrom data import TextDataset... | [
[
"torch.cuda.manual_seed",
"torch.nn.MSELoss",
"matplotlib.pyplot.errorbar",
"numpy.random.seed",
"torch.no_grad",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"torch.manual_seed",
"torch.cuda.set_device",
... |
realSaeedHassani/deeplearning | [
"108caff95faec342bdd987fc39c7bc00ac155b3d"
] | [
"runs/run_11_alstm_fcn.py"
] | [
"'''\r\n>> First run:\r\n Accuracy: ?\r\n Epoch: 1000\r\n ------------\r\n>> Second run:\r\n Length: 899, Activation: SoftMax\r\n'''\r\nimport os\r\nfrom itertools import cycle\r\n\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\nimport pandas as pd\r\nfrom keras import backend as K\r\nfrom keras... | [
[
"matplotlib.pyplot.xlim",
"pandas.read_csv",
"numpy.zeros_like",
"pandas.merge",
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"numpy.eye",
"numpy.arange",
"numpy.argmax",
"scipy.interp",
"numpy.array",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.grid",
... |
Flamexmt/ATMC | [
"ebf47b11ea6224b02d4a6931b8ca47011039c55f"
] | [
"cifar100/inference_model.py"
] | [
"import argparse, pickle\nimport os, sys\nsys.path.append(os.getcwd())\nsys.path.append(os.path.join(os.getcwd(), 'utee'))\nimport time\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nimport numpy as np\nfrom utee import misc\nfrom util import fgsm_gt, pgd_gt, ifg... | [
[
"torch.manual_seed",
"torch.cuda.is_available",
"torch.cuda.manual_seed",
"torch.load"
]
] |
albertdow/zinv-analysis | [
"039f1ca2217539f2bed5cb15b3aed435fc9be40d"
] | [
"tests/unit/sequence/Readers/test_CertifiedLumiChecker.py"
] | [
"import pytest\nimport mock\nimport numpy as np\n\nfrom sequence.Readers import CertifiedLumiChecker\n\nclass DummyEvent(object):\n def __init__(self):\n self.iblock = 0\n self.cache = {}\n self.run = np.array([0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3])\n self.luminosityBlock = np.array([0, 1,... | [
[
"numpy.array"
]
] |
PranjaliJain/matchmaker | [
"b7e22eb8b70cccabf0729076df7cbab3f4ba4a1f"
] | [
"matchmaker/modules/indexing_heads.py"
] | [
"from typing import Dict, Iterator, List\n\nimport torch\nimport torch.nn as nn\n\nclass CollectionIndexerHead(nn.Module):\n '''\n Wraps a nn.module and calls forward_representation in forward (needed for multi-gpu use)\n '''\n\n def __init__(self,\n neural_ir_model: nn.Module,\n ... | [
[
"torch.cuda.amp.autocast"
]
] |
Li-mz/bilby | [
"05a74dd2a750426524c78ac23048572b51d40e2b"
] | [
"bilby/gw/likelihood.py"
] | [
"from __future__ import division\n\nimport gc\nimport os\nimport json\nimport copy\n\nimport numpy as np\nimport scipy.integrate as integrate\nfrom scipy.interpolate import interp1d\n\ntry:\n from scipy.special import logsumexp\nexcept ImportError:\n from scipy.misc import logsumexp\nfrom scipy.special import... | [
[
"numpy.genfromtxt",
"numpy.load",
"numpy.exp",
"numpy.fft.fft",
"numpy.conjugate",
"numpy.logspace",
"numpy.nan_to_num",
"numpy.conj",
"numpy.arange",
"numpy.vdot",
"scipy.misc.logsumexp",
"scipy.interpolate.interp1d",
"scipy.integrate.simps",
"numpy.zeros",... |
AdityaKane2001/MaskTextSpotter | [
"a36d2abfca8738b1a0af49986447e9cd0d4eced4"
] | [
"maskrcnn_benchmark/data/datasets/coco.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\nimport torch\nimport torchvision\n\nfrom maskrcnn_benchmark.structures.bounding_box import BoxList\nfrom maskrcnn_benchmark.structures.segmentation_mask import SegmentationMask\n\n\nclass COCODataset(torchvision.datasets.coco.CocoDetection):\... | [
[
"torch.as_tensor",
"torch.tensor"
]
] |
kyphd/md-lecture | [
"b3f93f1dc77992a1f5797eb29c30abd2cc3d98bd"
] | [
"ex3_kidou.py"
] | [
"# ex3_kidou\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndef euler(t_start, t_end, dt, x_0, u_0, y_0, v_0, ax):\n\n t = t_start\n\n tary = [t]\n xary = [x_0]\n uary = [u_0]\n yary = [y_0]\n vary = [v_0]\n\n while t < t_end:\n r3 = np.sqrt(x_0 ** 2 + y_0 ** 2) ** 3\n\n ... | [
[
"matplotlib.pyplot.show",
"numpy.sqrt",
"matplotlib.pyplot.figure"
]
] |
potetopotatooo/mad-gui | [
"86f789e33deba15f39869bbfcd2e9297a317831f"
] | [
"mad_gui/windows/main.py"
] | [
"\"\"\"This builds a GUI which can\na) load and show IMU data\nb) apply an algorithm for stride segmentation and event detection\nc) be used to manually add/delete/adapt labels for strides and/or activites.\n\nisort:skip_file (Required import order: PySide2, pyqtgraph, mad_gui.*)\n\"\"\"\nimport os\nimport sys\nimp... | [
[
"pandas.read_pickle",
"pandas.DataFrame"
]
] |
quocnh/ConvertAIModel_to_CoreML_DeepLearning | [
"813474c675cdcec6536ed2625fba2148f973897e"
] | [
"loss.py"
] | [
"import numpy as np\nfrom keras import backend as K\n\nsmooth = 1e-5\n\n\ndef precision(y_true, y_pred):\n y_true_f = K.flatten(y_true)\n y_pred_f = K.flatten(y_pred)\n\n true_positives = K.sum(K.round(K.clip(y_true_f * y_pred_f, 0, 1)))\n predicted_positives = K.sum(K.round(K.clip(y_pred_f, 0, 1)))\n\n... | [
[
"numpy.sum"
]
] |
qiujz/gpt2-ml-Finetune-1.0 | [
"a0582e0f15a0f0c077cd0d9c8eb54a01101ca62f"
] | [
"train/train_tpu.py"
] | [
"# Original work Copyright 2018 The Google AI Language Team Authors.\n# Modified work Copyright 2019 Rowan Zellers\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://w... | [
[
"tensorflow.logging.set_verbosity",
"tensorflow.contrib.tpu.TPUConfig",
"tensorflow.gfile.Glob",
"tensorflow.contrib.tpu.TPUEstimator",
"tensorflow.logging.info",
"tensorflow.gfile.MakeDirs",
"tensorflow.contrib.cluster_resolver.TPUClusterResolver",
"tensorflow.app.run"
]
] |
goswamig/amazon-ray | [
"9984ebcdc9d0da0de65363074021e9aff2f82636"
] | [
"rllib/agents/ddpg/tests/test_ddpg.py"
] | [
"import numpy as np\nimport re\nimport unittest\nfrom tempfile import TemporaryDirectory\n\nimport ray\nimport ray.rllib.agents.ddpg as ddpg\nfrom ray.rllib.agents.ddpg.ddpg_torch_policy import ddpg_actor_critic_loss as \\\n loss_torch\nfrom ray.rllib.agents.sac.tests.test_sac import SimpleEnv\nfrom ray.rllib.ex... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.random.choice",
"numpy.minimum",
"numpy.ones",
"numpy.mean",
"numpy.std",
"numpy.transpose",
"numpy.random.random",
"numpy.squeeze"
]
] |
cowlicks/numpy | [
"a79d9d35c1b1582e5e0b8487f5dd414d15944f2c"
] | [
"numpy/lib/index_tricks.py"
] | [
"from __future__ import division, absolute_import, print_function\n\nimport sys\nimport math\n\nimport numpy.core.numeric as _nx\nfrom numpy.core.numeric import (\n asarray, ScalarType, array, alltrue, cumprod, arange\n )\nfrom numpy.core.numerictypes import find_common_type, issubdtype\n\nfrom . import funct... | [
[
"numpy.core.numeric.asarray",
"numpy.core.numerictypes.find_common_type",
"numpy.core.numeric.zeros_like",
"numpy.core.numerictypes.issubdtype",
"numpy.core.numeric.nditer",
"numpy.core.numeric.indices",
"numpy.core.numeric.arange",
"numpy.core.numeric.cumprod",
"numpy.core.num... |
dudtjakdl/OpenNMT-Korean-To-English | [
"32fcdb860906f40f84375ec17a23ae32cb90baa0"
] | [
"models/DecoderRNN.py"
] | [
"import random\n\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\n\nfrom .attention import Attention\n\nif torch.cuda.is_available():\n import torch.cuda as device\nelse:\n import torch as device\n\n\nclass DecoderRNN(nn.Module):... | [
[
"torch.nn.Linear",
"numpy.array",
"torch.cuda.is_available",
"torch.LongTensor",
"torch.nn.Embedding"
]
] |
atomoton/deriver | [
"a507a36753f86278ef9f007bf8a426615828bcbd"
] | [
"src/deriver/fragment_queries.py"
] | [
"# coding=utf-8\n#\n# Alternate implementations of the cascading mate queries in mate.py, to go with the FragmentIndex..\n#\n# code by Andreas Windemuth\n\nfrom typing import NamedTuple\nimport numpy as np\nfrom .util import Vec\n\n\nclass MateQueryParams(NamedTuple):\n \"\"\"Collection of all the parameters a q... | [
[
"numpy.zeros"
]
] |
BrandonCook7/VaccinePredictor | [
"b94b133a91b5fa48e353e08f35bf36857feba6ae"
] | [
"draw_graph.py"
] | [
"import plotly.express as px\nimport plotly.graph_objects as go\nimport pandas as pd\n\ndef graph(x,y, title):\n fig = px.scatter(x=x, y=y)\n fig.update_layout(\n title={\n 'text': title,\n 'x': 0.5,\n 'y': 1,\n 'xanchor': 'center',\n 'yanchor': 't... | [
[
"pandas.DataFrame"
]
] |
s-bl/robot_fingers | [
"11c0c5e1e5bf97fac58707c85276fc929b7259d1"
] | [
"test/test_pybullet_backend.py"
] | [
"#!/usr/bin/env python3\nimport unittest\nimport numpy as np\n\nimport robot_interfaces\nimport robot_fingers.pybullet_drivers\nfrom trifinger_simulation import finger_types_data\n\n\nclass TestPyBulletBackend(unittest.TestCase):\n \"\"\"Test using pyBullet in the robot interface backend via Python.\"\"\"\n\n ... | [
[
"numpy.testing.assert_array_almost_equal"
]
] |
daphne-yang/spotify-visualizations | [
"0932aa467526a1c83755d692473db5737c0dcff3"
] | [
"resources/get_all_top_songs.py"
] | [
"import pandas as pd\nfrom lyrics_function import get_genres, get_missing_genres\nfrom lyrics_function import get_song_lyrics\nimport pandas as pd\nimport os\nimport unicodedata\nfrom tqdm import tqdm\n\nGENIUS_API_TOKEN = '8E4NGMZM8KOloJtNlWp8oMjHJtbuAGa07QF-VgjvGzJkEi7l-uUvLI8A4DvhKnuX'\n\n#======================... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"pandas.concat"
]
] |
daia99/brain-tokyo-workshop | [
"cd470255230afddba2b80d99a9641b682f4d0762"
] | [
"AttentionNeuron/ant_bc_train.py"
] | [
"import os\nimport util\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nfrom solutions.torch_modules import AttentionNeuronLayer\n\n\nACT_DIM = 8\n\n\nclass PIStudent(nn.Module):\n \"\"\"Permutation invariant student policy.\"\"\"\n\n def __init__(self, act_dim, hidden_dim, msg_dim, pos_em_dim):\n... | [
[
"numpy.concatenate",
"torch.device",
"torch.nn.Linear",
"torch.nn.MSELoss",
"numpy.random.RandomState",
"torch.nn.Tanh",
"numpy.load",
"torch.vstack",
"torch.randn"
]
] |
big-data-lab-team/repartition_experiments | [
"71cff469d2036f3e325ea3fc15b9f686c794f8d8"
] | [
"repartition_experiments/scripts_paper/drawer/drawer.py"
] | [
"import matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as patches\nfrom matplotlib.lines import Line2D\n\nimport sys, argparse, json, os\nimport numpy as np\n\nfrom copy import copy\n\nplt.style.use('classic')\n\n\ndef get_chunks(cs, c, R, linewidth):\n \"\"\" Get the list of all r... | [
[
"matplotlib.lines.Line2D",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.style.use",
"matplotlib.pyplot.show",
"matplotlib.pyplot.gca",
"numpy.meshgrid",
"matplotlib.pyplot.xticks"
]
] |
lr4d/dask | [
"e405fa0c767a89ec6a413114be831a96cb388443"
] | [
"dask/array/tests/test_creation.py"
] | [
"import pytest\n\npytest.importorskip(\"numpy\")\n\nimport numpy as np\nimport pytest\nfrom toolz import concat\n\nimport dask\nimport dask.array as da\nfrom dask.array.core import normalize_chunks\nfrom dask.array.utils import assert_eq, same_keys, AxisError\nfrom dask.array.numpy_compat import _numpy_117\n\n\n@py... | [
[
"numpy.meshgrid",
"numpy.tile",
"numpy.fromfunction",
"numpy.random.random",
"numpy.dtype",
"numpy.indices",
"numpy.triu",
"numpy.eye",
"numpy.arange",
"numpy.random.randint",
"numpy.int32",
"numpy.array",
"numpy.pad",
"numpy.random.randn",
"numpy.allclo... |
bflashcp3f/ProcBERT | [
"72afe18ac30825e1756672235e1369aa8837e62a"
] | [
"code/utils/ner.py"
] | [
"\nimport os\nimport glob\nimport torch\n\nfrom utils.utils import *\nfrom chemdataextractor.nlp.tokenize import ChemWordTokenizer\n\nNEW_ENT_TYPE = ['Collection', 'Company', 'Software', 'Info-Type']\n\nWLP_ENT_NAME = ['Amount', 'Reagent', 'Device', 'Time', 'Speed', 'Action', 'Mention', 'Location', 'Numerical',\n ... | [
[
"torch.tensor"
]
] |
jnyjxn/MVSNet | [
"3f6c0c126e6db2e6ac66ab5c631c21224732d7f2"
] | [
"mvsnet/train.py"
] | [
"#!/usr/bin/env python\n\"\"\"\nCopyright 2019, Yao Yao, HKUST.\nTraining script.\n\"\"\"\n\nfrom __future__ import print_function\n\nimport os\nimport time\nimport sys\nimport math\nimport argparse\nfrom random import randint\n\nimport cv2\nimport numpy as np\nimport tensorflow as tf\n\nimport matplotlib.pyplot as... | [
[
"tensorflow.global_variables_initializer",
"tensorflow.concat",
"tensorflow.summary.histogram",
"tensorflow.TensorShape",
"tensorflow.Variable",
"tensorflow.global_variables",
"tensorflow.ConfigProto",
"tensorflow.app.run",
"tensorflow.get_collection",
"tensorflow.summary.m... |
fnrizzi/ElasticShearWaves | [
"b09cde0711562412c6bc24de0d18ad3a972b7289"
] | [
"meshing/fullMeshWithThreeVarGroups.py"
] | [
"#!/usr/bin/env python\n\nimport matplotlib.pyplot as plt\nimport sys, os, time\nimport numpy as np\nfrom numpy import linspace, meshgrid\nfrom matplotlib import cm\nimport collections\nimport random\n\nsys.path.insert(0, './helpers')\n\nfrom full_mesh_utils import *\nfrom utils import *\nfrom write_files import *\... | [
[
"matplotlib.pyplot.spy",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplot"
]
] |
zhiyangxu-umass/allennlp-models | [
"d922f7a8075387ebed1a3e38e588345f706d3f02",
"d922f7a8075387ebed1a3e38e588345f706d3f02"
] | [
"allennlp_models/pair_classification/models/decomposable_attention.py",
"allennlp_models/structured_prediction/models/srl_bert.py"
] | [
"from typing import Dict, Optional, List, Any\n\nfrom overrides import overrides\nimport torch\n\nfrom allennlp.common.checks import check_dimensions_match\nfrom allennlp.data import TextFieldTensors, Vocabulary\nfrom allennlp.models.model import Model\nfrom allennlp.modules import FeedForward\nfrom allennlp.module... | [
[
"torch.cat",
"torch.nn.CrossEntropyLoss",
"torch.nn.functional.softmax"
],
[
"torch.zeros",
"torch.nn.modules.Dropout",
"torch.nn.modules.Linear",
"torch.nn.functional.softmax"
]
] |
apollo2030/CarND-Advanced-Lane-Lines | [
"cb59ee21288cde8a0648310004af3a98263caacc"
] | [
"show_original_and_result.py"
] | [
"import matplotlib.pyplot as plt\nimport cv2\n\ndef show_original_and_result(image, result, cmap_result = 'viridis', result_type='BGR'):\n f, (ax1, ax2) = plt.subplots(1, 2, figsize=(24, 9))\n f.tight_layout()\n img = cv2.cvtColor(image,cv2.COLOR_BGR2RGB)\n\n ax1.imshow(img)\n ax1.set_title('Original... | [
[
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.subplots"
]
] |
EthanRosenthal/skits | [
"66ba312da560e7c6b1784e7b93c1d28571e3659d"
] | [
"tests/test_preprocessing.py"
] | [
"import numpy as np\nimport pytest\n\nfrom skits.preprocessing import (\n ReversibleImputer,\n DifferenceTransformer,\n LogTransformer,\n HorizonTransformer,\n)\n\n\nclass TestReversibleImputer:\n def test_transform(self):\n ri = ReversibleImputer()\n X = np.array([1, 1, 100, 0, 2], dty... | [
[
"numpy.array",
"numpy.log",
"numpy.allclose",
"numpy.arange",
"numpy.random.random"
]
] |
tjjlemaire/IntroNE | [
"36316b5b69c8e554b451e589d2af4f295c7a2f72"
] | [
"sigutils.py"
] | [
"# -*- coding: utf-8 -*-\n# @Author: Theo Lemaire\n# @Date: 2022-02-11 14:35:21\n# @Last Modified by: Theo Lemaire\n# @Last Modified time: 2022-05-11 14:12:19\n\nfrom turtle import back\nimport numpy as np\nimport random\nfrom scipy.signal import welch, butter, filtfilt, find_peaks\nfrom scipy.ndimage.filters i... | [
[
"scipy.signal.filtfilt",
"numpy.where",
"sklearn.preprocessing.MinMaxScaler",
"numpy.dtype",
"matplotlib.pyplot.subplots",
"numpy.arange",
"sklearn.decomposition.PCA",
"numpy.empty_like",
"numpy.array",
"numpy.round",
"scipy.ndimage.filters.maximum_filter",
"numpy.f... |
Hualin-Peng/D3DShot | [
"a506e1b3ab4effb49af5cc171fc87822a48b3ba9"
] | [
"d3dshot/capture_outputs/numpy_capture_output.py"
] | [
"import ctypes\n\nimport numpy as np\n\nfrom PIL import Image\n\nfrom d3dshot.capture_output import CaptureOutput\n\n\nclass NumpyCaptureOutput(CaptureOutput):\n def __init__(self):\n pass\n\n def process(self, pointer, pitch, size, width, height, region, rotation):\n image = np.empty((size,), d... | [
[
"numpy.rot90",
"numpy.stack",
"numpy.empty",
"numpy.reshape"
]
] |
chen-yuxuan/flair | [
"480d2c9afd66ab8d3bf40a676917e84dba3c4cee"
] | [
"flair/__init__.py"
] | [
"import logging.config\nimport os\nfrom pathlib import Path\n\nimport torch\nfrom transformers import set_seed as hf_set_seed\n\n# global variable: cache_root\ncache_root = Path(os.getenv(\"FLAIR_CACHE_ROOT\", Path(Path.home(), \".flair\")))\n\n# global variable: device\nif torch.cuda.is_available():\n device = ... | [
[
"torch.device",
"torch.cuda.is_available"
]
] |
jireh-father/tacotron2 | [
"f9f5ddf867d2381f4dbf286766bb346fbaceeccf"
] | [
"web_app.py"
] | [
"import sys\nsys.path.append('waveglow/')\n# import glow\nfrom flask import Flask, render_template, redirect, url_for, request, send_from_directory\nimport numpy as np\nimport os\nfrom pydub import AudioSegment\nfrom hparams import create_hparams\nfrom train import load_model\nimport torch\nfrom denoiser import Den... | [
[
"torch.no_grad",
"torch.from_numpy",
"scipy.io.wavfile.write",
"torch.load"
]
] |
MauroPfister/UltimateLabeling | [
"4c1e7b74fc7637118387ea8f4f834bc1c0dafadb"
] | [
"ultimatelabeling/siamMask/utils/anchors.py"
] | [
"# --------------------------------------------------------\n# SiamMask\n# Licensed under The MIT License\n# Written by Qiang Wang (wangqiang2015 at ia.ac.cn)\n# --------------------------------------------------------\nimport numpy as np\nimport math\nfrom .bbox_helper import center2corner, corner2center\n\n\nclas... | [
[
"numpy.array",
"numpy.stack",
"numpy.arange",
"numpy.zeros"
]
] |
camillescott/fuckitall | [
"a6738ec8681a5f6791aec1a9b0aa1de935bf52e9"
] | [
"ope/io/maf.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# (c) Camille Scott, 2019\n# File : maf.py\n# License: MIT\n# Author : Camille Scott <camille.scott.w@gmail.com>\n# Date : 11.12.2019\n\nimport pandas as pd\nimport numpy as np\n\nfrom .base import ChunkParser, next_or_raise, convert_dtypes\n\n\nclass MafParser(... | [
[
"pandas.DataFrame",
"numpy.log"
]
] |
varunagrawal/vision | [
"dea1afbf5e69afb33d2501f5a129fc1085a474ce"
] | [
"torchvision/ops/roi_align.py"
] | [
"import torch\nfrom torch import nn\n\nfrom torch.autograd import Function\nfrom torch.autograd.function import once_differentiable\n\nfrom torch.nn.modules.utils import _pair\n\nfrom torchvision.extension import _lazy_import\nfrom ._utils import convert_boxes_to_roi_format\n\n\nclass _RoIAlignFunction(Function):\n... | [
[
"torch.nn.modules.utils._pair"
]
] |
DanielShrimpton/opensimplex | [
"a057c788906e78a6a2740c6378d9a15122a95be5"
] | [
"tests/benchmark_opensimplex.py"
] | [
"\nimport numpy as np\nimport opensimplex as simplex\n\ndefault_num = 100000\n\n\nclass Benchmark:\n def __init__(self):\n # Randomized coordinate arrays that will supply the noise funcs.\n self.x = np.random.random_sample(default_num)\n self.y = np.random.random_sample(default_num)\n ... | [
[
"numpy.random.random_sample"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.