repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
cicicici/deeptensor | [
"efcd7b9ca2d758cb2461b64fa5ba1268685e4dab"
] | [
"deeptensor/model/timm/dla.py"
] | [
"\"\"\" Deep Layer Aggregation and DLA w/ Res2Net\nDLA original adapted from Official Pytorch impl at:\nDLA Paper: `Deep Layer Aggregation` - https://arxiv.org/abs/1707.06484\n\nRes2Net additions from: https://github.com/gasvn/Res2Net/\nRes2Net Paper: `Res2Net: A New Multi-scale Backbone Architecture` - https://arx... | [
[
"torch.cat",
"torch.nn.ModuleList",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.split",
"torch.nn.functional.dropout",
"torch.nn.ReLU",
"torch.nn.Conv2d"
]
] |
ben-hayes/torchcrepe | [
"9179f110313d1a6f046351fbad1ae72a4f0fd6fa"
] | [
"tests/test_threshold.py"
] | [
"import torch\n\nimport torchcrepe\n\n\n###############################################################################\n# Test threshold.py\n###############################################################################\n\n\ndef test_at():\n \"\"\"Test torchcrepe.threshold.At\"\"\"\n input_pitch = torch.ten... | [
[
"torch.tensor",
"torch.isnan"
]
] |
ChrisBremer/can-scrapers | [
"a91123368f8473a2778c4efcc40855b2fd631306"
] | [
"db/bin/populate_locations.py"
] | [
"import pandas as pd\nfrom can_tools.scrapers.uscensus.geo import USGeoBaseAPI\n\nd = USGeoBaseAPI(\"state\")\ndf_s = d.get()\ndf_s[\"location_type\"] = 2\n\nd = USGeoBaseAPI(\"county\")\ndf_c = d.get()\ndf_c[\"location_type\"] = 1\n\ndf = pd.DataFrame(pd.concat([df_s, df_c], ignore_index=True))\ndf[\"fullname\"] =... | [
[
"pandas.concat"
]
] |
mjuric/sbpy | [
"082ad903cb9b21ae961e4c72b666a8242539382a"
] | [
"sbpy/spectroscopy/tests/test_sources.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\nimport sys\nimport pytest\nimport numpy as np\nimport astropy.units as u\nfrom astropy.tests.helper import remote_data\nfrom astropy.modeling.blackbody import blackbody_nu, blackbody_lambda\nimport synphot\nfrom .. import sources\nfrom ..sources im... | [
[
"numpy.allclose",
"numpy.arange",
"numpy.isclose",
"numpy.logspace"
]
] |
phamduyhk/signate_student_cup_2020 | [
"19e158b08a86f2df8e4ee45445169ae396c91409"
] | [
"utils/dataloader.py"
] | [
"# coding: utf-8\nimport glob\nimport os\nimport io\nimport string\nimport re\nimport random\nimport spacy\nimport torchtext\nfrom torchtext.vocab import Vectors\nimport pandas as pd\nimport torch\n\n\nclass Preprocessing():\n def __init__(self):\n pass\n\n def get_data(self, path, train_file, test_fil... | [
[
"pandas.Series"
]
] |
RogerFrigola/probability | [
"cfb507b7ede2c1ba753bffc5ea827b9c97c37bdc"
] | [
"tensorflow_probability/python/distributions/sample_stats.py"
] | [
"# Copyright 2018 The TensorFlow Probability Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by a... | [
[
"tensorflow.conj",
"tensorflow.assert_rank",
"tensorflow.ones",
"tensorflow.reshape",
"tensorflow.assert_integer",
"tensorflow.ceil",
"tensorflow.cast",
"tensorflow.rank",
"tensorflow.python.framework.tensor_util.constant_value",
"tensorflow.shape",
"tensorflow.concat",... |
Indraos/EconML | [
"056fb30b49db5485ff23bb38cf49cd29bde783c9"
] | [
"econml/dr/_drlearner.py"
] | [
"# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\n\"\"\"\nDoubly Robust Learner. The method uses the doubly robust correction to construct doubly\nrobust estimates of all the potential outcomes of each samples. Then estimates a CATE model\nby regressing the potential... | [
[
"numpy.zeros",
"numpy.average",
"numpy.mean",
"numpy.moveaxis",
"numpy.arange",
"numpy.all",
"numpy.hstack",
"sklearn.base.clone",
"sklearn.linear_model.LogisticRegressionCV"
]
] |
cuichuan123456/transform-culane | [
"5e1de763100ae53b1c5c66cf168c09999cf75139"
] | [
"db/base.py"
] | [
"import os\nimport h5py\nimport numpy as np\n\nfrom config import system_configs\n\nclass BASE(object):\n def __init__(self):\n self._split = None\n self._db_inds = []\n self._image_ids = []\n\n self._data = None\n self._image_hdf5 = None\n self._image_fi... | [
[
"numpy.ones",
"numpy.zeros"
]
] |
yxiong/tensorflow | [
"f71cc62282bf2e066f9ebd08cf3f605fc98c6e41"
] | [
"tensorflow/python/ops/math_grad.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.math_ops.batch_ifft",
"tensorflow.python.ops.array_ops.invert_permutation",
"tensorflow.python.ops.math_ops.equal",
"tensorflow.python.ops.math_ops.fft",
"tensorflow.python.ops.math_ops.matmul",
"tensorflow.python.ops.gen_math_ops._inv_grad",
"tensorflow.python.o... |
Krish-sysadmin/genienlp | [
"3586e4368eb0b0756a772294daedc043ce55454c"
] | [
"genienlp/models/common.py"
] | [
"#\n# Copyright (c) 2018, Salesforce, Inc.\n# The Board of Trustees of the Leland Stanford Junior University\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# * Red... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.nn.Dropout",
"torch.cat",
"torch.stack",
"torch.nn.LSTMCell",
"torch.nn.ModuleList",
"torch.nn.Tanh",
"torch.zeros_like",
"torch.nn.functional.log_softmax",
"torch.ones",
"torch.nn.functional.softmax",
"torch.lt",
"to... |
TJUdyk/Matrix_RENet | [
"5d066e4e08e412b1f880c63743edfdb72bdc7138"
] | [
"models/resnet.py"
] | [
"import torch.nn as nn\n\n# This ResNet network was designed following the practice of the following papers:\n# TADAM: Task dependent adaptive metric for improved few-shot learning (Oreshkin et al., in NIPS 2018) and\n# A Simple Neural Attentive Meta-Learner (Mishra et al., in ICLR 2018).\n\n\ndef conv3x3(in_planes... | [
[
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.init.constant_",
"torch.nn.BatchNorm2d",
"torch.nn.LeakyReLU",
"torch.nn.init.kaiming_normal_",
"torch.nn.Conv2d"
]
] |
kaiott/pid-tools | [
"b625a457a4a5f98a32912400ffbc3ff0eb5a7c68"
] | [
"main.py"
] | [
"import PIDUtils as pid\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport control as co\n\n\n# specifications, ep=0 assumed\nte = 2.65\ndelta = 0.1\n\n# Process\nK=7\nprocess_poles = np.array([0, -12])\nprocess_zeros = np.array([])\n\n# Initial guess PID\npid_poles = np.array([0])\npid_zeros = np.array([... | [
[
"numpy.array",
"matplotlib.pyplot.xlim",
"numpy.log",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.ylim",
"numpy.real",
"numpy.poly",
"matplotlib.pyplot.fill_between",
"matplotlib.pyplot.show",
"numpy.conj",
"numpy.append",
"numpy.imag"
]
] |
AlokBharadwaj/ipl-prediction | [
"c4d6afeb6dc7e0bd65366c05ce3b5df030f7c538"
] | [
"ipl_chances.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sun Oct 25 19:01:42 2020\r\n\r\n@author: Alok\r\n\"\"\"\r\n\r\n# Program to simulate winning probabilites for the remaining matches in IPLT20 2020 edition\r\nfrom utils import shorthand\r\nimport numpy as np\r\nimport random\r\nimport matplotlib.pyplot as plt\r\nfrom... | [
[
"numpy.array",
"numpy.random.choice",
"numpy.lexsort",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.fill_between",
"numpy.arange",
"matplotlib.pyplot.ylabel"
]
] |
Petr-By/qtpyvis | [
"0b9a151ee6b9a56b486c2bece9c1f03414629efc"
] | [
"dltb/tool/activation.py"
] | [
"\"\"\"A collection of tools for dealing with network activations. This\ncomprises:\n\n* The :py:class:`ActivationTool` that allows to obtain activation values\n from a :py:class:`Network`.\n\n* The :py:class:`ActivationWorker` is a controller for an\n :py:class:`ActivationTool`, allowing to run it asynchronously... | [
[
"numpy.full",
"numpy.reshape",
"numpy.asarray",
"numpy.unravel_index",
"numpy.ndarray",
"numpy.take_along_axis",
"numpy.arange",
"numpy.memmap",
"numpy.argsort",
"numpy.append",
"numpy.argmax",
"numpy.argpartition",
"numpy.prod",
"numpy.dtype"
]
] |
jerrysong1324/lux | [
"b01f6f47f02340e28332863a4fba573539986767"
] | [
"lux/vislib/altair/AltairRenderer.py"
] | [
"# Copyright 2019-2020 The Lux 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 applicabl... | [
[
"pandas.api.types.is_period_dtype",
"pandas.PeriodIndex",
"pandas.api.types.is_interval_dtype"
]
] |
apdealbao/openpathsampling | [
"26997b43745e197abb91cdb3f51916da0cfc1774"
] | [
"openpathsampling/analysis/shooting_point_analysis.py"
] | [
"import openpathsampling as paths\nimport collections\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ntry:\n from collections import abc\nexcept ImportError:\n import collections as abc\n\n# based on http://stackoverflow.com/a/3387975\nclass TransformedDict(abc.MutableMapping):\n ... | [
[
"pandas.DataFrame",
"numpy.true_divide",
"numpy.errstate"
]
] |
NishthaShukla/ga-learner-dsmp-repo | [
"a6be62c4a37619a7a900eec8e7b81b33e29a655c"
] | [
"Car-insurance-claim/code.py"
] | [
"# --------------\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nfrom sklearn.model_selection import train_test_split\n\n# Code starts here\ndf = pd.read_csv(path)\n\nprint(df.head())\n\nprint(df.info())\n\ncolumns = ['INCOME','HOME_VAL','BLUEBOOK','OLDCLAIM','CLM_... | [
[
"sklearn.preprocessing.LabelEncoder",
"sklearn.preprocessing.StandardScaler",
"sklearn.metrics.accuracy_score",
"sklearn.linear_model.LogisticRegression",
"sklearn.model_selection.train_test_split",
"pandas.read_csv"
]
] |
samanfrm/gbnet | [
"de737602d88f8ad77b50803f0f9a50296426fcd6"
] | [
"gbnet/aux.py"
] | [
"import os\nimport psutil\nfrom datetime import timedelta\nimport time\n\nimport numpy as np\nimport pandas as pd\nfrom num2words import num2words\n\ndef genData(NX=3, num_active_tfs=2, NY=50, AvgNTF=0.5):\n # Start generating simulated data\n # The TFs: Number of TF and activation state of each\n\n # the ... | [
[
"numpy.random.choice",
"numpy.random.gamma",
"numpy.sign",
"numpy.random.uniform",
"numpy.select"
]
] |
balde-soul/TGS | [
"e2156ecd57f88c79dee5361c7c80095a1ee2fec5"
] | [
"model_base.py"
] | [
"# coding=utf-8\nimport tensorflow as tf\nfrom colorama import Fore\nimport numpy as np\nimport logging\nfrom collections import OrderedDict\nimport Putil.DenseNet.model_base as dmb\nfrom tensorflow.contrib import layers\nimport Putil.np.util as npu\nimport Putil.tf.util as tfu\n\n\ndef get_image_summary(img, idx=0... | [
[
"tensorflow.reduce_min",
"tensorflow.nn.conv2d",
"tensorflow.clip_by_value",
"tensorflow.stack",
"tensorflow.nn.softmax_cross_entropy_with_logits_v2",
"tensorflow.shape",
"tensorflow.concat",
"tensorflow.nn.leaky_relu",
"tensorflow.subtract",
"tensorflow.summary.histogram",... |
jmclong/random-fourier-features-pytorch | [
"22ad7db8387c3df397e828e93091dc26ba4c2b9b"
] | [
"rff/dataloader.py"
] | [
"import torch\nimport torchvision\n\nfrom torch import Tensor\nfrom torch.utils.data.dataset import TensorDataset\n\n\ndef rectangular_coordinates(size: tuple) -> Tensor:\n r\"\"\"Creates a tensor of equally spaced coordinates for use with an image or volume\n\n Args:\n size (tuple): shape of the image... | [
[
"torch.meshgrid",
"torch.stack",
"torch.linspace",
"torch.utils.data.dataset.TensorDataset"
]
] |
aslam/concept-to-clinic | [
"b69a6631ad007c5eca5280169c1db96444fd39ff"
] | [
"prediction/src/preprocess/lung_segmentation.py"
] | [
"import logging\nimport math\nimport os\nimport sys\n\nimport cv2\nimport dicom\nimport numpy\nimport scipy\nfrom dicom.errors import InvalidDicomError\nfrom skimage.filters import roberts\nfrom skimage.measure import label, regionprops\nfrom skimage.morphology import disk, binary_erosion, binary_closing\nfrom skim... | [
[
"numpy.array",
"numpy.flipud",
"numpy.stack",
"scipy.ndimage.binary_fill_holes",
"numpy.abs",
"numpy.vstack",
"numpy.int16"
]
] |
GxvgiuU/networkx | [
"3f1fdcb7693ff152f17623ce549526ec272698b1"
] | [
"examples/graph/plot_erdos_renyi.py"
] | [
"# -*- coding: utf-8 -*-\n#!/usr/bin/env python\n\"\"\"\n===========\nErdos Renyi\n===========\n\nCreate an G{n,m} random graph with n nodes and m edges\nand report some properties.\n\nThis graph is sometimes called the Erdős-Rényi graph\nbut is different from G{n,p} or binomial_graph which is also\nsometimes calle... | [
[
"matplotlib.pyplot.show"
]
] |
mgxd/niworkflows | [
"d28857d0be2a63263e4c29af44e84d18fdc44d2f"
] | [
"niworkflows/tests/test_segmentation.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\" Segmentation tests \"\"\"\n\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nimport os\nfrom shutil import copy\nimport pytest\n\nfrom niworkflows.nipype.interfaces.base import Bunch\nfrom niworkflows.interfaces.segmentation import FASTRPT, Reco... | [
[
"numpy.zeros_like"
]
] |
UnifyID/humandetect-sample-flask | [
"32cfa4850f9be31cefab9beb95e6e1d2e6904008"
] | [
"app/main.py"
] | [
"# Copyright (c) 2020 UnifyID, Inc. All rights reserved.\n# \n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, c... | [
[
"tensorflow.keras.preprocessing.image.img_to_array",
"tensorflow.keras.applications.MobileNet",
"numpy.expand_dims",
"tensorflow.keras.applications.mobilenet.preprocess_input"
]
] |
alexivaner/sklearn-onnx | [
"535a79481a79964287430bb390912c16911cff01"
] | [
"tests/test_sklearn_adaboost_converter.py"
] | [
"# -------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for\n# license information.\n# --------------------------------------------------------------------------\n... | [
[
"sklearn.ensemble.AdaBoostRegressor",
"sklearn.ensemble.AdaBoostClassifier",
"sklearn.linear_model.LinearRegression",
"sklearn.linear_model.LogisticRegression",
"sklearn.tree.DecisionTreeClassifier"
]
] |
afeinstein20/Eureka | [
"7c330086ff7978b81d0f6ebb83a88c0bee01dc50"
] | [
"eureka/S3_data_reduction/background.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport multiprocessing as mp\nfrom tqdm import tqdm\n\n__all__ = ['BGsubtraction', 'fitbg', 'fitbg2', 'fitbg3']\n\ndef BGsubtraction(data, meta, log, isplots):\n \"\"\"Does background subtraction using inst.fit_bg & background.fitbg\n\n Parameters\n ---... | [
[
"numpy.concatenate",
"numpy.delete",
"numpy.zeros",
"numpy.sum",
"numpy.ones",
"matplotlib.pyplot.plot",
"numpy.shape",
"matplotlib.pyplot.figure",
"numpy.polyval",
"numpy.where",
"numpy.std",
"numpy.argmax",
"numpy.polyfit",
"matplotlib.pyplot.pause",
"... |
nesilin/evolution_TALL_adults | [
"f36d6ebaeb43376096c14fc9ca20116bc2febae6"
] | [
"ext_runs/run_deconstructSig/assign_signature_to_mutation.py"
] | [
"import pandas as pd\nimport os\nimport click\nimport subprocess\n\n@click.command()\n@click.option('--in_path',\n '-i',\n type=click.Path(exists=True),\n required = True,\n help=\"Input must be a string written in command line specifying the absolute path to the ... | [
[
"pandas.concat",
"pandas.read_table",
"pandas.read_csv"
]
] |
lhz1029/DomainBed | [
"c3a3f6363974f5c9b16b82c4159eb54223699f2d"
] | [
"domainbed/networks.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision.models\n\nfrom domainbed.lib import misc\nfrom domainbed.lib import wide_resnet\n\n\nclass Identity(nn.Module):\n \"\"\"An identity layer\"\"\"\n ... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.AdaptiveAvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.GroupNorm",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.functional.relu"
]
] |
firestonelib/PASSL | [
"f08475c7230282ba5185bf1d2bc3ee39f14dfdee"
] | [
"passl/datasets/preprocess/mixup.py"
] | [
"# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.\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 req... | [
[
"numpy.concatenate",
"numpy.full",
"numpy.random.rand",
"numpy.zeros",
"numpy.rint",
"numpy.ones",
"numpy.random.beta",
"numpy.random.randint",
"numpy.sqrt",
"numpy.clip"
]
] |
dcs4cop/xcube-sh | [
"74f7eaab3e43abf2896f04db768131107383563f"
] | [
"test/test_cube.py"
] | [
"# The MIT License (MIT)\n# Copyright (c) 2020 by the xcube development team and contributors\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of\n# this software and associated documentation files (the \"Software\"), to deal in\n# the Software without restriction, including withou... | [
[
"numpy.datetime64"
]
] |
The-Learning-And-Vision-Atelier-LAVA/PoSFeat | [
"e8a42c05158384113e1a0eafecf84b516a88c1f1"
] | [
"losses/kploss.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F \nfrom .preprocess_utils import *\nfrom torch.distributions import Categorical, Bernoulli\n\nclass DiskLoss(nn.Module):\n def __init__(self, configs, device=None):\n super(DiskLoss, self).__init__()\n self.__lossname__ = 'DiskLos... | [
[
"torch.cat",
"torch.distributions.Categorical",
"torch.gather",
"torch.norm",
"torch.no_grad",
"torch.distributions.Bernoulli",
"torch.ones_like",
"torch.exp"
]
] |
truher/FRC2022 | [
"fb8a39d0212e8460669feb282f8b9977f17fdd93"
] | [
"simulator/firing_models/fit_lm.py"
] | [
"# use lmfit to extract some parameters from the simulated data, old-school.\n#\n# note:\n# * i have no model for p(hit). bleah\n# * i'm also not using the precision values, which seems wrong.\n\nfrom typing import Any\nimport pandas as pd # type:ignore\nimport matplotlib.pyplot as plt # type:ignore\nimport numpy ... | [
[
"numpy.random.normal",
"pandas.DataFrame",
"matplotlib.pyplot.show",
"matplotlib.pyplot.tight_layout",
"numpy.arange",
"pandas.unique",
"pandas.read_csv"
]
] |
WillTirone/stats_tools | [
"46f7d203f23049dbb77e0a9f5a3a28a54eec0521"
] | [
"tests/test.py"
] | [
"import unittest\nimport math as m\nimport sys\nimport os\n\nimport numpy as np\nfrom scipy import integrate\nfrom scipy.special import beta\n\n#only necessary while the module is not installed in pckgs\nsys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))\n\nfrom applied_stats import ... | [
[
"numpy.round",
"scipy.special.beta",
"numpy.random.default_rng",
"scipy.integrate.quad"
]
] |
arfon/astropy-lambda | [
"76ad397bb678b6649f8c76ff3665623dc1ef64b3"
] | [
"astropy/table/column.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\nfrom __future__ import (absolute_import, division, print_function,\n unicode_literals)\nfrom ..extern import six\nfrom ..extern.six.moves import zip\n\nimport warnings\nimport weakref\nimport re\n\nfrom copy import deepcopy\n\n... | [
[
"numpy.array",
"numpy.asarray",
"numpy.zeros",
"numpy.ma.MaskedArray.__setitem__",
"numpy.ma.asanyarray",
"numpy.any",
"numpy.asanyarray",
"numpy.ma.array",
"numpy.char.str_len",
"numpy.ma.MaskedArray.__new__",
"numpy.char.encode",
"numpy.insert",
"numpy.dtype"
... |
davidie/Text-Pairs-Relation-Classification | [
"fc4d7a1db2cdb32e048d8a56625d8686e5c25c36"
] | [
"ANN/test_ann.py"
] | [
"# -*- coding:utf-8 -*-\n__author__ = 'Randolph'\n\nimport os\nimport sys\nimport time\nimport numpy as np\nimport tensorflow as tf\nfrom utils import data_helpers as dh\n\n# Parameters\n# ==================================================\n\nlogger = dh.logger_fn('tflog', 'logs/test-{0}.log'.format(time.asctime())... | [
[
"numpy.concatenate",
"tensorflow.flags.DEFINE_string",
"tensorflow.train.latest_checkpoint",
"tensorflow.flags.DEFINE_boolean",
"tensorflow.Graph",
"tensorflow.Session",
"tensorflow.flags.DEFINE_float",
"tensorflow.ConfigProto",
"tensorflow.flags.DEFINE_integer",
"numpy.app... |
bramtoula/singleshotpose | [
"8979087bac76aab7d2e739e3cae726db40a22037"
] | [
"valid.py"
] | [
"import os\nimport time\nimport torch\nimport argparse\nimport scipy.io\nimport warnings\nfrom torch.autograd import Variable\nfrom torchvision import datasets, transforms\n\nimport dataset\nfrom darknet import Darknet\nfrom utils import *\nfrom MeshPly import MeshPly\n\nfrom raptor_specific_utils import *\nimport ... | [
[
"torch.autograd.Variable",
"torch.cuda.manual_seed",
"torch.utils.data.DataLoader"
]
] |
SunnyChing/duckietown5909 | [
"b3c1c0088fb2802c0198b52846a8454f2ec0e79b"
] | [
"catkin_ws/src/f23-LED/led_detection/src/LED_detector_node_sunny.py"
] | [
"#!/usr/bin/env python\nimport rospy\nimport time\nfrom led_detection.LEDDetector import sunny_LEDDetector\nfrom std_msgs.msg import Byte\nfrom duckietown_msgs.msg import Vector2D, LEDDetection, LEDDetectionArray, LEDDetectionDebugInfo, BoolStamped\nfrom sensor_msgs.msg import CompressedImage\nfrom duckietown_utils... | [
[
"numpy.array",
"numpy.zeros"
]
] |
wopsed1004/CompDam_DGD | [
"3c860bbb7985a13fa5468a49007859946ade20b8"
] | [
"pyextmod/verify_debug.py"
] | [
"import numpy as np\nimport CompDam_DGD\nimport helpers as h\nimport os, sys, argparse, inspect, json, re, numpy, shutil\n\nsv_attributes_ignore = ('old', 'debugpy_count', 'direct')\n\ndef _main_entry(args):\n '''\n Loads debug file\n Runs compdam using sv_old\n Writes a json file with the state variabl... | [
[
"numpy.zeros"
]
] |
mkucz95/image_classifier | [
"dd42a3a5c7baa7bd09a70709c14bc183c8af14b1"
] | [
"submission/network.py"
] | [
"import torch\nfrom torch import nn\nimport torch.nn.functional as F\n\nclass Network(nn.Module):\n def __init__(self, input_size, output_size, hidden_layers, drop_p):\n super().__init__()\n self.hidden_layers = nn.ModuleList([nn.Linear(input_size, hidden_layers[0])])\n\n #create hidden laye... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.no_grad",
"torch.FloatTensor",
"torch.nn.functional.log_softmax",
"torch.cuda.is_available",
"torch.exp"
]
] |
Benjamin-Etheredge/siamese | [
"9665d52bb1e8bf329821788332eb38476595a60f"
] | [
"siamese/data/label_utils.py"
] | [
"import tensorflow as tf\nimport os\n\ndef get_labels_from_filenames(files: tf.Tensor, separator='_', label_idx=0):\n if not tf.is_tensor(files):\n files = tf.convert_to_tensor(files)\n\n path_splits = tf.strings.split(files, sep=os.sep)\n filenames = tf.squeeze(path_splits[:, -1:].to_tensor()) # must us... | [
[
"tensorflow.convert_to_tensor",
"tensorflow.is_tensor",
"tensorflow.strings.split"
]
] |
Uason-Chen/SGP-JCA | [
"4ea9d4c7b049fe729ea98c86263ba208871beaf1"
] | [
"main.py"
] | [
"#!/usr/bin/env python\nfrom __future__ import print_function\n\nimport argparse\nimport inspect\nimport os\nimport pickle\nimport random\nimport shutil\nimport sys\nimport time\nfrom collections import OrderedDict\nimport traceback\nfrom sklearn.metrics import confusion_matrix\nimport csv\nimport numpy as np\n\n# ... | [
[
"numpy.concatenate",
"sklearn.metrics.confusion_matrix",
"numpy.array",
"torch.cuda.manual_seed_all",
"torch.max",
"numpy.random.seed",
"numpy.sum",
"torch.no_grad",
"numpy.mean",
"torch.manual_seed",
"torch.load",
"numpy.diag",
"torch.nn.CrossEntropyLoss",
... |
senyang-ml/learning-to-learn-by-pytorch | [
"3d41e96d37045066ba38238b6a08733fd4afb125"
] | [
"project/optim.py"
] | [
"import torch\r\nUSE_CUDA = torch.cuda.is_available()\r\n\r\n\r\n###############################################################\r\n\r\n###################### 手工的优化器 ###################\r\n\r\ndef SGD(gradients, state, learning_rate=0.001):\r\n \r\n return -gradients*learning_rate, state\r\n\r\ndef RMS(gr... | [
[
"torch.optim.Adam",
"torch.cuda.is_available",
"torch.sqrt",
"torch.pow"
]
] |
lm-takumi-nakaso/blueoil | [
"6a5f1cc1fb78c86423338f99cb9dbf506a76f3d6"
] | [
"blueoil/datasets/tfds.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright 2018 The Blueoil 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... | [
[
"tensorflow.compat.v1.data.make_one_shot_iterator",
"tensorflow.concat",
"tensorflow.expand_dims",
"tensorflow.one_hot",
"tensorflow.compat.v1.Session",
"tensorflow.constant",
"tensorflow.slice",
"tensorflow.image.resize",
"tensorflow.cast",
"tensorflow.image.grayscale_to_r... |
foamliu/Face-Recognition | [
"953a949722da04a3d36fdd028f3c786e89d65ed3"
] | [
"demo.py"
] | [
"import json\n\nimport cv2 as cv\nimport dlib\nimport imutils\nimport keras.backend as K\nimport numpy as np\nfrom imutils import face_utils\nfrom keras.applications.inception_resnet_v2 import preprocess_input\nfrom keras.models import load_model\n\nif __name__ == '__main__':\n img_size = 139\n model = load_m... | [
[
"numpy.linalg.norm",
"numpy.empty",
"numpy.zeros",
"numpy.argmin"
]
] |
manuhuth/Replication-of-Bailey-2010- | [
"dbf1cd6c1463d52b569bd2e7ce3ae4624451b422"
] | [
"auxiliary/ext.py"
] | [
"import pandas as pd\r\nimport numpy as np\r\n\r\n\r\n\r\ndef sim_start_val1(models, df, cluster_by, meth ='newton', numb_it = '100', up_bound = 1, low_bound = -1):\r\n \"\"\"Function to create different parameter values for random starting values of the models used in section 5.\r\n \r\n Args:\r\n ... | [
[
"pandas.DataFrame",
"numpy.random.uniform"
]
] |
ArturoDeza/EmergentProperties | [
"c3f0c4a4064c03b12e89f79ddbf6104736ccf231"
] | [
"Square_Cue_Conflict/plot_Square_curves.py"
] | [
"import pandas as pd\nimport numpy as np\nfrom shutil import copyfile\nimport matplotlib.pyplot as plt\nimport scipy\nfrom scipy import stats, optimize, interpolate\nimport math\n\n###############################\n# Trained on Both Distortions #\n###############################\n\n#Model_Type = 'AlexNet'\nModel_Typ... | [
[
"numpy.array",
"matplotlib.pyplot.savefig",
"numpy.sum",
"numpy.load",
"numpy.mean",
"numpy.std",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"numpy.abs",
"numpy.repeat",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
4ndrebar/2dGas | [
"83aa516426efb73f70f10e67879036449f22f1c9"
] | [
"2dgas.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Fri Mar 27 14:42:59 2020\r\nMicroscopic simulaiton of a 2d ideal gas in a fixed volume box.\r\n\r\nThe class swarm is composed by particle objects. \r\nIt has a interaction functions that iterates through particle pairs\r\nchecks for collisions and updates velocities... | [
[
"numpy.append",
"numpy.array",
"numpy.linalg.norm",
"numpy.dot",
"matplotlib.pyplot.sca",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.subplots",
"numpy.arange",
"numpy.abs",
"numpy.clip",
"matplotlib.pyplot.show",
"matplotlib.pyplot.xticks"
]
] |
JiazeWang/reagent | [
"b92c18a339e009504ca51ba5101f8c171b88721e"
] | [
"registration/train_pn_2D_action_divide.py"
] | [
"import numpy as np\nnp.random.seed(42)\nimport torch\ntorch.manual_seed(42)\ntorch.backends.cudnn.deterministic = True\ntorch.backends.cudnn.benchmark = False\ntorch.set_default_dtype(torch.float32)\nimport torch.nn.functional as F\nimport torch.nn as nn\nimport os\nfrom tqdm import tqdm\nfrom prefetch_generator i... | [
[
"torch.zeros",
"torch.cat",
"torch.optim.lr_scheduler.StepLR",
"torch.max",
"numpy.random.seed",
"torch.no_grad",
"numpy.mean",
"torch.cuda.device_count",
"torch.manual_seed",
"torch.cuda.is_available",
"torch.utils.data.TensorDataset",
"torch.utils.data.DataLoader"... |
quanmario0311/medTrans | [
"18bd98789c10dfcff13f03f7efe535e6a77d0a86"
] | [
"lightning_med/models/xcit.py"
] | [
"\"\"\" Cross-Covariance Image Transformer (XCiT) in PyTorch\n\nMostly from timm, with some minor changes\n - https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/xcit.py\n\nSame as the official implementation, with some minor adaptations.\n - https://github.com/facebookresearch/xcit/blob... | [
[
"torch.nn.Linear",
"torch.nn.functional.normalize",
"torch.cat",
"torch.nn.Dropout",
"torch.nn.Identity",
"torch.zeros",
"torch.arange",
"torch.nn.init.constant_",
"torch.nn.BatchNorm2d",
"torch.ones",
"torch.nn.Conv2d",
"torch.div"
]
] |
a-paxton/oss-community-health | [
"93ff4d266b5390b53d8ed59f71616de68bcfdda7"
] | [
"scripts/survivor_analysis/utils/project_features.py"
] | [
"import numpy as np\n\n\ndef compute_bus_factor(commits, n_committers=5):\n \"\"\"\n Compute bus factor\n\n Parameters\n ----------\n commits : pd.DataFrame\n Data Frame containing the commit information.\n\n n_committers : int, optional, default: 5\n Number of committers to consider... | [
[
"numpy.mean",
"numpy.unique"
]
] |
kaitodeesu/project2021 | [
"1b6a850f7c7aaced7173e424c0eca21e8349f071"
] | [
"Untitled2.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[4]:\n\n\nimport numpy as np\nfrom numpy import linalg as LA\n\n\ndimension=2 #次元を指定する\n\ndef randomnumber(dimension): #ランダムな行列の生成\n return np.random.random((dimension,dimension))\n\n\ndef gram(a,b): #規格化\n return ((np.dot(a,b)/np.dot(a,a))*a)\n\n\ndef hermat... | [
[
"numpy.array",
"numpy.linalg.norm",
"numpy.dot",
"numpy.zeros",
"numpy.conjugate",
"numpy.random.random"
]
] |
utcsilab/deep-jsense | [
"9e50b96adb944baeea3e365b4ce59627e310107d"
] | [
"models.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Nov 23 16:17:34 2020\n\n@author: yanni\n\"\"\"\n\nimport torch\nimport sigpy as sp\nimport numpy as np\nimport copy as copy\n\nfrom core_ops import TorchHybridSense, TorchHybridImage\nfrom core_ops import TorchMoDLSense, TorchMoDLImage\nfrom u... | [
[
"torch.nn.Identity",
"torch.cat",
"torch.view_as_real",
"numpy.ceil",
"torch.no_grad",
"numpy.ones",
"torch.view_as_complex",
"torch.ones",
"torch.tensor",
"numpy.repeat",
"numpy.mod",
"numpy.floor"
]
] |
0h-n0/first_deep | [
"8b4b1c3e2198774baaddac7b1045fecc95c59f0b"
] | [
"mnist.py"
] | [
"\"\"\"\nOriginal: https://github.com/pytorch/examples/blob/master/mnist/main.py\n\"\"\"\n\nfrom __future__ import print_function\nimport argparse\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torchvision import datasets, transforms\nimport torchex.nn as ex... | [
[
"torch.nn.Linear",
"torch.device",
"torch.no_grad",
"torch.nn.functional.log_softmax",
"torch.manual_seed",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.cuda.is_available",
"torch.nn.functional.nll_loss",
"torch.nn.functional.max_pool2d"
]
] |
neuromorphs/l2race | [
"ad5271afdd9d81375e45402bbef4a077d4bd45ac"
] | [
"src/controllers/neural_mpc_controller_util/nn_prediction/generate_data.py"
] | [
"import numpy as np\nimport math\nimport csv\nimport pandas as pd\nfrom racing.car import Car\nfrom racing.track import Track\nfrom mppi_mpc.car_controller import CarController\nfrom constants import *\nimport matplotlib.pyplot as plt\nfrom tqdm import trange\n\n\n\ntrack = Track()\ncar = Car(track)\n\npi = math.pi... | [
[
"numpy.random.normal",
"numpy.zeros",
"numpy.random.uniform",
"numpy.append",
"numpy.column_stack"
]
] |
SimranJain13/CarDamageDetection | [
"ba0b8ee6f3445a59723b005799d68e3285cb991d"
] | [
"mrcnn/visualize.py"
] | [
"\"\"\"\r\nMask R-CNN\r\nDisplay and Visualization Functions.\r\n\r\nCopyright (c) 2017 Matterport, Inc.\r\nLicensed under the MIT License (see LICENSE for details)\r\nWritten by Waleed Abdulla\r\n\"\"\"\r\n\r\nimport os\r\nimport sys\r\nimport random\r\nimport itertools\r\nimport colorsys\r\n\r\nimport numpy as np... | [
[
"numpy.random.choice",
"numpy.random.rand",
"numpy.where",
"matplotlib.patches.Rectangle",
"numpy.concatenate",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.subplot",
"matplotlib.lines.Line2... |
kapseliboi/Datascope | [
"c781bc70bf644365a48f63cb560a9d2fe0ae2e3b"
] | [
"public/data/testimages/generate-images.py"
] | [
"import numpy, Image\n\nfor n in xrange(10000):\n a = numpy.random.rand(64,64,3) * 255\n im_out = Image.fromarray(a.astype('uint8')).convert('RGBA')\n im_out.save('%000d.jpg' % n)"
] | [
[
"numpy.random.rand"
]
] |
zerohd4869/Chinese-NER | [
"53e259690538a54761a16caa41cc78535d61aa04"
] | [
"model/cw_ner/modules/highway.py"
] | [
"\n\"\"\"\nimplements of the highway net\ninclude two gate: transform gate(G_T) and carry gate(G_C)\n H = w_h * x + b_h\n G_T = sigmoid(w_t * x + b_t)\n G_C = sigmoid(w_c * x + b_c)\noutputs:\n outputs = G_T * H + G_C * x\n\nfor sample:\n G_C = (1 - G_T), then:\n outputs = G_T * H + (1 - G_T) * x\... | [
[
"torch.nn.Linear",
"torch.nn.functional.sigmoid"
]
] |
mellis13/SmartRedis | [
"b3d0bd07b53138f8b30cbb3291125e33839977d2"
] | [
"tests/python/test_put_get_dataset.py"
] | [
"# BSD 2-Clause License\n#\n# Copyright (c) 2021, Hewlett Packard Enterprise\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above c... | [
[
"numpy.array",
"numpy.testing.assert_array_equal"
]
] |
delldu/Fast-Image-Filters | [
"c238214fa4aaf1b4790b29e7306d6f772e1acf07"
] | [
"project/model_helper.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\n\n\nclass AdaptiveBatchNorm2d(nn.Module):\n\n \"\"\"Adaptive batch normalization\"\"\"\n\n def __init__(self, num_feat, eps=1e-5, momentum=0.1, affine=True):\n \"\"\"Adaptive batch normalization\"\"\"\n super().__init__()\n self.bn... | [
[
"torch.zeros",
"torch.nn.Identity",
"numpy.zeros",
"numpy.minimum",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.nn.LeakyReLU",
"torch.nn.init.xavier_uniform_",
"torch.no_grad",
"torch.ones",
"torch.from_numpy",
"torch.nn.Conv2d",
"torch.nn.init.zeros_"... |
ollitapa/pycolortools | [
"8e0d28411ccbd96de036e81845b217d05a4eee44"
] | [
"tester.py"
] | [
"#\n# Copyright 2015 Olli Tapaninen, VTT Technical Research Center of Finland\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#... | [
[
"numpy.array"
]
] |
Miffyli/minecraft-bc-2020 | [
"94f8706e547474a2ed8cacd41bb20e59f672215f"
] | [
"torch_codes/modules.py"
] | [
"#\n# PyTorch networks and modules\n#\n\nfrom collections import OrderedDict\nimport math\n\nimport torch\nfrom torch import nn\nimport torch.nn.functional as F\n\n# References:\n# [1] IMPALA. https://arxiv.org/pdf/1802.01561.pdf\n# [2] R2D3. https://arxiv.org/pdf/1909.01387.pdf\n# [3] Unixpickle's work https://git... | [
[
"torch.nn.Linear",
"torch.zeros",
"torch.cat",
"torch.rand",
"torch.nn.LSTM",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.no_grad",
"torch.ones",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.functional.relu"
]
] |
rmardushall/openmc | [
"62d4f725b027f1b65755e5a150a153dd1deba481"
] | [
"openmc/material.py"
] | [
"from collections import OrderedDict\nfrom copy import deepcopy\nfrom numbers import Real, Integral\nimport warnings\nfrom xml.etree import ElementTree as ET\n\nfrom six import string_types\nimport numpy as np\n\nimport openmc\nimport openmc.data\nimport openmc.checkvalue as cv\nfrom openmc.clean_xml import sort_xm... | [
[
"numpy.all",
"numpy.sum",
"numpy.array"
]
] |
rusher321/RNA-seq-2019nCov | [
"b216b66ab618489dfa66686a813003107f3b8837"
] | [
"sample.py"
] | [
"#!/usr/bin/env python\nimport glob\nimport os\nimport pandas as pd\n\n\ndef samples_validator(sample_df, input_type, is_pe):\n error_count = 0\n for i in sample_df.index:\n if input_type == \"fastq\":\n if is_pe:\n fq1 = sample_df.loc[[i], \"fq1\"].dropna().tolist()\n ... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
mixxen/imgclsmob | [
"64e39e117327ca25bed8a98b9a81c397c76a8220"
] | [
"keras_/kerascv/models/squeezenet.py"
] | [
"\"\"\"\n SqueezeNet for ImageNet-1K, implemented in Keras.\n Original paper: 'SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and <0.5MB model size,'\n https://arxiv.org/abs/1602.07360.\n\"\"\"\n\n__all__ = ['squeezenet', 'squeezenet_v1_0', 'squeezenet_v1_1', 'squeezeresnet_v1_0', 'squeezeres... | [
[
"tensorflow.keras.layers.add",
"tensorflow.keras.layers.Input",
"numpy.zeros",
"tensorflow.keras.layers.Activation",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.AvgPool2D"
]
] |
mycarta/bruges | [
"4b7dd42e96d477ffaaedd9134f9f7b7b60dd7123"
] | [
"bruges/util/util.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nUtility functions.\n\n:copyright: 2015 Agile Geoscience\n:license: Apache 2.0\n\"\"\"\nimport functools\nimport inspect\nimport warnings\n\nimport scipy.signal\nimport numpy as np\n\n\ngreek = {\n 'Alpha': 'Α',\n 'Beta': 'Β',\n 'Gamma': 'Γ',\n 'Delta': 'Δ',\n 'Epsilo... | [
[
"numpy.array",
"numpy.isnan",
"numpy.sum",
"numpy.ones",
"numpy.nanmin",
"numpy.sqrt",
"numpy.abs",
"numpy.log2",
"numpy.convolve"
]
] |
DanNduati/Parking-Management-System | [
"0bd9c254c49f9685b4442fbec43e36b5fb2b471b"
] | [
"tests/car_detection/car_detect.py"
] | [
"import os\nimport cv2\nimport numpy as np\nfrom os.path import join, dirname\n\n# Trained XML car classifier that describes some features of cars which we want to detect\ncascade_file = join(dirname(__file__), \"haarcascade_car.xml\")\ncars_cascade = cv2.CascadeClassifier(cascade_file)\nvideos_directory = join(os.... | [
[
"numpy.random.randint"
]
] |
djp42/IntentionPrediction | [
"9f260133f4b649e446166775b54885147d78393c"
] | [
"deprecated/signals_util.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Aug 10 10:06:07 2016\n\n@author: LordPhillips\n\ntraffic signal utilities\n\n\"\"\"\n\nfrom utils import vehicleclass as v\nfrom utils import driver_util as dru\nfrom utils import constants as c\nfrom utils import data2_class as dd2\nfrom utils import frame_util as f... | [
[
"matplotlib.pyplot.clf",
"matplotlib.pyplot.figure"
]
] |
BinhMisfit/vietnamese-punctuation-prediction | [
"c9ae9f89fc61e47fce08238c6aad88e9e69e74c8"
] | [
"Vietnamese_newspapers/train_BiLSTM_CRF__focal_loss_model.py"
] | [
"from preprocessing import process_data\r\nfrom model import BiLSTM_model, batchnize_dataset, BiLSTM_CRF_model,BiLSTM_Attention_model\r\n# dataset path\r\nraw_path = 'dataset/Cleansed_data'\r\nsave_path = \"dataset/Encoded_data\"\r\n# embedding path\r\nWord2vec_path = \"embeddings\"\r\n\r\nchar_lowercase = True\r\n... | [
[
"tensorflow.reset_default_graph"
]
] |
sk-ip/dffml | [
"1ef5a169327d71baecd5eccae83ad4a9999ccad1"
] | [
"model/xgboost/examples/iris_classification.py"
] | [
"from sklearn.datasets import load_iris\nfrom sklearn.model_selection import train_test_split\n\nfrom dffml import Feature, Features\nfrom dffml.noasync import train, accuracy\nfrom dffml.accuracy import ClassificationAccuracy\nfrom dffml_model_xgboost.xgbclassifier import (\n XGBClassifierModel,\n XGBClassif... | [
[
"sklearn.model_selection.train_test_split",
"sklearn.datasets.load_iris"
]
] |
anshumandutt/AreCELearnedYet | [
"e2286c3621dea8e4961057b6197c1e14e75aea5a"
] | [
"lecarb/workload/workload.py"
] | [
"import csv\nfrom collections import OrderedDict\nfrom typing import Dict, NamedTuple, Optional, Tuple, List, Any\nimport pickle\nimport numpy as np\n\nfrom ..dtypes import is_categorical\nfrom ..constants import DATA_ROOT, PKL_PROTO\nfrom ..dataset.dataset import Table, load_table\n\nclass Query(NamedTuple):\n ... | [
[
"numpy.array",
"numpy.arange",
"numpy.argmax",
"numpy.append"
]
] |
NikDemoShow/openvino | [
"31907e51e96f1603753dc69811bdf738374ca5e6"
] | [
"model-optimizer/unit_tests/extensions/middle/InsertSelect_test.py"
] | [
"# Copyright (C) 2018-2021 Intel Corporation\n# SPDX-License-Identifier: Apache-2.0\n\nimport unittest\n\nimport numpy as np\n\nfrom extensions.middle.InsertSelect import AddSelectBeforeMemoryNodePattern\nfrom mo.front.common.partial_infer.utils import int64_array\nfrom mo.utils.ir_engine.compare_graphs import comp... | [
[
"numpy.array"
]
] |
ZhaoJackie/fix-yahoo-finance | [
"d21b9c984572c514d73207781ecb855e49085e5b"
] | [
"fix_yahoo_finance/__init__.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Yahoo! Finance market data downloader (+fix for Pandas Datareader)\n# https://github.com/ranaroussi/fix-yahoo-finance\n#\n# Copyright 2017-2019 Ran Aroussi\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file excep... | [
[
"pandas.to_datetime",
"pandas.DataFrame",
"pandas.concat",
"numpy.round"
]
] |
phernst/TIGRE | [
"220935ae7a6a002d64ea95ed8b6f69baae2f9d21"
] | [
"Python/setup.py"
] | [
"import copy\r\nimport glob\r\nimport os\r\nfrom os.path import join as pjoin\r\nimport re\r\nimport subprocess\r\nimport sys\r\n\r\nfrom Cython.Distutils import build_ext\r\nimport numpy\r\nfrom setuptools import setup, find_packages, Extension\r\n\r\n\r\nIS_WINDOWS = sys.platform == 'win32'\r\n\r\n\r\n# Code from... | [
[
"numpy.get_numpy_include",
"numpy.get_include"
]
] |
laya-laya/minimum-dominating-set | [
"6f294922c9859a0b76b57cd9e290f5f5919fefdc"
] | [
"mds.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Nov 16 17:04:47 2020\n\n@author: layaparkavousi\n\"\"\"\n\nimport pulp \nimport networkx as nx\nfrom numpy import genfromtxt\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport time\n## preparing the dataset and the adjacency matrix\... | [
[
"numpy.genfromtxt",
"matplotlib.pyplot.figure"
]
] |
TihonkovSergey/wood_coefficient | [
"853a2e5babda662f71697045875a2e24e17f9df6"
] | [
"interface.py"
] | [
"import json\n\nimport seaborn as sns\nimport streamlit as st\nimport matplotlib.pyplot as plt\nimport cv2\n\nfrom src.data.data_load import get_image_by_path\nfrom src.utils.utils import get_front_images_paths\nfrom src.data.data_preprocessing import filter_image\nfrom definitions import DATA_DIR\n\nif __name__ ==... | [
[
"matplotlib.pyplot.subplots"
]
] |
yilingjia/BanditLib | [
"aab74f65d576f964e233a685e98bc6c1fd940686"
] | [
"lib/factorUCB.py"
] | [
"import numpy as np\nfrom util_functions import vectorize, matrixize\nfrom lib.BaseAlg import BaseAlg\n\n\nclass FactorUCBArticleStruct:\n def __init__(\n self,\n id,\n context_dimension,\n latent_dimension,\n lambda_,\n W,\n init=\"random\",\n context_feat... | [
[
"numpy.dot",
"numpy.random.rand",
"numpy.zeros",
"numpy.log",
"numpy.identity",
"numpy.transpose",
"numpy.outer",
"numpy.linalg.inv"
]
] |
TachibanaET/CODSUG2 | [
"e3c064fd59067d88d2899a7da36fe5c83bac9537"
] | [
"source/model_fine_tune.py"
] | [
"import json\nimport os\nimport numpy as np\nimport argparse\nfrom tqdm import tqdm\nfrom utility.encode_bpe import BPEEncoder_ja\nimport torch\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom transformers import GPT2Tokenizer, GPT2LMHeadModel\nfrom transformers import AdamW, get_linear_schedule_... | [
[
"torch.cuda.is_available",
"torch.nn.DataParallel"
]
] |
zdbzdb1212/hyppo | [
"5092beedec0a0c13ffa69f7a77f4ee30f3294256"
] | [
"hyppo/ksample/manova.py"
] | [
"import numpy as np\nfrom numba import jit\nfrom scipy.stats import f\n\nfrom ._utils import _CheckInputs\nfrom .base import KSampleTest, KSampleTestOutput\n\n\nclass MANOVA(KSampleTest):\n r\"\"\"\n Multivariate analysis of variance (MANOVA) test statistic and p-value.\n\n MANOVA is the current standard f... | [
[
"numpy.zeros",
"numpy.sum",
"numpy.linalg.pinv",
"scipy.stats.f.sf",
"numpy.min",
"numpy.abs",
"numpy.vstack"
]
] |
citrusjunos/mwe_aware_dependency_parsing | [
"4b3aca38463293e0f819582e117a8878465b20e5"
] | [
"hmtl/models/relation_extraction.py"
] | [
"# coding: utf-8\n\nimport logging\nimport math\nfrom typing import Any, Dict, List, Optional, Tuple\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable # from torch.nn.parameter import Parameter, Variable\n\nfrom overrides import overrides\n\nfrom allennlp.... | [
[
"torch.zeros",
"torch.sigmoid",
"torch.round",
"torch.nn.init.kaiming_normal_",
"torch.nn.init.normal_",
"torch.nn.BCEWithLogitsLoss",
"torch.nn.functional.relu",
"torch.Tensor",
"torch.matmul",
"torch.nn.functional.tanh"
]
] |
cthoyt-forks-and-packages/AutomatedSeriesClassification | [
"8057137619bc7b0b9692ffca2e750624e020a5db"
] | [
"AutomatedSeriesClassification/mainSeriesClassification.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Jan 27 16:40:49 2020\n\n@author: krugefr1\n\"\"\"\n\nimport numpy as np\nimport os\ntry:\n import arthor\nexcept ImportError:\n arthor = None\nfrom rdkit import Chem\nfrom rdkit.Chem import rdSubstructLibrary\nimport pickle\nimport rando... | [
[
"pandas.DataFrame",
"numpy.array",
"numpy.argmax"
]
] |
ZiyangTian/TrajectoryForecaster | [
"63ab3d7b97ec5dfbb1250af114038a6ad5a7faa9"
] | [
"forecaster/data/dataset_utils.py"
] | [
"\"\"\" Dataset utilities. \"\"\"\nimport functools\nimport tensorflow as tf\n\n\ndef named_dataset(dataset, names, num_parallel_calls=None):\n \"\"\"Create a `Dataset` by adding nested feature names to an existed `Dataset`.\n Arguments:\n dataset: A nested `tuple` structured `Dataset`.\n ... | [
[
"tensorflow.data.Dataset.zip"
]
] |
hanhtong/Effective-Instructions- | [
"a1766f300c4e613b4ce10e9b6eae1b14e43c7d60"
] | [
"instruction_env/Lib/site-packages/scipy/linalg/_decomp_qz.py"
] | [
"import warnings\n\nimport numpy as np\nfrom numpy import asarray_chkfinite\n\nfrom .misc import LinAlgError, _datacopied, LinAlgWarning\nfrom .lapack import get_lapack_funcs\n\n\n__all__ = ['qz', 'ordqz']\n\n_double_precision = ['i', 'l', 'd']\n\n\ndef _select_function(sort):\n if callable(sort):\n # ass... | [
[
"numpy.asarray_chkfinite",
"numpy.real",
"numpy.empty_like",
"numpy.asarray"
]
] |
FasrReactor/OpenBPS | [
"8b674ba810be36d863d261024330f271e6b31ed9"
] | [
"scripts/prepro.py"
] | [
"import re\nimport os\nimport sys\nimport numpy as np\nfrom pathlib import Path\n#\nMT = {18 : 'fission', 16 : '(n,2n)', 17 : '(n,3n)',\n 102 : '(n,gamma)', 103 : '(n,p)', 107 : '(n,a)'}\n\ndef parse_prepros(path, numproc=1):\n \"\"\"Parse prepro results\n\n Parametres:\n -----------\n path : str\n... | [
[
"numpy.zeros"
]
] |
jhurt/audio | [
"16de2b5b791bacfa8fb65b6fec3062d2e71fd725"
] | [
"torchaudio/functional/filtering.py"
] | [
"import math\nfrom typing import Optional\n\nimport torch\nfrom torch import Tensor\n\nimport torchaudio._internal.fft\n\n\ndef _dB2Linear(x: float) -> float:\n return math.exp(x * math.log(10) / 20.0)\n\n\ndef _generate_wave_table(\n wave_type: str,\n data_type: str,\n table_size: int,\n min: float,... | [
[
"torch.zeros",
"torch.round",
"torch.cat",
"torch.device",
"torch.bartlett_window",
"torch.floor",
"torch.sin",
"torch.arange",
"torch.max",
"torch.hann_window",
"torch.stack",
"torch.clamp",
"torch.randint",
"torch.tensor",
"torch.frac",
"torch.zero... |
Line290/tsn-pytorch | [
"91ee075b98df9fa063adc57b296cb5fe15f43f8a"
] | [
"models.py"
] | [
"from torch import nn\n\nfrom ops.basic_ops import ConsensusModule, Identity\nfrom transforms import *\nfrom torch.nn.init import normal, constant\n\nclass TSN(nn.Module):\n def __init__(self, num_class, num_segments, modality,\n base_model='resnet101', new_length=None,\n consensu... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.init.constant",
"torch.nn.Softmax",
"torch.nn.init.normal"
]
] |
t871005y/structural-analogy-cut | [
"3159dbc96124e73382f9497457902610ade46237"
] | [
"imresize.py"
] | [
"import numpy as np\nfrom scipy.ndimage import filters, measurements, interpolation\nfrom skimage import color\nfrom math import pi\n#from SinGAN.functions import torch2uint8, np2torch\nimport torch\n\n\ndef denorm(x):\n out = (x + 1) / 2\n return out.clamp(0, 1)\n\ndef norm(x):\n out = (x - 0.5) * 2\n ... | [
[
"torch.stack",
"numpy.copy",
"numpy.finfo",
"torch.cuda.is_available",
"scipy.ndimage.measurements.center_of_mass",
"numpy.max",
"numpy.zeros_like",
"numpy.sin",
"numpy.swapaxes",
"numpy.arange",
"numpy.ndim",
"scipy.ndimage.filters.correlate",
"numpy.expand_dim... |
PangHua/InfiniteScience | [
"67378d2625c4d70d5b59d5e7a3f904284bfe65da"
] | [
"examples/lettuce_paddle/lettuce/reporters.py"
] | [
"# code was heavily based on https://github.com/lettucecfd/lettuce\r\n# Users should be careful about adopting these functions in any commercial matters.\r\n# https://github.com/lettucecfd/lettuce#license\r\n\r\n\"\"\"\r\nInput/output routines.\r\nTODO: Logging\r\n\"\"\"\r\n\r\nimport sys\r\nimport warnings\r\nimpo... | [
[
"matplotlib.pyplot.savefig",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"matplotlib.pyplot.subplots"
]
] |
zengjia110/tensorflow | [
"6dd278831a62be829ce6f15039e5b6b368b3727c"
] | [
"tensorflow/python/client/timeline_test.py"
] | [
"# Copyright 2016 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.core.protobuf.config_pb2.ConfigProto",
"tensorflow.python.client.timeline.Timeline",
"tensorflow.python.framework.test_util.IsMklEnabled",
"tensorflow.python.ops.variables.Variable",
"tensorflow.core.protobuf.config_pb2.RunOptions",
"tensorflow.python.client.session.Session",
... |
schlafly/gfa_reduce | [
"9f68a8245a2f1bef3e11901bca7a4c6f45587faa"
] | [
"py/ci_reduce/analysis/djs_maskinterp.py"
] | [
"import numpy as np\nfrom scipy.interpolate import interp1d\nimport astropy.io.fits as fits\nimport time\n\ndef maskinterp1(yval, mask):\n# omitting xval arg (assume regular grid), omitting const kw arg\n# (assume const=True behavior is desired)\n\n yval = np.array(yval)\n\n mask = mask.astype(int)\n\n bad... | [
[
"numpy.array",
"scipy.interpolate.interp1d",
"numpy.sum",
"numpy.where",
"numpy.unique"
]
] |
Cyberpredator21/Test | [
"1025e359f103e2256ded9821f40db7e3d8eb1584"
] | [
"iris.py"
] | [
"import pandas as pd\nimport numpy as np\nimport pickle\n\ndf = pd.read_csv('iris.data')\n\nX = np.array(df.iloc[:, 0:4])\ny = np.array(df.iloc[:, 4:])\n\nfrom sklearn.preprocessing import LabelEncoder\nle = LabelEncoder()\ny = le.fit_transform(y)\n\nfrom sklearn.model_selection import train_test_split\nX_train, X_... | [
[
"numpy.array",
"sklearn.preprocessing.LabelEncoder",
"sklearn.svm.SVC",
"sklearn.model_selection.train_test_split",
"pandas.read_csv"
]
] |
Adrian609/google-research | [
"88481d10a87947ffb9305dc7665682e008b27391"
] | [
"uncertainties/scripts/train.py"
] | [
"# coding=utf-8\n# Copyright 2019 The Google Research 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 requ... | [
[
"tensorflow.compat.v1.gfile.Open",
"numpy.load",
"numpy.save",
"tensorflow.compat.v1.keras.utils.to_categorical",
"numpy.vstack"
]
] |
Sharad24/ignite | [
"0de7156bb284bd01d788252469a3b386f10abbd7"
] | [
"tests/ignite/metrics/test_frequency.py"
] | [
"import time\n\nimport pytest\n\nimport torch.distributed as dist\n\nfrom ignite.engine import Engine, Events\nfrom ignite.metrics import Frequency\n\n\ndef test_nondistributed_average():\n artificial_time = 1 # seconds\n num_tokens = 100\n average_upper_bound = num_tokens / artificial_time\n average_l... | [
[
"torch.distributed.get_world_size"
]
] |
lilchurro/PoseidonML | [
"22a7e91ebb4c747831b6fdb840a13bf0ad1e3c15"
] | [
"networkml/utils/common.py"
] | [
"import ast\nimport logging\nimport os\n\nimport numpy as np\nimport pika\nfrom redis import StrictRedis\n\n\nclass Common:\n \"\"\"\n Common functions that are shared across models\n \"\"\"\n\n def __init__(self, config=None):\n self.logger = logging.getLogger(__name__)\n logging.basicCon... | [
[
"numpy.exp",
"numpy.zeros"
]
] |
geraldomacias/MarkLogic | [
"996c48a970a24aa7e5af4752fe9c12b63d4834fe"
] | [
"services/machine_learning/project/linearSVC.py"
] | [
"# Db stuff\nfrom project import db\nfrom project.api.models import decode_auth_token, MLStatus\n\n# Machine learning\nimport sys\nimport json\nimport pandas as pd\nimport requests\nfrom sklearn import preprocessing\nfrom collections import defaultdict\nfrom sklearn.svm import LinearSVC\nfrom sklearn.model_selectio... | [
[
"pandas.DataFrame",
"sklearn.feature_extraction.text.HashingVectorizer",
"sklearn.model_selection.train_test_split",
"pandas.read_csv",
"sklearn.svm.LinearSVC"
]
] |
mrdrozdov/allRank | [
"6cc5675d467f4fc8bfb5beba92d9c052ff725346"
] | [
"allrank/main.py"
] | [
"from urllib.parse import urlparse\nimport hashlib\nimport collections\n\nfrom tqdm import tqdm\n\nimport allrank.models.losses as losses\nimport numpy as np\nimport os\nimport torch\nfrom allrank.config import Config\nfrom allrank.data.dataset_loading import load_libsvm_dataset, create_data_loaders\nfrom allrank.m... | [
[
"numpy.concatenate",
"torch.cat",
"torch.cuda.manual_seed_all",
"numpy.random.seed",
"torch.cuda.device_count",
"torch.manual_seed",
"torch.from_numpy",
"numpy.memmap",
"torch.autograd.detect_anomaly",
"torch.chunk",
"numpy.unique"
]
] |
kgruchal/bring-me-a-shrubbery | [
"cdfba30ffccb997876b05ae3f260960daad18215"
] | [
"common.py"
] | [
"import math\n\nimport numpy as np\n\n\ndef in_hull(p, hull):\n \"\"\"\n Test if points in `p` are in `hull`\n\n `p` should be a `NxK` coordinates of `N` points in `K` dimensions\n `hull` is either a scipy.spatial.Delaunay object or the `MxK` array of the \n coordinates of `M` points in `K`dimensions... | [
[
"numpy.full",
"numpy.array",
"numpy.delete",
"numpy.linalg.norm",
"numpy.sin",
"numpy.zeros",
"numpy.round",
"numpy.stack",
"numpy.random.randint",
"numpy.arctan2",
"numpy.hypot",
"numpy.arange",
"numpy.average",
"numpy.argmax",
"numpy.cos",
"scipy.s... |
theboyslush/mila | [
"274da1d3c7e7e4385fa58eb6aebd24c5ef7fed4d"
] | [
"nlu/classifier.py"
] | [
"from tensorflow.keras.models import load_model\nimport numpy as np\n\nlabels = open('nlu\\entities.txt', 'r', encoding='utf-8').read().split('\\n')\nmodel = load_model('nlu\\model.h5')\n\nlabel2idx = {}\nidx2label = {}\n\nfor k, label in enumerate(labels):\n label2idx[label] = k\n idx2label[k] = label\n\n\n#... | [
[
"tensorflow.keras.models.load_model",
"numpy.zeros"
]
] |
deel-ai/xplique | [
"1c493cf290970d05f1430cee04e2cd590d303f9c"
] | [
"xplique/attributions/occlusion.py"
] | [
"\"\"\"\nModule related to Occlusion sensitivity method\n\"\"\"\n\nfrom math import ceil\n\nimport numpy as np\nimport tensorflow as tf\n\nfrom .base import BlackBoxExplainer, sanitize_input_output\nfrom ..commons import repeat_labels, batch_tensor\nfrom ..types import Callable, Tuple, Union, Optional\n\n\nclass Oc... | [
[
"tensorflow.zeros",
"tensorflow.concat",
"numpy.zeros",
"tensorflow.expand_dims",
"tensorflow.logical_not",
"tensorflow.reduce_sum",
"tensorflow.repeat",
"tensorflow.cast"
]
] |
pzwickl/PZ-Thesis | [
"39354e724d11249a3b7e7082b4519b05af5faaa3"
] | [
"VNQ/vod/configuration.py"
] | [
"__author__ = 'patrick'\n\nimport numpy as np\n\npound_to_euro = 1.2618898\ndollar_to_euro = 1\n\ndef dollar(value):\n return value*dollar_to_euro\n\ndef pound(value):\n return value*pound_to_euro\n\ndef million(value):\n return value * 1000 * 1000\n\ndef billion(value):\n return 1000 * million(value)\n... | [
[
"numpy.average",
"numpy.sum"
]
] |
Lauffenburger-Lab/Artificial-Signaling-Network | [
"707e79c7e2ad341d68a719443b9e17fe9e7bb7c1"
] | [
"Model/ligandScreenCrossValidationResults.py"
] | [
"import torch\nimport numpy\nimport matplotlib.pyplot as plt\nimport bionetwork\nimport plotting\nimport pandas\nfrom scipy.stats import pearsonr\nimport seaborn as sns\nfrom scipy.stats import mannwhitneyu\nfrom sklearn.linear_model import LinearRegression\n\n#Load network\nnetworkList, nodeNames, modeOfAction = b... | [
[
"matplotlib.pyplot.text",
"matplotlib.pyplot.xlim",
"sklearn.linear_model.LinearRegression",
"numpy.mean",
"scipy.stats.pearsonr",
"pandas.read_csv",
"matplotlib.pyplot.savefig",
"pandas.DataFrame",
"scipy.stats.mannwhitneyu",
"torch.tensor",
"matplotlib.pyplot.gca",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.