repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
Zerwer/Chemistry
[ "7f8f9618553bbad458b193e030e6c18e981c7d66" ]
[ "graphs/acid_similarity.py" ]
[ "# Graph to visualize predicted versus actual acid pKa for similarity model\n# Splits the same way as the model training\nimport matplotlib.pyplot as plt\nfrom rdkit import Chem\nfrom rdkit.Chem import rdMolDescriptors\nfrom chemical_models import AcidSimilarity\nfrom sklearn.model_selection import train_test_split...
[ [ "matplotlib.pyplot.show", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.scatter" ] ]
dineshkumar4u/monitor-ml-models-efficiently-across-fleets-of-devices-aim325
[ "ad330f3d1c37081284ffa979f4fb99630903688a" ]
[ "lab/app/simulator.py" ]
[ "# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n# SPDX-License-Identifier: MIT-0\nimport time\nimport pandas as pd\nimport subprocess\nimport ipywidgets as widgets\nimport logging\nimport numpy as np\nimport os\nimport signal\nfrom turbine import WindTurbine\n\nclass WindTurbineFarmSimulator(...
[ [ "numpy.random.rand", "numpy.array", "numpy.mean", "pandas.read_csv" ] ]
abiswas3/NAS
[ "e6da66f84e305e603d21df331f90b354b0b353bc" ]
[ "reinforce.py" ]
[ "import tensorflow as tf\nimport random\nimport numpy as np\n\nclass Reinforce():\n def __init__(self,\n sess,\n optimizer,\n policy_network,\n max_layers,\n global_step,\n division_rate= 100.0,\n reg_...
[ [ "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.scalar_mul", "tensorflow.reduce_mean", "tensorflow.get_collection", "tensorflow.identity", "tensorflow.variables_initializer", "tensorflow.placeholder", "tensorflow.name_scope", "tensorflow.square", "tensorflow....
bristy1588/EvadeML-Zoo
[ "7d4acf19cc9e8a213f7541448b8638096d507ad8" ]
[ "datasets/imagenet.py" ]
[ "import sys, os\nsys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))\n\nimport numpy as np\nimport os\n# from multiprocessing import Pool\nfrom keras.preprocessing import image\n\nfrom models.keras_models import keras_resnet50_imagenet_model\nfrom models.keras_models import keras_vgg19_imag...
[ [ "numpy.concatenate", "numpy.eye", "numpy.expand_dims" ] ]
igor-93/ml_utils
[ "898dbeec1ebd54443a83d95eadfb37fb1db2943c" ]
[ "common/sparse_mat.py" ]
[ "import numpy as np\nfrom scipy.sparse import isspmatrix_coo, coo_matrix\n\n\ndef drop_data(mat, threshold):\n \"\"\"Removes common from the matrix that is smaller then threshold.\n\n Parameters\n ----------\n mat : coo_matrix\n matrix\n threshold : float\n value below which we want to...
[ [ "scipy.sparse.coo_matrix", "scipy.sparse.isspmatrix_coo", "numpy.unique", "numpy.in1d", "numpy.max" ] ]
mrgloom/pystruct
[ "08277d5a102e813958c9d76dd3fcc413ddb4889f" ]
[ "pystruct/learners/frankwolfe_ssvm.py" ]
[ "######################\n# Authors:\n# Xianghang Liu <xianghangliu@gmail.com>\n# Andreas Mueller <amueller@ais.uni-bonn.de>\n#\n# License: BSD 3-clause\n#\n# Implements structured SVM as described in Joachims et. al.\n# Cutting-Plane Training of Structural SVMs\n\nimport warnings\nfrom time import time\nimport ...
[ [ "numpy.sum", "numpy.arange", "numpy.zeros", "sklearn.utils.check_random_state" ] ]
iiduka-researches/201811-kaz
[ "52d7b101dec1ce404296d69e1af36bce54e2a91d" ]
[ "tests/test_projections.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nimport numpy as np\nfrom unittest import TestCase\nfrom qcopt.projections import *\n\n\nclass TestBox(TestCase):\n def test_behavior(self):\n p = box(np.array([-1., -2.]), np.array([3., 4.]))\n np.testing.assert_equal(\n p(np.array([0., 0...
[ [ "numpy.full", "numpy.ones", "numpy.fmax", "numpy.array", "numpy.zeros" ] ]
naisuu/Rxitect
[ "d39d3f00a537f49e6fa5a43570f93a50618064af" ]
[ "src/rxitect/data/chembl_corpus.py" ]
[ "from pathlib import Path\nfrom typing import Optional\n\nimport pandas as pd\nimport pytorch_lightning as pl\nfrom pytorch_lightning.utilities.types import (EVAL_DATALOADERS,\n TRAIN_DATALOADERS)\nfrom torch.utils.data.dataloader import DataLoader\nfrom globals import ...
[ [ "torch.utils.data.dataloader.DataLoader", "pandas.read_csv" ] ]
BerkeleyAutomation/rlqp_benchmarks
[ "5c79e870c4bd697383f66f5dff26aea29dc1ebfa" ]
[ "solvers/mosek.py" ]
[ "import mosek\nimport numpy as np\nimport scipy.sparse as spa\nfrom . import statuses as s\nfrom .results import Results\nfrom utils.general import is_qp_solution_optimal\n\n\nclass MOSEKSolver(object):\n\n # Map of Mosek status to mathprogbasepy status.\n STATUS_MAP = {mosek.solsta.optimal: s.OPTIMAL,\n ...
[ [ "numpy.abs", "scipy.sparse.tril", "scipy.sparse.find" ] ]
iariav/EDSR-PyTorch
[ "c709b3d43adb6c2457cf87c37c1f34a7bcfc48bb" ]
[ "src/data/dsm.py" ]
[ "import os\nfrom data import srdata\nimport numpy as np\n\nclass dsm(srdata.SRData):\n def __init__(self, args, name='depth', train=True, benchmark=False):\n\n if train:\n train_file = os.path.join(args.dir_data, args.data_train[0], 'train.txt')\n self.data_indices = np.loadtxt(train...
[ [ "numpy.loadtxt" ] ]
adrn/BarChaos
[ "1f6619763efb7d4425df8633e6425b18232efbb0" ]
[ "scripts/test_mpi.py" ]
[ "from os import path\nimport sys\n\n# Third-party\nimport astropy.units as u\nimport gala.dynamics as gd\nimport numpy as np\nimport h5py\nimport schwimmbad\n\n# Package\nfrom barchaos.experiments.freqmap import FreqMap\nfrom barchaos.log import logger\n\nlogger.setLevel(1)\n\ndef cache_file():\n fn = path.join(...
[ [ "numpy.random.random" ] ]
zy-han/Data-X
[ "1f2fd241d7af8cf926ccefc7308e5b7941739b21" ]
[ "API/Request_Uniswap_try.py" ]
[ "import requests\r\nimport json\r\nimport numpy as np\r\nimport pandas as pd\r\nimport matplotlib.pyplot as plt\r\n\r\ndef auto_query_uniswap(token_id_0, token_id_1, time_left, time_right, skip=5, first=100):\r\n pair_prefix = \"\"\"{\r\n pairs(where: {token0: \"\"\"\r\n pair_midfix = \"\"\", token1: \...
[ [ "pandas.DataFrame" ] ]
Duton/yolov4-tf2
[ "cdd49b5e0bd69a609c28071555da7ff5191d8781" ]
[ "utils/dataloader.py" ]
[ "import math\r\nfrom random import sample, shuffle\r\n\r\nimport cv2\r\nimport numpy as np\r\nfrom PIL import Image\r\nfrom tensorflow import keras\r\n\r\nfrom utils.utils import cvtColor, preprocess_input\r\n\r\nclass YoloDatasets(keras.utils.Sequence):\r\n def __init__(self, annotation_lines, input_shape, anch...
[ [ "numpy.expand_dims", "numpy.maximum", "numpy.minimum", "numpy.logical_and", "numpy.clip", "numpy.arange", "numpy.random.shuffle", "numpy.argmax", "numpy.random.rand", "numpy.floor", "numpy.random.uniform", "numpy.array", "numpy.zeros" ] ]
DAkinyemi/Vortex_in_Cell_Method
[ "311bf4875d8983fb369345f5bcc13039680c83f1" ]
[ "Python_Code/Vortex_in_Cell.py" ]
[ "#Importing required libraries\nimport math\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib.pyplot import figure\nimport random\nimport copy\nnp.set_printoptions(suppress=True)\n# import sys\n# sys.path.insert(0, \"./../../vortexincell/src/wrappedCode/\")\nimport ConvSolver\nimport importlib\n...
[ [ "numpy.sqrt", "matplotlib.pyplot.scatter", "matplotlib.pyplot.title", "numpy.asarray", "numpy.linspace", "numpy.set_printoptions", "numpy.random.random_sample", "numpy.concatenate", "matplotlib.pyplot.ylabel", "numpy.any", "matplotlib.pyplot.xlabel", "numpy.array", ...
muhlbach/econometric_causality
[ "372e05bec8d229f0180c859a6fb5d3d63e7bf91a" ]
[ "econometric_causality/selection_on_observables/matching.py" ]
[ "#------------------------------------------------------------------------------\n# Libraries\n#------------------------------------------------------------------------------\n# Standard\nimport pandas as pd\nfrom sklearn.neighbors import NearestNeighbors\nfrom sklearn.linear_model import LogisticRegression\n\n# Us...
[ [ "sklearn.neighbors.NearestNeighbors", "pandas.Series", "sklearn.linear_model.LogisticRegression" ] ]
tegg89/categorical_dqn
[ "647c24ee4734450551fc446d3225f57dadd82d48" ]
[ "model.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass CategoricalDQN(nn.Module):\n\tdef __init__(self, num_inputs, num_actions, args):\n\t\tsuper(CategoricalDQN, self).__init__()\n\t\tself.num_inputs = num_inputs\n\t\tself.num_actions = num_actions\n\t\tself.num_atoms = args.atom\n\t\tself....
[ [ "torch.nn.Linear", "torch.linspace", "torch.no_grad", "torch.tensor" ] ]
stephwag/coco-tools
[ "7b6030830c6f1dc0ce254c0e725cdc3847c255b1" ]
[ "annotate.py" ]
[ "import sys\nfrom PIL import Image\nimport numpy as np\nimport json\nimport cv2\nimport imutils\nfrom config import *\n\ndef annotation_obj(image_name, image_id, min_threshold=10, max_threshold=255, category_id=1, show_annotation=False, is_crowd=False):\n image = cv2.imread(\"{}/{}\".format(ANNOTATION_DIR, image...
[ [ "numpy.array" ] ]
taodav/novelty-search-repr-space
[ "461691104dc3a72b9b4f7ec040b71d95eec434b1" ]
[ "nsrl/helper/plot.py" ]
[ "import os\nimport json\nimport shutil\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport visdom\n\nfrom plotly import tools\nimport plotly.graph_objs as go\n\n\nclass Plotter(object):\n def __init__(self, experiment_dir, env_name=\"default\", host=None, port=8097, offline=False):\n if not hos...
[ [ "matplotlib.pyplot.tight_layout", "numpy.expand_dims", "numpy.arange", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "numpy.std", "matplotlib.pyplot.clf", "matplotlib.pyplot.close", "numpy.array", "numpy.average" ] ]
ferozkhanabbasi/human_pose
[ "5bf8bd33eec2b53aa173a6d34644c9df183759b7" ]
[ "tf_pose/slim/nets/inception_v3.py" ]
[ "# Copyright 2016 The TensorFlow 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\n#\r\n#...
[ [ "tensorflow.concat", "tensorflow.reduce_mean", "tensorflow.squeeze", "tensorflow.truncated_normal_initializer", "tensorflow.variable_scope" ] ]
eight0153/flownet2-pytorch
[ "cc2964233cd18c8db05d1751281c6ab9d3165da6" ]
[ "Video3D/inference.py" ]
[ "import argparse\nimport os\nfrom typing import Optional\n\nimport numpy as np\nimport plac\nimport torch\nfrom numpy.lib.format import open_memmap\nfrom torch.nn import functional as F\nfrom torch.utils.data import DataLoader\n\nfrom MiDaS.models.midas_net import MidasNet\nfrom Video3D.dataset import NumpyDataset,...
[ [ "torch.load", "numpy.lib.format.open_memmap", "torch.utils.data.DataLoader", "torch.no_grad", "torch.nn.functional.interpolate" ] ]
weiyuanlou/PyCSR3D
[ "67bf2fa296398209f38c28b639e6096de43ad154" ]
[ "csr3d/convolution.py" ]
[ "import numpy as np\nimport scipy.fft as sp_fft\n\n\ndef fftconvolve3(rho, *greens):\n \"\"\"\n Efficiently perform a 3D convolution of a charge density rho and multiple Green functions. \n \n Parameters\n ----------\n \n rho : np.array (3D)\n Charge mesh\n \n *greens : np.arra...
[ [ "scipy.fft.ifftn", "numpy.real", "numpy.zeros", "scipy.fft.fftn" ] ]
ningpang/com-CNN
[ "a494589a9445c9b3ad63175ec6b2084d4d3e3e81" ]
[ "CL/networks/selector.py" ]
[ "import torch\nimport torch.autograd as autograd\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torch.autograd import Variable\n\nclass Selector(nn.Module):\n\tdef __init__(self, config, s_relation_dim, p_relation_dim):\n\t\tsuper(Selector, self).__init__()\n\t\tself.conf...
[ [ "torch.mean", "torch.nn.Dropout", "torch.nn.functional.softmax", "torch.transpose", "torch.max", "torch.Tensor", "torch.cat", "torch.sum", "torch.nn.Embedding", "torch.matmul", "torch.stack", "torch.nn.init.xavier_uniform", "torch.nn.init.normal" ] ]
JerryX1110/NL-Augmenter
[ "f0dd6b2369c19146fe396f5b122d016f3b619eb3" ]
[ "transformations/suspecting_paraphraser/transformation.py" ]
[ "from typing import List, Tuple\n\nimport nltk\nimport numpy as np\n\n# Spacy needs this module, but it's used only implicitly\nimport pyinflect # noqa: F401\nimport spacy\nfrom gender_extractor import GenderExtractor\n\nfrom initialize import spacy_nlp\nfrom interfaces.QuestionAnswerOperation import QuestionAnswe...
[ [ "numpy.random.seed" ] ]
limkhashing/SpotPark-Backend
[ "e982e6ee43f4763c42877788565ce2412ac9abce" ]
[ "utility.py" ]
[ "import cv2\nimport os\nimport numpy as np\nimport io\nimport time\nfrom google.cloud import vision\n\n# MySql / PhpMyAdmin Connection Variable\nhost = u'sql132.main-hosting.eu'\nuser = u'u824500046_fyp'\npw = u'7pmfyvTNvyeU'\ndb = u'u824500046_fyp'\n\n# Initialize Cloud Vision API and Firebase Admin SDK\nos.enviro...
[ [ "numpy.median" ] ]
feynmanliang/pyro
[ "ef62e718a101c58e8ed920d06445eeb0d35ff895" ]
[ "tests/ops/gamma_gaussian.py" ]
[ "import torch\n\nimport pyro.distributions as dist\nfrom pyro.ops.gamma_gaussian import GammaGaussian\nfrom tests.common import assert_close\n\n\ndef random_gamma_gaussian(batch_shape, dim, rank=None):\n \"\"\"\n Generate a random Gaussian for testing.\n \"\"\"\n if rank is None:\n rank = dim + d...
[ [ "torch.randn" ] ]
ehrenb/Mercator
[ "f87c6aa38d304a62d86a9e4b3a7d96d1f7aba156" ]
[ "Mercator/utils/nx_scripts/path.py" ]
[ "import json\nfrom pprint import pprint\n\nimport networkx as nx\nfrom networkx.readwrite import json_graph\n\nimport matplotlib.pyplot as plt\n\n\ngraph = None\nwith open('02e231f85558f37da6802142440736f6/02e231f85558f37da6802142440736f6_component_graph.json') as f:\n graph = json.load(f)\nnx_graph = json_graph...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.axis" ] ]
Combatd/probability_analysis_package
[ "3f39afe52d8a46556fedfc4d269db36c8e5ab73f" ]
[ "Gaussian_Code_Exercise/gaussian.py" ]
[ "import math\nimport matplotlib.pyplot as plt\n\nclass Gaussian():\n \"\"\" Gaussian distribution class for calculating and \n visualizing a Gaussian distribution.\n \n Attributes:\n mean (float) representing the mean value of the distribution\n stdev (float) representing the standard devi...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.subplots", "matplotlib.pyplot.set_ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.hist" ] ]
tradewartracker/phase-one-product-hs2
[ "38dd328a8211695c31f09a34832535dc2c82a5c2" ]
[ "main-hs2.py" ]
[ "import datetime as dt\nfrom os.path import dirname, join\n\nimport numpy as np\n\nimport pandas as pd\n\nimport pyarrow as pa\nimport pyarrow.parquet as pq\n\nfrom bokeh.io import curdoc\nfrom bokeh.layouts import column, gridplot, row\nfrom bokeh.models import ColumnDataSource, DataRange1d, Select, HoverTool, Pan...
[ [ "numpy.array", "pandas.DataFrame", "pandas.date_range" ] ]
cramsay/PYNQ
[ "7e190122aea5a19b910cc2501a8f7eef58fa4cbc" ]
[ "pynq/ps.py" ]
[ "# Copyright (c) 2016, Xilinx, Inc.\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright notice,\n# this...
[ [ "numpy.arange" ] ]
tejaskannan/adaptive-sensor-security
[ "4c6dd1eb55eb30a8330c4bf3537e06c7d7802c0b" ]
[ "adaptiveleak/analysis/mutual_information.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom argparse import ArgumentParser\nfrom collections import Counter, defaultdict, OrderedDict, namedtuple\nfrom typing import Dict, List, DefaultDict, Optional, Tuple\n\nfrom adaptiveleak.analysis.plot_utils import COLORS, PLOT_STYLE, LINE_WIDTH, MARKER, MARKER...
[ [ "numpy.median", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "matplotlib.pyplot.style.context", "numpy.max", "matplotlib.pyplot.show" ] ]
Mayoogh/tensorflow
[ "d20954874dab39dc67fd2222003b9ab5ea4840d5" ]
[ "tensorflow/python/data/kernel_tests/map_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.python.data.ops.dataset_ops.Dataset.from_tensors", "tensorflow.python.data.ops.dataset_ops.MapDataset", "tensorflow.python.ops.variables.Variable", "tensorflow.python.data.ops.dataset_ops.Dataset.range", "tensorflow.python.framework.ops.device", "tensorflow.python.eager.context...
jpmorgan98/MCDC-TNT-2
[ "c437596097caa9af56df95213e7f64db38aac40e" ]
[ "mcdc_tnt/numba_kernels/gpu/advance.py" ]
[ "\"\"\"\nName: Advance\nbreif: inputdeck for MCDC-TNT\nAuthor: Jackson Morgan (OR State Univ - morgjack@oregonstate.edu) CEMeNT\nDate: Dec 2nd 2021\n\"\"\"\n\nimport math\nimport numpy as np\nimport numba as nb\nfrom numba import cuda\n\n#@cuda.jit(nopython=True)\ndef Advance(p_pos_x, p_pos_y, p_pos_z, p_mesh_cell,...
[ [ "numpy.ones", "numpy.random.rand", "numpy.array", "numpy.zeros", "numpy.sum" ] ]
Atomix85/Naball-Evolution-Invasion
[ "2ec2bc9d7a17696ae442e9eca84603a6ba21a1d1" ]
[ "2.77/python/lib/site-packages/numpy/core/setup.py" ]
[ "from __future__ import division, print_function\n\nimport imp\nimport os\nimport sys\nimport shutil\nimport pickle\nimport copy\nimport warnings\nimport re\nfrom os.path import join\nfrom numpy.distutils import log\nfrom distutils.dep_util import newer\nfrom distutils.sysconfig import get_config_var\n\nfrom setup_...
[ [ "numpy.distutils.system_info.get_info", "numpy.distutils.misc_util.Configuration", "numpy.distutils.core.setup", "numpy.distutils.misc_util.get_cmd", "numpy.distutils.misc_util.get_build_architecture", "numpy.distutils.log.info", "numpy.distutils.misc_util.dot_join" ] ]
cirrostratus1/bark
[ "6629a9bbc455d0fd708e09bb8e162425e62c4165" ]
[ "modules/runtime/viewer/viewer.py" ]
[ "# Copyright (c) 2019 fortiss GmbH\n#\n# This software is released under the MIT License.\n# https://opensource.org/licenses/MIT\n\nimport numpy as np\nfrom bark.viewer import Viewer\nfrom bark.geometry import *\nfrom bark.models.dynamic import *\nfrom bark.world.opendrive import *\nfrom bark.world.goal_definition ...
[ [ "numpy.array", "numpy.zeros" ] ]
ChaceAshcraft/ray
[ "a72237f1712e2805f6799de3489e326e2965d624" ]
[ "python/ray/tests/test_reconstruction.py" ]
[ "import os\nimport signal\nimport sys\n\nimport numpy as np\nimport pytest\n\nimport ray\nfrom ray.test_utils import (\n wait_for_condition,\n wait_for_pid_to_exit,\n)\n\nSIGKILL = signal.SIGKILL if sys.platform != \"win32\" else signal.SIGTERM\n\n\ndef test_cached_object(ray_start_cluster):\n config = {\n...
[ [ "numpy.zeros" ] ]
aaronkl/emukit
[ "ccd80811a1b8e11ece97dceb2f8c7b92a7a4f236" ]
[ "emukit/bayesian_optimization/acquisitions/expected_improvement.py" ]
[ "# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n# SPDX-License-Identifier: Apache-2.0\n\n\nfrom typing import Tuple, Union\n\nfrom GPyOpt.util.general import get_quantiles\nimport numpy as np\n\nfrom ...core.interfaces import IModel, IDifferentiable, IPriorHyperparameters\nfrom ...core.a...
[ [ "numpy.sqrt", "numpy.min" ] ]
timbook/modelmonitor
[ "876fdc8fb2b48e8e0942f9e7809193c62f0aa77e" ]
[ "modelmonitor/modelmonitor.py" ]
[ "import numpy as np\nimport pandas as pd\n\nclass ModelMonitor:\n def __init__(self, metric, labels=None, subset=None, sep='_'):\n self.metric = metric\n self.labels = labels\n self.subset = subset\n self.sep = sep\n \n def evaluate_1dim_pair(self, x1, x2):\n return s...
[ [ "numpy.arange", "numpy.array", "pandas.DataFrame" ] ]
vmtmxmf5/P-transformer
[ "ba8259d21f72e9a68e782ab6599c7b24bf6a8eb8" ]
[ "PEDec.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom MHA import MultiHeadedAttention\nfrom FeedForward import PositionwiseFeedForward\nfrom PositionalEncoding import *\nfrom Encoder import EncoderLayer, sequence_mask\nfrom Decoder import DecoderLayer\n\n\nclass subclass(nn.Module):\n def __init__(self,\n ...
[ [ "torch.gt", "torch.ones", "torch.nn.LayerNorm" ] ]
gabrieleagl/qiskit-aqua
[ "521d505a6483985c039dcfb71f7d517471cff441" ]
[ "qiskit/aqua/components/neural_networks/quantum_generator.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2019, 2020.\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 modificatio...
[ [ "numpy.log", "numpy.conj", "numpy.linspace", "numpy.ndim", "numpy.array", "numpy.sum" ] ]
titu1994/pyshac
[ "63edafb8b80a9d2dec7c27b023569df56a659894" ]
[ "pyshac/config/hyperparameters.py" ]
[ "import os\nfrom abc import ABCMeta, abstractmethod\nfrom collections import OrderedDict\nfrom collections import Iterable\nimport six\nimport sys\nimport inspect\nimport numpy as np\nimport uuid\nimport codecs\n\n\n# compatible with Python 2 *and* 3:\nABC = ABCMeta('ABC', (object,), {'__slots__': ()})\n\n\n_CUSTOM...
[ [ "numpy.exp", "numpy.array", "numpy.random.RandomState", "numpy.log" ] ]
jhemedin/ACT
[ "b362a332c44573977fd5523c7065f713b2e66520" ]
[ "act/tests/test_qc.py" ]
[ "from act.io.armfiles import read_netcdf\nfrom act.tests import (EXAMPLE_IRT25m20s, EXAMPLE_METE40, EXAMPLE_CEIL1,\n EXAMPLE_MFRSR, EXAMPLE_MET1, EXAMPLE_CO2FLX4M)\nfrom act.qc.arm import add_dqr_to_qc\nfrom act.qc.radiometer_tests import fft_shading_test\nfrom act.qc.qcfilter import parse_bit...
[ [ "numpy.isnan", "numpy.ma.count_masked", "numpy.timedelta64", "numpy.nansum", "numpy.testing.assert_raises", "numpy.array", "numpy.sum", "numpy.isclose" ] ]
wolfido92/Python-Hackathon
[ "f79224c584322b42b0f476b91acd39bdd3ec15d8" ]
[ "sort_by_BDM.py" ]
[ "from enum import Enum\nimport pandas as pd\nimport xlrd\nfrom pathlib import Path\nimport numpy as np\nimport csv\n\n\nclass Tag(Enum):\n NO_GO = \"no go\"\n GO = \"go\"\n S_H = \"sanity high\"\n S_L = \"sanity low\"\n NO_SHOW = \"no show\"\n\n\nclass Sort_By_BDM:\n \"\"\"\n This class reads a...
[ [ "pandas.read_table", "pandas.ExcelFile" ] ]
longhuang318/Hybrid-DeepRL-Automated-Driving
[ "386f5d43225b2acfcf8300ba644989e68113413b" ]
[ "hybrid-rl/sources/navigation/global_route_planner.py" ]
[ "# This work is licensed under the terms of the MIT license.\n# For a copy, see <https://opensource.org/licenses/MIT>.\n\n\"\"\"\nThis module provides GlobalRoutePlanner implementation.\n\"\"\"\n\nimport math\n\nimport numpy as np\nimport networkx as nx\n\nimport carla\n\nfrom sources.navigation.modified_local_plan...
[ [ "numpy.dot", "numpy.array", "numpy.linalg.norm", "numpy.cross" ] ]
HoBeom/deep-person-reid
[ "5ca1eedb326e6bfdf083c29ec6e5ce6ab95ee0e7" ]
[ "RL_projects/test/train_acc_test.py" ]
[ "\nfrom torchreid import metrics\nfrom torchreid.utils import re_ranking\nimport numpy as np\nimport torch\n\nfrom torch.nn import functional as F\n\nif __name__ == '__main__':\n ff = torch.load('train_avg_feature.pt')\n f_pids = np.load('train_pids.npy')\n f_camids = np.load('train_camids.npy')\n \n\n ...
[ [ "numpy.load", "torch.zeros_like", "torch.load" ] ]
cmayne28/mission_to_mars
[ "f87048e5b0dbe264f0919816500b54afe8a1e054" ]
[ "scrape_mars.py" ]
[ "from splinter import Browser\nfrom bs4 import BeautifulSoup\nimport time\nimport pandas as pd \n\ndef init_browser():\n executable_path = {\"executable_path\": \"/usr/local/bin/chromedriver\"}\n return Browser(\"chrome\", **executable_path, headless=False)\n\ndef scrape():\n browser = init_browser()\n\n ...
[ [ "pandas.read_html" ] ]
dtch1997/cookiecutter-pytorch
[ "b35b9f63a99a7021aaf92d76ae1dba29ad543477" ]
[ "{{cookiecutter.repo_name}}/{{cookiecutter.package_name}}/model/loss.py" ]
[ "import torch.nn.functional as F\n\n\ndef nll_loss(output, target):\n return F.nll_loss(output, target)\n" ]
[ [ "torch.nn.functional.nll_loss" ] ]
balling/cycle-gated-gan
[ "f7c3929a5361f650b8b01a93fe4787c1cd6f3c9b" ]
[ "models/networks.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.nn import init\nimport functools\nfrom torch.optim import lr_scheduler\nimport math\nimport numbers\nfrom torch.nn import functional as F\n\n\n###############################################################################\n# Helper Functions\n#######################...
[ [ "torch.optim.lr_scheduler.LambdaLR", "torch.optim.lr_scheduler.CosineAnnealingLR", "torch.sum", "torch.nn.BCEWithLogitsLoss", "torch.cuda.is_available", "torch.nn.ReplicationPad2d", "torch.nn.Dropout", "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.tensor", "torch.ran...
sauloal/cnidaria
[ "fe6f8c8dfed86d39c80f2804a753c05bb2e485b4" ]
[ "scripts/venv/lib/python2.7/site-packages/cogent/phylo/tree_space.py" ]
[ "#!/usr/bin/env python\nfrom __future__ import division\nimport numpy\nimport itertools\nfrom cogent.core.tree import TreeBuilder\nfrom cogent.phylo.tree_collection import ScoredTreeCollection\nfrom cogent.util import parallel, checkpointing, progress_display as UI\n\n__author__ = \"Peter Maxwell\"\n__copyright__ =...
[ [ "numpy.identity", "numpy.zeros", "numpy.sum" ] ]
jcl5m1/CVToolsPython
[ "02f5911abbc6463c96c12a55acb043230dc2b30c" ]
[ "RandomDotCorrespondence/homography.py" ]
[ "########################################################################\n# Module to compute homographies\t\t\t\t\t\t\t\t\t #\n#\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t #\n# Author : Alexis Mignon\t\t\t\t\t\t\t\t\t\t\t #\n# email : alexis.mignon@info.unicaen.fr\t\t\t\t\t\t\t #\n# date : 10/03/2010\t\t\t\t\t\...
[ [ "numpy.dot", "scipy.linalg.svd", "numpy.zeros", "scipy.linalg.lstsq" ] ]
effigies/mriqc
[ "de60ff0f65e4fe0e315143fe3b75ecd940beb2b1" ]
[ "mriqc/bin/abide2bids.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# @Author: oesteban\n# @Date: 2016-03-16 11:28:27\n# @Last Modified by: oesteban\n# @Last Modified time: 2016-11-15 09:30:00\n\n\"\"\"\nABIDE2BIDS downloader tool\n\n\"\"\"\nfrom __future__ import absolute_import, division, print_function, unicode_literals\n\nimp...
[ [ "numpy.array" ] ]
DT6A/UTGN
[ "ad8eda3a47d9f0f3b278ff86a0a6ede3a3391846" ]
[ "UTGN/model/main.py" ]
[ "\"\"\"Main script for executing training / testing.\n\"\"\"\n\nimport os\nimport sys\nimport signal\nimport time\nimport argparse\nimport fileinput\nfrom copy import deepcopy\nfrom glob import glob\nfrom shutil import rmtree\nfrom pprint import pprint\nimport numpy as np\nimport tensorflow as tf\nfrom utils import...
[ [ "numpy.savetxt", "numpy.isnan" ] ]
jeromeshan/mimas
[ "4e4250bc74a0e69560a13053a9d556bcfd42c6c4" ]
[ "pbgca/__init__.py" ]
[ "from pbgca.cluster import Cluster\nfrom pbgca.clusterer import Clusterer\nfrom pbgca.cube_generator import CubeGenerator\nfrom pbgca.connectivity_matrix import ConnectivityMatrix\nfrom pbgca.cm_python import connectivity_matrix_python\nimport pyximport\nimport numpy as np\npyximport.install(setup_args={\"include_d...
[ [ "numpy.get_include" ] ]
tlkh/jupyter_tensorboard
[ "eab6c6fa2f8f9de303a68f6d94232baec4eb9761" ]
[ "tests/test_tensorboard_integration.py" ]
[ "# -*- coding:utf-8 -*-\n\nimport sys\nimport time\nimport logging\nimport json\n\nimport pytest\nfrom tornado.testing import AsyncHTTPTestCase\n\n\n@pytest.fixture(scope=\"session\")\ndef tf_logs(tmpdir_factory):\n\n import numpy as np\n import tensorflow as tf\n x = np.random.rand(5)\n y = 3 * x + 1 +...
[ [ "tensorflow.norm", "tensorflow.summary.FileWriter", "tensorflow.Variable", "tensorflow.global_variables_initializer", "tensorflow.train.GradientDescentOptimizer", "tensorflow.summary.merge_all", "numpy.random.rand", "tensorflow.Session", "tensorflow.summary.scalar" ] ]
yougoforward/hlzhu-tensorflow-deeplab-resnet
[ "e592ec2c5480872747c9e7a6cde03971aa1acd9e" ]
[ "npy2ckpt50gcn.py" ]
[ "\"\"\"Conversion of the .npy weights into the .ckpt ones.\n\nThis script converts the weights of the DeepLab-ResNet model\nfrom the numpy format into the TensorFlow one.\n\"\"\"\n\nfrom __future__ import print_function\n\nimport argparse\nimport os\n\nimport tensorflow as tf\nimport numpy as np\n\nfrom deeplab_res...
[ [ "tensorflow.constant", "tensorflow.global_variables", "tensorflow.ConfigProto", "tensorflow.global_variables_initializer", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.get_variable_scope" ] ]
lgvaz/torchrl
[ "cfff8acaf70d1fec72169162b95ab5ad3547d17a" ]
[ "reward/utils/utils.py" ]
[ "import numpy as np\nimport torch\nfrom numbers import Number\nfrom reward.utils import EPSILON\nfrom collections import Iterable\n\n\ndef to_np(v): \n if isinstance(v, torch.Tensor): return v.detach().cpu().numpy()\n else: return np.array(v, copy=False)\n\ndef is_np(v): return isins...
[ [ "numpy.eye", "numpy.array" ] ]
MariusCautun/Weighing_the_MW_with_ML
[ "6941b6d9c019c9087bcd14bbafc196d7681579b2" ]
[ "include_files/create_features.py" ]
[ "import numpy as np\nimport h5py as h5\n\n\ndef load_data_and_create_features( inputFile ):\n \"\"\"Function for loading the data for the galaxies and their satellite systems used to constrain the mass of the Milky Way by training various ML algorithms. This function also manipulates some of the feature by trans...
[ [ "numpy.array", "numpy.log10", "numpy.column_stack" ] ]
Mstronach/turicreate
[ "c5e0e58d44adc1c1414eac486f3dc17a721a296e" ]
[ "src/python/turicreate/test/test_sframe.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright © 2017 Apple Inc. All rights reserved.\n#\n# Use of this source code is governed by a BSD-3-clause license that can\n# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause\nfrom __future__ import print_function as _\nfrom __future__ import divisio...
[ [ "numpy.unique", "pandas.DataFrame", "pandas.util.testing.assert_frame_equal", "numpy.std", "numpy.mean", "numpy.var", "numpy.array", "numpy.sum" ] ]
kamalkraj/tensorflow
[ "284b0dd7a3379c3ae6a1def7a30603b0fc1e108e" ]
[ "tensorflow/python/keras/engine/base_layer.py" ]
[ "# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.keras.mixed_precision.experimental.policy.serialize", "tensorflow.python.keras.backend.batch_get_value", "tensorflow.python.keras.mixed_precision.experimental.policy.policy_defaults_to_floatx", "tensorflow.python.framework.ops.executing_eagerly_outside_functions", "tensorflo...
ebouilhol/deepcell-tf
[ "2e609ba4daab526595ad628782a1594952320a5f" ]
[ "deepcell/model_zoo/resnet_3D.py" ]
[ "# 3D adaptation of ResNet50, based on the 2D version of : https://github.com/fchollet/deep-learning-models/blob/master/resnet50.py\n\nfrom scipy import interpolate\nfrom skimage import io\nfrom keras.layers import Input, Add, Dense, Activation, ZeroPadding3D, BatchNormalization, Flatten, Conv3D, AveragePooling3D, ...
[ [ "numpy.arange", "scipy.interpolate.interp1d", "numpy.isfinite", "numpy.empty" ] ]
Saadkhalid913/K-Means-Cluster-Model
[ "50167876af9b8ab38e70ecac9ccd9f9fa7804b53" ]
[ "KMeans.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.datasets import make_blobs\nimport pandas as pd\nfrom sklearn.preprocessing import Normalizer, MinMaxScaler\nfrom math import sqrt\nfrom sklearn.metrics import confusion_matrix, accuracy_score\n\n\nclass KMeansModel():\n\n def __init__(self, K_cl...
[ [ "sklearn.metrics.confusion_matrix", "numpy.concatenate", "numpy.random.rand", "sklearn.preprocessing.MinMaxScaler", "numpy.array", "numpy.sum", "sklearn.datasets.make_blobs", "sklearn.metrics.accuracy_score" ] ]
NastasjaEO/eotopia
[ "a29576075065428cbd61aa54b071f56ae0ff876c" ]
[ "visualization/visualization_eopatch/eopatch_visualization.py" ]
[ "\"\"\"\nThis module implements visualizations for EOPatch\n\nCredits:\nCopyright (c) 2017-2019 Matej Aleksandrov, Matej Batič, Andrej Burja, Eva Erzin (Sinergise)\nCopyright (c) 2017-2019 Grega Milčinski, Matic Lubej, Devis Peresutti, Jernej Puc, Tomislav Slijepčević (Sinergise)\nCopyright (c) 2017-2019 Blaž Sovda...
[ [ "pandas.concat", "numpy.unique", "numpy.clip", "numpy.squeeze", "pandas.DataFrame", "numpy.repeat", "numpy.flip" ] ]
bastustrump/genimpro
[ "3ef8f66ec0d1e8275b5d559090f1672a1788e47c" ]
[ "importwrapper.py" ]
[ "from __future__ import division, print_function, absolute_import\n\nimport struct\nimport warnings \nimport sys\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os\nimport genimpro as genimpro\nfrom pprint import pprint\nimport struct\nfrom IPython.core.display import HTML\nimport scipy.constants as...
[ [ "matplotlib.pyplot.axvline", "matplotlib.pyplot.twinx", "numpy.asarray", "matplotlib.transforms.blended_transform_factory", "numpy.dtype", "matplotlib.pyplot.plot", "numpy.seterr", "numpy.iinfo", "matplotlib.pyplot.xlabel", "numpy.zeros", "matplotlib.pyplot.figure" ] ...
sauhaardac/LIDAR-Landslide-Detection
[ "bc9ac0188f03f192a4e3eb8b6460864fe64d1372" ]
[ "clean_data.py" ]
[ "\"\"\"\nThis script operates on data from the qtm_extracted_data folder and populates the cleaned_data folder.\n\nThe objective of the script is to take the data from geographical format to a more simplified image based numerical format.\n\"\"\"\n\nimport os\nimport pandas as pd\nimport gdal\nfrom affine import Af...
[ [ "pandas.read_csv" ] ]
chichi0119/speech
[ "130124ccaf23fabe3e7a6f138d9403a7c0946ef3" ]
[ "examples/conformer/test.py" ]
[ "# Copyright 2020 Huy Le Nguyen (@usimarit)\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 ...
[ [ "tensorflow.io.gfile.exists", "tensorflow.keras.backend.clear_session", "tensorflow.config.optimizer.set_experimental_options", "tensorflow.random.set_seed" ] ]
serjik85kg/UnetV2-pytorch-segmentation
[ "c53598d00aeb0c79cb9dd52b6ab3b4976d127f21" ]
[ "python/sd_lib/geometry/polygon.py" ]
[ "# coding: utf-8\n\nimport cv2\nimport numpy as np\n\nfrom shapely.geometry import mapping, Polygon as ShapelyPolygon\n\nfrom sd_lib.geometry.conversions import shapely_figure_to_coords_list\nfrom sd_lib.geometry.point_location import row_col_list_to_points, points_to_row_col_list\nfrom sd_lib.geometry.vector_geome...
[ [ "numpy.zeros", "numpy.roll" ] ]
chinmaydas96/U-2-Net
[ "af81098edf8ec4c4417b6038b893845af790fc8f" ]
[ "Pytorch2Onnx.py" ]
[ "# import libraries\nfrom torchvision import models\nimport torch\n\n# create a dummy input with correct shape for the network\ndummy_input = torch.randn(16, 3, 224, 224, device='cuda')\n\n# created a resnet50 model\nmodel = models.resnet50(pretrained=True).cuda()\nmodel.eval()\n\n# Created dynamic axes for dynamic...
[ [ "torch.randn", "torch.onnx.export" ] ]
peterroelants/datashader
[ "fd938888feca3a42bdfb42462d098f758a954dd8" ]
[ "datashader/tests/test_transfer_functions.py" ]
[ "from __future__ import division, absolute_import\n\nfrom io import BytesIO\n\nimport numpy as np\nimport xarray as xr\nimport dask.array as da\nimport PIL\nimport pytest\nfrom collections import OrderedDict\nimport datashader.transfer_functions as tf\nfrom datashader.tests.test_pandas import assert_eq_xr\n\ncoords...
[ [ "numpy.testing.assert_equal", "numpy.linspace", "numpy.isnan", "numpy.arange", "numpy.eye", "numpy.nanmin", "numpy.dstack", "numpy.full", "numpy.ones", "numpy.random.normal", "numpy.array", "numpy.zeros", "numpy.where", "numpy.random.randint" ] ]
AidanGlickman/sportsreference
[ "2129b83553e37c42f847e2f2bfbfa7287212bc5f" ]
[ "sportsreference/fb/roster.py" ]
[ "import pandas as pd\nimport re\nfrom .constants import ROSTER_SCHEME, SQUAD_URL\nfrom ..decorators import float_property_decorator, int_property_decorator\nfrom .fb_utils import _lookup_team\nfrom pyquery import PyQuery as pq\nfrom sportsreference.utils import (_get_stats_table,\n ...
[ [ "pandas.DataFrame" ] ]
bwalker1/spatial-constrained-clustering-and-pseudotime
[ "1b5fda9c589d29b24537110dd63f106437de1eec" ]
[ "python_codes/sedr/utils_func.py" ]
[ "import os\nimport torch\nimport scanpy as sc\nimport pandas as pd\nfrom pathlib import Path\nfrom scanpy.readwrite import read_visium\nfrom scanpy._utils import check_presence_download\nfrom sklearn.neighbors import kneighbors_graph\n\ndef mk_dir(input_path):\n if not os.path.exists(input_path):\n os.ma...
[ [ "sklearn.neighbors.kneighbors_graph", "pandas.read_csv" ] ]
RayYuqian/standard-es
[ "a7a4bf7a82d1ce18d7a81e57ffae6e3bbc883fcd" ]
[ "algorithms/recombination.py" ]
[ "import numpy as np\nimport random\nfrom utils.distributions import bernoulli\nimport math\n\n\n# ----------------------------------------------------------------------------------------------------------------------\nclass Recombination(object):\n def __init__(self):\n pass\n\n def recombination(self,...
[ [ "numpy.dot", "numpy.clip", "numpy.asarray", "numpy.arange", "numpy.linalg.multi_dot", "numpy.cos", "numpy.sin", "numpy.random.normal", "numpy.random.permutation", "numpy.random.uniform", "numpy.zeros" ] ]
japaf/foamgen
[ "6f456796e79de344eefb21a1ad121fd869f9fd9e" ]
[ "src/foamgen/smesh.py" ]
[ "\"\"\"\nStructured meshing module\n=========================\n:synopsis: Create structured VTK mesh.\n\n.. moduleauthor:: Pavel Ferkl <pavel.ferkl@gmail.com>\n\"\"\"\nfrom __future__ import division, print_function\nimport os\nimport shutil\nimport subprocess as sp\nimport shlex\nfrom scipy.optimize import root_sc...
[ [ "scipy.optimize.root_scalar" ] ]
j-faria/vera
[ "96cbdb61c98c3527416611155b29a03a2bc66b15" ]
[ "vera/visibility.py" ]
[ "# -*- coding: utf-8 -*-\nfrom __future__ import print_function\nimport sys\nimport numpy as np\nfrom scipy.optimize import bisect\nimport datetime as dt\nfrom dateutil import tz\nimport pickle\nfrom random import choice\nfrom PyAstronomy import pyasl\nfrom astropy.coordinates import SkyCoord\nfrom astropy.coordina...
[ [ "matplotlib.pyplot.legend", "matplotlib.ticker.MultipleLocator", "numpy.cumsum", "scipy.optimize.bisect", "numpy.where", "numpy.random.randint", "numpy.ones_like", "numpy.arange", "numpy.argmax", "numpy.insert", "matplotlib.pyplot.text", "matplotlib.pyplot.figure", ...
kokandeep/open_model_zoo
[ "efd238d02035f8a5417b7b1e25cd4c997d44351f" ]
[ "tools/downloader/pytorch_to_onnx.py" ]
[ "import argparse\nfrom pathlib import Path\nimport sys\n\nimport onnx\nimport torch\nimport torch.onnx\n\n\ndef positive_int_arg(values):\n \"\"\"Check positive integer type for input argument\"\"\"\n result = []\n for value in values.split(','):\n try:\n ivalue = int(value)\n ...
[ [ "torch.randn", "torch.load" ] ]
OpenSourceEconomics/ose-scientific-computing-course-wirecard
[ "905c64d8dc7ef93f2231533c8e58614de63402ce" ]
[ "auxiliary/aux_m/function_get_start_point.py" ]
[ "from numpy import *\nimport pandas as pd\nimport random\nimport nlopt\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport numbers\nimport math\nimport random\nimport autograd.numpy as ag\nfrom autograd import grad\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom numpy.lib.function_base import vectorize\nfro...
[ [ "numpy.set_printoptions", "pandas.DataFrame", "numpy.concatenate", "numpy.random.uniform", "pandas.set_option", "numpy.random.dirichlet" ] ]
Heldenkrieger01/examples
[ "10aa1fb6796f0c275064d64e46699edd116be485" ]
[ "lite/examples/recommendation/ml/data/example_generation_movielens.py" ]
[ "# Lint as: python3\n# Copyright 2019 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/licens...
[ [ "tensorflow.io.TFRecordWriter", "tensorflow.io.gfile.exists", "tensorflow.io.gfile.makedirs", "tensorflow.compat.v1.logging.info", "tensorflow.keras.utils.get_file", "tensorflow.train.Features", "tensorflow.train.Int64List" ] ]
Chandler/pyFM
[ "7ee034fff55bb333d278503479ce17f32cca4237" ]
[ "pyFM/spectral/convert.py" ]
[ "import numpy as np\nfrom sklearn.neighbors import KDTree\nimport scipy.linalg\n\ntry:\n import pynndescent\n index = pynndescent.NNDescent(np.random.random((100, 3)), n_jobs=2)\n del index\n ANN = True\nexcept ImportError:\n ANN = False\n\n\ndef p2p_to_FM(p2p, eigvects1, eigvects2, A2=None):\n \"...
[ [ "numpy.random.random", "sklearn.neighbors.KDTree" ] ]
bendichter/element-array-ephys
[ "720eb00e60c6df928f4e6cbe938d4db625feab58" ]
[ "element_array_ephys/ephys.py" ]
[ "import datajoint as dj\nimport pathlib\nimport re\nimport numpy as np\nimport inspect\nimport importlib\n\nfrom .readers import spikeglx, kilosort, openephys\nfrom . import probe, find_full_path, find_root_directory, dict_to_uuid\n\nschema = dj.schema()\n\n_linking_module = None\n\n\ndef activate(ephys_schema_name...
[ [ "numpy.arange", "numpy.load", "numpy.array", "numpy.diff" ] ]
mkrack/aiida-cp2k
[ "2cd553c59b184d5df46a550ab1fc3d1f23644256" ]
[ "aiida_cp2k/utils/workchains.py" ]
[ "# -*- coding: utf-8 -*-\n###############################################################################\n# Copyright (c), The AiiDA-CP2K authors. #\n# SPDX-License-Identifier: MIT #\n# AiiDA-CP2K is hosted on GitHub at https://git...
[ [ "numpy.dot", "numpy.array", "numpy.zeros", "numpy.linalg.norm" ] ]
liyongsheng-tech/pytorch-metric-learning
[ "ae3807249a748512a1f7db62b380a524869b5911" ]
[ "pytorch_metric_learning/utils/common_functions.py" ]
[ "import collections\r\nimport torch\r\nfrom torch.autograd import Variable\r\nimport numpy as np\r\n\r\nNUMPY_RANDOM_STATE = np.random.RandomState()\r\n\r\n\r\ndef try_keys(input_dict, keys):\r\n for k in keys:\r\n try:\r\n return input_dict[k]\r\n except BaseException:\r\n pa...
[ [ "torch.zeros", "torch.is_tensor", "torch.from_numpy", "numpy.random.RandomState", "torch.autograd.Variable" ] ]
KITTCAMP-CODE/puppy
[ "f222c935ee474eb6e9dec2ff60f05415eab34c90" ]
[ "lane/laneline_coord_bku1.py" ]
[ "import cv2\nimport urllib.request as request\nimport numpy as np\nimport sys\nimport matplotlib.pyplot as plt\n\nfrom linesearch import *\n\n'''\nPrepare:\n In raspberryPi:\n\n ```\n cd Tools\n bash change_network.sh wifi\n bash remote_camera.sh\n ```\n\n In laptop computer:\n \n ```\n ...
[ [ "numpy.arange", "numpy.array", "numpy.linspace", "numpy.fromstring" ] ]
milkKarten/IC3Net
[ "98cbc4874d755ca5396f6c8caa24738845c52b44" ]
[ "comm.py" ]
[ "import torch\nimport torch.nn.functional as F\nfrom torch import nn\nimport time\nfrom models import MLP\nfrom action_utils import select_action, translate_action\nfrom networks import ProtoNetwork, ProtoLayer\nfrom noise import OUNoise\nimport numpy as np\n\nclass CommNetMLP(nn.Module):\n \"\"\"\n MLP based...
[ [ "torch.randn_like", "torch.ones", "torch.zeros", "numpy.random.choice", "torch.eye", "torch.from_numpy", "torch.unsqueeze", "torch.tensor", "torch.nn.Tanh", "torch.nn.Linear", "torch.nn.LSTMCell", "torch.exp", "torch.nn.functional.mse_loss", "numpy.array", ...
dahe-cvl/vhh_od
[ "ded750a5d7de55079da4b295230d09c8e99a9ec2" ]
[ "vhh_od/Video.py" ]
[ "import numpy as np\nimport cv2\nimport datetime\nfrom vhh_od.utils import *\nfrom vhh_od.Shot import Shot\nfrom PIL import Image\nimport torchvision\n\n\nclass Video(object):\n \"\"\"\n This class is representing a video. Each instance of this class is holding the properties of one Video.\n \"\"\"\n\n ...
[ [ "numpy.array" ] ]
libing4752/myia
[ "3bfb8ac20468bfc7be34128a396f79f2e03b24a1" ]
[ "tests/test_compile.py" ]
[ "from pytest import mark\nfrom copy import copy\nimport numpy as np\n\n\nfrom myia.abstract import from_value\nfrom myia.pipeline import standard_pipeline, standard_debug_pipeline\nfrom myia.prim import ops as P\nfrom myia.prim.py_implementations import \\\n typeof, scalar_add, partial\nfrom myia.utils import no...
[ [ "numpy.testing.assert_allclose" ] ]
ploshkin/hivemind
[ "7bb656567417895e9f1d8684a0c0e9ef4e4de25d" ]
[ "hivemind/server/connection_handler.py" ]
[ "import multiprocessing as mp\nimport os\nimport pickle\nfrom typing import Dict\n\nimport grpc\nimport torch\n\nfrom hivemind.proto import runtime_pb2, runtime_pb2_grpc as runtime_grpc\nfrom hivemind.server.expert_backend import ExpertBackend\nfrom hivemind.utils import get_logger, serialize_torch_tensor, deserial...
[ [ "torch.set_num_threads" ] ]
magh24/carla_RL_IAs
[ "a13b331ee8d69071570c97b35f1348758d658ee5" ]
[ "misc/automatic_control.py" ]
[ "#!/usr/bin/env python\n\n# Copyright (c) 2018 Intel Labs.\n# authors: German Ros (german.ros@intel.com)\n#\n# This work is licensed under the terms of the MIT license.\n# For a copy, see <https://opensource.org/licenses/MIT>.\n\n\"\"\"\n Example of automatic vehicle control from client side.\n\"\"\"\n\nfrom __f...
[ [ "numpy.reshape", "numpy.dtype", "numpy.array", "numpy.zeros", "numpy.fabs" ] ]
SsnL/BigGAN-PyTorch
[ "a11c8621a7bc733475afdd0c5e1e86db0b923381" ]
[ "BigGANdeep.py" ]
[ "import numpy as np\nimport math\nimport functools\n\nimport torch\nimport torch.nn as nn\nfrom torch.nn import init\nimport torch.optim as optim\nimport torch.nn.functional as F\nfrom torch.nn import Parameter as P\n\nimport layers\nfrom sync_batchnorm import SynchronizedBatchNorm2d as SyncBatchNorm2d\n\n# BigGAN-...
[ [ "torch.cat", "torch.nn.ModuleList", "torch.nn.AvgPool2d", "torch.nn.functional.relu", "torch.set_grad_enabled", "torch.nn.init.orthogonal_", "torch.nn.init.normal_", "torch.split", "torch.nn.init.xavier_uniform_", "torch.nn.ReLU" ] ]
alexandrebatista/mips-spark-optimization
[ "8d049920d602e42b988f1eaa0aca61df1a39ac4e" ]
[ "src/mips.py" ]
[ "from pyspark.ml.clustering import KMeans\nfrom pyspark.ml.evaluation import ClusteringEvaluator\nimport pyspark.sql.functions as F\nimport numpy as np\nfrom heapq import heapify, heappush, heappop, nlargest\nimport threading\nimport logging\nimport time\n\ndef unit_vector(vector):\n return vector / np.linalg.no...
[ [ "numpy.dot", "numpy.cos", "numpy.linalg.norm" ] ]
gpetretto/PyXtal
[ "8cdd44ccdfbc27bced35b305ec796ce3bcdcfa5e" ]
[ "pyxtal/test_all.py" ]
[ "# python -m unittest pyxtal/test_all.py\nimport unittest\n\nimport numpy as np\nfrom pkg_resources import resource_filename\nfrom pymatgen.core.structure import Molecule\nimport pymatgen.analysis.structure_matcher as sm\nfrom pymatgen.symmetry.analyzer import SpacegroupAnalyzer\nfrom pymatgen.core.operations impor...
[ [ "numpy.array", "numpy.allclose" ] ]
JunhoPark0314/fvcore
[ "50a98a712553e4e2f8fc66466585f89793255077" ]
[ "tests/test_activation_count.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n# pyre-ignore-all-errors[2]\n\nimport typing\nimport unittest\nfrom collections import Counter, defaultdict\nfrom typing import Any, Dict, List\n\nimport torch\nimport torch.nn as nn\nfrom fvcore.nn.activation_count import Handle, activation_...
[ [ "torch.nn.Linear", "torch.randn", "torch.nn.Conv2d" ] ]
ukky17/invert_MV_pytorch
[ "b6f54bf81f7deb5189213071056e83f0e578a7a6" ]
[ "ff_training.py" ]
[ "import os\nimport time\nimport sys\n\nimport torch\nimport torch.optim as optim\nimport torch.nn as nn\nimport torchvision.datasets as dst\nimport torchvision.transforms as tfs\nfrom torch.utils.data import DataLoader\n\nimport model\n\ndef train(dataloader, net):\n net.train()\n total = 0\n correct = 0\n...
[ [ "torch.nn.CrossEntropyLoss", "torch.max", "torch.utils.data.DataLoader", "torch.no_grad", "torch.device" ] ]
ksteensig/pytorch-batch-ops
[ "12063a470b92945470d09e2d23ff55ae13c85564" ]
[ "parallel_no_gesvda.py" ]
[ "import torch\nimport torch_batch_ops_cpp\nimport math\n\ndef csvd(X):\n size = list(X.size())\n m = size[1]\n n = size[2]\n batch_size = size[0]\n\n p = 20\n k = math.floor(n*0.10)\n l = k+p # estimate a low rank approx that is 10% of with p oversampling\n\n #Phi = torch.randint(0,2,(batch...
[ [ "torch.randn", "torch.cuda.synchronize", "torch.range" ] ]
Icenowy/apicula
[ "cace8bb98f6acc5d847c7da6c6cc086f05337fb0" ]
[ "apycula/tiled_fuzzer.py" ]
[ "import re\nimport os\nimport sys\nimport tempfile\nimport subprocess\nfrom collections import deque, Counter, namedtuple\nfrom itertools import chain, count, zip_longest\nfrom functools import reduce\nfrom random import shuffle, seed\nfrom warnings import warn\nfrom math import factorial\nimport numpy as np\nfrom ...
[ [ "numpy.where" ] ]
broccoliboy/LedFx
[ "1c90d5c3ddaf993a072eab92d3e373dd3b0fb45c" ]
[ "ledfx/effects/mel.py" ]
[ "\"\"\"This module implements a Mel Filter Bank.\nIn other words it is a filter bank with triangular shaped bands\narnged on the mel frequency scale.\nAn example ist shown in the following figure:\n.. plot::\n from pylab import plt\n import melbank\n f1, f2 = 1000, 8000\n melmat, (melfreq, fftfreq) = me...
[ [ "numpy.abs", "numpy.linspace", "numpy.arange", "numpy.mean", "numpy.zeros" ] ]
me2190901/Library_Inventory_Management_System
[ "d708aba96f0ff4283edb0bc784e8063aeb2f9ec3" ]
[ "Integrated.py" ]
[ "import spine_segment\nimport glob as gb\nimport text_recognize as tr\nimport pandas as pd\n# from IPython.display import display, HTML\ndef prediction(loc,debug=False):\n df=pd.read_csv(\".\\data1.csv\")\n df.drop_duplicates(subset =\"Title\",\n keep = False, inplace = True)\n if (debu...
[ [ "pandas.concat", "pandas.read_csv", "pandas.DataFrame" ] ]
yzhq97/SCKR
[ "601545db60eac3845e0eeaaae6b0580d4a41d949" ]
[ "modules/vgg16.py" ]
[ "import inspect\nimport os\n\nimport numpy as np\nimport tensorflow as tf\nimport time\n\nVGG_MEAN = [103.939, 116.779, 123.68]\n\n\nclass Vgg16:\n def __init__(self, vgg16_npy_path):\n self.data_dict = np.load(vgg16_npy_path, encoding='latin1').item()\n print(\"vgg16 npy file loaded\")\n\n def ...
[ [ "tensorflow.nn.bias_add", "tensorflow.nn.relu", "tensorflow.matmul", "tensorflow.constant", "tensorflow.concat", "tensorflow.nn.max_pool", "tensorflow.reshape", "tensorflow.nn.avg_pool", "tensorflow.variable_scope", "numpy.load", "tensorflow.split", "tensorflow.nn.c...
renwenduan/fooltrader
[ "c9ede56d6ce4f952618d14e0ec28479584ad9377" ]
[ "fooltrader/spiders/stock_kdata_spider_ths.py" ]
[ "import json\nimport os\n\nimport pandas as pd\nimport scrapy\nfrom scrapy import Request\nfrom scrapy import signals\n\nfrom fooltrader.api.quote import get_security_list\nfrom fooltrader.consts import TONGHUASHUN_KDATA_HEADER\nfrom fooltrader.contract import data_contract\nfrom fooltrader.contract.files_contract ...
[ [ "pandas.DataFrame" ] ]
euske/introdl
[ "f6d9da71c7172952e9b5872502293dbb41eb7d93" ]
[ "lec3/plotgrad.py" ]
[ "#!/usr/bin/env python\nimport numpy as np\nfrom PIL import Image\n\ndef sigmoid(x):\n return 1 / (1 + np.exp(-x))\n\nsize = 256\nls = np.linspace(-2,+2,size,False)\nw1 = ls\nw2 = ls.reshape(size,1)[::-1]\nw3 = -2.0\nb = 1.0\n# compute y.\nya = sigmoid(w1*0 + w2*0 + w3*0 + b)\nyb = sigmoid(w1*0 + w2*1 + w3*0 + b...
[ [ "numpy.exp", "numpy.zeros_like", "numpy.linspace" ] ]
wptoux/finvest-tutorial
[ "73fe98dbdb65853170740cf2361b03256316ab01" ]
[ "portfolio_opt.py" ]
[ "import numpy as np\nimport scipy.optimize as sco\nimport math\n\n__all__ = [\n 'efficient_frontier'\n]\n\ndef efficient_frontier(returns):\n '''\n '''\n n = returns.shape[1]\n noa = returns.shape[0]\n \n N = 100\n qs = [10**(5.0 * t/N - 1.0) for t in range(N)]\n \n Sigma = np.cov(retu...
[ [ "numpy.cov", "numpy.mean", "scipy.optimize.minimize", "numpy.array", "numpy.sum" ] ]
erayon/models
[ "c5ad244e8e1ac263e8dd33533e9c2c0b53763d46" ]
[ "official/benchmark/models/resnet_cifar_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.device", "tensorflow.compat.v1.logging.debug", "tensorflow.test.is_built_with_cuda", "tensorflow.compat.v1.logging.set_verbosity", "tensorflow.keras.backend.set_image_data_format", "tensorflow.keras.backend.set_learning_phase" ] ]
Radioactive-Waste/c3
[ "947ed882f94a6eaa43990af2eb4adcf31d19bc1f" ]
[ "c3/optimizers/sensitivity.py" ]
[ "\"\"\"Object that deals with the sensitivity test.\"\"\"\n\nimport os\nimport shutil\nimport pickle\nimport itertools\nimport numpy as np\nimport tensorflow as tf\nfrom c3.optimizers.optimizer import Optimizer\nfrom c3.utils.utils import log_setup\nfrom c3.libraries.estimators import (\n g_LL_prime_combined,\n ...
[ [ "tensorflow.stack", "numpy.array", "tensorflow.Variable" ] ]