repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
alexandre-bloch/TDLearning | [
"281dccaa70d1119b9628e64105bbd32efe2fe2a0"
] | [
"_model.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sat Jan 9 22:25:58 2021\r\n\r\n@author: atteb\r\n\"\"\"\r\n\r\nimport tensorflow as tf\r\nfrom tensorflow.keras.layers import Dense, Reshape\r\nfrom tensorflow.keras.layers.experimental.preprocessing import Normalization\r\n\r\ntf.keras.backend.set_floatx('float32')... | [
[
"tensorflow.tensordot",
"tensorflow.ones",
"tensorflow.keras.layers.Reshape",
"tensorflow.keras.layers.Dense",
"tensorflow.reshape",
"tensorflow.cast",
"tensorflow.rank",
"tensorflow.keras.backend.set_floatx",
"tensorflow.shape",
"tensorflow.GradientTape",
"tensorflow.s... |
Changh1228/SSS-model-thesis | [
"b1dc9dcefa43bc577966bc769dfb9cf09da972c5"
] | [
"Ref/Max/drape_mesh.py"
] | [
"from auvlib.data_tools import csv_data, xtf_data\nfrom auvlib.bathy_maps import map_draper, data_vis\nimport numpy as np\n\n#Script that drapes the side-scan data on top of the generated mesh_map and\n#saves the result as sss_map_images, which is a good data structure for applications.\n\n#------------------------... | [
[
"numpy.load"
]
] |
jdmartin/thesis-codesamples | [
"d19cdb1af3c94b9ea9a0e6e95315cc6b28e2fc38"
] | [
"Appendix B/plot_class_types_and_counts.py"
] | [
"import os\n\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport seaborn as sns\n\nfiles = os.listdir('by-type')\nfiles.remove('.DS_Store')\n\n#Results contains (year, type of course, count)\nresults=[]\n\n#Need a list of years... for secret reasons.\nyears = ['2001', '2002', '2003', '2004', '2005', '2006... | [
[
"pandas.DataFrame",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
mukaman84/pytorch-template | [
"03c24724e084fab99a859202d4c98f2a34cdba22",
"03c24724e084fab99a859202d4c98f2a34cdba22"
] | [
"utils/saver.py",
"BsplineModel/Read_from_folder.py"
] | [
"import os\nimport shutil\nimport torch\nfrom collections import OrderedDict\nimport glob\n\nclass Saver(object):\n\n def __init__(self, args):\n self.args = args\n self.directory = os.path.join('run', 'LaneMobis', args.checkname)\n self.runs = sorted(glob.glob(os.path.join(self.directory, '... | [
[
"torch.save"
],
[
"numpy.max",
"numpy.zeros_like",
"scipy.misc.imread",
"numpy.where",
"numpy.multiply",
"numpy.invert",
"scipy.misc.imsave"
]
] |
cchoquette/privacy | [
"6a48a45afd17c211af4f3c4087316f236e9ccb34"
] | [
"tensorflow_privacy/privacy/dp_query/quantile_adaptive_clip_sum_query_test.py"
] | [
"# Copyright 2019, The TensorFlow 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 ... | [
[
"tensorflow.compat.v1.assign",
"tensorflow.compat.v1.constant",
"numpy.log",
"numpy.std",
"tensorflow.compat.v1.test.main",
"numpy.sqrt",
"tensorflow.compat.v1.enable_eager_execution",
"numpy.linspace",
"tensorflow.compat.v1.Variable"
]
] |
ms8909/computer-vision | [
"fc5f9a8fb4bd8ff53d636b5aee02d4cdd6b8c80b"
] | [
"s3fd.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\n\nclass L2Norm(nn.Module):\n def __init__(self,n_channels, scale=1.0):\n super(L2Norm,self).__init__()\n self.n_channels = n_channels\n self.scale = scale\n self.eps = 1e-10\n ... | [
[
"torch.cat",
"torch.max",
"torch.nn.Conv2d",
"torch.nn.functional.max_pool2d",
"torch.Tensor",
"torch.chunk"
]
] |
polbebe/PinkPanther | [
"c6ba47956b2cae6468ac0cfe56229b5434fec754",
"c6ba47956b2cae6468ac0cfe56229b5434fec754"
] | [
"CML/Network Control/main_server.py",
"CML/Sim2Real Control/Read/WALK_Read.py"
] | [
"import gym\nimport gym.spaces as spaces\nimport sys\n\nimport socket\n\nfrom _thread import *\nimport os\n\nimport csv\n\nimport numpy as np\nimport pandas as pd\nimport math as m\nimport time\nimport random\n\nclass Interface:\n\tdef __init__(self, host='128.59.145.148', port=8123, act_dim=1, state_dim=1):\n\t\tp... | [
[
"numpy.array",
"numpy.random.uniform",
"numpy.zeros",
"numpy.append"
],
[
"numpy.array",
"numpy.linspace",
"numpy.sin",
"numpy.zeros"
]
] |
bouhoula/TextAttack | [
"10309a32deb9b7daeafa3434b4a3bfea990f442b"
] | [
"textattack/search_methods/beam_search.py"
] | [
"\"\"\"\nBeam Search\n===============\n\n\"\"\"\nimport numpy as np\n\nfrom textattack.goal_function_results import GoalFunctionResultStatus\nfrom textattack.search_methods import SearchMethod\n\n\nclass BeamSearch(SearchMethod):\n \"\"\"An attack that maintinas a beam of the `beam_width` highest scoring\n At... | [
[
"numpy.array"
]
] |
brianRingler/EDA-Tools- | [
"1870e786f1cd009f03a51243177e5b22a98bb921"
] | [
"HelperFunctions.py"
] | [
"import numpy as np\r\n\r\n\r\ndef scale_convert(self,list_to_convert):\r\n \"\"\"Takes a list of values and scales using NumPy\r\n log10() and rounds two decimal places.\r\n \r\n Arguments:\r\n list_to_convert {list} -- List of values int or float\r\n \r\n Returns:\r\n list -- List ... | [
[
"numpy.log10",
"numpy.array"
]
] |
GiuseMSD/k8-data-visualization | [
"a14b20e843149eda946d764781efd75835ae7158"
] | [
"upwork-devs/Giuseppe-mazzacua/pull_requests.py"
] | [
"import requests\nimport json\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom pprint import pprint\nfrom datetime import timedelta\nimport datetime as dt\nfrom pandas.io.json import json_normalize\nimport warnings\nwarnings.filterwarnings('ignore')\n\nclass PR:... | [
[
"pandas.to_datetime",
"pandas.set_option",
"numpy.median",
"matplotlib.pyplot.xlabel",
"pandas.io.json.json_normalize",
"pandas.DataFrame",
"numpy.mean",
"matplotlib.pyplot.ylabel",
"pandas.concat",
"matplotlib.pyplot.show"
]
] |
Ayushithakre12/tensorflow-tracer | [
"0db65fe55c2b6acd55d37112effc17aa90886bcf"
] | [
"examples/horovod-example.py"
] | [
"#! /usr/bin/env python -u\n# coding=utf-8\n\n__author__ = 'Sayed Hadi Hashemi'\n\nimport tensorflow as tf\nimport horovod.tensorflow as hvd\nfrom tensorflow.contrib.slim.nets import inception\nfrom tftracer import TracingServer\n\nINPUT_SIZE = [299, 299, 3]\nMINIBATCH_SIZE = 4\nNUM_CLASSES = 1000\nNUM_STEPS = 200\... | [
[
"tensorflow.logging.set_verbosity",
"tensorflow.random_uniform",
"tensorflow.train.MomentumOptimizer",
"tensorflow.losses.softmax_cross_entropy",
"tensorflow.ConfigProto",
"tensorflow.contrib.slim.nets.inception.inception_v3",
"tensorflow.app.run"
]
] |
trevor-wu/e-mission-server | [
"2e31986bd7c0faab7110b7eb69541b0b9eac62df"
] | [
"bin/intake_multiprocess.py"
] | [
"from __future__ import unicode_literals\nfrom __future__ import print_function\nfrom __future__ import division\nfrom __future__ import absolute_import\nfrom future import standard_library\nstandard_library.install_aliases()\nfrom builtins import *\nimport json\nimport logging\nimport logging.config\nimport argpar... | [
[
"numpy.random.seed"
]
] |
Ritvik19/pyradox-tabular | [
"ceac0fec255a7cc95803f13945035c717f17120b"
] | [
"pyradox_tabular/neural_decision_forest.py"
] | [
"import numpy as np\nimport tensorflow as tf\nfrom tensorflow import keras\nfrom tensorflow.keras import layers as L\n\nfrom .base import NetworkInputs\n\n\nclass NeuralDecisionTreeBackbone(keras.Model):\n def __init__(self, depth, num_features, used_features_rate, num_classes):\n super().__init__()\n ... | [
[
"tensorflow.zeros",
"tensorflow.shape",
"tensorflow.matmul",
"tensorflow.ones",
"tensorflow.reshape",
"tensorflow.keras.layers.Dense",
"numpy.eye",
"tensorflow.keras.Model",
"numpy.arange",
"tensorflow.tile",
"tensorflow.keras.activations.softmax",
"tensorflow.keras... |
pyodds/pyodds | [
"721f7a39942dbc6db03c392067f58ed4b7909cde"
] | [
"algo/sod.py"
] | [
"import numpy as np\nfrom sklearn.neighbors import NearestNeighbors\nfrom sklearn.utils import check_array\nfrom numpy import percentile\n\nfrom .base import Base\nfrom utils.utilities import check_parameter\n\nclass SOD(Base):\n \"\"\"Subspace outlier detection (SOD) schema aims to detect outlier in\n varyin... | [
[
"numpy.logical_not",
"numpy.square",
"numpy.array",
"numpy.zeros",
"numpy.percentile",
"numpy.sum",
"numpy.mean",
"numpy.std",
"numpy.sort",
"numpy.argsort",
"sklearn.utils.check_array",
"numpy.iinfo",
"sklearn.neighbors.NearestNeighbors",
"numpy.var",
"... |
tobeyOguney/pennylane | [
"0aaa797e17f3a010b564c3ffbb2fb3f8ad5d3de8"
] | [
"examples/pennylane_run_barren_plateaus.py"
] | [
"r\"\"\"\n.. _barren_plateaus:\n\nBarren plateaus in quantum neural networks\n==========================================\n*Author: Shahnawaz Ahmed (shahnawaz.ahmed95@gmail.com)*\n\nIn classical optimization, it is suggested that saddle\npoints, not local minima, provide a fundamental impediment\nto rapid high-dimen... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.semilogy",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
srph25/group-ksparse-temporal-cnns | [
"aeee40a8c3d650afd4fc6d704f1a1f1d1d27c7d6"
] | [
"datasets/coil100.py"
] | [
"import numpy as np\nfrom utils.pil import fromimage, toimage, imresize, imread, imsave\nfrom keras.utils import to_categorical\nfrom keras_applications.imagenet_utils import preprocess_input\nfrom datasets.mnistrotated import MNISTRotatedDataset\nfrom utils.preprocessing import ZCAWhitening\n\n\nclass COIL100Datas... | [
[
"numpy.pad",
"numpy.mod",
"numpy.zeros"
]
] |
HatsuneMiku4/PocketFlow | [
"285edbd5529cb00d6d51e728f9b468604b1b98b9"
] | [
"rl_agents/ddpg/running_mean_std.py"
] | [
"# Tencent is pleased to support the open source community by making PocketFlow available.\n#\n# Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.\n#\n# Licensed under the BSD 3-Clause License (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may... | [
[
"tensorflow.zeros_initializer",
"tensorflow.zeros",
"tensorflow.shape",
"tensorflow.summary.scalar",
"tensorflow.ones",
"tensorflow.app.flags.DEFINE_float",
"tensorflow.placeholder",
"tensorflow.reduce_sum",
"tensorflow.square"
]
] |
UVA-DSA/OpenPilot0.3.5 | [
"b5777bbb075b92b0c11969e56f9fd264bf0ce291"
] | [
"selfdrive/controls/lib/fcw.py"
] | [
"import numpy as np\nfrom common.realtime import sec_since_boot\n\n#Time to collisions greater than 5s are iognored\nMAX_TTC = 5.\n\ndef calc_ttc(l1):\n # if l1 is None, return max ttc immediately\n if not l1:\n return MAX_TTC\n # this function returns the time to collision (ttc), assuming that \n # ARel wil... | [
[
"numpy.maximum",
"numpy.sqrt",
"numpy.minimum"
]
] |
weiwang2330/Bayesian-Deep-Learning-with-Edward | [
"7a583d1bdfafcbf42612b069756048322d896021"
] | [
"edward/inferences/bigan_inference.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport six\nimport tensorflow as tf\n\nfrom edward.inferences.gan_inference import GANInference\nfrom edward.util import get_session\n\n\nclass BiGANInference(GANInference):\n \"\"\"Adversarially Lear... | [
[
"tensorflow.ones_like",
"tensorflow.gradients",
"tensorflow.variable_scope",
"tensorflow.zeros_like",
"tensorflow.reduce_mean",
"tensorflow.get_collection"
]
] |
Jong2/KAIST_ME491B_HW1 | [
"0987ac19c888509012adffc3b94a754a103b7e7f"
] | [
"CNN_test.py"
] | [
"#!/usr/bin/env python3\n\nimport os\nimport numpy as np\nimport torch\nimport torch.nn as nn\n\nimport torchvision\nfrom torchvision import datasets, models, transforms\nfrom PIL import Image\nimport matplotlib.pyplot as plt\nimport cv2\n\ndata_transforms = {\n 'train': transforms.Compose([\n transforms.... | [
[
"matplotlib.pyplot.subplot",
"numpy.array",
"torch.max",
"torch.no_grad",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.load",
"numpy.clip",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.imsho... |
anpar/EE-WCC-MapReduce | [
"b78732678b760b67aec1176e7e2e1b2b6c754d36"
] | [
"src/figure2.py"
] | [
"\"\"\"\nMIT License\n\nCopyright (c) 2019 Université Catholique de Louvain (UCLouvain)\n\nThe software provided allows to reproduce the results presented in the\nresearch paper \"Energy-Efficient Edge-Facilitated Wireless Collaborative\nComputing using Map-Reduce\" by Antoine Paris, Hamed Mirghasemi, Ivan Stupia\n... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
ezrankayamba/twiga_sales | [
"78ea9a35db7e75f3492f03559662808cb3ad59f3"
] | [
"backend_rest/invoices/invoice_ocr.py"
] | [
"from sales import ocr2 as ocr\nimport numpy as np\n\nimport pytesseract\nimport io\nimport re\nfrom decimal import Decimal\nfrom core import logging\nlogger = logging.getLogger(__name__)\n\n\ndef from_letter(pdf_data):\n kwargs = {'y': 500, 'h': 600}\n regex = 'exited[\\w \\n&]+ ([\\d,.]+)[tT\\. ]{2,}ons[\\w... | [
[
"numpy.array"
]
] |
bbruceyuan/ECPE-PyTorch | [
"fc4ee949177f2a5cef4508ae478583dca9e9044f"
] | [
"main.py"
] | [
"import random\nimport numpy as np\nimport os\n\nimport torch\nimport torch.backends\nimport torch.backends.cudnn\n\nfrom args import Args\nfrom log_config import LOG_CONFIG\nimport trainers\n\nimport logging\nimport logging.config\n\n\ndef set_log():\n logging.config.dictConfig(LOG_CONFIG)\n logger = logging... | [
[
"numpy.random.seed",
"torch.manual_seed"
]
] |
GenderPerformance/gender-performance | [
"48ec69862ff8efe69cc1fa28243ebaf1dd87b011"
] | [
"gendervoicemodel/test.py"
] | [
"# import pyaudio\nimport os\nimport wave\nimport librosa\nimport numpy as np\nfrom sys import byteorder\nfrom array import array\nfrom struct import pack\nimport asyncio\n\nTHRESHOLD = 500\nCHUNK_SIZE = 1024\n# FORMAT = pyaudio.paInt16\nRATE = 16000\n\nSILENCE = 30\n\ndef is_silent(snd_data):\n \"Returns 'True'... | [
[
"numpy.hstack",
"numpy.array"
]
] |
janithwanni/icecaps | [
"15efca1b896478f37b520385d591ae8bbac3e0e1"
] | [
"icecaps/estimators/ngram_lm_estimator.py"
] | [
"import tensorflow as tf\nimport copy\n\nfrom tensorflow.contrib.rnn import BasicRNNCell\n\nfrom icecaps.estimators.rnn_estimator import RNNEstimator\nfrom icecaps.estimators.convolutional_estimator import ConvolutionalEstimator\n\n\nclass NGramCell(BasicRNNCell):\n\n def __init__(self, hparams):\n super(... | [
[
"tensorflow.trainable_variables",
"tensorflow.estimator.EstimatorSpec",
"tensorflow.concat",
"tensorflow.summary.histogram",
"tensorflow.ones",
"tensorflow.reshape",
"tensorflow.variable_scope",
"tensorflow.nn.embedding_lookup",
"tensorflow.nn.dynamic_rnn"
]
] |
Healingl/3DAPRNet | [
"7c5e0028ae844df4e1f26327e8b438532ca0745f"
] | [
"step1_split_dataset_by_CV.py"
] | [
"#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\n# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # \n# @Author: ZhuangYuZhou\n# @E-mail: 605540375@qq.com\n# @Desc: \n# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n\nimport os\nfrom sklearn.model_selection import KFold\nimport numpy... | [
[
"pandas.DataFrame"
]
] |
jsigee87/onnx-tensorflow | [
"90a58bed24a18f5260ebe9f22bf4997f9d591f62"
] | [
"onnx_tf/handlers/backend/batch_normalization.py"
] | [
"import tensorflow as tf\n\nfrom onnx_tf.handlers.backend_handler import BackendHandler\nfrom onnx_tf.handlers.handler import onnx_op\nfrom onnx_tf.handlers.handler import tf_func\n\n\n@onnx_op(\"BatchNormalization\")\n@tf_func(tf.nn.batch_normalization)\nclass BatchNormalization(BackendHandler):\n\n @classmethod\... | [
[
"tensorflow.reshape",
"tensorflow.nn.moments"
]
] |
louis-lapassat/summer_invitational_data_open_2020 | [
"487325842391f1f336e1272eb47f95023d3009a9"
] | [
"function/data_loader.py"
] | [
"import pandas as pd\nimport os\nimport geopandas as gpd\n\n\ndef data_loader(path='../data/', city='London'):\n \"\"\"Read data for a given city, put them in a dict\n with same key as file name.\n Example: london_underground_station_info.csv\n corresponds to the entry 'london_underground_station_info'.... | [
[
"pandas.read_csv"
]
] |
harrispirie/stmpy | [
"74c5142bd75af474241c131b817ba362dcac5b13"
] | [
"stmpy/driftcorr.py"
] | [
"from __future__ import print_function\ntry:\n import cv2\nexcept ModuleNotFoundError:\n print(\"Please install opencv-python module using following command:\\npip3 install opencv-python\")\nimport stmpy\nimport numpy as np\nimport scipy as sp\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport... | [
[
"numpy.ones_like",
"matplotlib.pyplot.xlim",
"numpy.fft.fft2",
"numpy.argmin",
"numpy.minimum",
"numpy.copy",
"numpy.min",
"numpy.mean",
"numpy.exp",
"numpy.where",
"numpy.cos",
"numpy.cumsum",
"numpy.complex",
"numpy.zeros_like",
"numpy.sin",
"numpy... |
lewislone/mStocks | [
"bcc3f5831e0d2e12eec2caa74ed1944b42e68e7d"
] | [
"packets-analysis/lib/XlsxWriter-0.7.3/examples/pandas_chart_columns.py"
] | [
"##############################################################################\n#\n# An example of converting a Pandas dataframe to an xlsx file with a grouped\n# column chart using Pandas and XlsxWriter.\n#\n# Copyright 2013-2015, John McNamara, jmcnamara@cpan.org\n#\n\nimport pandas as pd\nfrom vincent.colors im... | [
[
"pandas.DataFrame",
"pandas.ExcelWriter"
]
] |
465b/General-Ecosystem-Modeling-Framework | [
"a0b19edcd50a8c351cf616024ce832d3546d90bc"
] | [
"nemf/models.py"
] | [
"import numpy as np\nfrom nemf import caller\nfrom nemf import worker\nfrom nemf.interaction_functions import *\nfrom copy import deepcopy\nimport yaml\n\n\n# Model_Classes \nclass model_class:\n\n\t# initialization methods\n\t# they are only used when a new model_class is created\n\n\tdef __init__(self,model_path,... | [
[
"numpy.concatenate",
"numpy.full",
"numpy.delete",
"numpy.array",
"numpy.zeros",
"numpy.sum",
"numpy.shape"
]
] |
bmeatayi/neurogan | [
"310590e648a68f2966312aa0b460908d719e964d"
] | [
"models/disc_cnn.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom collections import OrderedDict\n\n\nclass DiscriminatorCNN_proj(nn.Module):\n def __init__(self, nw=40, nh=40, nl=5,\n n_filters=(15, 9),\n kernel_size=(15, 11),\n n_cel... | [
[
"torch.nn.Linear",
"torch.rand",
"torch.nn.Dropout",
"torch.nn.Sequential",
"torch.nn.LeakyReLU",
"torch.from_numpy",
"torch.nn.Conv2d",
"torch.cuda.is_available",
"torch.tensor",
"numpy.random.random",
"torch.randn"
]
] |
RoyalTS/scikit-lego | [
"17457735614c3ea7897bf679eef70d492a7e9b9f"
] | [
"sklego/model_selection.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom datetime import timedelta\nfrom sklearn.exceptions import NotFittedError\nfrom sklearn.utils import check_array\n\nfrom sklego.base import Clusterer\n\n\nclass TimeGapSplit:\n \"\"\"\n Provides train/test indices to split time series data samples.\n\n This cro... | [
[
"pandas.to_datetime",
"pandas.DataFrame",
"numpy.where",
"sklearn.utils.check_array",
"numpy.unique"
]
] |
JungleEngine/speech_separation | [
"7e7d56257c3dee6da43e2df45819f8b7f7285b4e"
] | [
"data/video/video_download.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nimport sys\nimport os\nimport datetime\nsys.path.append(\"speech_separation/data/lib\")\nimport AVHandler as avh\nimport pandas as pd\n\n\n\ndef video_download(loc,cat,start_idx,end_idx):\n # Only dow... | [
[
"pandas.read_csv"
]
] |
lujieyang/irs_lqr | [
"bc9cade6a3bb2fa2d76bdd5fe453030a7b28700f"
] | [
"examples/pendulum/pendulum_nn.py"
] | [
"from irs_lqr.irs_lqr import IrsLqr\nfrom pendulum_dynamics import PendulumDynamics\nimport numpy as np\nimport pydrake.symbolic as ps\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch\nimport time\n\nimport matplotlib.pyplot as plt\nfrom matplotlib import cm\n\nfrom irs_lqr.dynamical_system import ... | [
[
"torch.nn.Linear",
"torch.optim.lr_scheduler.StepLR",
"numpy.random.rand",
"numpy.concatenate",
"numpy.random.normal",
"torch.autograd.grad",
"torch.Tensor",
"numpy.vstack",
"matplotlib.pyplot.axis",
"numpy.array",
"matplotlib.cm.get_cmap",
"matplotlib.pyplot.figure... |
jibinmathew691993/PythonHackerrank | [
"14ab5b620435a006d5ccff17536bc01acd7c22dc"
] | [
"Sum and Prod.py"
] | [
"import numpy as np\nn,m = input().split()\narr = np.array([input().split() for _ in range(int(n))], int)\nprint(np.prod(np.sum(arr,axis=0)))"
] | [
[
"numpy.sum"
]
] |
Laouen/ML_ConPipe | [
"ba0f1edb3abe187ce73c5e6b4f523cedf40c387e"
] | [
"ConPipe/GraphNode/ModelSelection.py"
] | [
"import pandas as pd\n\nfrom ConPipe.exceptions import NotExistentMethodError\nfrom ConPipe.Logger import Logger\nfrom ConPipe.ModuleLoader import get_class, get_function\nfrom sklearn.metrics import make_scorer\n\nclass ModelSelection():\n\n def __init__(self, parameter_optimizer, scoring, cv, models):\n\n ... | [
[
"pandas.DataFrame",
"pandas.concat"
]
] |
eugenelet/NeuralScale | [
"67ddedc19880d8e2e93304b07305e6ede8d76212"
] | [
"ratio_swipe.py"
] | [
"'''\nRun models (VGG11, ResNet18, MobileNetV2) by scaling filter sizes to different ratios on CIFAR10/100.\nStores accuracy for comparison plot.\nDefault Scaling Ratios: 0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0\n'''\n\nfrom __future__ import print_function\nimport torch\nimport torch.nn as nn\nimport torch.nn.fu... | [
[
"torch.no_grad",
"torch.optim.SGD",
"numpy.prod",
"numpy.arange",
"torch.utils.data.DataLoader",
"torch.nn.CrossEntropyLoss"
]
] |
jlema/nni | [
"be3a69662a708870840d265eaa66f5dbed66cfd6"
] | [
"nni/retiarii/trainer/pytorch/base.py"
] | [
"from typing import Any, List, Dict, Tuple\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch.utils.data import DataLoader\nfrom torchvision import datasets, transforms\n\nimport nni\n\nfrom ..interface import BaseTrainer\nfrom ...utils import register_trainer\n\n\ndef get_default_transform(data... | [
[
"torch.device",
"torch.max",
"torch.autograd.set_detect_anomaly",
"numpy.mean",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.nn.CrossEntropyLoss"
]
] |
Aditya-kiran/ResNet-VAE | [
"d375b12a787dd6c32d90cb9a33a5ba8cce4680e5"
] | [
"code/distributions.py"
] | [
"import numpy as np\nimport tensorflow as tf \n\ndef density_1(z):\n\tz1, z2 = tf.split(z, [1,1], axis=1) \n\tnorm = tf.sqrt(z1 ** 2 + z2 ** 2)\n\texp1 = tf.exp(-0.5 * ((z1 - 2) / 0.8) ** 2)\n\texp2 = tf.exp(-0.5 * ((z1 + 2) / 0.8) ** 2)\n\tu = 0.5 * ((norm - 4) / 0.4) ** 2 - tf.log(exp1 + exp2)\n\treturn tf.exp(-u... | [
[
"tensorflow.exp",
"tensorflow.split",
"tensorflow.sqrt",
"tensorflow.log"
]
] |
TOBEKNOWNABBAS/AI106394 | [
"51aa967ab63f9cc7fc64f7b9017d23f70bd5cfe7"
] | [
"Project/Weighted and Un-Weighted Svm [9x9].py"
] | [
"import numpy as np\r\nimport sklearn as sk\r\nimport pandas as pd\r\nfrom sklearn.naive_bayes import MultinomialNB\r\nfrom sklearn.model_selection import train_test_split\r\nfrom sklearn import svm\r\nfrom sklearn.svm import SVC\r\nfrom sklearn import metrics\r\nfrom sklearn.preprocessing import StandardScaler\r\n... | [
[
"numpy.array",
"numpy.empty",
"numpy.reshape",
"numpy.zeros",
"numpy.sum",
"sklearn.svm.SVC",
"sklearn.metrics.accuracy_score",
"numpy.append",
"sklearn.model_selection.train_test_split",
"pandas.read_csv"
]
] |
A-Malone/NFL-Analytics | [
"9950be28101a70e1e7486eb5c85bc14c64e55b73"
] | [
"AnalysisSite/Classes.py"
] | [
"import re\r\nimport math as m\r\nimport numpy as np\r\n\r\nclass Play:\r\n\t'''\r\n\tThis class stores data for one NFL regulation play. Data scraped from Sport Data API. Variable Descriptions:\r\n\tOffense (str) offensive team's name\r\n\tDefense (str) defensive team's name\r\n\tstart_down (int) Down when play st... | [
[
"numpy.median",
"numpy.std",
"numpy.array"
]
] |
strongwolf/CDG | [
"a78864ca3519de77deb60a11f68059b76e076b5c"
] | [
"lib/model/faster_rcnn/faster_rcnn_resnet.py"
] | [
"import random\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport numpy as np\nfrom model.utils.config import cfg\nfrom model.rpn.rpn import _RPN\nfrom model.roi_layers import ROIAlign, ROIPool\nfrom model.rpn.proposal_target_layer import _ProposalTarg... | [
[
"torch.mean",
"torch.nn.functional.cross_entropy",
"torch.nn.CrossEntropyLoss",
"torch.nn.functional.softmax"
]
] |
IIP-Sogang/Audio-Visual-Speech-Recognition | [
"bd03be91135acbc6162b83092d462b7fe71dd007",
"bd03be91135acbc6162b83092d462b7fe71dd007"
] | [
"examples/audio_visual_se_sr/criterions/avse_avsr_hybrid_ctc_ce.py",
"examples/speech_recognition/criterions/RNNT_loss.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport logging\nimport math\nfrom itertools import groupby\nimport torch.nn as nn\nimport torch\nimport to... | [
[
"torch.sum",
"torch.nn.functional.nll_loss",
"torch.nn.functional.ctc_loss",
"torch.nn.L1Loss"
],
[
"torch.sum"
]
] |
florentchandelier/universal-portfolios | [
"4db2b74209bb8b0d6d01718ad3fb31f2ad1f409b"
] | [
"universal/algos/cwmr.py"
] | [
"# -*- coding: utf-8 -*-\nfrom universal.algo import Algo\nimport numpy as np\nimport pandas as pd\nimport universal.tools as tools\nimport scipy.stats\nfrom numpy.linalg import inv\nfrom numpy import diag, sqrt, log, trace\n\n\nclass CWMR(Algo):\n \"\"\" Confidence weighted mean reversion.\n\n Reference:\n ... | [
[
"numpy.matrix",
"numpy.trace",
"numpy.log",
"numpy.sum",
"numpy.ones",
"numpy.eye",
"numpy.diag",
"numpy.sqrt",
"numpy.linalg.inv"
]
] |
tabbydoc/SemAIDA | [
"525ae14cc537ec9becc61a3d3979ee49351ef6f2"
] | [
"AAAI19/exp_T2D/evaluate_cnn_tm.py"
] | [
"\"\"\"\nThis file is to evaluate cnns of truly matched classes\n\"\"\"\nimport os\nimport sys\nimport random\nimport argparse\nimport numpy as np\nimport tensorflow as tf\nfrom sklearn import metrics\nfrom gensim.models import Word2Vec\nfrom util_t2d import read_t2d_cells\nfrom util_cnn import ordered_cells2synthe... | [
[
"numpy.concatenate",
"tensorflow.train.latest_checkpoint",
"tensorflow.Graph",
"tensorflow.Session",
"tensorflow.ConfigProto",
"sklearn.metrics.roc_auc_score"
]
] |
edponce/vetk | [
"dfdb11462a1b1fec6b7bc30dfcf5e7afa8e326ab"
] | [
"vetkit/analytics.py"
] | [
"\"\"\"WordEmbeddingAnalysis\n\nClasses:\n :class:`WordEmbeddingAnalysis`\n\nTodo:\n * Fairness in unsupervised learning, PCA and SVM (Olfat and Aswani 2018,\n Spectral algorithms for computing fair SVM) (Olfat and Aswani 2018,\n Convex formulations for fair PCA).\n\"\"\"\n# https://medium.com/@luck... | [
[
"sklearn.cluster.Birch",
"sklearn.cluster.MeanShift",
"scipy.stats.describe",
"scipy.stats.pearsonr",
"numpy.mean",
"numpy.tril_indices",
"numpy.cos",
"numpy.sin",
"sklearn.cluster.AgglomerativeClustering",
"numpy.empty",
"sklearn.cluster.SpectralClustering",
"numpy... |
pingyuanheliu/XRNeuralNetwork | [
"a171dfc220d226b2490f8d639f99c2f5114d2ffc"
] | [
"MLNN/gnt_to_png.py"
] | [
"\nimport os\nimport numpy as np,pandas as pd\nimport struct\nfrom PIL import Image\n \ndata_dir = '/Users/ll/Desktop/TensorFlow/gnt/trn'\n# train_data_dir = \"../data/HWDB1.1trn_gnt\"\ntrain_data_dir = os.path.join(data_dir, 'HWDB1.1trn_gnt')\ntest_data_dir = os.path.join(data_dir, 'HWDB1.1tst_gnt')\n \ndef read_f... | [
[
"numpy.fromfile"
]
] |
Megalinux/Polynomial_Regression_1 | [
"c469c61d1a65a347cbdd17bb32ec50a3c01b05ec"
] | [
"crypto_2_polinomial_regression_v1.py"
] | [
"import numpy as np \nimport pandas as pd\nfrom pylab import plt,mpl\nimport ccxt\nimport calendar\nfrom datetime import datetime\nfrom sympy import Symbol,expand\nimport Tools as tl\n\n#Set parameters of Matplotlib\nnp.random.seed(100)\nplt.style.use('seaborn')\nmpl.rcParams['savefig.dpi'] = 300\nmpl.rcParams... | [
[
"numpy.append",
"numpy.random.seed",
"pandas.DataFrame",
"numpy.polyval",
"numpy.std",
"numpy.polyfit",
"numpy.poly1d"
]
] |
mattdeitke/allenact-1 | [
"70f106b32a38424e862399a76d84f607838063be"
] | [
"core/base_abstractions/task.py"
] | [
"# Original work Copyright (c) Facebook, Inc. and its affiliates.\n# Modified work Copyright (c) Allen Institute for AI\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\"\"\"Defines the primary data structures by which agents interact ... | [
[
"numpy.mean"
]
] |
liangosc/Qcodes | [
"0f0a59fa4953e3ef44031e94459d1ff661f26473"
] | [
"qcodes/instrument_drivers/Keysight/N52xx.py"
] | [
"from typing import Sequence, Union, Any\nimport time\nimport re\nimport logging\n\nimport numpy as np\nfrom pyvisa import VisaIOError, errors\nfrom qcodes import (VisaInstrument, InstrumentChannel, ArrayParameter,\n ChannelList)\nfrom qcodes.utils.validators import Ints, Numbers, Enum, Bool\n\nl... | [
[
"numpy.array",
"numpy.linspace"
]
] |
AlGoulas/receptor-principles | [
"1a8b8714271d99ffe62f81f93ac42f3e57c952f1"
] | [
"main.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nfrom pathlib import Path\n\nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\nimport numpy as np\nimport pandas as pd\nfrom scipy.stats import spearmanr\nfrom scipy.stats import rankdata\nimport seaborn as sns\nfrom sklearn.decomposition import PCA\nfrom ... | [
[
"numpy.load",
"numpy.min",
"numpy.mean",
"scipy.stats.rankdata",
"matplotlib.pyplot.xticks",
"numpy.max",
"numpy.concatenate",
"matplotlib.pyplot.colorbar",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"numpy.transpose",
"numpy.isfinite",
"matplotlib.pyplot.... |
jufi2112/gaea_release | [
"6816f661041d554e61cfe538376a6e0cff0053d3"
] | [
"cnn/train_search.py"
] | [
"import os\nimport sys\nimport time\nimport glob\nimport numpy as np\nimport torch\nimport train_utils\nimport aws_utils\nimport random\nimport copy\nimport logging\nimport hydra\nimport pickle\nimport torch.nn as nn\nimport torch.utils\nimport torch.nn.functional as F\nimport json\nimport io\nimport PIL\n\nfrom to... | [
[
"torch.utils.tensorboard.SummaryWriter",
"torch.autograd.Variable",
"numpy.set_printoptions",
"torch.cuda.set_device",
"torch.cuda.is_available",
"torch.nn.CrossEntropyLoss"
]
] |
xiaotinghe/gluon-nlp | [
"3ce9995329fb0d18787019df541d4f229d7c9ded"
] | [
"scripts/word_embeddings/evaluation.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"
]
] |
jasonlin316/PPG-DrowsinessDetect | [
"31f141314f7e95913a2546b0dc264343ab188b1c"
] | [
"merge2.py"
] | [
"from lib.device import Camera\nfrom lib.processors_noopenmdao import findFaceGetPulse\nfrom lib.interface import plotXY, imshow, waitKey, destroyWindow\nimport argparse\nimport numpy as np\nimport datetime\n#TODO: work on serial port comms, if anyone asks for it\n#from serial import Serial\nimport socket\nimport s... | [
[
"scipy.spatial.distance.euclidean",
"numpy.vstack",
"numpy.savetxt"
]
] |
bogireddytejareddy/micro-expression-recognition | [
"f72d29cf3a6e37fe4d48db9e954eae7fa27937f9"
] | [
"CASME-SQUARE/MicroExpSTCNN.py"
] | [
"import os\nimport cv2\nimport numpy\nimport imageio\nfrom sklearn.metrics import confusion_matrix\nfrom keras.models import Sequential\nfrom keras.layers.core import Dense, Dropout, Activation, Flatten\nfrom keras.layers.convolutional import Convolution3D, MaxPooling3D\nfrom keras.optimizers import SGD, RMSprop\nf... | [
[
"numpy.max",
"numpy.asarray",
"numpy.zeros",
"numpy.rollaxis",
"numpy.mean",
"numpy.save",
"sklearn.model_selection.train_test_split"
]
] |
romanus/code_tekinetal_iccv17 | [
"4e17a383c863a2dafd6ca347974f1abc29ef29de"
] | [
"src/training/summary.py"
] | [
"\nimport os.path\nfrom collections import defaultdict\nfrom functools import reduce\n\nimport numpy as np\n\nclass Summary(object):\n \n def __init__(self):\n \n self.content = defaultdict(dict)\n \n def register(self, tag, index, value):\n \n self.content[tag][index] = valu... | [
[
"numpy.load",
"numpy.asarray",
"numpy.save"
]
] |
mamintoosi-papers-codes/ImageAI | [
"304caa1ca8e40a92232ed55738261c629e9031fb"
] | [
"utils/convert_yolo3_to_keras.py"
] | [
"# create a YOLOv3 Keras model and save it to file\n# based on https://github.com/experiencor/keras-yolo3\n\n# https://machinelearningmastery.com/how-to-perform-object-detection-with-yolov3-in-keras/\n\nimport struct\nimport numpy as np\nfrom keras.layers import Conv2D\nfrom keras.layers import Input\nfrom keras.la... | [
[
"numpy.frombuffer"
]
] |
shawlu95/gs-quant | [
"f80302d23c0d2e1195d4751ad2db8ab06c6299fa"
] | [
"gs_quant/test/api/test_risk.py"
] | [
"\"\"\"\nCopyright 2018 Goldman Sachs.\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in wr... | [
[
"pandas.DataFrame"
]
] |
jakob-ed/pytorch-dist-pos-tagger | [
"f6143564c0df309ea20a5d6544c31027adf0bc88"
] | [
"src/ray_parameter_server/async_parameter_server.py"
] | [
"import os\nimport random\n\nimport ray\nimport torch\nimport torch.optim as optim\n\nfrom .abstract_parameter_server import AbstractParameterServer\nfrom .data_worker import DataWorker\n\n\nMIN_FREQ = int(os.environ['SUSML_MIN_FREQ'])\nRAND_SEED = int(os.environ['SUSML_RAND_SEED'])\nNUM_EPOCHS = int(os.environ['SU... | [
[
"torch.manual_seed",
"torch.zeros"
]
] |
bhklimk/bat | [
"069e6bc52843dc07760969c531cc442ca7da8e0c"
] | [
"examples/bro_to_scikit.py"
] | [
"# Example that demonstrates going from Bro data to scikit-learn models\nfrom __future__ import print_function\nimport os\nimport sys\nimport argparse\n\n# Third Party Imports\nimport pandas as pd\nfrom sklearn.decomposition import PCA\nfrom sklearn.discriminant_analysis import LinearDiscriminantAnalysis\nfrom skle... | [
[
"sklearn.cluster.KMeans",
"sklearn.decomposition.PCA",
"pandas.set_option"
]
] |
haoruisun/CS254FinalProject | [
"7ce6fe1835b2c60aae656a6a7631611f9b9d2ece"
] | [
"loadmat.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nloadmat.py\nLoad a .mat file containing structs to create usable python structures.\n\n- Code copied by DJ from https://stackoverflow.com/a/65195623 on 8/18/21\n\"\"\"\n\n# import packages\nimport scipy.io as sio\n\n# Define functions\ndef _check_keys( dict)... | [
[
"scipy.io.loadmat"
]
] |
Connormcc3/ludwig | [
"5d562cbc0c4fed3e607969e18611f34240eef177"
] | [
"ludwig/models/trainer.py"
] | [
"#! /usr/bin/env python\n# coding=utf-8\n# Copyright (c) 2019 Uber Technologies, 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/LICENS... | [
[
"numpy.array",
"torch.cuda.is_available",
"numpy.gradient",
"numpy.isfinite"
]
] |
alexeybokhovkin/part-based-scan-understanding | [
"f7c0e4a85a088e431b20fb3663cdbfc9a9f29ee3"
] | [
"dataproc/tree_processing.py"
] | [
"from copy import deepcopy\nimport numpy as np\nfrom scipy.spatial.distance import cdist\n\n\ndef collect_leaves(hier, leaf_names, part_dir_names, leaf_name):\n if 'children' not in hier:\n leaf_names += [hier[leaf_name]]\n part_dir_names.extend(hier['objs'])\n else:\n for child in hier['... | [
[
"numpy.random.rand",
"numpy.where",
"scipy.spatial.distance.cdist",
"numpy.vstack",
"numpy.isin"
]
] |
coax-dev/coax | [
"7553ab11b0f709e69d8d70d1d3b4326296b0b479"
] | [
"coax/_core/q.py"
] | [
"from inspect import signature\nfrom collections import namedtuple\n\nimport jax\nimport jax.numpy as jnp\nimport numpy as onp\nimport haiku as hk\nfrom gym.spaces import Space, Discrete\n\nfrom ..utils import safe_sample, default_preprocessor\nfrom ..value_transforms import ValueTransform\nfrom .base_func import B... | [
[
"numpy.asarray",
"numpy.random.RandomState"
]
] |
varadhodiyil/vision_pipeline | [
"3cf2925b9d799bbd0dbf213d23ca35bfed927381",
"3cf2925b9d799bbd0dbf213d23ca35bfed927381"
] | [
"mobile_net/m_ganeshen.py",
"mobile_net/annotate.py"
] | [
"import tensorflow as tf\nimport numpy as np \nfrom glob import glob\nimport os\n\nfrom PIL import Image\nfrom datetime import datetime\nfrom tensorflow.keras.applications.mobilenet_v2 import preprocess_input\nimport pickle\n\nIMG_SIZE = 224\nIMG_SHAPE = (IMG_SIZE , IMG_SIZE , 3)\n\ndef resize_img(image):\n prin... | [
[
"tensorflow.keras.callbacks.TensorBoard",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.applications.MobileNetV2",
"tensorflow.keras.layers.GlobalAveragePooling2D",
"tensorflow.keras.initializers.glorot_uniform",
"tensorflow.keras.layers.BatchNorma... |
hpssjellis/tfQuantumJs | [
"5235c682b0d2de2eaab8d52b84e295c9f4abf4e5",
"5235c682b0d2de2eaab8d52b84e295c9f4abf4e5"
] | [
"rocksetta/qnn03-rocksetta.py",
"pennylaneai/qml-demos/tutorial_stochastic_parameter_shift.py"
] | [
"\n## from https://pennylane.ai/qml/demos/tutorial_qnn_module_tf.html\n## from https://github.com/hpssjellis/my-examples-for-quantum-computing/blob/main/pennylaneai/qml-demos/tf-tutorial_qnn_module_tf.py\n\n\nimport tensorflow as tf\nimport matplotlib.pyplot as plt\nfrom sklearn.datasets import make_moons\nimpor... | [
[
"tensorflow.keras.utils.to_categorical",
"tensorflow.keras.optimizers.SGD",
"tensorflow.keras.layers.Dense",
"matplotlib.pyplot.draw",
"matplotlib.pyplot.pause",
"tensorflow.keras.models.Sequential",
"matplotlib.pyplot.scatter",
"sklearn.datasets.make_moons",
"matplotlib.pyplot... |
07kshitij/Information-Retrieval | [
"3739fd68e4bd8915e0ba0a57afee967987767c6c"
] | [
"Assignment-3/17EC10063_1.py"
] | [
"import sys\nimport os\nfrom sklearn.naive_bayes import MultinomialNB, BernoulliNB\nfrom sklearn.feature_selection import mutual_info_classif, SelectKBest\nfrom nltk.tokenize import word_tokenize\nfrom nltk.corpus import stopwords, wordnet\nfrom nltk.stem import WordNetLemmatizer\n\nimport numpy as np\nfrom string ... | [
[
"numpy.array",
"sklearn.naive_bayes.MultinomialNB",
"sklearn.naive_bayes.BernoulliNB",
"sklearn.feature_selection.SelectKBest",
"sklearn.metrics.f1_score"
]
] |
dgiova/fairlearn | [
"afe95f2e4b2e7f19fec1e10249da0f9216cd6321"
] | [
"fairlearn/reductions/_moments/conditional_selection_rate.py"
] | [
"# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\nimport pandas as pd\nimport numpy as np\nfrom .moment import ClassificationMoment\nfrom .moment import _GROUP_ID, _LABEL, _PREDICTION, _ALL, _EVENT, _SIGN\nfrom fairlearn._input_validation import _MESSAGE_RATIO_NOT_IN... | [
[
"pandas.isna",
"numpy.zeros",
"pandas.concat",
"pandas.DataFrame",
"numpy.ones",
"pandas.Series",
"numpy.vstack"
]
] |
sumantrip/scikit-image | [
"dccfafd08efed16674a947f9849ae8735a36a3f7"
] | [
"skimage/measure/tests/test_moments.py"
] | [
"from numpy.testing import assert_equal, assert_almost_equal, assert_raises\nimport numpy as np\n\nfrom skimage.measure import (moments, moments_central, moments_normalized,\n moments_hu)\n\n\ndef test_moments():\n image = np.zeros((20, 20), dtype=np.double)\n image[14, 14] = 1\n ... | [
[
"numpy.testing.assert_almost_equal",
"numpy.testing.run_module_suite",
"numpy.zeros",
"numpy.testing.assert_equal"
]
] |
MichlF/scikit-learn-mooc | [
"31fd171c9e3f75bd19f3709e1f5345a75a7d22ab"
] | [
"python_scripts/linear_models_ex_05.py"
] | [
"# -*- coding: utf-8 -*-\n# %% [markdown]\n# # 📝 Exercise M4.05\n# In the previous notebook, we presented a non-penalized logistic regression\n# classifier. This classifier accepts a parameter `penalty` to add a\n# regularization. The regularization strength is set using the parameter `C`.\n#\n# In this exercise, ... | [
[
"sklearn.model_selection.train_test_split",
"sklearn.linear_model.LogisticRegression",
"pandas.read_csv",
"sklearn.preprocessing.StandardScaler"
]
] |
guochunhe/Vitis-AI | [
"e86b6efae11f8703ee647e4a99004dc980b84989",
"e86b6efae11f8703ee647e4a99004dc980b84989",
"e86b6efae11f8703ee647e4a99004dc980b84989"
] | [
"models/AI-Model-Zoo/VAI-1.3-Model-Zoo-Code/PyTorch/pt_facerec-resnet20_mixed_112_96_3.5G_1.3/code/utils/evaluate.py",
"models/AI-Model-Zoo/VAI-1.3-Model-Zoo-Code/TensorFlow/tf_RefineDet-Medical_EDD_320_320_9.83G_1.3/code/utils/eval/voc_eval.py",
"models/AI-Model-Zoo/VAI-1.3-Model-Zoo-Code/PyTorch/pt_facereid-l... | [
"# Copyright 2019 Xilinx 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 agreed ... | [
[
"numpy.max",
"numpy.array",
"numpy.linalg.norm",
"torch.autograd.Variable",
"torch.no_grad",
"numpy.min",
"numpy.mean",
"numpy.std",
"numpy.append"
],
[
"numpy.concatenate",
"numpy.max",
"numpy.array",
"numpy.zeros",
"numpy.minimum",
"numpy.sum",
... |
danbull1/superresolution | [
"a20fdb52b19f7c43d02eac63c14ba9bce7b498d1"
] | [
"ImagePreprocessing_3Band.py"
] | [
"#creates imageset from HR and LR aligned images + cloud\n##mask raster defines AOI\n##outputs a directory for each imageset with a patch for each colour\n\n\nfrom PIL import Image \nimport random\nimport math\nimport os\nimport numpy as np\n\n\ncropwidth = 128\ncropheight = 128\n\ndir = r'C:\\DeepLearning\\COMPX59... | [
[
"numpy.where",
"numpy.array"
]
] |
liujh168/tensorflow_template_application | [
"8e25542396158d1e470b3b407a23b6dbb59c54f8"
] | [
"data/a8a/print_tfrecords_files.py"
] | [
"#!/usr/bin/env python\n# -*- encoding: utf-8 -*-\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport tensorflow as tf\n\n\ndef print_tfrecords_file(input_filename):\n print(\"Try to print the tfrecords file: {}\".format(input_filen... | [
[
"tensorflow.train.Example",
"tensorflow.python_io.tf_record_iterator"
]
] |
TUM-AIMED/splink | [
"06e0ea66a8bf88ecaf09ebc0ff20cdd850d81b7f"
] | [
"splink-client/splink_client/util/gwas_dataset.py"
] | [
"\"\"\"\n A class to open and pre-process a GWAS dataset\n\n Copyright 2021 Reza NasiriGerdeh, Reihaneh TorkzadehMahani, and Julian Matschinske. 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... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.packbits",
"pandas.DataFrame",
"numpy.unpackbits",
"numpy.logical_and",
"numpy.where",
"numpy.fromfile",
"pandas.read_csv",
"numpy.unique"
]
] |
RaulAstudillo06/BOQN | [
"c5b2bb9e547e2489f856ebf86c749fb24eba1022"
] | [
"boqn/group_testing/src/two_stage_hierarchical.py"
] | [
"import numpy as np\n\ndef sim_2stage(pool_size = 32, prevalence = 0.001):\n # INPUTS\n # pool_size: number of people tested in the pool\n # prevalence: fraction of the population that is infected\n # RETURNS: number of tests per person, in one simulation\n\n # x is a vector that represents infection... | [
[
"numpy.random.rand"
]
] |
lev1khachatryan/DataVisualization | [
"80f13ee56e6808bf076b7fc7fa5f0d61d80a42bc"
] | [
"Homeworks/Homework_3_4/app.py"
] | [
"# Load dash components\nimport dash\nimport dash_html_components as html\nimport dash_core_components as dcc\nimport dash_daq as daq\nfrom dash.dependencies import Input, Output\n\n# Loading numpy and pandas libraries\nimport numpy as np\nimport pandas as pd\n\n# Model deployment\nfrom sklearn.preprocessing import... | [
[
"numpy.array",
"sklearn.preprocessing.StandardScaler",
"pandas.DataFrame",
"pandas.concat",
"numpy.cumsum",
"numpy.around",
"pandas.read_csv",
"sklearn.decomposition.PCA"
]
] |
lsst-ts/lib_cwfs | [
"c5a73be1252dc1056437cbc1c7f4dd443d9c4bba"
] | [
"cwfs/cwfsImage.py"
] | [
"#!/usr/bin/env python\n##\n# @package cwfs\n# @file cwfsImage.py\n##\n# @authors: Bo Xin & Chuck Claver\n# @ Large Synoptic Survey Telescope\n\nimport sys\n\nimport numpy as np\nimport scipy.ndimage as ndimage\nimport scipy.interpolate as interpolate\nfrom astropy.io import fits\n\nfrom cwfsTools import Zern... | [
[
"numpy.rot90",
"numpy.dot",
"numpy.random.rand",
"scipy.ndimage.morphology.binary_dilation",
"scipy.interpolate.RectBivariateSpline",
"numpy.exp",
"numpy.gradient",
"numpy.histogram",
"numpy.count_nonzero",
"numpy.nonzero",
"numpy.sqrt",
"numpy.array",
"numpy.re... |
DANTEpolaris/dlcourse_ai | [
"66604c9c7182c46e5b38d3650410c69ce85d931a"
] | [
"assignments/assignment2/trainer.py"
] | [
"from copy import deepcopy\n\nimport numpy as np\nfrom metrics import multiclass_accuracy\n\n\nclass Dataset:\n \"\"\"\n Utility class to hold training and validation data\n \"\"\"\n\n def __init__(self, train_X, train_y, val_X, val_y):\n self.train_X = train_X\n self.train_y = train_y\n ... | [
[
"numpy.zeros_like",
"numpy.not_equal",
"numpy.random.shuffle",
"numpy.mean",
"numpy.arange",
"numpy.array_split"
]
] |
ly-zhu/Separating-Sounds-from-a-Single-Image | [
"e447501aa3ca918dcfc6be5bf3e7497cf39aa1d3"
] | [
"utils.py"
] | [
"import os\nimport shutil\n\nimport numpy as np\nimport librosa\nimport cv2\n\nimport subprocess as sp\nfrom threading import Timer\n\n\ndef warpgrid(bs, HO, WO, warp=True):\n # meshgrid\n x = np.linspace(-1, 1, WO)\n y = np.linspace(-1, 1, HO)\n xv, yv = np.meshgrid(x, y)\n grid = np.zeros((bs, HO, ... | [
[
"numpy.asarray",
"numpy.zeros",
"numpy.log",
"numpy.exp",
"numpy.power",
"numpy.clip",
"numpy.log10",
"numpy.linspace",
"numpy.meshgrid"
]
] |
tansey/smoothfdr | [
"c5b693d0a66e83c9387433b33c0eab481bd4a763"
] | [
"test/score.py"
] | [
"import sys\nimport numpy as np\nimport os.path\n\n\ndef tpr_fdr(truth, estimated):\n # Get the true positive and false discovery rate\n trues = truth == 1\n tpr = estimated[trues].sum() / float(trues.sum())\n discs = estimated == 1\n fdr = (1 - truth[discs]).sum() / float(discs.sum())\n return (t... | [
[
"numpy.loadtxt"
]
] |
latte488/smth-smth-v2 | [
"8504d10a994458769707108cbbe62adde81ca5aa"
] | [
"models/fix_clstm16.py"
] | [
"import torch\nfrom torch import nn\n\nrnn_units = 16\n\nclass Model(nn.Module):\n def __init__(self, column_units):\n super(Model, self).__init__()\n self.cnn = nn.Sequential(\n nn.Conv2d(3, 16, kernel_size=3, stride=1, padding=1),\n nn.BatchNorm2d(16),\n nn.ReLU(i... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.LSTM",
"torch.nn.MaxPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.randn"
]
] |
Fatead/NER | [
"142fabb2fcb1b730042da7acfde10199c62537d5"
] | [
"example/train_cnn_softmax.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\n-----------------------------------------\n@Author: zhaocy\n@Email: 19110240027@fudan.edu.cn\n@Created: 2020/7/1\n------------------------------------------\n@Modify: 2020/7/1\n------------------------------------------\n@Description: \n\"\"\"\nfrom pathlib i... | [
[
"torch.load"
]
] |
benzhang13/roguelike | [
"950df3553715e37cfb35e998182ee8567badcaec"
] | [
"src/Roguelike/venv/lib/python3.7/site-packages/tcod/path2.py"
] | [
"from typing import Iterator, Sequence\n\nimport numpy as np\n\n\ndef get_2d_edges(cardinal: float, diagonal: float) -> np.array:\n return (\n np.array([[0, 1, 0], [1, 0, 1], [0, 1, 0]]) * cardinal\n + np.array([[1, 0, 1], [0, 0, 0], [1, 0, 1]]) * diagonal\n )\n\n\ndef get_hex_edges(cost: float)... | [
[
"numpy.array"
]
] |
TomDecroos/atomic-spadl | [
"b7ffbcb73b5fce00275491dc8cc32ca96849dc25"
] | [
"pattern/vis.py"
] | [
"from scipy import linalg\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib as mpl\r\nimport matplotsoccer as mps\r\nimport numpy as np\r\nimport math\r\n\r\ndef locmovaxes(figsize=4):\r\n fig,axs = plt.subplots(1,2)\r\n fig.set_size_inches((figsize*3,figsize))\r\n mps.field(ax=axs[0],show=False)\r\n... | [
[
"scipy.linalg.eigh",
"matplotlib.pyplot.subplots",
"matplotlib.patches.Ellipse",
"numpy.arctan",
"numpy.argmax",
"numpy.apply_along_axis",
"numpy.argsort",
"numpy.sqrt",
"matplotlib.pyplot.show",
"scipy.linalg.norm",
"matplotlib.pyplot.axis"
]
] |
thhapke/sdi_replication | [
"f23e48d60c0d76603eec5071ea57d0646a44389e"
] | [
"src/di_replication/repl_dict_csv/repl_dict_csv.py"
] | [
"import io\n\nimport os\nimport pandas as pd\nimport numpy as np\n\nimport subprocess\n\nimport sdi_utils.gensolution as gs\nimport sdi_utils.set_logging as slog\nimport sdi_utils.textfield_parser as tfp\nimport sdi_utils.tprogress as tp\n\nimport random\n\ntry:\n api\nexcept NameError:\n class api:\n ... | [
[
"pandas.DataFrame"
]
] |
PhilipMay/tpu | [
"edfa66a675ee109ffde5f8703c8318d1b770f766"
] | [
"models/official/efficientnet/efficientnet_model.py"
] | [
"# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.compat.v1.keras.layers.Dropout",
"tensorflow.compat.v1.nn.avg_pool",
"tensorflow.compat.v1.add",
"numpy.meshgrid",
"numpy.zeros",
"tensorflow.compat.v1.squeeze",
"tensorflow.compat.v1.variable_scope",
"tensorflow.compat.v1.identity",
"numpy.arange",
"tensorflow.... |
3dlg-hcvc/ANCSH-pytorch | [
"efee745861f84f78981b7f997985436d32f8ef8f"
] | [
"preprocess/proc_stage1.py"
] | [
"import os\nimport h5py\nimport yaml\nimport logging\nimport numpy as np\n\nfrom PIL import Image\nfrom scipy.spatial.transform import Rotation as R\nfrom progress.bar import Bar\nfrom multiprocessing import Pool, cpu_count\nfrom omegaconf import OmegaConf\n\nfrom tools.utils import io\n# from tools.visualization i... | [
[
"numpy.dot",
"numpy.reshape",
"numpy.asarray",
"numpy.linalg.inv",
"numpy.ones",
"numpy.eye",
"numpy.linspace",
"scipy.spatial.transform.Rotation.from_quat",
"numpy.meshgrid",
"numpy.empty_like"
]
] |
fpcasale/limix | [
"a6bc2850f243fe779991bb53a24ddbebe0ab74d2"
] | [
"limix/iset/linalg_utils.py"
] | [
"import scipy as sp\nimport scipy.linalg as la\n\n\ndef msqrt(C):\n _U, _S = la.eigh(C)\n _S[_S < 0] = 0.\n return _U * sp.sqrt(_S)\n\n\ndef lowrank_approx(C, rank=1):\n _S, _U = la.eigh(C)\n _U = _U[:, -rank:]\n _S = _S[-rank:]\n R = sp.dot(_U * _S, _U.T)\n return R\n"
] | [
[
"scipy.dot",
"scipy.sqrt",
"scipy.linalg.eigh"
]
] |
doc22940/magenta | [
"65166c2e97aac9e5b2e27b098ec95d3ec457d93e"
] | [
"magenta/models/onsets_frames_transcription/configs.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.contrib.training.HParams"
]
] |
AndreasMadsen/stable-nalu | [
"b3296ace137ffa4854edeef3759f1578b7650210"
] | [
"stable_nalu/reader/tensorboard_metric_reader.py"
] | [
"\nimport re\nimport ast\nimport pandas\nimport collections\nimport multiprocessing\n\nfrom tqdm import tqdm\nimport numpy as np\nimport tensorflow as tf\n\nfrom .tensorboard_reader import TensorboardReader\n\ndef _parse_numpy_str(array_string):\n pattern = r'''# Match (mandatory) whitespace between...\n ... | [
[
"tensorflow.train.summary_iterator",
"pandas.DataFrame"
]
] |
iarhbahsir/partial-observability | [
"dc0b4707138e07dd091b709b774f87c4173fb78a"
] | [
"sac.py"
] | [
"import random\nimport sys\nimport os\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom torch import tensor\nfrom torch import cat\nfrom torch import clamp\nfrom torch.distributions import normal\nfrom torch import nn\nimport torch.nn.functional as F\nfrom torch import optim\nfrom torch.utils.tensorboa... | [
[
"torch.nn.Linear",
"torch.device",
"torch.cat",
"torch.mul",
"numpy.asarray",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"torch.distributions.normal.Normal",
"numpy.mean",
"torch.ones",
"matplotlib.pyplot.hist",
"torch.cuda.is_available",
"torch.tens... |
ORNL/tx2 | [
"c2365580a994d35b31ec5a4c1be5acb3a4a7c8d7"
] | [
"tx2/calc.py"
] | [
"\"\"\"Helper calculation functions for the wrapper and dashboard.\"\"\"\n\nfrom typing import Any, Dict, List, Tuple, Union\n\nimport numpy as np\nimport pandas as pd\nfrom nltk.corpus import stopwords\nfrom sklearn.cluster import (\n DBSCAN,\n OPTICS,\n AffinityPropagation,\n AgglomerativeClustering,\... | [
[
"pandas.DataFrame.from_dict"
]
] |
ronentk/dyna-babi-baselines | [
"e3c418477fc81dc440bca4cda9e812de52b3b263"
] | [
"models/SAM-master/baselines/nvm/ntm_warper.py"
] | [
"\"\"\"All in one NTM. Encapsulation of all components.\"\"\"\nimport torch\nfrom torch import nn\nfrom .ntm import NTM\nfrom .controller import LSTMController\nfrom .head import NTMReadHead, NTMWriteHead\nfrom .ntm_mem import NTMMemory\nimport numpy as np\nimport torch.nn.functional as F\n\n\nclass EncapsulatedNTM... | [
[
"torch.zeros",
"torch.nn.ModuleList",
"torch.cuda.is_available",
"torch.eye",
"torch.t",
"torch.nn.functional.cosine_similarity"
]
] |
yhtang/GraphDot | [
"3d5ed4fbb2f6912052baa42780b436da76979691"
] | [
"graphdot/model/gaussian_process/base.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport itertools as it\nimport os\nimport pickle\nimport warnings\nimport numpy as np\nfrom scipy.optimize import minimize\nfrom graphdot.linalg.cholesky import CholSolver\nfrom graphdot.linalg.spectral import pinvh\nfrom graphdot.util.printer import markdown as mpri... | [
[
"numpy.linalg.slogdet",
"numpy.asarray",
"numpy.linalg.LinAlgError",
"numpy.isfinite",
"scipy.optimize.minimize"
]
] |
mcd01/arvalus-experiments | [
"1c075853885d0d81284eee55988ba8747d33584e"
] | [
"code/src/utils.py"
] | [
"import torch\nimport numpy as np\nfrom ignite.engine.engine import Engine, State, Events\nfrom ignite.utils import convert_tensor\nfrom torch.nn import CrossEntropyLoss\nimport re\nimport os\nimport dill\n\n\ndef create_supervised_trainer(model, optimizer, loss_fn=None,\n device=None, ... | [
[
"torch.no_grad",
"torch.normal",
"torch.tensor",
"torch.argmax"
]
] |
claudiocc1/numba-stats | [
"e79be268220b2a864f738b34942bad61fbcac22d"
] | [
"tests/test_norm.py"
] | [
"import scipy.stats as sc\nimport numpy as np\n\n\ndef test_norm_pdf():\n from numba_stats import norm\n\n x = np.linspace(-5, 5, 10)\n got = norm.pdf(x, 1, 2)\n expected = sc.norm.pdf(x, 1, 2)\n np.testing.assert_allclose(got, expected)\n\n\ndef test_norm_cdf():\n from numba_stats import norm\n\n... | [
[
"scipy.stats.norm.pdf",
"numpy.testing.assert_allclose",
"scipy.stats.norm.ppf",
"numpy.linspace",
"scipy.stats.norm.cdf"
]
] |
dmy123/qualityIndex | [
"2130068202a3dadf4b9ff99fb5b51e6f63d92aa2"
] | [
"crackAndStress/stress.py"
] | [
"import numpy as np\nimport math\n\n\ndef lnd_xy_creack(nx, ny, dx, dy): # 创建节点编码矩阵nx,ny为边界的节点个数dx为单元边长\n unit = (nx - 1) * (ny - 1) * 2 # 单元个数\n lnd = [[0 for i in range(3)] for j in range(unit)] # 每个单元的角标\n l = 0\n # '对各个单元编号,与节点编号对应 i=lnd(ie)(0)\n for j in range(ny - 1):\n for i in range... | [
[
"numpy.array",
"numpy.linalg.pinv"
]
] |
joamatab/grating_coupler_meep | [
"4a59ee38a759c5cadd14beeb73531cd78a30dd45"
] | [
"grating_coupler_meep/farfield_monitor/compute-serial5.py"
] | [
"import numpy as np\nimport subprocess\nfrom datetime import datetime\n\n# Run commands in parallel\nprocesses = []\n\nnum_processors = 10 # number of processors per MEEP execution\nperiods = np.linspace(1.0, 1.2, 11)\nFFs = np.linspace(0.1, 0.9, 17)\nxs = [0]\nthetas = [0]\n\n# Generate commands\ncommands = []\nf... | [
[
"numpy.linspace"
]
] |
ndalchau/emukit | [
"eb6754ea016a7cd82b275bb4075676b5ed662634"
] | [
"emukit/core/constraints.py"
] | [
"import logging\nfrom typing import Callable, Optional\n\nimport numpy as np\n\n_log = logging.getLogger(__name__)\n\n\nclass IConstraint:\n def evaluate(self, x: np.ndarray) -> np.ndarray:\n \"\"\"\n :param x: Array of shape (n_points x n_dims) containing input locations to evaluate constraint at\... | [
[
"numpy.all",
"numpy.any",
"numpy.full"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.