repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
cpsc532s-cc/CLVM_Test
[ "b814c47b3e5fbc053d083927dc00032530176745" ]
[ "multi_timescale_clvm.py" ]
[ "import numpy as np\nimport math\nimport pdb\nnp.cat = np.concatenate\nnp.random.seed(100)\nimport torch as t \nimport torch.nn as nn\nimport torch.nn.functional as f\nimport torch.optim as opt\nimport os.path\nfrom torch import FloatTensor as FT\nfrom variational_methods import *\nfrom gutenberg_data import *\nfro...
[ [ "torch.nn.functional.softmax", "numpy.sqrt", "torch.zeros", "torch.cat", "torch.sum", "torch.FloatTensor", "numpy.cat", "numpy.eye", "numpy.save", "numpy.load", "numpy.zeros", "torch.LongTensor", "numpy.random.random_integers", "torch.nn.Conv1d", "numpy....
sergioruiz/problemsolvingpython
[ "4620ac3bc09402415149840df14f051f1a44b682" ]
[ "Plot1.py" ]
[ "#https://matplotlib.org/users/pyplot_tutorial.html\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\n\r\n# evenly sampled time at 200ms intervals\r\nt = np.arange(0., 5., 0.2)\r\nprint(t)\r\n\r\n# red dashes, blue squares and green triangles\r\nplt.plot(t, t, 'r--', t, t**2, 'bs', t, t**3, 'g^')\r\nplt.p...
[ [ "matplotlib.pyplot.plot", "numpy.arange", "matplotlib.pyplot.show" ] ]
owen1998-liu/deepdow
[ "a815fb8072015b79e90aef619c196ea9a9389e7f" ]
[ "examples/var_model.py" ]
[ "\"\"\"\n=====================\nVector autoregression\n=====================\n\nThis example demonstrates how one can validate :code:`deepdow` on synthetic data.\nWe choose to model our returns with the vector autoregression model (VAR).\nThis model links future returns to lagged returns with a linear\nmodel. See [...
[ [ "matplotlib.pyplot.legend", "torch.zeros", "numpy.eye", "matplotlib.pyplot.subplots", "numpy.stack", "numpy.load" ] ]
udayagopi587/ArealRobotics_AutonomousDrone
[ "6bc10ee167076086abb3b2eef311ae43f457f21d" ]
[ "FaceTrackingDrone/utlis.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Tue Feb 22 23:00:07 2022\r\n\r\n@author: udaya\r\n\"\"\"\r\n\r\nfrom djitellopy import Tello\r\nimport cv2\r\nimport numpy as np\r\n \r\n \r\ndef initializeTello():\r\n myDrone = Tello()\r\n myDrone.connect()\r\n myDrone.for_back_velocity = 0\r\n myDrone....
[ [ "numpy.clip" ] ]
unimauro/Courses
[ "81e5b9c4cbc9b875eff82f96bda7d21ec4f258b2", "81e5b9c4cbc9b875eff82f96bda7d21ec4f258b2" ]
[ "DevOps/Data_Science_in_Production/cap01/LinearRegression.py", "DevOps/Data_Science_in_Production/cap01/LoadPandasDataFrame.py" ]
[ "from sklearn.linear_model import LinearRegression\nfrom sklearn.model_selection import train_test_split\n# See Section 1.4 (Boston Hosing data set)\nbostonDF = ...\nx_train, x_test, y_train, y_test = train_test_split(\nbostonDF.drop(['label'],axis=1),bostonDF['label'],test_size=0.3)\nmodel = LinearRegression()\nmo...
[ [ "sklearn.linear_model.LinearRegression" ], [ "pandas.read_csv" ] ]
vishwas1234567/tensor2tensor
[ "d62e2ee1b069d3d9b327d4d2dd6f9e50b7e62bb3", "d62e2ee1b069d3d9b327d4d2dd6f9e50b7e62bb3", "d62e2ee1b069d3d9b327d4d2dd6f9e50b7e62bb3", "d62e2ee1b069d3d9b327d4d2dd6f9e50b7e62bb3", "d62e2ee1b069d3d9b327d4d2dd6f9e50b7e62bb3" ]
[ "tensor2tensor/models/research/glow.py", "tensor2tensor/models/vanilla_gan.py", "tensor2tensor/data_generators/transduction_problems_test.py", "tensor2tensor/rl/envs/tf_atari_wrappers.py", "tensor2tensor/utils/rouge_test.py" ]
[ "# coding=utf-8\n# Copyright 2019 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...
[ [ "numpy.log", "tensorflow.Print", "tensorflow.zeros", "tensorflow.cast", "tensorflow.floor", "tensorflow.zeros_like", "tensorflow.variable_scope", "tensorflow.add_to_collection" ], [ "tensorflow.compat.v1.random_normal_initializer", "tensorflow.compat.v1.nn.sigmoid", ...
AliKhoda/DeepFish
[ "6769e83ab0b586e49f48e28f70607d33b5c36718" ]
[ "src/wrappers/clf_wrapper.py" ]
[ "import torch\nimport torch.nn.functional as F\nimport torchvision\nfrom torchvision import transforms\nimport os\nimport numpy as np\nimport time\nfrom src import utils as ut\nfrom sklearn.metrics import confusion_matrix\nimport skimage\nfrom src import wrappers\nfrom torchvision import transforms\n\nfrom haven im...
[ [ "torch.sigmoid", "numpy.array" ] ]
lweasel/piquant
[ "d9e8a15fd152413e85c42c3c6bc6e6afec5e7811" ]
[ "test/test_statistics.py" ]
[ "import piquant.statistics as statistics\nimport piquant.tpms as t\nimport numpy as np\nimport pandas as pd\nimport scipy.stats as scistats\nimport test_tpms\n\n\ndef _get_test_tpms():\n tpms = pd.DataFrame.from_dict({\n t.REAL_TPM: test_tpms.REAL_TPMS_VALS,\n t.CALCULATED_TPM: test_tpms.CALC_TPMS_...
[ [ "numpy.median", "numpy.array", "pandas.DataFrame.from_dict" ] ]
hi-paris/structured-predictions
[ "f28db05a1def9ce7aec59375235aa92dc0cc7bfc" ]
[ "stpredictions/models/DIOKR/estimator.py" ]
[ "import torch.optim as optim\nfrom scipy.linalg import block_diag\n\n# from stpredictions.models.DIOKR.cost import *\n# from stpredictions.models.DIOKR.kernel import *\nfrom stpredictions.models.DIOKR.IOKR import *\n\ndtype = torch.float\n\n\nclass DIOKREstimator(object):\n \"DIOKR Class with fitting procedure u...
[ [ "scipy.linalg.block_diag" ] ]
acolombi/pymc3
[ "4e695f635b2ead24e2e647651eadd2505ab1fa63", "fde52a4a69be1b0887a2f7861801fb48c941bbe6", "3cb45700156b63e786eb70909d3e1d6e1f21703a", "3cb45700156b63e786eb70909d3e1d6e1f21703a" ]
[ "pymc3/glm/linear.py", "pymc3/tuning/scaling.py", "pymc3/util.py", "pymc3/parallel_sampling.py" ]
[ "import theano.tensor as tt\nimport numpy as np\nfrom ..distributions import Normal, Flat\nfrom . import families\nfrom ..model import Model, Deterministic\nfrom .utils import any_to_tensor_and_labels\n\n\n__all__ = [\n 'LinearComponent',\n 'GLM'\n]\n\n\nclass LinearComponent(Model):\n \"\"\"Creates linear...
[ [ "numpy.asarray" ], [ "numpy.diag", "numpy.log", "numpy.minimum", "numpy.linalg.eigh", "numpy.prod", "numpy.exp" ], [ "numpy.asscalar" ], [ "numpy.frombuffer", "numpy.random.seed" ] ]
pkulwj1994/normalizing-flows
[ "326321c4aea4a3f6ab703f82e21277a79cd7d9e4", "326321c4aea4a3f6ab703f82e21277a79cd7d9e4" ]
[ "normflow/flows/glow.py", "normflow/flows/affine_coupling.py" ]
[ "import torch\nfrom torch import nn\n\nfrom .base import Flow\nfrom .affine_coupling import AffineCouplingBlock\nfrom .mixing import Invertible1x1Conv\nfrom .normalization import ActNorm\nfrom .. import nets\n\n\n\nclass GlowBlock(Flow):\n \"\"\"\n Glow: Generative Flow with Invertible 1×1 Convolutions, arXiv...
[ [ "torch.nn.ModuleList", "torch.zeros" ], [ "torch.sigmoid", "torch.zeros", "torch.nn.ModuleList", "torch.sum", "torch.zeros_like", "torch.tensor", "torch.exp", "torch.isfinite", "torch.log", "numpy.prod" ] ]
AvisP/AVGN_Avishek
[ "78b5cfc49d90016f462c91e42499970217f073c9" ]
[ "avgn/vocalsegmentation/utils.py" ]
[ "from scipy.signal import butter, lfilter\nimport numpy as np\nimport librosa\nfrom scipy import signal\nimport warnings\nimport matplotlib.pyplot as plt\n\n### General\ndef int16tofloat32(data):\n return np.array(data / 32768).astype(\"float32\")\n\n\ndef norm(x, _type=\"zero_one\"):\n return (x - np.min(x))...
[ [ "numpy.maximum", "numpy.abs", "numpy.clip", "numpy.min", "matplotlib.pyplot.subplots", "numpy.max", "scipy.signal.butter", "numpy.shape", "scipy.signal.lfilter", "numpy.array" ] ]
Prakshal2607/pythonml
[ "f77752d714144e9412685f8bfceef10934a9c525" ]
[ "TFANN/TFANN.py" ]
[ "'''\nTFANN.py\nThis file contains classes implementing ANN using numpy \nand tensorflow. Presently, multi-layer perceptron (MLP) \nand convolutional neural networks (CNN) are supported.\n'''\nimport tensorflow as tf\nimport numpy as np\n\ndef _Accuracy(Y, YH):\n '''\n Return the classification accuracy\n ...
[ [ "numpy.linspace", "tensorflow.nn.max_pool", "tensorflow.stack", "tensorflow.reduce_sum", "tensorflow.global_variables", "tensorflow.variables_initializer", "tensorflow.nn.conv2d_transpose", "tensorflow.losses.absolute_difference", "tensorflow.nn.sigmoid_cross_entropy_with_logit...
hirotatsuya/deep-learning-python
[ "83b9da2b616f6b6b545b354b3c0c931b59add6f0" ]
[ "src/matplotlib_sample.py" ]
[ "# numpyとmatplotlibのpyplotというモジュールを使う\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n# データの作成\nx = np.arange(0, 6, 0.1) # 0から6まで0.1刻みで生成\ny1 = np.sin(x)\ny2 = np.cos(x)\n\n# グラフの描画\n# plt.plot(x, y)\n# plt.show()\n\n# 複雑なグラフの描画\nplt.plot(x, y1, label='sin')\nplt.plot(x, y2, linestyle = '--', label='cos') #...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "numpy.arange", "numpy.cos", "numpy.sin", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
ZhenHengDong/bert4keras
[ "de66f9b66a57152816920a6b068a3f28648dd547", "de66f9b66a57152816920a6b068a3f28648dd547" ]
[ "bert4keras/layers.py", "bert4keras/backend.py" ]
[ "#! -*- coding: utf-8 -*-\n# 自定义层\n\nimport numpy as np\nimport tensorflow as tf\nfrom bert4keras.backend import keras, K\nfrom bert4keras.backend import sequence_masking\nfrom keras import initializers, activations\nfrom keras.layers import *\n\n\ndef integerize_shape(func):\n \"\"\"装饰器,保证input_shape一定是int或None...
[ [ "numpy.log", "tensorflow.reverse_sequence", "tensorflow.reduce_logsumexp", "tensorflow.einsum" ], [ "numpy.sqrt", "tensorflow.batch_gather", "tensorflow.gather", "tensorflow.nn.swish", "tensorflow.compat.v1.disable_eager_execution", "tensorflow.compat.v1.experimental.ou...
henighan/pandas
[ "45d8d77f27cf0dbc8cefe932f8fb64f6982b9527", "45d8d77f27cf0dbc8cefe932f8fb64f6982b9527" ]
[ "pandas/tests/indexes/datetimes/test_setops.py", "pandas/tests/series/methods/test_sort_values.py" ]
[ "from datetime import datetime\n\nimport numpy as np\nimport pytest\n\nimport pandas.util._test_decorators as td\n\nimport pandas as pd\nfrom pandas import (\n DataFrame,\n DatetimeIndex,\n Index,\n Int64Index,\n Series,\n bdate_range,\n date_range,\n to_datetime,\n)\nimport pandas._testing ...
[ [ "pandas._testing.equalContents", "pandas.to_datetime", "pandas.DateOffset", "pandas.bdate_range", "numpy.arange", "pandas.Index", "pandas.DatetimeIndex", "pandas.DataFrame", "pandas._libs.tslibs.timezones.dateutil_gettz", "pandas.tseries.offsets.BMonthEnd", "pandas._tes...
cicobalico/imgaug
[ "d2534903dea27f6e8836a2e627b3a0f075d959cf" ]
[ "imgaug/augmenters/color.py" ]
[ "\"\"\"\nAugmenters that apply color space oriented changes.\n\nDo not import directly from this file, as the categorization is not final.\nUse instead\n `from imgaug import augmenters as iaa`\nand then e.g. ::\n\n seq = iaa.Sequential([\n iaa.Grayscale((0.0, 1.0)),\n iaa.AddToHueAndSaturation((...
[ [ "numpy.tile", "numpy.clip" ] ]
OEP/volpy
[ "f49cae8b2e14b664dea26ccbcbdcadac31d80d5b" ]
[ "tests/test_geometry.py" ]
[ "import numpy.testing as npt\n\nimport volpy\n\nimport unittest\n\n\nclass BBoxTestCase(unittest.TestCase):\n\n def setUp(self):\n self.bbox = volpy.BBox([[1, 1, 1, 1],\n [5, 5, 5, 1]])\n\n def test_transform1(self):\n result = self.bbox.transform().dot(self.bbox.c...
[ [ "numpy.testing.assert_almost_equal" ] ]
WangFeng18/InvariancePropagation
[ "cad924ee2f7f311a805f8a4a9c3e8041e75ba002" ]
[ "downstream/linear_classification/eval_linear.py" ]
[ "\"\"\"\ncopied and modified from https://github.com/HobbitLong/CMC\n\n\"\"\"\nfrom __future__ import print_function\n\nimport os\nimport sys\nimport time\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.backends.cudnn as cudnn\nimport torch.nn.functional as F\nimport argparse\nimport...
[ [ "torch.nn.CrossEntropyLoss", "torch.cat", "torch.load", "numpy.asarray", "torch.utils.data.DataLoader", "torch.cuda.empty_cache", "torch.no_grad", "torch.nn.DataParallel", "torch.save" ] ]
savyovinicius/malicious_traffic_description
[ "599c36d16917ec627c77917abb4b0b7b8f6e5166" ]
[ "scripts/mud_to_openflow.py" ]
[ "import socket\nimport pandas as pd\n\ndef read_net_graph():\n\taux = pd.read_json(\"/tmp/mud_graph.json\")\n\treturn aux.drop_duplicates()\n\ndef read_nodes():\n\taux = pd.read_json(\"/tmp/mud_nodes.json\")\n\treturn aux.drop_duplicates()\n\ndef map_address(name):\n\tnodes = read_nodes()\n\ttry:\n\t\treturn nodes[...
[ [ "pandas.Series", "pandas.read_json", "pandas.DataFrame" ] ]
ESWZY/federated
[ "1693d5fdd25938dc9aadede8d103ed117d1d34c9", "1693d5fdd25938dc9aadede8d103ed117d1d34c9" ]
[ "tensorflow_federated/python/examples/remote_execution/remote_executor_example.py", "tensorflow_federated/python/simulation/sampling_utils_test.py" ]
[ "# Copyright 2018, The TensorFlow Federated 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...
[ [ "numpy.random.seed", "tensorflow.keras.losses.SparseCategoricalCrossentropy", "tensorflow.keras.layers.Dense", "tensorflow.reshape", "tensorflow.keras.optimizers.SGD", "tensorflow.keras.metrics.SparseCategoricalAccuracy", "tensorflow.keras.layers.Softmax", "tensorflow.keras.layers....
monash-emu/AuTuMN
[ "fa3b81ef54cf561e0e7364a48f4ff96585dc3310", "fa3b81ef54cf561e0e7364a48f4ff96585dc3310" ]
[ "autumn/tools/plots/utils.py", "autumn/tools/plots/plotter/streamlit_plotter.py" ]
[ "import datetime\nfrom typing import List, Dict\n\nimport matplotlib.ticker as ticker\nfrom matplotlib import colors\n\nPLOT_TEXT_DICT = {\n \"contact_rate\": \"infection risk per contact\",\n \"hospital_props_multiplier\": \"hospital risk multiplier\",\n \"compartment_periods.icu_early\": \"pre-ICU period...
[ [ "matplotlib.ticker.FuncFormatter", "matplotlib.colors.colorConverter.to_rgb" ], [ "matplotlib.pyplot.savefig" ] ]
1980744819/playing-mario-with-DQN
[ "f263e3615bf4439ad17d95a9f449c6145792402b" ]
[ "break_out/memory.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# @File : memory.py\n# @Author: zixiao\n# @Date : 2019-04-07\n# @Desc :\nimport numpy as np\n\n\nclass Memory:\n def __init__(self, size, w, h, frame_len):\n self.size = size\n self.index = 0\n self.count = 0\n self.num_in_memory = 0...
[ [ "numpy.concatenate", "numpy.zeros", "numpy.random.choice" ] ]
muntasir2000/lingvo
[ "1555299b817288b5a6637ded416dbbdc9b00036d", "4c6405a3c8b29764918dbfb599212dd7620ccf9c", "1555299b817288b5a6637ded416dbbdc9b00036d", "1555299b817288b5a6637ded416dbbdc9b00036d", "1555299b817288b5a6637ded416dbbdc9b00036d" ]
[ "lingvo/core/base_layer_test.py", "lingvo/core/ops/random_ops_test.py", "lingvo/tasks/punctuator/input_generator.py", "lingvo/core/bfloat16_variables_test.py", "lingvo/core/task_scheduler.py" ]
[ "# Lint as: python2, python3\n# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/...
[ [ "tensorflow.convert_to_tensor", "tensorflow.variable_scope", "tensorflow.test.main", "tensorflow.get_collection" ], [ "tensorflow.test.main" ], [ "tensorflow.convert_to_tensor", "tensorflow.range", "tensorflow.shape", "tensorflow.reduce_sum", "tensorflow.cast", ...
xunhen/Deep-Feature-Flow
[ "9fc6e755169bfad4e25553507bf2a98d6f3ee2e0" ]
[ "lib/bbox/bbox_regression.py" ]
[ "# --------------------------------------------------------\n# Deep Feature Flow\n# Copyright (c) 2017 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Modified by Yuwen Xiong\n# --------------------------------------------------------\n# Based on:\n# py-faster-rcnn\n# Copyright (c) 2016 by ...
[ [ "numpy.sqrt", "numpy.array", "numpy.zeros", "numpy.where" ] ]
egoliuk/ml_course
[ "4327f43a95112b1cd5a17456eda567068e497963" ]
[ "Exercise_1/Logistic_regression_as_a_neural_network/logistic_regression_with_NN.py" ]
[ "\n# coding: utf-8\n\n# # Logistic Regression with a Neural Network mindset\n# \n# Welcome to your first (required) programming assignment! You will build a logistic regression classifier to recognize cats. This assignment will step you through how to do this with a Neural Network mindset, and so will also hone yo...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.imshow", "numpy.dot", "numpy.sum", "scipy.ndimage.imread", "scipy.misc.imresize", "numpy.log", "numpy.abs", "numpy.squeeze", "matplotlib.pyplot.plot", "numpy.exp", "matplotlib.pyplot.xlabel", "numpy.array", "num...
xiaqi516/video-content-description-VCD
[ "d442d6a7c4d6d8807de2177054e9d82e52005221" ]
[ "draw/vcd_draw_towncentre.py" ]
[ "\"\"\"\nVCD (Video Content Description) library v4.3.1\n\nProject website: http://vcd.vicomtech.org\n\nCopyright (C) 2021, Vicomtech (http://www.vicomtech.es/),\n(Spain) all rights reserved.\n\nVCD is a Python library to create and manage VCD content version 4.3.1.\nVCD is distributed under MIT License. See LICENS...
[ [ "numpy.hstack" ] ]
mythezone/ECOS
[ "339c9a5dcd5d05dacd21bc3646af35585b926e35" ]
[ "Algorithms/lstm/lstm.py" ]
[ "import random\nfrom time import sleep\n\nimport numpy as np\nimport math\n\ndef sigmoid(x): \n return 1. / (1 + np.exp(-x))\n\ndef sigmoid_derivative(values): \n return values*(1-values)\n\ndef tanh_derivative(values): \n return 1. - values ** 2\n\n# createst uniform random array w/ values in [a,b) and sh...
[ [ "numpy.hstack", "numpy.dot", "numpy.random.seed", "numpy.zeros_like", "numpy.random.rand", "numpy.outer", "numpy.exp", "numpy.zeros" ] ]
t-zhong/DeepComplexCRN
[ "ecde09722d6ca441c3cc9ee57cf15cf4ae083750" ]
[ "denoise.py" ]
[ "# 输入一个音频,输出PSEQ值和声谱图\n\nimport glob\nimport os\nfrom argparse import ArgumentParser\n\nimport librosa\nimport pytorch_lightning as pl\nimport torch\nfrom asteroid.metrics import get_metrics\n\nimport dc_crn\nfrom dataset import WavDataset\nfrom train import LitModule\nfrom vis import showspec\nimport soundfile\n\n...
[ [ "torch.tensor" ] ]
IsaacChanghau/DeepNaryECOC
[ "08981309e21cf4d7519a36b034d35741c7fe0bf5" ]
[ "models/cifar_cnn_ps.py" ]
[ "import os\nimport keras\nimport numpy as np\nimport tensorflow as tf\nimport tensorflow.contrib.slim as slim\nfrom sklearn import utils\nfrom utils.logger import get_logger, Progbar\nfrom keras.preprocessing.image import ImageDataGenerator\n\n\ndef batch_dataset(images, labels, batch_size):\n total = labels.sha...
[ [ "tensorflow.layers.dropout", "numpy.concatenate", "numpy.mean", "tensorflow.train.AdamOptimizer", "tensorflow.Graph", "tensorflow.layers.batch_normalization", "numpy.reshape", "tensorflow.ConfigProto", "numpy.std", "tensorflow.reset_default_graph", "tensorflow.Session",...
kevinlib/IOHMM
[ "08f3a45479c6ecf0f918a6dcbc13c5988f8827cc" ]
[ "IOHMM/family_wrapper.py" ]
[ "'''\nThe Wrapper of statsmodels one parameter exponential family distributions used by GLM,\nwith the added functionality for log likelihood per sample. Loglikelihood per sample is\ngoing to be used in IOHMM to estimate emission probability.\n'''\nfrom __future__ import division\n\nfrom past.utils import old_div\n...
[ [ "numpy.log", "numpy.finfo", "numpy.shape", "scipy.special.gammaln", "numpy.exp", "numpy.zeros", "numpy.isclose" ] ]
cwscx/attackToolBox
[ "8434b38626b927079085e35245d43f75362791ef" ]
[ "example/KNNtest.py" ]
[ "from attackToolBox import *\nfrom tensorflow.examples.tutorials.mnist import input_data\n\nmnist = input_data.read_data_sets(\"MNIST_data/\", one_hot=True)\n\natb = attackToolBox(mnist.train.images[:10000], mnist.train.labels[:10000])\nprint(\"finish initializing\")\natb.polluteByKNN(mnist.test.images[:100], mnist...
[ [ "tensorflow.examples.tutorials.mnist.input_data.read_data_sets" ] ]
waldemar-szostak/tensorflow-models
[ "8217cc6a4fe46445bdd4a0e820de5c4ef214587c" ]
[ "official/resnet/keras/keras_imagenet_main.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.test.is_built_with_cuda", "tensorflow.reshape", "tensorflow.compat.v1.enable_eager_execution", "tensorflow.compat.v1.logging.set_verbosity", "tensorflow.keras.backend.set_image_data_format", "tensorflow.keras.backend.set_learning_phase" ] ]
JDonini/Stacking-Audio-Tagging
[ "a827a803dc140138d7a24ffc6fc8eda21672703e", "a827a803dc140138d7a24ffc6fc8eda21672703e" ]
[ "database/FMA/src/model-1/second_stage.py", "src/model_autoencoders_chromagram.py" ]
[ "import sys\nimport numpy as np\nimport pandas as pd\nimport tensorflow as tf\nimport datetime\nfrom keras.utils import plot_model\nfrom keras_preprocessing.image import ImageDataGenerator\nfrom keras import backend as k\nfrom keras.callbacks import TensorBoard, EarlyStopping, ReduceLROnPlateau, CSVLogger\nfrom ker...
[ [ "tensorflow.set_random_seed", "pandas.read_csv", "numpy.random.seed", "pandas.DataFrame" ], [ "tensorflow.set_random_seed", "pandas.read_csv", "numpy.random.seed" ] ]
cfierro94/numpy
[ "7b4a60f3f0559d33224da65f83eeeacb9bf22234" ]
[ "numpy/typing/tests/data/pass/scalars.py" ]
[ "import sys\nimport datetime as dt\n\nimport pytest\nimport numpy as np\n\n\n# Construction\nclass D:\n def __index__(self) -> int:\n return 0\n\n\nclass C:\n def __complex__(self) -> complex:\n return 3j\n\n\nclass B:\n def __int__(self) -> int:\n return 4\n\n\nclass A:\n def __flo...
[ [ "numpy.complex128", "numpy.string_", "numpy.ubyte", "numpy.longdouble", "numpy.csingle", "numpy.complex_", "numpy.void0", "numpy.clongdouble", "numpy.str_", "numpy.uint0", "numpy.bool_", "numpy.double", "numpy.complex64", "numpy.intc", "numpy.uint32", ...
yannforget/landsat-sentinel-fusion
[ "13872d733f4b3958a479b6da9477a83dc6ab1369" ]
[ "src/raster.py" ]
[ "\"\"\"Raster data processing.\"\"\"\n\nimport numpy as np\nimport rasterio\nimport rasterio.warp\n\n\ndef histogram_cutting(raster, percent=2, nodata=None, mask=None):\n \"\"\"Perform histogram cutting on a 2D raster\n\n Parameters\n ----------\n raster : numpy 2d array\n Input raster.\n perc...
[ [ "numpy.isnan", "numpy.ndarray" ] ]
zktuong/scirpy
[ "f0599abecc93c7db9ae1b0db268018d534ffe6da" ]
[ "scirpy/_tools/_clonotypes.py" ]
[ "import itertools\nimport random\nfrom typing import List, Optional, Sequence, Tuple, Union\n\nimport igraph as ig\nimport numpy as np\nimport pandas as pd\nfrom anndata import AnnData\nfrom scanpy import logging\nimport scipy.sparse as sp\n\nfrom .._compat import Literal\nfrom .._preprocessing import ir_dist\nfrom...
[ [ "numpy.max", "pandas.Series", "numpy.random.seed", "pandas.DataFrame" ] ]
Guilospanck/RA-opencv
[ "18a7d340b850e01fa4686cd36057baa991002677" ]
[ "src/ra.py" ]
[ "import cv2\nimport sys\nimport numpy as np\nimport math\nimport os\nfrom objloader_simple import *\n\nimport argparse\n\n# Minimum number of matches that have to be found\n# to consider the recognition valid\nMIN_MATCHES = 60\n\n# Command line argument parsing\nparser = argparse.ArgumentParser(description='Augment...
[ [ "numpy.dot", "numpy.linalg.inv", "numpy.eye", "numpy.int32", "numpy.linalg.norm", "numpy.stack", "numpy.float32", "numpy.cross", "numpy.array" ] ]
franaudo/compas
[ "8b2982a1c31e87d1a6740864476d6242612dc3dd" ]
[ "src/compas_plotters/artists/vectorartist.py" ]
[ "from matplotlib.patches import FancyArrowPatch\nfrom matplotlib.patches import ArrowStyle\n\nfrom compas.geometry import Point\nfrom compas_plotters.artists import Artist\n\n__all__ = ['VectorArtist']\n\n\nclass VectorArtist(Artist):\n \"\"\"\"\"\"\n\n zorder = 3000\n\n def __init__(self, vector, point=No...
[ [ "matplotlib.patches.ArrowStyle", "matplotlib.patches.FancyArrowPatch" ] ]
alanwang93/ATEC2018-NLP-PyTorch
[ "8e00c6af1d3e1db7ab4433a0587784e45f830347", "8e00c6af1d3e1db7ab4433a0587784e45f830347" ]
[ "models/sigmoid_siamese.py", "deep_models/sf_siamese.py" ]
[ "from torch import nn\nfrom torch.autograd import Variable\nimport torch\nfrom utils import score, BCELoss\nimport numpy as np\n\nUNK_IDX = 0\nEOS_IDX = 2\n\n\nclass SigmoidSiameseRNN(nn.Module):\n\n def __init__(self, config, data_config):\n super(SigmoidSiameseRNN, self).__init__()\n self.mode =...
[ [ "torch.nn.Softmax", "torch.abs", "torch.mean", "torch.max", "torch.cat", "torch.nn.Embedding", "torch.FloatTensor", "torch.nn.Dropout", "torch.norm", "torch.tensor", "torch.nn.SELU", "torch.arange", "torch.squeeze", "torch.nn.BatchNorm1d", "torch.nn.PReL...
jinyiyexing518/DAL
[ "994fedcdf8cbd8b18aeaaa26544bab4a9f046e3c" ]
[ "utils/nms_wrapper.py" ]
[ "# --------------------------------------------------------\n# Fast R-CNN\n# Copyright (c) 2015 Microsoft\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Ross Girshick\n# Modified by Linjie Deng\n# --------------------------------------------------------\nimport torch\n\nfrom utils.nms.cpu...
[ [ "torch.is_tensor" ] ]
jluastro/nirc2
[ "b42b064f2f850561f8afca16d732090de2fea231" ]
[ "nirc2/reduce/sky.py" ]
[ "from astropy.io import fits\nfrom astropy.table import Table\nfrom astropy import stats\nimport os, sys, shutil\nfrom nirc2.reduce import util\n#import util\nimport numpy as np\nfrom pyraf import iraf as ir\nfrom nirc2 import instruments\nfrom datetime import datetime\nimport pdb\nimport astropy\n\ndef makesky(fil...
[ [ "numpy.argsort" ] ]
MikeTrizna/lightning-flash
[ "8d68c32a20d5910a255b6fc9ef6851b091cb6ed6", "8d68c32a20d5910a255b6fc9ef6851b091cb6ed6" ]
[ "flash/audio/classification/input_transform.py", "tests/core/data/test_transforms.py" ]
[ "# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "torch.nn.Sequential" ], [ "torch.zeros", "torch.tensor", "torch.rand", "torch.allclose", "torch.nn.ReLU" ] ]
hhzb123/UWSOD
[ "e3a708463734752597d8523b68338e35c6777575", "e3a708463734752597d8523b68338e35c6777575" ]
[ "projects/WSL/wsl/modeling/proposal_generator/proposal_utils.py", "projects/WSL/tools/proposal_convert.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport logging\nimport math\nfrom typing import List, Tuple\nimport torch\n\nfrom detectron2.layers import batched_nms, cat\nfrom detectron2.structures import Boxes, Instances\nfrom detectron2.utils.events import get_event_storage\n\nlogger = ...
[ [ "torch.isfinite", "torch.full", "torch.arange" ], [ "numpy.nditer", "scipy.io.loadmat", "numpy.ones", "numpy.where", "numpy.zeros" ] ]
jplauri/vaex
[ "e8cdd3a4a26a31aebfbacfba7e255ff16a8098fa", "e8cdd3a4a26a31aebfbacfba7e255ff16a8098fa" ]
[ "packages/vaex-hdf5/vaex/hdf5/export.py", "tests/isin_test.py" ]
[ "from __future__ import division, print_function\n__author__ = 'maartenbreddels'\nimport os\nimport sys\nimport collections\nimport numpy as np\nimport logging\nimport vaex\nimport vaex.utils\nimport vaex.execution\nimport vaex.export\nimport vaex.hdf5.dataset\nfrom vaex.column import ColumnStringArrow, str_type\n\...
[ [ "numpy.ma.isMaskedArray" ], [ "numpy.array", "numpy.ma.MaskedArray" ] ]
Lanxiaozhi/tianshou
[ "0fa3f4b7a256780448b7dcdbdbeb9daf7944f1d5" ]
[ "tianshou/policy/modelfree/a2c.py" ]
[ "import torch\nimport numpy as np\nfrom torch import nn\nimport torch.nn.functional as F\nfrom typing import Any, Dict, List, Type, Union, Optional\n\nfrom tianshou.policy import PGPolicy\nfrom tianshou.data import Batch, ReplayBuffer, to_torch_as, to_numpy\n\n\nclass A2CPolicy(PGPolicy):\n \"\"\"Implementation ...
[ [ "numpy.concatenate", "torch.nn.functional.mse_loss", "torch.no_grad" ] ]
smithsophia1688/rm-cooperative-marl
[ "e9c782fa50957095dc025e16ff714e2fd19ee39e", "e9c782fa50957095dc025e16ff714e2fd19ee39e" ]
[ "src/experiments/iql.py", "src/Environments/rendezvous/gridworld_env.py" ]
[ "import numpy as np\nimport random, time\n\nfrom tester.tester import Tester\nfrom Agent.iqAgent import iqAgent\nfrom Environments.rendezvous.multi_agent_gridworld_env import MultiAgentGridWorldEnv\nfrom Environments.coop_buttons.multi_agent_buttons_env import MultiAgentButtonsEnv\nimport matplotlib.pyplot as plt\n...
[ [ "matplotlib.pyplot.locator_params", "numpy.full", "matplotlib.pyplot.plot", "matplotlib.pyplot.fill_between", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ], [ "numpy.mod", "numpy.floor_div...
icoxfog417/cartpole-q-learning
[ "54ae9de6c488cbbff9bda1be11fd0ecd1e681049" ]
[ "agent.py" ]
[ "import random\nimport copy\nfrom collections import defaultdict\nfrom collections import deque\nfrom collections import namedtuple\nimport numpy as np\n\n\nclass Q():\n\n def __init__(self, n_actions, observation_space, bin_size, low_bound=None, high_bound=None, initial_mean=0.0, initial_std=0.0):\n self...
[ [ "numpy.random.random", "numpy.random.choice", "numpy.append", "numpy.mean", "numpy.random.randn", "numpy.digitize" ] ]
jinliangwei/tensor2tensor
[ "c42797065738504d7f032d0a13f2dd5190bfb20f", "c42797065738504d7f032d0a13f2dd5190bfb20f" ]
[ "tensor2tensor/utils/trainer_lib.py", "tensor2tensor/rl/trainer_model_free.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Tensor2Tensor Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir...
[ [ "tensorflow.contrib.cluster_resolver.TPUClusterResolver", "tensorflow.logging.warning", "tensorflow.GPUOptions", "tensorflow.estimator.RunConfig", "tensorflow.contrib.training.wait_for_new_checkpoint", "tensorflow.contrib.learn.monitors.ValidationMonitor", "tensorflow.estimator.train_a...
alek5k/pytransform3d
[ "c6fb10b1d17713bd8a2d6becb928c4f6dcf611f9", "c6fb10b1d17713bd8a2d6becb928c4f6dcf611f9" ]
[ "examples/plots/plot_camera_trajectory.py", "examples/visualizations/vis_moving_trajectory.py" ]
[ "\"\"\"\n=================\nCamera Trajectory\n=================\n\nThe following illustration shows a camera's trajectory that has has been\nestimated from odometry. This specific trajectory has been used to reconstruct\na colored mesh from a depth camera and an RGB camera.\n\"\"\"\nprint(__doc__)\n\n\nimport os\n...
[ [ "numpy.min", "numpy.max", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ], [ "numpy.eye", "numpy.array", "numpy.zeros", "numpy.empty" ] ]
tvorogme/recommendation_system
[ "e8ca0216293c0ad2951518a12709d913016e9e07" ]
[ "models/hybrid_model.py" ]
[ "from collections import Counter\nimport datetime\n\nimport numpy as np\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.utils import shuffle\n\nfrom models.features.topics import topics_similarity\nfrom models.features.cosine import cosine_similarity_features\n\nclf = RandomForestClassifier()\ncl...
[ [ "sklearn.utils.shuffle", "sklearn.ensemble.RandomForestClassifier" ] ]
wdobbels/CAAPR
[ "50d0b32642a61af614c22f1c6dc3c4a00a1e71a3", "50d0b32642a61af614c22f1c6dc3c4a00a1e71a3", "50d0b32642a61af614c22f1c6dc3c4a00a1e71a3" ]
[ "CAAPR/CAAPR_AstroMagic/PTS/pts/magic/plot/imagegrid.py", "CAAPR/CAAPR_AstroMagic/PTS/pts/magic/tools/masks.py", "CAAPR/CAAPR_AstroMagic/PTS/pts/core/plot/attenuation.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf8 -*-\n# *****************************************************************\n# ** PTS -- Python Toolkit for working with SKIRT **\n# ** © Astronomical Observatory, Ghent University **\n# ***********************************************************...
[ [ "numpy.nanmax", "matplotlib.pyplot.tight_layout", "numpy.isnan", "scipy.ndimage.zoom", "numpy.nanmin", "matplotlib.colors.Normalize", "matplotlib.pyplot.savefig", "matplotlib.colorbar.ColorbarBase", "matplotlib.colors.ListedColormap", "matplotlib.gridspec.GridSpec", "ma...
snosov1/opencv
[ "ce05d6cb89450a5778f4c0169b5da5589798192a", "ce05d6cb89450a5778f4c0169b5da5589798192a", "ce05d6cb89450a5778f4c0169b5da5589798192a" ]
[ "modules/python/test/test_dft.py", "samples/python/gabor_threads.py", "samples/python/digits_adjust.py" ]
[ "#!/usr/bin/env python\n\n'''\nTest for disctrete fourier transform (dft)\n'''\n\n# Python 2/3 compatibility\nfrom __future__ import print_function\n\nimport cv2\nimport numpy as np\nimport sys\n\nfrom tests_common import NewOpenCVTests\n\nclass dft_test(NewOpenCVTests):\n def test_dft(self):\n\n img = se...
[ [ "numpy.fft.fft2", "numpy.fft.ifft2", "numpy.abs", "numpy.fft.fftshift", "numpy.float32" ], [ "numpy.arange", "numpy.maximum", "numpy.zeros_like" ], [ "numpy.hstack", "numpy.savez", "numpy.logspace", "numpy.arange", "numpy.nanmin", "numpy.mean", "...
Ollie-Hooper/IdeaStreams
[ "26a220e961f68b7239901979ea010ec222cc2c81" ]
[ "8 - Reducing Portfolio Political Risk Using Trump Beta.py" ]
[ "import math\nimport pandas as pd\n\nfrom io import StringIO\n\n\ndata_url = \"https://www.dropbox.com/s/pwm8wlncayp1clh/trump_beta.csv?dl=1\"\n\n\nclass MultidimensionalCalibratedAtmosphericScrubbers(QCAlgorithm):\n\n def Initialize(self):\n self.SetStartDate(2020, 6, 1) # Set Start Date\n self.S...
[ [ "pandas.to_datetime" ] ]
dylkot/EbolaSC
[ "d363f9d2c10911f01c7b1d22fec2b192df2569b1" ]
[ "Code/cNMF/cnmf.py" ]
[ "import numpy as np\nimport pandas as pd\nimport os, errno\nimport datetime\nimport uuid\nimport itertools\nimport yaml\nimport subprocess\nimport scipy.sparse as sp\n\n\nfrom scipy.spatial.distance import squareform\nfrom sklearn.decomposition.nmf import non_negative_factorization\nfrom sklearn.cluster import KMea...
[ [ "numpy.diag", "numpy.dot", "scipy.cluster.hierarchy.leaves_list", "numpy.sqrt", "pandas.Series", "sklearn.cluster.KMeans", "sklearn.metrics.silhouette_score", "numpy.linspace", "pandas.DataFrame", "scipy.spatial.distance.squareform", "numpy.where", "numpy.random.ran...
konabuta/fta-azure-machine-learning
[ "70da95e7a4c9b3e42db61bb0f69eda8e07c28eee" ]
[ "fundamentals/src/notebooks/030_scripts/train_with_azureml_workspace.py" ]
[ "import argparse\nimport os\nimport joblib\nimport mlflow\nfrom sklearn.pipeline import make_pipeline\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.linear_model import LassoLars\nfrom azureml.core import Workspace\nfrom azureml.core.run import Run, _OfflineRun\n\n# This script can run locally usin...
[ [ "sklearn.preprocessing.StandardScaler", "sklearn.linear_model.LassoLars" ] ]
BaldLee/tvm
[ "b53472c7b6afa34260afeffc5f088591352c58c3", "b53472c7b6afa34260afeffc5f088591352c58c3" ]
[ "tests/python/relay/test_op_level10.py", "tutorials/dev/bring_your_own_datatypes.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.reshape", "numpy.size", "numpy.broadcast_to", "numpy.random.rand", "numpy.random.uniform", "numpy.array", "numpy.sum", "numpy.random.randint" ], [ "numpy.random.seed", "numpy.asarray", "numpy.testing.assert_array_equal", "numpy.random.rand", "numpy.tr...
DynamicGravitySystems/DGP
[ "5bb8a30895365eccdd452970c45e248903fca8af" ]
[ "dgp/lib/transform/etc.py" ]
[ "# coding: utf-8\n\nimport pandas as pd\n\n\ndef named_series(*args, **kwargs):\n def wrapper(*args, **kwargs):\n return pd.Series(*args, **kwargs)\n return wrapper\n\n" ]
[ [ "pandas.Series" ] ]
megasanjay/soda-app-update
[ "1e368072f2191f194530b2d914848400d55f8690" ]
[ "src/pysoda/validator_soda.py" ]
[ "'''\nThis code validates the proposed folder structure and files\nagainst the schema required by the SPARC curation team.\nNote that since this code is separate from the code used\nthe the SPARC curation team that automatically checks similar\nitems, code passing this validator may not pass the official\nSPARC val...
[ [ "pandas.read_excel", "pandas.read_csv", "numpy.unique", "numpy.isnan", "numpy.argwhere" ] ]
zsz00/Graphormer
[ "838f239a41dfd861b483cefa824e2dd57ae6ab1a" ]
[ "graphormer/pretrain/__init__.py" ]
[ "from torch.hub import load_state_dict_from_url\nimport torch.distributed as dist\n\nPRETRAINED_MODEL_URLS = {\n \"pcqm4mv1_graphormer_base\": \"https://szheng.blob.core.windows.net/graphormer/modelzoo/pcqm4mv1/checkpoint_best_pcqm4mv1_full.pt\",\n \"pcqm4mv2_graphormer_base\": \"https://szheng.blob.core.wind...
[ [ "torch.distributed.get_rank", "torch.distributed.is_initialized", "torch.hub.load_state_dict_from_url", "torch.distributed.barrier" ] ]
kyuhyoung/PINTO_model_zoo
[ "c3759b9a6ef35704daba1964ee75db979cf8e118", "c3759b9a6ef35704daba1964ee75db979cf8e118" ]
[ "07_mobilenetv2-poseestimation/01_float32/02_weight_quantization.py", "07_mobilenetv2-poseestimation/01_float32/01_freeze_the_saved_model_v1.py" ]
[ "import tensorflow as tf\n\ntf.compat.v1.enable_eager_execution()\n\n# Weight Quantization - Input/Output=float32\nconverter = tf.lite.TFLiteConverter.from_saved_model('./saved_model')\nconverter.optimizations = [tf.lite.Optimize.OPTIMIZE_FOR_SIZE]\ntflite_quant_model = converter.convert()\nwith open('./mobilenet_v...
[ [ "tensorflow.lite.TFLiteConverter.from_saved_model", "tensorflow.compat.v1.enable_eager_execution" ], [ "tensorflow.Graph", "tensorflow.import_graph_def", "tensorflow.compat.v1.enable_eager_execution", "tensorflow.compat.v1.GraphDef", "tensorflow.compat.v1.gfile.GFile", "tensorf...
koliaok/RNN_javaSourceCodeLearningModel
[ "35d072eea65f605e2208da2a534a4b2bc4d955d4" ]
[ "train.py" ]
[ "from __future__ import print_function\nimport tensorflow as tf\n\nimport argparse\nimport time\nimport os\nfrom six.moves import cPickle\n\nfrom utils import TextLoader\nfrom model import Model\n\n\nimport csv\nimport itertools\nimport operator\nimport numpy as np\nimport math as math\nimport sys\nimport os\nimpor...
[ [ "tensorflow.train.get_checkpoint_state", "tensorflow.global_variables", "tensorflow.assign", "tensorflow.global_variables_initializer", "tensorflow.summary.merge_all", "tensorflow.Session" ] ]
haijohn/mars
[ "2805241ac55b50c4f6319baa41113fbf8c723832", "2805241ac55b50c4f6319baa41113fbf8c723832", "2805241ac55b50c4f6319baa41113fbf8c723832", "2805241ac55b50c4f6319baa41113fbf8c723832", "2805241ac55b50c4f6319baa41113fbf8c723832", "2805241ac55b50c4f6319baa41113fbf8c723832" ]
[ "mars/tensor/random/randn.py", "mars/tensor/fft/irfft2.py", "mars/dataframe/tests/test_initializer.py", "mars/dataframe/groupby/tests/test_groupby_execution.py", "mars/tests/core.py", "mars/learn/datasets/tests/test_samples_generator.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Copyright 1999-2020 Alibaba Group Holding Ltd.\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/li...
[ [ "numpy.dtype" ], [ "numpy.dtype" ], [ "pandas.testing.assert_series_equal", "pandas.Series", "numpy.random.choice", "numpy.arange", "pandas.Index", "numpy.random.shuffle", "pandas.DataFrame", "pandas.testing.assert_frame_equal", "numpy.random.rand", "numpy.r...
Gedeon-m-gedus/FinalYear_2018_2019_UR
[ "bf82c3640bf0ef854ae173e542535e9a8d697059" ]
[ "garelly_functions.py" ]
[ "#_________MATH AND PLOT LIBRAY__________\r\nimport numpy as np\r\nfrom matplotlib.lines import Line2D\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.animation as animation\r\n\r\n\r\nimport numpy\r\nfrom matplotlib.pylab import *\r\nfrom mpl_toolkits.axes_grid1 import host_subplot \r\nimport matplotlib.a...
[ [ "numpy.sqrt", "numpy.linspace", "matplotlib.pyplot.plot", "numpy.mean", "numpy.exp", "numpy.sinc", "numpy.arange", "numpy.sin", "numpy.std", "matplotlib.pyplot.subplot", "matplotlib.pyplot.text", "matplotlib.pyplot.title", "matplotlib.pyplot.ylim", "matplotl...
xqgex/CrazyFlie
[ "a7f613f41734db12bbbffe4714b5b1df91dbb2ea" ]
[ "Managers/joystick.py" ]
[ "import pygame\nimport numpy as np\nimport logger\n\ncp_logger = logger.get_logger(__name__)\n\n\nclass Joystick:\n def __init__(self, control_board_api):\n self._control_board_api = control_board_api\n if self._control_board_api:\n self._non_normalize_function = self._control_board_api....
[ [ "numpy.array", "numpy.linalg.norm" ] ]
Mohammad-Chowdhury-31/svmbir
[ "05665eb2a65b7aa951e26dd3691955e737f16c06" ]
[ "demo/demo_multires_comparison.py" ]
[ "import os\nimport numpy as np\nfrom demo_utils import plot_image\nimport svmbir\n\n\"\"\"\nThis file demonstrates the generation of a 3D microscopy phantom followed by sinogram projection and reconstruction using MBIR. \nThe phantom, sinogram, and reconstruction are then displayed. \n\"\"\"\n\n# Simulated image pa...
[ [ "numpy.linspace" ] ]
hoslo/ocr
[ "4f78ae7013beb2cab8fb9391ba25ba5e6e78967c", "7a5464895f455df6ddf61989a4173ea1999e1507" ]
[ "direction_detection/SkewDetect.py", "pan/utils/cal_recall/rrc_evaluation_funcs.py" ]
[ "\"\"\" Calculates skew angle \"\"\"\nimport os\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = \"-1\"\nimport time\n\nimport cv2\nfrom math import fabs, sin, cos, radians\nimport numpy as np\nimport scipy\nfrom PIL import Image\nfrom skimage.transform import hough_line, hough_line_peaks\n\n\nclass SkewDetect:\n\n piby4...
[ [ "numpy.abs", "numpy.rad2deg", "numpy.ones", "numpy.argmax", "numpy.mean", "scipy.stats.mode", "numpy.array" ], [ "numpy.array" ] ]
CHEN-Zhaohui/geoist
[ "06a00db3e0ed3d92abf3e45b7b3bfbef6a858a5b", "06a00db3e0ed3d92abf3e45b7b3bfbef6a858a5b", "06a00db3e0ed3d92abf3e45b7b3bfbef6a858a5b", "06a00db3e0ed3d92abf3e45b7b3bfbef6a858a5b", "06a00db3e0ed3d92abf3e45b7b3bfbef6a858a5b", "06a00db3e0ed3d92abf3e45b7b3bfbef6a858a5b", "06a00db3e0ed3d92abf3e45b7b3bfbef6a858a5...
[ "geoist/gridder/interpolation.py", "examples/vis_giplt_2d.py", "geoist/gridder/tests/test_slicing.py", "geoist/catalog/Seismicity.py", "examples/pfm_transform_deriv.py", "examples/forward_modeling_sphere_gravity.py", "geoist/inversion/grawavelet.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n Name : interpolation.py\n Created on : 2018/11/24 08:57\n Author : Steve Chen <chenshi@cea-igp.ac.cn>\n Affiliation : Institute of Geophysics, CEA.\n Version : 0.1.0\n Copyright : Copyright (C) 2018-2020 GEOIST Development Team. All Rights Reserved.\n License ...
[ [ "numpy.sqrt", "numpy.linspace", "numpy.isnan", "numpy.cos", "numpy.sin", "numpy.arctan2", "numpy.ma.is_masked" ], [ "matplotlib.pyplot.plot", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.axis", "matplotlib.pyplot.xlabel", "mat...
hillarypan/pymatgen
[ "6b14109d59867331a48cd0986200094fd36dcfbb" ]
[ "pymatgen/io/vasp/outputs.py" ]
[ "# coding: utf-8\n# Copyright (c) Pymatgen Development Team.\n# Distributed under the terms of the MIT License.\n\nfrom __future__ import division, unicode_literals, print_function\n\nimport json\nimport glob\nimport itertools\nimport logging\nimport math\nimport os\nimport re\nimport warnings\nimport xml.etree.cEl...
[ [ "numpy.dot", "numpy.swapaxes", "numpy.fromfile", "numpy.abs", "numpy.sqrt", "numpy.isnan", "numpy.linalg.norm", "numpy.sin", "numpy.linalg.det", "numpy.max", "numpy.fft.ifftshift", "numpy.cross", "numpy.exp", "numpy.array", "numpy.histogram", "numpy....
plr21/PENet_ICRA2021
[ "869a10d2f14858faca38f5d50e121769ad142cf1" ]
[ "sparse_to_dense.py" ]
[ "import argparse\nimport typing\nimport logging\nimport torch\n\n# Use GPU only if GPU is available and memory is more than 8GB\nif torch.cuda.is_available() and torch.cuda.get_device_properties(0).total_memory > 8e9:\n import torch.backends.cudnn as cudnn\n\n cudnn.benchmark = True\n device = torch.device...
[ [ "torch.device", "torch.cuda.get_device_properties", "torch.cuda.empty_cache", "torch.cuda.is_available" ] ]
Baccega/smartphone-based-rti
[ "8f34ad13ccb67ff1442169e31e36050361986496" ]
[ "utils.py" ]
[ "import os\nimport cv2 as cv\nimport numpy as np\nimport math\nfrom constants import constants\n\n\ndef outerContour(contour, gray, margin=10):\n \"\"\"\n Given a contour and an image, returns the mean of the pixels around the contour.\n This is used to detect the rectangle fiducial pattern.\n \"\"\"\n ...
[ [ "numpy.matrix", "numpy.around", "numpy.linalg.norm", "numpy.ones", "numpy.savez_compressed", "numpy.load", "numpy.roll", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
paulf81/FLORIS
[ "f1bfee1f22834109e1f3478cdf2b468e19dc584f", "ef4934ec7feb7afd2615772d364a1eaa28db93e9" ]
[ "examples/optimization/scipy/co-design_optimizations/optimize_power_density.py", "examples/_getting_started/example_00_open_and_vis_floris.py" ]
[ "# Copyright 2021 NREL\n\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n# use this file except in compliance with the License. You may obtain a copy of\n# the License at http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to in writing, soft...
[ [ "numpy.arange", "matplotlib.pyplot.show", "numpy.random.seed" ], [ "matplotlib.pyplot.show", "matplotlib.pyplot.subplots" ] ]
lvzhaoyang/liegroups
[ "b3ccad280a3b615ad33c5f15c35d9325b8d3a5be", "b3ccad280a3b615ad33c5f15c35d9325b8d3a5be" ]
[ "liegroups/torch/so2.py", "liegroups/torch/se3.py" ]
[ "import torch\n\nfrom liegroups.torch import _base\nfrom liegroups.torch import utils\n\n\nclass SO2(_base.SpecialOrthogonalBase):\n \"\"\"See :mod:`liegroups.SO2`\"\"\"\n dim = 2\n dof = 1\n\n def adjoint(self):\n if self.mat.dim() < 3:\n return self.mat.__class__([1.])\n else:...
[ [ "torch.eye", "torch.atan2" ], [ "torch.eye", "torch.bmm", "torch.cat" ] ]
zhoubenjia/RAAR3DNet
[ "b5f6486a9f1cbf9fdd2de6a141ad81354f39ee51", "b5f6486a9f1cbf9fdd2de6a141ad81354f39ee51" ]
[ "Network_Search/lib/model/model_search.py", "Network_Train/lib/datasets/DSADataset.py" ]
[ "\"\"\"RAAR3DNet architecture.\n The model is introduced in:\n Regional Attention with Architecture-Rebuilt 3D Network for RGB-D Gesture Recognition\n Benjia Zhou, Yunan Li, Jun Wan\n https://arxiv.org/pdf/2102.05348.pdf\n \"\"\"\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfro...
[ [ "torch.nn.Dropout", "torch.nn.functional.softmax", "torch.transpose", "torch.nn.CrossEntropyLoss", "torch.cat", "torch.randn", "torch.nn.ModuleList", "torch.nn.AdaptiveAvgPool3d", "torch.nn.MaxPool3d", "torch.nn.Conv3d", "torch.nn.BatchNorm3d", "torch.nn.functional....
aesqgr/har-fbc
[ "69a2ca42edaf6b7c5db7b10cce2dc85d7f8d0473" ]
[ "src/dashboard_pages/model_dash.py" ]
[ "import sys\nprint(sys.path)\nsys.path.append(\"..\")\nsys.path.append(\"../src\")\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport streamlit as st\nimport seaborn as sns\nfrom keras.models import load_model, Sequential\nfrom keras.layers import LSTM, Dense, Flatten, Dropout\nimport numpy as np\nimport...
[ [ "matplotlib.pyplot.legend", "pandas.read_csv", "matplotlib.pyplot.title", "matplotlib.pyplot.ylim", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
damicoedoardo/NNMF
[ "69fff4848b3243a2d3347bec3e1c9a01ae40e51a" ]
[ "RecSysFramework/Experiments/performance_user_pop.py" ]
[ "from RecSysFramework.Evaluation.Evaluator import EvaluatorMetrics\nfrom RecSysFramework.Utils.get_holdout import retrieve_train_validation_test_holdhout_dataset\nfrom RecSysFramework.Recommender.NonPersonalized import TopPop\nfrom RecSysFramework.Experiments.utils_experiments import get_results_latex_from_dict, ro...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.legend", "matplotlib.pyplot.axhline", "numpy.cumsum", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "numpy.array", "numpy.sum" ] ]
DanyangSu/linkalman
[ "3be320f36cca2795f1380d0d9b4ef6831247a601", "3be320f36cca2795f1380d0d9b4ef6831247a601" ]
[ "linkalman/test/core/deprecated_test_Constant_M.py", "linkalman/test/core/conftest.py" ]
[ "import pytest\nimport pandas as pd\nimport numpy as np\nfrom linkalman.core.utils import Constant_M\nfrom copy import deepcopy\n\n\n# Test __init__\ndef test_wrong_M_type():\n \"\"\"\n Test if raise exception if M is not a numpy array\n \"\"\"\n M = 2.1\n T = 5\n with pytest.raises(TypeError):\n ...
[ [ "numpy.testing.assert_array_equal", "numpy.array", "numpy.array_equal" ], [ "numpy.diag", "numpy.eye", "pandas.DataFrame", "numpy.ones", "numpy.exp", "numpy.array", "numpy.zeros" ] ]
brechtmann/ray
[ "0c76ebd676f794847ea990aecced22b88717d09e" ]
[ "python/ray/utils.py" ]
[ "import binascii\nimport errno\nimport hashlib\nimport inspect\nimport logging\nimport numpy as np\nimport os\nimport six\nimport subprocess\nimport sys\nimport tempfile\nimport threading\nimport time\nimport uuid\n\nimport ray\nimport ray.gcs_utils\nimport ray.ray_constants as ray_constants\nimport psutil\n\nlogge...
[ [ "numpy.random.bytes", "numpy.random.get_state", "numpy.random.set_state", "numpy.random.seed" ] ]
atbolsh/BNN_alternate_SOTA
[ "691fed93cf8b6911ec4d9dcd212f869dd5c9c7b9" ]
[ "remadeQuicknet.py" ]
[ "from typing import Optional, Sequence\n\n# The point of this one is to remove ALL the batchnorms.\n\n\nimport larq as lq\nimport numpy as np\nimport tensorflow as tf\nfrom zookeeper import Field, factory\n\nfrom larq_zoo.core import utils\nfrom larq_zoo.core.model_factory import ModelFactory\n\nfrom customRenorm i...
[ [ "tensorflow.keras.layers.Activation", "numpy.sqrt", "tensorflow.keras.layers.MaxPool2D", "tensorflow.keras.Model", "tensorflow.keras.initializers.RandomNormal" ] ]
matchRos/simulation_multirobots
[ "286c5add84d521ad371b2c8961dea872c34e7da2" ]
[ "src/simu/scripts/task_space_control.py" ]
[ "#!/usr/bin/env python3\n\n# /***************************************************************************\n\n# \n# @package: panda_siimulator_examples\n# @metapackage: panda_simulator\n# @author: Saif Sidhik <sxs1412@bham.ac.uk>\n# \n\n# **************************************************************************/\n\...
[ [ "numpy.dot", "numpy.asarray", "numpy.linalg.norm", "numpy.quaternion", "numpy.array", "numpy.vstack" ] ]
cgranade/QC-App-Oriented-Benchmarks
[ "4b935dae35486c29477830e90f777e54763499d4", "4b935dae35486c29477830e90f777e54763499d4" ]
[ "hidden-shift/qiskit/hs_benchmark.py", "_common/metrics.py" ]
[ "\"\"\"\nHidden Shift Benchmark Program - Qiskit\n\"\"\"\n\nimport sys\nimport time\n\nimport numpy as np\nfrom qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister\n\nsys.path[1:1] = [ \"_common\", \"_common/qiskit\" ]\nsys.path[1:1] = [ \"../../_common\", \"../../_common/qiskit\" ]\nimport execute as ...
[ [ "numpy.random.seed", "numpy.random.choice" ], [ "numpy.sqrt", "matplotlib.pyplot.ylim", "matplotlib.patches.Rectangle", "matplotlib.pyplot.subplots", "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.savefig", "matplotlib.pyplot.xlim", "matplotlib.cm.ScalarMappable", ...
chrisjdavie/ws_cross_project
[ "10ffd6d0df1aeea0e5d2d6c5dfddab907a2cd439" ]
[ "generic_plotting/linplots_cjd/semilog_plot.py" ]
[ "'''Plots a semi-log x axis against a linear y-axis.\n\nIt is, I think, only used for perturbation size, as it reflects\nthe underlying physics of that behaviour, but I've split it up\nfor clarity. Both bits do quite a lot of stuff.'''\n\nfrom linear_plot import linear_plot\nimport matplotlib.pyplot as plt\nimport...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.xlim", "numpy.argmin" ] ]
kj87au/Panda-Grasping
[ "54e35aee6e9c13358401b23e5584211418670657", "54e35aee6e9c13358401b23e5584211418670657" ]
[ "nets/GIGA-main/src/vgn/utils/implicit.py", "nets/contact_graspnet-main/pointnet2/models/frustrum_pontnets_v2.py" ]
[ "import os\nimport trimesh\nimport numpy as np\nfrom urdfpy import URDF\ntry:\n from vgn.ConvONets.utils.libmesh import check_mesh_contains\nexcept:\n print('import libmesh failed!')\n\nn_iou_points = 100000\nn_iou_points_files = 10\n\n## occupancy related code\ndef as_mesh(scene_or_mesh):\n \"\"\"\n Co...
[ [ "numpy.zeros", "numpy.random.rand" ], [ "tensorflow.Graph", "tensorflow.concat", "tensorflow.constant", "tensorflow.zeros", "tensorflow.slice", "tensorflow.reshape", "tensorflow.expand_dims", "tensorflow.ones" ] ]
n0whereRuoxi/aima-python
[ "777fa52b73830a534e27b33abf535933ace32a95" ]
[ "agents.py" ]
[ "'''\nThis file holds the agents.\n\n'''\n\nimport random, copy, collections\nfrom objects import Object\nfrom perception import *\nfrom comms import *\nimport numpy as np\nfrom scipy import spatial\nimport uuid\n# ______________________________________________________________________________\n\nclass Agent(Object)...
[ [ "numpy.asarray" ] ]
MSchauperl/propertyestimator
[ "9a67cb61498024c511f9bbe55536ac8e1a3c93be" ]
[ "propertyestimator/utils/serialization.py" ]
[ "\"\"\"\nA collection of classes which aid in serializing data types.\n\"\"\"\n\nimport importlib\nimport inspect\nimport json\nfrom abc import ABC, abstractmethod\nfrom enum import Enum\n\nimport numpy as np\n\nfrom propertyestimator import unit\nfrom propertyestimator.utils.quantities import EstimatedQuantity\n\n...
[ [ "numpy.float16", "numpy.int32", "numpy.int64", "numpy.float64", "numpy.float32", "numpy.array" ] ]
eric-kaufmann/ood_approach
[ "0ffff5e0cfc298557ddb7f1d773e0c4ebd21df48" ]
[ "train.py" ]
[ "import torch\nfrom torch.utils.tensorboard import SummaryWriter\nimport sys\nimport os\nsys.path.append(os.getcwd())\n\nfrom loss_functions import RBFClassifier, AAML, CircleLoss, Model, ModelArc\nfrom data_load import get_loader, get_channels, get_num_classes\n\nimport numpy as np\nimport torch.optim as optim\nim...
[ [ "torch.optim.lr_scheduler.CosineAnnealingLR", "torch.load", "matplotlib.pyplot.plot", "torch.no_grad", "torch.utils.tensorboard.SummaryWriter", "torch.cuda.is_available", "torch.device", "torch.optim.lr_scheduler.MultiStepLR", "torch.nn.CrossEntropyLoss", "torch.optim.lr_sc...
rdgozum/dexpression-pytorch
[ "6aac1fffee31062afda5fb1403f328d9c2502137" ]
[ "dexpression_pytorch/pipelines/network.py" ]
[ "import torch\nfrom dexpression_pytorch.cnn_model.dexpression import Dexpression\n\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n\n\ndef initialize():\n \"\"\"\n Loads model parameters into cuda.\n\n Returns\n -------\n model : object\n The convolutional neural ne...
[ [ "torch.cuda.is_available" ] ]
caodoanh2001/uit-mmf
[ "60359f6083b89b442c383dc7eee888e7fbf0c65f" ]
[ "pythia/utils/objects_to_byte_tensor.py" ]
[ "\n# Adopted from\n# https://github.com/pytorch/fairseq/blob/master/fairseq/distributed_utils.py\n\nimport pickle\nimport torch\n\nMAX_SIZE_LIMIT = 65533\nBYTE_SIZE = 256\n\n\ndef enc_obj2bytes(obj, max_size=4094):\n \"\"\"\n Encode Python objects to PyTorch byte tensors\n \"\"\"\n assert max_size <= MA...
[ [ "torch.zeros" ] ]
timchiu9781/Tomofun
[ "3f7abcb7fc1cc8200ec3fdff62bd51fbaada4126" ]
[ "01-byoc/code/workflow.py" ]
[ "import os\nimport time\nimport copy\nimport datetime\nimport json\nfrom argparse import ArgumentParser\nfrom pprint import pformat\nimport logging\n\nimport shutil\nimport torch\nimport numpy as np\nfrom torch.utils.tensorboard import SummaryWriter\n\nfrom utils import plot_confusion_matrix\nfrom dataset import So...
[ [ "torch.mean", "torch.nn.functional.softmax", "torch.max", "torch.load", "sklearn.metrics.roc_curve", "torch.std", "torch.set_grad_enabled", "torch.utils.tensorboard.SummaryWriter", "torch.cuda.is_available", "sklearn.metrics.auc", "numpy.vstack", "torch.save" ] ]
ZhitingHu/texar-pytorch
[ "72ea115013ced8a5a2b004eacf6271184d3572a8", "72ea115013ced8a5a2b004eacf6271184d3572a8" ]
[ "examples/xlnet/xlnet_generation_main.py", "texar/torch/utils/utils.py" ]
[ "# Copyright 2019 The Texar 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 required...
[ [ "torch.tensor", "torch.no_grad", "torch.cuda.is_available", "torch.load" ], [ "torch.max", "torch.arange", "numpy.iinfo", "torch.tensor" ] ]
Tauranis/tf-explain
[ "5a5a183d601bd8bdda41291ca4a76b132b3185a9" ]
[ "tf_explain/core/activations.py" ]
[ "\"\"\"\nCore Module for Activations Visualizations\n\"\"\"\nimport numpy as np\nimport tensorflow as tf\n\nfrom tf_explain.utils.display import filter_display\nfrom tf_explain.utils.saver import save_grayscale\n\n\nclass ExtractActivations:\n\n \"\"\" Draw activations of a specific layer for a given input \"\"\...
[ [ "numpy.clip", "tensorflow.keras.models.Model" ] ]
alshenoudy/ddpmMed
[ "b00a8d06a46ee5d49dbe1a391891a3c62b780b25", "b00a8d06a46ee5d49dbe1a391891a3c62b780b25" ]
[ "ddpmMed/utils/data.py", "ddpmMed/data/datasets.py" ]
[ "import os.path\n\nimport torch\nimport numpy as np\nfrom PIL import Image\nimport blobfile as bf\nimport tifffile as tiff\nfrom typing import Union, Any, List, Callable\nfrom torch.nn.functional import interpolate\nfrom matplotlib import pyplot as plt\nfrom torch.utils.data import DataLoader, Dataset\n\n\ndef imre...
[ [ "torch.concat", "torch.randint", "torch.max", "torch.cat", "numpy.min", "torch.tile", "torch.min", "matplotlib.pyplot.subplots", "torch.from_numpy", "numpy.max", "numpy.ceil", "torch.unique", "matplotlib.pyplot.close", "numpy.transpose", "torch.nn.functi...
chen-zhan/stDrosophila-release-1
[ "1b128eb81ff4d076f7271abb1298639be6d08310", "1b128eb81ff4d076f7271abb1298639be6d08310" ]
[ "stDrosophila/tools/cluster/cluster_spagcn.py", "stDrosophila/plot/three_d_plots.py" ]
[ "import random\n\nimport numpy as np\nimport pandas as pd\nimport SpaGCN as spg\nimport torch\n\nfrom anndata import AnnData\nfrom typing import Optional\n\ntry:\n from typing import Literal\nexcept ImportError:\n from typing_extensions import Literal\n\nfrom .utils import compute_pca_components\n\n\ndef clus...
[ [ "torch.manual_seed", "numpy.random.seed" ], [ "pandas.concat", "pandas.Series", "matplotlib.colors.to_rgb", "matplotlib.colors.to_hex", "pandas.DataFrame" ] ]
ZFhuang/DiveIntoDLSketches
[ "cf0654d06ab6eeaefc35fa3bebd4937f1cbbb165", "cf0654d06ab6eeaefc35fa3bebd4937f1cbbb165" ]
[ "Networks/LapSRN/LapSRN.py", "Networks/DBPN/DBPN.py" ]
[ "import torch\nfrom torch import nn\n\n# LapSRN, 拉普拉斯金字塔结构, 2017\n\n\nclass LapSRN(nn.Module):\n def __init__(self, fea_chan=64, scale=2, conv_num=3):\n super(LapSRN, self).__init__()\n self.level_num = int(scale/2)\n self.share_ski_upsample = nn.ConvTranspose2d(\n 1, 1, 4, stride...
[ [ "torch.nn.Sequential", "torch.mean", "torch.add", "torch.nn.ConvTranspose2d", "torch.sqrt", "torch.nn.Conv2d", "torch.nn.LeakyReLU" ], [ "torch.nn.Sequential", "torch.nn.Conv2d", "torch.nn.PReLU", "torch.nn.ConvTranspose2d" ] ]
codeballet/image-classifier-flowers
[ "95263d2c482b4dd68e51994175f3703b28d86fdd" ]
[ "get_device.py" ]
[ "import torch\n\n\n# Make code device agnostic with respect to user input\ndef get_device(gpu):\n if gpu == 'on':\n device = torch.device(\"cuda:0\" if torch.cuda.is_available() \n else \"cpu\")\n \n else:\n device = torch.device(\"cpu\")\n \n return...
[ [ "torch.device", "torch.cuda.is_available" ] ]
dachr8/Exercise
[ "2e567f9edcf0d06ca4ed99cb65a0264546a36d63" ]
[ "BUPT/Machine-Learning-I/Assignment1/ml4_6.py" ]
[ "# TODO 机器学习 4.6.sp 试选择2个UCI数据集,对上述2种算法所产生的未剪枝、预剪枝、后剪枝决策树进行实验比较。\n\nfrom ml4_3 import ID3_tree\nfrom ml4_4 import CART_tree\nfrom sklearn.datasets import load_iris, load_wine\nfrom sklearn.model_selection import train_test_split # Import train_test_split function\n\n\ndef run_4_6(dataset, criterion):\n x_train,...
[ [ "sklearn.datasets.load_wine", "sklearn.datasets.load_iris", "sklearn.model_selection.train_test_split" ] ]
CristopherNim/student_performance
[ "f1ec90329e91c44a8155d83c0ac1569eb038954e" ]
[ "ml_model.py" ]
[ "import numpy as np\r\nimport pandas as pd\r\nfrom sklearn.linear_model import Ridge\r\nfrom sklearn.model_selection import cross_val_score, train_test_split\r\nfrom sklearn.model_selection import RepeatedKFold\r\nfrom sklearn.preprocessing import OneHotEncoder\r\nimport pickle\r\nfrom flask import Flask, request\r...
[ [ "pandas.concat", "pandas.read_csv", "sklearn.model_selection.cross_val_score", "numpy.random.seed", "sklearn.preprocessing.OneHotEncoder", "sklearn.model_selection.train_test_split", "pandas.DataFrame", "sklearn.linear_model.Ridge", "numpy.column_stack" ] ]
yehonatanHarmatz/HandwritingGAN
[ "186aad6278ed91a7e3f8dcbcab32a19dbbfc3f09" ]
[ "util/train_extractor.py" ]
[ "#TODO- for loop with 16bit that trains a vgg19bn to recognize writers\nfrom torch import optim\nfrom torch.cuda.amp import GradScaler, autocast\n\nfrom models.StyleEncoder_model import StyleEncoder\n\n\ndef freeze_conv(model):\n for param in model.features:\n param.requires_grad = False\n\ndef train_vgg_...
[ [ "torch.cuda.amp.GradScaler", "torch.cuda.amp.autocast" ] ]
avostryakov/nlpaug
[ "f75770c230fe586cf21d11ad3342c2f160560d6a", "f75770c230fe586cf21d11ad3342c2f160560d6a" ]
[ "nlpaug/model/lang_models/xlnet.py", "test/augmenter/audio/test_mask.py" ]
[ "# Source: https://arxiv.org/abs/1906.08237\n\ntry:\n import torch\n from transformers import XLNetTokenizer, XLNetLMHeadModel\nexcept ImportError:\n # No installation required if not using this function\n pass\n\nfrom nlpaug.model.lang_models import LanguageModels\nfrom nlpaug.util.selection.filtering ...
[ [ "torch.tensor", "torch.no_grad", "torch.zeros" ], [ "numpy.array", "numpy.array_equal" ] ]
saitejamahadev/Experts-Hub-
[ "d29ff5d466c6403d156fdb6d9cc9a74191b77e3a" ]
[ "Random_Forest_Regression.py" ]
[ "# Random Forest Regression\n\n# Importing the libraries\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n# Importing the dataset\ndataset = pd.read_csv('Position_Salaries.csv')\nX = dataset.iloc[:, 1:2].values\ny = dataset.iloc[:, 2].values\n\n# Splitting the dataset into the Training s...
[ [ "sklearn.ensemble.RandomForestRegressor", "pandas.read_csv", "matplotlib.pyplot.title", "matplotlib.pyplot.scatter", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]