repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
hanskrupakar/fastestimator
[ "1c3fe89ad8b012991b524a6c48f328b2a80dc9f6" ]
[ "fastestimator/backend/get_image_dims.py" ]
[ "# Copyright 2019 The FastEstimator 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 r...
[ [ "tensorflow.is_tensor" ] ]
Pakirisu/ArknightsAutoHelper
[ "8b136c82794cfe9f364788d9c92f1e4c5b38c6cb", "8b136c82794cfe9f364788d9c92f1e4c5b38c6cb" ]
[ "Arknights/base.py", "imgreco/common.py" ]
[ "import logging.config\nimport os\nfrom collections import OrderedDict\nfrom random import randint, uniform, gauss\nfrom time import sleep, monotonic\n\nimport numpy as np\nfrom PIL import Image\n\n# from config import *\nimport config\nimport imgreco\nimport penguin_stats.loader\nimport penguin_stats.reporter\nimp...
[ [ "numpy.asarray" ], [ "numpy.array", "numpy.argmax", "numpy.asarray" ] ]
csho33/bacteria-ID
[ "3c00a712a6dbad9aefa19ac878a1e6db20590ca9" ]
[ "resnet.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\n\nclass ResidualBlock(nn.Module):\n def __init__(self, in_channels, out_channels, stride=1):\n super(ResidualBlock, self).__init__()\n\n # Layers\n self.conv1 = nn.Conv1d(in_channels...
[ [ "torch.nn.Linear", "torch.rand", "torch.nn.SELU", "torch.nn.Conv1d", "torch.nn.Sequential", "torch.nn.Sigmoid", "torch.nn.LeakyReLU", "torch.nn.Tanh", "torch.nn.ReLU", "torch.nn.BatchNorm1d", "torch.nn.Softplus", "torch.nn.functional.relu", "torch.nn.ELU" ] ]
zoulejiu/captcha_trainer
[ "3a4b79e7b00553c9cf78cc3720e6a50a1886a05a" ]
[ "trains.py" ]
[ "#!/usr/bin/env python3\n# -*- coding:utf-8 -*-\n# Author: kerlomz <kerlomz@gmail.com>\nimport tensorflow as tf\nimport core\nimport utils\nimport utils.data\nimport validation\nfrom config import *\nfrom tf_graph_util import convert_variables_to_constants\nfrom PIL import ImageFile\n\nImageFile.LOAD_TRUNCATED_IMAG...
[ [ "tensorflow.io.gfile.GFile", "tensorflow.compat.v1.summary.FileWriter", "tensorflow.compat.v1.logging.info", "tensorflow.train.latest_checkpoint", "tensorflow.Graph", "tensorflow.Session", "tensorflow.logging.info", "tensorflow.keras.backend.set_session", "tensorflow.train.get_...
lpj0822/image_point_cloud_det
[ "7b20e2f42f3f2ff4881485da58ad188a1f0d0e0f", "7b20e2f42f3f2ff4881485da58ad188a1f0d0e0f" ]
[ "easyai/tools/model_net_show.py", "easyai/model/base_block/utility/filter_response_normalization.py" ]
[ "import os\nimport sys\nsys.path.insert(0, os.getcwd() + \"/..\")\nimport torch\nfrom easyai.model.backbone.utility.backbone_factory import BackboneFactory\nfrom easyai.model.utility.model_factory import ModelFactory\nfrom easyai.torch_utility.torch_onnx.model_show import ModelShow\nfrom easyai.helper.arguments_par...
[ [ "torch.randn" ], [ "torch.max", "torch.nn.init.ones_", "torch.ones", "torch.abs", "torch.nn.init.zeros_", "torch.Tensor", "torch.pow" ] ]
CasperKristiansson/Group-Project-II1302
[ "2878ef514f0c114e5b6e7f4130264bbbf528bc0a" ]
[ "Backend/Machine Learning/Library/raw_data.py" ]
[ "\"\"\"\"\"\"\n__author__ = \"Casper Kristiansson\"\n__copyright__ = \"WeatherBrain\"\n\n__maintainer__ = \"Casper Kristiansson\"\n__email__ = \"casperkr@kth.se\"\n__status__ = \"Development\"\n\nimport pandas\n\n\ndef load_temperature_raw():\n \"\"\"This methid loads the raw temperature data from\n text file...
[ [ "pandas.to_datetime", "pandas.DataFrame", "pandas.concat" ] ]
cv-small-snails/Text-Recognition-Pytorch
[ "cdb3b201faf0a3cec6ef075b8c4fc5f567798045" ]
[ "text.recognition.pytorch/models/backbones/resnet.py" ]
[ "from typing import Type, Any, Callable, Union, List, Optional\n\nimport torch\nimport torch.nn as nn\nfrom torch import Tensor\n\nfrom torchvision.models.utils import load_state_dict_from_url\n\n\n__all__ = [\n \"ResNet\",\n \"resnet18\",\n \"resnet34\",\n \"resnet50\",\n \"resnet101\",\n \"resne...
[ [ "torch.nn.Linear", "torch.flatten", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.init.constant_", "torch.nn.init.kaiming_normal_", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d" ] ]
Sutthipong/thai-ner
[ "08576d563081f53662a4bd1e82354d3d386bb464" ]
[ "old/12092018/train2.py" ]
[ "# -*- coding: utf-8 -*-\n# เรียกใช้งานโมดูล\nfile_name=\"data\"\nimport codecs\nfrom pythainlp.tokenize import word_tokenize\n#import deepcut\nfrom pythainlp.tag import pos_tag\nfrom nltk.tokenize import RegexpTokenizer\nimport glob\nimport nltk\nimport re\n# thai cut\nthaicut=\"newmm\"\nfrom sklearn_crfsuite impo...
[ [ "sklearn.model_selection.train_test_split", "sklearn.model_selection.cross_validate", "sklearn.metrics.make_scorer" ] ]
elnazsn1988/Trading-Gym
[ "d4b36a6a50fa295ff8401b45786cf62cc89189c7" ]
[ "tests/gens/test_random.py" ]
[ "import numpy as np\nfrom tgym.gens import AR1, RandomWalk\n\n\ndef test_random_walk():\n rw = RandomWalk(ba_spread=0.1)\n val = rw.next()\n assert np.isclose(val[1] - val[0], 0.1)\n\n\ndef test_ar1():\n rw = AR1(a=0.1, ba_spread=0.1)\n val = rw.next()\n assert np.isclose(val[1] - val[0], 0.1)\n ...
[ [ "numpy.std", "numpy.isclose", "numpy.mean" ] ]
mgh17/tierpsy-tracker
[ "a18c06aa80a5fb22fd51563d82c639b520742777", "a18c06aa80a5fb22fd51563d82c639b520742777" ]
[ "tierpsy/analysis/ske_create/segWormPython/cleanWorm.py", "tierpsy/features/open_worm_analysis_toolbox/features/path_features.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri May 22 18:10:04 2015\n\n@author: ajaver\n\"\"\"\n\nfrom .cython_files.cleanWorm_cython import extremaPeaksCircDist, removeSmallSegments, cleanContour\nfrom .cython_files.circCurvature import circCurvature\n\nimport numpy as np\n\n\ndef circCurvature_old(points, edgeL...
[ [ "numpy.ceil", "numpy.array", "numpy.zeros", "numpy.lib.pad", "numpy.round", "numpy.sum", "numpy.roll", "numpy.diff", "numpy.arctan2", "numpy.linspace", "numpy.vstack", "numpy.convolve" ], [ "numpy.full", "numpy.isnan", "numpy.errstate", "numpy.ze...
walogo/Pythonista-scripts
[ "760451a0cdbe5dd76008a4e616d74191385bbd8b" ]
[ "Pythonista/KB_shortcuts/functions_eval/function.py" ]
[ "from re import search, findall\nfrom numpy import arange\nfrom matplotlib import pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom matplotlib import cm\nfrom crunch import Crunch\nfrom io import BytesIO\nfrom ui import Image\nfrom numpy import ma\nfrom math import *\n\n\ndef create_ranges(ranges):\n\tad...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.step", "numpy.arange", "matplotlib.pyplot.figure" ] ]
YeongHyeon/Super-Resolution_CNN
[ "1feb77eba7dbd59974ae948bf3e50f791fc0bfa2" ]
[ "run.py" ]
[ "import os, argparse\nos.environ[\"CUDA_VISIBLE_DEVICES\"]=\"0\"\n\nimport tensorflow as tf\n\nimport source.neuralnet as nn\nimport source.datamanager as dman\nimport source.tf_process as tfp\nimport source.stamper as stamper\nstamper.print_stamp()\n\ndef main():\n\n srnet = nn.SRNET()\n\n dataset = dman.Dat...
[ [ "tensorflow.compat.v1.train.Saver", "tensorflow.compat.v1.global_variables_initializer", "tensorflow.compat.v1.InteractiveSession" ] ]
ybai62868/CornerNet-Lite
[ "cad0fb248be1da38451042ff6c5b9979e67a0729" ]
[ "core/models/CornerNet_Squeeze.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom .py_utils import TopPool, BottomPool, LeftPool, RightPool # corner pooling\n\nfrom .py_utils.utils import convolution, corner_pool, residual\nfrom .py_utils.losses import CornerNet_Loss\nfrom .py_utils.modules import hg_module, hg, hg_net\n\nclass fire_module(nn.Module):...
[ [ "torch.nn.init.constant_", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.nn.ConvTranspose2d", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
adeckert23/soccer-proj
[ "4f86993b98c6a1153bdc1c57cc8d04053302967d" ]
[ "src/radar1_class.py" ]
[ "import numpy as np\nimport pylab as pl\n\nclass Radar1(object):\n def __init__(self, figure, title, labels, rect=None):\n if rect is None:\n rect = [0.05, 0.05, .85, .85]\n\n self.n = len(title)\n self.angles = np.arange(0, 360, 360.0/self.n)\n\n self.axes = [figure.add_ax...
[ [ "numpy.deg2rad", "numpy.arange" ] ]
ushita37/shortest_path
[ "a04eea43480809f528fa4b8d5878b23f11e58c1b" ]
[ "early_works/yamanote_inner_track.py" ]
[ "# © 2021 ushita37\n\nimport numpy as np\n# import pandas as pd\n\n# ekimei = pd.read_csv('stationName.csv', header=None, encoding='Shift-JIS').values.tolist()\n# ekimeiList = ekimei[0]\n\n# pandasを使うと正常に動作しないことがあるので、上記の4・6・7行目をコメントアウトし、以下の10・11行目を実行している\nF = open('stationName.csv')\nekimeiList = F.readline().repla...
[ [ "numpy.loadtxt" ] ]
ml-boringtao/rnn
[ "d7c7fd3ced77d7db061e4077a3532f74d2788886" ]
[ "training/helpers/callbacks.py" ]
[ "from keras.callbacks import BaseLogger\nimport matplotlib.pyplot as plt\nimport numpy as np \nimport json\nimport os\nfrom .utils import Utils\n\nclass TrainingMonitor(BaseLogger):\n def __init__(self, figPath, jsonPath=None, startAt=0):\n super(TrainingMonitor, self).__init__()\n self.figPath = f...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.legend", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.pyplot.style.use" ] ]
sdss/mangaSampleDB
[ "36c0b2113a9c0a163d47c844656af350d80310b1" ]
[ "python/mangaSampleDB/utils/catalogue.py" ]
[ "#!/usr/bin/env python3\n# encoding: utf-8\n\"\"\"\n\ncatalogue.py\n\nCreated by José Sánchez-Gallego on 18 Feb 2016.\nLicensed under a 3-clause BSD license.\n\nRevision history:\n 18 Feb 2016 J. Sánchez-Gallego\n Initial version\n\n\"\"\"\n\nfrom __future__ import division\nfrom __future__ import print_fun...
[ [ "numpy.where" ] ]
kevinkevin556/STASD
[ "db88c4302c6ddb0dc4b4d291f72d09dd4c9db38e" ]
[ "modules/ptt_region_crawler.py" ]
[ "from bs4 import BeautifulSoup\nimport pandas as pd\nimport requests\nimport re\nimport time\n\ndef get_post_num(region, date, verbose=True, init_index=None, return_index=False):\n\tdate_timestamp = pd.Timestamp(date)\n\tmax_index = get_max_index(region)\n\n\tif init_index is None:\n\t\ti = max_index\n\t\tcurrent_y...
[ [ "pandas.Timestamp", "pandas.Timestamp.today" ] ]
martsec/arcitectural_elements_identifier
[ "87607e87f714443c5aa37c96896b76a4f6f424d4" ]
[ "arch_elements/etl/transform.py" ]
[ "from sklearn.preprocessing import OneHotEncoder\r\nfrom sklearn.model_selection import train_test_split\r\nimport tensorflow as tf\r\nfrom tensorflow.keras.preprocessing.image import ImageDataGenerator\r\nimport numpy as np\r\nfrom collections.abc import Callable\r\n\r\nclass OneHot:\r\n def __init__(self):\r\n...
[ [ "numpy.concatenate", "numpy.array", "tensorflow.keras.preprocessing.image.ImageDataGenerator", "sklearn.model_selection.train_test_split", "sklearn.preprocessing.OneHotEncoder", "numpy.expand_dims" ] ]
we3lab/coals_controls
[ "4a9a368123d292b300d6bd4c978230c0552838fd" ]
[ "Code/function_dictionary_library/interaction_term_variable_creation.py" ]
[ "import numpy as np\n\n\ndef interaction_term_variable_creation(X, variable_1, variable_2):\n i = 0\n width_variable_1 = np.shape(variable_1)\n if len(width_variable_1) == 1:\n width_variable_1 = width_variable_1 + (1,)\n width_variable_1 = width_variable_1[1]\n width_variable_2 = np.shape(var...
[ [ "numpy.column_stack", "numpy.shape" ] ]
davedavedavid/plato
[ "097e26ef6de5d1fa1392ebe01cfc4576e5dd7ae9" ]
[ "plato/utils/unary_encoding.py" ]
[ "\"\"\"Implements unary encoding, used by Google's RAPPOR, as the local differential privacy mechanism.\n\nReferences:\n\nWang, et al. \"Optimizing Locally Differentially Private Protocols,\" ATC USENIX 2017.\n\nErlingsson, et al. \"RAPPOR: Randomized Aggregatable Privacy-Preserving Ordinal Response,\"\nACM CCS 201...
[ [ "numpy.where", "numpy.random.binomial", "numpy.random.choice", "numpy.zeros" ] ]
Praveen76/Wav2Keyword
[ "40c3bdd92c2ed43e421a4756426dbfd6158e8b94" ]
[ "recognize.py" ]
[ "import torch\nimport argparse\nimport soundfile as sf\nimport torch.nn.functional as F\nimport itertools as it\nfrom fairseq import utils\nfrom fairseq.models import BaseFairseqModel\nfrom examples.speech_recognition.w2l_decoder import W2lViterbiDecoder\nfrom fairseq.data import Dictionary\nfrom fairseq.models.wav...
[ [ "torch.nn.functional.layer_norm", "torch.IntTensor", "torch.no_grad", "torch.FloatTensor", "torch.from_numpy", "torch.load" ] ]
Jhilbertxtu/JDComments_Analyze
[ "9a93c7cfc572509fce5e0f82702d8d55d029ef8f" ]
[ "svm.py" ]
[ "import pandas as pd\nfrom sklearn.decomposition import PCA\nfrom sklearn import svm\n'''\n10条数据,但模型是100维的,所以复制够100,只取前10\n第1次 c=2 完全正确4,完全错误2,模糊4\n[1. 0. 0. 1. 1. 0. 0. 0. 1. 1. 1. 0. 0. 1. 1. 0. 0. 0. 1. 1. 1. 0. 0. 1.\n 1. 0. 0. 0. 1. 1. 1. 0. 0. 1. 1. 0. 0. 0. 1. 1. 1. 0. 0. 1. 1. 0. 0. 0.\n 1. 1. 1. 0. 0. 1. 1...
[ [ "pandas.read_csv", "sklearn.decomposition.PCA", "sklearn.svm.SVC" ] ]
USF-Seismology/mtuq
[ "92b863a53c9af909b2153c5c671741e020964384" ]
[ "mtuq/graphics/attrs.py" ]
[ "import os\n\nfrom matplotlib import pyplot\nfrom os.path import join\n\nfrom mtuq.util import warn\n\n\ndef plot_time_shifts(*args, **kwargs):\n \"\"\" Creates \"spider plots\" showing how time shifts vary geographically\n\n Within the specified directory, a separate PNG figure will be created for \n each...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.pyplot.scatter" ] ]
salil91/GASP-python
[ "26f84f03458765ebc07f5d2286e8a250b7fad898" ]
[ "gasp/population.py" ]
[ "# coding: utf-8\n# Copyright(c) Henniggroup.\n# Distributed under the terms of the MIT License.\n\nfrom __future__ import division, unicode_literals, print_function\n\n\"\"\"\nPopulation module:\n\nThis module contains classes used to hold the population of organisms.\n\n1. InitialPopulation: represents the initia...
[ [ "numpy.delete", "numpy.subtract", "numpy.linalg.norm", "scipy.spatial.qhull.ConvexHull" ] ]
CptPirx/opendr_internal
[ "9204f254c4a32ce4298dd4b95cabaab8f60fd3c7" ]
[ "src/opendr/perception/multimodal_human_centric/rgbd_hand_gesture_learner/rgbd_hand_gesture_learner.py" ]
[ "# Copyright 2020-2021 OpenDR European Project\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 applicab...
[ [ "torch.device", "torch.utils.tensorboard.SummaryWriter", "torch.no_grad", "numpy.transpose", "torch.utils.data.DataLoader", "torch.nn.CrossEntropyLoss", "numpy.expand_dims" ] ]
tneumann/cgtools
[ "8f77b6a4642fe79ac85b8449ebd3f72ea0e56032" ]
[ "tests/test_indexing.py" ]
[ "import numpy as np\nimport numpy.testing as npt\nfrom cgtools.indexing import valid_indices\n\n\ndef test_valid_indices_randomized_tests():\n for axes in range(1, 10):\n shape = np.random.randint(1, 10, axes)\n a = np.empty(shape)\n indices = np.random.randint(-5, 15, (500, axes))\n ...
[ [ "numpy.random.randint", "numpy.empty" ] ]
Alicegaz/torchok
[ "7b8f95df466a25b1ad8ee93bed1a3c7516440cf4" ]
[ "src/optim/optimizers/lamb.py" ]
[ "\"\"\" PyTorch Lamb optimizer w/ behaviour similar to NVIDIA FusedLamb\n\nThis optimizer code was adapted from the following (starting with latest)\n* https://github.com/HabanaAI/Model-References/blob/2b435114fe8e31f159b1d3063b8280ae37af7423/PyTorch/nlp/bert/pretraining/lamb.py\n* https://github.com/NVIDIA/DeepLea...
[ [ "torch.zeros", "torch.sqrt", "torch.no_grad", "torch.enable_grad", "torch.minimum", "torch.tensor", "torch.zeros_like", "torch.where" ] ]
Othinus099/int
[ "44d83c5d37f91957666ce65120543608a8a7f6a2" ]
[ "projects/UniDet/unidet/modeling/roi_heads/multi_dataset_fast_rcnn.py" ]
[ "import logging\r\nimport math\r\nfrom typing import Dict, Union\r\nimport torch\r\nfrom fvcore.nn import giou_loss, smooth_l1_loss\r\nfrom torch import nn\r\nfrom torch.nn import functional as F\r\n\r\nfrom detectron2.config import configurable\r\nfrom detectron2.layers import Linear, ShapeSpec, batched_nms, cat, ...
[ [ "torch.nn.Linear", "torch.nn.ModuleList", "torch.nn.init.constant_", "torch.nn.init.normal_", "torch.flatten" ] ]
zack28/TakenMind-Internship
[ "7fb7c1c0b255ee233f18fd9ab4fa76a9b2c992d7" ]
[ "Data Manipulation with Pandas/ranking_sorting.py" ]
[ "import numpy as np\r\nimport pandas as pd\r\nfrom pandas import Series,DataFrame\r\nfrom numpy.random import randn\r\n\r\ns1=Series([500,1000,1500],index=['a','c','b'])\r\nprint(s1)\r\n\r\n#sorting by index\r\nprint(s1.sort_index())\r\n\r\n#sort by values\r\nprint(s1.sort_values())\r\n\r\n#ranking of series\r\npri...
[ [ "numpy.random.randn", "pandas.Series" ] ]
antsfamily/pyopt
[ "e1d240321f954219daa44c5c7f73f6ad3f0e6427" ]
[ "pyopt/utils/tools.py" ]
[ "from __future__ import division, print_function, absolute_import\nimport numpy as np\nfrom scipy import signal\n\n\ndef cshift(x, L):\n\n N = np.size(x)\n\n if np.size(x, 0) > 1:\n raise ValueError(\"Input x must be 1-d vector!\")\n\n L = int(L)\n\n y = np.zeros(x.shape)\n print(x.shape, y.sh...
[ [ "numpy.array", "numpy.zeros", "numpy.size", "scipy.signal.convolve2d", "numpy.floor" ] ]
dhawalaashay/Image_Classifier
[ "c0f38069e11475c504d846edb1e22b420dbd4850" ]
[ "train_model.py" ]
[ "# import Python Modules /dependencies\nimport time\nimport torch\nimport argparse\nimport matplotlib\nimport numpy as np\nimport torch.nn.functional as F\nimport matplotlib.pyplot as plt\n\nfrom PIL import Image\nfrom torch import nn, optim\nfrom collections import OrderedDict\nfrom workspace_utils import active_s...
[ [ "torch.nn.NLLLoss", "torch.device", "torch.nn.Dropout", "torch.nn.Linear", "torch.nn.LogSoftmax", "torch.no_grad", "torch.nn.ReLU", "torch.exp" ] ]
AIllIll/hyperface-new
[ "b62fef1c8733d53d66e674b23cc3e44c7b13466c" ]
[ "scripts/extensions/imgviewer_extension.py" ]
[ "# -*- coding: utf-8 -*-\n\nimport multiprocessing\nimport numpy as np\n\nfrom chainer import variable\nfrom chainer.training import extension\n\nfrom . import imgviewer\n\n# logging\nfrom logging import getLogger, NullHandler, INFO\nlogger = getLogger(__name__)\nlogger.addHandler(NullHandler())\n# logging for imgv...
[ [ "numpy.transpose" ] ]
asvspoof/ASVspoof2019_system
[ "b85d256d564e93806c4cadc2257863b4f1b0f588" ]
[ "source-code/modelsummary.py" ]
[ "from torchsummary import summary\nimport torch\n\nfrom ResNet import DKU_ResNet\n\nif __name__ == '__main__':\n\n use_cuda = torch.cuda.is_available()\n device = torch.device(\"cuda\" if use_cuda else \"cpu\")\n print(\"Use\", device)\n model = DKU_ResNet(num_classes=2).to(device)\n summary(model,(1...
[ [ "torch.device", "torch.cuda.is_available" ] ]
LongmaoTeamTf/deep_recommenders
[ "168dabe4ef3a38cc582d019766cf3de576bc8af1" ]
[ "deep_recommenders/keras/models/ranking/fm.py" ]
[ "#!/usr/bin/python3\n# -*- coding: utf-8 -*-\n\nimport tensorflow as tf\n\n\n@tf.keras.utils.register_keras_serializable()\nclass FM(tf.keras.layers.Layer):\n \"\"\" Factorization Machine \"\"\"\n\n def __init__(self, **kwargs):\n super(FM, self).__init__(**kwargs)\n\n def build(self, input_shape):\...
[ [ "tensorflow.keras.layers.DenseFeatures", "tensorflow.keras.layers.Dense", "tensorflow.reduce_sum", "tensorflow.stack", "tensorflow.pow", "tensorflow.nn.sigmoid", "tensorflow.keras.utils.register_keras_serializable" ] ]
luiscruz/physalia
[ "364951d94e02b60092785db46a8c7a7299ffe2a4" ]
[ "physalia/fixtures/models.py" ]
[ "\"\"\"Fixtures for models module.\"\"\"\n\nfrom physalia.models import Measurement\nimport numpy\n\n\ndef create_measurement(use_case='login',\n app_pkg='com.package',\n duration=2,\n energy_consumption=30):\n \"\"\"Fake data for measurement.\"\"...
[ [ "numpy.random.seed", "numpy.random.normal" ] ]
gpvi/w2_AI
[ "fc6742c09237f7502585916a4d96a494996cd2ec" ]
[ "iris_KNN.py" ]
[ "from sklearn.datasets import load_iris\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.model_selection import GridSearchCV\nfrom sklearn.datasets import fetch_20newsgroups\nfrom sklearn.feature...
[ [ "sklearn.model_selection.train_test_split", "sklearn.neighbors.KNeighborsClassifier", "sklearn.datasets.load_iris", "sklearn.preprocessing.StandardScaler" ] ]
grechaw/ray_lightning
[ "2390e9c75b140af03811c8360f0ad63c4afebe95" ]
[ "ray_lightning/util.py" ]
[ "import io\nfrom typing import Callable\n\nimport torch\nfrom pytorch_lightning.accelerators import GPUAccelerator\nfrom pytorch_lightning import Trainer, LightningModule\n\nimport ray\n\n\nclass DelayedGPUAccelerator(GPUAccelerator):\n \"\"\"Same as GPUAccelerator, but doesn't do any CUDA setup.\n\n This all...
[ [ "torch.save", "torch.cuda.is_available" ] ]
songlab-cal/contact-geometry
[ "81cb7e56af7bccaf5b7f6dde52d9f2adbe89e8bd" ]
[ "self_contacts/utils.py" ]
[ "import numpy as np\nimport pickle as pkl\n\nfrom functional_groups import SMARTS_ATOM_MAP\n\nDATA_FOLDER = 'raw_contacts'\nVDMS_FOLDER = 'contacts'\nIFG_REPS_FOLDER = 'ifg_reps'\n\nAMINO_ACIDS = {'ALA', 'ARG', 'ASN', 'ASP', 'CYS', 'GLU', 'GLN', 'GLY', 'HIS', 'ILE', 'LEU',\n 'LYS', 'MET',...
[ [ "numpy.linalg.svd", "numpy.array", "numpy.linalg.det", "numpy.mean" ] ]
dmunozc/finpy
[ "93a0ad41f6f7938b5147398494054eb57c6645b0" ]
[ "finmarketpy_examples/events_examples.py" ]
[ "__author__ = 'saeedamen'\n\n# for logging\nimport pandas\nimport pytz\n\nfrom chartpy import Chart, Style\n\nfrom findatapy.market import Market, MarketDataGenerator, MarketDataRequest\nfrom findatapy.timeseries import Calculations\nfrom findatapy.util import LoggerManager\n\nfrom finmarketpy.economics import Even...
[ [ "pandas.DataFrame" ] ]
Zensho/CS91-Proj
[ "876d5e977800af42382f8c6398eb62ccff202497" ]
[ "DL_Models/tf_models/Xception/Xception.py" ]
[ "import tensorflow as tf\nfrom config import config\nfrom utils.utils import *\nimport logging\nfrom DL_Models.tf_models.ConvNet import ConvNet\n\n\nclass XCEPTION(ConvNet):\n \"\"\"\n The Xception architecture. This is inspired by Xception paper, which describes how 'extreme' convolutions can be represented\...
[ [ "tensorflow.keras.layers.Activation", "tensorflow.keras.layers.BatchNormalization", "tensorflow.keras.layers.SeparableConv1D" ] ]
hellotrik/trik
[ "142e0ef667802a5366e7ebca62e00633e2aa3813" ]
[ "examples/2x16x16x16x3_multi_classification.py" ]
[ "# -*- coding:utf-8 -*-\r\nimport numpy as np\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport trik\r\n# 每类随机生成点的个数。\r\npoints_sum = 100\r\n# 调用paradox的数据生成器生成三螺旋的3类数据。\r\ndata = trik.yu.helical_data(points_sum, 3, max_radius=2*np.pi)\r\n# 组合数据。\r\nc_x = data[0][0] + data[1][0] + data[2][0]\r\nc_y...
[ [ "numpy.max", "numpy.array", "matplotlib.pyplot.contourf", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.plot", "numpy.min", "matplotlib.pyplot.show" ] ]
XDUNZC/mmdetection_coco
[ "366777bdd40cd5d92a1e165bf20e6e062913f875" ]
[ "mmdet/models/detectors/test_mixins.py" ]
[ "import logging\nimport sys\n\nimport torch\n\nfrom mmdet.core import (bbox2roi, bbox_mapping, merge_aug_bboxes,\n merge_aug_masks, merge_aug_proposals, multiclass_nms)\n\nlogger = logging.getLogger(__name__)\n\nif sys.version_info >= (3, 7):\n from mmdet.utils.contextmanagers import compl...
[ [ "torch.from_numpy" ] ]
dsctt/PettingZoo
[ "b839259e961798cfc23b6f82c6ba0898b55cda60" ]
[ "pettingzoo/test/render_test.py" ]
[ "import random\n\nimport numpy as np\n\n\ndef collect_render_results(env, mode):\n results = []\n\n env.reset()\n for i in range(5):\n if i > 0:\n for agent in env.agent_iter(env.num_agents // 2 + 1):\n obs, reward, done, info = env.last()\n if done:\n ...
[ [ "numpy.flatnonzero" ] ]
Vatican-X-Formers/tensor2tensor
[ "103baef53d539a90f5b478ac590b9b1d79ecb756" ]
[ "tensor2tensor/data_generators/imagenet.py" ]
[ "# coding=utf-8\n# Copyright 2020 The Tensor2Tensor Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir...
[ [ "tensorflow.compat.v1.equal", "tensorflow.compat.v1.shape", "tensorflow.compat.v1.reduce_sum", "tensorflow.compat.v1.to_float", "tensorflow.compat.v1.constant", "tensorflow.compat.v1.reshape", "tensorflow.compat.v1.name_scope", "tensorflow.compat.v1.greater_equal", "tensorflow....
mmyers1/hatchet
[ "bed9127b479f7a1bed32392380777d426e1dfe62" ]
[ "src/hatchet/utils/cluster_bins.py" ]
[ "#!/usr/bin/python3\n\nimport os, shutil\nimport sys\nimport math\nimport copy\nimport numpy as np\n\nfrom .ArgParsing import parse_cluster_bins_args\nfrom . import Supporting as sp\n\n\ndef main(args=None):\n sp.log(msg=\"# Parsing and checking input arguments\\n\", level=\"STEP\")\n args = parse_cluster_bin...
[ [ "numpy.random.seed", "numpy.array", "numpy.argmin" ] ]
ASGuard-UCI/ld-metric
[ "87a52ca8cf11d2b8675d7504f9b4ac073addd984" ]
[ "scnn/model.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision.models as models\n\n\nclass SCNN(nn.Module):\n def __init__(\n self,\n input_size,\n ms_ks=9,\n pretrained=True,\n ):\n \"\"\"\n Argument\n ms_ks: kern...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.ModuleList", "torch.nn.Softmax", "torch.nn.Sigmoid", "torch.nn.AvgPool2d", "torch.nn.functional.interpolate", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.tensor", "torch.nn.BCELoss", "torch.nn.Drop...
mattiasu96/recsys-challenge-2021-twitter
[ "80b78050739a93165cbaaf256bd13932582a8930" ]
[ "train_NN_parametric_class.py" ]
[ "from sklearn.metrics import average_precision_score, log_loss\nfrom sklearn.model_selection import train_test_split\nimport dask.dataframe as dd\nimport os, sys\nimport time\nimport RootPath\nfrom Scripts.utilities import start_cluster\nimport tensorflow as tf\nfrom tensorflow.keras.models import Sequential\nfrom ...
[ [ "tensorflow.keras.metrics.AUC", "numpy.save", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Dropout", "numpy.finfo", "sklearn.metrics.average_precision_score", "sklearn.metrics.log_loss", "tensorflow.keras.layers.experimental.preprocessing.Normalization", "tensorflo...
MichielCottaar/mcot.core
[ "de00c15b946a99a048694f3d8b6ad822a835b299", "de00c15b946a99a048694f3d8b6ad822a835b299" ]
[ "mcot/core/_scripts/split/run.py", "mcot/core/_scripts/function/normalize.py" ]
[ "#!/usr/bin/env python\n\"\"\"Run part of the voxel-wise job\"\"\"\nfrom loguru import logger\nimport nibabel as nib\nfrom fsl.data.image import addExt\nfrom subprocess import run as srun\nimport numpy as np\nfrom typing import Sequence, Tuple\nimport string\nimport itertools\nimport tempfile\nimport sys\n\n\ndef g...
[ [ "numpy.where", "numpy.linspace", "numpy.log" ], [ "numpy.concatenate", "numpy.std", "numpy.diag" ] ]
obi-wan76/webbpsf
[ "ca3a3b6c26d4c263b906f29fb06e5f6d9b1e9a02" ]
[ "webbpsf/webbpsf_core.py" ]
[ "\"\"\"\n============\nWebbPSF Core\n============\n\nAn object-oriented modeling system for the JWST instruments.\n\nClasses:\n * SpaceTelescopeInstrument\n * JWInstrument\n * MIRI\n * NIRCam\n * NIRSpec\n * NIRISS\n * FGS\n\nWebbPSF makes use of python's ``logging`` facility for log me...
[ [ "numpy.max", "numpy.array", "numpy.ceil", "numpy.reshape", "numpy.asarray", "numpy.round", "numpy.min", "numpy.mean", "numpy.identity", "numpy.remainder", "numpy.arange", "numpy.arctan2", "numpy.sqrt", "numpy.isscalar", "numpy.meshgrid", "numpy.mod" ...
robert-s-lee/Keras-3D-Image-Classification
[ "8f7173df8ce3780d7be049947f8e0323b53b316d" ]
[ "train.py" ]
[ "\"\"\"\nTitle: 3D Image Classification from CT Scans\nAuthor: [Hasib Zunair](https://twitter.com/hasibzunair)\nDate created: 2020/09/23\nLast modified: 2020/09/23\nDescription: Train a 3D convolutional neural network to predict presence of pneumonia.\n\"\"\"\n\"\"\"\n## Introduction\nThis example will show the ste...
[ [ "tensorflow.keras.callbacks.TensorBoard", "tensorflow.keras.utils.get_file", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.keras.callbacks.ModelCheckpoint", "tensorflow.keras.layers.Dense", "tensorflow.keras.Model", "tensorflow.keras.layers.BatchNormalization", "numpy.c...
DefTruth/landmarksaug
[ "71d978a062e4a7c8fe90ca62c8dff109ea7718e7" ]
[ "torchlm/metrics/metrics.py" ]
[ "import numpy as np\nfrom scipy.integrate import simps\nfrom typing import List, Tuple\n\n__all__ = [\"nme\", \"fr_and_auc\"]\n\n\ndef nme(lms_pred: np.ndarray, lms_gt: np.ndarray, norm: float) -> float:\n \"\"\"\n :param lms_pred: (n,2) predicted landmarks.\n :param lms_gt: (n,2) ground truth landmarks.\n...
[ [ "scipy.integrate.simps", "numpy.linalg.norm", "numpy.arange", "numpy.count_nonzero" ] ]
taiga4112/pDESy
[ "ff2a77a3f7ad1714960dfabfcb977279a0b53d09" ]
[ "pDESy/model/component.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom .base_component import BaseComponent\nimport numpy as np\n\n\nclass Component(BaseComponent):\n \"\"\"Component\n Component class for expressing target product.\n This class is implemented from BaseComponent.\n\n Args:\n name (str):\n ...
[ [ "numpy.random.seed", "numpy.random.rand" ] ]
qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3
[ "630dcef73e6a258b6e9a52f934e2dd912ce741f8" ]
[ "venv/lib/python3.9/site-packages/google/cloud/bigquery_storage_v1/reader.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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "pandas.DataFrame", "pandas.Series", "pandas.concat" ] ]
sandialabs/OperonSEQer
[ "62622204b646ff86dbb11f35d04bb486ef2fdb2f" ]
[ "OperonSEQer/mergepreds.py" ]
[ "import csv\nimport sys\nimport configargparse\nimport pandas as pd\n\n\nif __name__ == '__main__':\n\n\tif len (sys.argv) < 5 :\n\t\tprint(\"Usage: python mergepred2021.py -f file\\nNumber of arguements is \" + str(len(sys.argv)))\n\t\tsys.exit (1)\n\n\tp = configargparse.ArgParser(description='this script merges ...
[ [ "pandas.DataFrame", "pandas.merge" ] ]
jiangtaoo2333/mmpose
[ "00e12ddc224b492e9c903df96d09aa04c3f2a5f3" ]
[ "mmpose/models/heads/topdown_heatmap_base_head.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nfrom abc import ABCMeta, abstractmethod\n\nimport numpy as np\nimport torch.nn as nn\n\nfrom mmpose.core.evaluation.top_down_eval import keypoints_from_heatmaps\n\n\nclass TopdownHeatmapBaseHead(nn.Module):\n \"\"\"Base class for top-down heatmap heads.\n\n Al...
[ [ "numpy.prod", "numpy.array", "numpy.ones", "numpy.zeros" ] ]
koursaros-ai/bert
[ "a37324c394c33b67385fb309523b859f1465f842" ]
[ "optimization.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team 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# Unl...
[ [ "tensorflow.zeros_initializer", "tensorflow.multiply", "tensorflow.group", "tensorflow.contrib.tpu.CrossShardOptimizer", "tensorflow.gradients", "tensorflow.constant", "tensorflow.train.polynomial_decay", "tensorflow.sqrt", "tensorflow.train.get_or_create_global_step", "ten...
HuangStomach/machine-learning
[ "47689469c431e2a833437b38832d3fdceda7b2b2" ]
[ "introduction_to_machine_learning_with_python/2.3/two_moons_random_forest.py" ]
[ "import matplotlib\nmatplotlib.use('MacOSX')\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport mglearn\n\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.datasets import make_moons\n\nX, y = make_moons(n_samples=100, noise=0.25, random_state=3)\nfrom sklearn.model_s...
[ [ "matplotlib.use", "sklearn.ensemble.RandomForestClassifier", "matplotlib.pyplot.subplots", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.show", "sklearn.datasets.make_moons" ] ]
Qidian213/NAIC2019
[ "23e05a8a096168ccfa4d1743467fdf78ffcaabba" ]
[ "data/datasets/eval_reid.py" ]
[ "# encoding: utf-8\n\"\"\"\n@author: liaoxingyu\n@contact: sherlockliao01@gmail.com\n\"\"\"\nimport os\nimport numpy as np\nimport shutil\nimport cv2\nimport json\nimport shutil\n\ndef eval_func(distmat, q_pids, g_pids, q_camids, g_camids,q_img_paths, g_img_paths, max_rank=210):\n \"\"\"Evaluation with market15...
[ [ "numpy.asarray", "numpy.mean", "numpy.any", "numpy.invert", "numpy.argsort" ] ]
Capgemini-Invent-France/CarbonAI
[ "ef9ccf2c6460e09241304f5618f9a6d082c3f65e" ]
[ "carbonai/power_meter.py" ]
[ "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\"\"\"\nPowerMeter\n---------\nMain Python class or entrypoint to monitor the power consumption of\nan algorithm.\n\"\"\"\n\n__all__ = [\"PowerMeter\"]\n\nimport datetime\nimport getpass\nimport json\nimport logging\nimport os\nimport shutil\nimport sys\nimport traceback...
[ [ "pandas.DataFrame", "pandas.read_csv", "pandas.read_excel" ] ]
maxim-borisyak/pyca
[ "2da2e25ba5ba47e1e5f70a31a2a4af4ecde01834" ]
[ "setup.py" ]
[ "\"\"\"\n Py Cellular Automata.\n\"\"\"\n\nfrom setuptools import setup, find_packages, Extension\n\nfrom codecs import open\nimport os\nimport os.path as osp\nimport numpy as np\n\ndef get_includes():\n env = os.environ\n\n includes = []\n\n for k in ['CPATH', 'C_INCLUDE_PATH', 'INCLUDE_PATH']:\n if k in en...
[ [ "numpy.get_include" ] ]
Ugness/CIPS_SR
[ "abce872f5bc1b84afb9634a7dd1991e8c74d7616" ]
[ "calculate_fid.py" ]
[ "import argparse\nimport os\n\nimport torch\nimport torchvision\nfrom torch_fidelity import calculate_metrics\nimport numpy as np\n\nimport model\nfrom dataset import ImageDataset\nfrom tensor_transforms import convert_to_coord_format\n\n\n@torch.no_grad()\ndef calculate_fid(model, fid_dataset, bs, size, num_batche...
[ [ "torch.no_grad", "torch.randn", "torch.load" ] ]
kashif/agents
[ "104a68bf9e61756f173452e1a339b4ddc121e8c5" ]
[ "agents/tools/loop.py" ]
[ "# Copyright 2017 The TensorFlow Agents 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 appli...
[ [ "tensorflow.convert_to_tensor", "tensorflow.shape", "tensorflow.get_default_graph", "tensorflow.cond", "tensorflow.where", "tensorflow.reduce_any", "tensorflow.Variable", "tensorflow.gfile.MakeDirs", "tensorflow.placeholder", "tensorflow.control_dependencies", "tensorfl...
varunjha089/computerscience
[ "bd90079e4a8701e92c9f88f598bfa86203b6cbb7" ]
[ "Labs/AI and Machine Learning/Cognitive Toolkit/resources/cntk2images.py" ]
[ "\n#\n\nfrom os import walk\nfrom PIL import Image\nimport numpy as np\n\ninputFile = ''\n\nwith open(inputFile) as f:\n images = f.readlines()\n\nimages = [line.strip() for line in images]\n\nw, h = 28, 28\n\nimgcnt = 0;\n\n\nfor imageline in images:\n\n\tdataparts = imageline.split(\" |features \")\n\timagedat...
[ [ "numpy.zeros" ] ]
BEPb/Python-100-days
[ "8f846962cd45342aa2490ec2e86df358ae0ef281" ]
[ "Game_AI_and_Reinforcement_Learning/ConnectX/v1/encoder_decoder_c4.py" ]
[ "\"\"\"\nPython 3.9 список функций\nНазвание файла encoder_decoder_c4.py\n\nсписок функций для кодирования / декодирования класса платы Connect4 для ввода / интерпретации в нейронную сеть\n\nVersion: 0.1\nAuthor: Andrej Marinchenko\nDate: 2021-12-20\n\"\"\"\n#!/usr/bin/env python\n\nimport numpy as np\nfrom connect...
[ [ "numpy.zeros" ] ]
ripplesaround/ETDI_NL
[ "4b77444d8ef5dee1f020e4d30e6cfc24fb5945c9" ]
[ "proposed/models/modeling.py" ]
[ "\"\"\" Modeling layer Implementation \"\"\"\r\n\r\nimport numpy as np\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\nfrom torch.nn.parameter import Parameter\r\n\r\n\r\ndef call_bn(bn, x):\r\n return bn(x)\r\n\r\n\r\nclass NoiseModel(nn.Module):\r\n def __init__(self, num_clas...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.cat", "torch.nn.functional.avg_pool2d", "torch.nn.BatchNorm2d", "torch.nn.init.kaiming_normal_", "torch.nn.Conv2d", "torch.nn.functional.dropout2d", "torch.eye", "torch.nn.functional.relu", "torch.nn.functional.max_pool2d", ...
weigq/pytorch-cyclegan-pix2pix
[ "ef49a77964aaefdb1b95067ec50426f15b7137e1", "ef49a77964aaefdb1b95067ec50426f15b7137e1" ]
[ "options/base_options.py", "models/test_model.py" ]
[ "\"\"\"\nrunning basic options\n\"\"\"\n\nimport argparse\nimport os\nfrom util import util\nimport torch\n\n\nclass BaseOptions():\n def __init__(self):\n self.parser = argparse.ArgumentParser()\n self.initialized = False\n self.opt = None\n\n def initialize(self):\n self.parser.a...
[ [ "torch.cuda.set_device" ], [ "torch.autograd.Variable" ] ]
ssm-jax/ssm-book
[ "f3bfa29a1c474b7dc85792a563df0f29736a44c6" ]
[ "_build/jupyter_execute/kevin.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# # Kevin's noodling\n# \n# In this chapter, we do blah.\n# For more details, see [](sec:bar), where we discuss bar.\n# \n# \n# ## Python\n\n# In[1]:\n\n\nfrom matplotlib import rcParams, cycler\nimport matplotlib.pyplot as plt\nimport numpy as np\nplt.ion()\n\n\n# In[2]:...
[ [ "numpy.array", "matplotlib.pyplot.ion", "numpy.random.seed", "numpy.random.randn", "matplotlib.pyplot.subplots", "numpy.linspace", "numpy.logspace" ] ]
AI-confused/Tianchi_Similarity
[ "9c3e76b7ac19f07e948d68270b0b747de92a413f" ]
[ "run_bert.py" ]
[ "from __future__ import absolute_import\nimport argparse\nimport csv\nimport logging\nimport os\nimport random\nimport sys\nfrom io import open\nimport pandas as pd\nimport numpy as np\nimport torch\nimport time\n# from scipy.stats import spearmanr\nimport collections\nimport torch.nn as nn\nfrom collections import...
[ [ "numpy.concatenate", "torch.cuda.manual_seed_all", "torch.utils.data.RandomSampler", "torch.isnan", "numpy.random.seed", "torch.norm", "torch.no_grad", "torch.utils.data.SequentialSampler", "torch.cuda.device_count", "torch.manual_seed", "torch.cuda.is_available", "...
KiwiCodesStuff/FairMOT
[ "8e6f5c6a82f15bf951f35bbd8592e558938dfd2f" ]
[ "src/track.py" ]
[ "# ------------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n# ------------------------------------------------------------------------------\n\nfrom __future__ import absolute_import\nfrom __future...
[ [ "numpy.sum", "numpy.dot", "numpy.asarray", "torch.from_numpy" ] ]
cuhksz-nlp/RE-TaMM
[ "3de913b778ca0fa9ac35ff04244e45c61c1a38df" ]
[ "data_utils.py" ]
[ "import os\nimport json\nimport logging\nimport numpy as np\nimport torch\nfrom torch.utils.data import Dataset\nfrom collections import defaultdict\nfrom dep_parser import DepInstanceParser\n\ndef change_word(word):\n if \"-RRB-\" in word:\n return word.replace(\"-RRB-\", \")\")\n if \"-LRB-\" in word...
[ [ "torch.tensor", "numpy.zeros" ] ]
zdanial/Bayesian-Optimization
[ "a4779e992da15d21fa3fc425293cfb1f2621f81f" ]
[ "example/example_remote.py" ]
[ "import os\nimport shutil\nimport subprocess\nimport time\n\nimport numpy as np\nimport requests\n\ndata = {\n \"search_param\": {\n \"emissivity\": {\"type\": \"r\", \"range\": [0.95, 1], \"N\": 2, \"precision\": 2},\n \"offset\": {\"type\": \"r\", \"range\": [-10, 10], \"N\": 2, \"precision\": 2}...
[ [ "numpy.sum", "numpy.random.randn", "numpy.sqrt" ] ]
pacovi/jira-agile-metrics
[ "0c8810a8348ea21145db71f7e3681adc65a6b02c" ]
[ "jira_agile_metrics/calculators/ageingwip.py" ]
[ "import logging\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nfrom ..calculator import Calculator\nfrom ..utils import set_chart_style\n\nfrom .cycletime import CycleTimeCalculator\n\nlogger = logging.getLogger(__name__)\n\nclass AgeingWIPChartCalculator(Calcula...
[ [ "pandas.isnull", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "pandas.Timestamp.now", "pandas.concat" ] ]
RustedSwords/HackTheMountains
[ "28b7853674e9ff1694f74841c5963c34be251680" ]
[ "drowsiness_detector.py" ]
[ "import numpy as np\nimport imutils\nimport time\nimport timeit\nimport dlib\nimport cv2\nimport matplotlib.pyplot as plt\nfrom scipy.spatial import distance as dist\nfrom imutils.video import VideoStream\nfrom imutils import face_utils\nfrom threading import Thread\nfrom threading import Timer\nfrom check_cam_fps ...
[ [ "numpy.random.seed", "scipy.spatial.distance.euclidean" ] ]
DrMichaelCornish/PyBaMM
[ "a31e2095600bb92e913598ac4d02b2b6b77b31c1" ]
[ "pybamm/simulation.py" ]
[ "#\n# Simulation class\n#\nimport pickle\nimport pybamm\nimport numpy as np\nimport copy\nimport warnings\nimport sys\n\n\ndef is_notebook():\n try:\n shell = get_ipython().__class__.__name__\n if shell == \"ZMQInteractiveShell\": # pragma: no cover\n # Jupyter notebook or qtconsole\n ...
[ [ "numpy.round", "numpy.diff" ] ]
anjunhu/flakes
[ "1a4a50a7c36b6cd26283e2eede1117ac0995e348" ]
[ "tis-OpenCV.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Nov 21 09:46:46 2016\n\nSample for tisgrabber to OpenCV Sample 2\n\nOpen a camera by name\nSet a video format hard coded (not recommended, but some peoples insist on this)\nSet properties exposure, gain, whitebalance\n\"\"\"\nimport ctypes as C\nimport tisgrabber as ...
[ [ "numpy.ones" ] ]
henryL7/fastNLP
[ "7255128dec92a2f09a6f16c708d67b608f22529e" ]
[ "fastNLP/action/trainer.py" ]
[ "import _pickle\n\nimport numpy as np\nimport torch\n\nfrom fastNLP.action.action import Action\nfrom fastNLP.action.action import RandomSampler, Batchifier\nfrom fastNLP.action.tester import POSTester\nfrom fastNLP.modules.utils import seq_mask\n\n\nclass BaseTrainer(Action):\n \"\"\"Base trainer for all traine...
[ [ "numpy.square", "torch.zeros", "numpy.array", "numpy.random.rand", "numpy.matmul", "torch.autograd.Variable", "torch.cuda.is_available", "torch.Tensor", "torch.nn.CrossEntropyLoss" ] ]
akshaykurmi/rl
[ "5575695c9af7f1981753fbb21855e5cde617d123" ]
[ "rl/agents/vpg_gae.py" ]
[ "import numpy as np\nimport tensorflow as tf\n\nfrom rl.replay_buffer import ReplayField, OnePassReplayBuffer, Advantage, RewardToGo\nfrom rl.utils import GradientAccumulator, MeanAccumulator, tf_standardize\n\n\nclass VPGGAE:\n def __init__(self, env, policy_fn, vf_fn, lr_policy, lr_vf, gamma, lambda_, vf_updat...
[ [ "tensorflow.size", "tensorflow.GradientTape", "tensorflow.expand_dims", "tensorflow.function", "tensorflow.squeeze", "tensorflow.keras.optimizers.Adam" ] ]
xwx1989119/zipline
[ "5cb37da2cf77b811fa7bfc0107619582008de55d" ]
[ "zipline/data/bundles/csvdir.py" ]
[ "\"\"\"\nModule for building a complete dataset from local directory with csv files.\n\"\"\"\nimport os\nimport sys\n\nfrom logbook import Logger, StreamHandler\nfrom numpy import empty\nfrom pandas import DataFrame, read_csv, Index, Timedelta, NaT\nfrom trading_calendars import register_calendar_alias\n\nfrom zipl...
[ [ "pandas.DataFrame", "pandas.Timedelta" ] ]
kahoooo/athena-public
[ "583aee106677cba7fa5ea4e3689e2cfb81796e25" ]
[ "tst/regression/scripts/tests/gr/hydro_shocks_hlle.py" ]
[ "# Test script for relativistic hydro shock tubes in GR with HLLE\n\n# Modules\nimport logging\nimport numpy as np\nimport sys\nimport scripts.utils.athena as athena\nimport scripts.utils.comparison as comparison\nsys.path.insert(0, '../../vis/python')\nimport athena_read # noqa\nathena_read.check_nan_flag = True\...
[ [ "numpy.isnan" ] ]
phuongnm-bkhn/OpenNMT-py
[ "554a826139f1bfc55f4ea6a3e7491858c2afec4c" ]
[ "onmt/decoders/combined_transformer_rnn.py" ]
[ "\"\"\"\nImplementation of \"Attention is All You Need\"\n\"\"\"\n\nimport torch\nimport torch.nn as nn\n\nfrom onmt.decoders.decoder import DecoderBase, RNNDecoderBase\nfrom onmt.encoders.combined_transformer_rnn import EmbeddingSkipped\nfrom onmt.models.stacked_rnn import StackedLSTM, StackedGRU\nfrom onmt.module...
[ [ "torch.zeros", "torch.nn.Dropout", "torch.nn.LayerNorm", "torch.stack", "torch.gt", "torch.ones" ] ]
spider-specimens/waibao-spider
[ "4b7623df3cf56cd33754fcee49149637f7409b2e" ]
[ "src/dakun.py" ]
[ "'''\n 大鲲 爬虫\n'''\nimport requests\nfrom headers import Headers\nfrom bs4 import BeautifulSoup\nimport time\nimport re\nimport numpy as np\nfrom storage import Storage\n\nheaders = Headers()\nstorage = Storage()\n\n\nclass DakunSpider(object):\n\n # 获取列表数据\n def fetch_list(self, _type, page):\n url ...
[ [ "numpy.random.rand" ] ]
Nhat-Thanh/SRCNN-TF
[ "9e9d7ae8f75d1c8a33b470f49d02c8f2ce6a134b" ]
[ "utils/dataset.py" ]
[ "from utils.common import *\nimport tensorflow as tf\nimport numpy as np\nimport os\n\nclass dataset:\n def __init__(self, dataset_dir, subset):\n self.dataset_dir = dataset_dir\n self.subset = subset\n self.data = tf.convert_to_tensor([])\n self.labels = tf.convert_to_tensor([])\n ...
[ [ "numpy.array", "tensorflow.convert_to_tensor", "numpy.load", "numpy.save", "numpy.arange", "numpy.absolute" ] ]
awnonbhowmik/2D-Diophantine-Encoder
[ "734e2e5aeccd66f213f60a51ce1ae22b72bba59b" ]
[ "main.py" ]
[ "from collections import abc\nfrom sympy.solvers.diophantine.diophantine import base_solution_linear\nfrom random import randint\nfrom numpy import gcd\n\n\ndef encrypt(msg):\n ascii_lst = [ord(c) for c in msg]\n print(\"\\nASCII List: {}\".format(ascii_lst))\n\n a, b = randint(1, 10), randint(1, 10)\n\n ...
[ [ "numpy.gcd" ] ]
willyspinner/High-Performance-Face-Recognition
[ "c5caad61be97fd20f9c47a727278ff938dc5cc8f" ]
[ "src/Look Across Elapse- Disentangled Representation Learning and Photorealistic Cross-Age Face Synthesis for Age-Invariant Face Recognition.TensorFlow/network.py" ]
[ "import tensorflow as tf \r\nimport numpy as np \r\nimport layers2 as L \r\nL.set_gpu('0')\r\nimport modeleag as M \r\n\r\nIMG_SIZE = 128\r\nAGE_CATEGORY = 10\r\nZ_DIM = 50\r\n\r\nclass EncoderNet(M.Model):\r\n\tdef initialize(self):\r\n\t\t# should modify the network structure for better training\r\n\t\tself.c1 = ...
[ [ "tensorflow.abs", "tensorflow.image.total_variation", "tensorflow.concat", "tensorflow.GradientTape", "tensorflow.sigmoid", "tensorflow.ones_like", "tensorflow.random.uniform", "tensorflow.reshape", "tensorflow.zeros_like", "tensorflow.tile", "tensorflow.nn.tanh", "...
itsliupeng/read_Detectron.pytorch
[ "aac793a459484c301cb203d9041f0de71dd00aa2" ]
[ "tools/infer_video_mask_kp.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport argparse\nimport distutils.util\nimport os\nimport sys\nimport pprint\nimport subprocess\nfrom collections import defaultdict\nfrom six.moves import xrange\n\n# Use a non-interactive backend\nim...
[ [ "matplotlib.use", "torch.cuda.is_available", "torch.load" ] ]
LeiaInc/pyrender
[ "f933ba1d96a75fb4ede325a7f6d4b7667bf2f917" ]
[ "pyrender/mesh.py" ]
[ "\"\"\"Meshes, conforming to the glTF 2.0 standards as specified in\nhttps://github.com/KhronosGroup/glTF/tree/master/specification/2.0#reference-mesh\n\nAuthor: Matthew Matl\n\"\"\"\nimport copy\n\nimport numpy as np\nimport trimesh\n\nfrom .primitive import Primitive\nfrom .constants import GLTF\nfrom .material i...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.minimum", "numpy.mean", "numpy.diff", "numpy.repeat", "numpy.maximum" ] ]
sailingfree/Python-VPP
[ "c4730494ae86dc78260ccd94fe05c85141760360" ]
[ "test/Resistance.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n__author__ = \"Marin Lauber\"\n__copyright__ = \"Copyright 2020, Marin Lauber\"\n__license__ = \"GPL\"\n__version__ = \"1.0.1\"\n__email__ = \"M.Lauber@soton.ac.uk\"\n\nimport numpy as np\nfrom src.HydroMod import HydroMod\nfrom src.YachtMod import Yacht, Keel, Ru...
[ [ "numpy.linspace" ] ]
leRoderic/VA_19
[ "86b02e38c30a2163cb7dae1f52f551e6d30f35f7" ]
[ "P5/LM_filters.py" ]
[ "'''\nThe Leung-Malik (LM) Filter Bank, implementation in python\n\nT. Leung and J. Malik. Representing and recognizing the visual appearance of\nmaterials using three-dimensional textons. International Journal of Computer\nVision, 43(1):29-44, June 2001.\n\nReference: http://www.robots.ox.ac.uk/~vgg/research/texcl...
[ [ "numpy.array", "numpy.sin", "numpy.dot", "numpy.reshape", "numpy.zeros", "numpy.exp", "numpy.arange", "numpy.sqrt", "numpy.cos", "numpy.meshgrid" ] ]
godzilla-but-nicer/boolmininfo
[ "50281b1a9d8a0718815910edf4123d67c532aa66" ]
[ "boolmininfo/eca/plot_eca_pid_correlations.py" ]
[ "import numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\n\n# load all of the neccesary dataframes\nwedge = pd.read_csv(snakemake.config['eca_decompositions']['wedge'])\nccs = pd.read_csv(snakemake.config['eca_decompositions']['ccs'])\nimin = pd.read_csv(snakemake.config['eca...
[ [ "pandas.isnull", "numpy.array", "numpy.triu_indices", "matplotlib.pyplot.savefig", "pandas.DataFrame", "matplotlib.pyplot.title", "matplotlib.pyplot.xlabel", "numpy.mean", "matplotlib.pyplot.figure", "numpy.random.uniform", "matplotlib.pyplot.ylabel", "pandas.read_c...
AnalystSubranjit/h2o-3
[ "b34e50ab81970ebd999eb8236de1580219293cdb" ]
[ "h2o-py/tests/testdir_algos/gbm/pyunit_gbm_monotone_synthetic.py" ]
[ "from h2o.estimators.xgboost import *\nfrom h2o.estimators.gbm import *\nfrom tests import pyunit_utils\nimport numpy as np\n\n\ndef train_models(iter):\n print(\"Iteration %s\" % iter)\n \n number_of_dpoints = 1000\n x1_positively_correlated_with_y = np.random.random(size=number_of_dpoints)\n x2_neg...
[ [ "numpy.random.normal", "numpy.sin", "numpy.cos", "numpy.random.random", "numpy.column_stack" ] ]
dendisuhubdy/ALAE
[ "471301aa671928748ffbd9cc191278e1ec8f29c4" ]
[ "dataset_preparation/prepare_mnist_tfrecords.py" ]
[ "# Copyright 2019-2020 Stanislav Pidhorskyi\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.python_io.TFRecordOptions", "tensorflow.train.Int64List", "numpy.asarray", "tensorflow.python_io.TFRecordWriter", "numpy.stack" ] ]
TinghuiWang/pymrt
[ "e096d712b897ebf8483c95a726933ee8b3d09432" ]
[ "pymrt/performance/ar.py" ]
[ "\"\"\"Event-based Performance Metrics\n\nThis file implements event-based performance metrics for activity recognition.\n\nReference:\n\n - Minnen, David, Tracy Westeyn, Thad Starner, J. Ward, and Paul Lukowicz.\n Performance metrics and evaluation issues for continuous activity\n recognition. Perform...
[ [ "numpy.empty", "numpy.dtype", "numpy.zeros" ] ]
santhoshkolloju/squash-generation
[ "3a4728e40bf801bb72497a8b24a37e7443c36d65" ]
[ "squash/filter.py" ]
[ "import numpy as np\nimport json\nimport pickle\nimport random\nimport sys\nimport os\nimport spacy\n\nfrom collections import defaultdict\n\nfrom squad_eval_utils import (\n f1_metric,\n exact_match_metric,\n metric_max_over_candidates,\n recall_metric,\n precision_metric,\n normalize\n)\n\nnlp =...
[ [ "numpy.max", "numpy.ceil", "numpy.argmax" ] ]
juandados/gait-inference
[ "19d29919be5cbf984ddbf76da442c59e07bb32bc" ]
[ "code/utils.py" ]
[ "import os\nimport datetime\nimport matplotlib.pyplot as plt\nimport cv2\nimport pandas as pd\nimport numpy as np\nimport xml.etree.ElementTree as et\nimport re\n\nfrom time import time\nfrom keras.preprocessing.image import ImageDataGenerator, Iterator, array_to_img, img_to_array, load_img\nfrom keras.models impor...
[ [ "numpy.max", "matplotlib.pyplot.text", "numpy.array", "numpy.empty", "numpy.zeros", "matplotlib.patches.Rectangle", "pandas.concat", "pandas.DataFrame", "numpy.exp", "numpy.mean", "matplotlib.pyplot.figure", "numpy.vstack", "numpy.flip", "pandas.Series", ...
pjavia/GAN
[ "3e8dfac34b5a32818286310ea96706c93494565a" ]
[ "dcgan/cifar.py" ]
[ "import cPickle\nimport numpy as np\nimport cv2\n\nrepository = []\n\nfor i in range(1, 6):\n\n name = 'cifar/data_batch_'+str(i)\n\n with open(name, 'rb') as fo:\n data = cPickle.load(fo)\n\n\n collect = data.get('data')\n\n\n for j in collect:\n red = []\n green = []\n blue...
[ [ "numpy.array" ] ]
hereagain-Y/DeepTCR_COVID19
[ "da7ff94ed94d6370c9585fdf9f32e4f1140d54c5" ]
[ "scripts/demographics/icu_admit.py" ]
[ "\"\"\" Demographics - Fraction of paitents admitted to the ICU in the NIH/NIAID cohort\"\"\"\n\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom matplotlib.colors import LinearSegmentedColormap\nimport matplotlib\nmatplotlib.rc('font', family='sans-serif')\nplt....
[ [ "numpy.array", "pandas.DataFrame", "numpy.sum", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "matplotlib.rc", "pandas.pivot", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.style.use", "numpy.hstack", "pandas.read_csv", "numpy.unique" ] ]
LuCeHe/trellisnet
[ "ec1de0a5ee09ef5a4c5bca4c83456dec8cbdf4c8" ]
[ "TrellisNet/char_PTB/utils.py" ]
[ "import unidecode\nimport torch\nfrom collections import Counter\nimport observations\nimport os\nimport pickle\nimport sys\nsys.path.append(\"../\")\nfrom model import *\n\n\ndef read_file(filename):\n file = unidecode.unidecode(open(filename).read())\n return file, len(file)\n\n\nclass Dictionary(object):\n...
[ [ "torch.save" ] ]
RejectHumanity/LIBS_library
[ "d655743d82467c13ae1a95c01599c97f0d9c8069" ]
[ "src/eval/dummies.py" ]
[ "from sklearn.base import BaseEstimator, RegressorMixin\nfrom sklearn.utils import check_array, check_X_y\nfrom sklearn.utils.validation import check_is_fitted\n\nclass Average_Dummy(BaseEstimator, RegressorMixin):\n\n def __init__(self, *args, **kwargs):\n pass\n \n\n def fit(self, X, y, *args, **kwargs)...
[ [ "sklearn.utils.check_array" ] ]
tavuong/covid-data-kit
[ "d1d9eec1efaa293d98d4b85a8d5fef9b4e0b2f6a" ]
[ "covid19-datakit.py" ]
[ "import sys, getopt\nimport matplotlib.pyplot as plt\nimport matplotlib.dates\nfrom datetime import datetime\nfrom datetime import date\nimport csv\nfrom lib.tavuong_visual import *\nfrom lib.user_visual import *\n\ndef main(argv):\n# --------------------------------------\n# ARGUMENT Processing\n inputfile = ''...
[ [ "matplotlib.pyplot.subplots" ] ]