repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
csortu/drugMLPytorch | [
"7ea6ef8c46dc3027a7ebd21836b7b12c23659db8"
] | [
"splitData.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Dec 13 13:32:14 2019\n\n@author: ortutay\n\"\"\"\n\nimport pandas as pd \nimport numpy as np\n\nlink = 'http://bit.ly/uforeports'\nufo = pd.read_csv(link)\n\n# We split 60-20-20% tran-validation-test sets\n\ntrain, validate, test = np.split(uf... | [
[
"numpy.arange",
"pandas.read_csv"
]
] |
tobikuhlmann/Conditional_Density_Estimation | [
"5e64fca31e0f8aafac43cfca7a37f70edb4d90fe"
] | [
"cde/density_estimator/MDN.py"
] | [
"import numpy as np\nimport sklearn\nimport tensorflow as tf\nimport edward as ed\nfrom edward.models import Categorical, Mixture, MultivariateNormalDiag\nfrom cde.utils.tf_utils.network import MLP\nimport cde.utils.tf_utils.layers as L\nfrom cde.utils.tf_utils.layers_powered import LayersPowered\nfrom cde.utils.se... | [
[
"tensorflow.unstack",
"tensorflow.zeros_like",
"tensorflow.variable_scope",
"tensorflow.reduce_prod",
"tensorflow.log",
"tensorflow.set_random_seed",
"numpy.random.RandomState",
"tensorflow.losses.add_loss"
]
] |
jmdearman/code_triage | [
"67626b40429365370b5bec11efa29b7ee8a1983e"
] | [
"code_triage.py"
] | [
"#!/usr/bin/env python2\nfrom __future__ import division, print_function\nimport collections\nimport os\nimport numpy as np\nimport h5py\n\nheader_text = \"\"\"\nINTRO TO ANTIPATTERNS IN SCIENTIFIC COMPUTING PART I: CODE TRIAGE\n-----------------------------------------------------------------\n\nInstructions to fo... | [
[
"numpy.random.RandomState"
]
] |
Aquaveo/tethysext-atcore | [
"7a83ccea24fdbbe806f12154f938554dd6c8015f"
] | [
"tethysext/atcore/tests/integrated_tests/controllers/resource_workflows/results_views/plot_workflow_results_view_tests.py"
] | [
"from unittest import mock\nimport pandas as pd\nfrom tethysext.atcore.controllers.resource_workflows.results_views.plot_workflow_results_view import PlotWorkflowResultView # noqa: E501\nfrom tethysext.atcore.tests.utilities.sqlalchemy_helpers import SqlAlchemyTestCase\nfrom tethysext.atcore.tests.utilities.sqlalc... | [
[
"numpy.arange",
"numpy.array",
"pandas.DataFrame"
]
] |
oawiles/habitat-api | [
"b6a08dac1b9e92e6ad0d66d75cf9cee0ee1ebaef"
] | [
"habitat_baselines/slambased/mappers.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\n\nfrom habitat_baselines.slambased.reprojection import (\n get_map_size_in_cells,\n project2d_pcl_into_worldmap,\n reproject_local_to_global,\n)\n\n\ndef depth2local3d(depth, fx, fy, cx, cy):\n r\"\"\"Projects depth map to 3d point cloud\n wit... | [
[
"torch.abs",
"torch.linspace",
"torch.cat",
"torch.zeros",
"torch.eye",
"torch.from_numpy",
"torch.device",
"torch.meshgrid"
]
] |
Wonseok-Oh/gym_hiprlgrid | [
"7a67ef8f3f6cf50062be76e909bfc6ac6de568c9"
] | [
"gym_minigrid/envs/multi_hiprlgrid_short_pose.py"
] | [
"from gym_minigrid.minigrid import *\nfrom gym_minigrid.register import register\nfrom gym_minigrid.envs.empty import EmptyEnv\nimport numpy as np\nfrom SpatialMap import SpatialMap, ObjectMap, BinaryMap, BinaryMap_MLP, ObjectMap_MLP\nimport rospy\nfrom std_srvs.srv import Empty\nfrom rosplan_dispatch_msgs.srv impo... | [
[
"numpy.array_equal",
"numpy.reshape",
"numpy.ones",
"numpy.append",
"numpy.array",
"numpy.zeros"
]
] |
aleccrowell/covid | [
"1ee264d64ac81cf1f8a2bbcf24832541e1b7574d"
] | [
"covid/covidtracking.py"
] | [
"import numpy as np\nimport pandas as pd\nimport itertools\nimport cachetools.func\n\nimport requests\nimport io\n\n@cachetools.func.ttl_cache(ttl=3600)\ndef load_us():\n s=requests.get('https://covidtracking.com/api/states/daily.csv',verify=False).content\n df = pd.read_csv(io.StringIO(s.decode('utf-8')))\n ... | [
[
"pandas.to_datetime"
]
] |
lcreyes/PULearningSelfTutorial | [
"a9a34da83033ca5205871a9c4e2fda4db650d4ef"
] | [
"kNNClassification.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn import neighbors\nfrom matplotlib.colors import ListedColormap\n\n#define constants\n\nn_l = 500 #number of labeled positive points\nn_p = 500 #number of positive points\nn_n = 1000 # number of negative points\n\n#define Gaussians mean and covarianc... | [
[
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.scatter",
"numpy.linspace",
"numpy.random.multivariate_normal",
"sklearn.neighbors.KNeighborsClassifier",
"matplotlib.colors.ListedColormap",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.pcolormesh",
"matplotlib.pyplot.xticks",
... |
dipesg/Face-Mask-Detector | [
"81ef0f52752f8f1034a35c932289fe62a6787a93"
] | [
"src/detect_and_predict_mask.py"
] | [
"from tensorflow.keras.applications.mobilenet_v2 import preprocess_input\nfrom tensorflow.keras.preprocessing.image import img_to_array\nimport numpy as np\nimport cv2\nfrom src import logger\n\nclass Mask:\n def __init__(self):\n self.log_writer = logger.App_Logger()\n self.file_object = open(\"..... | [
[
"tensorflow.keras.applications.mobilenet_v2.preprocess_input",
"numpy.array",
"tensorflow.keras.preprocessing.image.img_to_array"
]
] |
viktorvesely/Agent01 | [
"b5a16e68dd97e8a75db7699af336650f5a863138"
] | [
"src/DQN.py"
] | [
"import model as md\nimport numpy as np\nimport tensorflow as tf\n\nclass DQN:\n def __init__(self,\n num_states,\n num_actions,\n hidden_units,\n gamma,\n max_experiences,\n min_experiences,\n batch_size\n ):\n self.num_actions = num_actions\n self.batch_size = batch_size\n... | [
[
"numpy.random.random",
"numpy.random.choice",
"numpy.asarray",
"tensorflow.keras.losses.MeanSquaredError",
"tensorflow.keras.optimizers.RMSprop",
"numpy.atleast_2d",
"tensorflow.one_hot",
"tensorflow.square",
"numpy.where",
"tensorflow.GradientTape"
]
] |
chenw23/open_lth | [
"2ce732fe48abd5a80c10a153c45d397b048e980c"
] | [
"training/test/test_train.py"
] | [
"# 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 numpy as np\n\nimport datasets.registry\nfrom foundations.step import Step\nimport models.registry\nfrom training import train... | [
[
"numpy.round",
"numpy.array_equal"
]
] |
sternarubra/powerlawnoise | [
"4e03aae66a8379b4b755a39b9cf0df2c1b85c0d4"
] | [
"pypowerlawnoise/pypowerlawnoise/tests/test_power_law_noise.py"
] | [
"# Copyright (C) 2020 by Landmark Acoustics LLC\n\nimport pytest\n\nimport numpy as np\n\nfrom pypowerlawnoise import PowerLawNoise\n\nALPHAS = [-2, -1, 0, 1, 2]\nCOLOR_NAMES = ['red', 'pink', 'white', 'blue', 'violet']\nN = 5\nEQUIS = np.linspace(1, 0, N, dtype=float)\n\n\ndef pytest_generate_tests(metafunc):\n ... | [
[
"numpy.linspace"
]
] |
markomanninen/picoDAQ | [
"a07be1c9018577b1b5671fd3a184148a4fac337b"
] | [
"picodaqa/animHists.py"
] | [
"# -*- coding: utf-8 -*-\nfrom __future__ import division\nfrom __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport time, numpy as np\nimport matplotlib.pyplot as plt\nimport itertools\n\nclass animHists(object):\n ''' display histogram, as no... | [
[
"numpy.sqrt",
"numpy.linspace",
"matplotlib.pyplot.subplots",
"numpy.ones",
"numpy.zeros",
"numpy.sum"
]
] |
blues-lin/Char-level-CNN-for-Chinese-Text-Classification-in-Keras | [
"81c7cdec48d4b17640e4c5465a4a412e338a7e62"
] | [
"lib/vector_generator.py"
] | [
"\"\"\" Generate vector. \"\"\"\nimport os.path\nimport random\nimport numpy as np\nfrom lib import Vectorizer\n\nBASE_PATH = os.path.dirname(os.path.realpath(__file__))\nCHAR_PATH = os.path.join(BASE_PATH, 'data/charTable.txt')\nLABEL_PATH = os.path.join(BASE_PATH, 'data/label.txt')\n\n\nclass VectGenerator:\n ... | [
[
"numpy.array"
]
] |
oom-debugger/GraphZoo-1 | [
"7ef1184c0016090597e56b8706a87539a3f62fd6"
] | [
"graphzoo/models/base_models.py"
] | [
"\"\"\"\nBase model class\n\"\"\"\nimport numpy as np\nfrom sklearn.metrics import roc_auc_score, average_precision_score\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom graphzoo.layers.layers import FermiDiracDecoder\nfrom graphzoo import manifolds\nimport graphzoo.models.encoders as en... | [
[
"sklearn.metrics.roc_auc_score",
"torch.nn.functional.log_softmax",
"torch.nn.functional.nll_loss",
"torch.Tensor",
"torch.cat",
"torch.zeros_like",
"torch.tensor",
"sklearn.metrics.average_precision_score",
"torch.ones_like",
"numpy.random.randint"
]
] |
valterlej/CustomBMT | [
"c9326752d1355c81f845f2caab9c047be76067de"
] | [
"model/proposal_generator.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom model.encoders import BiModalEncoder, Encoder\nfrom utilities.proposal_utils import add_dict_to_another_dict, select_topk_predictions, tiou_vectorized\n\nfrom model.blocks import Transpose, FeatureEmbedder, Identity, PositionalEncoder\n\n... | [
[
"torch.nn.Sequential",
"torch.sigmoid",
"torch.nn.Dropout",
"torch.ones",
"torch.cat",
"torch.load",
"torch.zeros_like",
"torch.arange",
"torch.tensor",
"torch.nn.BCELoss",
"torch.exp",
"torch.nn.LayerNorm",
"torch.nn.init.xavier_uniform_",
"torch.nn.Conv1d"... |
thusithaC/QGforQA | [
"81beed7122abbf9a62745af8ab7d6d4d4bf52c73"
] | [
"LIB/bert/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.cluster_resolver.TPUClusterResolver",
"tensorflow.metrics.accuracy",
"tensorflow.FixedLenFeature",
"tensorflow.nn.log_softmax",
"tensorflow.reduce_sum",
"tensorflow.gfile.GFile",
"tensorflow.cast",
"tensorflow.train.init_from_checkpoint",
"tensorflow.gfile.M... |
amjal/Smart-Irrigation-using-Reinforcement-Learning | [
"efa8c8adf42cdeaab77e1107a02015a62bb38f04"
] | [
"ElementaryRLAgent.py"
] | [
"import numpy\nimport random\nimport math\nimport copy\nimport requests\nimport time\n\n# TODO use heuristic in pick_random action\n\n\nclass Action:\n def __init__(self, intensity):\n self.intensity = int(intensity)\n\n def __eq__(self, other):\n return self.intensity == other.intensity\n\n ... | [
[
"numpy.round",
"numpy.mean"
]
] |
june6723/sumo-rl-offset | [
"775cddc8d168fb7c4959610a96a791d746fa0afd"
] | [
"experiments/DDPG_offset.py"
] | [
"import argparse\nimport os\nimport sys\nif 'SUMO_HOME' in os.environ:\n tools = os.path.join(os.environ['SUMO_HOME'], 'tools')\n sys.path.append(tools)\nelse:\n sys.exit(\"Please declare the environment variable 'SUMO_HOME'\")\nimport pandas as pd\nimport ray\nfrom ray.rllib.agents.ddpg.ddpg import DDPGTr... | [
[
"numpy.array",
"numpy.zeros"
]
] |
eliberis/tensorpack | [
"f6313a070bca9bff0e6a2760a395b6b2ab7c4a3d"
] | [
"examples/FasterRCNN/data.py"
] | [
"# -*- coding: utf-8 -*-\n# File: data.py\n\nimport copy\nimport itertools\nimport numpy as np\nimport cv2\nfrom tabulate import tabulate\nfrom termcolor import colored\n\nfrom tensorpack.dataflow import (\n DataFromList, MapData, MapDataComponent, MultiProcessMapDataZMQ, MultiThreadMapData,\n TestDataSpeed, ... | [
[
"numpy.amax",
"numpy.histogram",
"numpy.asarray",
"numpy.arange",
"numpy.ones",
"numpy.concatenate",
"numpy.ceil",
"numpy.copy",
"numpy.where",
"numpy.prod",
"numpy.array",
"numpy.meshgrid",
"numpy.zeros",
"numpy.sum",
"numpy.vstack"
]
] |
luochuankai-JHU/ndmg | [
"1307cc4dbaf84e33d61b13a6f83f9bcc4e5cfad6"
] | [
"ndmg/utils/gen_utils.py"
] | [
"# !/usr/bin/env python\n\n# Copyright 2016 NeuroData (http://neurodata.io)\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... | [
[
"numpy.unique",
"numpy.squeeze",
"numpy.zeros_like",
"numpy.savetxt",
"numpy.load",
"numpy.logical_and",
"numpy.where",
"numpy.loadtxt",
"scipy.sparse.lil_matrix"
]
] |
AngusGLChen/qg | [
"3ebc5b94348a4c313829a6c71705fbc9dadd8181"
] | [
"process/triviaqa.py"
] | [
"'''\nCreated on Sep 11, 2017\n\n@author: Angus\n'''\n\nimport sys\nreload(sys) \nsys.setdefaultencoding('utf8')\n\nimport numpy\nimport matplotlib.pyplot as plt;\nplt.rcdefaults()\n\nfrom nltk.tokenize import sent_tokenize\n\ndef plot(array):\n n, bins, patches = plt.hist(array) \n plt.show()\n\ndef anal... | [
[
"matplotlib.pyplot.rcdefaults",
"matplotlib.pyplot.show",
"matplotlib.pyplot.hist",
"numpy.average"
]
] |
Mrutyu-1/malaria-liver-detection | [
"23506faff252ee34c1d0acc4163ebf6b200ce2bf"
] | [
"app.py"
] | [
"#Important Modules\nfrom flask import Flask,render_template, url_for ,flash , redirect\n#from forms import RegistrationForm, LoginForm\n#from sklearn.externals import joblib\nimport joblib\nfrom flask import request\nimport numpy as np\nimport tensorflow\n#from keras.layers import Conv2D, MaxPooling2D, Dense, Drop... | [
[
"tensorflow.keras.models.load_model",
"numpy.expand_dims",
"tensorflow.keras.preprocessing.image.load_img",
"numpy.argmax",
"numpy.array"
]
] |
CristiFati/rknn-toolkit | [
"a345d99be30c1ca84f56dd68a213c740450eeaa5"
] | [
"examples/pytorch/resnet18/test.py"
] | [
"import numpy as np\nimport cv2\nfrom rknn.api import RKNN\nimport torchvision.models as models\nimport torch\n\n\ndef export_pytorch_model():\n net = models.resnet18(pretrained=True)\n net.eval()\n trace_model = torch.jit.trace(net, torch.Tensor(1,3,224,224))\n trace_model.save('./resnet18.pt')\n\n\nde... | [
[
"numpy.array",
"numpy.exp",
"numpy.where",
"torch.Tensor"
]
] |
SpearOfBayes/text_cnn_wiki | [
"4296ddb4c589a4caf3213dfde8a8142ee6a9e1ed"
] | [
"data_helpers.py"
] | [
"import numpy as np\nimport re\nimport jieba\nimport jieba.analyse\nfrom encode_table import labels\nfrom tqdm import *\n\nlabel_dic = {}\n\ndef clean_str(string):\n \"\"\"\n Tokenization/string cleaning for all datasets except for SST.\n Original taken from https://github.com/yoonkim/CNN_sentence/blob/mas... | [
[
"numpy.arange",
"numpy.array"
]
] |
andrjas/data_check | [
"12ba740fcf54261bed15f909290649e8350474da"
] | [
"test/database/test_load_file.py"
] | [
"from pathlib import Path\nimport pytest\nimport pandas as pd\nfrom pandas.testing import assert_frame_equal\nfrom sqlalchemy import Table, Column, String, Integer, MetaData, Date, Numeric, DateTime\nimport datetime\n\n\nfrom data_check import DataCheck # noqa E402\nfrom data_check.config import DataCheckConfig #... | [
[
"pandas.testing.assert_frame_equal",
"pandas.DataFrame.from_dict"
]
] |
MarcelRG/semanai | [
"08a1ceb9f24b361fc155bf18526325aaf6769798"
] | [
"Dia1/numpy2.py"
] | [
"import streamlit as st\nimport pandas as pd\nimport numpy as np\nimport time\nimport uber_display\nfrom scipy import stats\n\n\"# Numpy and Pandas Tutorial\"\n\"### Semana i 2019\"\n\"Made in Streamlit\"\n\nif st.checkbox('Show Uber Data'):\n st.subheader('Uber data data')\n uber_display.main()\n\n\"\"\"# Nu... | [
[
"numpy.arange",
"numpy.linalg.norm",
"numpy.genfromtxt",
"scipy.stats.mode",
"numpy.array"
]
] |
cambridge-mlg/expressiveness-approx-bnns | [
"1d63a8671581bf388f1a84d0daf48990ebecb1e1"
] | [
"inbetween/NNKernel.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport gpflow\nfrom gpflow.base import Parameter\nfrom gpflow.utilities import positive\n\n\nclass ReLUKernel(gpflow.kernels.Kernel):\n \"\"\"\n Kernel such that the mean 0 GP with the corresponding covariance function is equal in distribution\n to an infinitel... | [
[
"tensorflow.matmul",
"tensorflow.sin",
"tensorflow.cos",
"numpy.ones",
"tensorflow.square",
"tensorflow.sqrt",
"tensorflow.acos"
]
] |
webbfontaine/fasttext-tensorflow | [
"fab3f3341862b4582d398939c7604752ba744902"
] | [
"fasttext_model.py"
] | [
"import inspect\nimport json\nimport os\nimport warnings\nfrom subprocess import (\n Popen,\n PIPE,\n STDOUT,\n)\n\nimport numpy as np\nimport pandas as pd\nfrom tqdm import tqdm\nimport tensorflow as tf\nimport tensorflow.compat.v1.logging as logging\n\nfrom utils import (\n load_graph,\n hash_,\n ... | [
[
"tensorflow.Graph",
"tensorflow.device",
"numpy.unique",
"numpy.squeeze",
"numpy.in1d",
"tensorflow.compat.v1.logging.set_verbosity",
"tensorflow.ConfigProto",
"tensorflow.reset_default_graph",
"numpy.zeros_like",
"tensorflow.GPUOptions",
"tensorflow.Session",
"nump... |
TanmayeeGujar/CP1_Calculus | [
"1a2c545299ac5fc355ba7f56b1ddc21fb81785a5"
] | [
"UtilityFunctions/integrals.py"
] | [
"import numpy as np\n\n\ndef simpson(f, a, b, n):\n \"\"\"Approximates the definite integral of f from a to b by\n the composite Simpson's rule, using n subintervals.\n From http://en.wikipedia.org/wiki/Simpson's_rule\n \n Args:\n f : function to integrate\n a,b : boundaries\n n : number... | [
[
"numpy.arange"
]
] |
ilivans/spaCy | [
"9ce059dd067ecc3f097d04023e3cfa0d70d35bb8"
] | [
"spacy/tests/doc/test_token_api.py"
] | [
"# coding: utf-8\nfrom __future__ import unicode_literals\n\nimport pytest\nimport numpy\nfrom spacy.attrs import IS_ALPHA, IS_DIGIT, IS_LOWER, IS_PUNCT, IS_TITLE, IS_STOP\nfrom spacy.symbols import VERB\nfrom spacy.vocab import Vocab\nfrom spacy.tokens import Doc\n\nfrom ..util import get_doc\n\n\n@pytest.fixture\... | [
[
"numpy.asarray"
]
] |
neurospin/pySnpImpute | [
"133db33a43c9eb01b2538cb3f4e2f146d7e7a532"
] | [
"pysnpimpute/utils.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"\nA set of common utility functions.\n\"\"\"\n\nimport os\nimport subprocess\nimport time\nimport argparse\nimport logging\nimport json\nimport glob\n\nfrom collections import OrderedDict\n\nimport numpy\nimport pandas\nimport pysnpimpute\n\nfrom pysnpimpute import (POSITIONS_OF_X_... | [
[
"numpy.asarray",
"pandas.read_csv"
]
] |
Danderson123/snip-public | [
"e464ffed8b76a102ae485ab12b44f0f3b5314ce4"
] | [
"snip/network.py"
] | [
"import tensorflow as tf\n\nfrom functools import reduce\nfrom helpers import static_size\n\n\ndef load_network(\n datasource, arch, num_classes,\n initializer_w_bp, initializer_b_bp, initializer_w_ap, initializer_b_ap,\n ):\n networks = {\n 'lenet300': lambda: LeNet300(\n ... | [
[
"tensorflow.nn.relu",
"tensorflow.get_variable",
"tensorflow.matmul",
"tensorflow.layers.batch_normalization",
"tensorflow.nn.max_pool",
"tensorflow.zeros_initializer",
"tensorflow.placeholder",
"tensorflow.variance_scaling_initializer",
"tensorflow.variable_scope",
"tensor... |
JGoutin/skio | [
"6c6e433232eca7371b0e9d94b8a75354dae7adab"
] | [
"skio/group.py"
] | [
"\"\"\"'Group' dict-like class definition\"\"\"\n# TODO:\n# - Find how show parameters and doc-strings for .set()/.get().\n# - Orderable Group.\n# - Autocomplete __doc__ with _doc, _dtype, ... information for subclasses.\n# - Add unit information support with optional support of \"pint\" package.\n# store data in... | [
[
"numpy.array"
]
] |
PeterouZh/pytorch-lightning | [
"6e32d00c8ca723c766ab6ff94adad1854bd89576"
] | [
"pytorch_lightning/examples/new_project_templates/multi_node_cluster_template.py"
] | [
"import os\nimport sys\nimport numpy as np\nfrom time import sleep\nimport torch\n\nfrom test_tube import HyperOptArgumentParser, Experiment, SlurmCluster\nfrom pytorch_lightning.models.trainer import Trainer\nfrom pytorch_lightning.utils.arg_parse import add_default_args\n\nfrom pytorch_lightning.callbacks import ... | [
[
"torch.manual_seed",
"numpy.random.seed"
]
] |
sujay-vittal/color-identification-cot-purdur | [
"1959ceb4d1965743dab4cf3b72bdc76ae4e76255"
] | [
"src/color_recognition_api/color_histogram_feature_extraction.py"
] | [
"#!/usr/bin/python\n\nfrom PIL import Image\nimport os\nimport cv2\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy.stats import itemfreq\nfrom color_recognition_api import knn_classifier as knn_classifier\n\n\ndef color_histogram_of_test_image(test_src_image):\n\n # load the image\n image = t... | [
[
"numpy.argmax"
]
] |
kajyuuen/pytorch-partial-crf | [
"bb368346544cb6241e425a8b4e1a3baee324ef0d"
] | [
"pytorch_partial_crf/crf.py"
] | [
"from typing import Optional\n\nimport torch\n\nfrom pytorch_partial_crf.base_crf import BaseCRF\nfrom pytorch_partial_crf.utils import log_sum_exp\n\nclass CRF(BaseCRF):\n \"\"\"Conditional random field.\n \"\"\"\n def __init__(self, num_tags: int, padding_idx: int = None) -> None:\n super().__init... | [
[
"torch.sum",
"torch.ones_like"
]
] |
junfengwen/DARN | [
"585fc99b9ed23b7c0835a2d47713016cf6333260"
] | [
"load_data.py"
] | [
"import os\n\nimport numpy as np\nfrom scipy.sparse import coo_matrix\n\n\ndef load_numpy_data(name,\n data_path,\n logger):\n\n if name == \"amazon\":\n\n data_names = [\"books\", \"dvd\", \"electronics\", \"kitchen\"]\n input_dim = 5000 # Number of features ... | [
[
"scipy.sparse.coo_matrix",
"numpy.random.choice",
"numpy.arange",
"numpy.squeeze",
"numpy.random.shuffle",
"numpy.load"
]
] |
ialab-puc/pytorch-segmentation-toolbox | [
"cc52d5ff7a41bae1f47ebe76b2908a84723fda93"
] | [
"predict.py"
] | [
"import argparse\nimport scipy\nfrom scipy import ndimage\nimport cv2\nimport numpy as np\nimport sys\nimport json\n\nimport torch\n\nfrom torch.autograd import Variable\nimport torchvision.models as models\nimport torch.nn.functional as F\nimport torch.backends.cudnn as cudnn\nfrom torch.utils import data\nimport ... | [
[
"numpy.array",
"torch.no_grad",
"numpy.argmax",
"torch.cuda.is_available"
]
] |
brandondong/osu-beatmap-generator | [
"7ca14793ef6a48a65cfd1a564f3b24d940a6051a"
] | [
"osu/models/models_util.py"
] | [
"from enum import Enum\nimport os\nimport pickle\n\nimport numpy as np\n\nTRAINING_METADATA_PATH = \"training_data/metadata/\"\n\nMODEL_SAVE_PATH = \"models/weights/\"\n\nclass MetadataPredictor(Enum):\n\tCS = \"cs\"\n\tDRAIN = \"drain\"\n\tACCURACY = \"accuracy\"\n\tAR = \"ar\"\n\ndef load_metadata_dataset():\n\t\... | [
[
"numpy.zeros"
]
] |
ercan-akar/chessboard-recognizer | [
"8ce2e782a400d2e5fb8c492442b0989741e996b3"
] | [
"recognize.py"
] | [
"#!/usr/bin/env python3\n\nimport sys\nfrom glob import glob\nfrom io import BytesIO\nfrom functools import reduce\nimport os\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'\n\nimport tensorflow as tf\nfrom tensorflow.keras import models\nimport numpy as np\n\nfrom constants import (\n TILES_DIR, NN_MODEL_PATH, FEN_CH... | [
[
"tensorflow.keras.models.load_model",
"numpy.reshape",
"tensorflow.image.resize",
"tensorflow.image.convert_image_dtype",
"numpy.array"
]
] |
yonip97/non-parametric-transformers | [
"f748b898a47b6dbd1ad1aa9aee9fc5b200e23030"
] | [
"npt/utils/cv_utils.py"
] | [
"\"\"\"Cross-validation utils.\"\"\"\n\nfrom collections import Counter\nfrom enum import IntEnum\n\nimport numpy as np\nfrom sklearn.model_selection import StratifiedKFold, train_test_split, KFold\n\n\nclass DatasetMode(IntEnum):\n \"\"\"Used in batching.\"\"\"\n TRAIN = 0\n VAL = 1\n TEST = 2\n\n\nDAT... | [
[
"numpy.arange",
"sklearn.preprocessing.LabelEncoder",
"sklearn.model_selection.train_test_split"
]
] |
cuihaoleo/exercises | [
"401dc2f19b6474e84e357a79a53754684fc93784"
] | [
"Schoolworks/ArtificialIntelligence/julei.py"
] | [
"from types import SimpleNamespace\nfrom collections import Counter\nimport numpy as np\nimport pandas as pd\nfrom pandas.tools.plotting import andrews_curves, radviz, parallel_coordinates\nimport matplotlib.pyplot as plt\nimport argparse\nfrom sklearn.decomposition import PCA\nfrom sklearn.cluster import KMeans\nf... | [
[
"scipy.cluster.vq.kmeans2",
"numpy.maximum",
"sklearn.cluster.KMeans",
"matplotlib.pyplot.subplots",
"pandas.DataFrame",
"numpy.linalg.norm",
"numpy.copy",
"scipy.spatial.distance.pdist",
"numpy.delete",
"numpy.fill_diagonal",
"numpy.array",
"matplotlib.pyplot.show"... |
tienln4/PaddleOCR-1 | [
"786448503b3f23140798bdecde19e985027257b2"
] | [
"tools/infer/utility.py"
] | [
"# Copyright (c) 2020 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.rot90",
"numpy.linalg.norm",
"numpy.ones",
"numpy.concatenate",
"numpy.max",
"numpy.fromstring",
"numpy.float32",
"numpy.array"
]
] |
zhouwubai/CarND-Term3 | [
"096f11903ba15fac2cf1dd26984d20a672c8360c"
] | [
"lectures/TrajectoryGenerator/helpers.py"
] | [
"from math import sqrt, exp\nfrom matplotlib import pyplot as plt\n\n\nclass Vehicle(object):\n \"\"\"\n Helper class. Non-ego vehicles move w/ constant acceleration\n \"\"\"\n def __init__(self, start):\n self.start_state = start\n\n def state_in(self, t):\n s = self.start_state[:3]\n ... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.scatter"
]
] |
flaxandteal/tablespy | [
"4918e7673802d15373b324ec719179f8565717e7"
] | [
"tests/test_locode.py"
] | [
"import pytest\nimport pandas as pd\nfrom tablespy.inspector import Inspector\n\nBLANK_COLS = 500\nBLANK_ROWS = 500\n\n\n@pytest.fixture\ndef blank_data():\n return [\n [''] * BLANK_COLS\n ] * BLANK_ROWS\n\n@pytest.fixture\ndef basic_df(blank_data):\n df = pd.DataFrame(blank_data)\n df.iloc[3, 11... | [
[
"pandas.DataFrame"
]
] |
demmojo/ResampleAndInterpolate | [
"c7730cf42b6dd55cb5cef331885d9adeae91c500"
] | [
"ResampleAndInterpolate.py"
] | [
"# Copyright 2019 Blok-Z\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 to i... | [
[
"pandas.ExcelWriter",
"pandas.ExcelFile",
"pandas.date_range"
]
] |
ishine/AttEncDecRNN | [
"d64e3e294cd8ccfc1118b8e607955019a61e0628"
] | [
"model.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom beam import Beam\n\n\nclass EncoderRNN(nn.Module):\n \"\"\"\"encode the input sequence with Bi-GRU\"\"\"\n\n def __init__(self, num_input, num_hidden, num_token, padding_idx, emb_dropout, hid_dropout):\n super(EncoderRNN, sel... | [
[
"torch.nn.Dropout",
"torch.nn.functional.softmax",
"torch.cat",
"torch.nn.GRU",
"torch.nn.utils.rnn.pack_padded_sequence",
"torch.nn.Embedding",
"torch.tanh",
"torch.nn.Linear",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.sort",
"torch.nn.GRUCell"
]
] |
Pandinosaurus/pyts | [
"1e584877bc3f06194ceb530a156d8a10e32c12a5"
] | [
"pyts/datasets/tests/test_make.py"
] | [
"\"\"\"Testing for datatset generation.\"\"\"\n\n# Author: Johann Faouzi <johann.faouzi@gmail.com>\n# License: BSD-3-Clause\n\nimport numpy as np\nimport pytest\nimport re\nfrom pyts.datasets import make_cylinder_bell_funnel\n\n\n@pytest.mark.parametrize(\n 'params, error, err_msg',\n [({'n_samples': '3'}, Ty... | [
[
"numpy.array_equal",
"numpy.arange",
"numpy.testing.assert_array_equal",
"numpy.bincount",
"numpy.array"
]
] |
GitPrakhar112/dsmp-pre-work | [
"6056e5d4b3c6efc84d0f14b57a595528f4e30fe5"
] | [
"Probability-of-the-Loan-Defaulters/code.py"
] | [
"# --------------\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n# Load the dataframe\ndf = pd.read_csv(path)\n\n# probability of fico score greater than 700\n\np_a = df[df['fico'].astype(float) >700].shape[0]/df.shape[0]\nprint(p_a)\n\n\n# probability of purpose == debt_consolidation... | [
[
"pandas.read_csv",
"matplotlib.pyplot.axvline",
"matplotlib.pyplot.title",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
flo-maier/c3 | [
"6bfd72d49fbe47c33038a73436f51f4e454f5ccb",
"6bfd72d49fbe47c33038a73436f51f4e454f5ccb"
] | [
"c3/optimizers/optimizer.py",
"c3/generator/devices.py"
] | [
"\"\"\"Optimizer object, where the optimal control is done.\"\"\"\n\nimport os\nimport time\nfrom typing import Callable, Union\nimport numpy as np\nimport tensorflow as tf\nimport json\nimport c3.libraries.algorithms as algorithms\nfrom c3.experiment import Experiment\n\n\nclass Optimizer:\n \"\"\"\n General... | [
[
"numpy.imag",
"tensorflow.constant",
"numpy.isnan",
"numpy.real",
"numpy.isinf",
"tensorflow.GradientTape"
],
[
"tensorflow.concat",
"tensorflow.zeros",
"tensorflow.reduce_sum",
"tensorflow.cast",
"tensorflow.linspace",
"tensorflow.add_n",
"numpy.random.rand... |
darthsuogles/mc-cnn | [
"f2c8aa67391ab9fbdae1102afbd1cb20f634d02c"
] | [
"preprocess_mb.py"
] | [
"#! /usr/bin/env python2\n# wget -r -np -A png,pfm,pgm,txt http://vision.middlebury.edu/stereo/data/scenes2014/datasets/\n# wget -r -np -A png,pfm,pgm,txt http://vision.middlebury.edu/stereo/data/scenes2006/FullSize/\n\nimport os\nimport re\nimport sys\nimport subprocess\n\nimport numpy as np\nimport cv2\n\ndef loa... | [
[
"numpy.fromfile",
"numpy.nonzero",
"numpy.reshape",
"numpy.arange",
"numpy.flipud",
"numpy.sort",
"numpy.concatenate",
"numpy.zeros_like",
"numpy.array",
"numpy.zeros",
"numpy.vstack"
]
] |
lawrennd/ods | [
"16b5b577cfa6bbae52afac29f14083eadc963687"
] | [
"pods/mocap.py"
] | [
"# Copyright 2014 Open Data Science Initiative and other authors. See AUTHORS.txt\n# Licensed under the BSD 3-clause license (see LICENSE.txt)\n\nimport os\nimport sys\nimport numpy as np\nimport math\n\n\nclass vertex:\n def __init__(self, name, id, parents=[], children=[], meta={}):\n self.name = name\n... | [
[
"numpy.dot",
"numpy.linalg.inv",
"numpy.isnan",
"numpy.eye",
"numpy.uint",
"numpy.ones",
"numpy.concatenate",
"numpy.array",
"numpy.zeros",
"numpy.loadtxt"
]
] |
1asso/TOM-Net | [
"ba13bd3f1bac0fa50c6043290691d7be5c29f777"
] | [
"train.py"
] | [
"import torch\nimport utility\nimport logging\nimport os\nimport torch.nn as nn\nfrom torch import Tensor\nfrom typing import Type, Any, Callable, Union, List, Optional\nfrom torch.utils.data import DataLoader\nfrom models import CoarseNet, RefineNet\nfrom argparse import Namespace\nfrom checkpoint import CheckPoin... | [
[
"torch.abs",
"torch.norm",
"torch.max",
"torch.autograd.set_detect_anomaly",
"torch.load",
"torch.min",
"torch.sum",
"torch.cuda.empty_cache",
"torch.cuda.FloatTensor",
"torch.nn.functional.mse_loss",
"torch.mul",
"torch.no_grad",
"torch.nn.functional.interpolat... |
l11x0m7/insuranceQA_zh | [
"0ccad4416be5683145de944db309922c78bfa209"
] | [
"data.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n#===============================================================================\n#\n# Copyright (c) 2017 Hai Liang Wang<hailiang.hl.wang@gmail.com> All Rights Reserved\n#\n#\n# File: /Users/hain/ai/InsuranceQA-Machine-Learning/deep_qa_1/network.py\n# Author: Hai Lia... | [
[
"numpy.argmax"
]
] |
masguit42/pytorch | [
"d1cbee7b2b1da94ff1a0fa880bd0173de27fb89f"
] | [
"torch/testing/_internal/common_methods_invocations.py"
] | [
"from functools import wraps, partial\nfrom itertools import product, chain\nimport itertools\nimport collections\nimport copy\nimport operator\nimport random\nimport numbers\n\nimport torch\nimport numpy as np\nfrom torch._six import inf\nimport collections.abc\n\nfrom typing import List, Sequence, Tuple, Union\n\... | [
[
"torch.testing._internal.common_utils.random_symmetric_pd_matrix",
"numpy.amax",
"torch.testing._internal.common_utils.random_symmetric_matrix",
"torch.randint",
"torch.lu_unpack",
"numpy.sqrt",
"torch.zeros",
"torch.randperm",
"torch.testing.all_types_and",
"numpy.asarray"... |
uabeysinghe/tensorflow | [
"c3ecdfa4f186d43c061a508d5f891e082ceb6640"
] | [
"tensorflow/lite/python/lite.py"
] | [
"# Lint as: python2, python3\n# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/... | [
[
"tensorflow.lite.python.util.populate_conversion_metadata",
"tensorflow.lite.python.util.model_input_signature",
"tensorflow.lite.python.conversion_metadata_schema_py_generated.ConversionOptionsT",
"tensorflow.python.platform.gfile.GFile",
"tensorflow.python.framework.convert_to_constants.conv... |
msychung/FUSE-2020 | [
"222225b9e18519e999e56b376895fcd407d5cfba"
] | [
"analysis/Distance.py"
] | [
"import BioLogic\nimport pandas as pd \nimport numpy as np \nimport glob\nimport os.path \nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as ticker\nfrom numpy import matlib\n\n'''\nUses the \"Distance\" method to find nucleation overpotential i.e. finds the point furthest away from a line drawn between ... | [
[
"numpy.matlib.repmat",
"matplotlib.pyplot.axhline",
"matplotlib.pyplot.title",
"numpy.gradient",
"pandas.DataFrame",
"matplotlib.pyplot.ylabel",
"numpy.argmax",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.... |
Kevin0624/HarDNeXt | [
"32cd7959af260fd7ede9514547907e187fb647a8"
] | [
"src/main.py"
] | [
"import argparse\nimport os\nimport random\nimport shutil\nimport time\nimport warnings\nimport sys\nimport numpy as np\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel\nimport torch.backends.cudnn as cudnn\nimport torch.distributed as dist\nimport torch.optim\nimport torch.multiprocessing as mp\nim... | [
[
"torch.nn.CrossEntropyLoss",
"torch.distributed.init_process_group",
"torch.multiprocessing.spawn",
"torch.utils.data.distributed.DistributedSampler",
"torch.cuda.set_device",
"torch.manual_seed",
"torch.load",
"torch.utils.data.DataLoader",
"numpy.cos",
"torch.nn.DataParal... |
tsunekoromochi/ssd | [
"0a081b957e90a8edd85c1ba7d96556ce929f9628"
] | [
"get_data_from_XML.py"
] | [
"import numpy as np\nimport os\nfrom xml.etree import ElementTree\n\nclass XML_preprocessor(object):\n\n def __init__(self, data_path):\n self.path_prefix = data_path\n self.num_classes = 2\n self.data = dict()\n self._preprocess_XML()\n\n def _preprocess_XML(self):\n filena... | [
[
"numpy.asarray",
"numpy.hstack"
]
] |
Terminator-Creators/CS434_Assignment4 | [
"736228191af71fdf0e8e6c892cd517cbd3d1bac5"
] | [
"pa4_starter/src/decompose.py"
] | [
"import numpy as np\nimport copy\n\n\nclass PCA():\n \"\"\"\n PCA. A class to reduce dimensions\n \"\"\"\n\n def __init__(self, retain_ratio):\n \"\"\"\n\n :param retain_ratio: percentage of the variance we maitain (see slide for definition)\n \"\"\"\n self.retain_ratio = ret... | [
[
"numpy.asarray",
"numpy.linalg.eig",
"numpy.matmul",
"numpy.real",
"numpy.cov"
]
] |
newlikehalo/pytroch-ctpn-Retina | [
"5c80fa1c91fa55cd6e45490a51385cab3b3343b6"
] | [
"predict.py"
] | [
"# -*- coding:utf-8 -*-\n# '''\n# Created on 18-12-11 上午10:03\n#\n# @Author: Greg Gao(laygin)\n# '''\nimport os\n\nos.environ['CUDA_VISIBLE_DEVICES'] = ''\nimport cv2\nimport numpy as np\nimport glob\nimport torch\nimport torch.nn.functional as F\nfrom ctpn_model import CTPN_Model\nfrom ctpn_utils import gen_anchor... | [
[
"numpy.hstack",
"torch.nn.functional.softmax",
"torch.load",
"torch.no_grad",
"torch.cuda.is_available",
"numpy.where"
]
] |
MichalPitr/transformers | [
"8b26688e2e4b68a64f4710b3627439089947cb08"
] | [
"src/transformers/models/distilbert/modeling_distilbert.py"
] | [
"# coding=utf-8\n# Copyright 2019-present, the HuggingFace Inc. team, The Google AI Language Team and Facebook, 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:/... | [
[
"torch.nn.Softmax",
"torch.nn.Dropout",
"torch.nn.CrossEntropyLoss",
"torch.ones",
"numpy.power",
"numpy.cos",
"torch.nn.Embedding",
"torch.nn.LayerNorm",
"numpy.sin",
"torch.nn.Linear",
"torch.matmul",
"torch.nn.BCEWithLogitsLoss",
"torch.tensor",
"torch.ar... |
arjunbhagoji/network-data-sharing | [
"05a4965758e3a0de312fed27becba3eabf0cb8f0"
] | [
"utils/data.py"
] | [
"import numpy as np\nimport pandas as pd\n\ndef data_cleanup(X,y):\n inf_indices=np.where(X==np.inf)\n nan_indices=np.where(X!=X)\n mask = np.ones(len(X), dtype=bool)\n mask[np.union1d(inf_indices[0],nan_indices[0])] = False\n X_mod=X[mask,:]\n y_mod=y[mask]\n return X_mod,y_mod\n\ndef read_dat... | [
[
"pandas.isna",
"pandas.read_csv",
"numpy.where",
"numpy.union1d"
]
] |
kehannan/mlcourse | [
"e51b16ac1feaeb732a211b837746b70fc2fcee7b"
] | [
"homework_working/hw7-backprop/code/test_utils.py"
] | [
"\"\"\"Computation graph test utilities\n\nBelow are functions that can assist in testing the implementation of backward\nfor individual nodes, as well as the gradient computation in a\nComputationGraphFunction. The approach is to use the secant approximation to\ncompute the gradient numerically, and this is then c... | [
[
"numpy.nditer",
"numpy.abs",
"numpy.random.standard_normal",
"numpy.copy",
"numpy.zeros",
"numpy.sum"
]
] |
jonandergomez/teaa_lab | [
"a5acf38b683b1d6feb1ff7e12dddfbc6352baf5e"
] | [
"portal.dsic/examples/python/KNN_Classifier.py"
] | [
"\"\"\"\n Author: Jon Ander Gomez Adrian (jon@dsic.upv.es, http://personales.upv.es/jon)\n Version: 1.0\n Date: October 2021\n Universitat Politecnica de Valencia\n Technical University of Valencia TU.VLC\n\n\"\"\"\n\nimport sys\nimport time\nimport math\nimport numpy\n\ntry:\n from pyspark.rdd im... | [
[
"numpy.array",
"numpy.zeros"
]
] |
deibraz-free/dsp_effects | [
"1ca1f1f400ea276755ede54d0b2d2a5d12cf61b7"
] | [
"main.py"
] | [
"'''\n\tCreated by Deividas Brazauskas 2020\n\n\t# Read in WAV file into Python Class\n\tsound1 = AudioProcessing('input.wav')\n\n\t# Set the speed of the audio\n\tsound1.set_audio_speed(0.5)\n\n\t# Set the pitch of the audio\n\tsound1.set_audio_pitch(2)\n\n\t# Reverse the content of the audio\n\tsound1.set_reverse... | [
[
"scipy.signal.filtfilt",
"numpy.abs",
"numpy.fft.fft",
"scipy.signal.butter",
"numpy.hanning",
"numpy.exp",
"numpy.angle",
"numpy.array",
"numpy.zeros",
"scipy.io.wavfile.read"
]
] |
KshitijKarthick/animewreck | [
"494ac6ae3eb21c6c7641a51e368dc72b5d1279c5"
] | [
"server/constants.py"
] | [
"import torch\n\ndevice = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\nrandom_seed = 42\n\nnum_genres = 44\nmin_slice = 6\nmax_slice = 11\npast_anime_length = 10\nnum_users, num_anime = (108711, 6668)\ntrain_frac = 0.8\nencoded_values_for_rating = 11\nbatch_size = 512\nnum_workers_dataloader = ... | [
[
"torch.cuda.is_available"
]
] |
Sin-tel/spheremesh | [
"c9a8e14a8dbf2d8e6e1cf46eaae8b25492cd36ea"
] | [
"example_remesh.py"
] | [
"import spheremesh as sh\nimport igl\nimport numpy as np\n\nfilename = \"data/cell.obj\"\nl_max = 20\n\norig_v, faces = igl.read_triangle_mesh(filename)\n\n\nsphere_verts = sh.conformal_flow(orig_v, faces)\nsphere_verts = sh.mobius_center(orig_v,sphere_verts,faces)\n\norig_v, sphere_verts = sh.canonical_rotation(or... | [
[
"numpy.arctan2",
"numpy.arccos",
"numpy.vstack"
]
] |
CameronKing/sympy | [
"3295b02c617a10ea8db0a070356cc0ba5a3b5121"
] | [
"sympy/core/sympify.py"
] | [
"\"\"\"sympify -- convert objects SymPy internal format\"\"\"\n\nfrom __future__ import print_function, division\n\nfrom inspect import getmro\n\nfrom .core import all_classes as sympy_classes\nfrom .compatibility import iterable, string_types, range\nfrom .evaluate import global_evaluate\n\n\nclass SympifyError(Va... | [
[
"numpy.asarray",
"numpy.finfo",
"numpy.size",
"numpy.isscalar",
"numpy.iscomplex"
]
] |
diptanshumittal/FCO-ICML21 | [
"4a9f4456cb7e1c3a0646c9b91a0926ba87fc6a48"
] | [
"optimization/bin_lr/federated_bin_lr.py"
] | [
"# Copyright 2021, 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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agree... | [
[
"tensorflow.keras.metrics.BinaryAccuracy"
]
] |
prolon-control-systems/dtu-smartlib-sensor-pi | [
"143f1d00cc0adadbdd0dc6ef3df3eaa0d27a7a68"
] | [
"Python/grovepi.py"
] | [
"#!/usr/bin/env python\n#\n# GrovePi Python library\n# v1.2.2\n#\n# This file provides the basic functions for using the GrovePi\n#\n# The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterindustries.com/GrovePi\n#\n# Have a question about this example? ... | [
[
"numpy.std",
"numpy.mean"
]
] |
CnybTseng/YOLACT | [
"e8564b9f961dc99c740a58efc199243233c8cbfe"
] | [
"core/layers/segmentation.py"
] | [
"import torch\r\nimport torch.nn.functional as F\r\n\r\nclass MaskProducer(object):\r\n def __init__(self, interpolation_mode='bilinear', crop_mask=True, score_thresh=0):\r\n self.interpolation_mode = interpolation_mode\r\n self.crop_mask = crop_mask\r\n self.score_thresh = score_thresh\r\n ... | [
[
"torch.sigmoid",
"torch.max",
"torch.min",
"torch.nn.functional.interpolate",
"torch.arange",
"torch.stack",
"torch.clamp"
]
] |
HannaCun/GoogleNet_Deploy | [
"4db38e97682b3982f2ca8db55b60ed32ef3ea2a5"
] | [
"examples/simple/test.py"
] | [
"# Copyright 2020 Lorna Authors. All Rights Reserved.\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required b... | [
[
"torch.topk",
"torch.softmax",
"torch.no_grad",
"torch.cuda.is_available"
]
] |
numericalalgorithmsgroup/pypop | [
"b8d0756f10bfb8db1466a2691c45ef9ed7c77194"
] | [
"pypop/prv.py"
] | [
"#!/usr/bin/env python\n# SPDX-License-Identifier: BSD-3-Clause-Clear\n# Copyright (c) 2019, The Numerical Algorithms Group, Ltd. All rights reserved.\n\n\"\"\"\\\nPRV Trace Loader\n----------------\n\nSupport for directly loading PRV trace data as Pandas dataframes\n\"\"\"\n\nimport pandas\nimport numpy\n\nfrom ha... | [
[
"pandas.IntervalIndex.from_arrays",
"pandas.concat",
"pandas.read_csv",
"pandas.Series",
"numpy.asarray",
"numpy.full",
"numpy.zeros_like",
"numpy.any",
"numpy.diff",
"numpy.average",
"numpy.sum"
]
] |
MC-Zealot/transformer | [
"581409b815326b21f303afafadae27f67e3b6e69"
] | [
"train.py"
] | [
"# -*- coding: utf-8 -*-\n#/usr/bin/python3\n'''\nFeb. 2019 by kyubyong park.\nkbpark.linguist@gmail.com.\nhttps://www.github.com/kyubyong/transformer\n'''\nimport tensorflow as tf\n\nfrom model import Transformer\nfrom tqdm import tqdm\nfrom data_load import get_batch\nfrom utils import save_hparams, save_variable... | [
[
"tensorflow.train.latest_checkpoint",
"tensorflow.summary.FileWriter",
"tensorflow.ConfigProto",
"tensorflow.global_variables_initializer",
"tensorflow.data.Iterator.from_structure",
"tensorflow.Session",
"tensorflow.train.Saver"
]
] |
nicoring/RoBonjwa | [
"7b42265a42c389964ddf3ff535dbfb9370863ac5"
] | [
"roborl/ddpg/ddpg.py"
] | [
"import os\nimport pickle\n\nimport numpy as np\nimport torch\nimport torch.optim as optim\nfrom torch.autograd import Variable\nfrom tensorboardX import SummaryWriter\n\n\nfrom roborl.util.memory import ReplayMemory\nfrom roborl.util.exploration import ActionNoiseExploration, ParamNoiseExploration\n\n\nuse_cuda = ... | [
[
"torch.mean",
"torch.load",
"torch.from_numpy",
"numpy.mean",
"torch.cuda.is_available",
"numpy.random.uniform",
"numpy.array"
]
] |
NolanMP/statsmodels | [
"ca6b652188be2422061052f7e61dd7bf2da03d52"
] | [
"statsmodels/regression/linear_model.py"
] | [
"# TODO: Determine which tests are valid for GLSAR, and under what conditions\n# TODO: Fix issue with constant and GLS\n# TODO: GLS: add options Iterative GLS, for iterative fgls if sigma is None\n# TODO: GLS: default if sigma is none should be two-step GLS\n# TODO: Check nesting when performing model based tests, ... | [
[
"numpy.diag",
"numpy.dot",
"numpy.sqrt",
"numpy.einsum",
"numpy.linalg.matrix_rank",
"numpy.asarray",
"numpy.all",
"scipy.optimize.fmin",
"numpy.mean",
"numpy.any",
"scipy.stats.f.sf",
"numpy.fill_diagonal",
"scipy.optimize.fmin_powell",
"numpy.linalg.qr",
... |
hgl71964/dagbo | [
"de198650268baee324bc495899e34531d10369e2"
] | [
"tests/dag_unittest.py"
] | [
"import os\nimport sys\nimport math\nimport warnings\nimport logging\nimport unittest\nimport torch\nimport numpy as np\nimport pandas as pd\nfrom torch import Size, Tensor\nfrom sklearn.metrics import mean_squared_error\nfrom sklearn.preprocessing import StandardScaler, MinMaxScaler\n\nimport gpytorch\nfrom gpytor... | [
[
"torch.cos",
"torch.linspace",
"torch.Size",
"numpy.log",
"numpy.random.seed",
"torch.cat",
"torch.sin",
"torch.manual_seed",
"torch.from_numpy",
"numpy.cos",
"torch.tensor",
"sklearn.metrics.mean_squared_error",
"numpy.sin",
"torch.log",
"torch.no_grad"... |
santacml/Malware-as-Video | [
"12dc3954f2237cb34857a44eadbb5ca76f8e97b5"
] | [
"libraries/createVectorizedAssembly.py"
] | [
"from assemblyVectorizor import Vectorizor\nfrom postVectorizeDataEditor import *\nimport csv\nimport random\nimport numpy as np\n \n# helper functions\n \ndef runThroughGenerator(gen, steps):\n for x in range(0, int(steps)):\n train_x, train_y = next(gen)\n print(\"done gen\", x)\n \n... | [
[
"numpy.asarray"
]
] |
lakshika1064/covid19-prediction-using-SIR-model | [
"91c7445807e678dfb15c24056b5b7af40ca00afc"
] | [
"COVID19--ZEPL.py"
] | [
"conn = z.getDatasource(\"snowflake_CP99894apsouth1aws_faa2e8\")\n\nimport pandas as pd\nimport numpy as np\nfrom datetime import datetime, timedelta\nimport requests\nimport io\nfrom datetime import datetime\nimport scipy\nimport operator\nfrom scipy.integrate import solve_ivp\nfrom scipy.integrate import odeint\n... | [
[
"pandas.read_csv",
"pandas.to_datetime",
"numpy.linspace",
"pandas.DataFrame",
"scipy.integrate.odeint"
]
] |
cbilodeau2/hgraph2graph | [
"cde0630b2de7f63125b3d296450409d45b62f4a8"
] | [
"generate_augmented_pair_list.py"
] | [
"import numpy as np\nimport pandas as pd\nimport argparse\n\nfrom rdkit.Chem.Descriptors import ExactMolWt\nfrom rdkit import Chem\n\nfrom chemprop.data.scaffold import generate_scaffold\nfrom hgraph.pairing import *\n\n# SETTINGS:\nparser = argparse.ArgumentParser()\n\nparser.add_argument('--gen_out', type=str, re... | [
[
"pandas.concat",
"pandas.read_csv"
]
] |
janursa/realtime_plotting | [
"936cde4e6d15b1a538712d77398f5c7052a0ce9b"
] | [
"realtime/monitor.py"
] | [
"\n\"\"\"This module is designed to visualize csv files on a browser in a real time fashion. \nAuthor: Jalil Nourisa\n\n\"\"\"\nimport sys, time, os\nimport dash\nimport dash_core_components as dcc\nimport dash_html_components as html\nfrom dash.dependencies import Input, Output, State\nimport plotly.graph_objs ... | [
[
"pandas.read_csv"
]
] |
Malavikka/ConvLab-2 | [
"f2a0d251e4fab9e36e9d9f04df6308623d2d780c"
] | [
"convlab2/policy/mdrg/multiwoz/train.py"
] | [
"from __future__ import division, print_function, unicode_literals\n\nimport argparse\nimport json\nimport random\nimport time\nfrom io import open\nimport os\n\nimport numpy as np\nimport torch\nfrom torch.optim import Adam\n\nfrom convlab2.policy.mdrg.multiwoz.utils import util\nfrom convlab2.policy.mdrg.multiwoz... | [
[
"torch.zeros",
"torch.manual_seed",
"torch.tensor",
"torch.cuda.is_available",
"torch.device"
]
] |
ykkawana/probability | [
"65bfd91cf6e855674da8dd9976c067f79da46e90"
] | [
"tensorflow_probability/python/distributions/linear_gaussian_ssm_test.py"
] | [
"# Copyright 2018 The TensorFlow Probability 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 a... | [
[
"tensorflow.convert_to_tensor",
"numpy.dot",
"numpy.diag",
"numpy.sqrt",
"tensorflow.zeros",
"numpy.asarray",
"tensorflow.reduce_sum",
"tensorflow.cast",
"numpy.concatenate",
"numpy.random.randn",
"numpy.mean",
"numpy.var",
"tensorflow.compat.v1.placeholder_with... |
ejarkm/model-analysis | [
"ff145c356c89a7bb421b86718a2f50f7c5c1f621"
] | [
"tensorflow_model_analysis/eval_saved_model/exporter.py"
] | [
"# Copyright 2016 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.estimator.gc._largest_export_versions",
"tensorflow.python.platform.tf_logging.warn",
"tensorflow.python.platform.tf_logging.info",
"tensorflow.python.platform.gfile.DeleteRecursively",
"tensorflow.python.estimator.gc._negation",
"tensorflow.python.estimator.gc._get_path... |
alekzieba/tensorflow-deeplab-v3-plus | [
"6562f25564e1c08a1732aeba53a8fa92beae1764"
] | [
"inference.py"
] | [
"\"\"\"Run inference a DeepLab v3 model using tf.estimator API.\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport argparse\nimport os\nimport sys\n\nimport tensorflow as tf\n\nimport deeplab_model\nfrom utils import preprocessing\nfrom ... | [
[
"matplotlib.pyplot.imshow",
"tensorflow.estimator.Estimator",
"matplotlib.pyplot.savefig",
"tensorflow.logging.set_verbosity",
"matplotlib.pyplot.axis",
"tensorflow.python.debug.LocalCLIDebugHook",
"tensorflow.app.run"
]
] |
Big-Fuzz/AS-MT | [
"85e24feb39608136429843ea02313e628225d72e"
] | [
"NN_extended_32/perf_on_all_df.py"
] | [
"from utils_tf2 import *\nimport numpy as np\nimport tensorflow as tf\nimport math\nimport pickle\nimport pandas as pd\n\n\n\ntf.compat.v1.disable_eager_execution()\ntf.compat.v1.reset_default_graph() # to be able to rerun the model without overwriting tf variables\n\n################################... | [
[
"pandas.read_csv",
"tensorflow.compat.v1.global_variables_initializer",
"tensorflow.compat.v1.Session",
"tensorflow.compat.v1.disable_eager_execution",
"tensorflow.compat.v1.reset_default_graph",
"tensorflow.abs"
]
] |
mathcoding/Programmazione2 | [
"09a22ada68fad0797b14cd4776d05bf8a5613e39"
] | [
"python/ann_minst.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon May 1 16:43:05 2017\n\n@author: gualandi\n\"\"\"\nimport time\nimport csv\nimport numpy as np\n\nfrom numpy import genfromtxt\nfrom matplotlib import plt\n\nfrom sklearn.neural_network import MLPClassifier\nfrom sklearn.metrics import accuracy_score\n\n\ndef DrawDig... | [
[
"sklearn.neural_network.MLPClassifier",
"matplotlib.plt.xlabel",
"matplotlib.plt.imshow",
"numpy.genfromtxt",
"matplotlib.plt.figure",
"numpy.array",
"matplotlib.plt.show",
"sklearn.metrics.accuracy_score"
]
] |
IngeniousCoder/CPU-Monitor | [
"d44e64b73c5723764f412ff8b7dafda9cfc29dbe"
] | [
"Use.py"
] | [
"import os\r\nprint(\"Loading Dependencies\")\r\nos.system(\"pip install -U git+https://github.com/Rapptz/discord.py@rewrite\")\r\nos.system(\"pip install ast\")\r\nos.system(\"pip install matplotlib\")\r\nos.system(\"pip install numpy\")\r\nos.system(\"cls\")\r\nprint(\"Dependencies Loaded.\")\r\n\r\n\r\nimport di... | [
[
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure"
]
] |
Basvanstein/BIAS | [
"5eed56d01803e455ef53afb278f630d5f3c85dc4"
] | [
"BIAS/Create_RF.py"
] | [
"import numpy as np\nimport pandas as pd\nimport pickle\nimport glob\nimport matplotlib.pyplot as plt\nimport seaborn as sbs\n\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.metrics import confusion_matrix, f1_score\nfrom sklearn.model_selection import train_test_split\n\ntest_names = ['1-spacin... | [
[
"matplotlib.pyplot.tight_layout",
"pandas.read_csv",
"sklearn.ensemble.RandomForestClassifier",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xticks",
"matplotlib.pyplot.show",
"matplotlib.pyplot.figure"
]
] |
jb803/tensorForm | [
"4d227caa88365d9b20cf65539c83c22560785f6d"
] | [
"tensorForm/aux.py"
] | [
"\"\"\"Module for eigenvalue problems.\n\nWe have an abstract base-class representing an eigensolver. This has a number of functions which must be overloaded\"\"\"\n\nfrom abc import ABC,abstractmethod\n\nfrom petsc4py import PETSc \nfrom slepc4py import SLEPc\n\nimport dolfin as dolf\n\nimport time\n\nimport numpy... | [
[
"numpy.abs"
]
] |
ctittel/worldengine | [
"a91ae436f6298be6a0bf7b68c43415f10b6e751f"
] | [
"worldengine/drawing_functions.py"
] | [
"\"\"\"\nThis file should contain only functions that operates on pixels, not on images,\nso no references to PIL are necessary and the module can be used also through\nJython\n\"\"\"\n\nimport numpy\nimport sys\nimport time\nfrom worldengine.common import get_verbose, count_neighbours\nfrom worldengine.common impo... | [
[
"numpy.logical_not",
"numpy.random.RandomState",
"numpy.zeros",
"numpy.random.randint"
]
] |
williamdjones/deep_protein_binding | [
"10b00835024702b6d0e73092c777fed267215ca7"
] | [
"src/model.py"
] | [
"import time\nimport torch\nfrom torch import nn\nfrom torch.autograd import Variable\nimport numpy as np\nfrom sklearn.preprocessing import OneHotEncoder\nfrom sklearn.metrics import r2_score, precision_score, recall_score, f1_score, accuracy_score\n\nimport dc_features as dc\nfrom rdkit import Chem\n\n\n# TODO: i... | [
[
"torch.nn.Softmax",
"torch.nn.Dropout",
"numpy.fromiter",
"torch.cat",
"sklearn.preprocessing.OneHotEncoder",
"torch.nn.Linear",
"numpy.argmax",
"torch.stack",
"torch.nn.ReLU",
"torch.autograd.Variable"
]
] |
wegamekinglc/qlib | [
"1bab07e419c9a6bc42f4f7bdcf86b6c922a1718b",
"9459fda174079e1fd9cce1cfbfd8c9f215a3a482"
] | [
"qlib/contrib/model/pytorch_lstm.py",
"qlib/contrib/report/analysis_model/analysis_model_performance.py"
] | [
"# Copyright (c) Microsoft Corporation.\n# Licensed under the MIT License.\n\n\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport numpy as np\nimport pandas as pd\nimport copy\nfrom sklearn.metrics import roc_auc_score, mean_squared_error\nimport logging\nfrom ...utils impo... | [
[
"torch.mean",
"numpy.random.seed",
"torch.nn.LSTM",
"torch.isnan",
"torch.manual_seed",
"numpy.squeeze",
"torch.cuda.empty_cache",
"numpy.random.shuffle",
"torch.from_numpy",
"numpy.concatenate",
"torch.nn.Linear",
"torch.isfinite",
"numpy.mean",
"torch.no_g... |
yuyingyeh/isospectralization-pytorch | [
"48317133b8bb57e57a8ecd73b3bc93ba374d0d60"
] | [
"code_for_3D/plot_eig.py"
] | [
"\"\"\"Plot the eigenvalue sequences stored in a txt file.\"\"\"\nimport argparse\n\nimport numpy as np\nfrom matplotlib import pyplot as plt\n\n# Configure Matplotlib\nplt.rc(\"figure\", titleweight=\"bold\", dpi=100)\nplt.rc(\"font\", family=\"serif\")\nplt.rc(\"axes\", labelweight=\"bold\", linewidth=1.5, titlew... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.rc",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.close",
"matplotlib.pyplot.xlabel",
"numpy.loadtxt",
"matplotlib.pyplot.ylabel"
]
] |
x94carbone/hdwell | [
"3f3726edd815f82df0a72f7e22cb681032f774d9"
] | [
"hdwell2/simulator.py"
] | [
"#!/usr/bin/env python3\n\n__author__ = \"Matthew R. Carbone & Marco Baity-Jesi\"\n__maintainer__ = \"Matthew R. Carbone\"\n__email__ = \"x94carbone@gmail.com\"\n__status__ = \"Prototype\"\n\n\"\"\"Core simulation.\"\"\"\n\nimport numpy as np\nimport sys\nfrom time import time\nfrom collections import Counter\nfrom... | [
[
"numpy.testing.assert_equal",
"numpy.imag",
"numpy.random.random",
"numpy.log2",
"numpy.logspace",
"numpy.ones",
"numpy.seterr",
"numpy.random.normal",
"numpy.log10",
"numpy.where",
"numpy.mean",
"numpy.std",
"numpy.exp",
"numpy.zeros",
"numpy.sum",
... |
csliuwei/mne-python | [
"0e67ce63990117756ff3f63caecb43e4b37c153f"
] | [
"mne/gui/tests/test_coreg_gui.py"
] | [
"# Author: Christian Brodbeck <christianbrodbeck@nyu.edu>\n#\n# License: BSD (3-clause)\n\nimport os\nimport os.path as op\nimport re\nimport shutil\nimport sys\nfrom unittest import SkipTest\n\nimport numpy as np\nfrom numpy.testing import (assert_allclose, assert_equal,\n assert_array_al... | [
[
"numpy.testing.assert_equal",
"numpy.rad2deg",
"numpy.mean",
"numpy.testing.assert_allclose",
"numpy.testing.assert_array_almost_equal"
]
] |
djeada/Numerical-Methodes | [
"45a5288f4719568a62a82374efbb3fc06d33ec46"
] | [
"src/systems of linear equations/gaussian_elimination.py"
] | [
"import numpy as np\n\n\ndef gaussian_elimination(a, b):\n\n n = len(a)\n m = n + 1\n\n for row, element in zip(a, b):\n row.append(element)\n if len(row) != m:\n raise ValueError(\"You have to provide a square matrix\")\n\n for i in range(n):\n if a[i][i] == 0.0:\n ... | [
[
"numpy.zeros"
]
] |
CulpaBS/wbBach | [
"1e2defc8d8ef8612b1f8684af55d433747c22ae6"
] | [
"rts/python/scalar.py"
] | [
"# Scalar functions.\n\nimport numpy as np\n\ndef signed(x):\n if type(x) == np.uint8:\n return np.int8(x)\n elif type(x) == np.uint16:\n return np.int16(x)\n elif type(x) == np.uint32:\n return np.int32(x)\n else:\n return np.int64(x)\n\ndef unsigned(x):\n if type(x) == np.int8:\n return np.uin... | [
[
"numpy.sqrt",
"numpy.arctan2",
"numpy.exp",
"numpy.fmod",
"numpy.trunc",
"numpy.uint32",
"numpy.uint8",
"numpy.int8",
"numpy.sin",
"numpy.uint16",
"numpy.float32",
"numpy.log",
"numpy.isnan",
"numpy.int64",
"numpy.int32",
"numpy.cos",
"numpy.int1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.