repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
ky-zhang/machinelearning_playground
[ "22285a0e49c888643112864430c6b7cd00a60aba" ]
[ "AdaBoost/adaboost.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\ndef loadSimpData():\n datMat = np.matrix([[1., 2.1],\n [2., 1.1],\n [1.3, 1.],\n [1., 1.],\n [2., 1.]])\n classLabels = [1.0, 1.0, -1.0, -1.0, 1.0]\n\n return datMat, classLabels\n\n# x, y = loadSimpData()\n# plt.plot(x, 'r...
[ [ "numpy.matrix", "numpy.zeros", "numpy.ones", "numpy.shape", "numpy.mat" ] ]
Steve-Tod/STFC3
[ "9f583704d271be501a2bf3c97e5b7ab3a84c2f92" ]
[ "code/data/__init__.py" ]
[ "import torch\nimport torch.utils.data\nimport logging\nfrom torchvision.datasets.samplers.clip_sampler import DistributedSampler, RandomClipSampler\nfrom torch.utils.data.dataloader import default_collate\n\ndef collate_fn_random_scale(batch):\n num_scale = len(batch[0])\n select_scale = torch.randint(num_sc...
[ [ "torch.randint", "torch.utils.data.dataloader.default_collate", "torch.utils.data.DataLoader" ] ]
annosoo/nncase
[ "898bd4075a0f246bca7b62a912051af3d890aff4" ]
[ "tests/tflite_test_runner.py" ]
[ "import tensorflow as tf\nfrom test_runner import *\nimport os\nimport shutil\n\n\nclass TfliteTestRunner(TestRunner):\n def __init__(self, case_name, targets=None, overwirte_configs: dict = None):\n super().__init__(case_name, targets, overwirte_configs)\n\n def from_tensorflow(self, module):\n ...
[ [ "tensorflow.lite.TFLiteConverter.from_saved_model", "tensorflow.saved_model.save", "tensorflow.lite.Interpreter" ] ]
NorthGuard/loop_printer
[ "808686c6a7bfb149a368d5d5b46f5047e81631d5" ]
[ "src/timer.py" ]
[ "from datetime import datetime, timedelta\n\nimport regex\nfrom scipy import optimize\nimport numpy as np\n\nfrom loop_printer.src.utility import _delta_time_str, _precision_on_microseconds, _get_difference_formatter\n\n\nclass LoopPrinterTimer:\n \"\"\"\n This timer records the step-counts passed on to the L...
[ [ "numpy.array", "scipy.optimize.leastsq" ] ]
brittonsmith/yt_p3bh
[ "52dd594fb3ded4a88b2cb43ec18ab1c81e617baa" ]
[ "scripts/plots/plot_top_growers.py" ]
[ "from matplotlib import pyplot, ticker\nimport numpy as np\n# import seaborn as sns\nimport yt\n\nfrom grid_figure import GridFigure\n\ndef get_distribution(vals, n=101):\n if vals.size == 0:\n return np.zeros(n)\n id_sort = np.argsort(vals)\n dist = vals[id_sort[np.clip(np.round(np.linspace(0, 1, n...
[ [ "numpy.zeros", "matplotlib.pyplot.savefig", "numpy.where", "numpy.argsort", "numpy.linspace", "numpy.logspace" ] ]
noriyukipy/tfdlg
[ "1040cc3cca44e0f9629ae0cb4bd6e18cbf4fbe3f" ]
[ "tfdlg/schedules.py" ]
[ "import tensorflow as tf\n\n\nclass TransformerSchedule(tf.keras.optimizers.schedules.LearningRateSchedule):\n \"\"\"TransformerScheduler implements the scheduler used in [Vaswani+, 2017]\"\"\"\n def __init__(self, d_model, warmup_steps=4000):\n super().__init__()\n\n self._d_model = d_model\n ...
[ [ "tensorflow.math.minimum", "tensorflow.math.maximum", "tensorflow.cast", "tensorflow.math.rsqrt" ] ]
parkus/emd
[ "7d739470f547ba84ae154a93c27362a70178ed38" ]
[ "test_script.py" ]
[ "import numpy as np\nimport emd.emd_functions as emd # for quick reload(emd) when debugging\nimport matplotlib.pyplot as plt\n\n#%% ---------------------------------------------------------------------------\n# GENERATE A POLYNOMIAL + SINE TEST FUNCTION\nN = 200\nt = np.arange(200, dtype=float) - N / 2\namp = 10.0\...
[ [ "numpy.max", "numpy.random.normal", "numpy.sin", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.random.uniform", "numpy.arange" ] ]
91902078/yb66
[ "ece7f637ac8bacb1ba51a6f1f6f1f2e9cdb91bd9" ]
[ "yb66/discussion/widget/Crystal_Parser.py" ]
[ "import re\nimport numpy\n#import xraylib\nimport sys\nimport os\n\ndef Crystal_Parser(filename='YB66.dat'):\n \"\"\"\n X.J. YU, xiaojiang@nus.edu.sg\n parse a complex crystal structure file, into a dictionary\n return a dictionary containing crystal infomation\n \"\"\"\n\n header_end = False ...
[ [ "numpy.array", "numpy.cos" ] ]
mrzhuzhe/PettingZoo
[ "81b21145cbe4b67a0f5713a806d3d992fc4ea487" ]
[ "mytest/test.py" ]
[ "import numpy as np\nfrom numpy import load\n\ndata = load('data/knights-archers-zombies-v8/test_run/ep_lengths.npy')\na = data\nprint(a)" ]
[ [ "numpy.load" ] ]
kasekun/MCVCM
[ "fa679ddc2458f282f5e4be8c827718ad2dd02f89" ]
[ "mcvcm.py" ]
[ "#!/usr/bin/env python3\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n# mcvcm.py\n#\n# Interactive software for manually cross-matching infrared and radio catalogues\n# and assigning multi-component radio ...
[ [ "matplotlib.use", "numpy.array", "matplotlib.pyplot.get_current_fig_manager", "matplotlib.pyplot.close", "numpy.where", "matplotlib.pyplot.show", "matplotlib.pyplot.subplots_adjust" ] ]
jm1261/GMRAnalysis
[ "de92803883b7296ed24ffecbcd6e1d967167190a" ]
[ "GMR/DataPreparation.py" ]
[ "import os\nimport numpy as np\nimport GMR.InputOutput as io\n\n\ndef pwr_norm(image_data, file_name, norm_power, dir_name):\n '''\n Plot a raw image and normalised image - use power meter data to\n normalise images. Normalised image's brightness estimated from\n pixels mean/std. Optionally save corre...
[ [ "numpy.reshape", "numpy.load", "numpy.exp", "numpy.shape", "numpy.transpose", "numpy.linspace" ] ]
philhchen/sparse-marginalization-lvm
[ "0fd219868389ad56fdf981f052c914cd7fbde27b" ]
[ "lvmhelpers/sparsesoftmax.py" ]
[ "import torch\nfrom torch.nn import Module, NLLLoss, Softmax\nimport torch.nn.functional as F\nfrom torch.autograd import Function\n\nEPS = 1e6\n\ndef sparse_softmax(X, dim: int = -1, train=True):\n mask = X < torch.mean(X, dim=dim, keepdim=True)\n mask_offset = mask * (EPS if train else float(\"Inf\"))\n ...
[ [ "torch.mean", "torch.nn.functional.log_softmax", "torch.nn.functional.softmax" ] ]
vb690/machine_learning_exercises
[ "9c5473652b576a3b0f0bd1df81e24166ca01c2b7" ]
[ "shops/machine_learning_exercises/modules/basic_supervised.py" ]
[ "import math\n\nimport itertools\n\nimport numpy as np\n\nimport matplotlib.pyplot as plt\n\nfrom .toolbox.abstract_models import _Distances\n\n\nclass Knn(_Distances):\n def __init__(self, k=6, distance='euclidian'):\n self.X_train = None\n self.y_train = None\n self.y_predicted = None\n ...
[ [ "numpy.array", "numpy.asarray", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "numpy.exp", "numpy.sum", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.pyplot.scatter", "matplotlib.pyplot...
apllolulu/SRN-Learning-to-see-in-the-dark
[ "94512bdcf2123ca20c1620998e11e5509472a45d" ]
[ "train_Sony.py" ]
[ "# uniform content loss + adaptive threshold + per_class_input + recursive G\n# improvement upon cqf37\nfrom __future__ import division\nimport os, time, scipy.io\nimport tensorflow as tf\nimport tensorflow.contrib.slim as slim\nimport numpy as np\nimport rawpy\nimport glob\nfrom random import shuffle\n\ninput_dir ...
[ [ "tensorflow.contrib.slim.max_pool2d", "numpy.minimum", "tensorflow.train.get_checkpoint_state", "numpy.where", "tensorflow.depth_to_space", "tensorflow.global_variables_initializer", "numpy.concatenate", "tensorflow.trainable_variables", "tensorflow.shape", "tensorflow.conc...
Nightfurex/MSS
[ "51a1bc0d4ce759288b5f3a0a46e538aa0c1a8788" ]
[ "mslib/utils/_tests/test_thermolib.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n\n mslib._test.test_thermoblib\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n Tests for the thermolib module.\n\n This file is part of mss.\n\n :copyright: Copyright 2017 Marc Rautenhaus\n :copyright: Copyright 2016-2022 by the mss team, see AUTHORS.\n :license: APACHE-2.0,...
[ [ "numpy.arange" ] ]
sungsulim/RLControl
[ "1af29e446958dc8c99ab101ddf5df969888d1e2e" ]
[ "agents/base_agent.py" ]
[ "from utils.replaybuffer import ReplayBuffer\nimport numpy as np\n\n\n# Agent interface\n# Takes an environment (just so we can get some details from the environment like the number of observables and actions)\nclass BaseAgent(object):\n def __init__(self, config, network_manager):\n\n self.norm_type = co...
[ [ "numpy.array" ] ]
sselgueta/pymoog
[ "8db465fd56debc1e25e5ce9e0afbb8053610a97c" ]
[ "build/lib/pymoog/model.py" ]
[ "#!/usr/bin/python\n# This is the python model dealing with the stellar atmosphere model.\nimport os\nimport subprocess\nimport numpy as np\nimport re\nimport pandas as pd\nfrom pymoog import line_data\nfrom scipy.spatial import Delaunay\n\nMOOG_path = '{}/.pymoog/moog_nosm/moog_nosm_NOV2019/'.format(os.environ['HO...
[ [ "numpy.array", "numpy.any", "numpy.transpose", "numpy.ptp", "pandas.read_csv", "scipy.spatial.Delaunay" ] ]
wolegechu/triton-inference-server
[ "6cce1c0627c453171c2f433442af1f254266e7a2" ]
[ "src/clients/python/experimental_api_v2/examples/simple_grpc_v2_infer_client.py" ]
[ "#!/usr/bin/env python\n# Copyright (c) 2020, NVIDIA CORPORATION. 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\n# are met:\n# * Redistributions of source code must retain the above copyright\n# ...
[ [ "numpy.ones", "numpy.arange", "numpy.expand_dims" ] ]
thirtywang/OpenPNM
[ "e55ee7ae69a8be3e2b0e6bf24c9ff92b6d24e16a", "e55ee7ae69a8be3e2b0e6bf24c9ff92b6d24e16a" ]
[ "OpenPNM/Network/models/pore_topology.py", "OpenPNM/Phases/models/contact_angle.py" ]
[ "r\"\"\"\n===============================================================================\npore_topology -- functions for monitoring and adjusting topology\n===============================================================================\n\n\"\"\"\nimport scipy as _sp\nfrom OpenPNM.Base import logging\nlogger = logg...
[ [ "scipy.shape", "scipy.vstack", "scipy.rand", "scipy.ones", "scipy.prod", "scipy.empty", "scipy.average" ], [ "scipy.rad2deg", "scipy.arccos" ] ]
Global19/qiskit-machine-learning
[ "479f9f03d2b6c1fbab936b5d6bfaee6eaee465b0" ]
[ "test/connectors/test_torch_connector.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2021.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modifications or ...
[ [ "torch.nn.Linear", "numpy.linalg.norm", "numpy.random.rand", "numpy.zeros", "numpy.sum", "torch.autograd.gradcheck", "torch.Tensor", "torch.randn" ] ]
ClaireGayral/formation_openclassroom
[ "ad3774064f71407ac6310b5b4b165bb5ac48e769" ]
[ "P5_gayral_claire/script06_reduce_dim.py" ]
[ "import matplotlib.pyplot as plt\nfrom matplotlib.collections import LineCollection\nimport numpy as np\nimport pandas as pd \nimport matplotlib._color_data as mcd\nimport random\n\n\n##\n## PCA\n## \ndef get_str_vars(list_of_var):\n # from a list of str, return a sentence\n # if the line is too long (sup to ...
[ [ "matplotlib.pyplot.text", "numpy.dot", "matplotlib.pyplot.xlim", "numpy.linalg.norm", "pandas.DataFrame", "numpy.arange", "matplotlib.pyplot.gca", "matplotlib.pyplot.axis", "matplotlib.pyplot.subplot", "scipy.cluster.hierarchy.dendrogram", "numpy.zeros", "matplotlib...
tlu7/jax
[ "f4351e84191cf769b59f6e652264bb2b9ab007d8" ]
[ "jax/interpreters/pxla.py" ]
[ "# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.max", "numpy.array", "numpy.empty", "numpy.asarray", "numpy.array_equal", "numpy.vectorize", "numpy.zeros", "numpy.min", "numpy.prod", "numpy.issubdtype", "numpy.broadcast_to", "numpy.dtype", "numpy.flatnonzero" ] ]
khramtsova/federated
[ "88b3ca65204a9922696ccefd774ece03ebf5cc8e" ]
[ "tensorflow_federated/python/core/impl/compiler/type_serialization.py" ]
[ "# Lint as: python3\n# 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# ...
[ [ "tensorflow.DType", "tensorflow.TensorShape" ] ]
intel/mlir-extensions
[ "fb5cb57176648bb09fc80abde5fd1a415fe0fe04" ]
[ "numba_dpcomp/numba_dpcomp/mlir/tests/test_numpy.py" ]
[ "# Copyright 2021 Intel Corporation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or ...
[ [ "numpy.testing.assert_allclose", "numpy.dot", "numpy.mean", "numpy.resize", "numpy.iscomplexobj", "sklearn.datasets.make_regression", "numpy.dtype", "numpy.concatenate", "numpy.empty", "numpy.seterr", "numpy.eye", "numpy.arange", "numpy.empty_like", "numpy.a...
fegan104/roam
[ "6a3a9136c8b25e2b550c11789901b1f1d8916afc" ]
[ "src/runvast2.py" ]
[ "import pickle\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom macrel import graphs\nfrom macrel import viewmap\nfrom macrel import vast11data as vast\n\nN = len(vast.NODES)\n\n\ndef blend(probs, weights):\n\tassert len(probs) == len(weights)\n\tk = len(probs)\n\n\ttotal_weight = sum(w for w in weigh...
[ [ "matplotlib.pyplot.show" ] ]
Elizabeth-Warren/warren_organizing_email
[ "662e5ae4844bffe64fec4c6635ee87dabd0c3e06" ]
[ "utils.py" ]
[ "import datetime\nimport pandas as pd\nimport pytz\n\n\ndef date_today():\n return datetime.datetime.now(pytz.timezone(\"US/Eastern\")).date()\n\n\ndef ds_today():\n return str(date_today())\n\n\ndef sql_quote(v):\n \"\"\"Returns quoted value suitable for SQL insert.\n\n Is not robust enough to properly...
[ [ "pandas.isnull" ] ]
markusweimer/hummingbird
[ "0bbd5607b74ead81c9876c75a89a4bd845da1b5b" ]
[ "hummingbird/ml/operator_converters/_tree_implementations.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...
[ [ "torch.sigmoid", "torch.cat", "torch.nn.ParameterList", "numpy.zeros", "torch.gather", "torch.IntTensor", "torch.FloatTensor", "numpy.ones", "torch.softmax", "torch.mm", "torch.from_numpy", "torch.squeeze", "torch.LongTensor", "torch.index_select", "torc...
villasen/ML-KWS-for-MCU
[ "704a36897c04582254239fccb8bc37af04919b1d" ]
[ "quant_test.py" ]
[ "# Copyright 2017 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.trainable_variables", "tensorflow.logging.set_verbosity", "tensorflow.assign", "numpy.round", "tensorflow.argmax", "tensorflow.equal", "tensorflow.confusion_matrix", "tensorflow.logging.info", "tensorflow.placeholder", "numpy.transpose", "tensorflow.app.run"...
yifding/AVEQA_transformers
[ "7c6619db4fa87c331f798d89e08a54b5ec4d8868" ]
[ "src/transformers/models/deberta_v2/modeling_deberta_v2.py" ]
[ "# coding=utf-8\n# Copyright 2020 Microsoft and the Hugging Face Inc. 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...
[ [ "torch.nn.Linear", "numpy.tile", "torch.ones", "numpy.sign", "numpy.where", "torch.nn.CrossEntropyLoss", "torch.nn.LayerNorm", "numpy.log", "torch.nn.Conv1d", "numpy.arange", "torch.tensor", "torch.zeros_like", "torch._softmax_backward_data", "torch.zeros", ...
AUST-Hansen/Dive-into-DL-PyTorch
[ "a97816955ecbaa4a337162a9b1e3e990f6e66dc6" ]
[ "code/d2lzh_pytorch/utils.py" ]
[ "import collections\nimport math\nimport os\nimport random\nimport sys\nimport tarfile\nimport time\nimport json\nimport zipfile\nfrom tqdm import tqdm\nfrom PIL import Image\nfrom collections import namedtuple\n\nfrom IPython import display\nfrom matplotlib import pyplot as plt\nimport torch\nfrom torch import nn\...
[ [ "torch.nn.Linear", "torch.cat", "torch.stack", "torch.nn.BatchNorm2d", "numpy.genfromtxt", "matplotlib.pyplot.semilogy", "torch.cuda.is_available", "torch.transpose", "torch.nn.CrossEntropyLoss", "numpy.random.normal", "torch.nn.MaxPool2d", "matplotlib.pyplot.subplo...
contrera/gammapy
[ "aa0a74baa977ee2477b5c63e036075f4219792a3", "aa0a74baa977ee2477b5c63e036075f4219792a3" ]
[ "gammapy/utils/nddata.py", "gammapy/utils/fitting/tests/test_sherpa.py" ]
[ "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\"\"\"Utility functions and classes for n-dimensional data and axes.\n\"\"\"\nfrom __future__ import absolute_import, division, print_function, unicode_literals\nimport itertools\nfrom collections import OrderedDict\nimport numpy as np\nfrom astropy....
[ [ "numpy.array", "numpy.isnan", "numpy.reshape", "numpy.argmin", "numpy.shape", "numpy.arange", "numpy.atleast_1d", "numpy.sqrt", "numpy.clip", "numpy.log10", "numpy.abs", "numpy.linspace", "scipy.interpolate.RegularGridInterpolator", "numpy.logspace", "nu...
darkreactions/rdkit
[ "0c388029c1f9386d832f6c321e59a11589c373d8", "0c388029c1f9386d832f6c321e59a11589c373d8" ]
[ "rdkit/Chem/Pharm3D/EmbedLib.py", "rdkit/Chem/Draw/SimilarityMaps.py" ]
[ "# $Id$\n#\n# Copyright (C) 2004-2008 Greg Landrum and Rational Discovery LLC\n#\n# @@ All Rights Reserved @@\n# This file is part of the RDKit.\n# The contents are covered by the terms of the BSD license\n# which is included in the file license.txt, found at the root\n# of the RDKit source tree.\n#\nfrom __f...
[ [ "numpy.array", "numpy.dot", "numpy.zeros", "numpy.nonzero", "numpy.take", "numpy.sqrt" ], [ "numpy.max", "numpy.min" ] ]
ktanushree/bulkupgrade
[ "8dfaa07b58a345c0ebfef9cc05b981272ce9e997" ]
[ "bulkupgrade.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nPrisma SDWAN Bulk Device Upgrades\ntkamath@paloaltonetworks.com\nVersion: 1.0.1 b1\n\"\"\"\n# standard modules\nimport getpass\nimport json\nimport logging\nimport datetime\nimport os\nimport sys\nimport csv\nimport time\nimport numpy as np\nimport pandas as pd\n\n#standard modules\n...
[ [ "pandas.read_csv" ] ]
ahmedhammad97/Offensive-Language-Detection
[ "f5bd9056eada52f63862ba4f54d4d0c2d4b59df6" ]
[ "app.py" ]
[ "#######################################\n## Author: Ahmed Hammad\n## License: MIT\n## Email: hammad97official@gmail.com\n## Website: www.ahmedhammad97.com\n#######################################\n\nimport pandas as pd\nimport numpy as np\nfrom tqdm import tqdm\nimport preprocessing, embedding, helper, classifying...
[ [ "pandas.read_csv" ] ]
shadinaguib/shadinaguib.github.io
[ "7bc8b60ffca3fafb737f820f264ae43942611f6d" ]
[ "Notebooks/src/functions.py" ]
[ "# ------------------------- IMPORTS -------------------------\n\nimport pandas as pd\nimport numpy as np\nimport os\nimport sys\nimport pycountry\nimport reverse_geocode\nimport pycountry_convert as pc\n\n\n# -------------------- GLOBAL VARIABLES ---------------------\n\n# Cell size for defining home location\nCEL...
[ [ "numpy.sin", "pandas.merge", "numpy.sqrt", "numpy.cos", "numpy.deg2rad" ] ]
bryanhe/tutorials
[ "37b50b7c11fb1fbd6120af3cc00a0f303f84224e" ]
[ "beginner_source/torchvision_video_tutorial.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nTransfer Learning for Computer Vision Tutorial\n==============================================\n**Author**: `Sasank Chilamkurthy <https://chsasank.github.io>`_\n\nIn this tutorial, you will learn how to train a convolutional neural network for\nimage classification using transfer l...
[ [ "torch.nn.Linear", "torch.optim.lr_scheduler.StepLR", "torch.cuda.is_available", "torch.nn.CrossEntropyLoss", "torch.sum", "torch.utils.data.DataLoader", "matplotlib.pyplot.subplot", "numpy.array", "torch.max", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", ...
redherring2141/CarND-Advanced-Lane-Lines
[ "cb604cacaca260b03afc216864166d04209c9829" ]
[ "files_for_submission/classLine.py" ]
[ "import numpy as np\nfrom processFrame import process_frame\n\n# Define a class to receive the characteristics of each line detection\nclass Line():\n def __init__(self):\n # was the line detected in the last iteration?\n self.detected = False \n # x values of the last n fits of the line\n ...
[ [ "numpy.array" ] ]
tiefenauer/ip9
[ "4d50ee288f8a00f64a6f4a7d80639d3dc89df4e8", "4d50ee288f8a00f64a6f4a7d80639d3dc89df4e8" ]
[ "src/util/pipeline_util.py", "src/create_pc_corpus.py" ]
[ "\"\"\"\nUtility functions for end-to-end tasks\n\"\"\"\nimport json\nimport os\nfrom os.path import join, basename, exists, pardir, abspath\nfrom shutil import copyfile\n\nimport numpy as np\nimport pandas as pd\nfrom bs4 import BeautifulSoup\nfrom pattern3.metrics import levenshtein_similarity\n\nfrom constants i...
[ [ "pandas.DataFrame" ], [ "pandas.DataFrame" ] ]
rbeucher/pyLineSPM
[ "07ab561f638cae0caccd4f27c74b03f1f1364202" ]
[ "tests/test_unit_test.py" ]
[ "import numpy as np\n\nsurface = np.zeros((100, 2))\nsurface[:, 0] = np.linspace(0, 8*np.pi, 100)\nsurface[:, 1] = np.cos(surface[:, 0])\n\nprecip_rate = np.ones(surface[:,0].shape)\nerodibility = np.ones(surface[:,0].shape) * 0.1\nuplift_rate = np.ones(surface[:,0].shape) * 0.01\n\ndef test_import():\n import p...
[ [ "numpy.zeros", "numpy.ones", "numpy.allclose", "numpy.cos", "numpy.linspace" ] ]
salvacarrion/yolo4math
[ "57102831bbad7e70f213052664202449d41a1294", "57102831bbad7e70f213052664202449d41a1294" ]
[ "preprocessing/kmeans.py", "preprocessing/check_bboxes.py" ]
[ "import numpy as np\nfrom utils.utils import *\n\n\nclass YOLO_Kmeans:\n\n def __init__(self, cluster_number):\n self.cluster_number = cluster_number\n\n def iou(self, boxes, clusters): # 1 box -> k clusters\n n = boxes.shape[0]\n k = self.cluster_number\n\n box_area = boxes[:, 0]...
[ [ "numpy.max", "numpy.array", "numpy.empty", "numpy.reshape", "numpy.zeros", "numpy.minimum", "numpy.random.seed", "numpy.argmin", "numpy.random.choice", "numpy.lexsort", "numpy.tile", "numpy.shape", "numpy.multiply" ], [ "numpy.array" ] ]
piushvaish/dissecting-reinforcement-learning
[ "91c5d00d15b99b8d79a3c2e38fbc443856779273" ]
[ "src/4/actor_critic.py" ]
[ "#!/usr/bin/env python\n\n#MIT License\n#Copyright (c) 2017 Massimiliano Patacchiola\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...
[ [ "numpy.max", "numpy.full", "numpy.array", "numpy.random.choice", "numpy.zeros", "numpy.random.random" ] ]
Jacfger/simple-stuffs
[ "5596a03ec7a42a2f32b695ed73afb8c6a3cce030" ]
[ "utils/graph.py" ]
[ "import os\nimport pickle\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport collections\nimport numpy as np\nimport sys\nsys.path.append(\"/home/zwanggc/FirstOrderQueryEstimation\")\nfrom fol import beta_query_v2, parse_formula, beta_query\nfrom data_helper import all_normal_form\n\n\nbeta_step = [15000...
[ [ "numpy.zeros_like", "numpy.asarray", "numpy.log", "pandas.DataFrame.from_dict", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "numpy.where", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "pandas....
ralfrost/probnum
[ "6b0988009a9dd7ecda87ba28c9d5c0b8019981b6" ]
[ "tests/test_diffeq/test_odefiltsmooth/test_odefiltsmooth.py" ]
[ "\"\"\"\nWe test on two test-problems:\n * logistic ODE (because it has a closed form sol.)\n -> make sure error converges to zero (even with rate q?)\n -> Check if iterates match the closed-form solutions in\n Schober et al.\n * Lotka-Volterra (because it provides meaningful uncertainty ...
[ [ "numpy.array", "numpy.zeros", "numpy.ones", "numpy.diff", "numpy.amin", "numpy.amax", "numpy.sqrt", "numpy.abs" ] ]
CQUlearningsystemgroup/BitwiseBottlneck
[ "db2b3a19d56740a8e933c609fed45eb667378c37" ]
[ "utils/data/file_io.py" ]
[ "\n\"\"\"Convenience functions for managing dataset file buffers.\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport atexit\nimport multiprocessing\nimport os\nimport tempfile\nimport uuid\n\nimport numpy as np\nimport six\n\nimport tens...
[ [ "numpy.ceil", "tensorflow.train.FloatList", "tensorflow.compat.v1.logging.info", "numpy.reshape", "tensorflow.train.Features", "tensorflow.train.Int64List", "tensorflow.io.gfile.stat", "tensorflow.io.gfile.makedirs", "tensorflow.io.gfile.exists", "numpy.stack", "tensorf...
vincekurtz/quadruped_drake
[ "0fed14eeb7ba33144ab740bc9afa412398f70b7e" ]
[ "planners/simple.py" ]
[ "import numpy as np\nfrom pydrake.all import *\n\nclass BasicTrunkPlanner(LeafSystem):\n \"\"\"\n Implements the simplest possible trunk-model planner, which generates\n desired positions, velocities, and accelerations for the feet, center-of-mass,\n and body frame orientation. \n \"\"\"\n def __i...
[ [ "numpy.array", "numpy.sin", "numpy.zeros", "numpy.cos" ] ]
z0li627/lambdata_DS9
[ "e122f66c1da19d8b768a0719007ce060831db70e" ]
[ "lambdata_z0li627/__init__.py" ]
[ "\"\"\"lambdata - a collection os data science heper functions\"\"\"\n\nimport pandas as pd\nimport numpy as np\n\n#sample code\n\n#sample datasets\nONES = pd.DataFrame(np.ones(10))\nZEROS = pd.DataFrame(np.zeros(10))\n\n#sample functions\ndef increment(x):\n return (x + 1)\n\n" ]
[ [ "numpy.ones", "numpy.zeros" ] ]
guyeshet/Keras-Project-Template
[ "4b324aea4a923ca0ceb1610487bf7139706fae33" ]
[ "webserver/loader.py" ]
[ "import os\nfrom collections import Counter\n\nimport numpy as np\nfrom keras.engine.saving import load_model\n\nfrom utils.utils import from_env, get_root\nfrom webserver.storage.factory import StorageFactory\n\nmodel = None\nMODEL_TYPE = from_env('MODEL_TYPE', 'uk_target_only_native_speakers')\nMODEL_NUM = from_e...
[ [ "numpy.zeros" ] ]
morgoth1145/sandpiles
[ "d50327875c837b1af7668444cbe65df2ecc94719" ]
[ "sandpile.py" ]
[ "import enum\nimport os\nimport time\n\nimport numpy\nimport pyopencl as cl\nfrom pyopencl.tools import dtype_to_ctype\nfrom PIL import Image\n\nimport pyopencl.array\n\nclass SymmetryMode(enum.Enum):\n SYMMETRY_OFF = 0\n SYMMETRY_ON = 1\n SYMMETRY_ON_WITH_OVERLAP = 2\n\ndef isqrt(n):\n x = n\n y = (...
[ [ "numpy.uint32", "numpy.load" ] ]
hudmgy/HRNet-Facial-Landmark-Detection
[ "fe95d4b19e92fe267201d38648635b9beffba77a" ]
[ "lib/datasets/face300wsd.py" ]
[ "# ------------------------------------------------------------------------------\n# Copyright (c) Microsoft\n# Licensed under the MIT License.\n# Created by Tianheng Cheng(tianhengcheng@gmail.com), Yang Zhao\n# ------------------------------------------------------------------------------\n\nimport os\nimport rand...
[ [ "pandas.read_csv", "torch.Tensor" ] ]
Toyhom/models
[ "54f64c665e2f737a91c39f42e973fa121b80d8b4" ]
[ "dygraph/ptb_lm/ptb_dy.py" ]
[ "# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE-2.0\r...
[ [ "numpy.random.seed", "numpy.exp", "numpy.zeros" ] ]
nodmaterial/OpenVaccine
[ "7961d43bb2f7c5ebc35548511608cc98f9948a01" ]
[ "covid-19_inference.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nimport time\nimport warnings\nwarnings.filterwarnings('ignore')\nimport pandas as pd, numpy as np\nimport math, json, gc, random, os, sys\nimport torch\nimport logging\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.utils.data as data\nfrom ...
[ [ "torch.nn.Linear", "torch.cat", "torch.cuda.manual_seed", "torch.nn.LSTM", "torch.nn.GRU", "numpy.load", "torch.cuda.is_available", "torch.load", "pandas.concat", "pandas.read_csv", "torch.reshape", "numpy.concatenate", "pandas.merge", "pandas.DataFrame", ...
ada-shen/Interpret_quality
[ "e58d8e24a44005bde1eadbf8ef34c715d02a19cf" ]
[ "final_shapley_value.py" ]
[ "\"\"\" save the region id and sampled orders\r\nalso calculate the Shapley value for each region (at the original position of the point cloud) \"\"\"\r\nimport os\r\n\r\nimport argparse\r\nimport torch\r\nfrom final_data_shapley import ModelNet_Loader_Shapley_test, ShapeNetDataset_Shapley_test\r\nimport numpy as n...
[ [ "numpy.concatenate", "torch.device", "numpy.zeros", "torch.no_grad", "torch.argmin", "numpy.load", "numpy.save", "torch.from_numpy", "torch.cuda.device_count", "torch.cuda.current_device", "torch.cuda.is_available", "numpy.arange", "torch.mean" ] ]
tonybaloney/cpython-book-samples
[ "d61d252d63461b114c3c02329a88a74dc8c51956" ]
[ "62/profile.py" ]
[ "import argparse\nfrom pathlib import Path\nfrom perf._bench import BenchmarkSuite\n\nimport seaborn as sns\nimport pandas as pd\n\nsns.set(style=\"whitegrid\")\n\nparser = argparse.ArgumentParser()\nparser.add_argument('files', metavar='N', type=str, nargs='+',\n help='files to compare')\nargs =...
[ [ "pandas.DataFrame" ] ]
hai-dang-dau/particles
[ "312d0d3675518ce075c5e57c7437466d1fabd3b5" ]
[ "setup.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport io\nimport os\nimport setuptools \nimport sys\nimport warnings\n\nNAME = 'particles'\nDESCRIPTION = 'Sequential Monte Carlo in Python'\n\nwith open('README.md') as f:\n long_description = f.read()\n\nMETADATA = dict(\n name=NAME, \n version='0.1', ...
[ [ "numpy.distutils.extension.Extension" ] ]
Julien-Virl/PYCOF
[ "973d82d302f52a8f32bca85617d4225b0a436f62" ]
[ "pycof/data.py" ]
[ "import os\nimport sys\nimport getpass\nimport boto3\n\nimport pandas as pd\nimport numpy as np\nimport math\nimport json\nimport xlrd\nimport hashlib\nfrom io import StringIO, BytesIO\nimport urllib.request\nfrom types import SimpleNamespace\n\nimport re\n\nfrom tqdm import tqdm\nimport datetime\n\nfrom .misc impo...
[ [ "pandas.read_csv", "pandas.read_parquet", "pandas.read_json", "pandas.read_excel" ] ]
kennethsequeira/Hello-world
[ "464227bc7d9778a4a2a4044fe415a629003ea77f" ]
[ "Python/KNN_with_scikit_learn.py" ]
[ "\n# coding: utf-8\n\n# In[21]:\n\n\n#importing libraries\n#!pip install pandas\n#!pip install matplotlib\n#!pip install sklearn\n\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics imp...
[ [ "matplotlib.pyplot.xlabel", "sklearn.neighbors.KNeighborsClassifier", "matplotlib.pyplot.plot", "sklearn.metrics.accuracy_score", "matplotlib.pyplot.ylabel", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.show", "pandas.read_csv" ] ]
mriberodiaz/client_availability
[ "c8b0b89fe647ae620118569c23022f5e9aad8749" ]
[ "optimization/shared/fed_avg_schedule.py" ]
[ "# Copyright 2019, Google LLC.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agree...
[ [ "tensorflow.shape", "tensorflow.GradientTape", "tensorflow.nest.map_structure", "tensorflow.constant", "tensorflow.cast" ] ]
nerds-ufes/G-PolKA
[ "9c6bd42167bc333f6421a751c93a88c00841def9", "9c6bd42167bc333f6421a751c93a88c00841def9", "9c6bd42167bc333f6421a751c93a88c00841def9" ]
[ "validation/emulation/experiments/linear-gpolka.p4app/test/jitter_test/graph_jitter.py", "src/polka/keyflow_multicast.py", "validation/emulation/experiments/linear-gpolka.p4app/test2/latency_test_btraffic/graph_latency_btraffic.py" ]
[ "import pandas as pd\nimport numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nfrom datetime import datetime\nimport os\n\nimport matplotlib as mpl\n\nmpl.use(\"pdf\")\nplt.style.use(\"paper\")\nplt.grid(True, linestyle=\"-\", alpha=0.5, linewidth=0.5)\n# mpl.rcParams[\"figure.figsize\"] = [3.2, ...
[ [ "matplotlib.use", "matplotlib.pyplot.grid", "pandas.DataFrame", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.legend", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.style.use" ], [ "numpy.ceil" ], [ "matplotlib.use", "matplotlib.pyplot.grid", "pandas.DataFrame...
astonzhang/dgl
[ "2664ed2dff9d0e9e45d2349c531b460b31cec215" ]
[ "tests/pytorch/test_line_graph.py" ]
[ "import torch as th\nimport networkx as nx\nimport numpy as np\nimport dgl\nimport utils as U\n\nD = 5\n\ndef test_line_graph():\n N = 5\n G = dgl.DGLGraph(nx.star_graph(N))\n G.edata['h'] = th.randn((2 * N, D))\n n_edges = G.number_of_edges()\n L = G.line_graph(shared=True)\n assert L.number_of_n...
[ [ "torch.zeros", "torch.randn" ] ]
Huawei-Ascend/tensorflow
[ "67979f8cf1acbb6db6b156ee0a15d277571d4a03" ]
[ "tf_adapter/python/npu_bridge/estimator/npu/npu_loss_scale_optimizer.py" ]
[ "\n# Optimizer for mixed precision training for Davinci NPU.\n\n\"\"\"Loss scaling optimizer.\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport tensorflow as tf\nfrom tensorflow.python.eager import context\nfrom tensorflow.pyth...
[ [ "tensorflow.python.ops.math_ops.cast", "tensorflow.python.ops.control_flow_ops.cond", "tensorflow.get_default_graph", "tensorflow.equal", "tensorflow.python.ops.gen_math_ops.reciprocal", "tensorflow.constant", "tensorflow.python.eager.context.executing_eagerly" ] ]
Hamifthi/CS231.n-programming-assignment
[ "6620de7b5cb2c2fa7db0cfe4f4801adfe77c3356", "6620de7b5cb2c2fa7db0cfe4f4801adfe77c3356" ]
[ "assignment3/cs231n/classifiers/squeezenet.py", "assignment1/cs231n/gradient_check.py" ]
[ "import tensorflow as tf\n\nNUM_CLASSES = 1000\n\ndef fire_module(x,inp,sp,e11p,e33p):\n with tf.variable_scope(\"fire\"):\n with tf.variable_scope(\"squeeze\"):\n W = tf.get_variable(\"weights\",shape=[1,1,inp,sp])\n b = tf.get_variable(\"bias\",shape=[sp])\n s = tf.nn.co...
[ [ "tensorflow.concat", "tensorflow.nn.relu", "tensorflow.nn.conv2d", "tensorflow.one_hot", "tensorflow.train.Saver", "tensorflow.reshape", "tensorflow.variable_scope", "tensorflow.placeholder", "tensorflow.get_variable", "tensorflow.nn.bias_add", "tensorflow.nn.max_pool",...
ritu01rt/DeepPixel
[ "bb09017c40b2cbd3fe24c7cd7f1540b559434a66" ]
[ "deeppixel/face_rec/Face_detection/FaceDetection.py" ]
[ " \nfrom glob import glob \nimport matplotlib.pyplot as plt\nimport cv2\nimport os\nimport argparse\n\n#Function to convert RBG images to Gray\ndef convertToGray(image):\n\treturn cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)\n\n#Function to convert gray images to RGB\ndef convertToRGB(image):\n\treturn cv2.cvtColor(imag...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.pyplot.axis", "matplotlib.pyplot.imshow" ] ]
FantasyJXF/deeplab_v3
[ "153136ac496d54e6608e4053cadf6982811f1cb5" ]
[ "preprocessing/read_data.py" ]
[ "import tensorflow as tf\nfrom preprocessing.inception_preprocessing import apply_with_random_selector, distort_color\nimport urllib\nimport tarfile\nimport os\n\ndef random_flip_image_and_annotation(image_tensor, annotation_tensor, image_shape):\n \"\"\"Accepts image tensor and annotation tensor and returns ran...
[ [ "tensorflow.rank", "tensorflow.shape", "tensorflow.decode_raw", "tensorflow.expand_dims", "tensorflow.round", "tensorflow.random_uniform", "tensorflow.FixedLenFeature", "tensorflow.equal", "tensorflow.reshape", "tensorflow.image.resize_image_with_crop_or_pad", "tensorfl...
SikandarBakht/asg2cap
[ "97a1d866d4a2b86c1f474bb168518f97eb2f8b96" ]
[ "framework/ops.py" ]
[ "import numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom torch.nn.utils.rnn import pack_padded_sequence\nfrom torch.nn.utils.rnn import pad_packed_sequence\n\ndef l2norm(inputs, dim=-1):\n # inputs: (batch, dim_ft)\n norm = torch.norm(inputs, p=2, dim=dim, keepdim=True)\...
[ [ "torch.norm", "numpy.ones", "torch.arange", "torch.from_numpy" ] ]
hklhfong/CAB420Assignment-1B
[ "50127f08a8c29e47c9674a7334969f77648e7092" ]
[ "Question2.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri May 15 15:24:24 2020\n\n@author: hofonglaw\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nfrom sklearn.mixture import GaussianMixture\nimport matplotlib.pyplot as plt\nfrom sklearn.cluster import KMeans\nfrom sklearn.metrics import confusion_matrix, ConfusionMat...
[ [ "matplotlib.pylab.xticks", "pandas.merge", "matplotlib.pylab.ylabel", "matplotlib.pylab.bar", "matplotlib.pylab.show", "matplotlib.pylab.figure", "sklearn.mixture.GaussianMixture", "matplotlib.pylab.subplots", "pandas.read_csv", "numpy.unique" ] ]
octavian-ganea/equidock_public
[ "ac2c754399bf20b50a27d86dbff4f6669788d47f" ]
[ "src/inference_rigid.py" ]
[ "import os\n\nimport torch\n\nos.environ['DGLBACKEND'] = 'pytorch'\n\nfrom datetime import datetime as dt\nfrom src.utils.protein_utils import preprocess_unbound_bound, protein_to_graph_unbound_bound\nfrom biopandas.pdb import PandasPdb\nfrom src.utils.train_utils import *\nfrom src.utils.args import *\nfrom src.ut...
[ [ "torch.zeros", "torch.device", "torch.stack", "torch.mm", "torch.ones", "torch.from_numpy", "torch.cuda.is_available", "torch.tensor", "torch.load" ] ]
code-BSOD/Describing_a_Knowledge_Base
[ "b516bc77b25fa02e86bac20f6ebc4e11113c9efe" ]
[ "main.py" ]
[ "import argparse\nimport sys\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nfrom predictor import Predictor\nfrom utils.loader import Table2text_seq\nfrom structure_generator.EncoderRNN import EncoderRNN\nfrom structure_generator.DecoderRNN import DecoderRNN\nfrom structure_generator.seq2seq imp...
[ [ "torch.device", "torch.cuda.manual_seed", "torch.set_grad_enabled", "torch.manual_seed", "torch.cuda.is_available", "torch.load", "torch.nn.Embedding" ] ]
scedastic/my_ml_service
[ "9231db2602a78a2c696c79f5ff8b26edbd225c39" ]
[ "backend/server/apps/ml/income_classifier/random_forest.py" ]
[ "import joblib\r\nimport pandas as pd\r\n\r\nclass RandomForestClassifier:\r\n def __init__(self):\r\n '''\r\n Constructor: loads preprocessing objects and Random Forest object (created with Jupyter)\r\n '''\r\n # path_to_artifacts = \"../../reasearch/\"\r\n path_to_artifacts =...
[ [ "pandas.DataFrame" ] ]
mady1258/clade_prediction
[ "c708251972be001a1341bb4ab10f8443b33a590e" ]
[ "convert_gen_seqs_fasta.py" ]
[ "import time\nimport sys\nimport os\n\nimport pandas as pd\nimport numpy as np\nimport json\n\nimport utils\n\ndata_path = \"test_results/08_10_one_hot_3_CPU_20A_20B/\"\ngen_file = \"true_predicted_multiple_20B_20I_Alpha_20F_20D_21G_Lambda_21H_2_times.csv\"\nparent_clade = \"20B\"\nchild_clade = \"20I_Alpha_20F_20D...
[ [ "numpy.round", "pandas.read_csv" ] ]
ViliamVadocz/Bots
[ "092abc5bf92e9dab9d07499849d54a33b0b0c4f6" ]
[ "Retired/BoostHog/util.py" ]
[ "import math\n\ntry:\n import numpy as np\nexcept ImportError:\n try:\n from pip import main as pipmain\n except ImportError:\n from pip._internal import main as pipmain\n pipmain(['install', 'numpy'])\n try:\n import numpy as np\n except ImportError:\n raise Import...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.dot", "scipy.interpolate.interp1d", "numpy.zeros" ] ]
AdamMomen/linear_regression
[ "cf4d3ac41709b42878222ef37697587af7cb1b97" ]
[ ".history/run_20200624142032.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport sklearn.linear_model\n\n\n# Loading the data\noecd_bli = pd.read_csv(\"oced_bli_2015.csv\", thousands=\",\")\ngdp_per_capita = pd.read_csv(\n \"oced_bli_2015.csv\", thousands=\",\", delimiter=\"\\t\", encoding=\"latin1\", na_values...
[ [ "pandas.read_csv", "pandas.merge" ] ]
zdebeurs/radvel
[ "acbe76db00dc1ef558fb426a2ef5533f4676f873" ]
[ "setup.py" ]
[ "from setuptools import setup, find_packages, Extension\nfrom setuptools.command.build_ext import build_ext as _build_ext\nimport re\n\n\nclass build_ext(_build_ext):\n def finalize_options(self):\n _build_ext.finalize_options(self)\n # Prevent numpy from thinking it is still in its setup process:\...
[ [ "numpy.get_include" ] ]
thuzhf/tensorpack
[ "83ef7d05d0a16f82d86323c4e2f9b5d14870affa" ]
[ "examples/boilerplate.py" ]
[ "# -*- coding: utf-8 -*-\n# Author: Your Name <your@email.com>\n\nimport os\nimport argparse\nimport tensorflow as tf\n\nfrom tensorpack import *\n\n\"\"\"\nThis is a boiler-plate template.\nAll code is in this file is the most minimalistic way to solve a deep-learning problem with cross-validation.\n\"\"\"\n\nBATC...
[ [ "tensorflow.placeholder", "tensorflow.get_variable", "tensorflow.identity", "tensorflow.train.AdamOptimizer" ] ]
mobius-scheduler/evaluation
[ "2f24eb564130d4108d5f5f358a9948c3909f5ceb" ]
[ "parse.py" ]
[ "import json\nimport sys\nimport pandas as pd\nimport glob\n\nCOLS = ['env', 'alpha', 'time', 'round', 'app_id', 'tasks_requested', 'tasks_fulfilled']\n\ndef parse_im(y, req_prev, ids):\n # open file\n with open(y) as f:\n im = json.load(f)\n\n req = {id: 0 for id in ids}\n for t in im:\n ...
[ [ "pandas.DataFrame", "pandas.read_csv", "pandas.concat" ] ]
skyler-nch/DJI-Tello-Project
[ "9255cef7e9849574d9ac6f04aff446f2640628c4" ]
[ "FaceRecognition and Tracking.py" ]
[ "from djitellopy.tello import Tello\nimport cv2\nimport pygame\nimport numpy as np\nimport time\nimport imutils\n\n# Speed of the drone\nS = 60\n# Frames per second of the pygame window display\nFPS = 30\n\n\nclass FrontEnd(object):\n \"\"\" Maintains the Tello display and moves it through the keyboard keys.\n ...
[ [ "numpy.rot90", "numpy.flipud" ] ]
twanvl/rwa-da
[ "7707daf51f8baccf460907638a8012ed60ac0ffd" ]
[ "src/deep_features/network.py" ]
[ "# The used network architecture\n# Based on\n# https://github.com/Lasagne/Recipes/blob/master/examples/ImageNet%20Pretrained%20Network%20%28VGG_S%29.ipynb\n\nimport numpy as np\nimport lasagne\nimport theano\nimport theano.tensor as T\nfrom lasagne.layers import InputLayer, DenseLayer, DropoutLayer\nfrom lasagne....
[ [ "numpy.concatenate", "numpy.array", "numpy.pad", "numpy.copy", "numpy.load", "numpy.random.shuffle", "matplotlib.pyplot.figure", "numpy.shape", "numpy.random.random_sample", "numpy.float32", "numpy.swapaxes", "numpy.random.randint", "numpy.empty_like", "nump...
UoB-HPC/everythingsreduced
[ "72e69dafdf0d155c35df38bfda7786d9f88c641a" ]
[ "results/reorganize.py" ]
[ "import pandas as pd\nimport glob\nimport csv\n\nfiles = [\n \"a100-results.csv\",\n \"clx-1S-results.csv\",\n \"clx-results.csv\",\n \"gen9-results.csv\",\n \"mi100-results.csv\",\n# \"rome-results-aocc.csv\",\n \"rome-results-cce.csv\"]\n\ncsv_frames = []\nfor f in files:\n csv_frames.appe...
[ [ "pandas.read_csv", "pandas.Series", "pandas.concat" ] ]
zahra8500/yolov3object_detection-Transfer_Learning-
[ "173d4f0d285199b5c354a7e3e777f95c2df2caa1" ]
[ "train_bottleneck.py" ]
[ "\"\"\"\nRetrain the YOLO model for your own dataset.\n\"\"\"\nimport os\nimport numpy as np\nimport keras.backend as K\nfrom keras.layers import Input, Lambda\nfrom keras.models import Model\nfrom keras.optimizers import Adam\nfrom keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, EarlyStoppi...
[ [ "numpy.array", "numpy.zeros", "numpy.random.seed", "numpy.load", "numpy.random.shuffle", "numpy.savez" ] ]
lauratomaz/nilearn
[ "7e413a51676fea8bdcbab12e20482da6c417567c" ]
[ "nilearn/image/tests/test_resampling.py" ]
[ "\"\"\"\nTest the resampling code.\n\"\"\"\nimport os\nimport copy\nimport math\n\nfrom nose import SkipTest\nfrom nose.tools import assert_equal, assert_raises, \\\n assert_false, assert_true, assert_almost_equal, assert_not_equal\nfrom numpy.testing import assert_array_equal, assert_array_almost_equal\n\nimpor...
[ [ "numpy.concatenate", "numpy.max", "numpy.array", "numpy.dot", "numpy.logical_not", "numpy.zeros", "numpy.random.RandomState", "numpy.testing.assert_array_equal", "numpy.ones", "numpy.eye", "numpy.testing.assert_array_almost_equal", "numpy.prod", "numpy.random.ra...
dl-framework-benchmark/Paddle
[ "73daa3d6c0001855aea95cdd552b6398de50c349", "73daa3d6c0001855aea95cdd552b6398de50c349" ]
[ "python/paddle/fluid/optimizer.py", "python/paddle/fluid/dygraph/nn.py" ]
[ "# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re...
[ [ "numpy.array" ], [ "numpy.array", "numpy.prod" ] ]
scicubator/countGauss
[ "7e744c3de1de342d72ef10da76c0c3b4605d70d4" ]
[ "csnmf/tests/test_snmf.py" ]
[ "from __future__ import absolute_import, print_function\nimport numpy as np\nimport dask.array as da\nimport timeit\nimport itertools\nimport matplotlib.pyplot as plt\nimport pickle\nimport csnmf.snmf\n\n\ndef run(m, n, q, ncols, blockshape):\n \"\"\"\n Create a low-rank matrix. We then compute its separable ...
[ [ "matplotlib.pyplot.switch_backend", "numpy.random.standard_normal", "numpy.zeros", "matplotlib.pyplot.savefig", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.pyplot.axes" ] ]
zizai/pytorch-transformers
[ "d7a4c3252ed5e630b7fb6e4b4616daddfe574fc5" ]
[ "pytorch_transformers/modeling_xlm.py" ]
[ "# coding=utf-8\n# Copyright 2019-present, Facebook, Inc and the HuggingFace Inc. 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/LICE...
[ [ "torch.nn.Linear", "numpy.sin", "torch.nn.LayerNorm", "torch.nn.AdaptiveLogSoftmaxWithLoss", "torch.nn.MSELoss", "torch.arange", "torch.nn.ModuleList", "torch.cat", "torch.nn.init.constant_", "torch.nn.functional.dropout", "torch.nn.CrossEntropyLoss", "torch.ones", ...
imkeines/envirocar-py
[ "257e640c910cad710aac2648cad529d69a11944a" ]
[ "envirocar/EDA/inspection.py" ]
[ "import pandas as pd\nimport seaborn as sns\nimport numpy as np \nimport matplotlib.pyplot as plt\nimport plotly.express as px\nimport geopandas as gpd\nfrom scipy import stats\n\n# class Inspection():\n# def __init__(self):\n# print(\"Initializing class 'Inspection'\") \n\n\ndef skewness_num_variables...
[ [ "pandas.to_datetime", "pandas.DataFrame", "matplotlib.pyplot.title", "numpy.ones", "matplotlib.pyplot.figure", "scipy.stats.probplot", "matplotlib.pyplot.show" ] ]
Leterax/Visualization
[ "4f3ad3f1ebc920b1f315ae9ff0d5c44d7a7ec514" ]
[ "visualization/TextArt/text_art.py" ]
[ "from pathlib import Path\n\nimport moderngl\nimport moderngl_window as mglw\nimport numpy as np\n\n# noinspection PyUnresolvedReferences\nfrom generate_text import render_text_perimeter_balls\nfrom pyrr import matrix44\n\n\nclass TextArt(mglw.WindowConfig):\n \"\"\"\n Render text assembling from balls.\n ...
[ [ "numpy.array", "numpy.random.random_sample" ] ]
TiantianWang/VideoMatting-CRGNN
[ "25220077d1a7ca8ad7beed000fccc0559b4ea141" ]
[ "models/hlmobilenetv2.py" ]
[ "\"\"\"\nThis implementation is modified from the following repository:\nhttps://github.com/poppinace/indexnet_matting\n\n\"\"\"\n\nimport os\nimport sys\nimport math\nfrom time import time\nfrom functools import partial\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom hlaspp import A...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.functional.avg_pool2d", "torch.cuda.synchronize", "numpy.zeros", "torch.nn.MaxPool2d", "torch.nn.Sigmoid", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.FloatTensor", "numpy.mean", "torch.nn.ReLU6", "torch.nn.Con...
alphagov-mirror/govuk-entity-personalisation
[ "a674bca4c15691fe2c4e32ea213dfccf3cb0e8ec" ]
[ "notebooks/entities-synonyms/02_cbow_embeddings.py" ]
[ "from gensim.models import Word2Vec\nimport json\nimport pandas as pd\n\n\n# load model and entities\nmodel_w2v = Word2Vec.load('model/word2vec_cbow.model')\n# generated from data/interim/kg_entities.cypher\ndf_entities = pd.read_csv(filepath_or_buffer='data/interim/kg_entities.csv')\n\n# transform each entity so s...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
AtsushiHAM/EEI_Analysis_model_based_rl
[ "800fa57a0ef5609e487c7844a2b21b31a937ece4" ]
[ "pddm/envs/vreacher/vreacher_sincosless_ngr.py" ]
[ "import numpy as np\nfrom gym import utils\nfrom gym.envs.mujoco import mujoco_env\nimport tensorflow as tf\nimport os\nimport numpy as np\n\n#GYM_ASSET_PATH2=os.path.join(os.getcwd(),'assets')\n#GYM_ASSET_PATH=os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', 'assets'))\nGYM_ASSET_PATH = os.path.join...
[ [ "numpy.concatenate", "numpy.square", "numpy.array", "numpy.sin", "numpy.asarray", "numpy.zeros", "numpy.sqrt", "numpy.cos", "numpy.abs", "numpy.expand_dims" ] ]
MarcoMernberger/mpathways
[ "6041b300f6d512b81ff590019f519c795fdb761a" ]
[ "src/mpathways/util.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"util.py: Contains some utility functions.\"\"\"\n\nfrom pathlib import Path\nfrom typing import Optional, Callable, List, Dict, Tuple, Any, Union\nfrom pypipegraph import Job, FileGeneratingJob\nfrom mbf_genomics.genes import Genes\nfrom pandas import DataFra...
[ [ "numpy.asfarray", "pandas.isnull", "numpy.minimum.accumulate", "pandas.DataFrame", "scipy.stats.hypergeom" ] ]
isaacmg/bokeh
[ "1025d1177b8e636c36f6160da4bd2fbf8ca51962" ]
[ "bokeh/core/property/wrappers.py" ]
[ "#-----------------------------------------------------------------------------\n# Copyright (c) 2012 - 2018, Anaconda, Inc. All rights reserved.\n#\n# Powered by the Bokeh Development Team.\n#\n# The full license is in the file LICENSE.txt, distributed with this software.\n#----------------------------------------...
[ [ "numpy.array", "numpy.append" ] ]
masihsultani/infotheory-research
[ "11167cbaaa79d49f094f938ed0918aa53752b441" ]
[ "tools/ngram_entropy.py" ]
[ "import csv\nimport sys\nfrom ast import literal_eval\nfrom collections import defaultdict\nimport numpy as np\nimport pandas as pd\n\nfrom tools.helper import get_context, file_locations, get_gram_count, gram_conv\n\n\ndef compute_entropy(corpus, gram, stop_words=None):\n \"\"\"\n\n :param gram:\n :param ...
[ [ "pandas.read_csv", "numpy.log2" ] ]
Y-Sree-Chaitanya/zeugma
[ "f0fda428889d6ceb2ae22eda721473611d7020d2" ]
[ "tests/test_keras_transformers.py" ]
[ "import pytest\nfrom sklearn.pipeline import make_pipeline\nfrom zeugma.keras_transformers import Padder, TextsToSequences\n\n\n@pytest.fixture(scope=\"function\")\ndef sequencer():\n \"\"\" Instantiate trainable word2vec vectorizer \"\"\"\n return TextsToSequences(num_words=5)\n\n\ndef test_sequencer(sample_...
[ [ "sklearn.pipeline.make_pipeline" ] ]
Jebrankhan/datasets
[ "920faf40c0766cb71d2dbba71554181881cc3e7b" ]
[ "tests/test_arrow_dataset.py" ]
[ "import copy\nimport itertools\nimport json\nimport os\nimport pickle\nimport re\nimport tempfile\nfrom functools import partial\nfrom pathlib import Path\nfrom unittest import TestCase\nfrom unittest.mock import patch\n\nimport numpy as np\nimport pandas as pd\nimport pyarrow as pa\nimport pytest\nfrom absl.testin...
[ [ "numpy.array", "tensorflow.convert_to_tensor", "tensorflow.data.TFRecordDataset", "pandas.DataFrame.from_dict", "tensorflow.io.FixedLenFeature", "numpy.ones", "tensorflow.constant", "pandas.read_json", "tensorflow.io.parse_single_example", "torch.tensor", "numpy.issubdt...
chetakks/ddsp
[ "72923ec557e208a6e4374b7b5dfb6d871130807e" ]
[ "ddsp/losses_test.py" ]
[ "# Copyright 2020 The DDSP Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or a...
[ [ "numpy.isfinite", "tensorflow.compat.v2.random.uniform", "tensorflow.compat.v2.test.main" ] ]
Slow-Rain/NPTEL-The-Joy-of-Computing-using-Python
[ "e4bd830ef7a3f171a14a88f94df626c766a7649b" ]
[ "Week12/Week 12 programming assignment 1.py" ]
[ "import numpy as np # importing numpy module\r\n\r\n# taking endpoints from the user as point_1, point_2 & point_3\r\n\r\npoint_1 = list(map(float,input().split())) \r\npoint_2 = list(map(float,input().split()))\r\npoint_3 = list(map(float,input().split()))\r\n\r\narr = np.array([point_1,point_2,point_3]) \r\...
[ [ "numpy.array", "numpy.linalg.det" ] ]
RosenblumLabUser/Qcodes
[ "042c5e25ab9e40b20c316b4055c4842844834d1e" ]
[ "qcodes/instrument_drivers/rohde_schwarz/RTO1000.py" ]
[ "# All manual references are to R&S RTO Digital Oscilloscope User Manual\n# for firmware 3.65, 2017\n\nimport logging\nimport warnings\nimport time\nfrom typing import Optional, Any\n\nimport numpy as np\nfrom distutils.version import LooseVersion\n\nfrom qcodes import Instrument\nfrom qcodes.instrument.visa import...
[ [ "numpy.linspace", "numpy.fromstring" ] ]
maierbn/streaming_software
[ "2cfe5da8e28b45751147c62906e8ef85ccf91fca" ]
[ "mouse/mouse_control.py" ]
[ "# module to interface the 3D SpaceMouse\n\nimport time\nimport spacemouse\nimport numpy as np\nimport pickle\n\ndef increase_sensitivity(a):\n if a < 0:\n return -a*a\n return a*a\n\ndef loop(camera):\n \"\"\"\n Main loop to handle mouse input and apply it to the camera.\n :param camera: the camera object ...
[ [ "numpy.array" ] ]
karanvijaygit/DMLM
[ "aaeb3e65d0a58ad583289aaa39b089f11d06a4eb" ]
[ "packages/regression_model/regression_model/processing/data_management.py" ]
[ "import pandas as pd\nimport joblib\nfrom sklearn.pipeline import Pipeline\n\nfrom regression_model.config import config\nfrom regression_model import __version__ as _version\n\nimport logging\nimport typing as t\n\n\n_logger = logging.getLogger(__name__)\n\n\ndef load_dataset(*, file_name: str) -> pd.DataFrame:\n ...
[ [ "pandas.read_csv" ] ]
ashok-arjun/prototypical-network-pytorch
[ "afe38c109194a850beffd0e893f0292c59baedb3" ]
[ "samplers.py" ]
[ "import torch\nimport numpy as np\n\n\nclass CategoriesSampler():\n \"\"\"\n CategoriesSampler\n \n Samples data points for the current batch. This is present to sample N-way (N-classes) and k shot + q query samples in every batch.\n This is called in every iteration of a single epoch. Hence its leng...
[ [ "numpy.array", "torch.stack", "numpy.argwhere", "torch.from_numpy" ] ]
GuanlinLee/SCNet
[ "f4c13f9afc113fa535566528fba776ee785a31d2", "f4c13f9afc113fa535566528fba776ee785a31d2" ]
[ "ASCAD/ASCAD_test_models_v1.py", "ASCAD/ASCAD_test_models_v2.py" ]
[ "import os.path\nimport sys\nimport h5py\nimport numpy as np\nimport matplotlib\nmatplotlib.use('agg')\nimport matplotlib.pyplot as plt\nfrom keras.models import load_model\nimport os\n\n\n\n\nos.environ['CUDA_VISIBLE_DEVICES'] = '0'\n\nAES_Sbox = np.array([\n 0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0x...
[ [ "matplotlib.use", "numpy.array", "numpy.zeros", "numpy.log", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "numpy.where", "numpy.arange", "matplotlib.pyplot.ylabel" ], [ "matplotlib.use", "numpy.a...
mostafajubayerkhan/Image-Captioning
[ "7545fe89448b597400a0c8dccea533d2795631e2" ]
[ "model.py" ]
[ "import torch\nimport torch.nn as nn\nimport torchvision.models as models\n\n'''\nEncoderCNN class provided by Udacity (utilizing Resnet)\nwas used as is by me, while attempting this project.\n'''\nclass EncoderCNN(nn.Module):\n def __init__(self, embed_size):\n super(EncoderCNN, self).__init__()\n ...
[ [ "torch.nn.Linear", "torch.nn.LSTM", "torch.max", "torch.nn.Sequential", "torch.nn.Embedding" ] ]