repo_name
stringlengths
8
130
hexsha
list
file_path
list
code
list
apis
list
robertjankowski/reproducing-dl-papers
[ "01ad85eac333b87358b3d2e2276292333cacf0e0" ]
[ "homophily_structural_balance/plotting/plot_positive_edge_density.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport argparse\n\n\ndef extract_name(word: str):\n return word.split('=')[-1]\n\n\ndef extract_info(filename: str):\n filename_splitted = filename.split('_')\n assert len(filename_splitted) == 7\n p = float(extract_name(filename_splitted[1]))\n i...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.rc", "matplotlib.pyplot.xticks", "matplotlib.pyplot.figure", "matplotlib.pyplot.grid", "matplotlib.pyplot.savefig", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.yticks", ...
elephantscale/facies
[ "ea78a4917ebb5dbbe478b9fc27200c67b6e5576f" ]
[ "code/faciesplot.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.colors as colors\nfrom mpl_toolkits.axes_grid1 import make_axes_locatable\n\n#Key:\n# 1=sandstone 2=c_siltstone 3=f_siltstone \n# 4=marine_silt_shale 5=mudstone 6=wackestone 7=dolomite\n# 8=packstone 9=bafflestone\n\n\nfacies_labels = ['SS',...
[ [ "matplotlib.pyplot.colorbar", "numpy.expand_dims", "matplotlib.pyplot.subplots" ] ]
siyemuxu888/imagepy
[ "a933526483a15da282bacac54608d44d2173beb4", "a933526483a15da282bacac54608d44d2173beb4" ]
[ "imagepy/tools/Transform/scale_tol.py", "imagepy/menus/Plugins/Surf/surf_plg.py" ]
[ "import wx\nimport numpy as np\nfrom imagepy.core.engine import Tool, Filter\nimport scipy.ndimage as nimg\n\nclass ScaleTool(Tool):\n def __init__(self, plg):\n self.plg = plg\n self.para = plg.para\n self.moving = False\n \n def snap(self, x, y, lim):\n plg = self.plg\n ...
[ [ "numpy.array", "scipy.ndimage.affine_transform" ], [ "numpy.sqrt", "numpy.float32" ] ]
KedoKudo/jupyter-ht-hedm
[ "b447202fb9800e7b2916b38470db1b9a83357130" ]
[ "seisidd/tomo_plans.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"\nPredefined bluesky scan plans\n\"\"\"\n\nimport numpy as np\nimport bluesky.plans as bp\nimport bluesky.preprocessors as bpp\nimport bluesky.plan_stubs as bps\n\nfrom .utility import load_config\n\n#@bpp.run_decorator()\ndef collect_white_field...
[ [ "numpy.cos", "numpy.arange", "numpy.array", "numpy.sin", "numpy.radians" ] ]
petuum/tuun
[ "8eec472dbf0e5e695449b0fa2d98985469fd5b30" ]
[ "tuun/probo/models/gp_stan_transfer.py" ]
[ "\"\"\"\nClasses for GP models with Stan that perform transfer optimization.\n\"\"\"\n\nfrom argparse import Namespace\nimport numpy as np\nimport copy\n\nfrom .gp_stan import StanGp\nfrom .regression.transfer_regression import TransferRegression\nfrom ..util.misc_util import dict_to_namespace\n\n\nclass StanTransf...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.min", "numpy.mean" ] ]
K4S4B4/learnable-triangulation-pytorch
[ "94f5121919785bf7c89dd973521a21c01104dbd5" ]
[ "mvn/utils/op.py" ]
[ "import numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom mvn.utils.img import to_numpy, to_torch\nfrom mvn.utils import multiview\n\n\ndef integrate_tensor_2d(heatmaps, softmax=True):\n \"\"\"Applies softmax to heatmaps and integrates them to get their's \"center of mas...
[ [ "torch.stack", "torch.nn.functional.softmax", "torch.zeros_like", "torch.exp", "torch.nn.functional.relu", "torch.arange", "torch.nn.functional.grid_sample", "torch.zeros", "torch.einsum", "torch.cat" ] ]
ctiger34/BASIC-EMOTION-DETECTION
[ "1c2be519c70408159ea6e1093d5f139c99ea6e27" ]
[ "load_and_process.py" ]
[ "import pandas as pd\nimport cv2\nimport numpy as np\n\n\ndataset_path = 'fer2013/fer2013/fer2013.csv'\nimage_size=(48,48)\n\ndef load_fer2013():\n data = pd.read_csv(dataset_path)\n pixels = data['pixels'].tolist()\n width, height = 48, 48\n faces = []\n for pixel_sequence in pix...
[ [ "pandas.read_csv", "numpy.expand_dims", "numpy.asarray", "pandas.get_dummies" ] ]
ray-ruisun/FedML
[ "24ff30d636bb70f64e94e9ca205375033597d3dd", "24ff30d636bb70f64e94e9ca205375033597d3dd" ]
[ "app/fedcv/medical_chest_xray_image_clf/data/chexpert/data_loader.py", "app/fedgraphnn/ego_networks_link_pred/data/utils.py" ]
[ "import logging\n\nimport os\nimport numpy as np\nimport torch\nfrom torch.utils.data import Dataset, DataLoader\nimport torchvision.transforms as transforms\nfrom torch.utils.data.distributed import DistributedSampler\n\nfrom .dataset import CheXpert\n\n\ndef _get_mean_and_std(dataset: Dataset):\n \"\"\"Compute...
[ [ "torch.utils.data.DataLoader", "numpy.ones", "numpy.random.shuffle", "torch.utils.data.distributed.DistributedSampler", "numpy.random.choice", "numpy.clip", "torch.from_numpy", "torch.zeros", "numpy.random.randint" ], [ "numpy.random.uniform", "torch.as_tensor", ...
openmcworkshop/paramak
[ "c41dc4c2e68183869556544ee7a72deb1d16a8dc" ]
[ "paramak/reactor.py" ]
[ "\nimport json\nfrom collections import Iterable\nfrom pathlib import Path\n\nimport cadquery as cq\nimport matplotlib.pyplot as plt\nimport plotly.graph_objects as go\nfrom cadquery import exporters\n\nimport paramak\nfrom paramak.neutronics_utils import (add_stl_to_moab_core,\n ...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots" ] ]
jaycosaur/spynet
[ "535841bcea761463d27f7f3eb745ffe186d9f763" ]
[ "streaming_helpers.py" ]
[ "import queue\nimport time\nimport numpy as np\n\n\nclass CameraInformation:\n def __init__(self, cam_id: str):\n self._frame_queue: queue.Queue = queue.Queue(maxsize=1)\n self._frame_shape = None\n self._last_frame_time = None\n self.is_online = True\n self.node_id = cam_id\n\...
[ [ "numpy.zeros" ] ]
liiliiliil/ride-hailing-platform-with-simulator
[ "c9eae7f718c9e10c7ba4955e5093d4fb21d16d25" ]
[ "data_processing/draw_value_map.py" ]
[ "import os\nimport time\nimport pickle\n\nimport math\nimport numpy as np\nimport linecache\nimport matplotlib.pyplot as plt\n# from matplotlib.pyplot import MultipleLocator\nimport grid\n\ndata_path = 'E:/dataset/didi/processed'\nsave_path = 'E:/dataset/didi/processed/order_20161101_sampled_value_map_fig'\ndata_fi...
[ [ "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.title", "numpy.max", "numpy.min", "numpy.array", "matplotlib.pyplot.colorbar", "matplotlib.pyplot.scatter" ] ]
Amir-Mehrpanah/hgraph2graph
[ "6d37153afe09f7684381ce56e8366675e22833e9" ]
[ "hgraph/decoder.py" ]
[ "import torch\nimport torch.nn as nn\nimport rdkit.Chem as Chem\nimport torch.nn.functional as F\nfrom hgraph.nnutils import *\nfrom hgraph.encoder import IncHierMPNEncoder\nfrom hgraph.mol_graph import MolGraph\nfrom hgraph.inc_graph import IncTree, IncGraph\n\nclass HTuple():\n def __init__(self, node=None, me...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.functional.softmax", "torch.nn.functional.pad", "torch.multinomial", "torch.nn.CrossEntropyLoss", "torch.exp", "torch.eye", "torch.nn.BCEWithLogitsLoss", "torch.sigmoid", "torch.LongTensor", "torch.nn.ReLU", "torc...
johncliu/Horizon
[ "cfa7a873ada5de3bb01e78e2f237d9849b8270b2" ]
[ "ml/rl/test/test_normalization.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n\nimport unittest\n\nimport numpy as np\nimport numpy.testing as npt\nimport six\nfrom caffe2.python import core, workspace\nfrom ml.rl.caffe_utils import C2\nfrom ml.rl.preprocessing import identify_types, normalizati...
[ [ "numpy.logical_or", "numpy.squeeze", "numpy.zeros", "numpy.less", "numpy.mean", "numpy.isclose", "numpy.greater", "numpy.expand_dims", "scipy.special.expit", "numpy.all", "numpy.array", "numpy.std", "numpy.where", "numpy.isfinite" ] ]
boycehbz/DMMR
[ "18fcee7ce584fdccfa08bcda883d9b4fcb962c04" ]
[ "core/smplx/lbs_.py" ]
[ "# -*- coding: utf-8 -*-\n\n# Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG) is\n# holder of all proprietary rights on this computer program.\n# You can only use this computer program if you have closed\n# a license agreement with MPG or you get the right to use the computer\n# program from som...
[ [ "torch.unsqueeze", "torch.ones", "torch.stack", "torch.split", "torch.cos", "torch.bmm", "torch.nn.functional.pad", "torch.norm", "torch.sin", "torch.arange", "torch.index_select", "torch.zeros", "torch.einsum", "torch.eye", "torch.cat", "torch.matmu...
ardhanii/covid19-sir
[ "59d95156b375c41259c46ce4e656b86903f92ec2" ]
[ "covsirphy/loading/db_owid.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport country_converter as coco\nimport pandas as pd\nfrom covsirphy.util.term import Term\nfrom covsirphy.loading.db_base import _RemoteDatabase\n\n\nclass _OWID(_RemoteDatabase):\n \"\"\"\n Access \"Our World In Data\".\n https://github.com/owid/covid-1...
[ [ "pandas.read_csv" ] ]
egonrian/google-research
[ "9049acf9246c1b75170f0c6757e62a8f619a9db6", "2c0043ecd507e75e2df9973a3015daf9253e1467", "2c0043ecd507e75e2df9973a3015daf9253e1467" ]
[ "task_set/tasks/fixed/fixed_text_rnn_classification_test.py", "depth_and_motion_learning/consistency_losses.py", "protein_lm/embed_test.py" ]
[ "# coding=utf-8\n# Copyright 2020 The Google Research Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.compat.v1.test.main" ], [ "tensorflow.compat.v1.stop_gradient", "tensorflow.compat.v1.math.multiply_no_nan", "tensorflow.compat.v1.less", "tensorflow.compat.v1.reduce_mean", "tensorflow.compat.v1.expand_dims", "tensorflow.compat.v1.squeeze", "tensorflow.compat.v1.nn...
shanky1947/Air-Draw
[ "ab370f96384414ba5c4e369f5465cd8e28b4f3f0" ]
[ "Air Canvas (only)/Different Canvas Codes/detect1.py" ]
[ "# get hsv values using trackbar\nimport cv2\nimport numpy as np\nimport time\n\n# A required callback method that goes into the trackbar function.\ndef nothing(x):\n pass\n\n# Initializing the webcam feed.\ncap = cv2.VideoCapture(0)\ncap.set(3,1280)\ncap.set(4,720)\n\n# Create a window named trackbars.\ncv2.nam...
[ [ "numpy.array", "numpy.save", "numpy.hstack" ] ]
123972/PCA-nutricion
[ "aff3c51a71c887c3fa367dbf9d599be5915c80cc", "aff3c51a71c887c3fa367dbf9d599be5915c80cc" ]
[ "src/pca/todoJunto.py", "environment/lib/python3.8/site-packages/sklearn/decomposition/tests/test_dict_learning.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\nimport codecs\nimport sys\n\nimport sklearn as sk\nimport pandas as pd\nimport numpy as np \nimport math\n\nfrom sklearn import preprocessing\nfrom sklearn.decomposition import PCA\n\nfrom src.pca.algoritmo_QR import eigenvectores_eigenvalores_QR_vf\nfrom src.pca.metodo_po...
[ [ "numpy.sum", "numpy.transpose", "numpy.zeros", "sklearn.decomposition.PCA", "pandas.DataFrame", "numpy.linalg.svd", "numpy.array", "numpy.dot", "numpy.mean" ], [ "numpy.sum", "sklearn.utils._testing.TempMemmap", "numpy.random.RandomState", "sklearn.utils._te...
mnabavi84/dcamp-intro-python
[ "218b67106061d45cfa18a1b1d46487900f9aa539" ]
[ "11-Numpy Basic Statistics.py" ]
[ "# np_baseball is available\r\n\r\n# Import numpy\r\nimport numpy as np\r\n\r\n# Create np_height_in from np_baseball\r\nnp_height_in = np_baseball[:,0]\r\n\r\n# Print out the mean of np_height_in\r\nprint(np.mean(np_height_in))\r\n\r\n# Print out the median of np_height_in\r\nprint(np.median(np_height_in))\r\n\r\n...
[ [ "numpy.median", "numpy.array", "numpy.std", "numpy.mean", "numpy.corrcoef" ] ]
kili-technology/active-learning
[ "72dce7d91b988264dd7fa1a972d9af45e9648c4c" ]
[ "experiments/mnist_simple/class_imbalance.py" ]
[ "import os\nimport logging\nimport pickle\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n\nimport al\nfrom al.dataset import mnist\nfrom al.model.model_zoo.simple_cnn import ConvModel\nfrom al.model.mnist import MnistLearner\nfrom al.dataset.mnist import MnistDat...
[ [ "numpy.array", "numpy.arange", "numpy.random.permutation", "numpy.random.rand" ] ]
yuancaimaiyi/gtsfm
[ "cc5781c35af23498d45cd96a1818e4786c5cca80" ]
[ "gtsfm/common/gtsfm_data.py" ]
[ "\"\"\"Class to hold the tracks and cameras of a 3D scene.\nThis can be the output of either data association or of bundle adjustment.\n\nAuthors: Ayush Baid, John Lambert, Xiaolong Wu\n\"\"\"\nimport itertools\nfrom typing import Any, Dict, List, Optional, Tuple\n\nimport numpy as np\nfrom gtsam import PinholeCame...
[ [ "numpy.allclose", "numpy.median", "numpy.max", "numpy.all", "numpy.min", "numpy.isnan", "numpy.array", "numpy.round", "numpy.mean" ] ]
EmergentSystemLabStudent/Prosodic-DAA
[ "068af5db337ed977c059e788353414d3aa9a8ac8" ]
[ "prosodic_daa/sample/pyhlm_sample_murakami.py" ]
[ "import os\nimport numpy as np\nfrom pyhlm.model import WeakLimitHDPHLM, WeakLimitHDPHLMPython\nfrom pyhlm.internals.hlm_states import WeakLimitHDPHLMStates\nfrom pyhlm.word_model import LetterHSMM, LetterHSMMPython\nimport pyhsmm\nimport warnings\nfrom tqdm import trange\nwarnings.filterwarnings('ignore')\nimport ...
[ [ "numpy.cumsum", "numpy.zeros", "numpy.savetxt", "numpy.hstack", "numpy.identity", "numpy.loadtxt" ] ]
trojanjay/sfa-numpy
[ "bff5737ef429f31228d20a9e1d0ce7d46d3080d3" ]
[ "examples/modal_beamforming_open_circular_array.py" ]
[ "\"\"\"\n Compute the plane wave decomposition for an incident broadband plane wave\n on an open circular array using a modal beamformer of finite order.\n\"\"\"\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport micarray\nfrom micarray.util import db\n\nNsf = 50 # order of the incident sound fie...
[ [ "numpy.matmul", "numpy.squeeze", "matplotlib.pyplot.figure", "matplotlib.pyplot.savefig", "numpy.conj", "numpy.fft.irfft", "matplotlib.pyplot.title", "numpy.expand_dims", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.colorbar", "numpy.linspace", "matplotlib.pyplot....
uclyyu/over9000
[ "9e2e0aa4be9da941372a21ea627c38a3eb7be617" ]
[ "ralamb.py" ]
[ "import torch, math\nfrom torch.optim.optimizer import Optimizer\n\n# RAdam + LARS\nclass Ralamb(Optimizer):\n\n def __init__(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-8, weight_decay=0):\n defaults = dict(lr=lr, betas=betas, eps=eps, weight_decay=weight_decay)\n self.buffer = [[None, None,...
[ [ "torch.zeros_like" ] ]
micbia/tools21cm
[ "72081e94e4d83511380baacce427d79d13da2fa5" ]
[ "t2c/segmentation.py" ]
[ "\"\"\"\nCreated by Michele Bianco, 9 July 2021\n\"\"\"\n\nimport numpy as np, pkg_resources\nfrom tqdm import tqdm\n\nimport tensorflow as tf\nfrom tensorflow.keras.models import load_model\nfrom tensorflow.keras import backend as K\nfrom tensorflow.python.ops import nn_ops\nfrom tensorflow.python.framework import...
[ [ "tensorflow.keras.backend.sum", "tensorflow.keras.backend.log", "tensorflow.keras.backend.epsilon", "tensorflow.python.ops.nn_ops._ensure_xent_args", "numpy.ascontiguousarray", "numpy.fliplr", "numpy.mean", "tensorflow.keras.backend.abs", "numpy.std", "tensorflow.python.fra...
jrobertojunior/face-parsing.PyTorch
[ "d34f39c9ae9726ac8eaf39ecff824a14ec4e15b9" ]
[ "preprocessing/main.py" ]
[ "import cv2 as cv\nimport numpy as np\nimport os\n\ndef preprocess(labels_path, sep_labels_path):\n # list all files on labels_path\n labels_filenames = os.listdir(labels_path)\n\n count = 0\n for label_filename in labels_filenames:\n label_path = os.path.join(labels_path, label_filename)\n\n ...
[ [ "numpy.zeros" ] ]
Principe92/contextualbandits
[ "43cf5be10b3d39d74f9da5c5fe1cfae5bc2dd6f5" ]
[ "example/loc3/rewards.py" ]
[ "import pandas\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport scipy.stats as st\nfrom pylab import rcParams\n\n\ndf = pandas.read_csv('rewards_loc3.csv')\n\nucb,ts,ovr,egr,egr2,agr,agr2,efr,ac,aac,sft = df['ucb'],df['ts'],df['ovr'],\\\ndf['egr'],df['egr2'],df['agr'],df['agr2'],df['efr'],df['ac'],df['a...
[ [ "scipy.stats.t.ppf", "pandas.read_csv", "matplotlib.pyplot.savefig", "scipy.stats.sem", "matplotlib.pyplot.title", "matplotlib.pyplot.errorbar", "matplotlib.pyplot.subplot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ] ]
Jesmine0902/TSP_CPLEX_2
[ "8853d6837bd5408b8925eb5f45e21c79945a5904" ]
[ "Add/add_heuristic_engine.py" ]
[ "import pandas as pd\n\n__author__ = 'slei'\n\n\nclass AddHeuristicTSP:\n \"\"\" Finds the shortest path using a heuristic method \"\"\"\n\n def __init__(self, cities_df):\n self.df = cities_df\n self.edges = list((t.origin, t.destination) for t in df.itertuples())\n self.distance = dict(...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
YellowOfTheEgg/ots-eval
[ "8ec08e60330d41f8f7ffd571dd6301cdedaefd99" ]
[ "ots_eval/stability_evaluation/close.py" ]
[ "import numpy as np\nfrom scipy.spatial.distance import euclidean\nfrom typing import Union\nimport pandas\n\n\nclass CLOSE(object):\n\n def __init__(self, data: pandas.DataFrame, measure: Union[str, callable] = 'mse', minPts: int = None, output: bool = False,\n jaccard: bool = False, weighting: ...
[ [ "numpy.sum", "numpy.abs", "numpy.power", "numpy.array", "numpy.where", "numpy.average" ] ]
dajes/labelfficient
[ "5dd0566224fb04285e690bf8576eacc04a7c87cd" ]
[ "commons/siam_mask/experiments/siammask_sharp/resnet.py" ]
[ "import torch.nn as nn\nimport torch\nfrom torch.autograd import Variable\nimport math\nimport torch.utils.model_zoo as model_zoo\nfrom commons.siam_mask.models.features import Features\n\n__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',\n 'resnet152']\n\n\nmodel_urls = {\n 'resnet...
[ [ "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.FloatTensor", "torch.autograd.Variable", "torch.nn.Conv2d", "torch.nn.Sequential", "torch.utils.model_zoo.load_url", "torch.nn.ReLU" ] ]
AlexBlack2202/EigenGAN-Tensorflow
[ "86b21a47a824a2bb04a088c3e78b03d03a53735c" ]
[ "tflib/distribute/distribute.py" ]
[ "import tensorflow as tf\n\nfrom tensorflow.python.client import device_lib\n\n\ndef get_available_gpus():\n local_device_protos = device_lib.list_local_devices()\n return [x.name for x in local_device_protos if x.device_type == 'GPU']\n\ngpus = get_available_gpus\n\n\ndef split_nest(nest, num_or_size_splits,...
[ [ "tensorflow.python.client.device_lib.list_local_devices", "tensorflow.nest.pack_sequence_as", "tensorflow.device", "tensorflow.reduce_mean", "tensorflow.expand_dims", "tensorflow.concat", "tensorflow.nest.flatten", "tensorflow.split" ] ]
vdutor/VFF
[ "459be5b480bba49e8c15dc7daeca5fd1ddd762df" ]
[ "experiments/increasing_dim/Exp_1/kron.py" ]
[ "import numpy as np\nimport sys\nimport gpflow\nimport VFF\n\nfrom time import time\n\nfrom config import *\n\ndim = sys.argv[1]\nrep = sys.argv[2]\n\nprint('vff: dimension {}, replicate {}'.format(dim, r))\n\n# data\ndata = np.load('data/data_dim{}_rep{}.npz'.format(dim, 0))\n\n# full_gp\ndef prodkern(dim):\n r...
[ [ "numpy.arange", "numpy.ones" ] ]
Akshat-unt/jina
[ "b0b058f99f3ee4dcbcbbf2acbf04c5d7e7e9c717" ]
[ "tests/integration/issues/hanging_termination/test_hanging_termination.py" ]
[ "import os\nfrom pathlib import Path\n\nimport numpy as np\nimport pytest\n\nfrom jina import Flow, Document\nfrom jina.clients import Client\nfrom jina.logging.profile import TimeContext\nfrom jina.parsers import set_client_cli_parser\nfrom typing import Dict\nfrom jina import DocumentArray, Executor, requests\n\n...
[ [ "numpy.random.random" ] ]
claireguichon/pynet
[ "92706375e61fb5cb523548303b7d04769c9de134" ]
[ "pynet/cam.py" ]
[ "# -*- coding: utf-8 -*-\n##########################################################################\n# NSAp - Copyright (C) CEA, 2019\n# Distributed under the terms of the CeCILL-B license, as published by\n# the CEA-CNRS-INRIA. Refer to the LICENSE file or to\n# http://www.cecill.info/licences/Licence_CeCILL-B_V1...
[ [ "torch.sum", "torch.nn.functional.softmax", "numpy.max", "torch.from_numpy", "numpy.min", "numpy.maximum", "numpy.mean" ] ]
GatherLab/OLED-evaluation
[ "419dfd5d2c3773f5f90d76aef634f8b1cc0b6378" ]
[ "src/UI_assign_group_window.py" ]
[ "# -*- coding: utf-8 -*-\nfrom PySide2 import QtCore, QtGui, QtWidgets\n\nimport json\nimport core_functions as cf\nimport numpy as np\n\nfrom UI_labeled_slider import LabeledSlider\n\n\nclass Ui_AssignGroup(object):\n def setupUi(self, AssignGroups):\n # Note: this is not how it should be done but curren...
[ [ "numpy.unique", "numpy.empty" ] ]
czw1296924847/ResGraphNet
[ "1638236e4138719c324afc3137f31cfec8a9de64" ]
[ "run/run_ResGraphNet.py" ]
[ "\"\"\"\nTesting ResGraphNet\n\"\"\"\nimport datetime\nimport numpy as np\nimport pandas as pd\nimport torch\nimport os\nimport os.path as osp\nimport matplotlib.pyplot as plt\n\nimport sys\nsys.path.append(\"..\")\nimport func.cal as cal\n\n\ndevice = \"cuda:0\" if torch.cuda.is_available() else \"cpu\"\n# device ...
[ [ "numpy.load", "torch.nn.MSELoss", "pandas.DataFrame", "matplotlib.pyplot.show", "torch.arange", "torch.cuda.is_available", "torch.from_numpy", "numpy.square", "torch.cat", "numpy.loadtxt" ] ]
JaworWr/Dynamic-inverse-kinematics
[ "b9da50b88152682060075a44da940e6f98690a9a" ]
[ "idea.py" ]
[ "import numpy as np\n\n\ndef FNS(scores):\n domination = np.all(scores[:, None, :] <= scores[None, :, :], axis=2) # domination[i, j] = \"i dominuje j\"\n domination &= np.any(scores[:, None, :] < scores[None, :, :], axis=2)\n Nx = domination.sum(0)\n\n Pf = []\n ranks = np.zeros(scores.shape[0])\n ...
[ [ "numpy.sum", "numpy.any", "numpy.argsort", "numpy.stack", "numpy.vstack", "numpy.random.choice", "numpy.take_along_axis", "numpy.where", "numpy.nonzero", "numpy.unique", "numpy.random.uniform", "numpy.zeros", "numpy.repeat", "numpy.all", "numpy.power", ...
Keck-FOBOS/producer
[ "6f2b0d3f29f62187bf593567081061e53ddb5a4e" ]
[ "producer/util.py" ]
[ "\"\"\"\nMiscellaneous package utilities.\n\n.. include:: ../include/links.rst\n\"\"\"\n\nfrom itertools import chain, combinations\n\nfrom IPython import embed \n\nimport numpy\n\n\ndef all_subclasses(cls):\n \"\"\"\n Collect all the subclasses of the provided class.\n\n The search follows the inheritance...
[ [ "numpy.sum", "numpy.roll", "numpy.atleast_2d", "numpy.zeros", "numpy.logical_not" ] ]
chundiliu/slim_for_Cdiscount
[ "ea7f9d56072072c031094c12c803c63591066c6c" ]
[ "generate_cdiscount_predictions.py" ]
[ "import math\nimport tensorflow as tf\nimport os\nimport struct\nimport pdb\nimport numpy as np\nfrom datasets import dataset_factory\nfrom nets import nets_factory\nimport nets.resnet_v2 as resnet_v2\nfrom preprocessing import preprocessing_factory\nslim = tf.contrib.slim\n\ndef merge_predictions(predictions_fn):\...
[ [ "tensorflow.global_variables_initializer", "tensorflow.train.latest_checkpoint", "tensorflow.train.start_queue_runners", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.train.batch", "tensorflow.train.Coordinator" ] ]
jeantardelli/math-with-python
[ "119bbbc62329c0d834d965232239bd3b39116cc1" ]
[ "data-and-statistics/understanding-a-population-using-sampling.py" ]
[ "\"\"\"\nOne of the central problems in statistics is to make estimations — and quantify\nhow good these estimations are — of the distribution of an entire population\ngiven only a small (random) sample. A classic example is to estimate the average\nheight of all the people in a country when measuring the height of...
[ [ "pandas.Series", "scipy.stats.t.ppf" ] ]
Bhavay192/keras
[ "f1e9c76675981ee6683f54a3ce569212d551d12d" ]
[ "keras/optimizer_v2/rmsprop_test.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...
[ [ "numpy.sqrt", "tensorflow.compat.v2.compat.v1.nn.embedding_lookup", "tensorflow.compat.v2.compat.v1.get_default_graph", "tensorflow.compat.v2.compat.v1.global_variables_initializer", "tensorflow.compat.v2.Graph", "tensorflow.compat.v2.test.main", "tensorflow.compat.v2.device", "num...
shivampotdar/Artificial-Intelligence-with-Python
[ "00221c3b1a6d8003765d1ca48b5c95f86da375d9" ]
[ "Chapter 10/code/category_predictor.py" ]
[ "from sklearn.datasets import fetch_20newsgroups\nfrom sklearn.naive_bayes import MultinomialNB\nfrom sklearn.feature_extraction.text import TfidfTransformer\nfrom sklearn.feature_extraction.text import CountVectorizer\n\n# Define the category map\ncategory_map = {'talk.politics.misc': 'Politics', 'rec.autos': 'Aut...
[ [ "sklearn.naive_bayes.MultinomialNB", "sklearn.feature_extraction.text.TfidfTransformer", "sklearn.feature_extraction.text.CountVectorizer" ] ]
andrzejmalota/StockPricePrediction
[ "a6d7da353b706fb2d970f2883841db14d896268f" ]
[ "src/trading_simulation/simulation.py" ]
[ "import sys\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\n\n\nclass Simulation:\n def __init__(self, init_investment, stock_returns, strategy, predicted_movements=None):\n self.init_investment = init_investment\n self.predicted_movements = predicted_movements\n s...
[ [ "pandas.DataFrame", "numpy.insert", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "numpy.array", "matplotlib.pyplot.xlabel" ] ]
pranavrajpal/scipy
[ "7dcdeffed53483a60b3e054618520e0f28adeba4", "859c1061b3d5aa30c4466824049d69edde5499a2" ]
[ "scipy/optimize/tests/test_linprog.py", "scipy/integrate/_ivp/rk.py" ]
[ "\"\"\"\nUnit test for Linear Programming\n\"\"\"\nimport sys\n\nimport numpy as np\nfrom numpy.testing import (assert_, assert_allclose, assert_equal,\n assert_array_less, assert_warns, suppress_warnings)\nfrom pytest import raises as assert_raises\nfrom scipy.optimize import linprog, Opt...
[ [ "numpy.ones", "numpy.sum", "numpy.testing.assert_equal", "numpy.random.seed", "numpy.testing.assert_warns", "numpy.vstack", "numpy.cos", "numpy.random.rand", "numpy.identity", "numpy.eye", "numpy.zeros", "numpy.testing.assert_array_less", "scipy.optimize.linprog...
RodrigoATorres/hermione
[ "c51f5e54a41609099eef48990c7ad7018dcdf41a" ]
[ "hermione/module_templates/__IMPLEMENTED_BASE__/src/predict.py" ]
[ "import pandas as pd\nimport io\nfrom joblib import load\nimport logging\n\nlogging.getLogger().setLevel(logging.INFO)\n\ndef generate_data():\n new_data = pd.DataFrame({\n 'Pclass':[3,2,1],\n 'Sex': ['male', 'female', 'male'],\n 'Age':[4, 22, 28]\n })\n return new_data\n\n\ndef load_m...
[ [ "pandas.DataFrame" ] ]
bee-hive/nested-policy-rl
[ "56b0be37ed814265cb3ef26ea0a1a62b5cd7f05c" ]
[ "tests/test_networks.py" ]
[ "import torch\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport torch.nn as nn\n\n# import sys\n# sys.path.append(\"../simulated_fqi/\")\nfrom simulated_fqi import NFQNetwork, ContrastiveNFQNetwork\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\ndef train(x, y, groups, network, optimiz...
[ [ "torch.nn.functional.mse_loss" ] ]
SixHeo/IVOS-ATNet
[ "1cf574953a96bd680c518c6362b510fd103ff271" ]
[ "libs/utils_torch.py" ]
[ "import torch\n\ndef combine_masks_with_batch(masks, n_obj, th=0.5, return_as_onehot = False):\n \"\"\" Combine mask for different objects.\n\n Different methods are the following:\n\n * `max_per_pixel`: Computes the final mask taking the pixel with the highest\n probability for every...
[ [ "torch.zeros_like", "torch.argmax" ] ]
muchemwal/models
[ "49fd0a8a61b0e5dab196014bf47de7f62d97c884" ]
[ "tensorflow/super_resolution/syndicai.py" ]
[ "import os\nimport io\nimport time\nimport base64\nimport functools\n\nfrom PIL import Image\nimport numpy as np\nimport tensorflow as tf\nimport tensorflow_hub as hub\n\nfrom helpers import *\nos.environ[\"TFHUB_DOWNLOAD_PROGRESS\"] = \"True\"\n\n\nclass PythonPredictor:\n\n def __init__(self, config):\n ...
[ [ "tensorflow.squeeze" ] ]
Ricechrispi/sc2_academy
[ "9ffed467fe019262035ac61d10c5cc3ee64a7bb2" ]
[ "sc2_academy/ppo/my_epsilon_greedy_policy.py" ]
[ "# coding=utf-8\n# Copyright 2018 The TF-Agents 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 b...
[ [ "tensorflow.shape", "tensorflow.logical_not", "tensorflow.ones_like", "tensorflow.nest.map_structure", "tensorflow.compat.v1.where", "tensorflow.zeros_like" ] ]
ronnith24/NeuralNetworksFromScratch
[ "5c831de8954a4b84fef7b70b16f9d9e6c1cb24b9" ]
[ "NeuralNetwork.py" ]
[ "import numpy as np\n\nclass NeuralNetwork(object):\n def __init__(self, topology, epsilon, numLabels):\n self.theta = []\n self.topology = topology\n self.numLabels = numLabels\n self.gradientChecking = False\n for layer in range(len(self.topology)):\n if layer == 0...
[ [ "numpy.matmul", "numpy.zeros", "numpy.exp", "numpy.random.rand", "numpy.concatenate" ] ]
swcho84/image-segmentation
[ "ef9b9b3d832e9efe6f43522cc5ca0e17279d6608" ]
[ "image-segmentation/data_generators/kitti/kitti_dataset.py" ]
[ "from collections import namedtuple\n\nimport os\nimport json\nimport numpy as np\n\nfrom tqdm import tqdm\nfrom data_generators.utils import load_image_rgb\n\n# Copied from: https://github.com/mcordts/cityscapesScripts/blob/master/cityscapesscripts/helpers/labels.py\n#\n# Cityscapes labels\n#\n#-------------------...
[ [ "numpy.arange", "numpy.zeros" ] ]
pearcandy/pennylane
[ "dfa35989cd0798496e41999a197bcf0eb26185df" ]
[ "tests/devices/test_default_qubit_jax.py" ]
[ "import pytest\r\n\r\njax = pytest.importorskip(\"jax\", minversion=\"0.2\")\r\njnp = jax.numpy\r\nimport numpy as np\r\nimport pennylane as qml\r\nfrom pennylane.devices.default_qubit_jax import DefaultQubitJax\r\n\r\npytestmark = pytest.mark.usefixtures(\"tape_mode\")\r\n\r\n\r\nclass TestQNodeIntegration:\r\n ...
[ [ "numpy.array", "numpy.all", "numpy.testing.assert_array_equal" ] ]
RotemBadash/IML.HUJI
[ "2b20d074c159123f61b321a7e84312ab82400949" ]
[ "IMLearn/learners/regressors/polynomial_fitting.py" ]
[ "from __future__ import annotations\nfrom typing import NoReturn\nfrom . import LinearRegression\nfrom ...base import BaseEstimator\nimport numpy as np\n\n\nclass PolynomialFitting(BaseEstimator):\n \"\"\"\n Polynomial Fitting using Least Squares estimation\n \"\"\"\n def __init__(self, k: int) -> Polyn...
[ [ "numpy.vander" ] ]
LvJC/cpp-libtorch
[ "4a56dda616bde50423591e7a4d4d7be6a978f6bf" ]
[ "MyModule.py" ]
[ "import torch\nimport torchvision\n\n# An instance of your model.\nmodel = torchvision.models.resnet18()\n\n# An example input you would normally provide to your model's forward() method.\nexample = torch.rand(1, 3, 224, 224)\n\n# Use torch.jit.trace to generate a torch.jit.ScriptModule via tracing.\ntraced_script_...
[ [ "torch.rand", "torch.jit.trace" ] ]
demarley/leopard
[ "52c5eb2dd732798972d429887c273f8449039c8f" ]
[ "python/deepLearningTorch.py" ]
[ "\"\"\"\nCreated: 16 August 2018\nLast Updated: 16 August 2018\n\nDan Marley\ndaniel.edison.marley@cernSPAMNOT.ch\nTexas A&M University\n-----\n\nClass for performing deep learning in pytorch\n\nDesigned for running on desktop at TAMU\nwith specific set of software installed\n--> not guaranteed to work in ...
[ [ "torch.nn.Linear", "torch.load", "sklearn.model_selection.StratifiedKFold", "torch.nn.functional.sigmoid", "sklearn.metrics.roc_curve", "torch.autograd.Variable", "numpy.std", "torch.nn.functional.relu", "torch.from_numpy", "torch.nn.ModuleList", "torch.nn.BCELoss", ...
THU-DA-6D-Pose-Group/self6dpp
[ "c267cfa55e440e212136a5e9940598720fa21d16" ]
[ "core/csrc/torch_nndistance/test.py" ]
[ "import torch\nimport os.path as osp\nimport sys\nfrom torch.autograd import Variable\n\ncur_dir = osp.dirname(osp.abspath(__file__))\nsys.path.insert(0, cur_dir)\nimport torch_nndistance as NND\n\n\np1 = torch.rand(10, 1000, 3)\np2 = torch.rand(10, 1500, 3)\npoints1 = Variable(p1, requires_grad=True)\npoints2 = p2...
[ [ "torch.sum", "torch.rand", "torch.autograd.Variable" ] ]
gorff/Toric-Code-Correlated-Error-Decoder
[ "c43cf34c22f03334add078f5d02e6604e5c89cba" ]
[ "project/correctiondemos/pythag_test.py" ]
[ "\nimport matplotlib.pyplot as plt\nimport matplotlib.mlab as mlab\nimport numpy as np\nimport os,sys,inspect\nimport imageio\n\nsys.path.insert(1, os.path.join(sys.path[0], '..')) #go up a dir to import\nimport CodePy2.funmath as funmath\n#import imageio\nn = 1.0\nsizes = [i/n for i in range(33*int(n))]\n\nxvals ...
[ [ "matplotlib.pyplot.figure", "matplotlib.pyplot.grid", "matplotlib.pyplot.axis", "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.close", "numpy.sqrt", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel" ] ]
SunYanCN/nlp-experiments-in-pytorch
[ "5d05a53146dffd707e4d037230656f980d7be05c" ]
[ "models/Transformer.py" ]
[ "import copy\nimport math\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\n\nfrom utils.utils import clones\n\n\nclass LayerNormGoogle(nn.Module):\n def __init__(self, features, epsilon=1e-6):\n ...
[ [ "torch.ones", "matplotlib.pyplot.legend", "torch.nn.Linear", "torch.nn.init.xavier_uniform_", "torch.cos", "torch.mean", "matplotlib.pyplot.figure", "torch.nn.functional.softmax", "torch.nn.Embedding", "numpy.arange", "torch.sin", "matplotlib.pyplot.show", "torc...
donyori/2018ccf_bdci_inter_fund_correlation_prediction
[ "6e06a3e192e05ae1e9822111cf323eda3a61bf4e" ]
[ "program/model/version/ver1_2.py" ]
[ "from tensorflow import keras\n\nfrom constants import TRADING_DAYS_PER_WEEK, INDEX_RETURN_INDICATOR_NUMBER\nfrom ..constants import *\n\nMODEL_NAME = 'ifcp_model_ver1_2'\nROLLING_WINDOW_SIZE = TRADING_DAYS_PER_WEEK\n\n\ndef build_model():\n fund1_return = keras.Input(shape=(ROLLING_WINDOW_SIZE, 1), name=FUND1_R...
[ [ "tensorflow.keras.layers.concatenate", "tensorflow.keras.regularizers.l2", "tensorflow.keras.layers.subtract", "tensorflow.keras.Model", "tensorflow.keras.regularizers.l1", "tensorflow.keras.layers.Dense", "tensorflow.keras.Input" ] ]
simonfong6/micro-projects
[ "5be195ea72ce117df6da041446f11c18e102b5df" ]
[ "ml_tutorial/test.py" ]
[ "import svm as SVM\nimport numpy as np\n\ndata_dict = {\t-1:np.array(\t[[10,9,1],\n\t\t\t\t[2,8,1],\n\t\t\t\t[3,8,1],]),\n \n\t\t1:np.array(\t[[5,1,1],\n \t [6,-1,1],\n \t [7,3,1],])}\n\nsvm = SVM.Support_Vector_Machine()\nsvm.fit(data=data_dict)\n\npredict_...
[ [ "numpy.array" ] ]
OnionIoT/tau-lidar-camera
[ "a70b24e18be8e4c5abfe525c6768fbc10a492fd8" ]
[ "examples/distancePlusAmplitude.py" ]
[ "import argparse\nimport numpy as np\nimport cv2\n\nfrom TauLidarCommon.frame import FrameType\nfrom TauLidarCamera.camera import Camera\n\ndef setup(serialPort=None):\n port = None\n camera = None\n\n # if no serial port is specified, scan for available Tau Camera devices\n if serialPort is None:\n ...
[ [ "numpy.frombuffer" ] ]
R-aryan/Jigsaw-Toxic-Comment-Classification
[ "e5e4da7df379ac1b315f2bde655386180f39c517" ]
[ "backend/services/toxic_comment_jigsaw/application/ai/training/src/train.py" ]
[ "import pandas as pd\nimport numpy as np\nimport torch\n\nfrom sklearn.model_selection import train_test_split\nfrom backend.services.toxic_comment_jigsaw.application.ai.model import BERTClassifier\nfrom backend.services.toxic_comment_jigsaw.application.ai.training.src.dataset import BERTDataset\nfrom backend.servi...
[ [ "numpy.array", "torch.utils.data.DataLoader", "sklearn.model_selection.train_test_split", "pandas.read_csv" ] ]
chensnathan/CARAFE_CUDA
[ "33d3d3af69b24fc679f6a3a071a19070dc46664b" ]
[ "carafe_layer/setup.py" ]
[ "from setuptools import setup\nfrom torch.utils.cpp_extension import BuildExtension, CUDAExtension\n\nsetup(\n name='carafe_layer_cuda',\n ext_modules=[\n CUDAExtension('carafe_layer_cuda', [\n 'src/carafe_layer_cuda.cpp',\n 'src/carafe_layer_kernel.cu',\n ])\n ],\n c...
[ [ "torch.utils.cpp_extension.CUDAExtension" ] ]
AU-DATALAB/newsFluxus
[ "20522b2c8c830d2377a9620d149a515baaaa9cf4" ]
[ "src/saffine/detrending_coeff.py" ]
[ "from numpy import *\r\nimport numpy as np\r\n# from numba import jit\r\n\r\n# @jit\r\n\r\ndef detrending_coeff(win_len , order):\r\n\r\n#win_len = 51\r\n#order = 2\r\n\tn = (win_len-1)/2\r\n\tA = mat(ones((win_len,order+1)))\r\n\tx = np.arange(-n , n+1)\r\n\tfor j in range(0 , order + 1):\r\n\t\tA[:,j] = mat(x ** ...
[ [ "numpy.arange" ] ]
RedTachyon/OpenTraj
[ "8277f526d714a4e77d0f9f354259ff5b74e59fd2" ]
[ "opentraj/toolkit/loaders/loader_pets.py" ]
[ "# Author: Javad Amirian\n# Email: amiryan.j@gmail.com\n\nimport xml.etree.ElementTree as et\n\nimport numpy as np\nimport pandas as pd\n\nfrom opentraj.toolkit.core.trajdataset import TrajDataset\nfrom opentraj.toolkit.utils.calibration.camera_calibration_tsai import *\n\n\ndef load_pets(path, **kwargs):\n \"\"...
[ [ "numpy.array" ] ]
t-brink/pyiron
[ "c07552b54a39e3f036ba395325cd4b372af0f794" ]
[ "pyiron/vasp/potential.py" ]
[ "# coding: utf-8\n# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department\n# Distributed under the terms of \"New BSD License\", see the LICENSE file.\n\nimport os\nimport posixpath\n\nimport numpy as np\nimport pandas\nimport tables\nimport warnings\nfrom pyiron...
[ [ "pandas.Series", "pandas.DataFrame", "pandas.concat", "numpy.core.defchararray.find", "numpy.where" ] ]
MECLabTUDA/ACS
[ "bb418c5479a3585138c48c63112352f5cc8f64b1" ]
[ "mp/models/continual/model_utils.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom mp.models.segmentation.unet_fepegar import UNet2D\n\n### UNet Wrapper ###\nclass UNet2D_dis(UNet2D):\n r\"\"\"Wrapper for UNet2D to access encoder and decoder seperately.\n \"\"\"\n def __init__(self, *args, **kwargs):\n sup...
[ [ "torch.stack", "torch.rand", "torch.nn.Conv2d", "torch.nn.InstanceNorm2d", "torch.nn.Sigmoid", "torch.nn.ConvTranspose2d", "torch.nn.BatchNorm2d", "torch.nn.Softmax", "torch.var", "torch.nn.AvgPool2d", "torch.mean", "torch.nn.AdaptiveMaxPool2d", "torch.tensor", ...
hashi0203/deep-video-mvs
[ "b3943a9249d522dca3e6cd603e427f611cc7bad5", "fa14288f149c5af7b2a49092f729f5c4f44517ba" ]
[ "dataset/7scenes-export/7scenes-export-color.py", "dvmvs/pairnet/run-testing.py" ]
[ "import os\nimport shutil\nfrom multiprocessing.pool import Pool\n\nimport cv2\nimport numpy as np\nfrom functools import partial\nfrom path import Path\n\n\ndef process_scene(input_directory, output_folder):\n K = np.array([[525.0, 0.0, 320.0],\n [0.0, 525.0, 240.0],\n [0.0, 0....
[ [ "numpy.array", "numpy.loadtxt" ], [ "numpy.fromfile", "torch.load", "numpy.transpose", "torch.no_grad", "torch.from_numpy", "torch.device", "numpy.loadtxt" ] ]
lukasc-ch/QuantLab
[ "7ddcc51ec1131a58269768cd898ce04e8b49beb6" ]
[ "quantlab/COCO/YOLOv3Tiny/postprocess.py" ]
[ "# Copyright (c) 2019 UniMoRe, Matteo Spallanzani\n\nimport torch\n\nfrom ..utils.utils import xywh2xyxy, bbox_iou\n\n\ndef clip_boxes(boxes):\n boxes[:, [0, 2]] = boxes[:, [0, 2]].clamp(min=0, max=1)\n boxes[:, [1, 3]] = boxes[:, [1, 3]].clamp(min=0, max=1)\n\n\ndef postprocess_pr(pr_outs, conf_thres=0.001, ...
[ [ "torch.cat", "torch.isfinite" ] ]
NicoSerranoP/PySyft
[ "87fcd566c46fce4c16d363c94396dd26bd82a016" ]
[ "syft/frameworks/torch/mpc/fss.py" ]
[ "\"\"\"\nThis is an implementation of Function Secret Sharing\n\nUseful papers are:\n- Function Secret Sharing- Improvements and Extensions, Boyle 2017\n Link: https://eprint.iacr.org/2018/707.pdf\n- Secure Computation with Preprocessing via Function Secret Sharing, Boyle 2019\n Link: https://eprint.iacr.org/2019...
[ [ "torch.empty", "torch.ones", "torch.randint", "torch.split", "torch.tensor", "torch.gather", "torch.arange", "torch.IntTensor", "torch.cat" ] ]
neurodebian/scikits.image-1
[ "33206f87c5e0208e7ff0d5910ac082b3353fe04e", "33206f87c5e0208e7ff0d5910ac082b3353fe04e" ]
[ "skimage/exposure/exposure.py", "skimage/filter/_gabor.py" ]
[ "import warnings\nimport numpy as np\n\nfrom skimage import img_as_float\nfrom skimage.util.dtype import dtype_range, dtype_limits\nfrom skimage._shared.utils import deprecated\n\n\n__all__ = ['histogram', 'cumulative_distribution', 'equalize',\n 'rescale_intensity', 'adjust_gamma',\n 'adjust_lo...
[ [ "numpy.log2", "numpy.interp", "numpy.histogram", "numpy.any", "numpy.issubdtype", "numpy.exp", "numpy.clip", "numpy.max", "numpy.min", "numpy.nonzero" ], [ "numpy.zeros", "numpy.cos", "numpy.exp", "numpy.log", "numpy.sin", "numpy.real", "nump...
daoran/opendr
[ "bca25f6a43244fe9c219a24576181f94a0726923" ]
[ "tests/sources/tools/perception/object_tracking_2d/deep_sort/test_object_tracking_2d_deep_sort.py" ]
[ "# Copyright 2020-2022 OpenDR European Project\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 applicab...
[ [ "torch.equal" ] ]
maxiaoba/rlk
[ "3e23473f6bbc59552b6b2bcd97245e024d7ca95d", "3e23473f6bbc59552b6b2bcd97245e024d7ca95d", "3e23473f6bbc59552b6b2bcd97245e024d7ca95d", "3e23473f6bbc59552b6b2bcd97245e024d7ca95d" ]
[ "tests/DifferentialGame/masac_gnn_gaussian.py", "tests/Simple/SupLstm/visualize_policy.py", "tests/MultiDifferentialGame/r2g_gnn11_share_gaussian.py", "tests/Particle/coma_gaussian.py" ]
[ "import copy\nimport torch.nn as nn\nfrom rlkit.launchers.launcher_util import setup_logger\nimport rlkit.torch.pytorch_util as ptu\nfrom rlkit.core.ma_eval_util import get_generic_ma_path_information\n\ndef experiment(variant):\n num_agent = variant['num_agent']\n from differential_game import DifferentialGa...
[ [ "torch.nn.Linear", "torch.nn.ReLU", "torch.manual_seed", "numpy.random.seed" ], [ "torch.load" ], [ "torch.nn.Linear", "torch.manual_seed", "torch.save", "numpy.random.seed", "torch.nn.LeakyReLU" ], [ "torch.nn.Linear", "torch.manual_seed", "numpy.ra...
jrsassen/megaman
[ "faccaf267aad0a8b18ec8a705735fd9dd838ca1e" ]
[ "megaman/geometry/tests/test_adjacency.py" ]
[ "# LICENSE: Simplified BSD https://github.com/mmp2/megaman/blob/master/LICENSE\n\nfrom nose import SkipTest\n\nimport numpy as np\nfrom numpy.testing import assert_allclose, assert_raises, assert_equal\nfrom scipy.sparse import isspmatrix\nfrom scipy.spatial.distance import cdist, pdist, squareform\n\nfrom megaman....
[ [ "numpy.testing.assert_raises", "scipy.spatial.distance.pdist", "scipy.spatial.distance.cdist", "numpy.random.RandomState", "numpy.arange", "numpy.random.rand", "scipy.sparse.isspmatrix" ] ]
scopatz/PyTables
[ "05a74def785688abd802224a5ba44393a701ebc7", "05a74def785688abd802224a5ba44393a701ebc7", "05a74def785688abd802224a5ba44393a701ebc7" ]
[ "bench/create-large-number-objects.py", "tables/tests/common.py", "examples/tutorial2.py" ]
[ "\"This creates an HDF5 file with a potentially large number of objects\"\n\nimport sys\nimport numpy\nimport tables\n\nfilename = sys.argv[1]\n\n# Open a new empty HDF5 file\nfileh = tables.open_file(filename, mode=\"w\")\n\n# nlevels -- Number of levels in hierarchy\n# ngroups -- Number of groups on each level\n#...
[ [ "numpy.array" ], [ "numpy.all" ], [ "numpy.arange", "numpy.dtype" ] ]
aljanabim/svea
[ "37d27089237af3777456d7664473ffb811dabf33" ]
[ "src/teleop_tools/mouse_teleop/scripts/mouse_teleop.py" ]
[ "#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Copyright (c) 2015 Enrique Fernandez\n# Released under the BSD License.\n#\n# Authors:\n# * Enrique Fernandez\n\nimport Tkinter\n\nimport rospy\nfrom geometry_msgs.msg import Twist, Vector3\n\nimport numpy\n\n\nclass MouseTeleop():\n def __init__(self):\n ...
[ [ "numpy.rad2deg" ] ]
dnjst/squidpy
[ "ca765d04b9621debb8752d3d4693dd68f6909513" ]
[ "tests/image/test_segmentation.py" ]
[ "from typing import Tuple, Union, Callable, Optional, Sequence\nfrom pytest_mock import MockerFixture\nimport pytest\n\nimport numpy as np\nimport dask.array as da\n\nfrom squidpy.im import (\n segment,\n ImageContainer,\n SegmentationCustom,\n SegmentationWatershed,\n)\nfrom squidpy.im._segment import ...
[ [ "numpy.zeros_like", "numpy.ones", "numpy.zeros", "numpy.testing.assert_array_equal", "numpy.mean" ] ]
schibsen/MLops_exercises_organized
[ "2c9b386fed7b1e400524905cb68f220caf9d015b" ]
[ "src/models/model.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass MyAwesomeModel(nn.Module):\n def __init__(self, n_classes):\n super(MyAwesomeModel, self).__init__()\n\n self.feature_extractor = nn.Sequential(\n nn.Conv2d(in_channels=1, out_channels=6, kernel_size=4, stri...
[ [ "torch.nn.functional.log_softmax", "torch.nn.Linear", "torch.flatten", "torch.nn.Tanh", "torch.nn.Conv2d", "torch.nn.AvgPool2d" ] ]
hugerepo-tianhang/low_dim_update_stable
[ "565f6cbf886d266d0633bc112ccae28f1d116ee1" ]
[ "stable_baselines/cmaes/cma_redo.py" ]
[ "from stable_baselines.ppo2.run_mujoco import eval_return\nimport cma\n\nimport numpy as np\nfrom stable_baselines.low_dim_analysis.eval_util import *\nfrom stable_baselines.low_dim_analysis.common import do_pca, plot_2d, \\\n dump_rows_write_csv, generate_run_dir, do_proj_on_first_n_IPCA, get_allinone_concat_df...
[ [ "numpy.vstack", "numpy.sum", "numpy.matmul", "pandas.read_csv", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "numpy.min", "numpy.max", "numpy.array", "sklearn.decomposition.IncrementalPCA", "numpy.linalg.norm", "matplotlib....
larsbarring/icclim
[ "f3685c77a1a3aaff58b0d05609380c9387e9aa99" ]
[ "icclim/user_indices/stat.py" ]
[ "from typing import Sequence\n\nimport numpy as np\nimport xarray\nfrom xarray import DataArray\nfrom xclim.indices.run_length import rle_1d\n\n\ndef get_longest_run_start_index(\n arr: DataArray,\n window: int = 1,\n dim: str = \"time\",\n) -> DataArray:\n return xarray.apply_ufunc(\n get_index_...
[ [ "numpy.any", "numpy.where", "numpy.all" ] ]
Ikerlz/dcd
[ "056e5c4060f9d655ce4f6234b86481ae4b3f7106" ]
[ "DC_method/util.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom sklearn.cluster import KMeans\nimport itertools\nimport findspark\nimport pyspark\nfrom pyspark.sql.functions import pandas_udf, PandasUDFType\nfrom pyspark.sql.types import *\nimport time\n\n\ndef simulate_sbm_dc_data(sbm_matrix, sample_size=1000, partition_num=10, cl...
[ [ "numpy.random.binomial", "numpy.sum", "numpy.empty", "numpy.zeros", "numpy.append", "pandas.DataFrame", "numpy.argsort", "numpy.linalg.svd", "sklearn.cluster.KMeans", "numpy.array", "numpy.dot", "numpy.random.randint", "numpy.linalg.norm", "numpy.linalg.eig"...
denix56/fcdd
[ "d110aa8b141dc13f47156da913a6b4f9d64ddc74" ]
[ "python/fcdd/datasets/outlier_exposure/emnist.py" ]
[ "import os.path as pt\n\nimport numpy as np\nimport torchvision.transforms as transforms\nimport torch\nfrom torch.utils.data import DataLoader\nfrom torchvision.datasets import EMNIST\n\n\ndef ceil(x: float):\n return int(np.ceil(x))\n\n\nclass MyEMNIST(EMNIST):\n \"\"\" Reimplements get_item to transform te...
[ [ "torch.utils.data.DataLoader", "numpy.ceil" ] ]
ava6969/rgb_stacking_extend
[ "a36f1e35aa796e77201321161056e174966e7707" ]
[ "rgb_stacking/contrib/common.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\nfrom rgb_stacking.utils.utils import init\n\n\nclass Flatten(nn.Module):\n def forward(self, x):\n return x.view(x.size(0), -1)\n\n\nclass Sum(nn.Module):\n def __init__(self, dim):\n super().__init__()\n self.dim = dim\n\n def ...
[ [ "torch.sum", "torch.nn.init.constant_", "numpy.sqrt", "torch.nn.init.orthogonal_", "torch.mean" ] ]
SunsetWolf/qlib
[ "89972f6c6f9fa629b4f74093d4ba1e93c9f7a5e5" ]
[ "qlib/contrib/data/highfreq_processor.py" ]
[ "import os\n\nimport numpy as np\nimport pandas as pd\nfrom qlib.data.dataset.processor import Processor\nfrom qlib.data.dataset.utils import fetch_df_by_index\nfrom typing import Dict\n\n\nclass HighFreqTrans(Processor):\n def __init__(self, dtype: str = \"bool\"):\n self.dtype = dtype\n\n def fit(sel...
[ [ "numpy.save", "numpy.log1p", "numpy.load", "numpy.nanmax", "numpy.nanmean", "pandas.DataFrame", "numpy.nanmin", "numpy.absolute" ] ]
hgKwak/SeriesSleepNet-
[ "1e90c3a0ed6244c2b876979194d7cd94056f5c8a" ]
[ "network/cnn.py" ]
[ "import torch\nimport torch.nn as nn\n\nuse_cuda = torch.cuda.is_available()\nclass CNNClassifier(nn.Module):\n def __init__(self, channel, SHHS=False):\n super(CNNClassifier, self).__init__()\n conv1 = nn.Conv2d(1, 10, (1, 200))\n pool1 = nn.MaxPool2d((1, 2))\n if channel == 1:\n ...
[ [ "torch.nn.MaxPool2d", "torch.nn.Linear", "torch.cuda.is_available", "torch.nn.Conv2d", "torch.nn.ReLU" ] ]
WildflowerSchools/wf-cv-utils
[ "647a2a46e3d6e6e14a1f813d17064cb33a3ced92" ]
[ "cv_utils/core.py" ]
[ "import cv_datetime_utils\nimport cv2 as cv\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport scipy.optimize\nimport json\nimport os\n\ndef compose_transformations(\n rotation_vector_1,\n translation_vector_1,\n rotation_vector_2,\n translation_vector_2):\n rotation_vector_...
[ [ "numpy.arctan2", "numpy.matmul", "numpy.sort", "numpy.multiply", "numpy.empty", "numpy.squeeze", "numpy.zeros", "numpy.linalg.inv", "numpy.full_like", "numpy.arctan", "numpy.subtract", "numpy.asarray", "numpy.arange", "numpy.array", "numpy.square", "...
teomores/kafka-twitter
[ "29d7c48fd1d225e33ec06be9bfed1826fa4d6b60" ]
[ "data_preprocessing/tweet_api.py" ]
[ "# Import the Twython class\nfrom twython import Twython\nimport json\nimport os\nimport pandas as pd\nfrom tqdm import tqdm\n\ntry:\n os.remove('twitter_dataset.csv')\nexcept OSError:\n pass\n\ndef main():\n old_df = pd.read_csv('data/twitter_dataset_2.csv', lineterminator='\\n')\n #first load the dict...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
RaulAstudillo/bocf
[ "cd84eab2d1b4ea5a4bdeeb452df92296afbafb87" ]
[ "GPy/kern/src/static.py" ]
[ "# Copyright (c) 2012, GPy authors (see AUTHORS.txt).\n# Licensed under the BSD 3-clause license (see LICENSE.txt)\n\n\nfrom .kern import Kern\nimport numpy as np\nfrom ...core.parameterization import Param\nfrom paramz.transformations import Logexp\nfrom paramz.caching import Cache_this\n\nclass Static(Kern):\n ...
[ [ "numpy.ones", "numpy.eye", "numpy.empty", "numpy.zeros", "numpy.trace", "numpy.einsum", "numpy.diagonal", "numpy.full" ] ]
jacenkow/inside
[ "6f860420644b50b78981158a59ceed8cdbd209bf" ]
[ "inside/pipelines/clevr.py" ]
[ "# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2020 Grzegorz Jacenków.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n# use this file except in compliance with the License. You may obtain a copy of\n# the License at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Unless require...
[ [ "tensorflow.GradientTape", "tensorflow.keras.metrics.Mean" ] ]
BaratiLab/GAMD
[ "7de91526f1c8c06ea005920e6a55c3cf031c26b2" ]
[ "dataset/generate_tip4p_data.py" ]
[ "from openmmtools import testsystems\nfrom simtk.openmm.app import *\nimport simtk.unit as unit\n\nimport logging\n\nimport numpy as np\n\nfrom openmmtools.constants import kB\nfrom openmmtools import respa, utils\n\nlogger = logging.getLogger(__name__)\n\n# Energy unit used by OpenMM unit system\nfrom openmmtools ...
[ [ "numpy.random.uniform", "numpy.matmul", "numpy.savez", "numpy.random.randn", "numpy.cos", "numpy.sin", "numpy.mean" ] ]
Intelligent-Systems-Lab/ISL-BCFL
[ "42ceb86708a76e28b31c22b33c15ee9a6a745ec7" ]
[ "script/app/agg.py" ]
[ "import os\n# import torch\nimport argparse\nimport base64\nimport sys\nimport io\n\nimport torch\nimport torch.nn as nn\nfrom torchvision import transforms\nfrom torch.utils.data import DataLoader\nfrom torch.utils.data.sampler import SubsetRandomSampler\n\n\ndef fullmodel2base64(model):\n buffer = io.BytesIO()...
[ [ "torch.save" ] ]
lanagarmire/granatumx
[ "3dee3a8fb2ba851c31a9f6338aef1817217769f9" ]
[ "g_packages/deepImpute/docker/deepimpute/deepimpute/multinet.py" ]
[ "import os\nimport numpy as np\nimport pandas as pd\nimport binascii\nimport warnings\nimport tempfile\nfrom math import ceil\nfrom multiprocessing import cpu_count, sharedctypes\nfrom multiprocessing.pool import Pool\nfrom sklearn.metrics import r2_score\n\nfrom deepimpute.net import Net\nfrom deepimpute.normalize...
[ [ "numpy.intersect1d", "pandas.DataFrame", "numpy.random.seed", "numpy.reshape", "numpy.random.choice", "numpy.setdiff1d", "pandas.concat", "numpy.ctypeslib.as_array", "numpy.corrcoef" ] ]
XinChCh/singa
[ "93fd9da72694e68bfe3fb29d0183a65263d238a1" ]
[ "test/python/test_tensor.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.sum", "numpy.matmul", "numpy.transpose", "numpy.ceil", "numpy.einsum", "numpy.reshape", "numpy.random.seed", "numpy.asarray", "numpy.repeat", "numpy.random.randn", "numpy.random.random", "numpy.tensordot", "numpy.testing.assert_array_almost_equal", "n...
hyperfraise/action-detection
[ "a3ee263ed701ed251cd0a79830ef796889ff366e" ]
[ "ssn_dataset.py" ]
[ "import torch.utils.data as data\n\nimport os\nimport os.path\nfrom numpy.random import randint\nfrom ops.io import load_proposal_file\nfrom transforms import *\nfrom ops.utils import temporal_iou\n\n\nclass SSNInstance:\n def __init__(\n self,\n start_frame,\n end_frame,\n video_fram...
[ [ "numpy.random.randint" ] ]
delldu/EDSR
[ "98752b57a3091e693c523e710380d369f9913041" ]
[ "src/model/vdsr.py" ]
[ "from model import common\n\nimport torch.nn as nn\nimport torch.nn.init as init\n\nurl = {\n 'r20f64': ''\n}\n\ndef make_model(args, parent=False):\n return VDSR(args)\n\nclass VDSR(nn.Module):\n def __init__(self, args, conv=common.default_conv):\n super(VDSR, self).__init__()\n\n n_resbloc...
[ [ "torch.nn.ReLU", "torch.nn.Sequential" ] ]
NunoEdgarGFlowHub/PyBaMM
[ "4e4e1ab8c488b0c0a6efdb9934c5ac59e947a190", "4e4e1ab8c488b0c0a6efdb9934c5ac59e947a190" ]
[ "tests/unit/test_parameters/test_current_functions.py", "pybamm/expression_tree/binary_operators.py" ]
[ "#\n# Tests for current input functions\n#\nimport pybamm\nimport numbers\nimport unittest\nimport numpy as np\n\n\nclass TestCurrentFunctions(unittest.TestCase):\n def test_constant_current(self):\n # test simplify\n current = pybamm.electrical_parameters.current_with_time\n parameter_value...
[ [ "numpy.sin", "numpy.linspace", "numpy.zeros" ], [ "numpy.ones", "numpy.zeros", "scipy.sparse.issparse", "scipy.sparse.csr_matrix", "numpy.errstate", "numpy.all", "numpy.maximum", "numpy.minimum" ] ]
YongLiuLab/BrainRadiomicsTools
[ "19b440acd554ee920857c306442b6d2c411dca88" ]
[ "Core/hippoSeg/LiviaNet/startTraining.py" ]
[ "\"\"\" \nCopyright (c) 2016, Jose Dolz .All rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of condi...
[ [ "numpy.array", "numpy.ones", "numpy.zeros", "sklearn.cross_validation.LeaveOneOut" ] ]
T3p/policy-optimization
[ "77006545779823737c4ca3b19e9d80506015c132" ]
[ "potion/envs/minigolf.py" ]
[ "from numbers import Number\n\nimport gym\nfrom gym import spaces\nfrom gym.utils import seeding\nimport numpy as np\nimport math as m\nfrom scipy.stats import norm\n\n\"\"\"\nMinigolf task.\nReferences\n----------\n - Penner, A. R. \"The physics of putting.\" Canadian Journal of Physics 80.2 (2002): 83-96.\n\"\"\...
[ [ "numpy.sqrt", "numpy.zeros", "scipy.stats.norm.pdf", "numpy.abs", "numpy.ravel", "numpy.clip", "numpy.array" ] ]
jenildesai25/WebScrapping
[ "41937094a7963d53ab09e3ceff055dca4a95f13f" ]
[ "WebScraping2.py" ]
[ "\n# Online References used :\n# https://github.com/imadmali/movie-scraper/blob/master/MojoLinkExtract.py\n# https://www.crummy.com/software/BeautifulSoup/bs4/doc/\n# https://nycdatascience.com/blog/student-works/scraping-box-office-mojo/\n# https://www.youtube.com/watch?v=XQgXKtPSzUI\n# https://www.youtube.com/wat...
[ [ "pandas.read_csv", "pandas.concat", "pandas.to_numeric" ] ]
IKupriyanov-HORIS/lets-plot-docs
[ "30fd31cb03dc649a03518b0c9348639ebfe09d53" ]
[ "docs/_downloads/e0051c6e37b730111a06abd85529e288/plot__2d_distributions.py" ]
[ "\"\"\"\r\n2D Distributions\r\r\n================\r\r\n\r\r\nSome plots visualize a transformation of the original data set. Use a\r\r\nstat parameter to choose a common transformation to visualize.\r\r\n\r\r\nEach stat creates additional variables to map aesthetics to. These\r\r\nvariables use a common ..name.. sy...
[ [ "pandas.read_csv" ] ]