repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
Sophylax/transformers
[ "5d565dd8526ec794a701a80f216e03e506b1c607" ]
[ "examples/pytorch/contrastive-image-text/run_clip.py" ]
[ "#!/usr/bin/env python\n# coding=utf-8\n# Copyright 2022 The HuggingFace Team All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/li...
[ [ "torch.jit.script", "torch.stack", "torch.no_grad", "torch.tensor" ] ]
zifeo/Titanic
[ "cd2b0e0ae44a1c00de346cc3e2b7796c4cd53699" ]
[ "gcnn/coarsening/coarse_utils.py" ]
[ "import scipy as sp\nimport numpy as np\n\ndef compute_perm_amg(parents):\n \"\"\"\n Return a list of indices to reorder the adjacency and data matrices so\n that the union of two neighbors from layer to layer forms a binary tree.\n \"\"\"\n\n # Order of last layer is random (chosen by the clustering...
[ [ "scipy.sparse.coo_matrix", "numpy.array", "scipy.sparse.hstack", "scipy.sparse.vstack", "numpy.where", "numpy.argsort" ] ]
reithmeier/Mask_RCNN
[ "4e7d93adf8c244dc541c7fcc959d5e994c8dd9b1" ]
[ "samples/sun/preprocess/resize.py" ]
[ "# **********************************************************************************************************************\n#\n# brief: script to preprocess the data\n#\n# author: Lukas Reithmeier\n# date: 09.07.2020\n#\n# *************************************************************************************...
[ [ "numpy.load", "numpy.save" ] ]
RobinGRAPIN/smoot
[ "a27dc904bda0f2f5a16d30d41d69d883b31839af" ]
[ "smoot/smoot.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Mar 31 14:08:54 2021\n\n@author: robin grapin\n\"\"\"\n\nimport numpy as np\n\nfrom pymoo.algorithms.moo.nsga2 import NSGA2\nfrom pymoo.core.problem import Problem, ElementwiseProblem\nfrom pymoo.optimize import minimize\nfrom pymoo.factory import get_performance_ind...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.asarray", "numpy.random.RandomState", "numpy.mean", "numpy.append", "numpy.var" ] ]
pschulam/Notebook
[ "3404ce01a4ebdf23216ff01512a8f84b4f7758aa" ]
[ "2015/07/longitudinal.py" ]
[ "import pandas as pd\n\n\ndef LongitudinalSpec(index, date, outcome):\n 'The index, timestamp, and outcome column names of a longitudinal dataset.'\n return {'index': index, 'date': date, 'outcome': outcome}\n\n\ndef AlignmentSpec(index, time, date, baseline):\n 'The date and baseline column names used to ...
[ [ "pandas.to_datetime", "pandas.read_csv", "pandas.merge" ] ]
fangzhouli/MSAP
[ "cd4d6623acf3495ab57d1be09e8b27baacca91b3" ]
[ "msap/modeling/model_evaluation/statistics.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"The module of methods that calculate statistics related to model\nperformance.\n\nAuthors:\n Fangzhou Li - fzli@ucdavis.edu\n\n\"\"\"\nfrom typing import Union\n\nfrom scipy.spatial import distance_matrix\nfrom sklearn.manifold import TSNE\nfrom sklearn.decomposition import PCA\nf...
[ [ "sklearn.metrics.confusion_matrix", "sklearn.manifold.TSNE", "pandas.concat", "sklearn.model_selection.KFold", "sklearn.decomposition.PCA" ] ]
rll-research/ARM
[ "7a51e00fabdcdbd8ad2b235266c66115e79deeb0", "7a51e00fabdcdbd8ad2b235266c66115e79deeb0" ]
[ "extar/runners/multi_env_runner.py", "extar/runners/_env_runner.py" ]
[ "\"\"\"\nNew(0721) try adding GPU agents\nNOTE(0714) My attempt at making a simpler version of a multi-task trainer that \nhandles EnvRunner, ReplayBuffer, and the Agent Update with a slightly more\nflattened logic.\nBig credit to Stephen's MultiTaskQAttention for great reference \n\"\"\"\nimport os\nimport time\ni...
[ [ "numpy.array" ], [ "numpy.random.seed", "torch.device" ] ]
htphung2000/Diagnosis-of-COVID-19
[ "1714e6d4b44225cc487f6ff238e18b6ee2efb2ff" ]
[ "CNN.py" ]
[ "import numpy as np\r\nimport pandas as pd\r\nimport tensorflow as tf\r\nimport matplotlib.pyplot as plt\r\nimport keras\r\nfrom keras.layers import *\r\nfrom keras.models import *\r\nfrom tensorflow.keras.optimizers import *\r\nfrom keras.utils.vis_utils import *\r\nfrom keras.preprocessing.image import *\r\nfrom ...
[ [ "numpy.array", "numpy.round", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.show" ] ]
mannyfin/IRAS
[ "a164856e80320c90e2decdfb3ded4b75a10d5061", "a164856e80320c90e2decdfb3ded4b75a10d5061", "a164856e80320c90e2decdfb3ded4b75a10d5061" ]
[ "plotTPD_data programs/IR _plot.py", "GaP/remove_wiggle.py", "Type C calibrations/send_multiple_setpoints.py" ]
[ "import pandas as pd\nimport numpy as np\nimport tkinter as tk\nfrom tkinter import filedialog\nimport matplotlib.pyplot as plt\nimport os\n\"quick plot of IR spectra from the Bruker IR\"\n\ncolnames = ['Wavenumber', 'Intensity']\n\nexport_me = False\n\n# Select the rest\nroot = tk.Tk()\nroot.withdraw()\nfile_path1...
[ [ "pandas.ExcelWriter", "matplotlib.pyplot.subplots", "pandas.concat", "matplotlib.pyplot.show", "pandas.read_csv" ], [ "pandas.read_excel", "numpy.fft.ifft", "matplotlib.pyplot.legend", "matplotlib.pyplot.subplots", "numpy.where", "numpy.fft.fft", "numpy.abs", ...
fsorodrigues/reddit-scraper
[ "6ef12bd21e1966905dbcf2f5defa20f6491c4f2b" ]
[ "reddit_pushshift_praw.py" ]
[ "#! /usr/bin/env python3\n\n# importing modules\nimport time\nimport datetime\nimport requests\nimport json\nimport pandas as pd\nimport praw\nimport re\n\n# set datetime string pattern\n# limit_date below will need to match this format\n# CHANGE VALUE HERE\ndate_pattern = '%Y-%m-%d %H:%M:%S' # == YYYY-MM-DD HH:MM:...
[ [ "pandas.DataFrame", "pandas.concat" ] ]
szahlner/hybrid-rl
[ "1719ac8c4cb5e79a13b31722c964452b62821d2c" ]
[ "callbacks/buffers.py" ]
[ "import warnings\n\nimport torch\nimport numpy as np\n\nfrom typing import Any, List, Optional, Tuple\n\ntry:\n # Check replay buffer fits in memory, if possible\n import psutil\nexcept ImportError:\n psutil = None\n\n\nclass ReplayBuffer:\n def __init__(\n self,\n n_state: int,\n n...
[ [ "numpy.random.choice", "numpy.empty", "numpy.roll", "numpy.savez_compressed", "torch.tensor" ] ]
wdika/mridc
[ "bcbec4ce3bdca45273369d45c5de889f3b7c82b5" ]
[ "scripts/run_zf.py" ]
[ "# coding=utf-8\n__author__ = \"Dimitrios Karkalousos\"\n\nimport argparse\nimport gc\nimport pathlib\nimport sys\nimport time\nfrom collections import defaultdict\nfrom typing import Dict\n\nimport numpy as np\nimport torch\nfrom torch.utils.data import DataLoader\n\nfrom mridc import save_reconstructions, complex...
[ [ "torch.cuda.empty_cache", "torch.no_grad" ] ]
fzeiser/240Pu_article_supplement
[ "da1f81ec87c1664da1290e9317c080668aeac244" ]
[ "exp_analysis/rhotot_T0.415/strength_plotter.py" ]
[ "from __future__ import division\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport sys\n\n# Constants for energy binning\na0 = -0.8400\na1 = 0.1200\n\n# Cross section factor for formula strength = xsec*factor/Egamma\nxsec_factor = 8.68e-8\n\nstrengthfile = open('strength.nrm', 'r')\nstrengthlines = st...
[ [ "matplotlib.pyplot.text", "matplotlib.pyplot.errorbar", "numpy.zeros", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.yscale" ] ]
jbeilstenedmands/dials
[ "fb9672b91854f564cbbba6f1cceeefa18d135965" ]
[ "util/image.py" ]
[ "from __future__ import absolute_import, division, print_function\n\n\nclass reader:\n \"\"\"A class to read the CBF files used in DIALS\"\"\"\n\n def read_file(self, filename):\n \"\"\"Read the CBF file\"\"\"\n import pycbf\n\n self.cbf_handle = pycbf.cbf_handle_struct()\n self.cb...
[ [ "numpy.fromstring" ] ]
adrn/gary-old
[ "065b371534baa03deeb860893640068d90ba5881" ]
[ "gary/integrate/pyintegrators/dopri853.py" ]
[ "# coding: utf-8\n\n\"\"\" Wrapper around SciPy DOPRI853 integrator. \"\"\"\n\nfrom __future__ import division, print_function\n\n__author__ = \"adrn <adrn@astro.columbia.edu>\"\n\n# Third-party\nfrom scipy.integrate import ode\n\n# Project\nfrom ..core import Integrator\nfrom ..timespec import parse_time_specifica...
[ [ "scipy.integrate.ode" ] ]
sgbaird/botorch
[ "3318c06333166328c95d24edd1055d4ef4bded70" ]
[ "test/models/test_gp_regression_mixed.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Meta Platforms, Inc. and affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport itertools\nimport warnings\n\nimport torch\nfrom botorch import fit_gpytorch_model\nfrom botorch.ex...
[ [ "torch.Size", "torch.rand", "torch.tensor", "torch.allclose", "torch.equal" ] ]
ratschlab/Laplace
[ "e44bd3bb4079ce18556d3563cc8c63a6c32a12e8" ]
[ "laplace/lllaplace.py" ]
[ "import torch\nfrom torch.nn.utils import parameters_to_vector, vector_to_parameters\n\nfrom laplace.baselaplace import BaseLaplace, FullLaplace, KronLaplace, DiagLaplace\nfrom laplace.feature_extractor import FeatureExtractor\n\nfrom laplace.matrix import Kron\nfrom laplace.curvature import BackPackGGN\n\n\n__all_...
[ [ "torch.ones_like", "torch.no_grad", "torch.stack", "torch.softmax" ] ]
mistajuliax/pbrt-v3-IILE
[ "b9be01096293ab0f50b14b9043556c93ff9e07ec" ]
[ "ml/iispt_net.py" ]
[ "import torch\nfrom torch import nn, optim\nfrom torch.autograd.variable import Variable\nfrom torchvision import transforms, datasets\n\nK = 64\n\nclass IISPTNet(torch.nn.Module):\n\n def __init__(self):\n super(IISPTNet, self).__init__()\n\n # Input depth:\n # Intensity RGB\n # Norm...
[ [ "torch.cat", "torch.nn.MaxPool2d", "torch.nn.LeakyReLU", "torch.nn.BatchNorm2d", "torch.nn.ConvTranspose2d", "torch.nn.Upsample", "torch.nn.ReLU", "torch.nn.Conv2d" ] ]
chen-yuxuan/privacy-evaluator
[ "ed4852408108c3e6a01216af4183261945fd7e67" ]
[ "tests/attacks/membership_inference/membership_inference_test.py" ]
[ "import pytest\n\nfrom privacy_evaluator.attacks.membership_inference.membership_inference import (\n MembershipInferenceAttack,\n)\nfrom privacy_evaluator.classifiers.classifier import Classifier\nfrom privacy_evaluator.datasets.torch.cifar10 import TorchCIFAR10\nfrom privacy_evaluator.models.torch.dcti.dcti im...
[ [ "torch.nn.CrossEntropyLoss" ] ]
Drtaylor1701/Learn-Python-by-Building-Data-Science-Applications
[ "c97bc1b7d5b1e7070706832de364fa9337e32d58" ]
[ "Chapter18/_compute_median.py" ]
[ "import pandas as pd\nfrom glob import glob\nimport json\n\n\ndef _read_all_data(root_path=\"../Chapter16/data/311/2019/06\"):\n files = glob(root_path + \"/**.csv\")\n datas = []\n for file in files:\n try:\n df = pd.read_csv(file, index_col=0)\n if len(df) > 0:\n ...
[ [ "pandas.to_datetime", "pandas.notnull", "pandas.np.timedelta64", "pandas.concat", "pandas.read_csv" ] ]
cedricfoucault/networks_for_sequence_prediction
[ "f2983a9738ec43e03a430f2f194f0359d2bb5bf7" ]
[ "code/training_dynamics_prediction_confidence_plot.py" ]
[ "import argparse\nimport decoding_data\nimport matplotlib.pyplot as plt\nimport matplotlib.cm\nfrom matplotlib.collections import LineCollection\nimport measure\nimport numpy as np\nimport pandas\nimport plots\nfrom scipy import stats\nimport utils\n\npredictor_key_dict = {\n \"all\": \"hidden_all\",\n \"gate...
[ [ "numpy.concatenate", "matplotlib.pyplot.text", "numpy.array", "numpy.empty", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.figure", "matplotlib.collections.LineCollection", "numpy.arange", "matplotlib.pyplot.ylabel", "numpy.floor", "matplo...
nim65s/quadruped-reactive-walking
[ "1e0f4069fd11af85abf10bfc8f9d66200c672646" ]
[ "python/quadruped_reactive_walking/LoggerControl.py" ]
[ "'''This class will log 1d array in Nd matrix from device and qualisys object'''\nimport numpy as np\nfrom datetime import datetime as datetime\nfrom time import time\nfrom utils_mpc import quaternionToRPY\n\n\nclass LoggerControl():\n def __init__(self, dt, joystick=None, estimator=None, loop=None, planner=None...
[ [ "numpy.int", "numpy.zeros", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.suptitle", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "numpy.savez", "matplotlib.pyplot.ylabel", "m...
ethanluoyc/tuna
[ "48cf2bfe94c40bb6300cb5648796602ef8ae5ab6" ]
[ "tuna/logger.py" ]
[ "# Adapted from tune.rllib\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport csv\nimport json\nimport numpy as np\nimport os\nimport sys\nimport tensorflow as tf\n\nfrom tuna.variant_generator import TrainingResult\n\nif sys.version_info[0] =...
[ [ "tensorflow.Summary", "tensorflow.summary.FileWriter", "numpy.issubdtype", "numpy.isnan" ] ]
bmaulana/nlp-media
[ "5612fc7b7d5639056256bc0104222721cfb08db6" ]
[ "plot.py" ]
[ "import sys\nimport json\nimport os\nimport numpy as np\nfrom dateutil.parser import parse as date_parse\nimport datetime\nimport matplotlib.pyplot as plt\nimport matplotlib.dates as mdates\nfrom mpl_toolkits.axes_grid1 import make_axes_locatable\nfrom sklearn.preprocessing import LabelEncoder\nfrom collections imp...
[ [ "sklearn.preprocessing.LabelEncoder", "numpy.array", "numpy.zeros", "matplotlib.pyplot.savefig", "matplotlib.dates.DateFormatter", "matplotlib.pyplot.close", "matplotlib.pyplot.subplots", "scipy.stats.mannwhitneyu", "numpy.std", "numpy.arange", "numpy.argsort", "num...
gaohao95/pymbolic
[ "0685203758717a7c57bd23819a4210f1c2e56e61" ]
[ "pymbolic/mapper/stringifier.py" ]
[ "from __future__ import division\n\n__copyright__ = \"Copyright (C) 2009-2013 Andreas Kloeckner\"\n\n__license__ = \"\"\"\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restrictio...
[ [ "numpy.zeros" ] ]
nipunreddevil/pandas
[ "08b1b3edf9d470e804226927701954a39a73ab98" ]
[ "pandas/tseries/tests/test_timeseries.py" ]
[ "# pylint: disable-msg=E1101,W0612\nfrom datetime import datetime, time, timedelta, date\nimport sys\nimport os\nimport operator\n\nfrom distutils.version import LooseVersion\n\nimport nose\n\nimport numpy as np\nrandn = np.random.randn\n\nfrom pandas import (Index, Series, TimeSeries, DataFrame,\n ...
[ [ "pandas.tseries.offsets.CustomBusinessDay", "pandas.compat.StringIO", "pandas.core.datetools.Hour", "numpy.random.rand", "pandas.DatetimeIndex", "pandas.datetools.Nano", "numpy.tile", "pandas.compat.product", "pandas.Timestamp.now", "pandas.Timestamp", "numpy.where", ...
achals/feast
[ "ce3ad0332edd6507e63fb80310c13d24952100d4" ]
[ "sdk/python/feast/type_map.py" ]
[ "# Copyright 2019 The Feast Authors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or ...
[ [ "pandas.isnull", "pandas.core.series.Series" ] ]
christocs/MiningTenemantsVectorisation
[ "7c008ca4ceb14ec34fefae722b19be0a10d3cc22" ]
[ "doc2vec_model.py" ]
[ "import os, time, csv, re, random, collections\nimport gensim\nfrom gensim.models.doc2vec import TaggedDocument\nimport numpy as np\nimport matplotlib.mlab as mlab\nfrom matplotlib import colors\nimport matplotlib.pyplot as plt\nfrom tabulate import tabulate\n\nNEAR_MATCH_THRESHOLD = 0.03 # how close a template mat...
[ [ "numpy.median", "matplotlib.pyplot.xlabel", "numpy.mean", "matplotlib.pyplot.hist", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
tycho/tensorflow
[ "27767d8e9c1325979cf32ff5b81c10df9006fd57" ]
[ "tensorflow/contrib/tpu/python/tpu/tpu_config.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.contrib.tpu.python.tpu.util.check_positive_integer" ] ]
kesaroid/faster-rcnn.pytorch
[ "5948a43602ee8c37090a2125b52597eaf9bc5bea", "5948a43602ee8c37090a2125b52597eaf9bc5bea" ]
[ "lib/build/lib.linux-x86_64-3.7/datasets/ag.py", "lib/build/lib.linux-x86_64-3.7/roi_data_layer/roidb.py" ]
[ "# --------------------------------------------------------\r\n# Fast/er R-CNN\r\n# Licensed under The MIT License [see LICENSE for details]\r\n# Written by Ross Girshick and Xinlei Chen\r\n# --------------------------------------------------------\r\nfrom __future__ import absolute_import\r\nfrom __future__ import...
[ [ "numpy.max", "numpy.isclose", "numpy.zeros", "numpy.mean", "numpy.where" ], [ "numpy.where", "numpy.array", "numpy.argsort" ] ]
ClementPinard/direct-warper
[ "be46410202c8cd9efb982b5dc4c1eb954ab45b10" ]
[ "Warp_Module/direct_warp/direct_warper.py" ]
[ "import torch\nimport torch.nn as nn\n\nfrom pytorch_direct_warp.direct_proj import direct_projection\n\n\nclass DirectWarper(nn.Module):\n def __init__(self, keep_index=False):\n super(DirectWarper, self).__init__()\n self.id_grid = None\n self.keep_index = keep_index\n\n def set_id_grid...
[ [ "torch.cat", "torch.stack", "torch.arange" ] ]
softsys4ai/causal-config-labyrinth
[ "4f50f9ff15429b0ac6ad0a99fbe4cfdd17e360fc" ]
[ "causallearn/search/FCMBased/lingam/bootstrap.py" ]
[ "\"\"\"\nPython implementation of the LiNGAM algorithms.\nThe LiNGAM Project: https://sites.google.com/site/sshimizu06/lingam\n\"\"\"\n\nimport numbers\n\nimport numpy as np\nfrom sklearn.utils import check_array, resample\n\nfrom .utils import find_all_paths\n\n\nclass BootstrapMixin():\n \"\"\"Mixin class for ...
[ [ "numpy.concatenate", "numpy.array", "numpy.zeros_like", "numpy.nan_to_num", "numpy.zeros", "numpy.median", "sklearn.utils.resample", "numpy.where", "numpy.sign", "numpy.vstack", "numpy.argsort", "numpy.abs", "sklearn.utils.check_array", "numpy.unique" ] ]
mohammedElfatihSalah/string-experiments
[ "762165c29cf1dc83cc5b075f9ca77985e9223c9e" ]
[ "clrs/_src/samplers.py" ]
[ "# Copyright 2021 DeepMind Technologies Limited. 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# Unle...
[ [ "numpy.concatenate", "numpy.random.choice", "numpy.zeros", "numpy.random.RandomState", "numpy.minimum", "numpy.sum", "numpy.triu", "numpy.take", "numpy.transpose", "numpy.maximum" ] ]
nahidgrid/pytorch-lightning
[ "60bf48d3e0ee26ebafd7a98ad96c86ba304d4533" ]
[ "tests/trainer/test_trainer_test_loop.py" ]
[ "import pytest\nimport torch\n\nimport pytorch_lightning as pl\nimport tests.base.develop_utils as tutils\nfrom tests.base import EvalModelTemplate\n\n\n@pytest.mark.skipif(torch.cuda.device_count() < 2, reason=\"test requires multi-GPU machine\")\ndef test_single_gpu_test(tmpdir):\n tutils.set_random_master_por...
[ [ "torch.eq", "torch.cuda.device_count" ] ]
lachhebo/pyclustertend
[ "11687499c470552b1d1b3cfcc712463678cae407" ]
[ "tests/test_visual_assessment_of_tendency.py" ]
[ "from pathlib import Path\nfrom unittest.mock import patch\n\nimport numpy as np\nfrom sklearn import datasets\nfrom sklearn.preprocessing import scale\n\nfrom pyclustertend import (\n vat,\n ivat,\n compute_ordered_dissimilarity_matrix,\n compute_ivat_ordered_dissimilarity_matrix,\n)\n\nTEST_DIR = Path...
[ [ "numpy.testing.assert_allclose", "numpy.ones", "numpy.load", "sklearn.datasets.load_iris" ] ]
niits/BentoML
[ "3954f36762e10f5df15af7e0ae6dd71f5f214261" ]
[ "tests/integration/test_keras_artifact.py" ]
[ "# pylint: disable=redefined-outer-name\n\nimport json\n\nimport keras\nimport numpy as np\nimport pytest\nimport tensorflow as tf\n\nimport bentoml\nfrom tests.integration.utils import (\n build_api_server_docker_image,\n export_service_bundle,\n run_api_server_docker_container,\n)\n\nTF2 = tf.__version__...
[ [ "numpy.array", "tensorflow.__version__.startswith" ] ]
perryshao/MSRefNet
[ "2be823d0629ed574addbbddca939cbff4f648a17" ]
[ "scripts_vcoco/utils/calculate_ap_classwise.py" ]
[ "#### This script will calculate AP per classwise without considering bounding boxes precision. This can be used to have a sanity check on the learnt model###\n\nfrom sklearn.metrics import average_precision_score\nfrom sklearn.metrics import classification_report\nimport pandas as pd\nimport torch\nimport numpy as...
[ [ "numpy.random.randint", "sklearn.metrics.average_precision_score", "numpy.random.random_sample" ] ]
sriram-lab/metoncofit-website
[ "7d4063098529048a012573ece6c8a12b3966d20c" ]
[ "run_app.py" ]
[ "\"\"\"\r\nMetOncoFit Interactive explorer\r\n\r\nThis application was built with a Flask framework using Dash and Plotly. The explorer shows three heatmaps that shows the top 10 features predicted by MetOncoFit on the y-axis, the genes corresponding to the feature predictions on the x-axis, and each cell is the co...
[ [ "pandas.read_json" ] ]
Yousazoe/oxBot
[ "f677595c97369ac0548329f074cd44b916a84848" ]
[ "examples/zerg/zerg_rush.py" ]
[ "import os\nimport sys\n\nfrom sc2 import maps\nfrom sc2.bot_ai import BotAI\nfrom sc2.ids.ability_id import AbilityId\nfrom sc2.ids.buff_id import BuffId\nfrom sc2.ids.unit_typeid import UnitTypeId\nfrom sc2.ids.upgrade_id import UpgradeId\nfrom sc2.main import run_game\n\nsys.path.append(os.path.join(os.path.dirn...
[ [ "numpy.ndenumerate" ] ]
DFRLab/digitalsherlocks
[ "b2f1ae419d7739f97cbd29831bdeca2929f227ee" ]
[ "digitalsherlocks/utils/__init__.py" ]
[ "# -*- coding: utf-8 -*-\n\n''' This file compiles a set of functions\nCollects parameters from user\nLoads Twitter API credentials and connects to API\nCreates a .db file using sqlite3\nCollects and process attrs from Twitter data\nBuilds and saves a network-like dataset\n'''\n\n# import modules\nfrom w3lib.html i...
[ [ "pandas.to_datetime", "pandas.DataFrame" ] ]
ksmirenko/cv-homework
[ "8015c1bfda2ea20ad1d1efdc2ab2ee59415f5155" ]
[ "task3-scaling/image_scaling.py" ]
[ "from __future__ import division\nimport cv2\nimport numpy as np\nimport matplotlib.pyplot as plot\nfrom math import sin, cos, pi\n\nimg = cv2.imread(\"chessboard.bmp\")\nrow4 = np.array(img, dtype='u1')[4]\n\n\n# performs sampling of a continuous signal\ndef sampling(y, t, n): # signal, period, number of componen...
[ [ "numpy.array", "numpy.zeros", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "matplotlib.pyplot.imshow" ] ]
vinayakShenoy/TemporalConvolutionalNetworks
[ "537ed972bde10311245d49f32f6ce65321ccdc80" ]
[ "code/tf2_models.py" ]
[ "import tensorflow as tf\n#from tf.keras.models import Sequential, Model\n#from keras.layers import Input, Dense, TimeDistributed, merge, Lambda\n#from keras.layers.core import *\n#from keras.layers.convolutional import *\n#from keras.layers.recurrent import *\n\n\n#from keras.activations import relu\nfrom functool...
[ [ "tensorflow.keras.layers.Merge", "tensorflow.keras.layers.Conv1D", "tensorflow.keras.layers.Input", "tensorflow.compat.v1.ConfigProto", "tensorflow.compat.v1.InteractiveSession", "tensorflow.keras.layers.Activation", "tensorflow.keras.layers.Convolution1D", "tensorflow.keras.models...
b1quint/DRAGONS
[ "0f5814caaa791bda47edf00407722247095f8427" ]
[ "gempy/library/matching.py" ]
[ "# Copyright(c) 2017-2020 Association of Universities for Research in Astronomy, Inc.\n\nimport numpy as np\nfrom astropy.modeling import fitting, models, FittableModel, Parameter\nfrom astropy.modeling.fitting import (_validate_model,\n _fitter_to_model_params,\n ...
[ [ "numpy.max", "scipy.spatial.cKDTree", "numpy.array", "numpy.linalg.norm", "numpy.zeros", "numpy.argmin", "numpy.exp", "matplotlib.pyplot.subplots", "numpy.diff", "numpy.where", "numpy.std", "numpy.sign", "numpy.arange", "numpy.append", "matplotlib.pyplot...
sidd04/Traffic-Counter
[ "d168b92041b14429914667c835578fc31bacdaf3" ]
[ "tensorflow_examples/models/densenet/train.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\r\n#\r\n# Licensed under the Apache License, Version 2.0 (the \"License\");\r\n# you may not use this file except in compliance with the License.\r\n# You may obtain a copy of the License at\r\n#\r\n# http://www.apache.org/licenses/LICENSE-2.0\r\n#\...
[ [ "tensorflow.keras.metrics.Mean", "tensorflow.keras.optimizers.SGD", "tensorflow.GradientTape", "tensorflow.__version__.startswith", "tensorflow.function", "tensorflow.keras.losses.SparseCategoricalCrossentropy", "tensorflow.keras.callbacks.LearningRateScheduler", "tensorflow.keras....
vovamedentsiy/mpdnn
[ "9d5966a95a27c8c9037c46cbc50d91fe8d387c1e" ]
[ "utils/hooks.py" ]
[ "import threading\n\nimport torch\nimport numpy as np\nclass TBHook(object):\n def __init__(self, model,writer, start_iter=0, n_parallel_devices=0, log_interval=200):\n self.hook = model.register_forward_hook(self.hook_fn)\n self.writer = writer\n self.log_interval = log_interval\n se...
[ [ "torch.Size", "torch.no_grad", "numpy.isscalar" ] ]
mike-gimelfarb/bayesian-epsilon-greedy
[ "77ab3a7b8941a1e093ce91a75f3909e9a95a6f4c" ]
[ "BayesianExploration/tasks/CartPole.py" ]
[ "import gym\nimport math\nimport numpy as np\n\nfrom tasks.Task import Task\n\n\nclass CartPole(Task):\n\n def __init__(self, discrete=False):\n self.env = gym.make('CartPole-v1')\n self.buckets = (3, 3, 6, 3)\n self.discrete = discrete\n\n def initial_state(self, training=True):\n ...
[ [ "numpy.reshape" ] ]
NMNS93/JellyPy
[ "e778b89d6f0f9f0ec41f168f65b099abeb720079" ]
[ "scripts/cancer_cases_with_pharma_results.py" ]
[ "import argparse\nfrom time import strptime\nfrom datetime import date, timedelta\nimport os\nimport pandas as pd\nfrom jellypy.pyCIPAPI.interpretation_requests import access_date_summary_content, get_interpreted_genome_for_case, \\\n get_interpretation_request_list\n\n\ndef parser_args():\n \"\"\"Parse argum...
[ [ "pandas.DataFrame" ] ]
linpeisensh/sim
[ "e849d76caa0a20507436d4a6f9aab06e659ae6b2" ]
[ "maskrcnn_benchmark/modeling/roi_heads/mask_head/mask_head.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\nimport torch\nfrom torch import nn\n\nfrom maskrcnn_benchmark.structures.bounding_box import BoxList\n\nfrom .roi_mask_feature_extractors import make_roi_mask_feature_extractor\nfrom .roi_mask_predictors import make_roi_mask_predictor\nfrom ....
[ [ "torch.cat" ] ]
HackTheSolarSystem/meteorite-mineral-mapping
[ "74a4ab1918553e6c690db1fe6e2926ae227b84d4" ]
[ "src/identifier/main-cuda.py" ]
[ "from numba import cuda\nfrom numba import *\nimport numpy as np\nfrom PIL import Image, ImageDraw, ImageFont\nfrom constants import palette\nimport json\nimport sys\nimport math\n\ntargetObject = sys.argv[1]\n\n#load calibration JSON from standard\nwith open(\"calibration.json\", 'r') as f:\n\tcalibration = json.l...
[ [ "numpy.full", "numpy.zeros" ] ]
mrossetti/zengl
[ "f3e7ed625386b0f48181f1a5e06edb4a05a95f43" ]
[ "examples/instanced_crates.py" ]
[ "import numpy as np\nimport zengl\nfrom objloader import Obj\nfrom PIL import Image\n\nfrom window import Window\n\nwindow = Window(1280, 720)\nctx = zengl.context()\n\nimage = ctx.image(window.size, 'rgba8unorm', samples=4)\ndepth = ctx.image(window.size, 'depth24plus', samples=4)\nimage.clear_value = (1.0, 1.0, 1...
[ [ "numpy.random.normal", "numpy.linspace" ] ]
privacytrustlab/dp_dynamics
[ "0566b7c1b1f1a48b96713193b6e37f646690fb97" ]
[ "models.py" ]
[ "# adapted from https://github.com/ftramer/Handcrafted-DP/blob/main/models.py\n# MIT License\n\n# Copyright (c) 2020 ftramer\n\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without...
[ [ "torch.nn.Linear", "torch.nn.Identity", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.Tanh", "torch.nn.GroupNorm", "torch.nn.Conv2d" ] ]
mesarcik/Efficient-GAN-Anomaly-Detection
[ "849ffd91436f4ab8908e0d0ae9e6eadff5f67110" ]
[ "data/kdd.py" ]
[ "import logging\nimport numpy as np\nimport pandas as pd \nfrom sklearn.model_selection import train_test_split\nfrom sklearn.preprocessing import MinMaxScaler\n\nlogger = logging.getLogger(__name__)\n\ndef get_train(*args):\n \"\"\"Get training dataset for KDD 10 percent\"\"\"\n return _get_adapted_dataset(\...
[ [ "numpy.concatenate", "numpy.random.RandomState", "sklearn.preprocessing.MinMaxScaler", "pandas.read_csv", "pandas.get_dummies" ] ]
pansn1995/tvm
[ "aabe351231537ef44eccb3eff0014abd6a84f95d" ]
[ "python/tvm/relay/frontend/onnx.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.array", "numpy.ones_like", "numpy.asarray", "numpy.prod", "numpy.random.randint", "numpy.iinfo", "numpy.dtype" ] ]
College-Track/fy21_hs_survey
[ "0677095897d98d38b3b0ea52269ac303ac46f8c7" ]
[ "src/individual_student_responses.py" ]
[ "import pandas as pd\nfrom simple_salesforce import Salesforce, format_soql\nimport os\nfrom dotenv import load_dotenv\nfrom ct_snippets.load_sf_class import SF_SOQL, SF_Report\nfrom ct_snippets.sf_bulk import sf_bulk, sf_bulk_handler, generate_data_dict\nfrom reportforce import Reportforce\nimport numpy as np\nimp...
[ [ "pandas.read_pickle", "pandas.read_gbq", "pandas.ExcelWriter" ] ]
effigies/sdcflows
[ "c56e2fd87974b96b02f43aab5b0cf3733fcf0d3c" ]
[ "sdcflows/interfaces/fmap.py" ]
[ "# -*- coding: utf-8 -*-\n# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n\"\"\"\nInterfaces to deal with the various types of fieldmap sources\n\n .. testsetup::\n\n >>> tmpdir = getfixture('tmpdir')\n >>> tmp = tmpdir.chdir() # c...
[ [ "numpy.array", "numpy.zeros_like", "numpy.ones_like", "scipy.ndimage.binary_erosion", "numpy.median", "scipy.ndimage.generate_binary_structure", "numpy.abs" ] ]
ranisalt/hackaton-saac
[ "39278b23ffb60c0a1ebc5a1d2f02f1167dbd30c0" ]
[ "tpot_agent.py" ]
[ "import numpy as np\nfrom tpot import TPOTRegressor\nfrom tpot.config import regressor_config_dict_light\n\nfrom agent import SillyWalker, Action\n\n\nif __name__ == '__main__':\n walker = SillyWalker()\n\n for _ in range(10):\n while not walker.done:\n walker.step()\n walker.reset()\...
[ [ "numpy.array" ] ]
jphgxq/bagua
[ "3444f79b8fe9c9d2975a8994a1a613ebd14c3d33" ]
[ "bagua/torch_api/communication.py" ]
[ "import logging\nimport multiprocessing\nimport bagua_core as B\nimport bagua.torch_api.globals\nfrom bagua.service import AutotuneService\nfrom . import env\nfrom .env import (\n get_world_size,\n get_rank,\n get_local_rank,\n get_local_size,\n get_master_addr,\n get_default_bucket_size,\n get...
[ [ "torch.device", "torch.cuda.synchronize", "torch.distributed.distributed_c10d._get_default_store", "torch.distributed.init_process_group", "torch.cuda.current_stream", "torch.distributed.is_initialized", "torch.cuda.stream", "torch.distributed.get_rank", "torch.cuda.Stream" ]...
AnonymousAuthors444/VEC_VAD
[ "0072bf857030e621e2f9c12689407b81e45ed603" ]
[ "model/unet.py" ]
[ "import torch\nimport torch.nn as nn\n\nclass double_conv(nn.Module):\n '''(conv => BN => ReLU) * 2'''\n\n def __init__(self, in_ch, out_ch):\n super(double_conv, self).__init__()\n self.conv= nn.Sequential(\n nn.Conv2d(in_channels=in_ch, out_channels=out_ch, kernel_size=3, padding=1)...
[ [ "torch.cat", "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.ConvTranspose2d", "torch.nn.ReLU", "torch.nn.Upsample", "torch.nn.Conv2d" ] ]
ska-telescope/ska-rfi-monitoring-processing
[ "7f8e76b1a82238e148da73dea27db46b2824e711" ]
[ "SKALA4 in phase0.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Mar 13 14:28:07 2019\n\nReads a TDD data file from LFAA PHASE 0 experiment\n\n@author: f.divruno\n\"\"\"\nimport os, os.path\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom math import * \nimport matplotlib\nimport rfiLib as RFI\nfrom scipy import signal \...
[ [ "matplotlib.pyplot.grid", "matplotlib.pyplot.plot", "scipy.signal.butter", "matplotlib.pyplot.legend", "numpy.load", "matplotlib.rc", "matplotlib.pyplot.figure", "scipy.signal.filtfilt", "scipy.signal.lfilter", "numpy.savez_compressed", "numpy.log10", "scipy.signal....
fffy2366/image-processing
[ "e1170b3f670e23e5728caa2716c96b90216ce4b3" ]
[ "tests/python/rotation_spacing.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nhttps://gist.github.com/endolith/334196bac1cac45a4893#\n\nAutomatically detect rotation and line spacing of an image of text using\nRadon transform\nIf image is rotated by the inverse of the output, the lines will be\nhorizontal (though they may be upside-down depending on the orig...
[ [ "matplotlib.pyplot.subplot", "numpy.fft.rfft", "matplotlib.mlab.rms_flat", "matplotlib.pyplot.axhline", "matplotlib.pyplot.gray", "matplotlib.pyplot.plot", "numpy.mean", "numpy.blackman", "numpy.argmax", "matplotlib.pyplot.show", "matplotlib.pyplot.axvline", "matplo...
lewtun/satflow
[ "6a675e4fa921b4dd023361b55cc2a5fa25b8f8ed" ]
[ "satflow/models/perceiver.py" ]
[ "from perceiver_pytorch import PerceiverIO, MultiPerceiver\nfrom perceiver_pytorch.modalities import InputModality, modality_encoding\nfrom perceiver_pytorch.utils import encode_position\nfrom perceiver_pytorch.encoders import ImageEncoder\nfrom perceiver_pytorch.decoders import ImageDecoder\nimport torch\nfrom mat...
[ [ "torch.nn.Linear", "torch.stack", "torch.ones", "torch.eye", "torch.Tensor" ] ]
adamreidsmith/moon_ai
[ "9dd53ce58e17b7b3da3ac550828e06c039f230d8" ]
[ "grade_net.py" ]
[ "import numpy as np\nimport pickle\nimport torch as t\nfrom torch import nn\nfrom torch.utils.data import Dataset, DataLoader, random_split\nfrom torch.optim import Adam\n#from torch.optim.lr_scheduler import MultiplicativeLR\nimport matplotlib.pyplot as plt\nfrom itertools import chain\n#from scipy.stats import pe...
[ [ "torch.nn.Linear", "torch.cat", "numpy.mean", "matplotlib.pyplot.xticks", "numpy.histogram", "matplotlib.pyplot.colorbar", "torch.utils.data.random_split", "numpy.prod", "torch.utils.data.DataLoader", "matplotlib.pyplot.gca", "torch.Tensor", "numpy.array", "matp...
murrayrm/fbs2e-python
[ "24abc64ca280e23adcfb8a5eebe189604b4601c9" ]
[ "figure-2.9-secord_stepresp.py" ]
[ "# figure-2.9-secord_stepresp.py - step responses for second order systems\n# RMM, 21 Jun 2021\n#\n# Responses to a unit step change in the reference signal for different\n# values of the design parameters \\omega_c and \\zeta_c. The left column\n# shows responses for fixed \\zeta_c = 0.707 and \\omega_c = 1, 2, an...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "numpy.linspace", "matplotlib.pyplot.subplot" ] ]
VictorDarvariu/graph-construction-rl
[ "46eccc1d94b1db51ddbe414baf56b19334a39678" ]
[ "relnet/agent/supervised/sl_net.py" ]
[ "import torch\nfrom pytorch_util import weights_init\nfrom torch import nn as nn\nfrom torch.autograd import Variable\nfrom torch.nn import functional as F\n\nfrom relnet.agent.fnapprox.gnn_regressor import GNNRegressor\nfrom relnet.common.modules.custom_mod import JaggedArgmaxModule\nfrom relnet.utils.config_utils...
[ [ "torch.nn.Linear", "torch.LongTensor", "torch.argmax", "torch.zeros" ] ]
susht3/Text_Mutil_Classification_keras
[ "82e43bec29588c620a731323c5bf95c50c94c119" ]
[ "main/30w_vec.py" ]
[ "import sys\nsys.path.append(\"../\")\nimport os\nimport time\nimport json, pickle\nimport numpy as np\nfrom datetime import datetime\nfrom itertools import product\nfrom keras.callbacks import ModelCheckpoint\nfrom keras.models import load_model\nfrom util94 import plot_loss_figure, load_X, load_Y,load_X_hierarchi...
[ [ "numpy.arange" ] ]
TheArtOfPour/rpi-vision
[ "482cb7c2dc628901f19d31377ff554d7455680b3" ]
[ "tests/pygametest.py" ]
[ "import pygame\nimport os\nimport sys\nimport time\nfrom rpi_vision.agent.capture import PiCameraStream\nimport numpy as np\n\nos.environ['SDL_FBDEV'] = \"/dev/fb1\"\nos.environ['SDL_VIDEODRIVER'] = \"fbcon\"\ncapture_manager = PiCameraStream(resolution=(320, 320), rotation=180, preview=False)\n\npygame.init()\nscr...
[ [ "numpy.array" ] ]
tsubame-mz/reinforcement_learning
[ "b69cce573deed11676f60653b41e036d8e79aedc" ]
[ "RL/ppo/agent.py" ]
[ "import torch\r\nimport torch.nn.functional as F\r\nfrom torch.distributions import Categorical\r\nimport numpy as np\r\nimport os\r\n\r\n\r\nclass Agent:\r\n def __init__(self, p_net, v_net, optim_p, optim_v, device):\r\n super(Agent, self).__init__()\r\n self.p_net = p_net\r\n self.v_net =...
[ [ "torch.nn.functional.binary_cross_entropy_with_logits", "torch.distributions.Categorical", "torch.max", "torch.save", "torch.no_grad", "numpy.mean", "torch.load", "torch.exp" ] ]
SID262000/BentoML
[ "0708a6495e4d1f0ddf639026be768abf2d55410a" ]
[ "bentoml/_internal/runner/container.py" ]
[ "import abc\nimport pickle\nimport typing as t\nfrom typing import TYPE_CHECKING\n\nfrom simple_di import inject\nfrom simple_di import Provide\n\nfrom ..types import LazyType\nfrom ..configuration.containers import DeploymentContainer\n\nSingleType = t.TypeVar(\"SingleType\")\nBatchType = t.TypeVar(\"BatchType\")\...
[ [ "numpy.stack", "numpy.squeeze", "numpy.split", "pandas.concat" ] ]
nathanwolfe/zipline-minute-bars
[ "bcc6532731503c4521c6f7c4f9ee5e7ee545c013" ]
[ "zipline/finance/trading.py" ]
[ "#\n# Copyright 2016 Quantopian, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or...
[ [ "pandas.tslib.normalize_date" ] ]
FelipeGiro/ReliabiliPy
[ "42624a65504a959f66a64ae2ad2ccfb5af5ae9b0" ]
[ "reliabpy/models/inference.py" ]
[ "import numpy as np\nfrom scipy.stats import norm\nfrom reliabpy.models.observation import Probability_of_Detection as PoD\n\nimport torch\n\nclass _Base(object):\n def _global_init(self):\n self.store_results = True\n self.t, self.action, self.output = 0, None, None\n\n self.force_detection...
[ [ "numpy.array", "numpy.ones_like", "torch.mul", "numpy.sum", "numpy.diff", "numpy.random.uniform", "torch.matmul", "torch.Tensor" ] ]
mkamyab/welleng
[ "0ab73440e5ac3ad9a67d880658f9cdde33c0e0e7" ]
[ "welleng/io.py" ]
[ "import numbers\nimport numpy as np\nfrom .survey import Survey\n\ntry:\n from openpyxl import load_workbook\n OPENPYXL = True\nexcept ImportError:\n OPENPYXL = False\n\n\ndef get_standard_data(filename):\n # import data from Excel\n assert OPENPYXL, \"ImportError: try pip install welleng[easy]\"\n ...
[ [ "numpy.array" ] ]
keshav47/mildnet
[ "c5a95da78039bea605b75ce3ed2af6fe310f36f6" ]
[ "trainer/accuracy.py" ]
[ "from tensorflow.keras import backend as K\nimport tensorflow as tf\n\n_EPSILON = K.epsilon()\n\ndef accuracy_fn(batch_size):\n\n def accuracy(y_true, y_pred):\n y_pred = K.clip(y_pred, _EPSILON, 1.0-_EPSILON)\n accuracy = 0\n for i in range(0,batch_size,3):\n try:\n ...
[ [ "tensorflow.keras.backend.sum", "tensorflow.cond", "tensorflow.keras.backend.epsilon", "tensorflow.keras.backend.clip", "tensorflow.cast" ] ]
Tekrific/lightly
[ "75a1d56b4cee77f68e0f3166e3a412711d0dbb2d", "75a1d56b4cee77f68e0f3166e3a412711d0dbb2d" ]
[ "lightly/models/simsiam.py", "tests/api_workflow/test_api_workflow.py" ]
[ "\"\"\" SimSiam Model \"\"\"\n\n# Copyright (c) 2020. Lightly AG and its affiliates.\n# All Rights Reserved\n\nimport torch\nimport torch.nn as nn\n\n\ndef _prediction_mlp(in_dims: int, \n h_dims: int, \n out_dims: int) -> nn.Sequential:\n \"\"\"Prediction MLP. The original ...
[ [ "torch.nn.Linear", "torch.nn.Sequential", "torch.nn.ReLU", "torch.nn.BatchNorm1d" ], [ "numpy.random.choice" ] ]
lenskit/lenskit-tf
[ "7f1366bb74223592721439689dee39195aff3cbd" ]
[ "lenskit_tf/biasedmf.py" ]
[ "import logging\n\ntry:\n import tensorflow as tf\n import tensorflow.keras as k\nexcept ImportError:\n tf = None\n\nfrom lenskit import util\nfrom lenskit.algorithms.mf_common import MFPredictor\nfrom lenskit.algorithms.bias import Bias\nfrom .util import init_tf_rng, check_tensorflow\n\n_log = logging.ge...
[ [ "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Embedding", "tensorflow.keras.Model", "tensorflow.keras.regularizers.l2", "tensorflow.keras.layers.Dot", "tensorflow.keras.Input" ] ]
artis-mcrt/artistools
[ "40f78d87fa5cd50f08731a63a9fc2ecb85c7e06d", "40f78d87fa5cd50f08731a63a9fc2ecb85c7e06d" ]
[ "artistools/inputmodel/shen2018.py", "artistools/nonthermal/leptontransport.py" ]
[ "#!/usr/bin/env python3\n\nimport argparse\nimport math\nimport os.path\n\nimport numpy as np\nimport pandas as pd\nfrom astropy import units as u\n\nimport artistools as at\n\n\ndef addargs(parser):\n parser.add_argument('-inputpath', '-i',\n default='1.00_5050.dat',\n ...
[ [ "pandas.DataFrame", "pandas.read_csv" ], [ "matplotlib.pyplot.close", "matplotlib.pyplot.subplots" ] ]
SNEWS2/snewpdag
[ "57f886cf08e1acd8af48ee486a1c2400e2b77b8b" ]
[ "snewpdag/plugins/Histogram1D.py" ]
[ "\"\"\"\nHistogram1D: a plugin which accumulates a histogram based on its configuration.\n Only notifies downstream plugins on a `report' action.\n\nConstructor arguments:\n nbins: number of bins\n xlow: low edge of histogram\n xhigh: high edge of histogram\n in_field: string, name of field to extract from al...
[ [ "numpy.sqrt", "numpy.zeros" ] ]
TaeHoon-Roh/Caffe2
[ "8539a1e78b7fd8aa92b08a8f24b2b0f7978bf5a5" ]
[ "caffe2/python/operator_test/weighted_sample_test.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport numpy as np\n\nfrom hypothesis import given\nimport hypothesis.strategies as st\n\nfrom caffe2.python import core\nfrom caffe2.python import workspace\ni...
[ [ "numpy.testing.assert_allclose", "numpy.array", "numpy.random.rand", "numpy.zeros", "numpy.random.randint" ] ]
quchunguang/test
[ "dd1dde14a69d9e8b2c9ed3efbf536df7840f0487" ]
[ "testpy3/tensorflow1.py" ]
[ "import os\nimport numpy as np\nimport tensorflow as tf\n\n# Ignore warn: Your CPU supports instructions that this TensorFlow binary\n# was not compiled\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'\n\n##构造数据##\nx_data = np.random.rand(100).astype(np.float32) # 随机生成100个类型为float32的值\ny_data = x_data * 0.1 + 0.3 # 定义方程...
[ [ "tensorflow.zeros", "numpy.random.rand", "tensorflow.random_uniform", "tensorflow.Session", "tensorflow.global_variables_initializer", "tensorflow.square", "tensorflow.train.GradientDescentOptimizer" ] ]
Codle/texar-pytorch
[ "d63556e7a8f48076c396467314a771d56552d595" ]
[ "texar/torch/modules/networks/conv_networks.py" ]
[ "# Copyright 2019 The Texar 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 required...
[ [ "torch.no_grad", "torch.ones" ] ]
jowens/altair
[ "3c45a584e3644fc3a234d8468333e48ba808c32b" ]
[ "altair/vegalite/v2/tests/test_api.py" ]
[ "\"\"\"Unit tests for altair API\"\"\"\n\nimport io\nimport json\nimport os\nimport tempfile\n\nimport pytest\nimport pandas as pd\n\nimport altair.vegalite.v2 as alt\n\n\n@pytest.fixture\ndef basic_chart():\n data = pd.DataFrame({\n 'a': ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'],\n 'b': [28, 5...
[ [ "pandas.DataFrame", "pandas.date_range" ] ]
hardy8059/OpenCV_Examples
[ "8cdba1a72374b4cb9f8aa293a4b88edc7d1f341d" ]
[ "Image Processing/Morphological Transformations/BlackHat.py" ]
[ "import cv2\r\nimport numpy as np\r\nfrom matplotlib import pyplot as plt\r\n\r\nimg = cv2.imread('C:/Users/Hardik/Documents/OpeCV/Tut6/Noise.jpg')\r\nkernel = np.ones((5,5),np.uint8)\r\n\r\ngradient = cv2.morphologyEx(img,cv2.MORPH_BLACKHAT,kernel)\r\n\r\ncv2.imshow('Original',img)\r\ncv2.imshow('Filtered',gradien...
[ [ "numpy.ones" ] ]
randilu/Impact-Analysis-Module-codebase
[ "87dddfd886ce690a450cedae709379283e1b0ed1" ]
[ "src/data/fetch_kw_format2.py" ]
[ "import json\nimport math\nfrom pandas.io.json import json_normalize\nfrom src.data.fetch_trend_data_utils import display_max_cols, save_dictionary_to_csv\n\ndisplay_max_cols(10)\njfile = \"/home/randilu/fyp_impact analysis module/impact_analysis_module/data/external/events/Kelani_Valley_Plantaitions_PLC_v2.json\"\...
[ [ "pandas.io.json.json_normalize" ] ]
madeira-sustcer/ME336-Project2
[ "94334569418b4270a326453a000dfd53938d2c82" ]
[ "calculate.py" ]
[ "import numpy\n\ndef quaternion_matrix(quaternion):\n \"\"\"Return homogeneous rotation matrix from quaternion.\n\n >>> M = quaternion_matrix([0.99810947, 0.06146124, 0, 0])\n >>> numpy.allclose(M, rotation_matrix(0.123, [1, 0, 0]))\n True\n >>> M = quaternion_matrix([1, 0, 0, 0])\n >>> numpy.allc...
[ [ "numpy.concatenate", "numpy.array", "numpy.dot", "numpy.zeros", "numpy.sum", "numpy.linalg.eigh", "numpy.linalg.pinv", "numpy.roll", "numpy.linalg.det", "numpy.mean", "numpy.identity", "numpy.allclose", "numpy.argmax", "numpy.linalg.svd", "numpy.outer", ...
Dquentin/tensorflow
[ "06ad4ad47bef99d4a8f6856bbb121387e8edcfa5" ]
[ "tensorflow/python/kernel_tests/logging_ops_test.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.ops.variables.Variable", "tensorflow.python.ops.math_ops.div", "tensorflow.python.ops.math_ops.less", "tensorflow.python.ops.logging_ops.Print", "tensorflow.python.ops.math_ops.matmul", "tensorflow.python.ops.logging_ops.print_v2", "tensorflow.python.ops.math_ops.mul...
chapman-phys227-2016s/hw-7-ChinmaiRaman
[ "ed985215003006e2fd011c3f83f453ad63f7c61b" ]
[ "Polynomial.py" ]
[ "#! /usr/bin/env python\n\n\"\"\"\nFile: Polynomial\nCopyright (c) 2016 Chinmai Raman\nLicense: MIT\nCourse: PHYS227\nAssignment: 7.27\nDate: April 14th, 2016\nEmail: raman105@mail.chapman.edu\nName: Chinmai Raman\nDescription: Regular Polynomial class\n\"\"\"\n\nfrom __future__ import division\nimport matplotlib.p...
[ [ "numpy.allclose", "numpy.zeros" ] ]
fearofcode/queue-controller
[ "f6838e8930ea627534791559f537ef9c0723122e" ]
[ "plot_test.py" ]
[ "import math\nimport matplotlib.pyplot as plt\n\nt = [i+1 for i in range(200)]\ns = [math.sin(i) for i in t]\nplt.plot(t, s)\n\nplt.xlabel('time (s)')\nplt.ylabel('voltage (mV)')\nplt.title('simple plotting test')\nplt.grid(True)\nplt.show()\n" ]
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
sivaabhishek/emotion-recognition-using-deep-learning
[ "42d9224e1279830c783295a1fb403f2c45c35064" ]
[ "dataset_prepare.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom PIL import Image\nfrom tqdm import tqdm\nimport os\n\n\n# making folders\nouter_names = ['test', 'train']\ninner_names = ['angry', 'disgusted', 'fearful', 'happy', 'sad', 'surprised', 'neutral']\nos.makedirs('data', exist_ok=True)\nfor outer_name in outer_names:\n o...
[ [ "pandas.read_csv", "numpy.zeros" ] ]
bricsi0000000000000/keras-yolo3
[ "04b606e2ca85d9168a8d2520704652f60c4bb97b" ]
[ "yolo3/model.py" ]
[ "\"\"\"YOLO_v3 Model Defined in Keras.\"\"\"\n\nfrom functools import wraps\n\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.keras import backend as K\nfrom tensorflow.keras.layers import Conv2D, Add, ZeroPadding2D, UpSampling2D, Concatenate, MaxPooling2D\nfrom tensorflow.keras.layers import LeakyReL...
[ [ "tensorflow.keras.backend.sigmoid", "tensorflow.keras.backend.dtype", "tensorflow.keras.layers.Add", "tensorflow.keras.backend.cast", "tensorflow.image.non_max_suppression", "numpy.minimum", "tensorflow.keras.backend.zeros_like", "tensorflow.keras.models.Model", "tensorflow.ker...
aangfanboy/teknofestcomp
[ "04f6ce510326cbc1af72a442cc65a80ad880c0f8" ]
[ "ModelUtils/TensorBoardEngine.py" ]
[ "import tensorflow as tf\n\nfrom shutil import rmtree\n\n\nclass TensorBoardCallback:\n def delete_graphs(self):\n if tf.io.gfile.exists(self.logdir):\n rmtree(self.logdir)\n print(f\"[*] {self.logdir} has deleted with shutil's rmtree\")\n\n def initialize(self, delete_if_exists: ...
[ [ "tensorflow.summary.image", "tensorflow.summary.scalar", "tensorflow.summary.text", "tensorflow.io.gfile.exists", "tensorflow.summary.create_file_writer" ] ]
davrempe/caspr
[ "a02edb4be11f5ccfe563b2a7869ee8e731e0f8ff" ]
[ "caspr/utils/test_utils.py" ]
[ "import numpy as np\n\n#\n# testing helper functions\n#\n\nclass TestStatTracker():\n '''\n Tracks statistics of interest while running inference on the\n validation or test sets\n '''\n def __init__(self):\n self.loss_sum = 0.0\n self.total_loss_count = 0\n\n self.cnf_err_sum = ...
[ [ "numpy.sum", "numpy.array" ] ]
Velythyl/pairwise-distance-loss-POC
[ "408592cd04eb7b39b9c4191663609c90f9fdcf28" ]
[ "eval_model.py" ]
[ "import numpy as np\nimport sklearn.metrics\nimport torch\nfrom torch.nn.functional import mse_loss\n\nimport plot\nfrom utils import tensor2numpy\n\n\ndef compute_centroids(embeddings, classes):\n embeddings = tensor2numpy(embeddings)\n classes = tensor2numpy(classes)\n\n embeddings = embeddings\n cent...
[ [ "numpy.max", "torch.nn.functional.normalize", "numpy.copy", "torch.no_grad", "numpy.mean", "torch.from_numpy", "torch.nn.functional.mse_loss", "numpy.std", "torch.clone", "torch.cdist" ] ]
mjhoshea/MetaLifelongLanguage
[ "22327dec0038a50276ba0994258f6f2fd46fbae7" ]
[ "models/cls_anml.py" ]
[ "import logging\nimport math\n\nimport higher\nimport torch\nfrom torch import nn, optim\n\nimport numpy as np\n\nfrom torch.utils import data\nfrom transformers import AdamW\n\nimport datasets\nimport models.utils\nfrom models.base_models import ReplayMemory, TransformerClsModel, TransformerNeuromodulator\n\nloggi...
[ [ "torch.utils.data.ConcatDataset", "torch.save", "torch.optim.SGD", "torch.no_grad", "numpy.mean", "torch.autograd.grad", "torch.tensor", "torch.utils.data.DataLoader", "torch.load", "torch.nn.CrossEntropyLoss" ] ]
MetaMind/varibad
[ "75e26430d83296c0ee3a7ac3ebb1506b7cf7d49e" ]
[ "utils/helpers.py" ]
[ "import os\nimport pickle\n# import pickle5 as pickle\nimport random\nimport warnings\nfrom distutils.util import strtobool\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch.nn import functional as F\n\nfrom environments.parallel_envs import make_vec_envs\n\ndevice = torch.device(\"cuda:0\" if ...
[ [ "torch.nn.Linear", "torch.zeros", "torch.cat", "torch.min", "numpy.random.seed", "torch.no_grad", "torch.nn.functional.relu", "torch.manual_seed", "torch.random.manual_seed", "torch.randn_like", "torch.all", "torch.cuda.is_available", "torch.tensor", "torch....
yida2311/segmentation_models.pytorch
[ "e5c0b8b915a7d8c82222cc319030b241b12b0cf2" ]
[ "segmentation_models_pytorch/pspnet/decoder.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom ..base import modules\n\n\nclass PSPBlock(nn.Module):\n\n def __init__(self, in_channels, out_channels, pool_size, use_bathcnorm=True):\n super().__init__()\n if pool_size == 1:\n use_bathcnorm = False # PyTor...
[ [ "torch.nn.AdaptiveAvgPool2d", "torch.nn.functional.interpolate", "torch.cat", "torch.nn.Dropout2d" ] ]
agramfort/nibabel
[ "286c882f32d270111b1c152bc398e15e81b30457" ]
[ "nibabel/nifti1.py" ]
[ "# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##\n#\n# See COPYING file distributed along with the NiBabel package for the\n# copyright and license terms.\n#\n#...
[ [ "numpy.dot", "numpy.mean", "numpy.finfo", "numpy.sort", "numpy.fromstring", "numpy.dtype", "numpy.eye", "numpy.asscalar", "numpy.isfinite", "numpy.array", "numpy.linalg.det", "numpy.diff", "numpy.allclose", "numpy.linalg.svd", "numpy.argsort", "numpy...
Faaizz/computer_vision
[ "a6145c6b3b7d8b3492e85932fe96da6f46fcd0d4" ]
[ "old/test/test_nodes/test_multiclass_svm_loss.py" ]
[ "\nimport unittest, sys\nimport numpy as np\n\nfrom src.nodes.multiclass_svm_loss import MulticlassSVMLoss\nfrom src.utils.numeric_gradient import evaluate_gradient\n\nclass TestMulticlassSVMLoss(unittest.TestCase):\n\n def setUp(self):\n self.model= MulticlassSVMLoss()\n\n def test_forward(self):\n ...
[ [ "numpy.testing.assert_almost_equal", "numpy.array", "numpy.random.randn" ] ]
mvdhoek/DSB-ReSeT
[ "746aa92cab795011494e09f4c27c5c2e673ba82c" ]
[ "Elastic/ElasticPutDocs.py" ]
[ "# A python script to upload safety reports to Elasticsearch\n\nimport elasticsearch as es\nfrom elasticsearch import helpers\nimport logging\nimport base64\nfrom os import listdir\nfrom os.path import isfile, join\nimport hashlib\nimport pandas as pd\n\n# DEFINITIONS -----------------------------------------------...
[ [ "pandas.isnull" ] ]
milhidaka/iclr2017
[ "13170b731a1dcd6e380ea187a1caf87004a4d8d1" ]
[ "train_server/train_loop.py" ]
[ "# -*- coding:utf-8 -*-\n\nimport json\nimport logging\nimport numpy as np\nfrom collections import defaultdict\nfrom SimpleWebSocketServer import SimpleWebSocketServer, WebSocket\nimport dist_train_config\nimport dist_params\nimport varserverapi\nfrom dataset_loader import DatasetLoader\nfrom weight_pack import We...
[ [ "numpy.zeros_like" ] ]
antoinedemathelin/ruptures
[ "2860a5aeea6c99d03049445a6d37c79f94fda18f" ]
[ "src/ruptures/costs/costrank.py" ]
[ "r\"\"\"Rank-based cost function (CostRank)\"\"\"\nimport numpy as np\nfrom numpy.linalg import pinv, LinAlgError\nfrom scipy.stats.mstats import rankdata\n\nfrom ruptures.base import BaseCost\nfrom ruptures.costs import NotEnoughPoints\n\n\nclass CostRank(BaseCost):\n r\"\"\"\n Rank-based cost function\n ...
[ [ "numpy.cov", "numpy.linalg.LinAlgError", "numpy.linalg.pinv", "numpy.mean", "scipy.stats.mstats.rankdata" ] ]
KarinaMartirosova/JETSCAPE
[ "683dbce4f711cca87270fd360812e25538de919d" ]
[ "src/reader.py" ]
[ "'''\nRead data according to the JetScape 1.0 stat specification\n'''\n\nimport numpy as np\n\nimport os\nimport pickle\nfrom pathlib import Path\n\n\ndef ReadDesign(FileName):\n # This is the output object\n Result = {}\n Version = ''\n\n Result[\"FileName\"] = FileName\n\n # First read all the head...
[ [ "numpy.loadtxt", "numpy.zeros", "numpy.absolute" ] ]