repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
PigUnderRoof/Model-Based-Super-Mario
[ "69b62c14871369df7da42485b5aaa678d8be5882" ]
[ "environment.py" ]
[ "import gym_super_mario_bros\nimport numpy as np\nimport cv2\n\nfrom gym.spaces import Box\nfrom gym import Wrapper\nfrom nes_py.wrappers import JoypadSpace\nfrom gym_super_mario_bros.actions import SIMPLE_MOVEMENT, COMPLEX_MOVEMENT, RIGHT_ONLY\n\nfrom typing import Tuple, Dict, Any\nArray = np.ndarray\nAction = in...
[ [ "numpy.concatenate", "numpy.repeat", "numpy.zeros" ] ]
taikis/kaggle-kuzushiji-recognition
[ "63c063f03f1ff5d53d411ae1709b4e328e170ace" ]
[ "mmdetection/mmdet/ops/nms/nms_wrapper.py" ]
[ "import numpy as np\nimport torch\n\nfrom . import nms_cpu, nms_cuda\nfrom .soft_nms_cpu import soft_nms_cpu\n\n\ndef nms(dets, iou_thr, device_id=None):\n \"\"\"Dispatch to either CPU or GPU NMS implementations.\n\n The input can be either a torch tensor or numpy array. GPU NMS will be used\n if the input...
[ [ "torch.from_numpy" ] ]
penglian518/protwis
[ "d81b0aaeb0821dcca1979926dc18c1a70a3ca654", "d81b0aaeb0821dcca1979926dc18c1a70a3ca654" ]
[ "tools/management/commands/assign_structure_states.py", "contactnetwork/distances.py" ]
[ "from django.core.management.base import BaseCommand, CommandError\nfrom django.core.management import call_command\nfrom django.conf import settings\nfrom django.db import connection\nfrom django.db.models import Max, Min\n\nfrom contactnetwork.distances import *\nfrom contactnetwork.models import *\nfrom protein....
[ [ "pandas.DataFrame", "scipy.spatial.distance.squareform", "scipy.cluster.hierarchy.to_tree" ], [ "numpy.mean", "numpy.nan_to_num", "numpy.var", "numpy.absolute" ] ]
yongsu-bloo/AdapAug
[ "074793f9e34c2d4968f7e863198bcb316be55da4" ]
[ "AdapAug/train.py" ]
[ "import pathlib\nimport sys\n\nsys.path.append(str(pathlib.Path(__file__).parent.parent.absolute()))\n\nimport itertools\nimport json\nimport logging\nimport math\nimport os\nfrom collections import OrderedDict\n\nimport torch\nfrom torch.distributions import Categorical\nfrom torch import nn, optim\nfrom torch.nn....
[ [ "torch.device", "torch.distributed.get_world_size", "torch.distributions.Categorical", "torch.cuda.synchronize", "torch.no_grad", "torch.nn.parallel.data_parallel.DataParallel", "torch.sum", "torch.cuda.set_device", "torch.load", "torch.distributed.get_rank", "torch.dis...
Price-L/Comp_Phys
[ "40ec1ddf10dad0d7109fcb8845fe93b578027533" ]
[ "hw/price_hw1.3_2.py" ]
[ "class particle2(object):\n \n def __init__(self, mass=1., x=0., y=0., vx=0., vy=0.):\n self.mass = mass\n self.x = x\n self.y = y\n self.vx = vx\n self.vy = vy\n \n def euler(self, fx, fy, dt):\n self.vx = self.vx + fx/self.mass*dt\n self.vy = self.vy...
[ [ "numpy.array", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.legend", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
AGI-Labs/continual_rl
[ "bcf17d879e8a983340be233ff8f740c424d0f303" ]
[ "continual_rl/experiments/tasks/image_task.py" ]
[ "import torch\nimport torchvision\nfrom gym.spaces.box import Box\nfrom continual_rl.experiments.tasks.task_base import TaskBase\nfrom continual_rl.experiments.tasks.preprocessor_base import PreprocessorBase\nfrom continual_rl.utils.utils import Utils\nfrom continual_rl.utils.env_wrappers import FrameStack, WarpFra...
[ [ "torch.stack" ] ]
Lapayo/SPFlow
[ "6ca69f2085b33ef365a091d38be8c658bf423457" ]
[ "src/spn/structure/leaves/histogram/Gradients.py" ]
[ "import bisect\n\nimport numpy as np\n\nfrom spn.structure.leaves.histogram.Histograms import Histogram\nfrom spn.structure.leaves.histogram.Inference import histogram_ll\nimport logging\n\nlogger = logging.getLogger(__name__)\n\n\ndef histogramm_gradient(node, input_vals=None, dtype=np.float64):\n if input_vals...
[ [ "numpy.searchsorted", "numpy.array", "numpy.isnan" ] ]
shaswatac2/PhocNet2
[ "dcdb9916e04c39ce5f1ece074234e5ce5b7ab030" ]
[ "phoc2.py" ]
[ "import numpy as np\nimport more_itertools as mit \nimport re\n\nalphabet=[chr(i) for i in range(97,123)]\ndigits=[chr(i) for i in range(48,58)]\nbigrams=[ 'th' , 'he' ,'in' ,'er' , 'an' ,'re' ,'on' ,'at' ,'en' ,'nd' , 'ti' ,'es' ,'or' ,'te' ,'of' ,'ed' ,'is' ,'it' ,'al' ,'ar' , 'st' ,'to' ,'nt...
[ [ "numpy.zeros" ] ]
mbalassi/handson-ml
[ "4817bf78681b02df489d7823cf4f0cd333497df6" ]
[ "02_end_to_end_machine_learning_project.py" ]
[ "\n# coding: utf-8\n\n# **Chapter 2 – End-to-end Machine Learning project**\n# \n# *Welcome to Machine Learning Housing Corp.! Your task is to predict median house values in Californian districts, given a number of features from these districts.*\n# \n# *This notebook contains all the sample code and solutions to t...
[ [ "sklearn.linear_model.LinearRegression", "sklearn.externals.joblib.dump", "scipy.stats.geom", "sklearn.model_selection.RandomizedSearchCV", "numpy.mean", "sklearn.tree.DecisionTreeRegressor", "scipy.stats.sem", "pandas.read_csv", "pandas.plotting.scatter_matrix", "sklearn.m...
UKPLab/TWEAC-qa-agent-selection
[ "ed4f0cafa87aefd4820cca0d7f4881d2de99a9f0" ]
[ "elasticsearch/create_index_with_embedding.py" ]
[ "import logging\nimport os\nimport argparse\nimport json\nimport yaml\nfrom elasticsearch import Elasticsearch\nfrom elasticsearch.helpers import bulk\nfrom sentence_transformers import SentenceTransformer\nimport numpy as np\nimport base64\n\nfrom es_vec_classifier.use_encoder import USEEncoderAPI, USEEncoder\n\nn...
[ [ "numpy.random.seed", "numpy.array", "numpy.dtype" ] ]
bhjeong-goldenplanet/automl
[ "0e24ef5d57b005a1185d1a583eff88ee9e45f748" ]
[ "ml/automl/tables/kfp_e2e/create_model_for_tables/tables_eval_component.py" ]
[ "# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.barh", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure" ] ]
PattynR/PyTorch-NLP
[ "8995774abf3734db6da174425843d883face5218" ]
[ "torchnlp/label_encoder.py" ]
[ "from collections import Counter\n\nfrom torchnlp.encoder import Encoder\n\nimport torch\n\n# RESERVED TOKENS\n# NOTE: vocab size is len(reversed) + len(vocab)\nUNKNOWN_INDEX = 0\nUNKNOWN_TOKEN = '<unk>'\nRESERVED_ITOS = [UNKNOWN_TOKEN]\nRESERVED_STOI = {token: index for index, token in enumerate(RESERVED_ITOS)}\n\...
[ [ "torch.LongTensor" ] ]
eclipsesource/squeezeDet
[ "77a9f03f52a5d6c99998a4dbcfb20d45d6b7a8d7" ]
[ "src/config/config.py" ]
[ "# Author: Bichen Wu (bichen@berkeley.edu) 08/25/2016\n\n\"\"\"Base Model configurations\"\"\"\n\nimport os\nimport os.path as osp\nimport numpy as np\nfrom easydict import EasyDict as edict\n\ndef base_model_config(dataset='PASCAL_VOC'):\n assert dataset.upper()=='PASCAL_VOC' or dataset.upper()=='KITTI', \\\n ...
[ [ "numpy.array" ] ]
StephenTerror/TSSCapsNet
[ "edc01b85987da641f4797c1bf60355bc78a6d51f" ]
[ "utils/flops.py" ]
[ "from keras_flops import get_flops\nfrom tensorflow.keras import Model, Input\n\n\ndef compute(model, input_shape, batch_size=1):\n inp = Input(input_shape)\n out = model(inp)\n _model = Model(inp, out)\n flops = get_flops(_model, batch_size=batch_size)\n print(f\"FLOPS: {flops / 10 ** 9:.03} G\")\n\...
[ [ "tensorflow.keras.Input", "tensorflow.keras.Model" ] ]
datosgobar/series-tiempo-ar
[ "a0e27135a3195ad6863933f65fb9ad1d465830b6" ]
[ "tests/test_series_tiempo_ar.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"Tests del modulo series_tiempo_ar.\"\"\"\n\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\nfrom __future__ import with_statement\n\nimport os\nimport unittest\n\nimport nose\nimport pandas as pd\nfrom nose.tools import raises\...
[ [ "pandas.read_csv" ] ]
zhanghuanrong/ortjs
[ "2fed37c8eb93d56ab00ad7c0af7921cf3abf934c" ]
[ "orttraining/orttraining/python/ort_trainer.py" ]
[ "import io\nimport os\nimport warnings\nimport numpy as np\nimport onnx\nfrom onnx import numpy_helper\nfrom onnx import helper\nimport torch\nimport torch.nn\nimport torch.onnx\nimport onnxruntime as ort\nfrom distutils.version import LooseVersion\nfrom .checkpointing_utils import list_checkpoint_files, get_checkp...
[ [ "torch.device", "torch.save", "torch.no_grad", "torch.from_numpy", "torch.randint", "torch.tensor", "torch.load", "torch.randn" ] ]
AliengirlLiv/dreamer-pytorch
[ "23b5a633cba6c6aa6ed0df860d93682914572d13" ]
[ "main_grid.py" ]
[ "import datetime\nimport os\nimport argparse\nimport torch\nimport babyai\n\nfrom rlpyt.runners.minibatch_rl import MinibatchRlEval, MinibatchRl\nfrom rlpyt.samplers.serial.sampler import SerialSampler\nfrom rlpyt.utils.logging.context import logger_context\n\nfrom dreamer.agents.minigrid_dreamer_agent import Minig...
[ [ "torch.load" ] ]
adityai/pyMarsTime
[ "0e579a0396d157348316d87024a4690c4d6efe6a" ]
[ "examples/analemma.py" ]
[ "import matplotlib\nfrom matplotlib.ticker import MultipleLocator, FormatStrFormatter\nmatplotlib.use(\"Agg\")\nmatplotlib.rc(\"xtick\",labelsize=8)\nmatplotlib.rc(\"ytick\",labelsize=8)\nmatplotlib.rc(\"font\",size=8)\n\nimport marstime\nimport numpy\nimport pylab\n\n#define the start date as sometime in May 2000,...
[ [ "matplotlib.use", "matplotlib.ticker.MultipleLocator", "matplotlib.rc", "numpy.arange", "numpy.linspace" ] ]
ttxskk/mmhuman3d
[ "f6d39e24a2d5cc216448fc3bd82832ff45eee436" ]
[ "mmhuman3d/core/conventions/keypoints_mapping/__init__.py" ]
[ "from collections import defaultdict\nfrom typing import List, Optional, Tuple, Union\n\nimport numpy as np\nimport torch\nfrom mmcv.utils import print_log\n\nfrom mmhuman3d.core.conventions.keypoints_mapping import (\n agora,\n coco,\n coco_wholebody,\n crowdpose,\n gta,\n h36m,\n human_data,\...
[ [ "numpy.where", "numpy.ones", "numpy.take" ] ]
chriski777/graph_algorithms
[ "c844e62fa1528b962163b510dc3029344e8caa25" ]
[ "bounds.py" ]
[ "import random\nimport numpy as np\nfrom scipy.sparse.csgraph import minimum_spanning_tree\n\nclass Bounds:\n\tdef __init__(self, nodeDict, adjMatrix):\n\t\tself.nodeDict = nodeDict\n\t\tself.adjMatrix = adjMatrix\n\t\tself.counts = len(nodeDict)\n\t\tself.edgeDict = {}\n\t\tfor i in range(self.counts):\n\t\t\tfor ...
[ [ "numpy.delete", "numpy.array", "numpy.zeros", "numpy.sum", "numpy.nonzero", "scipy.sparse.csgraph.minimum_spanning_tree" ] ]
CHEN-yongquan/RL-Meta-Learning-ACTA
[ "57e782af548c15b4067c3ea48fc278cfe63ee43e", "57e782af548c15b4067c3ea48fc278cfe63ee43e" ]
[ "Lidar_models/altimeter_pointing_t.py", "RL_lib/Agents/PPO/policy_drdv_pulsed.py" ]
[ "\n\nimport numpy as np\nimport attitude_utils as attu\n\nclass Altimeter(object):\n def __init__(self, measurement_model, target_position, pointing_position, dphi=0.0, theta=np.pi/8, nbeams=4, attitude_parameterization=attu.Quaternion_attitude()):\n self.measurement_model = measurement_model\n s...
[ [ "numpy.sin", "numpy.linalg.norm", "numpy.asarray", "numpy.cos", "numpy.all", "numpy.linspace" ], [ "numpy.dot", "numpy.linalg.norm", "numpy.zeros", "numpy.roots", "numpy.real", "numpy.imag", "numpy.squeeze", "numpy.expand_dims" ] ]
gogasca/ai-platform-samples-1
[ "8f26907d62b3470f6850ffe0c2e1dff05d607b7f" ]
[ "training/horovod/base/horovod_wrapper.py" ]
[ "import collections\nimport datetime\nimport json\nimport multiprocessing\nimport os\nimport subprocess\nimport sys\nimport time\n\n_SSHD_BINARY_PATH = \"/usr/sbin/sshd\"\n\nEnvironmentConfig = collections.namedtuple(\n \"EnvironmentConfig\",\n [\"hosts\", \"port\", \"is_chief\", \"pools\", \"job_id\"])\n\n\n...
[ [ "tensorflow.python.client.device_lib.list_local_devices" ] ]
gmbrandt/echelle
[ "7e6678cd541ccf025fc187eca7f1344efe85f265" ]
[ "xwavecal/utils/blaze_utils.py" ]
[ "import numpy as np\n\n\ndef normalize_orders(image_data, trace, half_window=10, n=100):\n \"\"\"\n :param image_data: numpy.ndarray\n :param trace: xwavecal.utils.trace_utils.Trace\n :param half_window: int\n the number of pixels above an below a diffraction order to try and norm...
[ [ "numpy.max", "numpy.ones_like", "numpy.isclose", "numpy.min", "numpy.arange", "numpy.sort" ] ]
parasol-ppl/PPL_utils
[ "0be7584eee07e81dd77087808d53fa077128803c" ]
[ "bullet/setup.py" ]
[ "\nfrom setuptools import find_packages\nfrom sys import platform as _platform\nimport sys\nimport glob\n\nfrom distutils.core import setup\nfrom distutils.extension import Extension\nfrom distutils.util import get_platform\nfrom glob import glob\n\n#see http://stackoverflow.com/a/8719066/295157\nimport os\n\n\npla...
[ [ "numpy.get_include" ] ]
ankit-1517/NER-with-Bi-LSTM
[ "3dfa65c19b0131034a9766e136b7c9492f365979" ]
[ "test_ner.py" ]
[ "from ner_test_glove_random import *\nfrom ner_test_char import *\nimport sys\nimport contextlib\nimport numpy as np\nimport pandas as pd\nimport torch\nimport torch.nn as nn\nfrom torch.utils.data import Dataset, DataLoader\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom ...
[ [ "torch.device", "torch.cuda.is_available" ] ]
KuangenZhang/StructuredRL
[ "9b05e5034ff0e045aabf83786efb0859f08e989a" ]
[ "code/envs/cheetah_mujoco.py" ]
[ "from gym import utils, error, spaces\nfrom gym.envs.mujoco import mujoco_env\nfrom envs.controller import ImControl\nimport shutil\nimport os\nimport numpy as np\n\ntry:\n import mujoco_py\nexcept ImportError as e:\n raise error.DependencyNotInstalled(\"{}. (HINT: you need to install mujoco_py, and also perf...
[ [ "numpy.square", "numpy.asarray", "numpy.zeros", "numpy.copy", "numpy.ones", "numpy.random.uniform", "numpy.arange", "numpy.abs", "numpy.clip", "numpy.deg2rad" ] ]
liulixiang1988/data-science-learning
[ "3ddc3bdb134773f4333b4d717b3cf73f2e79e2c5" ]
[ "doing-math-with-python/universal_gravitation.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nNewton's law of Universal Gravitation\n\n@author: liulixiang\n\"\"\"\n\nimport matplotlib.pyplot as plt\n\n\n# Draw the graph\ndef draw_graph(x, y):\n plt.plot(x, y, marker='o')\n plt.xlabel('Distance in meters')\n plt.ylabel('Gravitational force in newtons')\n plt.titl...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
AttPyramid/nips2021
[ "bd5a0ade35c7d0fa47e7122cca6b7092bb90af01" ]
[ "common_attention/attention/attention.py" ]
[ "from torch import FloatTensor\nfrom torch.autograd import Variable\nfrom torch.nn.functional import sigmoid, softmax\n\n\ndef mask3d(value, sizes):\n \"\"\"Mask entries in value with 0 based on sizes.\n\n Args\n ----\n value: Tensor of size (B, N, D)\n Tensor to be masked. \n sizes: list of i...
[ [ "torch.autograd.Variable", "torch.nn.functional.sigmoid", "torch.nn.functional.softmax" ] ]
VincentStimper/nsf
[ "6bde505639ebcb67bffa227ea0021e3de235e03d" ]
[ "neural_spline_flows/nde/transforms/svd_test.py" ]
[ "import torch\nimport unittest\n\nfrom neural_spline_flows import utils\n\nfrom neural_spline_flows.nde.transforms import svd\nfrom neural_spline_flows.nde.transforms.transform_test import TransformTest\n\n\nclass SVDLinearTest(TransformTest):\n\n def setUp(self):\n self.features = 3\n self.transfo...
[ [ "torch.exp", "torch.inverse", "torch.randn" ] ]
dyollb/nnUNet-1
[ "3de9beb473957f10ca8aae283f5fabb1e812a7f9", "3de9beb473957f10ca8aae283f5fabb1e812a7f9" ]
[ "nnunet/evaluation/model_selection/ensemble.py", "nnunet/training/network_training/nnUNetTrainerV2_DDP.py" ]
[ "# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany\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# ...
[ [ "numpy.load", "numpy.mean" ], [ "torch.distributed.get_world_size", "torch.cuda.amp.autocast", "numpy.load", "numpy.mean", "torch.cuda.is_available", "torch.distributed.init_process_group", "torch.manual_seed", "numpy.prod", "torch.distributed.get_rank", "torch....
Joonkkyo/KoBART-translation-for-IPU
[ "cc098f39fd71ee35d2b3a278de91a823ff4c5cb1" ]
[ "torchlight_test.py" ]
[ " # Copyright (c) 2021 Graphcore Ltd. All rights reserved.\nimport pytorch_lightning as pl\n\nimport torch\n\nimport torchvision\nimport torchvision.transforms as transforms\n\nfrom simple_torch_model import SimpleTorchModel\n\n\n# This class shows a minimal lightning example. This example uses our own\n# Simpl...
[ [ "torch.stack", "torch.utils.data.DataLoader", "torch.nn.functional.nll_loss", "torch.argmax", "torch.sum" ] ]
persimmon-persimmon/rl-eight-puzzle
[ "e2d6cdb6280f15df7104ae7cf207365f909001bd" ]
[ "trainer_agent/q_learning_nn_agent.py" ]
[ "import sys\r\nimport os\r\ncurrent_dir=os.path.dirname(__file__)\r\nsys.path.append(os.path.join(current_dir,\"../\"))\r\nimport json\r\nimport random\r\nfrom collections import deque,defaultdict\r\nimport numpy as np\r\nfrom square_puzzle import SquarePuzzle\r\nfrom sklearn.neural_network import MLPRegressor\r\nf...
[ [ "numpy.max", "numpy.array", "numpy.random.uniform", "sklearn.neural_network.MLPRegressor", "sklearn.pipeline.Pipeline", "sklearn.preprocessing.OneHotEncoder", "numpy.vstack" ] ]
JasonKraft/CVFall2017
[ "995c59fcf38186458daa15ad1c816b7ce19581fe" ]
[ "hw3/problem2.py" ]
[ "# 1. Select 4 bounding boxes around each dot\n# 2. For each frame:\n# a. search some radius around the bounding box\n# b. select a new bounding box from your search such that the SDD is minimized\n# c. compute projective transformation based on the centers of each bounding box\n# d. warp an image u...
[ [ "numpy.sum", "numpy.array", "numpy.zeros" ] ]
CubeSkyy/ILU-RL
[ "676d88587e1d8638487de1b5a3f8785a7375ad1a" ]
[ "ilurl/utils/tf2_savers.py" ]
[ "\"\"\"\n tf2_savers.py\n\"\"\"\nimport pickle\nfrom typing import Mapping, Union\n\nimport tensorflow as tf\nfrom acme import core\n\nPythonState = tf.train.experimental.PythonState\nCheckpointable = Union[tf.Module, tf.Variable, PythonState] \n\n\nclass Saver:\n \"\"\"\n Convenience class to save tf....
[ [ "tensorflow.train.Checkpoint" ] ]
zxcayumi/pygcn
[ "b30cbcc92f74b0846bb758a0de684f774b95cad2" ]
[ "pygcn/layers.py" ]
[ "import math\n\nimport torch\n\nfrom torch.nn.parameter import Parameter\nfrom torch.nn.modules.module import Module\n\n\nclass GraphConvolution(Module):\n \"\"\"\n Simple GCN layer, similar to https://arxiv.org/abs/1609.02907\n \"\"\"\n\n def __init__(self, in_features, out_features, bias=True):\n ...
[ [ "torch.spmm", "torch.FloatTensor", "torch.mm" ] ]
lab11/Task2
[ "3c3451599dd303cd1e2469e5b9e36e1b4ca49fa6" ]
[ "simulator/scripts/simulate.py" ]
[ "#! /usr/bin/env python3\nimport yaml\nimport pandas as pd\nimport numpy as np\nimport math\nimport datetime\nfrom pympler import tracker\nfrom pprint import pprint\nfrom datetime import datetime\nimport matplotlib.pyplot as plt\nimport time\n\nnp.random.seed(42)\n\nSECONDS_IN_YEAR = 60*60*24*365\nSECONDS_IN_DAY = ...
[ [ "numpy.random.seed", "numpy.random.poisson", "numpy.load", "numpy.timedelta64", "numpy.random.random" ] ]
srinivasputta/ngraph
[ "7506133fff4a8e5c25914a8370a567c4da5b53be" ]
[ "python/test/ngraph/test_normalization.py" ]
[ "# ******************************************************************************\n# Copyright 2018 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:...
[ [ "numpy.array", "numpy.prod" ] ]
naltun/sunpy
[ "0f3a1a42deedc05a525200ddf3e5e2415a5cc9be" ]
[ "sunpy/coordinates/frames.py" ]
[ "\"\"\"\nCommon solar physics coordinate systems.\n\nThis submodule implements various solar physics coordinate frames for use with\nthe `astropy.coordinates` module.\n\"\"\"\nfrom contextlib import contextmanager\n\nimport numpy as np\n\nimport astropy.units as u\nfrom astropy.coordinates import ConvertError, Quan...
[ [ "numpy.errstate", "numpy.sqrt", "numpy.fmin", "numpy.cos" ] ]
angelvillar96/Deep-Learning-from-Scratch
[ "9632b426a708926df3e0b123d5a5f333ab4564ba" ]
[ "lib/layers/FullyConnected.py" ]
[ "\"\"\"\nImplementation of a fully connected (FC) layer\n\n@author: Angel Villar-Corrales\n\"\"\"\n\nimport numpy as np\n\n\nclass FullyConnected:\n \"\"\"\n Class corresponding to a fully connected layer of a neural network\n\n Args:\n -----\n input_size: integer\n number of inputs connection...
[ [ "numpy.concatenate", "numpy.ones", "numpy.random.rand", "numpy.matmul" ] ]
slac-lcls/pdsdata2
[ "6e2ad4f830cadfe29764dbd280fa57f8f9edc451", "6e2ad4f830cadfe29764dbd280fa57f8f9edc451" ]
[ "psana/psana/dgrammanager.py", "psdaq/psdaq/configdb/epixquad_config.py" ]
[ "import sys, os\nimport time\nimport getopt\nimport pprint\n\ntry:\n # doesn't exist on macos\n from shmem import PyShmemClient\nexcept:\n pass\nfrom psana import dgram\nfrom psana.event import Event\nfrom psana.detector import detectors\nfrom psana.psexp.event_manager import TransitionId\nimport numpy as ...
[ [ "numpy.array", "numpy.asarray" ], [ "numpy.array", "numpy.reshape", "numpy.zeros", "numpy.nonzero", "numpy.unique" ] ]
TParcollet/speechbrain
[ "34ade3fbf22ac1e470599df856ca0cec9a08874f" ]
[ "recipes/AMI/Diarization/experiment.py" ]
[ "#!/usr/bin/python3\n\"\"\"This recipe implements diarization baseline\nusing deep embedding extraction followed by spectral clustering.\n\nTo run this recipe, do the following:\n> python experiment.py hyperparams.yaml\n\nCondition: Oracle VAD\n\nNote: There are multiple ways to write this recipe. We chose to itera...
[ [ "numpy.concatenate", "numpy.array", "numpy.empty", "numpy.random.seed", "torch.no_grad", "torch.ones", "numpy.arange", "torch.load" ] ]
yasersharaf/dlrm
[ "98fb60f150edc3a59facd47e47c01e51094f59c4" ]
[ "dlrm_data_pytorch.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n#\n# Description: generate inputs and targets for the dlrm benchmark\n# The inpts and outputs are generated according to the following...
[ [ "numpy.random.rand", "numpy.set_printoptions", "numpy.load", "numpy.min", "numpy.random.random", "numpy.concatenate", "numpy.max", "torch.tensor", "numpy.mod", "numpy.array", "numpy.round", "numpy.fromfile", "numpy.array_split", "numpy.ceil", "numpy.rand...
sesem738/Calamari
[ "f3e16682901138c5ee8bb5e94b335bfaee36afad" ]
[ "src/model.py" ]
[ "# 12 channel : 3 lidar + 9 rgb\n\n\nimport torch\nfrom torch import nn\nfrom torch._C import device \nimport torch.nn.functional as F\n\nclass Network(nn.Module):\n def __init__(self, alpha, input_dim, output_dim, name='online', checkpoint='checkpoints/dqn'):\n super(Network, self).__init__()\n \n...
[ [ "torch.nn.Linear", "torch.device", "torch.cat", "torch.tensor_split", "torch.nn.Conv2d", "torch.load", "torch.flatten" ] ]
iosetek/CommandRecognition
[ "56a58b44bdc4d54feafc955c17dd0ff236486cae", "56a58b44bdc4d54feafc955c17dd0ff236486cae" ]
[ "src/gaussian.py", "src/mfccphrase.py" ]
[ "from src.diagonal_multivariate import DiagonalMultivariateNormal\nimport random\nimport numpy as np\nfrom bigfloat import BigFloat\n\nclass Gaussian:\n \"\"\"\n Gaussian object is simple representation of ND gauss distribution.\n \"\"\"\n def __init__(self, mean, cov):\n self.__mean = mean\n ...
[ [ "numpy.array" ], [ "numpy.array" ] ]
LaurantChao/VIP
[ "1f0d3a1e454c25b3bd97235df41bfbe6e03e4ddc" ]
[ "VIP_fun_speedup_recon_alpha_classic_validate.py" ]
[ "import numpy as np\r\nfrom matplotlib.pylab import pcolor\r\nimport pandas as pd\r\nimport matplotlib.pyplot as plt\r\nimport tensorflow as tf\r\nimport time\r\n#### clear variables and ops and everything from TF\r\ntf.reset_default_graph() \r\n\r\nn_train = x_train.shape[1]\r\n\r\nn_test = x_test.shape[1]\r\n\r\n...
[ [ "tensorflow.constant_initializer", "tensorflow.matmul", "tensorflow.tile", "tensorflow.global_variables_initializer", "tensorflow.linalg.trace", "tensorflow.random_normal_initializer", "numpy.concatenate", "tensorflow.set_random_seed", "numpy.random.normal", "numpy.log", ...
sstillger/QuantEcon.py
[ "80a42f5be5f5066c982d777d515d3f30a13124d1" ]
[ "quantecon/util/timing.py" ]
[ "\"\"\"\nProvides Matlab-like tic, tac and toc functions.\n\n\"\"\"\nimport time\nimport numpy as np\n\n\nclass __Timer__:\n \"\"\"Computes elapsed time, between tic, tac, and toc.\n\n Methods\n -------\n tic :\n Resets timer.\n toc :\n Returns and prints time elapsed since last tic().\...
[ [ "numpy.empty", "numpy.sort" ] ]
KyleGoyette/pytorch-lightning
[ "d6470bf1937e51e037a7f94a55ad76898e5ae103" ]
[ "tests/plugins/test_cluster_integration.py" ]
[ "import os\nfrom unittest import mock\n\nimport pytest\nimport torch\n\nfrom pytorch_lightning import Trainer\nfrom pytorch_lightning.plugins import DDP2Plugin, DDPPlugin, DDPShardedPlugin, DeepSpeedPlugin, RPCSequentialPlugin\nfrom pytorch_lightning.plugins.environments import LightningEnvironment, SLURMEnvironmen...
[ [ "torch.device" ] ]
jbueltemeier/pystiche_papers
[ "d162c2db87251f9e3280fea35cf149d030dc335b" ]
[ "pystiche_papers/johnson_alahi_li_2016/_data.py" ]
[ "from typing import Optional, Sized, Tuple\nfrom urllib.parse import urljoin\n\nimport torch\nfrom torch.utils.data import DataLoader, Dataset, Sampler\n\nimport pystiche.image.transforms.functional as F\nfrom pystiche import image\nfrom pystiche.data import (\n DownloadableImage,\n DownloadableImageCollectio...
[ [ "torch.utils.data.DataLoader" ] ]
Combatd/Intro_to_Machine_Learning
[ "b40deb7705431fe2537f873e434ab4d0304e723a" ]
[ "GaussianNB_Terrain/ClassifyNB.py" ]
[ "def classify(features_train, labels_train): \n ### import the sklearn module for GaussianNB\n ### create classifier\n ### fit the classifier on the training features and labels\n ### return the fit classifier\n \n \n from sklearn.naive_bayes import GaussianNB\n clf = GaussianNB()\n clf...
[ [ "sklearn.naive_bayes.GaussianNB" ] ]
NunoEdgarGFlowHub/aqua
[ "5c35227db9535c98447cfc5861e2ba3418e619bf" ]
[ "test/test_svm_qkernel.py" ]
[ "# -*- coding: utf-8 -*-\n\n# Copyright 2018 IBM.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli...
[ [ "numpy.testing.assert_array_almost_equal", "numpy.asarray" ] ]
ageron/keras-tuner
[ "003559cc82bc82b01480c85e51568cd4d3e5ca86" ]
[ "tests/unit_tests/tuners/randomsearch_test.py" ]
[ "# Copyright 2019 The KerasTuner 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# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable la...
[ [ "tensorflow.keras.layers.Dense", "numpy.ones", "tensorflow.keras.Sequential" ] ]
njanirudh/coding_task_make-a-model
[ "12fa64ff6d7846c74624cc9856921f2aaba5c275" ]
[ "src/pidata/pidata/pi_parser.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n# This file is covered by the LICENSE file in the root of this project.\n\nfrom __future__ import annotations\n\nimport pathlib\nimport typing\n\nimport cv2\nimport numpy as np\n\nfrom piutils.piutils import pi_log\nfrom . import pi_dataset\nfrom . import pi_transfo...
[ [ "numpy.max", "numpy.concatenate", "numpy.clip", "numpy.isin", "numpy.sin", "numpy.asarray", "numpy.zeros", "numpy.random.RandomState", "numpy.ceil", "numpy.round", "numpy.sqrt", "numpy.absolute", "numpy.unique", "numpy.floor" ] ]
glentner/pybench
[ "ec130d44cb1b306ec611528f728ff611cf003b31" ]
[ "pybench/logdata.py" ]
[ "# SPDX-FileCopyrightText: 2021 Geoffrey Lentner\n# SPDX-License-Identifier: Apache-2.0\n\n\"\"\"Specification for LogRecord and LogData structures.\"\"\"\n\n\n# type annotations\nfrom __future__ import annotations\nfrom typing import List, Union, IO, Tuple\n\n# standard libs\nfrom collections import defaultdict\nf...
[ [ "pandas.DataFrame" ] ]
jp-nerdery/chainermn
[ "cf07282ccf538bfafc9d63d905cf372b3220f403" ]
[ "tests/chainermn_tests/iterators_tests/test_multi_node_iterator.py" ]
[ "import chainer\nimport chainer.testing\nimport chainer.testing.attr\nimport chainermn\nfrom chainermn.iterators.multi_node_iterator import _build_ctrl_msg\nfrom chainermn.iterators.multi_node_iterator import _parse_ctrl_msg\nimport numpy as np\nimport platform\nimport pytest\nfrom six.moves import range\nimport un...
[ [ "numpy.arange", "numpy.copyto", "numpy.roll", "numpy.asarray" ] ]
mmlab-cv/Group-Obstacle-LSTM
[ "fa653e4ef0728438316c6b34eb747b94906ccca1" ]
[ "social-lstm-pytorch-group/social_lstm/sample.py" ]
[ "'''\nTest script for the Social LSTM model\n\nAuthor: Anirudh Vemula\nDate: 14th June 2017\n'''\n\nimport os\nimport pickle\nimport os\nimport pickle\nimport argparse\nimport time\n\nimport torch\nfrom torch.autograd import Variable\n\nimport numpy as np\nfrom utils import DataLoader\nfrom st_graph import ST_GRAPH...
[ [ "torch.zeros", "torch.from_numpy", "torch.LongTensor", "torch.load", "torch.index_select" ] ]
Abhishek856/tensorboard
[ "ff8619825fff6f7c14282360adf92a985ed6e2c2" ]
[ "tensorboard/util.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.logging.set_verbosity", "tensorflow.compat.as_text" ] ]
TheShadow29/vognet-pytorch
[ "238e93c37cf9f03a2fd376a14760bb3d334a113d" ]
[ "dcode/preproc_ds_files.py" ]
[ "\"\"\"\nPreprocess dataset files\n\"\"\"\n\nimport json\nimport pandas as pd\nfrom pathlib import Path\nfrom tqdm import tqdm\nimport yaml\nfrom yacs.config import CfgNode as CN\nimport numpy as np\nimport ast\nfrom collections import Counter\nfrom torchtext import vocab\nimport pickle\nfrom munch import Munch\n\n...
[ [ "numpy.random.rand", "numpy.zeros", "numpy.random.seed", "pandas.DataFrame", "pandas.read_csv" ] ]
zipzou/captcha-recognition
[ "05b43461f37925d7e0f228ca183d2288e007ca0a" ]
[ "src/data.py" ]
[ "import os\nimport numpy as np\n\nfrom sklearn.model_selection import train_test_split\n\ndef get_data(path):\n \"\"\"\n Get images name in path\n :param path: the path to save images\n :return: image list filled with names and their labels.\n \"\"\"\n image_names = os.listdir(path)\n image_names = [name for...
[ [ "numpy.array", "numpy.sum", "numpy.load", "numpy.save", "sklearn.model_selection.train_test_split" ] ]
wonkyunglee/MPNet
[ "3a6821a88a5e3db5bd97121761dbb361d9518bc2" ]
[ "networks/pspnet.py" ]
[ "import torch.nn as nn\nfrom torch.nn import functional as F\nimport math\nimport torch.utils.model_zoo as model_zoo\nimport torch\nimport numpy as np\nfrom torch.autograd import Variable\naffine_par = True\nimport functools\n\nimport sys, os\nfrom utils.pyt_utils import load_model\n\n#from inplace_abn import InPla...
[ [ "torch.cat", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d", "torch.nn.Dropout2d" ] ]
Laezerus/FeatureTools
[ "aaa84e3634988b2e6d2c528ff240a397655024d7" ]
[ "featuretools/tests/primitive_tests/test_agg_feats.py" ]
[ "from datetime import datetime\nfrom inspect import isclass\nfrom math import isnan\n\nimport numpy as np\nimport pandas as pd\nimport pytest\nfrom woodwork.column_schema import ColumnSchema\nfrom woodwork.logical_types import Datetime\n\nimport featuretools as ft\nfrom featuretools.entityset.relationship import Re...
[ [ "pandas.isnull", "numpy.array", "numpy.nan_to_num", "pandas.DatetimeIndex", "pandas.DataFrame", "pandas.DateOffset", "pandas.Timestamp", "numpy.append", "pandas.Series" ] ]
edwardyehuang/iSeg
[ "256b0f7fdb6e854fe026fa8df41d9a4a55db34d5" ]
[ "core_train.py" ]
[ "# ================================================================\n# MIT License\n# Copyright (c) 2021 edwardyehuang (https://github.com/edwardyehuang)\n# ================================================================\n\nimport tensorflow as tf\nimport numpy as np\nimport math\n\nfrom iseg.metrics.mean_iou impo...
[ [ "tensorflow.keras.callbacks.TensorBoard" ] ]
harshraj22/DeepLearnin
[ "f3cc646e6d4cdca59251e6da099942d66cbed0b8" ]
[ "implementations/SAN/utils/dataset.py" ]
[ "from torch.utils.data import Dataset, DataLoader\nfrom tqdm.autonotebook import tqdm\nimport torch\nfrom PIL import Image\nimport numpy as np\nfrom torch.nn.utils.rnn import pad_sequence\n\n\"\"\"\nWrite your own dataset here.\nThe __getitem__ method must return a dict with the following key, value pairs:\n 'qu...
[ [ "numpy.array", "torch.nn.utils.rnn.pad_sequence", "torch.from_numpy", "torch.tensor", "numpy.moveaxis" ] ]
arthurdjn/pysnake
[ "1d66644529804ee50a296b141123eba328f68a8e" ]
[ "pysnake/io.py" ]
[ "# -*- coding: utf-8 -*-\n# Created on Fri Mar 6 00:00:43 2020\n# @author: arthurd\n\n\n# Useful packages\nimport os\nimport json\nimport numpy as np\n# PySnake modules\nfrom pysnake.snake import Snake\nimport pysnake.game\nfrom pysnake.gen.population import Population\n\n\n\ndef open_files(dir_path, ext=\"json\")...
[ [ "numpy.array" ] ]
andrewrowell/PyStocks
[ "62a1317230a929724dff4538347d4923222c3077" ]
[ "PyStockTools.py" ]
[ "from flask import Flask\nfrom flask import request\nfrom flask import Response\nfrom flask import jsonify\nimport datetime\nimport matplotlib.pyplot as plt\nimport mpld3\nimport Data as Data\nimport json\n\napp = Flask(__name__)\n\nDATE_FORMAT = \"%Y-%m-%d\"\n\n\n@app.route('/')\ndef home():\n return \"Home Pag...
[ [ "matplotlib.pyplot.plot", "matplotlib.pyplot.figure" ] ]
NPAPENBURG/DS33-Unit-2-Project
[ "36d669b53aab36b2e78c3653a61e919b24d557fb" ]
[ "pages/predictions.py" ]
[ "# Imports from 3rd party libraries\nimport dash\nimport dash_bootstrap_components as dbc\nimport dash_core_components as dcc\nimport dash_html_components as html\nfrom dash.dependencies import Input, Output\nimport pandas as pd\nfrom joblib import load\n# Imports from this application\nfrom app import app\n\n\nwit...
[ [ "pandas.DataFrame" ] ]
TrafalgarLaw-24/Disaster-Response-Project
[ "5c9d4a8b9bfdf88b6a3a0537417e1498641d7d64" ]
[ "app/run.py" ]
[ "import json\nimport plotly\nimport pandas as pd\n\nfrom nltk.stem import WordNetLemmatizer\nfrom nltk.tokenize import word_tokenize\n\nfrom flask import Flask\nfrom flask import render_template, request, jsonify\nfrom plotly.graph_objs import Bar\nfrom sklearn.externals import joblib\nfrom sqlalchemy import create...
[ [ "sklearn.externals.joblib.load", "pandas.read_sql_table" ] ]
MPoL-dev/mpoldatasets
[ "bffe95a1f3cbce70d8a0ee308ac4290731309f95" ]
[ "scripts/plot_spectral_windows.py" ]
[ "#!/usr/bin/env python3\n\nfrom visread import examine\nimport os\nimport matplotlib.pyplot as plt\nimport argparse\n\n\ndef plot_raw(fname):\n # make a pre-scaled directory\n noscaledir = \"rawscaled\"\n if not os.path.exists(noscaledir):\n os.makedirs(noscaledir)\n\n for spw in examine.get_uniq...
[ [ "matplotlib.pyplot.close" ] ]
indisoluble/amazon-braket-default-simulator-python
[ "4eda298a62d2094a00f7f9894a07af1c483d5e16" ]
[ "src/braket/default_simulator/simulation_strategies/single_operation_strategy.py" ]
[ "# Copyright 2019-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n# may not use this file except in compliance with the License. A copy of\n# the License is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in th...
[ [ "numpy.tensordot", "numpy.transpose", "numpy.argsort" ] ]
asuszko/pycu_interface
[ "2cca149b4d683a7c3d3fbfca6fa1074fc72cb308", "2cca149b4d683a7c3d3fbfca6fa1074fc72cb308" ]
[ "uni_ptr.py", "shared.py" ]
[ "# -*- coding: utf-8 -*-\n__all__ = [\n \"Unified_Ptr\",\n]\n\nfrom ctypes import cast, c_void_p\nfrom functools import reduce\nfrom operator import mul\nimport numpy as np\nimport warnings\n\nfrom cuda_helpers import (cu_conj,\n cu_free,\n cu_iadd_val,\n ...
[ [ "numpy.ctypeslib.ndpointer", "numpy.dtype" ], [ "numpy.array" ] ]
JulienMaille/segmentation_models.pytorch
[ "4b18a48c14e05fe33ab13bd473195ef151d76e5e", "4b18a48c14e05fe33ab13bd473195ef151d76e5e" ]
[ "segmentation_models_pytorch/fpn/decoder.py", "segmentation_models_pytorch/encoders/timm_resnest.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass Conv3x3GNReLU(nn.Module):\n def __init__(self, in_channels, out_channels, upsample=False):\n super().__init__()\n self.upsample = upsample\n self.block = nn.Sequential(\n nn.Conv2d(\n i...
[ [ "torch.cat", "torch.nn.Sequential", "torch.nn.functional.interpolate", "torch.nn.GroupNorm", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.Dropout2d" ], [ "torch.nn.Sequential", "torch.nn.Identity" ] ]
uncbiag/neuro_shooting
[ "ebf80a9c0a4515fdfffaa0c5418dc866e2776495" ]
[ "tests/autograd_gradient_test.py" ]
[ "# the goal of this script is to use a simple affine model and check if the gradients are computed correctly\n\n\nimport random\nseed = 1234\nprint('Setting the random seed to {:}'.format(seed))\nrandom.seed(seed)\nimport torch\ntorch.manual_seed(seed)\n\nimport neuro_shooting.shooting_blocks as shooting_blocks\nim...
[ [ "torch.manual_seed", "torch.randn", "torch.all", "torch.abs", "torch.mean" ] ]
felixwzh/DialoGPT
[ "11db966dc85e1de5a623690b0e430ca3c95fef49" ]
[ "code/gpt_decoder.py" ]
[ "import os\nimport torch\nimport torch.nn.functional as F\nfrom transformers import GPT2Tokenizer, GPT2LMHeadModel, GPT2Config\nimport argparse\nfrom tqdm.auto import tqdm\nfrom pathlib import Path\n\ndef reinput(text):\n\t# global conditioned_tokens\n\t# os.system('cls' if os.name == 'nt' else 'clear')\n\tconditio...
[ [ "torch.no_grad", "torch.multinomial", "torch.tensor", "torch.load", "torch.nn.functional.softmax", "torch.sort" ] ]
Ludaxord/ConceptEngine
[ "16775bc9b518d4fd4c8bd32bb5f297223dfacbae" ]
[ "api/upscalers/dlss/prototype/tools/utils.py" ]
[ "import re\nimport pandas as pd\nfrom tensorflow.python.keras.losses import binary_crossentropy\nfrom keras import backend as K\n\n\ndef digits_only(digit):\n try:\n replaced = re.findall('[0-9]+', digit)\n # replaced = re.sub(\"(?<=^|)\\d+(\\.\\d+)?(?=$| )|(?<=^|)\\.\\d+(?=$| )\", '', digit)\n ...
[ [ "pandas.option_context", "pandas.reset_option" ] ]
dlvp/madminer
[ "4ae7d9b73452848a6c9d1b81b50ef316ff7a054f" ]
[ "madminer/utils/ml/ratio_trainer.py" ]
[ "from __future__ import absolute_import, division, print_function, unicode_literals\n\nimport numpy as np\nimport logging\nimport torch\nfrom torch import tensor\nimport torch.optim as optim\nfrom torch.utils.data import TensorDataset, DataLoader\nfrom torch.utils.data.sampler import SubsetRandomSampler\nfrom torch...
[ [ "torch.device", "numpy.array", "numpy.zeros", "torch.no_grad", "numpy.random.shuffle", "numpy.save", "torch.from_numpy", "torch.cuda.is_available", "torch.tensor", "torch.utils.data.DataLoader", "torch.mean", "torch.utils.data.sampler.SubsetRandomSampler", "torc...
AbdallahOmarAhmed/Image-Compression
[ "69586e092d0f636b7aec1212726b1f0031ea7b4b" ]
[ "model.py" ]
[ "import torch\nfrom torch import nn\nfrom pytorch_lightning.core.lightning import LightningModule\nfrom torch.optim import Adam, lr_scheduler\nfrom torchjpeg import quantization, dct, metrics\nimport warnings\nfrom dataset import img_size\n\nwarnings.filterwarnings('ignore')\nbatch_size = 14\nlearning_rate = 0.001\...
[ [ "torch.round", "torch.cat", "torch.isnan", "torch.optim.lr_scheduler.CosineAnnealingLR", "torch.nn.LeakyReLU", "torch.nn.L1Loss", "torch.nn.PixelShuffle", "torch.nn.Conv2d", "torch.tensor", "torch.nn.Dropout2d" ] ]
ahmadki/nvtx-plugins
[ "a5d47ba6cb0548f2a6c15814d409a14aca4d33f8" ]
[ "examples/tf_session_example.py" ]
[ "# -*- coding: utf-8 -*-\n\n# Copyright (c) 2019, NVIDIA CORPORATION. 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/L...
[ [ "tensorflow.train.MomentumOptimizer", "numpy.random.shuffle", "tensorflow.nn.sigmoid_cross_entropy_with_logits", "numpy.loadtxt", "tensorflow.placeholder", "tensorflow.train.MonitoredSession", "tensorflow.layers.dense", "tensorflow.local_variables_initializer", "tensorflow.nn.s...
llach/baselines
[ "22e72ad9d4c9bc61e98186d6dcb09bf53892a8c2" ]
[ "baselines/a2c/a2c.py" ]
[ "import time\nimport json\nimport functools\nimport datetime\nimport numpy as np\nimport tensorflow as tf\n\nfrom baselines import logger\n\nfrom baselines.common import set_global_seeds, explained_variance\nfrom baselines.common import tf_util, colorize\nfrom baselines.common.policies import build_policy\n\nfrom f...
[ [ "tensorflow.summary.histogram", "tensorflow.train.RMSPropOptimizer", "tensorflow.clip_by_global_norm", "tensorflow.gradients", "numpy.mean", "numpy.any", "tensorflow.variable_scope", "tensorflow.placeholder", "tensorflow.squeeze", "numpy.clip", "tensorflow.summary.merge...
kperrynrel/pvanalytics
[ "78f516a10511b13f5caaf333c4ac8f7070732ff4" ]
[ "docs/examples/hampel-outlier-detection.py" ]
[ "\"\"\"\nHampel Outlier Detection\n========================\n\nIdentifying outliers in time series using\nHampel outlier detection.\n\"\"\"\n\n# %%\n# Identifying and removing outliers from PV sensor time series\n# data allows for more accurate data analysis.\n# In this example, we demonstrate how to use\n# :py:fun...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.legend", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "pandas.read_csv" ] ]
elkysandor/IML.HUJI
[ "cb576d0e2cf2890f269143fdefe8fff5f149f4b6" ]
[ "IMLearn/learners/gaussian_estimators.py" ]
[ "from __future__ import annotations\nimport numpy as np\nfrom numpy.linalg import inv, det, slogdet\n\n\nclass UnivariateGaussian:\n \"\"\"\n Class for univariate Gaussian Distribution Estimator\n \"\"\"\n def __init__(self, biased_var: bool = False) -> UnivariateGaussian:\n \"\"\"\n Estim...
[ [ "numpy.cov", "numpy.log", "numpy.linalg.det", "numpy.apply_along_axis", "numpy.power", "numpy.sqrt", "numpy.linalg.inv" ] ]
wwha/CarND-Behavioral-Cloning-P3
[ "cfd1ade2c9f605e0a5f8d2925b302e1a0881aae0" ]
[ "model_generator.py" ]
[ "import os\nimport csv\nimport cv2\nimport numpy as np\nimport sklearn\nimport keras\nfrom keras.models import Sequential, Model\nfrom keras.layers import Flatten, Dense, Lambda\nfrom keras.layers.convolutional import Convolution2D, Cropping2D\nfrom keras.layers.pooling import MaxPooling2D\nimport matplotlib.pyplot...
[ [ "sklearn.model_selection.train_test_split", "numpy.array", "sklearn.utils.shuffle" ] ]
surajpaib/Size-Matters
[ "1be0ef00f660fe362ab8494c9b8e98d38f058f7a" ]
[ "experiments/Julian_ExperimentRunner.py" ]
[ "import sys\r\nimport logging\r\nimport time\r\nimport shutil\r\nimport string\r\nimport random\r\nimport os\r\n\r\nimport torch\r\nimport torchvision\r\nfrom torch.utils.tensorboard import SummaryWriter\r\nfrom sklearn.model_selection import KFold\r\n\r\nsys.path.append('framework')\r\nsys.path.append('application...
[ [ "torch.utils.data.ConcatDataset", "torch.cuda.manual_seed", "torch.manual_seed", "torch.cuda.is_available", "torch.utils.data.DataLoader", "sklearn.model_selection.KFold", "torch.utils.data.Subset", "torch.nn.CrossEntropyLoss" ] ]
Ian-Lo/DATA5703_Group09
[ "7609e9f489eb4314ba275a86b3eab06deb9a6b19" ]
[ "pytorch_django/main/models.py" ]
[ "import torch\nfrom torch import nn\nimport torchvision\n\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n\n\nclass Encoder(nn.Module):\n \"\"\"\n Encoder.\n \"\"\"\n\n def __init__(self, encoded_image_size=14):\n super(Encoder, self).__init__()\n self.enc_image...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.cat", "torch.nn.LSTMCell", "torch.nn.Softmax", "torch.nn.Sigmoid", "torch.nn.Sequential", "torch.nn.Parameter", "torch.nn.ReLU", "torch.cuda.is_available", "torch.nn.AdaptiveAvgPool2d", "torch.nn.Embedding" ] ]
tom-andersson/neuralprocesses
[ "7696dc1c8bbe922fb2a1ba18fe0cdda041fc9cfd" ]
[ "experiment/plot.py" ]
[ "import lab as B\nimport matplotlib.pyplot as plt\nimport neuralprocesses.torch as nps\nimport stheno\nimport torch\nfrom wbml.plot import tweak\n\n__all__ = [\"visualise\"]\n\n\ndef visualise(model, gen, *, path, config, predict=nps.predict):\n \"\"\"Plot the prediction for the first element of a batch.\"\"\"\n...
[ [ "matplotlib.pyplot.savefig", "torch.no_grad", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.pyplot.fill_between", "matplotlib.pyplot.axvline", "matplotlib.pyplot.gca", "matplotlib.pyplot.subplot" ] ...
Liang813/DEBAR
[ "1d7349db2fa97c58f251f0ceb647c279b33ffa51" ]
[ "dynamic_tool/TFNBUtils.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport math\n\ndef choose_max_batch(x_train, y_train, batch_size, grads, evaled, sess, feed_dict, additional):\n ret_x = None\n ret_y = None\n min_value = 1e20\n ix = None\n for i in range(0, len(x_train), batch_size):\n eval_grads = sess.run(grads...
[ [ "numpy.max", "numpy.array", "numpy.reshape", "numpy.zeros", "numpy.min", "numpy.arange", "numpy.clip", "numpy.squeeze" ] ]
ygrepo/learned-inverted-indexes
[ "af5b58b20f61a09b8b87c10066fc12fae1480e8e" ]
[ "src/quantization.py" ]
[ "from collections import OrderedDict\n\nimport numpy as np\nimport torch\n\nfrom model import ShallowNetwork\n\n\ndef quantize_tensor_as_numpy(x, num_bits=8):\n if len(x.shape) == 1 and x.shape[0] == 1:\n v = np.float32(x[0]).tobytes()\n return np.frombuffer(v, dtype=np.uint8)\n\n qmin = 0.\n ...
[ [ "torch.zeros", "numpy.append", "numpy.zeros", "torch.set_default_tensor_type", "numpy.float32", "numpy.frombuffer" ] ]
alexhbnr/CAZySQLite
[ "94bb4d4856301b0c353380b8f0d7ebf87e3db224" ]
[ "src/main.py" ]
[ "#!/usr/bin/env python\n########################################################################\n# Scrapes CAZy.org and converts data into SQLite3 database\n#\n# Alex Huebner, 25/03/2020\n########################################################################\n\nimport argparse\nimport os\nimport sqlite3\nimport ...
[ [ "pandas.concat" ] ]
OKaluza/napari
[ "95a6afbbdb54a530b1eaca23037b8f98c7c8b064", "95a6afbbdb54a530b1eaca23037b8f98c7c8b064" ]
[ "napari/tests/test_napari.py", "napari/layers/layer_utils.py" ]
[ "import numpy as np\nimport pytest\nimport napari\n\nfrom napari.tests.utils import (\n check_viewer_functioning,\n layer_test_data,\n view_layer_type,\n)\n\n\n@pytest.mark.parametrize('layer_type, data, ndim', layer_test_data)\ndef test_view(qtbot, layer_type, data, ndim):\n\n np.random.seed(0)\n vi...
[ [ "numpy.random.seed", "numpy.random.random" ], [ "numpy.max", "numpy.array", "numpy.linalg.norm", "numpy.min", "numpy.prod", "numpy.stack", "numpy.cross" ] ]
danich1/bayesian_changepoint_detection
[ "2ba96fd8556e0ab05c395bd5cbaaa5e5c335318f" ]
[ "bayesian_changepoint_detection/online_changepoint_detection.py" ]
[ "from __future__ import division\n\nimport numpy as np\nfrom numpy.linalg import inv\nfrom scipy import stats\nfrom itertools import islice\n\n\ndef online_changepoint_detection(data, hazard_func, observation_likelihood):\n maxes = np.zeros(len(data) + 1)\n\n R = np.zeros((len(data) + 1, len(data) + 1))\n ...
[ [ "numpy.concatenate", "numpy.array", "numpy.empty", "numpy.log", "numpy.sum", "numpy.ones", "matplotlib.pyplot.subplots", "numpy.identity", "numpy.sqrt", "numpy.linalg.inv", "numpy.expand_dims", "scipy.stats.multivariate_t.pdf" ] ]
vit-/pi-airmon
[ "23deb5c1b04bb9e76eff2765380195377af9e12b" ]
[ "airmon/app.py" ]
[ "import asyncio\nimport os\nimport time\nfrom copy import copy\n\nimport aiotg\nimport matplotlib\nmatplotlib.use('Agg') # noqa\n\nfrom airmon import const, forecast, storage, chart, date\nfrom airmon.storage.models import bind_db\n\n\nBOT_TOKEN = os.environ.get('TG_BOT_TOKEN')\nBOT_NAME = os.environ.get('TG_BOT_N...
[ [ "matplotlib.use" ] ]
xiaozw1994/EFDLS
[ "9eda931328a65dbc8408e89bda635e23097155ff" ]
[ "trainFedKD.py" ]
[ "import torch\nimport torchvision\nimport torchvision.transforms as transforms\nimport torch.utils.data.dataloader as dataloader\nfrom torch.utils.data import Subset,Dataset\nimport torch.nn as nn\nimport torch.optim as optim\nfrom torch.nn.parameter import Parameter\nimport numpy as np\nimport network as net\nfrom...
[ [ "torch.cuda.manual_seed_all", "torch.utils.data.dataloader.DataLoader", "torch.max", "numpy.random.seed", "torch.no_grad", "numpy.load", "torch.manual_seed", "torch.cuda.is_available", "numpy.argmax", "torch.load", "torch.nn.CrossEntropyLoss" ] ]
minority4u/coockiecutter-ds-mod
[ "25503f24d3bcd613871ce8e4a998c35f1693b111" ]
[ "{{ cookiecutter.repo_name }}/src/utils/Utils_io.py" ]
[ "import os, errno\nimport logging\nfrom time import time\nimport platform\n\nif not platform.system() == 'Windows':\n import matplotlib as mpl\n\n #mpl.use('TkAgg')\nimport matplotlib.pyplot as plt\nimport json\n\ndef show_available_gpus():\n \"\"\"\n Prints all GPUs and their currently BytesInUse\n ...
[ [ "tensorflow.python.client.device_lib.list_local_devices", "matplotlib.pyplot.close", "matplotlib.pyplot.tight_layout" ] ]
king4arabs/wsnsims2
[ "13d4c49ea2ae9de7ea42d4aaa8d117b3368cda20" ]
[ "wsnsims/focus/energy.py" ]
[ "import collections\nimport itertools\nimport logging\n\nimport numpy as np\n\nimport scipy.sparse.csgraph as sp\n\nfrom wsnsims.core.data import segment_volume\n\nlogger = logging.getLogger(__name__)\n\n\nclass FOCUSEnergyModelError(Exception):\n pass\n\n\nclass FOCUSEnergyModel(object):\n def __init__(self,...
[ [ "scipy.sparse.csgraph.breadth_first_order", "scipy.sparse.csgraph.csgraph_from_dense", "numpy.zeros", "scipy.sparse.csgraph.connected_components" ] ]
abcp4/pt.darts
[ "51acc1d8b5a11c98ee150f59f0cc57e67115d204" ]
[ "utils.py" ]
[ "\"\"\" Utilities \"\"\"\nimport os\nimport logging\nimport shutil\nimport torch\nimport torchvision.datasets as dset\nimport numpy as np\nimport preproc\n\nclass ImageFolderWithPaths(dset.ImageFolder):\n \"\"\"Custom dataset that includes image file paths. Extends\n torchvision.datasets.ImageFolder\n \"\"...
[ [ "torch.load" ] ]
wahabk/colloidoscope
[ "508918703405e07c336c0ad97cf6b3e87db311bb" ]
[ "scripts/simulate/sim_positions_polydisp.py" ]
[ "from colloidoscope import hoomd_make_configurations, read_gsd, hoomd_make_configurations_polydisp\nfrom colloidoscope import DeepColloid\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom random import randrange, uniform\nimport hoomd.hpmc\nimport gsd.hoomd\n\nif __name__ == '__main__':\n\n\t# phi = 0.1\n\...
[ [ "numpy.linspace" ] ]
KanchiShimono/recommenders
[ "a4a0e7c129f0ca9221c1ef7805991b58169bed79" ]
[ "tensorflow_recommenders/layers/embedding/tpu_embedding_layer.py" ]
[ "# Copyright 2021 The TensorFlow Recommenders 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 ...
[ [ "tensorflow.tpu.experimental.embedding.FeatureConfig", "tensorflow.nest.pack_sequence_as", "tensorflow.zeros_initializer", "tensorflow.keras.optimizers.schedules.deserialize", "tensorflow.distribute.get_strategy", "tensorflow.tpu.experimental.embedding.TPUEmbedding", "tensorflow.tpu.ex...
insight-decentralized-consensus-lab/Unified-Blockchains
[ "4dfaddfd3d75d6b01f7c1d3259285e5f0d876619" ]
[ "unified-tools/tx_per_day.py" ]
[ "import pandas as pd\nimport numpy as np\nimport sys,os\n\nif(len(sys.argv)>1):\n inputfile = sys.argv[1]\nelse:\n print(\"run via:\")\n print(\"python3 \"+sys.argv[0]+\" <input-file>\")\n sys.exit(1)\n\nwith open(inputfile) as f:\n data = pd.read_json(f)\n print(data.columns.values)\n data[\"n...
[ [ "pandas.read_json", "numpy.arange" ] ]
cristinanichiforov/forecasting
[ "10352e07c74f7cae2f68629fdfb89877596fcc6d" ]
[ "contrib/tsperf/OrangeJuice_Pt_3Weeks_Weekly/RNN/make_features.py" ]
[ "\"\"\"\nThis script contains the function for creating features for the RNN model.\n\"\"\"\n\n# import packages\nimport itertools\nimport sys\nimport inspect\nimport os\nimport pandas as pd\nimport numpy as np\nfrom utils import *\nfrom sklearn.preprocessing import OneHotEncoder\n\n# Add TSPerf root directory to s...
[ [ "numpy.concatenate", "pandas.DataFrame.from_records", "numpy.array", "numpy.nan_to_num", "numpy.reshape", "numpy.exp", "numpy.std", "numpy.repeat", "pandas.read_csv", "sklearn.preprocessing.OneHotEncoder" ] ]
areikka/huggingface_transformers_ipu
[ "98c130fcd7d714dc07931f6a02d69a1802254aad" ]
[ "examples/pytorch/text-classification/run_glue.py" ]
[ "#!/usr/bin/env python\n# coding=utf-8\n# Copyright 2020 The HuggingFace Inc. team. 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....
[ [ "numpy.squeeze", "numpy.argmax" ] ]
13375P34Ker/speech_analytics
[ "5c6b5df888546b7e1c37541e267259fa5be07eb2" ]
[ "src/vad/vad_pyannote.py" ]
[ "import os\nimport tempfile\nimport wave\n\nimport torch\nfrom pyannote.audio.utils.signal import Binarize\nfrom scipy.io import wavfile\n\n\nclass VADException(Exception):\n pass\n\n\nclass VoiceActivityDetection:\n\n def __init__(self, binarize_params=None):\n self.sad = torch.hub.load('pyannote/pyan...
[ [ "scipy.io.wavfile.write", "scipy.io.wavfile.read", "torch.hub.load" ] ]
usgs/groundmotion-processing-
[ "ed188e2bb1dcd9b17433ef4677874eac654fdd16", "ed188e2bb1dcd9b17433ef4677874eac654fdd16" ]
[ "gmprocess/io/bhrc/core.py", "gmprocess/waveform_processing/windows.py" ]
[ "#!/usr/bin/env python\n\n# stdlib imports\nimport os\nimport re\n\n# third party imports\nimport numpy as np\nfrom obspy.core.utcdatetime import UTCDateTime\n\n# local\nfrom gmprocess.utils.constants import UNIT_CONVERSIONS\nfrom gmprocess.core.stationstream import StationStream\nfrom gmprocess.core.stationtrace i...
[ [ "numpy.genfromtxt", "numpy.ceil", "numpy.isnan" ], [ "numpy.array", "numpy.isnan", "pandas.DataFrame", "numpy.exp", "numpy.sqrt", "numpy.size" ] ]