repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
carlospares/deleno | [
"63c083efa109bbac24a17e57e91cf14962e8b32a"
] | [
"observables.py"
] | [
"import numpy as np\n\nIDENTITY = 0\nSUBDOMAIN = 1\nPOINT = 2\n\nobservables_dict = {\"identity\": IDENTITY, \"id\": IDENTITY, \"subdomain\": SUBDOMAIN, \"point\": POINT}\n\ndef observables_factory(obs_name):\n if observables_dict[obs_name]==IDENTITY:\n return identity\n elif observables_dict[obs_name]... | [
[
"numpy.sum"
]
] |
ryanfarr01/blue | [
"a9aac98c09cce0f7cadf26cf592e3d978bf4e3ff"
] | [
"openmdao/utils/general_utils.py"
] | [
"\"\"\"Some miscellaneous utility functions.\"\"\"\nfrom __future__ import division\n\nimport os\nimport sys\nimport warnings\nfrom six import string_types\n\nfrom collections import Iterable\nimport numbers\n\nimport numpy as np\n\n\ndef warn_deprecation(msg):\n \"\"\"\n Raise a warning and prints a deprecat... | [
[
"numpy.ones",
"numpy.atleast_1d",
"numpy.asarray",
"numpy.isscalar"
]
] |
werthm/becquerel | [
"975c522419eb4245efb0069b4aac23520703deb5",
"975c522419eb4245efb0069b4aac23520703deb5"
] | [
"becquerel/core/plotting.py",
"becquerel/core/utils.py"
] | [
"\"\"\"Tools for plotting spectra.\"\"\"\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom uncertainties import unumpy\nimport warnings\n\n\nclass PlottingError(Exception):\n \"\"\"General exception for plotting.py\"\"\"\n\n pass\n\n\nclass SpectrumPlotter:\n \"\"\"Class for handling spectrum pl... | [
[
"numpy.max",
"numpy.zeros_like",
"numpy.ceil",
"numpy.min",
"matplotlib.pyplot.subplots",
"numpy.abs",
"numpy.floor",
"numpy.log10",
"numpy.maximum"
],
[
"numpy.finfo",
"numpy.array",
"numpy.asarray",
"numpy.sqrt"
]
] |
udaydatar7/SSA | [
"66d03de027206badd9317d1086bfecbd85edd94f"
] | [
"StockSentimentAnalysis.py"
] | [
"# import key libraries\r\nimport pandas as pd\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport seaborn as sns\r\nfrom wordcloud import WordCloud, STOPWORDS\r\nimport nltk\r\nimport re\r\nfrom nltk.stem import PorterStemmer, WordNetLemmatizer\r\nfrom nltk.corpus import stopwords\r\nfrom nltk.token... | [
[
"tensorflow.keras.preprocessing.sequence.pad_sequences",
"tensorflow.keras.utils.to_categorical",
"sklearn.metrics.confusion_matrix",
"matplotlib.pyplot.figure",
"sklearn.metrics.accuracy_score",
"tensorflow.keras.layers.Embedding",
"tensorflow.keras.layers.Dense",
"tensorflow.kera... |
choiip/kerasify | [
"9add953ad2333486de66e985213c6e57ea4c17b4"
] | [
"kerasify_h5.py"
] | [
"from tensorflow.keras.models import load_model\nfrom kerasify import export_model\n\nmodel = load_model('tiny-yolo.h5')\n\nexport_model(model, 'output.model')\n"
] | [
[
"tensorflow.keras.models.load_model"
]
] |
motrom/kittifusion-pdeft | [
"65b938dc760f31ad3fc5007619481419b8603a50"
] | [
"plotStuff.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nlast mod 2/1/19 adding some common functions\n+x is up, +y is left\nreference is bottom center, unlike prototype which is center center\n\"\"\"\n\nfrom math import pi, tan, cos, sin\nimport numpy as np\nimport cv2\n#from matplotlib.cm import ScalarMappable\n... | [
[
"numpy.array",
"numpy.sin",
"numpy.empty",
"numpy.zeros",
"matplotlib.colors.hsv_to_rgb",
"numpy.where",
"numpy.arange",
"numpy.hypot",
"numpy.cos",
"numpy.append",
"numpy.meshgrid",
"numpy.maximum"
]
] |
bsipocz/astroML | [
"4ca74616a886c24dd7946e00f535f323e2e13787"
] | [
"astroML/datasets/wmap_temperatures.py"
] | [
"import os\nimport numpy as np\n\n# because of a bug in healpy, pylab must be imported before healpy is\n# or else a segmentation fault can result.\nimport pylab as pl\n\nfrom . import get_data_home\nfrom .tools import download_with_progress_bar\n\nDATA_URL = ('http://lambda.gsfc.nasa.gov/data/map/dr4/'\n ... | [
[
"numpy.logical_not"
]
] |
isaacanthony/spark-playground | [
"cfafe71f882b1c5620291383da7b32b46ff211b9"
] | [
"src/helpers/dataframe.py"
] | [
"\"\"\"Helper script for interacting with dataframes\"\"\"\nimport pandas as pd\nfrom pyspark.sql import DataFrame, SparkSession\n\n\ndef read_csv(spark: SparkSession, file_path: str) -> DataFrame:\n \"\"\"Converts a CSV into a spark DataFrame\"\"\"\n spark.conf.set('spark.sql.execution.arrow.enabled', 'true'... | [
[
"pandas.read_csv"
]
] |
nunenuh/invgen | [
"c36930bfa9d3e3a08ce17f0c47c8773b1b4d5066"
] | [
"docgen/csvgen/field.py"
] | [
"import random\nimport string\nimport pandas as pd\nfrom . import config\n\nfrom . import utils\n\n\n\ndef nomer_dokumen():\n pass\n\ndef nomer_faktur():\n pass\n\ndef tanggal_faktur():\n pass\n\n# ====== identitas pemilik ====== #\n\ndef degree(name, csv_path = None):\n if csv_path == None:\n cs... | [
[
"pandas.read_csv",
"pandas.concat"
]
] |
gaybro8777/featuretools | [
"0bb7b29045107e10acfab07322ef00934ec21c14"
] | [
"featuretools/variable_types/variable.py"
] | [
"from __future__ import division\n\nfrom builtins import object\n\nimport numpy as np\nimport pandas as pd\n\nfrom featuretools.utils import is_string\n\n\nclass Variable(object):\n \"\"\"Represent a variable in an entity\n\n A Variable is analogous to a column in table in a relational database\n\n Args:\n... | [
[
"pandas.Timestamp.now",
"pandas.Timedelta"
]
] |
jonarani/IAS0360_project | [
"1f8182dcf6edcba6607a0f287fa3fbaab05f50fd"
] | [
"source/preprocess_and_train.py"
] | [
"import json\nfrom PIL.Image import SEQUENCE\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom numpy.random.mtrand import shuffle\nimport cv2\nimport numpy as np\nimport scipy.ndimage as scpy\nfrom tensorflow.keras.layers import Conv2D, MaxPool2D, Dropout, BatchNormalization, Flatten\nfrom tensorflow.keras.... | [
[
"numpy.array",
"numpy.delete",
"tensorflow.keras.layers.Flatten",
"numpy.copy",
"tensorflow.keras.layers.MaxPool2D",
"numpy.mean",
"numpy.random.shuffle",
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Dense",
"tensorflow.l... |
ab93/Depression-Identification | [
"31b5e6f44ecd6a87b1a181fcd9e8388edb15a176"
] | [
"src/feature_extract/extract_CLM_Gaze.py"
] | [
"import pandas as pd\nfrom pprint import pprint\nfrom glob import glob\nimport numpy as np\nimport re\nimport csv\nimport os\nimport fnmatch\nimport sys\n\nfollowUp = {}\nack = {}\nnonIntimate = {}\nintimate = {}\nfeatureList = {}\nquestionType_DND={}\nquestionType_PN={}\n\n\ndef readHelperData():\n global follo... | [
[
"pandas.read_csv",
"numpy.asarray"
]
] |
kblaszczak-intel/open_model_zoo | [
"e313674d35050d2a4721bbccd9bd4c404f1ba7f8"
] | [
"tools/accuracy_checker/openvino/tools/accuracy_checker/launcher/gapi_launcher.py"
] | [
"\"\"\"\nCopyright (c) 2018-2022 Intel Corporation\n\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 ... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros",
"numpy.shape",
"numpy.resize",
"numpy.transpose",
"numpy.ndim"
]
] |
shizhediao/robert4qa-parallel | [
"b77cd0733d2e86054ad14d6613e38a4015cb89c6"
] | [
"train-kfolds/partition.py"
] | [
"import pandas as pd\nfrom sklearn import model_selection\n\ndf = pd.read_csv(\"../data/train.csv\")\ndf = df.dropna().reset_index(drop = True) # 过滤缺失数据并重置索引\ndf[\"kfold\"] = -1 # 数据对折\n\ndf = df.sample(frac = 1).reset_index(drop = True) # 随机采样\n\n# 按sentiment分层采样\nkf = model_selection.StratifiedKFold(n_sp... | [
[
"pandas.read_csv",
"sklearn.model_selection.StratifiedKFold"
]
] |
CVMI-Lab/KDEP | [
"5fe3914dac9e522476086bad47bc35b4661c6171"
] | [
"src/semseg/tool/test.py"
] | [
"import os\nimport time\nimport logging\nimport argparse\n\nimport cv2\nimport numpy as np\nimport torch\nimport torch.backends.cudnn as cudnn\nimport torch.nn.functional as F\nimport torch.nn.parallel\nimport torch.utils.data\n\nfrom util import dataset, transform, config\nfrom util.util import AverageMeter, inter... | [
[
"numpy.ceil",
"numpy.uint8",
"numpy.zeros",
"torch.nn.DataParallel",
"torch.no_grad",
"torch.nn.functional.interpolate",
"numpy.mean",
"numpy.loadtxt",
"numpy.transpose",
"torch.utils.data.DataLoader",
"numpy.argmax",
"torch.nn.functional.softmax",
"torch.load",... |
Hotown/ssd_pytorch | [
"0f2f73a4ab77603ec20211f50dec054c0bd34f2b"
] | [
"utils/augmentations.py"
] | [
"import torch\nfrom torchvision import transforms\nimport cv2\nimport numpy as np\nimport types\nfrom numpy import random\n\n\ndef intersect(box_a, box_b):\n max_xy = np.minimum(box_a[:, 2:], box_b[2:])\n min_xy = np.maximum(box_a[:, :2], box_b[:2])\n inter = np.clip((max_xy - min_xy), a_min=0, a_max=np.in... | [
[
"numpy.array",
"numpy.random.choice",
"numpy.minimum",
"numpy.random.uniform",
"numpy.random.randint",
"numpy.clip",
"numpy.maximum"
]
] |
dukeNashor/R2Us | [
"ca9f80350a461feb7be116fd0d3761174d61a247",
"ca9f80350a461feb7be116fd0d3761174d61a247"
] | [
"SVM_Classifier_FashionMNIST/SVM_Classifier_FashionMNIST/Neural_Network_Classifier.py",
"COMP5425Project/COMP5425Project/SBIR.py"
] | [
"import h5py\nimport numpy as np\nimport os\nimport matplotlib.pyplot as plt\nimport time\n\nfrom preprocessor import pca\nfrom preprocessor import split_train_test\nfrom preprocessor import ConfusionMatrixHelper\n\n# Neural Network Classifier using Stochastic Gradient Descent, ReLU is used as activation function, ... | [
[
"numpy.array",
"numpy.matmul",
"numpy.zeros",
"numpy.log",
"numpy.copy",
"numpy.random.randn",
"numpy.exp",
"numpy.sqrt",
"numpy.squeeze",
"numpy.unique"
],
[
"numpy.expand_dims",
"numpy.zeros"
]
] |
kimjimong/Informer2020 | [
"1466bea980552ca65468f10d53bef8506935f315"
] | [
"exp/exp_informer.py"
] | [
"from data.data_loader import Dataset_ETT_hour, Dataset_ETT_minute, Dataset_Custom, Dataset_Pred\nfrom data.edf_loader import EdfDataset\nfrom data.sample_loader import SampleDataset\nfrom exp.exp_basic import Exp_Basic\nfrom models.model import Informer, InformerStack\n\nfrom utils.tools import EarlyStopping, adju... | [
[
"torch.zeros",
"numpy.array",
"torch.cat",
"torch.cuda.amp.autocast",
"torch.nn.MSELoss",
"numpy.save",
"torch.ones",
"torch.utils.data.DataLoader",
"torch.load",
"numpy.average",
"torch.cuda.amp.GradScaler",
"torch.nn.DataParallel"
]
] |
GerinTang/tpu | [
"d6ca25c49b5f7e88fdf7d2623cf6fd8349ddfc3f"
] | [
"models/official/detection/modeling/retinanet_model.py"
] | [
"# Lint as: python2, python3\n# 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/... | [
[
"tensorflow.compat.v1.reshape",
"tensorflow.compat.v1.logging.info",
"tensorflow.compat.v1.concat",
"tensorflow.compat.v1.identity",
"tensorflow.compat.v1.shape",
"tensorflow.compat.v1.expand_dims",
"tensorflow.compat.v1.keras.backend.moving_average_update",
"tensorflow.compat.v1.r... |
Infrarift/data-prep | [
"02fcf63358d13aec52404266ae645c61eda985cf"
] | [
"visualization/image_strip.py"
] | [
"import numpy as np\nimport cv2\n\n\nclass ImageStrip:\n def __init__(self):\n pass\n\n @staticmethod\n def _get_output_dimensions(num_images, width, height, pad):\n total_width = num_images * (width + pad) + pad\n total_height = height + pad * 2\n return total_width, total_heig... | [
[
"numpy.zeros"
]
] |
andyfaff/sasview | [
"c00a797ab9c4ddc60f0fa8a64ae8a2067c225921"
] | [
"src/sas/sasgui/plottools/fittings.py"
] | [
"\"\"\"\nThis module is used to fit a set of x,y data to a model passed to it. It is\nused to calculate the slope and intercepts for the linearized fits. Two things\nshould be noted:\n\nFirst, this fitting module uses the NLLSQ module of SciPy rather than a linear\nfit. This along with a few other modules could p... | [
[
"scipy.optimize.leastsq"
]
] |
zhangbo2008/bert | [
"d2c1b03735c5c1428b918d80f810baea1527ac2d"
] | [
"run_pretraining.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team 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# Unl... | [
[
"tensorflow.contrib.tpu.TPUEstimatorSpec",
"tensorflow.data.TFRecordDataset",
"tensorflow.contrib.tpu.TPUEstimator",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.metrics.mean",
"tensorflow.one_hot",
"tensorflow.parse_single_example",
"tensorflow.trainable_variables",
... |
amurto/nlp-scripts | [
"f1158221a87838589ccff4eaa4db5349e6ec1c8d"
] | [
"Glove/2/train.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"hategru.ipynb\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1fg_cClsHnbiRLknbfd1tVF2hTqP0UL4m\n\"\"\"\n\nfrom google.colab import drive\ndrive.mount('/content/drive')\n\nimport os\nimport pickle\nimport numpy a... | [
[
"sklearn.preprocessing.LabelEncoder",
"sklearn.metrics.confusion_matrix",
"numpy.asarray",
"sklearn.metrics.accuracy_score",
"numpy.argmax",
"sklearn.model_selection.train_test_split",
"pandas.read_csv"
]
] |
audreyruckman/armory | [
"a0ff702779c11dc4ecd5e0dc50e195f2f0433605"
] | [
"armory/baseline_models/pytorch/ucf101_mars.py"
] | [
"\"\"\"\nModel contributed by: MITRE Corporation\nAdapted from: https://github.com/craston/MARS\n\"\"\"\nimport logging\nfrom typing import Union, Optional, Tuple\n\nfrom art.estimators.classification import PyTorchClassifier\nimport numpy as np\nfrom PIL import Image\nimport torch\nfrom torch import optim\n\nfrom ... | [
[
"numpy.array",
"torch.nn.functional.interpolate",
"torch.optim.SGD",
"torch.from_numpy",
"torch.cuda.is_available",
"numpy.random.randint",
"torch.load",
"torch.transpose",
"torch.nn.CrossEntropyLoss",
"numpy.vstack",
"torch.reshape"
]
] |
bsxfun/pffdtd | [
"aa319f6c86517cb95aabfae8656277da62c3ead5"
] | [
"python/air_abs/test_air_abs_filters.py"
] | [
"##############################################################################\n# This file is a part of PFFDTD.\n#\n# PFFTD is released under the MIT License.\n# For details see the LICENSE file.\n#\n# Copyright 2021 Brian Hamilton.\n#\n# File name: test_air_abs_filters.py\n#\n# Description: This is a testbench f... | [
[
"numpy.log",
"numpy.exp",
"matplotlib.pyplot.figure",
"numpy.random.random_sample",
"numpy.arange",
"matplotlib.pyplot.show"
]
] |
mapeAAU/3D-ZeF | [
"7230261dcb993ed67cb2c9c3200e9741cfa8a9c2"
] | [
"modules/reconstruction/Triangulate.py"
] | [
"import cv2\nimport os.path\nimport numpy as np\nfrom sklearn.externals import joblib\n### Module imports ###\nimport sys\nsys.path.append('../../')\n\nclass Triangulate:\n \"\"\"\n Class implementation for triangulating two 2D points \n \"\"\"\n \n def rayIntersection(self, ray1Dir, ray1Point, ray2D... | [
[
"numpy.array",
"numpy.arccos",
"numpy.dot",
"numpy.linalg.norm",
"numpy.sqrt"
]
] |
abdelrahman0110/task | [
"2956dc96f51b3fb3d691d0f8bbad9d9bfdeb6078"
] | [
"seqtolang/model.py"
] | [
"import torch\nfrom torch import nn\nfrom torch import autograd\nfrom torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence\n\n\nclass SeqToLangModel(nn.Module):\n def __init__(self, num_of_ngrams, output_size, hidden_size, embedding_dim):\n super().__init__()\n\n self.chars_embedding... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.LSTM",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.cuda.is_available",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.nn.Embedding"
]
] |
desihub/LSS | [
"be7559adee9250bde44f40816230caa83313488a"
] | [
"py/LSS/common_tools.py"
] | [
"import numpy as np\nimport fitsio\nfrom astropy.table import Table,join\n\nfrom LSS.tabulated_cosmo import TabulatedDESI\ncosmo = TabulatedDESI()\ndis_dc = cosmo.comoving_radial_distance\n\n\n\n#functions that shouldn't have any dependence on survey go here\n\ndef find_znotposs(dz):\n\n dz.sort('TARGETID')\n ... | [
[
"numpy.histogram",
"numpy.array",
"numpy.loadtxt",
"numpy.unique",
"numpy.isin"
]
] |
ksc999/tianshou | [
"8a5e2190f7045ffee2ffa4346c0010693ac7b222",
"8a5e2190f7045ffee2ffa4346c0010693ac7b222"
] | [
"test/base/test_collector.py",
"tianshou/policy/modelfree/dqn.py"
] | [
"import tqdm\nimport pytest\nimport numpy as np\nfrom torch.utils.tensorboard import SummaryWriter\n\nfrom tianshou.policy import BasePolicy\nfrom tianshou.env import DummyVectorEnv, SubprocVectorEnv\nfrom tianshou.data import Batch, Collector, AsyncCollector\nfrom tianshou.data import (\n ReplayBuffer,\n Pri... | [
[
"numpy.bincount",
"numpy.zeros_like",
"numpy.array",
"numpy.isclose",
"numpy.zeros",
"numpy.mean",
"numpy.allclose",
"numpy.arange",
"numpy.all",
"torch.utils.tensorboard.SummaryWriter"
],
[
"numpy.isclose",
"numpy.random.rand"
]
] |
emdodds/whitening | [
"52d1133c49f5feac8f36b58bccee1f1ba054e2d7"
] | [
"Scripts/model_recovery.py"
] | [
"import numpy as np\nimport pickle\nimport argparse\nimport os\nfrom pathlib import Path\nimport StimSet\nfrom SAILnet import SAILmods\nimport fitlearners\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--learner', default='SAILnet', type=str)\nparser.add_argument('-g', '--gain', default=2, type=float)\... | [
[
"numpy.power"
]
] |
Yulin-W/cpp-k-nearest-neighbors | [
"36b16eb427e9295b9f50ffe2a6611b3dccb66b34"
] | [
"training/data_generator.py"
] | [
"import numpy as np\nimport pandas as pd\nimport random\n\n# Random point generator with x, y bounds as +- specified value from origin\ndef rand_point(x_bound, y_bound):\n random.seed()\n x = random.uniform(-x_bound, x_bound)\n y = random.uniform(-y_bound, y_bound)\n return (x, y)\n\n# Functions for lab... | [
[
"pandas.DataFrame",
"numpy.sqrt"
]
] |
mifunduj/GMR | [
"dfacc121a9599515e7269c53a3618f069c7b4bed"
] | [
"scripts/Regression.py"
] | [
"import csv\r\nimport argparse\r\nimport numpy as np\r\nimport GaussianMixtureRegression as gmr\r\nfrom sklearn.mixture import GaussianMixture as GM\r\n\r\ndef main():\r\n epilog=\"\"\"\"\r\n\r\n \"\"\"\"\"\r\n parser=argparse.ArgumentParser(description='',epilog=epilog)\r\n parser.add_argument('-f','--... | [
[
"sklearn.mixture.GaussianMixture"
]
] |
DriesMeerman/Risk-Assessment | [
"7ea4ac9d2f56a31f237853eab2cfd7f4dc9fe96b"
] | [
"code/python/training_pipeline/src/models/ml/KNNModelTest.py"
] | [
"import time\nfrom typing import Dict\nfrom .ModelTest import ModelTest\nimport pandas as pd\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom ..config_helper import ConfigHelper\n\n\nclass KNNModelTest(ModelTest):\n def __init__(self, training_df: pd.DataFrame, config, variation: str) -> None:\n ... | [
[
"sklearn.neighbors.KNeighborsClassifier"
]
] |
ian-cooke/basilisk_mag | [
"a8b1e37c31c1287549d6fd4d71fcaa35b6fc3f14"
] | [
"src/fswAlgorithms/attDetermination/sunlineUKF/_UnitTest/SunLineuKF_test_utilities.py"
] | [
"''' '''\n'''\n ISC License\n\n Copyright (c) 2016, Autonomous Vehicle Systems Lab, University of Colorado at Boulder\n\n Permission to use, copy, modify, and/or distribute this software for any\n purpose with or without fee is hereby granted, provided that the above\n copyright notice and this permission notice ap... | [
[
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylim",
"numpy.sqrt",
"matplotlib.pyplot.show",
"matplotlib.py... |
ksecology/FixedEffectModel | [
"c2371c34350d95e6c308159e1a9c00e56bcb104c"
] | [
"FixedEffectModel/OLSHighDCategory.py"
] | [
"from statsmodels.compat import lrange\nfrom statsmodels.iolib import SimpleTable\nfrom .DemeanDataframe import demean_dataframe,demeanonex\nfrom .FormTransfer import form_transfer\nfrom .OLSFixed import OLSFixed\nfrom .RobustErr import robust_err\nfrom .ClusterErr import *\nfrom .CalDf import cal_df\nfrom .CalFull... | [
[
"numpy.delete",
"numpy.dot",
"numpy.zeros",
"scipy.stats.f.sf",
"numpy.sqrt",
"numpy.abs",
"numpy.diag"
]
] |
adry84/aditof_sdk | [
"3e99c435bcf603318267b984a7cbaa3b30fc65fd"
] | [
"bindings/python/examples/showPointCloud/showPointCloud.py"
] | [
"#\n# BSD 3-Clause License\n#\n# Copyright (c) 2019, Analog Devices, Inc.\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# 1. Redistributions of source code must retain the above copy... | [
[
"numpy.resize",
"numpy.uint8"
]
] |
juliendehos/fast-cma-es | [
"ebf74f908dcee22b617fc6759480fc6f9f717460"
] | [
"fcmaes/advretry.py"
] | [
"# Copyright (c) Dietmar Wolz.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory.\n\nimport time\nimport os\nimport math\nimport random\nimport ctypes as ct\nimport numpy as np\nfrom random import Random\nimport multiprocessing as mp\nfrom multiprocessing im... | [
[
"numpy.asarray",
"scipy.optimize.Bounds",
"numpy.minimum",
"numpy.random.MT19937",
"numpy.abs",
"numpy.random.SeedSequence",
"numpy.maximum"
]
] |
stonescenter/bert | [
"45f1e09e58be693754db5d2bd89d9ad97a9f30f8"
] | [
"run_classifier.py"
] | [
"# coding=utf-8\n# Copyright 2018 The Google AI Language Team 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# Unl... | [
[
"tensorflow.contrib.tpu.TPUEstimatorSpec",
"tensorflow.data.TFRecordDataset",
"tensorflow.train.Features",
"tensorflow.contrib.tpu.TPUEstimator",
"tensorflow.matmul",
"tensorflow.metrics.precision",
"tensorflow.metrics.mean",
"tensorflow.nn.softmax",
"tensorflow.one_hot",
"... |
wkschwartz/cvxpy | [
"5788e30e58aa9341b3cd8d36dd34b7477eef9c25"
] | [
"cvxpy/atoms/geo_mean.py"
] | [
"\"\"\"\nCopyright 2013 Steven Diamond\n\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 i... | [
[
"numpy.any",
"numpy.array",
"scipy.sparse.csc_matrix"
]
] |
ucd-plse/func2vec-fse2018-artifact | [
"a17e22f247a03b77931751dd55d429f26c8f293c"
] | [
"src/walker/commands.py"
] | [
"from collections import defaultdict, Counter\nfrom copy import deepcopy\nimport csv\nimport itertools\nimport functools\nimport os\nimport sys\nimport csv\n\nimport matplotlib\nmatplotlib.use(\"Agg\")\nimport matplotlib.pyplot as plt\n\nimport numpy as np\nimport walker.pushdown\nfrom walker.pushdown import PushDo... | [
[
"matplotlib.use",
"matplotlib.pyplot.savefig",
"numpy.array",
"numpy.arange"
]
] |
AlexanLee/x-deeplearning | [
"24637dc141feccef3499b5ff310d47dbd93ca83c"
] | [
"xdl/xdl/python/lib/graph.py"
] | [
"# Copyright (C) 2016-2018 Alibaba Group Holding Limited\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 require... | [
[
"numpy.array"
]
] |
mazpie/vime-pytorch | [
"fef62d9d700886622d9ca8c2234ad1718c10f553"
] | [
"play.py"
] | [
"import argparse\nimport os\n# workaround to unpickle olf model files\nimport sys\n\nimport numpy as np\nimport torch\nimport time\n\nfrom envs.envs_util import VecPyTorch, make_vec_envs\nfrom misc.utils import get_render_func, get_vec_normalize\n\n# sys.path.append('a2c_ppo_acktr')\n\nparser = argparse.ArgumentPar... | [
[
"torch.zeros",
"torch.no_grad"
]
] |
KarlJohnsonnn/rpgpy | [
"ddf79ce3eda649fca9ef92a0d66fbb0059164f7c"
] | [
"tests/unit/test_utils.py"
] | [
"from rpgpy import utils\nfrom numpy.testing import assert_array_equal\nimport pytest\n\n\ndef test_rpg_seconds2date():\n date = utils.rpg_seconds2date(0)\n date_only = utils.rpg_seconds2date(0, date_only=True)\n res = ['2001', '01', '01', '00', '00', '00']\n assert_array_equal(date, res)\n assert_ar... | [
[
"numpy.testing.assert_array_equal"
]
] |
Kazuhito00/GrabCut-Tool | [
"f7b8f3cc8f3d7b97a0277cc8fd048b4891e48a87"
] | [
"grabcut_tool.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\nimport os\nimport glob\nimport copy\nimport argparse\n\nimport cv2 as cv\nimport numpy as np\nfrom PIL import Image\n\n\ndef get_args():\n parser = argparse.ArgumentParser()\n\n parser.add_argument(\"--input\", type=str, default='image')\n parser.add_argumen... | [
[
"numpy.where",
"numpy.zeros"
]
] |
adolgert/cascade | [
"2084e07c9ee5e901dd407b817220de882c7246a3",
"2084e07c9ee5e901dd407b817220de882c7246a3"
] | [
"tests/stats/test_estimation.py",
"tests/model/test_compartmental.py"
] | [
"import pytest\n\nimport pandas as pd\n\nfrom cascade.stats.estimation import meas_bounds_to_stdev\n\n\ndef test_meas_bounds_to_stdev__bad_bounds():\n df = pd.DataFrame({\"meas_lower\": [0, 0, 1, 1], \"meas_value\": [0, -0.01, 1, 1], \"meas_upper\": [-10, 0, 1, 10]})\n\n with pytest.raises(ValueError):\n ... | [
[
"pandas.DataFrame"
],
[
"numpy.full",
"numpy.zeros_like",
"numpy.array",
"numpy.exp",
"numpy.allclose",
"numpy.abs",
"numpy.linspace",
"scipy.stats.gamma"
]
] |
samir-nasibli/sdc | [
"b9144c8799d6454dec3e5c550e305963b24c1570",
"b9144c8799d6454dec3e5c550e305963b24c1570"
] | [
"examples/old_examples/Basic_DataFrame.py",
"sdc/timsort.py"
] | [
"# *****************************************************************************\n# Copyright (c) 2019, Intel Corporation All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# Redistribut... | [
[
"numpy.arange",
"pandas.merge",
"pandas.concat"
],
[
"numpy.empty",
"numpy.random.seed",
"pandas.DataFrame",
"numpy.testing.assert_almost_equal",
"numpy.ones",
"numpy.arange",
"numpy.random.ranf"
]
] |
himanshurawlani/damage-analyzer | [
"50ad59ff165505cc9e8103d0eb2c4ad1bc291bdb"
] | [
"tf_serving/export_saved_model.py"
] | [
"import tensorflow as tf\n\n# The export path contains the name and the version of the model\ntf.keras.backend.set_learning_phase(0) # Ignore dropout at inference\nmodel = tf.keras.models.load_model('./inception.h5')\nexport_path = './my_image_classifier/1'\n\n# Fetch the Keras session and save the model\n# The sig... | [
[
"tensorflow.keras.models.load_model",
"tensorflow.keras.backend.set_learning_phase",
"tensorflow.saved_model.simple_save",
"tensorflow.keras.backend.get_session"
]
] |
tdmorello/napari-basicpy | [
"70e1a16f1401a5c7636ce7a995b79a93bef179d0"
] | [
"src/napari_basicpy/_sample_data.py"
] | [
"from __future__ import annotations\n\nfrom typing import TYPE_CHECKING, List\n\nimport numpy as np\n\nif TYPE_CHECKING:\n import napari\n\n\ndef make_sample_data() -> List[napari.types.LayerData]:\n \"\"\"Generate a parabolic gradient to simulate uneven illumination\"\"\"\n np.random.seed(42)\n\n n_ima... | [
[
"numpy.random.seed",
"numpy.moveaxis",
"numpy.linspace"
]
] |
hablb/pytorch | [
"c17bc35f0e4551de300650d4702ebda4f57d77f9",
"c17bc35f0e4551de300650d4702ebda4f57d77f9"
] | [
"torch/ao/quantization/_dbr/auto_trace_rewriter.py",
"torch/testing/_internal/common_fx2trt.py"
] | [
"import copy\nimport math\nimport operator\nfrom types import ModuleType\nfrom typing import Callable, Any, Tuple, Dict\n\nimport torch\nimport torch.fx\nfrom .mappings import conv_ops\nfrom .quantization_state import AutoQuantizationState\nfrom .utils import get_packable_arg_idxs\n\nclass AllModuleTracer(torch.fx.... | [
[
"torch.fx.Proxy",
"torch.fx.GraphModule"
],
[
"torch.fx.experimental.normalize.NormalizeArgs",
"torch.no_grad",
"torch.manual_seed",
"torch.cuda.is_available",
"torch.fx.symbolic_trace",
"torch.fx.passes.shape_prop.ShapeProp",
"torch.fx.experimental.fx_acc.acc_tracer.trace"... |
allenintw/slomo_mine | [
"849d10b1603b555301383a993862653eb228dd1d"
] | [
"models/plustwo.py"
] | [
"# *****************************************************************************\n# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n# * Redis... | [
[
"torch.sigmoid",
"torch.cat",
"numpy.array",
"torch.nn.MSELoss",
"torch.nn.MaxPool2d",
"torch.nn.functional.interpolate",
"torch.nn.BatchNorm2d",
"torch.nn.LeakyReLU",
"torch.linspace",
"torch.nn.L1Loss",
"torch.nn.ReLU",
"torch.nn.Upsample",
"torch.nn.Conv2d"
... |
MohamedAshrafTolba/maze-rl-agent | [
"5a01d0c2ae6a404970d174f0dbf30bf846ab4e66"
] | [
"dynamic_programming.py"
] | [
"import numpy as np\nimport copy\nfrom util import print_iter\n\n\ndef q_from_v(env, V, s, gamma=1):\n q = np.zeros(env.nA)\n for action in range(env.nA):\n for prob, next_state, reward, done in env.P[s][action]:\n q[action] += prob * (reward + gamma * V[next_state])\n return q\n\n\ndef p... | [
[
"numpy.ones",
"numpy.zeros"
]
] |
wingillis/ssm | [
"3d350842330292e0899eb1e134592ca294b8e2a0"
] | [
"ssm/observations.py"
] | [
"import copy\nimport warnings\n\nimport autograd.numpy as np\nimport autograd.numpy.random as npr\nfrom autograd.scipy.special import logsumexp\nfrom autograd.scipy.special import gammaln, digamma\n\nfrom ssm.util import random_rotation, ensure_args_are_lists, \\\n logistic, logit, one_hot\nfrom ssm.regression i... | [
[
"sklearn.cluster.KMeans",
"sklearn.linear_model.LinearRegression"
]
] |
JBEI/KineticLearning | [
"c34249105c43dc4b7889bee7ebb82531f3e89fb5"
] | [
"KineticLearning/helper.py"
] | [
"import random\nimport pandas as pd\nimport numpy as np\nimport math\nfrom scipy.integrate import ode\nfrom scipy.interpolate import interp1d\nfrom scipy.signal import savgol_filter\nfrom sklearn.model_selection import learning_curve\nimport matplotlib.pyplot as plt\n\n\n#====================#\n# Helper Functions ... | [
[
"scipy.interpolate.interp1d",
"scipy.signal.savgol_filter",
"pandas.DataFrame",
"matplotlib.pyplot.figure",
"scipy.integrate.ode",
"pandas.concat",
"numpy.linspace",
"matplotlib.pyplot.figlegend",
"numpy.gradient"
]
] |
caoxiaoyue/PyAutoArray | [
"e10d3d6a5b8dd031f2ad277486bd539bd5858b2a",
"e10d3d6a5b8dd031f2ad277486bd539bd5858b2a",
"e10d3d6a5b8dd031f2ad277486bd539bd5858b2a"
] | [
"autoarray/structures/grids/one_d/grid_1d_util.py",
"test_autoarray/inversion/pixelization/test_voronoi.py",
"test_autoarray/dataset/test_imaging.py"
] | [
"import numpy as np\r\nfrom typing import Tuple\r\n\r\nfrom autoarray.structures.arrays.one_d import array_1d_util\r\nfrom autoarray import numba_util\r\nfrom autoarray.geometry import geometry_util\r\nfrom autoarray.mask import mask_1d_util\r\n\r\n\r\ndef grid_1d_slim_via_shape_slim_from(\r\n shape_slim: Tuple[... | [
[
"numpy.full",
"numpy.zeros"
],
[
"numpy.array",
"numpy.ones"
],
[
"numpy.invert",
"numpy.array",
"numpy.ones"
]
] |
50sven/carla_rllib | [
"b5f8bd4de884e591f80a7148db60362882af5b37"
] | [
"carla_rllib/utils/rendering.py"
] | [
"\"\"\"OpenDrive Rendering\n\nThis rendering is specific to a particular application and\ndoes not represent a universal blueprint for different tasks!\nHowever, it can be adapted to other applications.\n\nThis script provides a rendering class that uses the underlying OpenDrive Map to render images.\nIn addition, ... | [
[
"numpy.zeros"
]
] |
tam633/geometric-js | [
"ad5c2ca53691eedb0b246ade18a80738a15e79a5"
] | [
"utils/helpers.py"
] | [
"\"\"\"Generic helper module.\"\"\"\n\nimport argparse\nimport numpy as np\nimport os\nimport random\nimport shutil\nimport torch\n\n\ndef create_safe_directory(directory, logger=None):\n \"\"\"Create a directory and archive the previous one if already existed.\"\"\"\n if os.path.exists(directory):\n i... | [
[
"numpy.random.seed",
"torch.manual_seed",
"torch.cuda.is_available"
]
] |
Vivianyzw/Dual.DBNet.pytorch | [
"19d823ed7c05076c087a3f7ad1127c71c1c0d692"
] | [
"utils/ocr_metric/icdar2015/detection/icdar2013.py"
] | [
"# -*- coding: utf-8 -*-\n# @Time : 2021/9/29 14:09\n# @Author : vivian\nimport math\nfrom collections import namedtuple\nimport numpy as np\nfrom shapely.geometry import Polygon\n\n\nclass DetectionICDAR2013Evaluator(object):\n def __init__(\n self,\n area_recall_constraint=0.8, area_precision... | [
[
"numpy.array",
"numpy.empty",
"numpy.mean"
]
] |
YJiangcm/machine-learning-tutorial | [
"e072ee32cda8f6df6fcc848ab772e967fb50ad5d"
] | [
"(2) back propogation/hands on backpropogation.py"
] | [
"\"\"\"\n\nThis program builds a two-layer neural network for the Iris dataset.\nThe first layer is a relu layer with 10 units, and the second one is \na softmax layer. The network structure is specified in the \"train\" function.\n\nThe parameters are learned using SGD. The forward propagation and backward \nprop... | [
[
"numpy.max",
"numpy.array",
"numpy.dot",
"numpy.zeros",
"numpy.log",
"numpy.sum",
"numpy.random.permutation",
"numpy.genfromtxt",
"numpy.random.randn",
"numpy.exp",
"numpy.mean",
"numpy.ones",
"numpy.argmax"
]
] |
yalhaizaey/Dreich | [
"bc314d41471d00b9d605bb4519f31a465e0a6b75"
] | [
"Aeneas/aeneas/aeneas/sd.py"
] | [
"#!/usr/bin/env python\n# coding=utf-8\n\n# aeneas is a Python/C library and a set of tools\n# to automagically synchronize audio and text (aka forced alignment)\n#\n# Copyright (C) 2012-2013, Alberto Pettarin (www.albertopettarin.it)\n# Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it)\n# Copyright (C)... | [
[
"numpy.min",
"numpy.argmin"
]
] |
zdaxie/SpatiallyAdaptiveInference-Detection | [
"323801deac6f0641d00ecb23f6885df8483cc447"
] | [
"mmdet/models/backbones/sparse_resnet.py"
] | [
"import logging\n\nimport torch\nimport torch.nn.functional as F\nimport torch.nn as nn\nimport torch.utils.checkpoint as cp\nimport torch.distributed as dist\nfrom torch.nn.modules.batchnorm import _BatchNorm\n\nfrom mmcv.cnn import constant_init, kaiming_init\nfrom mmcv.runner import load_checkpoint, get_dist_inf... | [
[
"torch.distributed.get_world_size",
"torch.nn.Sigmoid",
"torch.nn.Sequential",
"torch.nn.MaxPool2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.tensor",
"torch.distributed.all_reduce",
"torch.utils.checkpoint.checkpoint",
"torch.nn.functional.conv2d"
]
] |
renjie-liu/iree | [
"9ec6e61fba85d1e0d7f526fa4a5324edb14cde9b"
] | [
"integrations/tensorflow/e2e/math_test.py"
] | [
"# Lint as: python3\n# Copyright 2020 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl... | [
[
"numpy.array",
"tensorflow.compat.v2.math.mod",
"tensorflow.compat.v2.math.ceil",
"tensorflow.compat.v2.math.abs",
"tensorflow.compat.v2.enable_v2_behavior",
"tensorflow.compat.v2.math.cos",
"tensorflow.compat.v2.TensorSpec",
"tensorflow.compat.v2.math.log",
"tensorflow.compat.... |
StevenHuang2020/PyTorch_Learning | [
"292508f6794cfb23e0767139c1c703b9525cdb35",
"292508f6794cfb23e0767139c1c703b9525cdb35"
] | [
"src/genDataset.py",
"src/regression2_opt.py"
] | [
"\"\"\"\nSteven 20/03/2020\ngenerate dataset\n\"\"\"\n#python3 steven\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\ngSavePath=r'./db/'\n\ndef noise(len):\n return np.random.rand(len)\n \ndef appendComment(file,comment,mode='a'):\n with open(file, mode) as f:\n f.write(... | [
[
"numpy.max",
"numpy.random.rand",
"pandas.DataFrame",
"numpy.random.randn",
"numpy.min",
"numpy.mean",
"numpy.where",
"numpy.hstack",
"numpy.linspace",
"numpy.around"
],
[
"matplotlib.pyplot.cla",
"matplotlib.pyplot.subplots"
]
] |
harispoljo/simglucose | [
"59f2fa11926516e7247d08c8fa8e4c88d367895c"
] | [
"simglucose/envs/simglucose_gym_env.py"
] | [
"from simglucose.simulation.env import T1DSimEnv as _T1DSimEnv\nfrom simglucose.patient.t1dpatient import T1DPatient\nfrom simglucose.sensor.cgm import CGMSensor\nfrom simglucose.actuator.pump import InsulinPump\nfrom simglucose.simulation.scenario_gen import RandomScenario\nfrom simglucose.controller.base import A... | [
[
"pandas.read_csv"
]
] |
leoMurtha/Titanic-ML-from-Disaster | [
"c5d3e1e065094bca9628fa219e8a18f9102ad65d"
] | [
"titanic.py"
] | [
"# Importing essential libraries\nimport numpy as np # Math lib\nimport matplotlib.pyplot as plt # Plot lib\nimport pandas as pd # Manage Data lib\n\n# Importing dataset\ndataset = pd.read_csv('train.csv')\ncols = list(dataset.columns.values)\ncols.pop(cols.index('Survived'))\ncols = cols + ['Survived']\ndataset = ... | [
[
"pandas.read_csv"
]
] |
loopylangur/geomstats | [
"431011b6b55dddffdbc5c23d962181af9a6bd88a"
] | [
"examples/plot_kmeans_poincare_disk.py"
] | [
"\"\"\"\nPlot a square on H2 with Poincare Disk visualization\nwith two clusters from uniformly sampled random points.\nThen apply the K-means algorithm and plot the points labels\nas two distinct colors.\n\"\"\"\nimport os\n\nimport matplotlib.pyplot as plt\n\nimport geomstats.backend as gs\nimport geomstats.visua... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.gca"
]
] |
geo-fluid-dynamics/modular_extendable_snowmodel | [
"56334bce17651fd19a07401e01116a315393fa5a"
] | [
"Model/model_geometry.py"
] | [
"import numpy as np\r\n\r\nfrom model.constant_variables import Z_field, Z_lab\r\n\r\n\r\ndef set_up_model_geometry(geom=\"FieldScale0.5m\"):\r\n \"\"\"\r\n Set-up model geometry \r\n Arguments\r\n ------------------------------\r\n geom Flag for geometry of choice\r\n\r\n Results\r\n --... | [
[
"numpy.array",
"numpy.linspace",
"numpy.zeros"
]
] |
mkashifn/celosia | [
"2caa776620b9e7c3f63c41329f10c8c91fb4857f"
] | [
"src/functions.py"
] | [
"#!/bin/python\nimport numpy as np\n\nclass Function:\n def __init__(self):\n pass\n def __call__(self, x):\n return self.fx(x)\n def fx(self, x):\n return x\n\n def dfx(self, x):\n return np.zeros(x.shape)\n\nclass Logistic(Function):\n def __init__(self):\n pass\n\n def fx(self, x):\n retu... | [
[
"numpy.max",
"numpy.diagflat",
"numpy.dot",
"numpy.zeros",
"numpy.sum",
"numpy.exp"
]
] |
sefira/Paddle | [
"d7bd0361cb36587c07f1edf973672fd24e67e720"
] | [
"python/paddle/fluid/tests/unittests/test_density_prior_box_op.py"
] | [
"# Copyright (c) 2018 PaddlePaddle 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 re... | [
[
"numpy.array",
"numpy.zeros",
"numpy.tile",
"numpy.clip",
"numpy.random.random"
]
] |
pospielov/Linear-Algebra-in-Python-and-Java-Research | [
"833f22b510c65ec5059543e093e140b033173bda"
] | [
"python-module/tf_test.py"
] | [
"import numpy as np\nimport tensorflow as tf\nimport timeit\n\nembeddings = np.genfromtxt(\"embeddings.txt\", delimiter=',')\n\n\ndef test():\n embeddings1 = embeddings[0:1]\n embeddings2 = embeddings[1:10001]\n\n # embeddings1 = tf.divide(embeddings1, tf.norm(embeddings1, axis=1, keepdims=True))\n # em... | [
[
"tensorflow.subtract",
"numpy.genfromtxt",
"tensorflow.reduce_max",
"tensorflow.math.l2_normalize",
"tensorflow.square"
]
] |
raymondw99/SI1336 | [
"a88a0347f4f80b702146d24a91c378a21774d7e2"
] | [
"Project 4/10.10b.py"
] | [
"\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib import animation\nfrom scipy.optimize import curve_fit\nfrom pylab import cm as plcm # colors for plotting\nimport pickle # for storing calculations and reading again while editing plot details\n\nplt.rcPara... | [
[
"matplotlib.pyplot.rcParams.update",
"scipy.optimize.curve_fit",
"numpy.zeros",
"numpy.log",
"matplotlib.pyplot.xlabel",
"numpy.copy",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel"... |
BarakGahtan/5GRIE | [
"10db5d3f556ff06fe8248149f3967ea020149859"
] | [
"Main.py"
] | [
"import copy\nimport math\nimport os\n\nimport networkx as nx\nimport numpy as np\nimport torch\nfrom loguru import logger\n\nfrom Baseline_Benchmark.greedy_baseline import greedy_baseline\nfrom Environment.Env import NetworkEnv\nfrom Environment.Interfernce_Model.Interference_Maker import Interference\nfrom Enviro... | [
[
"tensorflow.summary.create_file_writer",
"numpy.full",
"torch.cuda.is_available",
"numpy.fill_diagonal"
]
] |
HemaZ/pyroomacoustics | [
"c401f829c71ff03a947f68f9b6b2f48346ae84b2"
] | [
"pyroomacoustics/datasets/base.py"
] | [
"'''\nBase class for some data corpus and the samples it contains.\n'''\n\nfrom itertools import islice\n\ndef _take(n, iterable):\n \"Return first n items of the iterable as a list\"\n return list(islice(iterable, n))\n\nclass Meta(object):\n '''\n A simple class that will take a dictionary as input\n ... | [
[
"numpy.ceil",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.specgram",
"numpy.sqrt",
"matplotlib.pyplot.ylabel"
]
] |
abhishekunique/RND-ashwin | [
"f8bcf3c593df2dacc0efba0875533be71ccb5011"
] | [
"softlearning/samplers/classifier_sampler.py"
] | [
"from .simple_sampler import SimpleSampler\nimport numpy as np\n\nclass ClassifierSampler(SimpleSampler):\n def __init__(self, algorithm=None, **kwargs):\n super().__init__(**kwargs)\n\n if algorithm:\n assert hasattr(algorithm, 'get_reward'), (\n 'Must implement `get_rewa... | [
[
"numpy.asscalar"
]
] |
Reiningecho90/personal-automation | [
"47b5f968e48586e771956602e6b09a93db41197e"
] | [
"easy-access/sane-ai/sane-ai-ceo-edition.py"
] | [
"# Working on: EOL Reached.\n# Finished: FINAL RELEASE v2.0\n\n# Update Description: Finishes up all features. Everything will be completed after 2.0 gets released. This will be the last update to S.A.N.E.\n\n# Future Ideas: NEOL Reached.\n\n# Imports\nfrom tkinter.constants import END\nimport speech_recognition as... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
YeongHyeon/Enhancementing-Method-for-STEMI-Detection | [
"dc19b72e9f45067d74d21da5db562ca642e10ae9"
] | [
"CNN/source/datamanager.py"
] | [
"import os, inspect, glob, random, shutil\nimport numpy as np\n\nPACK_PATH = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))+\"/..\"\n\nclass DataSet(object):\n\n def __init__(self, setname, tr_ratio=0.9):\n\n self.data_path = os.path.join(PACK_PATH, \"..\", setname)\n sel... | [
[
"numpy.zeros",
"numpy.load",
"numpy.eye",
"numpy.append",
"numpy.expand_dims"
]
] |
MatthewTe/research_site | [
"cec4b09823488effdc4b249716b52530484a49c8"
] | [
"research_site/research_core/views.py"
] | [
"# Importing default django methods:\nfrom django.shortcuts import render, redirect\nfrom django.db.models import Count\nfrom django.core.paginator import Paginator\nfrom django.db.models.functions import TruncDay\nfrom django.http import HttpResponseRedirect\n\n# Importing plotly methods:\nimport plotly.graph_objs... | [
[
"numpy.cumsum",
"numpy.ones",
"pandas.Series"
]
] |
vkrit/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers | [
"f2960cce80af399b8d3302d7893334698ff213fc"
] | [
"ExamplesFromChapters/Chapter1/SMS_behaviour.py"
] | [
"import pymc as pm\nimport numpy as np\n\ncount_data = np.loadtxt(\"../../Chapter1_Introduction/data/txtdata.csv\")\nn_count_data = len(count_data)\n\nalpha = 1.0/count_data.mean() #recall count_data is \n #the variable that holds our txt counts\n \nlambda_1... | [
[
"numpy.loadtxt",
"numpy.zeros"
]
] |
DueapeCommon/kaggle | [
"78009876853d2536be895097c289ac35c748beba"
] | [
"solutions/kaggle-allstate-claims-severity/nn_bagging_1111.84364.py"
] | [
"\n''' \nAuthor: Danijel Kivaranovic \nTitle: Neural network (Keras) with sparse data\n'''\n\n## import libraries\nimport numpy as np\nnp.random.seed(123)\n\nimport pandas as pd\nimport subprocess\nfrom scipy.sparse import csr_matrix, hstack\nfrom sklearn.metrics import mean_absolute_error\nfrom sklearn.preprocessi... | [
[
"numpy.ceil",
"numpy.log",
"sklearn.preprocessing.StandardScaler",
"numpy.random.seed",
"scipy.sparse.hstack",
"numpy.zeros",
"pandas.DataFrame",
"numpy.exp",
"numpy.random.shuffle",
"numpy.arange",
"pandas.concat",
"sklearn.model_selection.KFold",
"pandas.read_... |
jeremy43/FCIS | [
"0ed234c14d064b615d6c2553edca24031b8c7c84"
] | [
"lib/segmentation/segmentation.py"
] | [
"\"\"\"\r\nSegmentation:\r\ndata =\r\n {'data': [num_images, c, h, w],\r\n 'im_info': [num_images, 4] (optional)}\r\nlabel =\r\n {'label': [batch_size, 1] <- [batch_size, c, h, w]}\r\n\"\"\"\r\n\r\nimport numpy as np\r\nfrom utils.image import get_segmentation_image, tensor_vstack\r\n\r\ndef get_segmentat... | [
[
"numpy.array"
]
] |
AstroHiro/NCM | [
"720db63ec018a1986ac9e370613f8209328b89e1"
] | [
"classncm.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nMIT License\n\nCopyright (c) 2020 Hiroyasu Tsukamoto https://hirotsukamoto.com/\n\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 Softwar... | [
[
"numpy.set_printoptions",
"numpy.load",
"tensorflow.keras.layers.Dense",
"numpy.size",
"tensorflow.keras.models.Sequential",
"numpy.linalg.norm",
"numpy.empty",
"numpy.save",
"matplotlib.pyplot.subplots",
"numpy.sqrt",
"numpy.linalg.cholesky",
"matplotlib.pyplot.sub... |
CaoYuchen/16726 | [
"06ab1263de89056a6a4b20e79a8f089bbbd0cda2"
] | [
"a3/utils.py"
] | [
"# CMU 16-726 Learning-Based Image Synthesis / Spring 2022, Assignment 3\n# The code base is based on the great work from CSC 321, U Toronto\n# https://www.cs.toronto.edu/~rgrosse/courses/csc321_2018/assignments/a4-code.zip\n\nimport os\nimport torch\n\n\ndef to_var(x):\n \"\"\"Converts numpy to variable.\"\"\"\... | [
[
"torch.cuda.is_available"
]
] |
oyiadin/STM | [
"8501f4e5632b204c833c6c93e21deaad25b91b01"
] | [
"main.py"
] | [
"import argparse\nimport datetime\nimport os\nimport time\nimport shutil\nimport torch\nimport torchvision\nimport torch.nn.parallel\nimport torch.backends.cudnn as cudnn\nimport torch.optim\nfrom torch.nn.utils import clip_grad_norm\nfrom torch.utils.tensorboard import SummaryWriter\n\nfrom dataset import TSNDataS... | [
[
"torch.autograd.Variable",
"torch.save",
"torch.optim.SGD",
"torch.no_grad",
"torch.nn.CrossEntropyLoss",
"torch.cuda.empty_cache",
"torch.load",
"torch.utils.tensorboard.SummaryWriter",
"torch.nn.DataParallel"
]
] |
WraySmith/log-anomaly | [
"1b93cfed9ab0947c2a921a889d2a58b2b8a0831b"
] | [
"process/project_processor.py"
] | [
"\"\"\"\nloads the semi-structured drain data, and processes it for the CNN\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nimport time\nfrom sliding_window_processor import collect_event_ids, FeatureExtractor\n\nif __name__ == \"__main__\":\n\n data_version = \"_v5\"\n\n data_version = \"_tf-idf{}\".form... | [
[
"numpy.intersect1d"
]
] |
RavidHausmann/Rabbits_Lab | [
"633ac4150f8760ddaac4c1f519ecd2973458a7dc"
] | [
"physics.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jan 17 12:15:41 2020\n\n@author: thausmann\n\"\"\"\n\n\nimport numpy as np\nfrom matplotlib import pyplot as plt\nfrom matplotlib import animation\n\n\nclass Particle():\n pos = []\n vel = []\n walls = []\n def __init__(self, posit... | [
[
"numpy.array",
"numpy.dot",
"numpy.linalg.norm",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"numpy.sqrt",
"matplotlib.pyplot.show",
"matplotlib.pyplot.axes"
]
] |
NCAR/ldc-tools | [
"55e65c7757da6236abee3c6a7663b8dd24ff25b9"
] | [
"ldcpy/util.py"
] | [
"import collections\nimport csv\nimport os\n\nimport cf_xarray as cf\nimport dask\nimport numpy as np\nimport xarray as xr\n\nfrom .calcs import Datasetcalcs, Diffcalcs\n\n\ndef collect_datasets(data_type, varnames, list_of_ds, labels, **kwargs):\n \"\"\"\n Concatonate several different xarray datasets across... | [
[
"numpy.square",
"numpy.isnan",
"pandas.DataFrame.from_dict",
"numpy.min",
"numpy.unique"
]
] |
SharperJBCA/COMAPreduce | [
"6722c2f59b4968c24b81be4a0f4b12955e270d2b",
"6722c2f59b4968c24b81be4a0f4b12955e270d2b"
] | [
"comancpipeline/Tools/Coordinates.py",
"comancpipeline/Analysis/SourceFitting.py"
] | [
"from comancpipeline.Tools import pysla\nimport numpy as np\nimport healpy as hp\n\n# List of sources used for calibration\n# Ephem objects have None, calculated on the fly\nCalibratorList = {\n 'TauA': [(5 + 34./60. + 31.94/60.**2)*15, 22 + 0 + 52.2/60.**2],\n 'CasA': [(23 + 23./60. + 24./60.**2)*15, 58 + 48... | [
[
"numpy.array",
"numpy.arccos",
"numpy.sin",
"numpy.sum",
"numpy.interp",
"numpy.mean",
"numpy.abs",
"numpy.cos",
"numpy.mod",
"numpy.floor"
],
[
"numpy.median",
"numpy.exp",
"numpy.min",
"numpy.mean",
"numpy.gradient",
"numpy.max",
"numpy.his... |
fuxiAIlab/RL4RS | [
"e26ee5d068eaffd0f04779067614e34e313b1200"
] | [
"rl4rs/server/gymHttpServer.py"
] | [
"import os\nos.environ['CUDA_VISIBLE_DEVICES'] = '-1'\nfrom flask import Flask, request, jsonify\nimport uuid\nimport gym\nimport numpy as np\nimport six\nimport argparse\nimport sys\nimport json\nfrom rl4rs.env.slate import SlateRecEnv, SlateState\nfrom rl4rs.env.seqslate import SeqSlateRecEnv, SeqSlateState\nimpo... | [
[
"numpy.array",
"numpy.isscalar"
]
] |
spyrosviz/Parkinson-Prediction | [
"2ca38bffc37262a555c4e13ba6dedba35115f51f"
] | [
"Scrape_Preprocessing/DFA.py"
] | [
"import numpy as np\nfrom sklearn.linear_model import LinearRegression\nfrom scipy import signal\n\n'''Detrended Fluctuation Analysis'''\n\ndef DFA (lista,min_box_size,max_box_size,show=False):\n lista = np.array(lista)\n cumsum = np.cumsum(lista-np.mean(lista))\n RMS = []\n\n\n '''# mean centered cumul... | [
[
"numpy.array",
"sklearn.linear_model.LinearRegression",
"scipy.signal.detrend",
"numpy.mean",
"numpy.log2"
]
] |
jim-schwoebel/voiceome | [
"9af84a8568a7a0630992ec56be03521ff9547c68"
] | [
"scripts/cleaning/bnt_tasks.py"
] | [
"import os, shutil\r\nimport pandas as pd \r\nfrom tqdm import tqdm\r\n\r\n# read csv document \r\ng=pd.read_csv('new2.csv')\r\nlabels=list(g)\r\n\r\ncurdir=os.getcwd()\r\ntry:\r\n\tos.mkdir('bnt_images')\r\nexcept:\r\n\tshutil.rmtree('bnt_images')\r\n\tos.mkdir('bnt_images')\r\n\r\nbnt_tasks=list()\r\nbnt_dict=dic... | [
[
"pandas.read_csv"
]
] |
dichen-cd/kornia | [
"dcd1c5e17cf4d2ae2db1f438c53245bba0afd93f"
] | [
"kornia/augmentation/_2d/geometric/thin_plate_spline.py"
] | [
"from typing import Dict, Optional\n\nimport torch\n\nfrom kornia.augmentation._2d.geometric.base import GeometricAugmentationBase2D\nfrom kornia.geometry.transform import get_tps_transform, warp_image_tps\n\n\nclass RandomThinPlateSpline(GeometricAugmentationBase2D):\n r\"\"\"Add random noise to the Thin Plate ... | [
[
"torch.distributions.Uniform",
"torch.tensor"
]
] |
TheScienceMuseum/heritage-connector-demos | [
"f595953c5a96b9a307f056c97f33684f09beaab9"
] | [
"1_event_streamlit/app.py"
] | [
"# external\nimport streamlit as st\nimport pandas as pd\n\n# internal\nimport streamlit_utils\nimport config\n\ndef main():\n st.set_page_config(page_title=\"Heritage Connector Demo\")\n st.markdown(streamlit_utils.load_image(\"header_cropped.png\"), unsafe_allow_html=True)\n st.title(\"Heritage Connector... | [
[
"pandas.read_pickle",
"pandas.isnull"
]
] |
csxeba/Verres | [
"04230d22b7791f84d86b9eb2272a6314a27580ed"
] | [
"verres/architecture/backbone/small.py"
] | [
"import tensorflow as tf\nfrom tensorflow.keras import layers as tfl\n\nimport verres as V\nfrom . import FeatureSpec, VRSBackbone\n\n\nclass SmallFCNN(VRSBackbone):\n\n def __init__(self, config: V.Config):\n\n strides = config.model.backbone_spec[\"strides\"]\n width_base = config.model.backbone_... | [
[
"tensorflow.keras.layers.Conv2D",
"tensorflow.keras.layers.MaxPool2D",
"tensorflow.cast"
]
] |
Bidur-Khanal/REMIND | [
"2e82ca75a3e4d4ccba00c5a763097cc0f650a0a4"
] | [
"vqa_experiments/vqa_models.py"
] | [
"\"\"\"\nWritten by Kushal, modified by Robik\n\"\"\"\nimport numpy as np\nimport torch\nimport torch.nn as nn\nfrom torch.nn.utils.rnn import pack_padded_sequence\n\nfrom vqa_experiments.rnn import RNN\n\n\n# TODO: Test with and without weight norm\n\nclass WordEmbedding(nn.Module):\n \"\"\"Word Embedding\n ... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.init.kaiming_uniform_",
"torch.cat",
"torch.nn.LSTM",
"torch.nn.ModuleList",
"torch.flatten",
"numpy.load",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.BatchNorm1d",
"torch.nn.utils.rnn.pack_padded_sequence",
"t... |
dukebw/torchcv | [
"6101e209a709899c5645342784c8f451028ff46e"
] | [
"torchcv/models/retinanet/net.py"
] | [
"import torch\nimport torch.nn as nn\n\nfrom .fpn import FPN50\n\n\nclass RetinaNet(nn.Module):\n num_anchors = 9\n\n def __init__(self, num_classes):\n super(RetinaNet, self).__init__()\n self.fpn = FPN50()\n self.num_classes = num_classes\n self.loc_head = self._make_head(self.nu... | [
[
"torch.cat",
"torch.nn.Sequential",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.randn"
]
] |
zzeng13/DISC | [
"7542fcd67dfbea448c0cfa76ac34353ae6ab171d"
] | [
"demo_helper/data_processor.py"
] | [
"from itertools import islice\nimport torch\nfrom torch.utils import data as torch_data\nfrom torch.nn.utils.rnn import pad_sequence\nfrom src.utils.file_util import load_json_file\nfrom src.model.embedding_layers import EmbeddingGeneratorGLOVE\nfrom transformers import BertTokenizerFast\nfrom nltk.tokenize import ... | [
[
"torch.nn.utils.rnn.pad_sequence",
"torch.Tensor",
"torch.vstack"
]
] |
aja9675/pytorch-unet | [
"0ed4868f219e59dfd396c13ea5546c63666b5140"
] | [
"train_bees.py"
] | [
"#!/usr/bin/env python3\n\nimport sys\nimport os\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport helper\nimport glob\nfrom skimage import io, transform\nimport torch\nfrom torch.utils.data import Dataset, DataLoader\nfrom torchvision import transforms, datasets, models\nimport torchvision.utils\nfrom c... | [
[
"torch.nn.functional.binary_cross_entropy_with_logits",
"torch.sigmoid",
"torch.optim.lr_scheduler.StepLR",
"torch.stack",
"torch.utils.data.random_split",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.set_grad_enabled"
]
] |
MD2Korg/CerebralCortex-Kernel | [
"206e9419fecf587ad1eb69a2e2c605db5ee3eb05"
] | [
"cerebralcortex/algorithms/stats/features.py"
] | [
"# Copyright (c) 2020, MD2K Center of Excellence\n# - Nasir Ali <nasir.ali08@gmail.com>\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# * Redistributions of source code must retain t... | [
[
"numpy.sign",
"numpy.mean",
"pandas.concat"
]
] |
gopala-kr/ds-notebooks | [
"bc35430ecdd851f2ceab8f2437eec4d77cb59423"
] | [
"Kaggle-Competitions/CrowdFlower/scripts/helper.py"
] | [
"import numpy as np\nimport pandas as pd\nfrom nltk.stem import PorterStemmer\nfrom nltk.stem.wordnet import WordNetLemmatizer\nimport re\nfrom HTMLParser import HTMLParser\nfrom sklearn.cross_validation import StratifiedShuffleSplit\nfrom bs4 import BeautifulSoup\nfrom collections import Counter\nimport difflib\nf... | [
[
"sklearn.cross_validation.StratifiedShuffleSplit",
"numpy.array",
"pandas.DataFrame",
"sklearn.metrics.make_scorer",
"pandas.read_csv"
]
] |
mdtraj/tftraj | [
"f3715c1efc7a2ad5ea6821a445c17c1220cc381f"
] | [
"tests/test_rmsd_deriv.py"
] | [
"import mdtraj as md\nimport numpy as np\nimport tensorflow as tf\n\nimport tftraj.rmsd\nimport tftraj.rmsd_op\n\n\ndef test_works(sess, traj):\n rmsd = tftraj.rmsd_op.load()\n inds = [5, 19, 234, 235]\n target = np.array(traj.xyz[inds])\n target = tf.Variable(target)\n prmsd, _ = rmsd.pairwise_msd(t... | [
[
"numpy.array",
"numpy.testing.assert_almost_equal",
"tensorflow.Variable",
"tensorflow.gradients",
"tensorflow.constant",
"numpy.arange",
"tensorflow.global_variables_initializer"
]
] |
lqx19981012/tensorflow | [
"de36b1aac74c7594ab6c3a40331a7e258a3ed5ee"
] | [
"tensorflow/python/keras/layers/preprocessing/categorical_test.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.python.framework.tensor_shape.TensorShape",
"tensorflow.python.keras.keras_parameterized.run_all_keras_modes",
"tensorflow.python.ops.math_ops.not_equal",
"numpy.asarray",
"tensorflow.python.platform.test.test_src_dir_path",
"tensorflow.python.ops.array_ops.gather_nd_v2",
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.