repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
tobias-fyi/vela
[ "b0b3d3c6dc3fa397c8c7a492098a02cf75e0ff82" ]
[ "ds/kb/code/neural-network-from-scratch.py" ]
[ "import numpy as np\n\ndef neural_network(X, y):\n W1 = np.random.rand(2, 4)\n W2 = np.random.rand(4, 1)\n output = np.zeros((4,1))\n\n for epochs in range(10000): \n layer = 1 / (1 + np.exp(-np.dot(X, W1)))\n output = 1 / (1 + np.exp(-np.dot(layer, W2)))\n error = (y - output)\n ...
[ [ "numpy.array", "numpy.dot", "numpy.random.rand", "numpy.zeros", "numpy.round" ] ]
THU-CVlab/MEPDNet-pytorch
[ "af033785fe183a4360f3f395087b45aba377d2bc" ]
[ "utils/use.py" ]
[ "import os\nimport cv2\nimport glob\nimport torch\nimport shutil\nimport datetime\nimport numpy as np\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom PIL import Image\nfrom tqdm import tqdm\nfrom os.path import split,splitext\nfrom utils import setup_logger, is_image_file, SeqUseDataset, SingleUseDa...
[ [ "torch.sigmoid", "torch.no_grad", "numpy.save", "torch.utils.data.DataLoader", "torch.load", "torch.nn.functional.softmax", "torch.argmax" ] ]
korhanpolat/phoenix_term_discovery
[ "61532ff89d6de37dadd2a137dc1cfc3f66a04190" ]
[ "utils/sdtw_pipeline.py" ]
[ "from utils.eval import evaluate\n\n\nfrom joblib import Parallel, delayed\nfrom itertools import combinations\n\n\nfrom utils.sdtw_funcs import sdtw_jit, LCMA_jit, joints_loss, sdtw_np, LCMA_jit_new\n\nfrom utils.ZR_utils import new_match_dict, change_post_disc_thr, post_disc2, get_nodes_df, get_clusters_list, run...
[ [ "sklearn.metrics.pairwise.cosine_similarity", "sklearn.metrics.pairwise.euclidean_distances", "sklearn.metrics.pairwise.cosine_distances", "numpy.floor" ] ]
mjziebarth/gimli
[ "5fafebb7c96dd0e04e2616df402fa27a01609d63", "5fafebb7c96dd0e04e2616df402fa27a01609d63" ]
[ "tests/basics/testAssemblePerf.py", "python/pygimli/physics/traveltime/raplot.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\npygimli integration function\n\"\"\"\n\nimport pygimli as pg\nimport numpy as np\n\ndef test(N):\n \n x = np.linspace(0, 1, N)\n\n pg.tic()\n mesh = pg.createGrid(x, x, x)\n print(mesh)\n pg.toc()\n \n A = pg.RSparseMatrix()\n A.fil...
[ [ "numpy.linspace" ], [ "matplotlib.pyplot.colorbar", "numpy.loadtxt", "numpy.arange", "numpy.absolute", "numpy.unique" ] ]
Eralys/pywph_dev
[ "bb864050c73b168c32a59f37ac0aca71ff159aed" ]
[ "tests/wph_quijote/wph_syntheses/sufficient_stat.py" ]
[ "import torch\n\nfrom .utils import periodic_dis\n\ndef compute_idx_of_sufficient_stat(L, J, dj, dl, dn):\n L2 = L * 2\n idx_j1, idx_j2, idx_k1, idx_k2, idx_ell2, idx_dn1, idx_dn2 = [], [], [], [], [], [], []\n idx_lists = (idx_j1, idx_j2, idx_k1, idx_k2, idx_ell2, idx_dn1, idx_dn2)\n\n # j1=j2, k1=0,1,...
[ [ "torch.tensor" ] ]
iklasky/timemachines
[ "1820fa9453d31d4daaeff75274a935c7455febe3" ]
[ "timemachines/skatertools/evaluation/evaluators.py" ]
[ "from timemachines.skatertools.data.synthetic import brownian_with_noise, brownian_with_exogenous\nfrom timemachines.skating import residuals, prior_with_sporadic_fit\nfrom timemachines.inclusion.sklearninclusion import using_sklearn\nfrom timemachines.inclusion.scipyinclusion import using_scipy\nimport numpy as np...
[ [ "scipy.stats.energy_distance" ] ]
ermubuzhiming/open_model_zoo
[ "d204db6ae8afcfb9c484047e538692c89d775bf1", "d204db6ae8afcfb9c484047e538692c89d775bf1" ]
[ "demos/common/python/models/segmentation.py", "tools/accuracy_checker/accuracy_checker/preprocessor/geometric_transformations.py" ]
[ "\"\"\"\n Copyright (c) 2020 Intel Corporation\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law ...
[ [ "numpy.argmax", "numpy.exp" ], [ "numpy.full", "numpy.pad", "numpy.array", "numpy.linalg.matrix_rank", "numpy.ceil", "numpy.zeros", "numpy.ones", "numpy.linalg.det", "numpy.mean", "numpy.eye", "numpy.std", "numpy.finfo", "numpy.linalg.svd", "nump...
krzysztoffiok/interpret-flair
[ "2f1911213cfe78a41b5c176d1d4303ef888718b7" ]
[ "interpretation_package/.ipynb_checkpoints/interpret_flair-checkpoint.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom flair.data import Sentence\n\nfrom captum.attr import (\n LayerIntegratedGradients\n)\n\nfrom captum.attr import visualization as viz\n\n\ndef interpret_sentence(flair_model_wrapper, lig, sentence, target_label, visualization_list, n_steps=100, estimation_method=\"gau...
[ [ "torch.norm", "torch.max", "torch.ones_like", "torch.nn.functional.softmax" ] ]
haoyanbin918/Group-Contextualization
[ "aa59d9979f6f6578f143df48086260afdde65b86" ]
[ "nets/GC_GST.py" ]
[ "import torch\nimport torch.nn as nn\nimport math\nimport torch.utils.model_zoo as model_zoo\nimport torchvision.models as models\n\nfrom nets.Calibrator3D import GC_L33Dnb, GC_T13Dnb, GC_S23DDnb, GC_CLLDnb\n\n__all__ = ['ResNet', 'resnet50', 'resnet101','resnet152']\n\nmodel_urls = {\n 'resnet18': 'https://down...
[ [ "torch.nn.Linear", "torch.rand", "torch.cat", "torch.nn.init.constant_", "torch.nn.Sequential", "torch.nn.AvgPool2d", "torch.nn.MaxPool3d", "torch.nn.init.kaiming_normal_", "torch.utils.model_zoo.load_url", "torch.nn.ReLU", "torch.nn.Conv3d", "torch.zeros_like", ...
AlexandreAbraham/scikit-activeml
[ "1e1f4615948501cb9c9559de2e94433f700b2b80", "1e1f4615948501cb9c9559de2e94433f700b2b80" ]
[ "skactiveml/utils/_aggregation.py", "skactiveml/pool/tests/test_expected_error.py" ]
[ "import numpy as np\n\nfrom ._label import ExtLabelEncoder, is_labeled\nfrom sklearn.utils import check_array, check_consistent_length\n\n\ndef compute_vote_vectors(y, w=None, classes=None, missing_label=np.nan):\n \"\"\"Counts number of votes per class label for each sample.\n\n Parameters\n ----------\n ...
[ [ "numpy.full", "numpy.isnan", "numpy.ones_like", "numpy.any", "numpy.arange", "sklearn.utils.check_consistent_length", "sklearn.utils.check_array", "numpy.nanmax" ], [ "numpy.ones_like", "numpy.zeros", "numpy.testing.assert_array_equal", "numpy.ones", "sklear...
parwisenlared/Churn_analysis
[ "a2c0e36fa3b6d12cefced05bde7b922a05722f67" ]
[ "dtree_visualization.py" ]
[ "import pandas as pd\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import classification_report,confusion_matrix\nfrom sklearn.tree import DecisionTreeClassifier\n\nfrom IPython.display import Image \nfrom sklearn.externals.six import StringIO \nfrom sklearn.tree import export_graphv...
[ [ "sklearn.tree.export_graphviz", "pandas.read_csv", "sklearn.externals.six.StringIO", "sklearn.tree.DecisionTreeClassifier" ] ]
nicolossus/pylfi
[ "7950aff5c36e7368cbe77b32ef348966b905f5cf" ]
[ "_dev/inferences/rejection_abc.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\nimport logging\nimport time\n\nimport numpy as np\nfrom pylfi.inferences import ABCBase\nfrom pylfi.journal import Journal\nfrom pylfi.utils import setup_logger\nfrom tqdm.auto import tqdm\n\n\nclass RejectionABC(ABCBase):\n \"\"\"Rejection ABC.\n \"\"\"\n\n...
[ [ "numpy.array", "numpy.stack" ] ]
lewfish/cloud-buster
[ "da31c4acea30bd97f68e1ff99dbbe11e0ba13db6" ]
[ "python/preprocess/monolabel.py" ]
[ "#!/usr/bin/env python3\n\n# The MIT License (MIT)\n# =====================\n#\n# Copyright © 2020 Azavea\n#\n# Permission is hereby granted, free of charge, to any person\n# obtaining a copy of this software and associated documentation\n# files (the “Software”), to deal in the Software without\n# restriction, inc...
[ [ "numpy.ones" ] ]
Liulinghzi/DeepCTR
[ "bb3f204e368ad34d84639025480613abd99231c5" ]
[ "mydeepctr/examples/lr/controller.py" ]
[ "'''\n@Author: your name\n@Date: 2020-05-27 14:53:55\n@LastEditTime: 2020-06-09 13:07:02\n@LastEditors: Please set LastEditors\n@Description: In User Settings Edit\n@FilePath: /model-building/recommend/estimator/lr.py\n'''\nimport tensorflow as tf\nimport os\nimport sys\nimport json\nimport argparse\ntf.logging.set...
[ [ "tensorflow.logging.set_verbosity", "tensorflow.estimator.experimental.stop_if_no_decrease_hook", "tensorflow.io.FixedLenFeature", "tensorflow.ConfigProto", "tensorflow.estimator.RunConfig", "tensorflow.estimator.Estimator", "tensorflow.contrib.estimator.stop_if_no_decrease_hook" ] ]
melkisedeath/scikit-learn
[ "74a37de119d2c7c9ea1cce673c2ee207541a55d2" ]
[ "sklearn/cluster/_birch.py" ]
[ "# Authors: Manoj Kumar <manojkumarsivaraj334@gmail.com>\n# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>\n# Joel Nothman <joel.nothman@gmail.com>\n# License: BSD 3 clause\n\nimport warnings\nimport numbers\nimport numpy as np\nfrom scipy import sparse\nfrom math import sqrt\n\nfrom...
[ [ "scipy.sparse.issparse", "numpy.dot", "numpy.zeros", "numpy.argmin" ] ]
zqwei/LIF_Vis_model
[ "16f651ac827ba5f0feb40a0e619e600f1251d009", "16f651ac827ba5f0feb40a0e619e600f1251d009", "16f651ac827ba5f0feb40a0e619e600f1251d009" ]
[ "analysis_codes_v1/oscillations_run.py", "analysis_codes_v1/f_rate_hist.py", "analysis_codes_v2/i_amplification_fit_for_cells.py" ]
[ "import matplotlib\nmatplotlib.use('Agg')\nimport oscillations\nimport pickle\nimport numpy as np\nimport matplotlib.pyplot as plt\nmatplotlib.rcParams.update({'font.size': 20})\n\nbin_start = 500.0\nbin_stop = 3000.0\nbin_size = 1.0\n\nelectrode_pos = [0.0, 0.0, 0.0]\nr_cutoff = 10.0 # Distance, in um, below whic...
[ [ "matplotlib.use", "matplotlib.pyplot.errorbar", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.legend", "numpy.where", "matplotlib.rcParams.update", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ], [ "matplotlib.use", "numpy.histo...
MichielCottaar/pymc3
[ "f37198653e7d09881e7bc411cbd10fffbab442c2" ]
[ "pymc3/step_methods/nuts.py" ]
[ "from .quadpotential import *\nfrom .arraystep import *\nfrom ..core import *\nfrom numpy import exp, log\nfrom numpy.random import uniform\nfrom .hmc import leapfrog, Hamiltonian, bern, energy\nfrom ..distributions import *\nfrom ..tuning import guess_scaling\nimport theano\nfrom ..theanof import make_shared_repla...
[ [ "numpy.random.uniform", "numpy.exp", "numpy.log" ] ]
Bezenek/algorithmic-efficiency
[ "84aac20796d685f810960dfa4fe5524798db876e" ]
[ "algorithmic_efficiency/workloads/wmt/wmt_jax/models.py" ]
[ "\"\"\"Transformer-based machine translation model.\"\"\"\n\nfrom typing import Any, Callable, Optional\n\nfrom flax import linen as nn\nfrom flax import struct\nfrom jax import lax\nimport jax.numpy as jnp\nimport numpy as np\n\n\n@struct.dataclass\nclass TransformerConfig:\n \"\"\"Global hyperparameters used to ...
[ [ "numpy.sin", "numpy.log", "numpy.zeros", "numpy.arange", "numpy.cos" ] ]
junhee-yoo/tensorflow
[ "4af94829b94a15c4dc51571a2ddf5a015a81d98a" ]
[ "tensorflow/python/keras/layers/serialization.py" ]
[ "# Copyright 2015 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.tf2.enabled", "tensorflow.python.util.tf_export.keras_export", "tensorflow.python.keras.utils.generic_utils.deserialize_keras_object" ] ]
sokol1412/rllab_hierarchical_rl
[ "6d46c02e32c3d7e9ac55d753d6a3823ff86c5a57" ]
[ "sandbox/snn4hrl/policies/hier_snn_mlp_policy.py" ]
[ "import json\nimport os\nfrom contextlib import contextmanager\n\nimport joblib\nimport lasagne\nimport lasagne.layers as L\nimport lasagne.nonlinearities as NL\nimport numpy as np\nimport theano\nimport theano.tensor as TT\n\nfrom rllab import config\nfrom rllab.core.lasagne_layers import ParamLayer\nfrom rllab.co...
[ [ "numpy.random.normal", "numpy.array", "numpy.ones_like", "numpy.log", "numpy.zeros", "numpy.ones", "numpy.exp", "numpy.vstack" ] ]
SkynetRTN/afterglow-access-server
[ "3d8d62f622577fdd1ae7b0076cb536251f7bf0cd" ]
[ "afterglow_core/resources/job_plugins/photometry_job.py" ]
[ "\"\"\"\nAfterglow Core: batch photometry job plugin\n\"\"\"\n\nfrom datetime import datetime\nfrom typing import List as TList\n\nfrom marshmallow.fields import Integer, List, Nested\nfrom numpy import concatenate, deg2rad, isfinite, zeros\nfrom astropy.wcs import WCS\nimport sep\n\nfrom skylib.photometry import a...
[ [ "numpy.deg2rad", "numpy.isfinite", "numpy.concatenate" ] ]
ceumicrodata/respect-trade-similarity
[ "51e0ece6097fb0ee5b05277d425531fd3c7269bf" ]
[ "code/gen_df.py" ]
[ "import pandas as pd\nfrom itertools import product\n\ndata = pd.read_csv(\"../input/trade_data_filtered/cn2014.csv\")\ndata[\"PRODUCT_NC\"] = data[\"PRODUCT_NC\"].apply(lambda x: str(x[:6]))\nsixdigit_product_trade = pd.DataFrame(data.groupby([\"TRADE_TYPE\",'DECLARANT_ISO','PARTNER_ISO',\"PRODUCT_NC\"])['VALUE_IN...
[ [ "pandas.read_csv" ] ]
matwilso/boxLCD
[ "7505e27f47e6694026303aa6cf12477959fc9fba" ]
[ "research/wrappers/sync_vector_env.py" ]
[ "import numpy as np\nfrom copy import deepcopy\n\nfrom gym import logger\nfrom gym.vector.vector_env import VectorEnv\nfrom gym.vector.utils import concatenate, create_empty_array\n\n__all__ = ['SyncVectorEnv']\n\n\nclass SyncVectorEnv(VectorEnv):\n \"\"\"Vectorized environment that serially runs multiple environm...
[ [ "numpy.copy", "numpy.stack", "numpy.zeros" ] ]
alex-petrenko/curious-rl
[ "6cd0eb78ab409c68f8dad1a8542d625f0dd39114" ]
[ "algorithms/multi_env.py" ]
[ "import time\nfrom multiprocessing import Process, JoinableQueue\nfrom enum import Enum\nimport copy\n\nimport numpy as np\n\nfrom utils.utils import log, AttrDict\n\n\nclass StepType(Enum):\n REAL = 1\n IMAGINED = 2\n\n\nclass _MultiEnvWorker:\n \"\"\"Helper class for the MultiEnv.\"\"\"\n\n def __init...
[ [ "numpy.array", "numpy.arange", "numpy.asarray", "numpy.mean" ] ]
yangxy/SDL
[ "fed3a44876de5edbd1c1bb18128ab2003bb6e84b" ]
[ "losses/losses.py" ]
[ "import math\nimport torch\nfrom torch import autograd as autograd\nfrom torch import nn as nn\nfrom torch.nn import functional as F\n\nfrom basicsr.archs.vgg_arch import VGGFeatureExtractor\nfrom basicsr.utils.registry import LOSS_REGISTRY\nfrom basicsr.losses.loss_util import weighted_loss\n\n_reduction_modes = [...
[ [ "torch.var", "torch.sqrt", "torch.nn.MSELoss", "torch.bmm", "torch.abs", "torch.mean" ] ]
suki7/mmaction_fsl_78
[ "8e61f2a145a14dea0475867ce7d3a3e9936a7847" ]
[ "mmaction/models/heads/fewshot_head.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\nfrom mmcv.cnn import normal_init\n\nfrom ..registry import HEADS\nfrom .base import AvgConsensus, BaseHead\n\n\n@HEADS.register_module()\nclass FewShotHead(BaseHead):\n\n def __init__(self,\n num_classes,\n...
[ [ "torch.cosine_similarity", "torch.cat", "torch.nn.Dropout", "torch.stack", "torch.split", "torch.nn.MaxPool3d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d" ] ]
timofeymukha/wallriori
[ "a24961da70f79fd51cd0ab70a9bbeac2d939103b" ]
[ "wallriori/lawsofthewall/lawsofthewall.py" ]
[ "# wThis file is part of wallriori\n# (c) Timofey Mukha\n# The code is released under the MIT Licence.\n# See LICENCE.txt and the Legal section in the README for more information\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nimport numpy as np\nfr...
[ [ "numpy.exp", "numpy.log" ] ]
gchhablani/toxic-spans-detection
[ "5eeba0c069bef8c707d9c5fef8c6048c98d89ba5" ]
[ "integrated_gradients.py" ]
[ "import gc\nimport os\nimport pickle as pkl\nfrom captum import attr\n\nimport numpy as np\nfrom captum.attr import IntegratedGradients\nfrom datasets import Dataset\n\nimport torch\nimport torch.nn.functional as F\nfrom tqdm.auto import tqdm\nimport collections\nimport numpy as np\n\nfrom transformers import Train...
[ [ "torch.device", "numpy.array", "numpy.append", "numpy.sum", "numpy.mean", "numpy.argmax", "torch.tensor", "numpy.argsort", "torch.nn.functional.softmax", "torch.linalg.norm", "torch.sum" ] ]
jennyfothergill/signac
[ "f506f720095aac6f91cc9086c1adde5d8acbdacc" ]
[ "benchmark.py" ]
[ "#!/usr/bin/env python\n# Copyright 2018 The Regents of the University of Michigan\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of\n# this software and associated documentation files (the \"Software\"), to deal in\n# the Software without restriction, including without limitatio...
[ [ "pandas.DataFrame", "pandas.concat" ] ]
felixbur/ml_experiment
[ "3baec2d01f498c013f7547da132b319a0024292b" ]
[ "src/dataset.py" ]
[ "# dataset.py\nimport audformat\nimport pandas as pd\nimport ast\nimport os\nfrom random import sample\nfrom util import Util\nfrom plots import Plots\nimport glob_conf\n\nclass Dataset:\n \"\"\" Class to represent datasets\"\"\"\n name = '' # An identifier for the dataset\n config = None # The configurati...
[ [ "pandas.read_pickle", "pandas.DataFrame" ] ]
fuliucansheng/UniTorch
[ "47038321593ce4e7eabda555bd58c0cf89482146" ]
[ "tests/models/test_infoxlm.py" ]
[ "# Copyright (c) FULIUCANSHENG.\n# Licensed under the MIT License.\n\nimport unitorch\nimport torch\nfrom absl.testing import absltest, parameterized\nfrom unitorch import set_seed\nfrom unitorch.models.infoxlm import InfoXLMForGeneration, InfoXLMProcessor\nfrom unitorch.cli import cached_path\nfrom unitorch.cli im...
[ [ "torch.cuda.is_available" ] ]
neonbjb/keops
[ "7ec8e23d3da2de08c28b58b2a28378abd233c95b", "7ec8e23d3da2de08c28b58b2a28378abd233c95b" ]
[ "pykeops/examples/numpy/plot_test_softmax_numpy.py", "pykeops/sandbox/test_specific.py" ]
[ "\"\"\"\nSumSoftMaxWeight reduction\n==========================\n\"\"\"\n\n###############################################################################\n# Using the :class:`numpy.Genred <pykeops.numpy.Genred>` class,\n# we show how to perform a computation specified through:\n#\n# * Its **inputs**:\n#\n# - :...
[ [ "numpy.max", "numpy.linalg.norm", "numpy.random.rand", "numpy.sum", "matplotlib.pyplot.plot", "numpy.random.randn", "matplotlib.pyplot.legend", "numpy.exp", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.show", "matplotlib.pyplot.subplot" ], [ "numpy.allcl...
nprakash13/MPC-Case-Study
[ "dafd5eae3af5be332d33574d53adc596f75973a6" ]
[ "Development/F_in Code/template_mpc1.py" ]
[ "#\n# This file is part of do-mpc\n#\n# do-mpc: An environment for the easy, modular and efficient implementation of\n# robust nonlinear model predictive control\n#\n# Copyright (c) 2014-2019 Sergio Lucia, Alexandru Tatulea-Codrean\n# TU Dortmund. All rights reserved\n#\n# do-m...
[ [ "numpy.array" ] ]
ultpnml/ult_instruments
[ "3c9dd6b26e993bba3e20c7f91af6510152850cfd" ]
[ "Python/triton_monitor.py" ]
[ "# Monitors the status of the dilution refrigerator\n\n#TO DO: Message boundaries for recv over TCP\n\nimport socket\nimport time\nimport traceback\nimport atexit\nfrom collections import deque\ntry:\n import thread\nexcept ModuleNotFoundError:\n import _thread as thread\n\nimport datetime\nimport re\ndt_expr...
[ [ "matplotlib.dates.DateFormatter", "matplotlib.dates.num2date", "matplotlib.pyplot.figure" ] ]
mitjanikolaus/peppa
[ "bacfaf3ef09f050dcb503bb4c67e01f8e7ab06f5", "bacfaf3ef09f050dcb503bb4c67e01f8e7ab06f5" ]
[ "generate_targeted_triplets_eval_sets.py", "pig/evaluation.py" ]
[ "import argparse\nimport itertools\nimport json\nimport os\nimport re\nfrom collections import Counter\n\nimport pandas as pd\nfrom spacy.tokens import Doc\n\nimport spacy\nfrom tqdm import tqdm\n\nfrom pig.data import SPLIT_SPEC\n\nDATA_DIR = \"data/out/180x100/\"\nREALIGNED_DATA_DIR = \"data/out/realign/\"\nDATA_...
[ [ "pandas.DataFrame" ], [ "pandas.DataFrame.from_records", "torch.cat", "torch.save", "torch.manual_seed", "torch.eye", "torch.load" ] ]
stefaniaebli/paper-snn-neurips2020tda
[ "935658c9fa93897b4e288918e6e9c3fb0a0bee3e" ]
[ "figures/performance_error.py" ]
[ "#!/usr/bin/env python3\n\nimport os\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef main():\n\n plt.rcParams.update({\"font.size\": 6})\n\n fig = plt.figure(constrained_layout=True, figsize=(80/25.4, 35/25.4))\n\n gs = fig.add_gridspec(1, 3)\n axs = gs.subplots()\n\n for d in [0, 1, 2]...
[ [ "matplotlib.pyplot.rcParams.update", "numpy.log10", "numpy.load", "matplotlib.pyplot.figure" ] ]
ThomasBrouwer/BNMTF
[ "34df0c3cebc5e67a5e39762b9305b75d73a2a0e0", "34df0c3cebc5e67a5e39762b9305b75d73a2a0e0" ]
[ "plots/model_selection/plot_Sanger_nmf_model_selection.py", "experiments/experiments_gdsc/cross_validation/np_nmf/np_nmf_xval.py" ]
[ "\"\"\"\nPlot the model selection of the VB-NMF algorithm on the Sanger dataset.\n\nWe run our method on the entire dataset, so no test set.\n\nWe plot the MSE, BIC and AIC.\n\"\"\"\n\nimport matplotlib.pyplot as plt\n\nvalues_K = range(1,35+1)\n\nvb_all_values = {'MSE': [3.0272045267867274, 2.5912982754926035, 2.3...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xticks" ], [ "numpy.random.seed" ] ]
jinglingzhua/blinkblink
[ "1975be380ef08f895af4c1c07992efaed7af49e9" ]
[ "facedetector/utils/datasets.py" ]
[ "import glob\nimport math\nimport os\nimport random\nimport shutil\nimport time\nfrom pathlib import Path\nfrom threading import Thread\nfrom PIL import Image, ExifTags\nimport cv2\nimport numpy as np\nimport torch\nfrom PIL import Image, ExifTags\nfrom torch.utils.data import Dataset\nfrom tqdm import tqdm\n\nfrom...
[ [ "torch.cat", "torch.stack", "numpy.load", "numpy.where", "numpy.concatenate", "numpy.full", "numpy.save", "numpy.eye", "numpy.arange", "numpy.mod", "torch.zeros", "numpy.array", "numpy.delete", "numpy.savetxt", "numpy.zeros", "numpy.clip", "numpy...
jxhuang0508/HCL
[ "0106d93fd6277ca843572a6aa01bdf2d1caca117" ]
[ "hcl_target/dataset/cityscapes_train_dataset.py" ]
[ "import os\nimport os.path as osp\nimport numpy as np\nimport random\nimport matplotlib\nmatplotlib.use('agg')\nimport matplotlib.pyplot as plt\nimport collections\nimport torch\nimport torchvision\nfrom torch.utils import data\nfrom PIL import Image\nfrom dataset.autoaugment import ImageNetPolicy\nimport time\n\nc...
[ [ "matplotlib.use", "numpy.array", "numpy.uint8", "numpy.asarray", "numpy.ones", "numpy.transpose", "torch.utils.data.DataLoader", "numpy.flip" ] ]
glindsell/seldon-core
[ "a6992832b74ed71bbd3a91c48b5a79a5cee785b2" ]
[ "testing/scripts/test_seldon_metadata.py" ]
[ "import pytest\nimport time\nfrom google.protobuf import json_format\nimport json\nfrom subprocess import run\nimport numpy as np\n\nfrom seldon_core.proto import prediction_pb2\n\nfrom seldon_e2e_utils import (\n wait_for_status,\n wait_for_rollout,\n rest_request_ambassador,\n initial_rest_request,\n ...
[ [ "numpy.array" ] ]
ConanoutlooklvTBS/mars
[ "7030566fd9e9fc02b6b4064ef7bd86f6c24a2f60", "7030566fd9e9fc02b6b4064ef7bd86f6c24a2f60" ]
[ "mars/dataframe/window/rolling/tests/test_rolling.py", "mars/dataframe/base/transform.py" ]
[ "# Copyright 1999-2021 Alibaba Group Holding Ltd.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "pandas.testing.assert_series_equal", "numpy.random.rand" ], [ "numpy.errstate" ] ]
newlyedward/datascinece
[ "2a6148511832552991e115cb468ba4cc1db24353" ]
[ "src/data/future/utils.py" ]
[ "# -*- coding: utf-8 -*-\nimport re\nfrom pathlib import Path\nfrom datetime import datetime, timedelta\n\nimport pandas as pd\n\nfrom src.data import conn\nfrom src.data import DATE_PATTERN, INSTRUMENT_TYPE, RAW_HQ_DIR, BACKUP_DIR\nfrom src.data import get_future_hq\nfrom log import LogHandler\n\nlog = LogHandler(...
[ [ "pandas.to_datetime", "pandas.DataFrame" ] ]
Stanford-ILIAD/Confidence-Aware-Imitation-Learning
[ "1d8af0e4ab87a025885133a2384d5a937329b2f5" ]
[ "eval_policy.py" ]
[ "import argparse\r\nimport torch\r\n\r\nfrom cail.env import make_env\r\nfrom cail.algo.algo import EXP_ALGOS\r\nfrom cail.utils import evaluation\r\n\r\n\r\ndef run(args):\r\n env = make_env(args.env_id)\r\n\r\n device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\r\n\r\n algo = EXP_A...
[ [ "torch.cuda.is_available" ] ]
eram1205/DeepSDF
[ "c71c1545fa4606cbbe4b6d7a4edac5060d6750ab", "c71c1545fa4606cbbe4b6d7a4edac5060d6750ab" ]
[ "visualize_sampler.py", "deep_sdf/data.py" ]
[ "import argparse\nimport trimesh\nimport torch\nimport numpy as np\nfrom deep_sdf.samplers import NormalPerPoint as Sampler\n\n\ndef get_sphere_transform(translation):\n t = np.eye(4)\n t[:3,3] = translation\n return t\n\ndef add_point_to_scene(scene, point, scale=1., color=[128,128,128,50]):\n sphere =...
[ [ "torch.from_numpy", "numpy.eye" ], [ "numpy.concatenate", "torch.rand", "torch.cat", "torch.isnan", "numpy.load", "torch.randperm", "torch.from_numpy", "numpy.memmap", "torch.index_select" ] ]
Yamp/Lin-Kernighan
[ "88e3ef8c0f4ec91ba22a065466b2473725d86870" ]
[ "lin_kernighan/algorithms/structures/tabu_list.py" ]
[ "from sys import maxsize\nfrom typing import Tuple\n\nimport numba as nb\nimport numpy as np\n\nfrom lin_kernighan.algorithms.utils.hash import generate_hash\n\n\n@nb.experimental.jitclass(spec=[\n ('data', nb.types.Set(nb.i8)),\n ('best_length', nb.float64),\n ('best_route', nb.int64[:])\n])\nclass TabuSe...
[ [ "numpy.array" ] ]
jjotterson/beafullfetchpy
[ "47d492f79e620ad967593982887d9428756cd63b" ]
[ "datapungibea/tests/test_driversCI.py" ]
[ "import datapungibea as dpbea \nimport time\nimport pandas as pd\nimport os\n\n\ndef executeCode(stringIn):\n '''\n auxiliary function for tests: get the requests code as a string and try to execute it.\n '''\n try:\n exec(stringIn+'\\n') #exec('print(\"hi\")') #\n return(dict( code...
[ [ "pandas.DataFrame" ] ]
hdoupe/Tax-Cruncher-ARP
[ "c8c960c085d0883915f99ac2ea4630c928af4c16", "c8c960c085d0883915f99ac2ea4630c928af4c16" ]
[ "taxcalc_arp/taxcalc/calcfunctions.py", "taxcalc_arp/taxcalc/utils.py" ]
[ "\"\"\"\nTax-Calculator functions that calculate payroll and individual income taxes.\n\nThese functions are imported into the Calculator class.\n\nNote: the parameter_indexing_CPI_offset policy parameter is the only\npolicy parameter that does not appear here; it is used in the policy.py\nfile to possibly adjust t...
[ [ "numpy.where", "numpy.zeros", "numpy.maximum" ], [ "numpy.multiply", "numpy.where", "numpy.sort", "pandas.concat", "numpy.cumsum", "numpy.inner", "numpy.divide", "numpy.zeros_like", "numpy.less", "pandas.DataFrame", "numpy.random.randint", "numpy.ara...
michalwols/yann
[ "b3c0f35ec7515ddaeb1f04d365af7b6d136f56cf", "b3c0f35ec7515ddaeb1f04d365af7b6d136f56cf" ]
[ "tests/test_train.py", "yann/transforms/__init__.py" ]
[ "import pytest\nimport torch.cuda\nfrom torch import nn\nfrom torch.optim import SGD\n\nfrom yann.callbacks import (\n History, HistoryPlotter, HistoryWriter, Logger, Checkpoint\n)\nfrom yann.datasets import TinyDigits\nfrom yann.datasets.wrappers import Slice\nfrom yann.modules import Flatten\nfrom yann.train imp...
[ [ "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.CrossEntropyLoss", "torch.nn.Linear" ], [ "numpy.array", "numpy.random.beta", "torch.randperm" ] ]
y-x-c/Heliot
[ "b98646966fd1d437e308abeed59668df640932de" ]
[ "computation/Jetson/test_local.py" ]
[ "\"\"\" \n\nTesting the installation on Jetson-TX2\n\nObject detection using Pretrained Tensorflow Model\n\nCredits: This code is modified from the TensorFlow object detection tutorial available at:\nhttps://github.com/tensorflow/models/blob/master/research/object_detection/object_detection_tutorial.ipynb\n\n\"\"\"...
[ [ "tensorflow.Graph", "tensorflow.Session", "tensorflow.GraphDef", "tensorflow.import_graph_def", "tensorflow.gfile.GFile", "numpy.expand_dims" ] ]
MrHuff/general_ds_pipeline
[ "c11440d7e54329931d3b1a4cb5b7f1c855a208cb" ]
[ "prediction_models/NN.py" ]
[ "import copy\n\nimport numpy as np\nimport torch\nfrom utils.other import *\nimport tqdm\n\nclass multi_input_Sequential(torch.nn.Sequential):\n def forward(self, inputs):\n for module in self._modules.values():\n if type(inputs) == tuple:\n inputs = module(*inputs)\n ...
[ [ "torch.nn.Linear", "numpy.concatenate", "torch.cat", "torch.nn.MSELoss", "torch.unbind", "torch.no_grad", "torch.nn.BatchNorm1d", "torch.nn.Embedding" ] ]
KaustabhGanguly/Recurrent-Neural-Networks-to-predict-Google-Stock-Price
[ "56891dcab862f9bd512edd8d134c0d800800ad52" ]
[ "LSTM_better_models/rnn_20timesteps_1lstmlayers.py" ]
[ "# Recurrent Neural Network\n\n# Part 1 - Data Preprocessing\n\n# Importing the libraries\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n# Importing the training set\ndataset_train = pd.read_csv('Google_Stock_Price_Train.csv')\ntraining_set = dataset_train.iloc[:,1:2].values\n\n# Featu...
[ [ "numpy.concatenate", "numpy.array", "numpy.reshape", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "sklearn.preprocessing.MinMaxScaler", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "pandas.read_csv...
zidik/AnimalView
[ "2dfaa34645247fd9e0e5d4ed33ac911d7c0870da" ]
[ "main.py" ]
[ "# -*- coding: utf-8 -*-\n'''\nCreated on 21.09.2013\n\n@author: Mark\n'''\n\nimport time\nimport numpy as np\nimport cv2\n\nDEBUG = True\n\n\n\n\nclass OpenCVWindow(object):\n \"\"\"\n Klass mis hõlmab endas ühe OpenCV nimelise akna avamist, sulgemist ning sellel pildi näitamist\n \"\"\"\n def __init__...
[ [ "numpy.array" ] ]
tegg89/rl-teacher-Pytorch
[ "98484e913ec509d3588f6aaa8571fb32ba573cb6" ]
[ "envs.py" ]
[ "import cv2\nimport gym\nimport numpy as np\nfrom gym.spaces.box import Box\n\n\n# Taken from https://github.com/openai/universe-starter-agent\ndef create_atari_env(env_id):\n env = gym.make(env_id)\n env = AtariRescale42x42(env)\n env = NormalizedEnv(flip=False, env=env)\n # env = HumanWrapper(env)\n ...
[ [ "numpy.moveaxis", "numpy.flip" ] ]
lusewell/xarray
[ "da99a5664df4f5013c2f6b0e758394bec5e0bc80" ]
[ "xarray/core/parallel.py" ]
[ "try:\n import dask\n import dask.array\n from dask.array.utils import meta_from_array\n from dask.highlevelgraph import HighLevelGraph\n\nexcept ImportError:\n pass\n\nimport collections\nimport itertools\nimport operator\nfrom typing import (\n Any,\n Callable,\n DefaultDict,\n Dict,\n ...
[ [ "numpy.cumsum" ] ]
shawlu95/numpy
[ "984e6a91f5b6a8e4f901fc1d17a287473914ecbb" ]
[ "numpy/distutils/misc_util.py" ]
[ "from __future__ import division, absolute_import, print_function\n\nimport os\nimport re\nimport sys\nimport copy\nimport glob\nimport atexit\nimport tempfile\nimport subprocess\nimport shutil\nimport multiprocessing\nimport textwrap\n\nimport distutils\nfrom distutils.errors import DistutilsError\ntry:\n from ...
[ [ "numpy.distutils.core.Extension", "numpy.distutils.system_info.system_info.saved_results.items", "numpy.get_include", "numpy.distutils.compat.get_exception", "numpy.distutils.npy_pkg_config.read_config", "numpy.distutils.core.get_distribution" ] ]
fofferhorn/SC2ML
[ "436e9b9883c78505cfecaaf1fe1abe9ec630dd88" ]
[ "src/train_ff.py" ]
[ "from __future__ import absolute_import, division, print_function\n\n# TensorFlow and tf.keras\nimport tensorflow as tf\nfrom tensorflow.keras import metrics, optimizers, layers, losses, models, callbacks, utils, regularizers\nfrom tensorflow.keras import backend as K\n\n\n# Helper libraries\nimport numpy as np\nim...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.close", "tensorflow.keras.layers.Dense", "tensorflow.keras.models.Sequential", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show", "tensorflow.k...
sizhec-joy/CSE583-Movie
[ "9ce9dc540040359b4e05382bfb6b5b9b3056a789" ]
[ "movie_recommendations/userbased_filtering.py" ]
[ "import pickle\nimport os.path\nimport ast\nimport pandas as pd\nfrom surprise import Reader, Dataset, SVD, model_selection\n\nRun = False\n\nif __name__ == \"__main__\":\n Run = True\n print(\"process file cop\")\n\nif not os.path.isfile('movies-dataset/source/collaborative_result.csv'):\n Run = True\n ...
[ [ "pandas.read_csv" ] ]
danzvara/baselines
[ "d3ad1c61a86f40351ae1e9fc8f3768bea8163555" ]
[ "baselines/ppo2/runner.py" ]
[ "import numpy as np\nfrom baselines import logger\nfrom baselines.common.runners import AbstractEnvRunner\nimport time\n\nclass Runner(AbstractEnvRunner):\n \"\"\"\n We use this object to make a mini batch of experiences\n __init__:\n - Initialize the runner\n\n run():\n - Make a mini batch\n \...
[ [ "numpy.zeros_like", "numpy.asarray" ] ]
AlamiMejjati/neurips18_hierchical_image_manipulation
[ "ce42ed88e3edca7eb43970ec6a28ebf3a8b13b9e" ]
[ "preprocess_city2.py" ]
[ "import os\nimport glob\nfrom shutil import copy2\nfrom scipy import ndimage\nfrom PIL import Image\nimport json\nimport numpy as np\nimport argparse\nimport shutil\nfrom skimage import io\nfrom tqdm import tqdm\nfrom itertools import product\n\n\nclass NpEncoder(json.JSONEncoder):\n def default(self, obj):\n ...
[ [ "numpy.median", "scipy.ndimage.label", "numpy.sum", "numpy.where", "numpy.size", "numpy.unique" ] ]
xi-studio/DiscreteNN
[ "85468da14bddfe4cbe2e07071454cdbc52ef915f", "85468da14bddfe4cbe2e07071454cdbc52ef915f", "85468da14bddfe4cbe2e07071454cdbc52ef915f", "85468da14bddfe4cbe2e07071454cdbc52ef915f" ]
[ "tree/fft1.py", "wav/savedata/conversion.py", "tree/generate.py", "wav/savedata/fft.py" ]
[ "from __future__ import print_function\nimport argparse\nimport torch\nimport torch.utils.data\nfrom torch import nn, optim\nfrom torch.nn import functional as F\nfrom torchvision import datasets, transforms\nfrom torchvision.utils import save_image\n\nimport numpy as np\n\n\nparser = argparse.ArgumentParser(descri...
[ [ "torch.nn.Linear", "torch.device", "torch.zeros", "torch.sin", "torch.arange", "torch.no_grad", "torch.manual_seed", "torch.randn_like", "torch.cuda.is_available", "torch.zeros_like" ], [ "matplotlib.use", "torch.device", "torch.zeros", "torch.arange", ...
constanreedjohn/mmocr
[ "8f638f11fff56c5f4969a350c88ab013849b7fd4" ]
[ "mmocr/models/textrecog/losses/ctc_loss.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport math\n\nimport torch\nimport torch.nn as nn\n\nfrom mmocr.models.builder import LOSSES\n\n\n@LOSSES.register_module()\nclass CTCLoss(nn.Module):\n \"\"\"Implementation of loss module for CTC-loss based text recognition.\n\n Args:\n flatten (bool)...
[ [ "torch.log_softmax", "torch.nn.CTCLoss", "torch.clamp", "torch.full", "torch.Tensor" ] ]
ShreeshaN/COVID_19
[ "02bf2559801491bed53f839c20fe931f4f1ccff6" ]
[ "covid_19/runners/forced_autoencoder.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\n@created on: 3/1/21,\n@author: Shreesha N,\n@version: v0.0.1\n@system name: badgod\nDescription:\n\n..todo::\n\n\"\"\"\n\nimport json\nimport random\nimport time\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\n\nfrom covid_19.networks.conv_a...
[ [ "numpy.max", "torch.device", "numpy.array", "torch.nn.MSELoss", "torch.nn.Sigmoid", "numpy.random.seed", "torch.no_grad", "torch.optim.lr_scheduler.ExponentialLR", "numpy.min", "numpy.mean", "torch.manual_seed", "numpy.std", "torch.cuda.is_available", "sklea...
BEC-Trento/becpy
[ "9094052cc856fe1b533d933a42a86398fc77591c" ]
[ "becpy/physics/trapped_hartree_fock.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#\n# Created: 08-2020 - Carmelo Mordini <carmelo> <carmelo.mordini@unitn.it>\n\n\"\"\"\nFunctions and formulas for HF theory of a trapped Bose gas\nRefs:\n[1] Pitaevskii, Stringari, Bose-Einstein condensation and superfluidity, 2nd ed. Chap 13\n[2] S. Giorgini, L. P....
[ [ "numpy.log", "numpy.vectorize", "numpy.sqrt", "numpy.maximum" ] ]
alt113/flow-triangle-scenario
[ "42451365c5760d5b6b7aa2507985652ec7ba9a72" ]
[ "flow/controllers/velocity_controllers.py" ]
[ "from flow.controllers.base_controller import BaseController\nimport numpy as np\n\n\nclass FollowerStopper(BaseController):\n \"\"\"Inspired by Dan Work's... work:\n\n Dissipation of stop-and-go waves via control of autonomous vehicles:\n Field experiments https://arxiv.org/abs/1705.01693\n\n Parameter...
[ [ "numpy.mean" ] ]
ColeMiles/QGasML
[ "3ad303b7022bd5220bd2d4a6e4fd9ddb35b0d2ec", "3ad303b7022bd5220bd2d4a6e4fd9ddb35b0d2ec" ]
[ "test/test_nn_models.py", "data_util.py" ]
[ "import os\nimport sys\nimport itertools\n\nimport numpy as np\nimport torch\nimport pytest\n\nSCRIPTPATH = os.path.abspath(__file__)\nREPODIR = os.path.split(os.path.split(SCRIPTPATH)[0])[0]\nsys.path.append(REPODIR)\n\nimport nn_models\n\n\n@pytest.fixture\ndef fake_snapshots():\n \"\"\" Return a batch of 5 ra...
[ [ "numpy.pad", "torch.eq", "torch.randint", "torch.zeros_like", "torch.allclose" ], [ "torch.utils.data.ConcatDataset", "torch.stack", "torch.rot90", "numpy.where", "torch.flip", "numpy.concatenate", "numpy.full", "numpy.empty", "torch.is_tensor", "num...
systragroup/quetzal
[ "bb7934bcae588cddf0f0da810d75114d1c64768f" ]
[ "quetzal/io/gtfs_reader/importer.py" ]
[ "# pylint: disable=no-member\nimport geopandas as gpd\nimport gtfs_kit as gk\nimport pandas as pd\nfrom shapely.geometry import LineString\nfrom syspy.transitfeed import feed_links\n\nfrom . import patterns\nfrom .feed_gtfsk import Feed\n\n\ndef get_epsg(lat, lon):\n return int(32700 - round((45 + lat) / 90, 0) ...
[ [ "pandas.to_timedelta", "pandas.merge" ] ]
SenthilVikram/IPL-Data-Scraping-Live-Scorecard
[ "cd8eeff7f5e6f184db9086068cfcad7c9f6d2b67" ]
[ "ipl_scrap.py" ]
[ "import pandas as pd\nimport re\nfrom bs4 import BeautifulSoup\n\nwith open(\"Doc.html\") as fp:\n soup = BeautifulSoup(fp, 'html.parser')\n# Deleting a tag and its content because it's a useless tag and interrupts \n# while iterating through player names in table \nfor span in soup.find_all(\"span\", {'class':'...
[ [ "pandas.DataFrame" ] ]
Bogatom/MagentaTraining
[ "9ffa8c566f70868720d69d9839bb3222c4c1c93b" ]
[ "magenta/models/pianoroll_rnn_nade/pianoroll_rnn_nade_create_dataset_test.py" ]
[ "# Copyright 2020 The Magenta Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law o...
[ [ "tensorflow.compat.v1.disable_v2_behavior", "tensorflow.compat.v1.test.main" ] ]
StefOe/selection-masks
[ "e59487bffe3c30bdab7a6425bed01f6adeda4f67" ]
[ "logger.py" ]
[ "from torch.utils.tensorboard import SummaryWriter\nimport torch\n\n\nclass Logger(SummaryWriter):\n def __init__(self, log_iter, use_any_mask, use_thumbs, use_fmap, n_featuremaps, n_thumbs, img_mean, img_std, device,\n **kwargs):\n self.log_iter = log_iter\n self.n_featuremaps = n_...
[ [ "torch.tensor" ] ]
Daniel-Cheng249/Model-reproduction
[ "71c83ef1e0dc6a5013e5458d39781c721f797c6e" ]
[ "iris classification/iris classification by SVM.py" ]
[ "from sklearn import svm\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib\r\nfrom sklearn.model_selection import train_test_split\r\n\r\n\r\n# 定义字典,将字符与数字对应起来\r\ndef Iris_label(s):\r\n it = {b'Iris-setosa': 0, b'Iris-versicolor': 1, b'Iris-virginica': 2}\r\n return it[s]\r\n\r\n\r...
[ [ "matplotlib.pyplot.pcolormesh", "matplotlib.pyplot.xlim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.title", "numpy.split", "sklearn.svm.SVC", "numpy.loadtxt", "numpy.stack", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel", "sklear...
1ucian0/qiskit-aer
[ "138353ed262346e5431cd73cfe40ffd750c92d56" ]
[ "test/terra/reference/ref_non_clifford.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2018, 2019.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modificatio...
[ [ "numpy.array", "numpy.eye", "numpy.abs", "numpy.sqrt", "numpy.diag" ] ]
soo89/CSD-SSD
[ "fed14a47fa4dda8a72e8f606ad9a21922b4f7ba4" ]
[ "data/voc07_consistency_init.py" ]
[ "\"\"\"VOC Dataset Classes\n\nOriginal author: Francisco Massa\nhttps://github.com/fmassa/vision/blob/voc_dataset/torchvision/datasets/voc.py\n\nUpdated by: Ellis Brown, Max deGroot\n\"\"\"\nfrom .config import HOME\nimport os.path as osp\nimport sys\nimport torch\nimport torch.utils.data as data\nimport cv2\nimpor...
[ [ "numpy.expand_dims", "numpy.array", "numpy.zeros", "torch.from_numpy" ] ]
SuperXiang/se3-transformer-pytorch
[ "d0db110533c0cd29a243e05e27dbef083ff232f4" ]
[ "se3_transformer_pytorch/se3_transformer_pytorch.py" ]
[ "from math import sqrt\nfrom itertools import product\nfrom collections import namedtuple\n\nimport torch\nimport torch.nn.functional as F\nfrom torch import nn, einsum\n\nfrom se3_transformer_pytorch.basis import get_basis\nfrom se3_transformer_pytorch.utils import exists, default, uniq, map_values, batched_index_...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.ModuleList", "torch.einsum", "torch.nn.ModuleDict", "torch.finfo", "torch.eye", "torch.nn.functional.pad", "torch.sum", "torch.nn.LayerNorm", "torch.is_tensor", "torch.nn.Embedding", "torch.nn.ParameterDict", "torch....
zezeze97/image2latex
[ "c745667cd1af91dbff2385dcf2f2b80b9a40adb6" ]
[ "mmocr/models/textrecog/backbones/table_resnet_extra.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom mmdet.models.builder import BACKBONES\nfrom ..layers.context_block import ContextBlock\n\ndef conv3x3(in_planes, out_planes, stride=1):\n \"\"\" 3x3 convolution with padding \"\"\"\n return nn.Conv2d(in_planes, out_planes, kernel_si...
[ [ "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.init.constant_", "torch.nn.BatchNorm2d", "torch.nn.init.kaiming_normal_", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
hoffmann/daq
[ "25bb7393ffdb232bc77947984377cf399be9843f" ]
[ "tests/conftest.py" ]
[ "# content of conftest.py\nimport pytest\nimport os\nimport numpy as np\nimport pandas as pd\nfrom storefact import get_store\nfrom kartothek.io.dask.dataframe import update_dataset_from_ddf\nimport dask.dataframe as dd\n\n@pytest.fixture(scope=\"session\")\ndef account_name():\n return os.environ.get(\"ACCOUNT_...
[ [ "pandas.Timestamp", "numpy.array" ] ]
chickert/reinforcement_learning
[ "473323f08b079004f27a7f0931e5e9a46bfad347" ]
[ "behavior_cloning/prelim_submit/param_annealing.py" ]
[ "import numpy as np\n\n# I used this class from our PPO group project\nclass AnnealedParam(float):\n\n def __new__(cls,\n param_min,\n param_max,\n period,\n param_value=None,\n param_max_decay=1.0,\n param_min_decay=1.0,\n...
[ [ "numpy.cost" ] ]
vishalbelsare/trieste
[ "d25b66becd0cac47574b0f8e80bc28301aa0bf98", "d25b66becd0cac47574b0f8e80bc28301aa0bf98" ]
[ "tests/util/misc.py", "tests/integration/test_multi_objective_bayesian_optimization.py" ]
[ "# Copyright 2020 The Trieste Contributors\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 l...
[ [ "numpy.testing.assert_allclose", "tensorflow.random.set_seed", "numpy.random.seed", "tensorflow.TensorShape", "tensorflow.constant", "tensorflow.reduce_sum" ], [ "tensorflow.constant", "tensorflow.math.reduce_variance", "tensorflow.math.log", "tensorflow.gather" ] ]
hzhang4/usg-cln
[ "7bc6a58f73dade866c8d24838305058d4ea2e568" ]
[ "examples/scripts/flopy_swi2_ex2.py" ]
[ "import os\nimport sys\n\nimport numpy as np\n\nimport flopy\n\nimport matplotlib.pyplot as plt\n\n# --modify default matplotlib settings\nupdates = {\n \"font.family\": [\"Univers 57 Condensed\", \"Arial\"],\n \"mathtext.default\": \"regular\",\n \"pdf.compression\": 0,\n \"pdf.fonttype\": 42,\n \"l...
[ [ "matplotlib.pyplot.rcParams.update", "numpy.zeros", "numpy.ones", "matplotlib.pyplot.subplots", "numpy.arange", "numpy.meshgrid" ] ]
weima/pytorch-study-notes
[ "dd01f70a617042842483bc8ff1ea12aa3c46f197" ]
[ "core/utils.py" ]
[ "import torch\n\nfrom core.types import TorchDevice\n\ndevice = torch.device(TorchDevice.Cuda if torch.cuda.is_available() else TorchDevice.Cpu)\n\n\ndef set_parameter_requires_grad(model, feature_extracting):\n \"\"\"\n This helper function sets the .requires_grad attribute of\n the parameters in the mode...
[ [ "torch.cuda.is_available" ] ]
karm-patel/numpyro
[ "34e0cdf4fa0ab9a0300a0d894d6758419fb46f40" ]
[ "test/contrib/test_funsor.py" ]
[ "# Copyright Contributors to the Pyro project.\n# SPDX-License-Identifier: Apache-2.0\n\nfrom collections import OrderedDict\nfrom functools import partial\n\nimport numpy as np\nfrom numpy.testing import assert_allclose\nimport pytest\n\nfrom jax import random\nimport jax.numpy as jnp\n\nfrom funsor import Bint, R...
[ [ "numpy.testing.assert_allclose", "numpy.random.normal", "numpy.random.rand", "numpy.random.choice", "numpy.stack", "numpy.arange" ] ]
dumpmemory/state-spaces
[ "b6672bca994b6a36347f414faa59761e42b1e2b1" ]
[ "extensions/cauchy/tuning_setup.py" ]
[ "import os\nfrom setuptools import setup\nfrom pathlib import Path\n\nimport torch.cuda\nfrom torch.utils.cpp_extension import CppExtension, CUDAExtension, BuildExtension\nfrom torch.utils.cpp_extension import CUDA_HOME\n\n\nextensions_dir = Path(os.getenv('TUNING_SOURCE_DIR')).absolute()\nassert extensions_dir.exi...
[ [ "torch.utils.cpp_extension.CUDAExtension" ] ]
MohMehrnia/FarsiDigitHandwrite
[ "4128d5666e2cc0f35e7b0e1f7766c43f29ff7ca3", "4128d5666e2cc0f35e7b0e1f7766c43f29ff7ca3" ]
[ "main.py", "main-cnn.py" ]
[ "from __future__ import print_function\nfrom matplotlib import pyplot as plt\nfrom HodaDatasetReader import read_hoda_cdb, read_hoda_dataset\nfrom keras.datasets import mnist\nfrom keras.models import Sequential\nfrom keras.layers.core import Dense, Activation, Dropout\nfrom keras.optimizers import Adam\nfrom keras...
[ [ "numpy.random.seed" ], [ "numpy.random.seed" ] ]
alexandrepires5/3DPerception
[ "d9df7051a2b480d1132ccadca1def4b4eabd7c51" ]
[ "train_svm.py" ]
[ "#!/usr/bin/env python\nimport pickle\nimport itertools\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn import svm\nfrom sklearn.preprocessing import LabelEncoder, StandardScaler\nfrom sklearn import cross_validation\nfrom sklearn import metrics\n\ndef plot_confusion_matrix(cm, classes,\n ...
[ [ "sklearn.metrics.confusion_matrix", "sklearn.cross_validation.cross_val_score", "matplotlib.pyplot.xticks", "matplotlib.pyplot.colorbar", "sklearn.cross_validation.cross_val_predict", "sklearn.svm.SVC", "sklearn.metrics.accuracy_score", "matplotlib.pyplot.tight_layout", "sklear...
liranszlak/causallib
[ "2636149f6b1e307672aff638a53f8eaf2be56bc9", "2636149f6b1e307672aff638a53f8eaf2be56bc9" ]
[ "causallib/estimation/tmle.py", "causallib/preprocessing/filters.py" ]
[ "import abc\nimport warnings\nfrom typing import Type\n\nimport pandas as pd\nimport numpy as np\nimport statsmodels.api as sm\nfrom sklearn.preprocessing import MinMaxScaler, OneHotEncoder\nfrom sklearn.utils.multiclass import type_of_target\n\nfrom .doubly_robust import DoublyRobust as BaseDoublyRobust\nfrom caus...
[ [ "numpy.full", "numpy.clip", "numpy.log", "pandas.DataFrame", "sklearn.utils.multiclass.type_of_target", "numpy.finfo", "pandas.concat", "pandas.Series", "sklearn.preprocessing.OneHotEncoder" ], [ "numpy.isnan", "numpy.zeros", "numpy.sum", "scipy.stats.ttest_...
jameszhan/notes-ml
[ "c633d04e5443eab71bc3b27fff89d57b89d1786c", "c633d04e5443eab71bc3b27fff89d57b89d1786c" ]
[ "03-algorithms/02-optimization/codebase/gradient_descent/tests/02_test_linear_gd2.py", "03-algorithms/03-k-nearest-neighbors/code-practice/knn_digit_recognizer.py" ]
[ "# -*- coding: utf-8 -*-\nimport os\nimport sys\nimport logging\nimport unittest\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nparent_path = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))\nsys.path.append(parent_path)\n\nfrom linear_gd2 import linear_gd\n\n\nlogger = logging.getLogger...
[ [ "matplotlib.pyplot.show", "numpy.array", "matplotlib.pyplot.plot" ], [ "numpy.array", "sklearn.neighbors.KNeighborsClassifier" ] ]
rodluger/exoaurora
[ "0ec1c59c368ccbf0c9eb2450d52b7ec7897ce322" ]
[ "search/pool.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n'''\n:py:mod:`pool.py` - Multiprocessing\n-----------------------------------\n\nAn implementation of three different types of pools:\n \n - An MPI pool borrowed from :py:mod:`emcee`. This pool passes Python objects\n back and forth to the workers and comm...
[ [ "numpy.sum", "numpy.random.randint" ] ]
kromerh/solarAnalytics
[ "8d450746dcf45b5ae3933b5e2d8838a23c8b32ea" ]
[ "readout_scripts/vzlogger/read_itron_push_mongoDB.py" ]
[ "import pandas as pd\nimport subprocess\nfrom pymongo import MongoClient\nimport re\n\n# read the vzlogger\ndef read_vzlogger(collection):\n\t# collection: collection to use to store the document\n\t# return: dictionary with time, OBIS identifiers 1.8.0, 2.8.0, and respective values\n\n\t# get current time\n\ttime ...
[ [ "pandas.Timestamp.now", "pandas.DataFrame" ] ]
Ratnesh-Rai/Pydial-Personalisation
[ "482aacd16870b84bcad70aa59aa67098b42efff5" ]
[ "policy/DRL/trpo_utils/distribution/utils.py" ]
[ "###############################################################################\n# PyDial: Multi-domain Statistical Spoken Dialogue System Software\n###############################################################################\n#\n# Copyright 2015 - 2018\n# Cambridge University Engineering Department Dialogue Sy...
[ [ "tensorflow.exp", "numpy.random.rand", "tensorflow.group", "tensorflow.gradients", "tensorflow.reshape", "numpy.cumsum", "tensorflow.stop_gradient", "tensorflow.cast", "tensorflow.set_random_seed", "tensorflow.shape", "numpy.prod", "numpy.arange", "numpy.array",...
vmalarcon/tensorflow
[ "eda89e930cfcbd992ecacafd40267d733e2153dc" ]
[ "tensorflow/python/ops/linalg_ops.py" ]
[ "# Copyright 2015 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl...
[ [ "tensorflow.python.framework.tensor_shape.TensorShape", "tensorflow.python.framework.ops.RegisterShape", "tensorflow.python.framework.tensor_shape.scalar", "tensorflow.python.framework.tensor_shape.unknown_shape", "tensorflow.python.ops.gen_linalg_ops.batch_matrix_solve_ls", "tensorflow.py...
schroeder-dewitt/maddpg
[ "a2827dddde3aab87d278ccdead39a3e5e380a332" ]
[ "maddpg/common/distributions.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport maddpg.common.tf_util as U\nfrom tensorflow.python.ops import math_ops\nfrom multiagent.multi_discrete import MultiDiscrete\nfrom tensorflow.python.ops import nn\n\n\nclass Pd(object):\n \"\"\"\n A particular probability distribution\n \"\"\"\n def fl...
[ [ "tensorflow.exp", "tensorflow.shape", "tensorflow.nn.softmax_cross_entropy_with_logits", "tensorflow.concat", "tensorflow.python.ops.math_ops.less", "tensorflow.sigmoid", "numpy.log", "tensorflow.round", "tensorflow.nn.sigmoid_cross_entropy_with_logits", "tensorflow.constan...
fedden/jax
[ "30bede1f6af5f147e379c5c5679172730f3767fa" ]
[ "jaxlib/cuda_prng.py" ]
[ "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.dtype" ] ]
ChoiMunbong/GRAPE
[ "9764fdebd237aaebf54cf8ab2b0e571db2ba1ba7" ]
[ "models/gnn_model.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nimport torch_geometric.nn as pyg_nn\nimport torch_geometric.utils as pyg_utils\nfrom models.egcn import EGCNConv\nfrom models.egsage import EGraphSage\nfrom utils.utils import get_activation\n\ndef get_gnn(data, args):\n ...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.Dropout", "torch.nn.ModuleList", "torch.nn.Sequential", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.pyplot.subplot" ] ]
bertid/clean-pvnet
[ "4f91324c5bc9d2a05624f49c6cad15a33a446106" ]
[ "lib/evaluators/linemod/pvnet.py" ]
[ "from lib.datasets.dataset_catalog import DatasetCatalog\nfrom lib.config import cfg\nimport pycocotools.coco as coco\nimport numpy as np\nfrom lib.utils.pvnet import pvnet_pose_utils, pvnet_data_utils\nimport os\nfrom lib.utils.linemod import linemod_config\nimport torch\nif cfg.test.icp:\n from lib.utils.icp i...
[ [ "numpy.concatenate", "numpy.array", "numpy.dot", "numpy.trace", "numpy.asarray", "numpy.zeros", "numpy.linalg.norm", "numpy.arccos", "numpy.isnan", "numpy.mean", "scipy.linalg.sqrtm", "torch.argmax" ] ]
yangchihyuan/shufflenet-v2-tensorflow
[ "8eb37ab5f0c78d7a03636a68f9c74cb3e2f301bf" ]
[ "train_Zenbo_dataset.py" ]
[ "import tensorflow as tf\nimport os\nfrom model import model_fn, RestoreMovingAverageHook\nfrom input_pipeline import Pipeline\ntf.compat.v1.logging.set_verbosity('INFO')\n#from datasets.DatasetFactory import DatasetFactory\n#from helper.model_helper import get_model_function, get_input_function\n#from helper.model...
[ [ "tensorflow.estimator.TrainSpec", "tensorflow.compat.v1.ConfigProto", "tensorflow.compat.v1.logging.set_verbosity", "tensorflow.estimator.RunConfig", "tensorflow.estimator.train_and_evaluate", "tensorflow.estimator.Estimator" ] ]
anishmprasad/lingvo
[ "4a8eb86fc9caa6358cac4d26ff2514072c85a83c" ]
[ "lingvo/core/model_pruning/pruning.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.math_ops.less", "tensorflow.python.ops.variable_scope.variable_scope", "tensorflow.python.ops.variable_scope.get_variable", "tensorflow.python.ops.math_ops.greater_equal", "tensorflow.python.ops.state_ops.assign", "tensorflow.python.ops.math_ops.less_equal", "ten...
eidosmontreal/shape-analysis
[ "62f62db869cc577dcf5a384cd0e72c321d83f976" ]
[ "scripts/visualize_humanseg.py" ]
[ "import datasets\nimport utils\nimport open3d as o3d\nimport pdb\nimport torch\nimport argparse\nfrom os.path import join\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"--dataset\", type=str, default='HumanSegmentation')\nparser.add_argument(\"--test\", action='store_false')\nparser.add_argument(\"--s...
[ [ "torch.utils.data.DataLoader" ] ]
DeepLearnPhysics/SparseConvNet
[ "f75ab7cacfd7f8d9f155ecc51ae9898c5dd212fe" ]
[ "examples/Chinese_handwriting/data.py" ]
[ "\n# Copyright 2016-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport torch\nimport torchnet\nimport sparseconvnet as scn\nimport pickle\nimport math\nimport random\nimport ...
[ [ "torch.zeros", "torch.cat", "torch.utils.data.Dataset.__init__", "torch.arange", "torch.LongTensor", "torch.Tensor" ] ]
vighneshbirodkar/scikit-image
[ "766745c0498a82852c3044fb205c9970ba1caee2" ]
[ "doc/examples/features_detection/plot_censure.py" ]
[ "\"\"\"\n========================\nCENSURE feature detector\n========================\n\nThe CENSURE feature detector is a scale-invariant center-surround detector\n(CENSURE) that claims to outperform other detectors and is capable of real-time\nimplementation.\n\"\"\"\n\nfrom skimage import data\nfrom skimage impo...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplots" ] ]
szemyd/deep-reinforcement-learning
[ "2dc2ab8511bcf3975c51dc057b66d2d500e2cf80" ]
[ "DDPG Agent - Continous Multi-Agent Environment/agents/agent_ddpg/model.py" ]
[ "import numpy as np\nimport random\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\ndef hidden_init(layer):\n fan_in = layer.weight.data.size()[0]\n lim = 1. / np.sqrt(fan_in)\n return (-lim, lim)\n\nclass Actor(nn.Module):\n def __init__(self, state_space, action_space, random...
[ [ "torch.manual_seed", "torch.cat", "torch.nn.Linear", "numpy.sqrt" ] ]
redhawkresearch/pandas
[ "1dc78c71f4f81403eb340722c5a7ea3cfe3821f6" ]
[ "pandas/tseries/tools.py" ]
[ "from datetime import datetime, timedelta, time\nimport sys\n\nimport numpy as np\n\nimport pandas.lib as lib\nimport pandas.tslib as tslib\nimport pandas.core.common as com\nfrom pandas.core.common import ABCIndexClass\nimport pandas.compat as compat\nfrom pandas.util.decorators import deprecate_kwarg\n\ntry:\n ...
[ [ "pandas.tslib.get_timezone", "pandas.tslib.datetime_to_datetime64", "pandas.core.common._ensure_object", "numpy.empty", "pandas.core.common.is_integer_dtype", "pandas.lib.try_parse_year_month_day", "pandas.core.common.is_list_like", "pandas.tslib.array_strptime", "pandas.core.c...