repo_name stringlengths 8 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
xierensong/learnPython | [
"33f9891d8a8ed39772ff9bcbeb1e5cff6f3b5455"
] | [
"case/tfP.py"
] | [
"import tensorflow as tf\nmnist = tf.keras.datasets.mnist\n\n(x_train, y_train),(x_test, y_test) = mnist.load_data()\nx_train, x_test = x_train / 255.0, x_test / 255.0\n\nmodel = tf.keras.models.Sequential([\n tf.keras.layers.Flatten(),\n tf.keras.layers.Dense(512, activation=tf.nn.relu),\n tf.keras.layers.Dropo... | [
[
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Dense"
]
] |
adeline-cs/GTR | [
"889b0cda8a3c2b061371c4a63ea871821ddcd3d7"
] | [
"lib/evaluators.py"
] | [
"from __future__ import print_function, absolute_import\nimport time\nfrom time import gmtime, strftime\nfrom datetime import datetime\nfrom collections import OrderedDict\nimport torch\nimport numpy as np\nfrom random import randint\nfrom PIL import Image\nimport sys\nfrom . import metric\nfrom metric import Accur... | [
[
"numpy.sum",
"torch.no_grad",
"torch.abs",
"torch.device",
"torch.cat",
"torch.nn.CosineSimilarity"
]
] |
kevint324/tensorboard | [
"cbc5b1f2d74236d89baa9d4810c166e4cee973a9"
] | [
"tensorboard/plugins/core/core_plugin_test.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.test.main"
]
] |
veya2ztn/mltool | [
"4ed151152845ebe3de128e1f53c478581c1492e4"
] | [
"ModelArchi/GANModel/SNdcgan.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nfrom torch import autograd\nimport time as t\nimport os\nfrom itertools import chain\nfrom torchvision import utils\nfrom .spectral_normalization import SpectralNorm\n\nclass WassersteinLoss(torch.nn.Module):\n def forward(self, x , targe... | [
[
"torch.nn.BatchNorm2d",
"torch.FloatTensor",
"torch.nn.LeakyReLU",
"torch.nn.MSELoss",
"torch.save",
"torch.autograd.Variable",
"torch.nn.Tanh",
"torch.nn.Conv2d",
"torch.nn.BCEWithLogitsLoss",
"torch.nn.BCELoss",
"torch.nn.Sigmoid",
"torch.nn.ReLU",
"torch.Tens... |
augeas/NeverMindTheMolluscs | [
"829185ad1d9239368d5b6f3572fc07b7825deb49"
] | [
"oliva.py"
] | [
"import numpy as np\n\n\nclass Oliva(object):\n def __init__(self,width=640, skip=12, act_diff=0.015, act_decay=0.1,\n act_prod=0.1, sat=0.25, in_diff=0.0, in_decay=0.014, in_mm=0.1,\n h_decay=0.1, hormone=0.5):\n \n self.width = width\n self.cells = np.zeros((2,2,self.width))... | [
[
"numpy.roll",
"numpy.zeros",
"numpy.copy",
"numpy.arange",
"numpy.random.random",
"numpy.square"
]
] |
MElody9120/UESTC-FinalRepo | [
"f7271e76090d92866a4c9346da19e4b7464f5f0b"
] | [
"BikeShare/bikeShareData/parseCSV.py"
] | [
"# Author Melody\n# Data 2021-06-03 16:27:40\n\nimport pandas as pd\nimport geopy.distance\n\n\n# Pytest is an automated testing module on Python,Use Pytest to test the legitimacy on Bikeshare Data\n# import pytest as pt\n\n# Coords is a data structures to save How Bikeshare Date,Coord just like a List\n\n\ndef get... | [
[
"pandas.read_csv"
]
] |
CFM-MSG/Code_LEORN | [
"fabea1e1ded973a4db692e51e2df442bde55f626"
] | [
"lib/models/frame_modules/frame_pool.py"
] | [
"import torch\nfrom torch import nn\n\n\nclass FrameAvgPool(nn.Module):\n\n def __init__(self, cfg):\n super(FrameAvgPool, self).__init__()\n input_size = cfg.INPUT_SIZE # 4096\n hidden_size = cfg.HIDDEN_SIZE # 512\n kernel_size = cfg.KERNEL_SIZE # 16\n stride = cfg.STRIDE\n... | [
[
"torch.sum",
"torch.nn.AvgPool1d",
"torch.nn.MaxPool1d",
"torch.nn.Linear",
"torch.stack",
"torch.nn.BatchNorm1d",
"torch.nn.Softmax",
"torch.nn.Parameter",
"torch.relu",
"torch.nn.Conv1d",
"torch.nn.ReLU",
"torch.zeros",
"torch.eye",
"torch.cat",
"torch... |
crtrentz/MONAI | [
"355db48e46047a18e3bb9dbd83f424a8ad0a2622"
] | [
"tests/test_png_rw.py"
] | [
"# Copyright 2020 MONAI Consortium\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# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agreed to i... | [
[
"numpy.random.rand",
"numpy.testing.assert_allclose"
]
] |
Ckst123/KoBERT-events | [
"68eb22845b179bcaf13771fea776be3d9772306f"
] | [
"run.py"
] | [
"from data_loader import load_data, tokenizer\nfrom models import BertForMultipleSequenceClassification\n\nfrom transformers import AutoConfig\nimport torch\nfrom tqdm.auto import tqdm\nfrom transformers import get_scheduler\nfrom transformers import AdamW\nfrom sklearn.metrics import accuracy_score, f1_score\n\nla... | [
[
"torch.argmax",
"torch.no_grad",
"sklearn.metrics.f1_score",
"sklearn.metrics.accuracy_score",
"torch.cuda.is_available",
"torch.device",
"torch.cat"
]
] |
liytt85/gail-tf-pro | [
"ad92f41c26c34e8fabc536664fb11b44f25956cf"
] | [
"gailtf/baselines/ppo1/pposgd_simple.py"
] | [
"from gailtf.baselines.common import Dataset, explained_variance, fmt_row, zipsame\nfrom gailtf.baselines import logger\nimport gailtf.baselines.common.tf_util as U\nimport tensorflow as tf, numpy as np\nimport time, os, sys\nfrom gailtf.baselines.common.mpi_adam import MpiAdam\nfrom gailtf.baselines.common.mpi_mom... | [
[
"tensorflow.placeholder",
"tensorflow.minimum",
"numpy.empty",
"numpy.append",
"numpy.zeros",
"tensorflow.assign",
"tensorflow.square",
"numpy.array",
"numpy.mean"
]
] |
tianjianjiang/allennlp | [
"35b285585e0677b1025eac1c19b5eefe7e2a70db",
"35b285585e0677b1025eac1c19b5eefe7e2a70db",
"35b285585e0677b1025eac1c19b5eefe7e2a70db"
] | [
"allennlp/training/metrics/entropy.py",
"allennlp/modules/similarity_functions/linear.py",
"allennlp/tests/data/dataset_readers/multiprocess_dataset_reader_test.py"
] | [
"from typing import Optional\n\nfrom overrides import overrides\nimport torch\n\nfrom allennlp.training.metrics.metric import Metric\n\n\n@Metric.register(\"entropy\")\nclass Entropy(Metric):\n def __init__(self) -> None:\n self._entropy = 0.0\n self._count = 0\n\n @overrides\n def __call__(\... | [
[
"torch.nn.functional.log_softmax",
"torch.exp"
],
[
"torch.Tensor",
"torch.matmul"
],
[
"numpy.random.shuffle",
"numpy.random.seed"
]
] |
y-veys/iGibson | [
"1442c50187f8fcef118b097c195fef707eef04cb"
] | [
"gibson2/core/physics/drivers/minitaur.py"
] | [
"\"\"\"This file implements the functionalities of a minitaur using pybullet.\n\n\"\"\"\nimport copy\nimport math\nimport numpy as np\nfrom gibson2.core.physics.drivers import motor\nfrom gibson2.core.physics.robot_locomotors import LocomotorRobot\nfrom gibson2.core.physics.robot_bases import Joint, BodyPart\nimpor... | [
[
"numpy.multiply",
"numpy.zeros"
]
] |
YuJungHeo/kbvqa-public | [
"c04bed5c60085ac3a551a8c196e6269befce1e5b"
] | [
"main.py"
] | [
"import os\nimport time\nimport torch\nimport argparse\nfrom tqdm import tqdm\nimport torch.optim as optim\nimport torch.nn.functional as F\nfrom torch.utils.data import DataLoader\nfrom torch.utils.tensorboard import SummaryWriter\nfrom utils import (\n load_files,\n save_pickle,\n fix_seed,\n print_mo... | [
[
"torch.utils.data.DataLoader",
"torch.load",
"torch.nn.functional.nll_loss",
"torch.no_grad",
"torch.topk",
"torch.utils.tensorboard.SummaryWriter"
]
] |
zfar-/BaselineWithNoise | [
"ca18d1f2aed36d571c50ed8e630eb38a87c79265"
] | [
"baselines/run.py"
] | [
"import sys\nimport multiprocessing\nimport os.path as osp\nimport gym\nfrom collections import defaultdict\nimport tensorflow as tf\nimport numpy as np\n\nfrom baselines.common.vec_env.vec_video_recorder import VecVideoRecorder\nfrom baselines.common.vec_env.vec_frame_stack import VecFrameStack\nfrom baselines.com... | [
[
"numpy.empty",
"numpy.zeros",
"numpy.asarray",
"numpy.std",
"tensorflow.ConfigProto",
"numpy.mean"
]
] |
99starman/fairseq | [
"a098a52f5c961dffd06fd9a14c4cf6b657f2f52d"
] | [
"fairseq/tasks/translation.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\nfrom dataclasses import dataclass, field\nimport itertools\nimport json\nimport logging\nimport os\nfrom typing import Optional\nfro... | [
[
"numpy.array",
"torch.is_tensor"
]
] |
fietensen/FlappyAI | [
"f8bff24e2ee62edf97a9b061183e28bf4924db09"
] | [
"game/game.py"
] | [
"from game.pole import PolesObject\nfrom game.agent import Agent\nfrom pygame import Rect\nimport pygame, struct\nimport numpy as np\n\nclass Game:\n def __init__(self, resolution):\n self.resolution = resolution\n self.screen = pygame.display.set_mode(resolution) # init window\n self.player... | [
[
"numpy.random.uniform"
]
] |
soraros/nutils | [
"91119b12bdebf12a85eecb6a2247be2415f60e6f"
] | [
"nutils/evaluable.py"
] | [
"# Copyright (c) 2014 Evalf\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, d... | [
[
"numpy.sum",
"numpy.core.multiarray.c_einsum",
"numpy.ones",
"numpy.multiply",
"numpy.intersect1d",
"numpy.less",
"numpy.diff",
"numpy.dtype",
"numpy.argsort",
"numpy.asarray",
"numpy.add",
"numpy.ndindex",
"numpy.transpose",
"numpy.rollaxis",
"numpy.cos... |
zhaoruinan/indy_vision_task_sim | [
"71500c69de53808f8a691d600e56213c1768a9c6"
] | [
"src_ros2/ros2_sim_indy_pybullet/ros2_sim_indy_pybullet/indy7_fixed_cam_test.py"
] | [
"import pybullet as p\nimport time\nimport numpy as np\nobjects = ['apple', 'orange', 'banana', 'milk', 'orange']\np.connect(p.GUI)\np.setGravity(0, 0, -9.8)\n#planeId = p.loadURDF(\"plane.urdf\", [0, 0, 0])\nTableId = p.loadURDF(\"table/table.urdf\", [0.45, 0.35, -0.65])\nindyId= p.loadURDF(\"indy7.urdf\", [0, 0, ... | [
[
"numpy.empty",
"numpy.random.rand",
"numpy.delete"
]
] |
RamsteinWR/PneumoniaRSNA1 | [
"08bdba51292307a78ef711c6be4a63faea240ddf"
] | [
"models/RelationNetworks/relation_rcnn/core/rcnn.py"
] | [
"\"\"\"\nFast R-CNN:\ndata =\n {'data': [num_images, c, h, w],\n 'rois': [num_rois, 5]}\nlabel =\n {'label': [num_rois],\n 'bbox_target': [num_rois, 4 * num_classes],\n 'bbox_weight': [num_rois, 4 * num_classes]}\nroidb extended format [image_index]\n ['image', 'height', 'width', 'flipped',\n ... | [
[
"numpy.sqrt",
"numpy.sum",
"numpy.ones",
"numpy.append",
"numpy.empty",
"numpy.zeros",
"numpy.concatenate",
"numpy.abs",
"numpy.random.choice",
"numpy.hstack",
"numpy.array",
"numpy.where",
"numpy.round",
"numpy.minimum"
]
] |
ezg/PanoramicDataWin8 | [
"229e9ab64cda30a0bd1c6d39a70754ba4651ad43"
] | [
"backend/binrange.py"
] | [
"#!/usr/bin/python\nimport json\nimport numpy as np\nimport pandas as pd\nimport math\n\nclass BinRange():\n def __init__(self, dataMinValue, dataMaxValue, targetBinNumber):\n self.dataMinValue = float(dataMinValue)\n self.dataMaxValue = float(dataMaxValue)\n self.targetBinNumber = float(tar... | [
[
"numpy.arange"
]
] |
banjtheman/odsc_nlp_workshop | [
"6562938fff0e9e50d4db8feed5552eaaa7a7f1f6"
] | [
"module_5/helpful_flow.py"
] | [
"# Python imports\nimport logging\nimport os\n\n# Project imports\nimport utils as helpful_funcs\n\n# 3rd party imports\nfrom metaflow import FlowSpec, Parameter, step, card\nimport numpy as np\n\n# How to run\n# python helpful_flow.py run --output_dir test_run\n\n\nclass HelpfulFlow(FlowSpec):\n \"\"\"\n Thi... | [
[
"numpy.array_split"
]
] |
kingjuno/devolearn | [
"555c8c55441a4f0b9ed8801c37d07c45b03ec774"
] | [
"devolearn/cell_membrane_segmentor/cell_membrane_segmentor.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torch.nn import functional as F\nimport torchvision\nimport torchvision.transforms as transforms\nfrom torchvision.transforms import ToTensor\nfrom torchvision.transforms import ToPILImage\n\nimport os\nimport cv2\nimport wget\nimport imutils\nfrom tqdm import tqdm, tqdm_n... | [
[
"pandas.DataFrame",
"torch.load",
"numpy.zeros"
]
] |
avi2412/nlp-dl-prework | [
"902d77344c351954e370a4aacf5a427db68cfad9"
] | [
"Lego-Collector's-Dilemma/code.py"
] | [
"# --------------\nimport pandas as pd\nimport numpy as np\nfrom sklearn.cross_validation import train_test_split\n# code starts here\n\ndata = pd.read_csv(path)\ndf = pd.DataFrame(data)\n#print(df.iloc[0:5])\n\nX = df.drop(['list_price'], axis = 1)\ny = df.iloc[:, 1]\n\nX_train, X_test, y_train, y_test = train_tes... | [
[
"sklearn.metrics.mean_squared_error",
"pandas.read_csv",
"pandas.DataFrame",
"sklearn.linear_model.LinearRegression",
"matplotlib.pyplot.subplots",
"sklearn.cross_validation.train_test_split",
"matplotlib.pyplot.show",
"sklearn.metrics.r2_score"
]
] |
ibrahim-sheriff/Deploying-a-ML-Model-on-Heroku-with-FastAPI | [
"483c563d0e3838580f5cd643c70db6a47e1c1219"
] | [
"src/tests/conftest.py"
] | [
"\"\"\"\r\nAuthor: Ibrahim Sherif\r\nDate: October, 2021\r\nThis script holds the conftest data used with pytest module\r\n\"\"\"\r\nimport os\r\nimport pytest\r\nimport pandas as pd\r\nimport great_expectations as ge\r\nfrom sklearn.model_selection import train_test_split\r\n\r\nimport config\r\nfrom pipeline.data... | [
[
"pandas.read_csv",
"sklearn.model_selection.train_test_split"
]
] |
Simmons-Wang/easy-backtrack-tweets | [
"d5c7912e06376f63800e76af658a79b87129dc92"
] | [
"tweetBacktrack.py"
] | [
"import datetime\nimport pickle\nimport tweepy as tp\nimport pandas as pd\nimport time\n\n\ndef lookUpDetail(ids):\n \"\"\"\n :param ids: the list of tweets ids, the maximum length is 100 at a time.\n :return: dataframe which include 'tweet_id', 'favorite_count', 'retweet_count', 'lang',\n 'hashtags', '... | [
[
"pandas.DataFrame"
]
] |
jezsadler/summit | [
"982de7f6424bb94da2084d4d84396b4b2673eeca"
] | [
"summit/benchmarks/experiment_emulator/bnn_emulator.py"
] | [
"import os\nimport os.path as osp\n\nimport numpy as np\n\nfrom summit.benchmarks.experiment_emulator.emulator import Emulator\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nfrom blitz.modules import BayesianLinear\nfrom blitz.utils import variational_estimat... | [
[
"torch.utils.data.DataLoader",
"torch.nn.MSELoss",
"torch.nn.functional.dropout",
"torch.load",
"torch.tensor",
"torch.device",
"torch.cuda.is_available",
"sklearn.metrics.r2_score",
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.utils.data.TensorDataset",
"torch.... |
johnnytheboii/TensorFuzz_2.0 | [
"d1d7ae7de26067c2a1c223dbef6d897752aa8f71"
] | [
"examples/quantize/quantized_fuzzer.py"
] | [
"# Copyright 2018 Google LLC\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# https://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by applicable law or agreed to ... | [
[
"tensorflow.flags.DEFINE_integer",
"tensorflow.flags.DEFINE_float",
"tensorflow.app.run",
"tensorflow.logging.set_verbosity",
"numpy.argmax",
"tensorflow.flags.DEFINE_boolean",
"tensorflow.Session",
"tensorflow.flags.DEFINE_string"
]
] |
C-bowman/inference-tools | [
"499c3c23f1b3817b4cabde21ba45f2e2c6b95f77"
] | [
"inference/priors.py"
] | [
"\"\"\"\n.. moduleauthor:: Chris Bowman <chris.bowman.physics@gmail.com>\n\"\"\"\nfrom typing import Union, Iterable\n\nfrom numpy import array, log, pi, zeros, concatenate, float64, where\nfrom numpy.random import normal, exponential, uniform\nfrom itertools import chain\n\n\nclass JointPrior(object):\n \"\"\"\... | [
[
"numpy.random.uniform",
"numpy.zeros",
"numpy.where",
"numpy.log",
"numpy.random.exponential",
"numpy.random.normal",
"numpy.concatenate",
"numpy.array"
]
] |
mschwoer/alphapept | [
"446b3c8b2a20619a74ff872c24a01fed8b99a20a"
] | [
"alphapept/ext/bruker/timsdata.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Python wrapper for timsdata.dll\"\"\"\n\nimport numpy as np\nimport sqlite3\nimport os, sys\nfrom ctypes import *\n\nif sys.platform[:5] == \"win32\":\n libname = \"timsdata.dll\"\nelif sys.platform[:5] == \"linux\":\n libname = \"libtimsdata.so\"\nelse:\n raise Exception(\"... | [
[
"numpy.array",
"numpy.empty"
]
] |
mahanswaray/simpletransformers | [
"44a97d689b6bd19495e698ae918e67c80828559e"
] | [
"simpletransformers/classification/multi_label_classification_model.py"
] | [
"import logging\nimport random\nimport warnings\nfrom multiprocessing import cpu_count\n\nimport numpy as np\nimport torch\nfrom transformers import (\n WEIGHTS_NAME,\n AlbertConfig,\n AlbertTokenizer,\n BertConfig,\n BertTokenizer,\n DistilBertConfig,\n DistilBertTokenizer,\n ElectraConfig,... | [
[
"torch.cuda.manual_seed_all",
"torch.manual_seed",
"numpy.random.seed",
"torch.cuda.is_available",
"torch.device",
"torch.Tensor"
]
] |
Tudor67/Neural-Networks-Assignments | [
"7376e9d3b0059df2f2b21d56787c47d3c1ba6746"
] | [
"2018-2019/project/utils/evaluation.py"
] | [
"import config\nimport numpy as np\nimport tensorflow as tf\n\ndef get_tp_fp_fn(a, b):\n a = np.equal(a, 1)\n not_a = np.logical_not(a)\n b = np.equal(b, 1)\n not_b = np.logical_not(b)\n \n tp = np.logical_and(a, b).sum().astype(np.float64)\n fp = np.logical_and(a, not_b).sum().astype(np.float6... | [
[
"tensorflow.greater_equal",
"tensorflow.equal",
"tensorflow.logical_not",
"numpy.equal",
"numpy.logical_and",
"tensorflow.logical_and",
"numpy.logical_not",
"tensorflow.cast",
"tensorflow.constant",
"tensorflow.count_nonzero"
]
] |
belkhir-nacim/generative_model_toolbox | [
"573e69979a77030004afe2df216893f556225454"
] | [
"generative_models_toolbox/vqvae2/sample.py"
] | [
"import argparse\nimport os\n\nimport torch\nimport torchvision.utils\nfrom tqdm import tqdm\n\nfrom .vqvae import VQVAE\nfrom .pixelsnail import PixelSNAIL\n\n\n@torch.no_grad()\ndef sample_model(model, device, batch, size, temperature, condition=None):\n row = torch.zeros(batch, *size, dtype=torch.int64).to(de... | [
[
"torch.load",
"torch.no_grad",
"torch.multinomial",
"torch.zeros",
"torch.softmax"
]
] |
tatsushi-ikeda/pyheom | [
"d069fcf791959942b7a0357cda349d9976e06313"
] | [
"pyheom/pyheom.py"
] | [
"# \n# LibHEOM: Copyright (c) Tatsushi Ikeda\n# This library is distributed under BSD 3-Clause License.\n# See LINCENSE.txt for licence.\n# ------------------------------------------------------------------------\n\nimport enum\nimport sys\nimport numpy as np\nimport scipy as sp\nimport scipy.sparse\nimport importl... | [
[
"numpy.zeros_like",
"numpy.zeros",
"numpy.diag",
"numpy.copy",
"scipy.sparse.coo_matrix",
"numpy.linalg.eig"
]
] |
marcusinthesky/Word2Risk | [
"0212718369f04607a1b06c009df9e6cee29fe103"
] | [
"scraper/News/spiders/biznews.py"
] | [
"import scrapy\nimport pandas as pd\nimport os\nimport requests\nfrom bs4 import BeautifulSoup\n\nclass biznewsSpider(scrapy.Spider):\n name = \"biznews\"\n \n def __init__(self, *a, **kw):\n super(biznewsSpider, self).__init__(*a, **kw)\n path = os.path.join(os.path.expanduser(\"~\"),\"Docum... | [
[
"pandas.read_csv"
]
] |
esgomezm/deepcell-tf | [
"6693c9ed7e76793561e6c2281437acaf3e4fa441"
] | [
"deepcell/layers/location_test.py"
] | [
"# Copyright 2016-2019 The Van Valen Lab at the California Institute of\n# Technology (Caltech), with support from the Paul Allen Family Foundation,\n# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.\n# All rights reserved.\n#\n# Licensed under a modified Apache License, Version 2.0 (the \... | [
[
"tensorflow.python.platform.test.main"
]
] |
gesiscss/wikiwho_demo | [
"1549a63dc9714c1a813a77dcad481a69cd28dfcd"
] | [
"visualization/conflicts_listener.py"
] | [
"import pandas as pd\nimport numpy as np\nimport plotly\nfrom plotly import graph_objs\n\n\nclass ConflictsListener():\n\n def __init__(self, df):\n\n # time diff to seconds\n #df['diff_secs'] = df['time_diff'].dt.total_seconds()\n\n # conflict time diff to seconds \n #df['diff_secs_c... | [
[
"pandas.Grouper"
]
] |
symphony233/gbnns_dim_red | [
"2403411600a60ad4365aba3d78a81da144a456b7"
] | [
"train.py"
] | [
"from __future__ import division\nimport argparse\nimport numpy as np\nimport torch\n\nfrom dim_red.triplet import train_triplet\nfrom dim_red.angular import train_angular\n\nfrom dim_red.support_func import sanitize\nfrom dim_red.data import load_dataset\n\nif __name__ == '__main__':\n parser = argparse.Argume... | [
[
"numpy.random.permutation",
"torch.manual_seed",
"torch.cuda.is_available",
"numpy.random.seed"
]
] |
tkShir/EC521-Group6-Novel-Steganographic-Scheme | [
"d01ff5b625d5ef85790451fa62e5c33f15f06f0d"
] | [
"novel_stego_protocol/textgenrnn/textgenrnn.py"
] | [
"import json\nimport re\n\nimport numpy as np\nimport tensorflow as tf\nimport tqdm\nfrom pkg_resources import resource_filename\nfrom sklearn.decomposition import PCA\nfrom sklearn.manifold import TSNE\nfrom sklearn.metrics.pairwise import cosine_similarity\nfrom sklearn.preprocessing import LabelBinarizer\nfrom t... | [
[
"sklearn.preprocessing.LabelBinarizer",
"tensorflow.keras.callbacks.LearningRateScheduler",
"tensorflow.keras.optimizers.Adam",
"tensorflow.keras.models.Model",
"tensorflow.keras.preprocessing.text.text_to_word_sequence",
"tensorflow.distribute.MirroredStrategy",
"tensorflow.keras.prep... |
malisit/onnx-tensorflow | [
"3eb41dc923f350ca533f1024f602a842dd55de45"
] | [
"onnx_tf/handlers/backend/sequence_erase.py"
] | [
"import tensorflow as tf\n\nfrom onnx_tf.handlers.backend_handler import BackendHandler\nfrom onnx_tf.handlers.handler import onnx_op\n\n\n@onnx_op(\"SequenceErase\")\nclass SequenceErase(BackendHandler):\n\n @classmethod\n def chk_pos_in_bounds(cls, input_seq, pos):\n \"\"\"\n Check the position is in-boun... | [
[
"tensorflow.negative",
"tensorflow.equal",
"tensorflow.logical_and",
"tensorflow.concat",
"tensorflow.less_equal",
"tensorflow.control_dependencies"
]
] |
pangtao22/quasistatic_simulator | [
"7c6f99cc7237dd922f6eb0b54c580303e86b5223"
] | [
"examples/planar_hand_ball/run_planar_hand.py"
] | [
"import os\nimport numpy as np\n\nfrom pydrake.all import PiecewisePolynomial\n\nfrom examples.setup_simulations import (\n run_quasistatic_sim)\nfrom qsim.parser import QuasistaticParser, QuasistaticSystemBackend\nfrom qsim.model_paths import models_dir\nfrom qsim.simulator import GradientMode\n\n\n#%% sim setu... | [
[
"numpy.array",
"numpy.zeros"
]
] |
Paul-St-Young/eried | [
"63dbcab435a1fbe65b3b727a6c4b743497f60862"
] | [
"examples/02_min-h4/eri/diff_evals.py"
] | [
"#!/usr/bin/env python3\nimport yaml\nimport numpy as np\n\ndef read_evals(fyml):\n with open(fyml, 'r') as f:\n evd = yaml.safe_load(f)\n elist = evd['evals']\n return np.array(elist)\n\ndef main():\n from argparse import ArgumentParser\n parser = ArgumentParser()\n parser.add_argument('nup', type=int)\n ... | [
[
"numpy.array",
"numpy.where"
]
] |
TheRockStarDBA/sqlmlutils | [
"956bdd72638a649f0e613f100fbb81c900dcb65e"
] | [
"Python/sqlmlutils/sqlpythonexecutor.py"
] | [
"# Copyright(c) Microsoft Corporation. All rights reserved.\r\n# Licensed under the MIT license.\r\n\r\nfrom typing import Callable\r\nimport dill\r\nfrom pandas import DataFrame\r\n\r\nfrom .connectioninfo import ConnectionInfo\r\nfrom .sqlqueryexecutor import execute_query, execute_raw_query\r\nfrom .sqlbuilder i... | [
[
"pandas.DataFrame"
]
] |
xadupre/keras-onnx | [
"17559f987ecce7ec40ab8a36a9596eb950f9b332"
] | [
"keras2onnx/ke2onnx/lstm.py"
] | [
"###############################################################################\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for\n# license information.\n##########################################################################... | [
[
"numpy.array",
"numpy.concatenate",
"numpy.zeros",
"numpy.split"
]
] |
fwitte/chp_orc | [
"509abf4faf2a5d08ef8311a0f2a8c75e1bbba95e"
] | [
"Optimization/app.py"
] | [
"# %%\n\n\nfrom CoolProp.CoolProp import PropsSI\nimport pygmo as pg\nimport pandas as pd\nfrom matplotlib import pyplot as plt\nfrom orc import ORC_without_ihe, CHPORC\nfrom tespy.components import HeatExchanger, Merge, Pump, Sink, Source, Splitter\nfrom tespy.components.heat_exchangers.condenser import Condenser\... | [
[
"matplotlib.pyplot.close",
"matplotlib.pyplot.subplots"
]
] |
willxujun/tensorflow | [
"5c31a9c4a8aa94d2f41c60880bb3ca699c23328c"
] | [
"tensorflow/compiler/aot/ex2/make_graph.py"
] | [
"import argparse\nimport os\nimport sys\n\nimport tensorflow as tf\nfrom tensorflow.core.protobuf import saver_pb2\nfrom tensorflow.python.client import session\nfrom tensorflow.python.framework import constant_op\nfrom tensorflow.python.framework import dtypes\nfrom tensorflow.python.framework import function\nfro... | [
[
"tensorflow.placeholder",
"tensorflow.python.platform.app.run",
"tensorflow.python.framework.ops.Graph",
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.global_variables_initializer",
"tensorflow.random_normal",
"tensorflow.train.AdamOptimizer",
"tensorflow.examples.... |
thefullstackninja/effective_data_visualization_using_plotly_express | [
"043225b9a4e2333709df19be64475d8ed003daa3"
] | [
"pie_charts/basic_pie_chart_tips_by_gender.py"
] | [
"### Case study Distribution of tips by gender\n\nimport pandas as pd\nimport plotly.express as px\n\n\ndf = pd.read_csv(\"../data/tips.csv\")\n\nplot = px.pie(\n data_frame=df,\n values='tip',\n names='sex',\n title=\"Case study Distribution of tips by gender\"\n \n)\n\nplot.show()"
] | [
[
"pandas.read_csv"
]
] |
yasudakn/hmr | [
"6b7a9a4d1a312c0f93140d4d4752ab2d100a4ce3"
] | [
"src/tf_smpl/batch_lbs.py"
] | [
"\"\"\" Util functions for SMPL\n@@batch_skew\n@@batch_rodrigues\n@@batch_lrotmin\n@@batch_global_rigid_transformation\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow as tf\n\n\ndef batch_skew(vec, batch_size=None):\n ... | [
[
"tensorflow.pad",
"tensorflow.norm",
"tensorflow.zeros",
"tensorflow.stack",
"tensorflow.reshape",
"tensorflow.scatter_nd",
"tensorflow.div",
"tensorflow.tile",
"tensorflow.range",
"tensorflow.ones",
"tensorflow.expand_dims",
"tensorflow.eye",
"tensorflow.matmul... |
Parallel-in-Time/PararealF90 | [
"a8318a79b92465a8a3cf775cc7fd096ff0494529"
] | [
"plot_solution.py"
] | [
"import sys\nsys.path.append('./scripts')\nfrom get_parameter import get_parameter\n\nimport numpy as np\n\nfrom matplotlib import pyplot as plt\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom matplotlib import cm\nfrom matplotlib.ticker import LinearLocator, FormatStrFormatter\n\nnu, Nx, Ny, Nz, dt_fine, dt_coarse,... | [
[
"matplotlib.pyplot.figure",
"numpy.size",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"numpy.array",
"numpy.meshgrid",
"numpy.linspace",
"matplotlib.pyplot.xlabel"
]
] |
IgorHoholko/metrics | [
"5510ccd99eaec5ab8175bbd5e2ad9e66e82d10e4"
] | [
"torchmetrics/regression/psnr.py"
] | [
"# Copyright The PyTorch Lightning team.\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... | [
[
"torch.tensor"
]
] |
baijianhua/pymath | [
"a96ebbd8c8ac646c436d8bf33cb01764a948255d"
] | [
"bak/coord.py"
] | [
"#用python绘制坐标\n#https://matplotlib.org/examples/axes_grid/demo_axisline_style.html\n#https://stackoverflow.com/questions/13430231/how-i-can-get-cartesian-coordinate-system-in-matplotlib\n#https://stackoverflow.com/questions/50798265/what-is-subplotzero-documentation-lacking\n\n# notice import as 和 from import有什么区别?... | [
[
"numpy.arange",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show"
]
] |
manaccac/sc2_bot | [
"3aa8b3711378b71fd0a44662cdd7148846e39530"
] | [
"bot/venv/lib/python3.7/site-packages/scipy/ndimage/_ni_docstrings.py"
] | [
"\"\"\"Docstring components common to several ndimage functions.\"\"\"\nfrom scipy._lib import doccer\n\n__all__ = ['docfiller']\n\n\n_input_doc = (\n\"\"\"input : array_like\n The input array.\"\"\")\n_axis_doc = (\n\"\"\"axis : int, optional\n The axis of `input` along which to calculate. Default is -1.\"\"... | [
[
"scipy._lib.doccer.filldoc"
]
] |
JanBrabec/UCI-ML-API | [
"59f6c680ac914df55e93e05545eb198887510943"
] | [
"UCI_ML_Functions.py"
] | [
"# Functions to read, analyze, and download from UCI ML portal\n\n# ==========================================\n# Function to read UCI ML datasets table\n# ==========================================\ndef read_dataset_table(\n url=\"https://archive.ics.uci.edu/ml/datasets.php\", msg_flag=True\n):\n \"\"\"\n ... | [
[
"pandas.read_csv",
"pandas.DataFrame",
"pandas.read_html",
"pandas.set_option"
]
] |
h-vetinari/triton | [
"d9dd97492f228020573b39a9cec14ee3b8776957"
] | [
"python/tutorials/03-matrix-multiplication.py"
] | [
"\"\"\"\nMatrix Multiplication\n======================\nIn this tutorial, you will write a 25-lines high-performance FP16 matrix multiplication\nkernel that achieves performance on par with cuBLAS.\nYou will specifically learn about:\n\n- Block-level matrix multiplications\n- Multi-dimensional pointer arithmetic\n-... | [
[
"torch.empty",
"torch.randn",
"torch.manual_seed",
"torch.nn.ReLU",
"torch.matmul"
]
] |
jasonleeinf/ParlAI | [
"1f7f6d5b7481195b0214e835bb5d782db768d71c"
] | [
"tests/test_torch_agent.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\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 unittest\nfrom parlai.core.agents import Agent\n\nfrom collections import deque\n\nSKIP_TESTS = False\... | [
[
"torch.LongTensor"
]
] |
CeasarLee/ncnn | [
"178825d14a16c4059820d9f054a8d857df671027"
] | [
"tools/pnnx/tests/test_F_avg_pool1d.py"
] | [
"# Tencent is pleased to support the open source community by making ncnn available.\r\n#\r\n# Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.\r\n#\r\n# Licensed under the BSD 3-Clause License (the \"License\"); you may not use this file except\r\n# in compliance with the License. You ma... | [
[
"torch.manual_seed",
"torch.rand",
"torch.equal",
"torch.nn.functional.avg_pool1d",
"torch.jit.trace"
]
] |
rmit-ir/al-ef | [
"abffe57ae171cd846ca29b5e1b5a9f337c948912"
] | [
"code/density.py"
] | [
"#!/usr/bin/env python\nimport numpy\n\ndef jaccquard_similarity(a, b):\n if len(b) == 0 or len(a) == 0: return 0.0\n return len(set(a).intersection(b))*1./len(set(a).union(set(b)))\n\ndef similarityMatrix(features):\n a = numpy.zeros((len(features), len(features)),\n dtype=numpy.float)\n... | [
[
"numpy.sort",
"numpy.mean"
]
] |
adeptflax/image2image | [
"8c7c531176d261789f90a27125b31d6241bc9c27"
] | [
"taming/modules/transformer/mingpt.py"
] | [
"\"\"\"\ntaken from: https://github.com/karpathy/minGPT/\nGPT model:\n- the initial stem consists of a combination of token encoding and a positional encoding\n- the meat of it is a uniform sequence of Transformer blocks\n - each Transformer is a sequential combination of a 1-hidden-layer MLP block and a self-at... | [
[
"torch.ones",
"torch.nn.Linear",
"torch.nn.functional.softmax",
"torch.no_grad",
"torch.multinomial",
"torch.nn.Embedding",
"torch.tensor",
"torch.nn.GELU",
"torch.topk",
"torch.nn.LayerNorm",
"torch.randperm",
"torch.zeros",
"torch.isnan",
"torch.cat",
... |
hee9joon/Face-Generation | [
"caa9b4e0bb61e77ee6d32fc8687bad63f998ec9c"
] | [
"3. BEGAN (Boundary Equilibrium GAN)/celeba.py"
] | [
"from torch.utils.data import DataLoader\nfrom torchvision.datasets import ImageFolder\nimport torchvision.transforms as transforms\n\nfrom config import *\n\n\ndef get_celeba_loader(path, batch_size):\n \"\"\"CelebA Loader\"\"\"\n transform = transforms.Compose([\n transforms.Resize((config.crop_size,... | [
[
"torch.utils.data.DataLoader"
]
] |
raydouglass/cugraph | [
"228a4e1abc95b9b15ab211d9e397cc61913275e5"
] | [
"python/cugraph/graph/test_graph.py"
] | [
"# Copyright (c) 2019, NVIDIA CORPORATION.\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law ... | [
[
"numpy.array",
"scipy.io.mmread"
]
] |
54hanxiucao/gym-electric-motor | [
"911432388b00675e8a93f4a7937fdc575f106f22"
] | [
"gym_electric_motor/visualization/motor_dashboard_plots/state_plot.py"
] | [
"import numpy as np\n\nfrom .base_plots import TimePlot\n\n\nclass StatePlot(TimePlot):\n \"\"\"Plot to display the environments states and their references.\"\"\"\n\n _default_limit_line_cfg = {\n 'color': 'red',\n 'linestyle': '--',\n 'linewidth': 1\n }\n\n # Labels for each state... | [
[
"numpy.ones"
]
] |
belivem/Study | [
"7e4633b988985735100f2ddd17ae62b8348dbb8e"
] | [
"src/mnist_fully_network/mnist_practice/mnist_data_info.py"
] | [
"import os\nimport sys\nimport tensorflow as tf\nfrom tensorflow.examples.tutorials.mnist import input_data\n\nmnist_path = \"/Users/liyanan/Documents/Test/Tensorflow/data/mnist_data/\"\n\n#print mnist data\ndef mnistInfo():\n \n batch_size = 100\n\n #read mnist data\n mnist = input_data.read_data_sets(... | [
[
"tensorflow.unique_with_counts",
"tensorflow.placeholder",
"tensorflow.global_variables_initializer",
"tensorflow.examples.tutorials.mnist.input_data.read_data_sets",
"tensorflow.Session",
"tensorflow.argmax"
]
] |
filippovitale/tensorflow | [
"fe9b5008ff63a70e4092cdc7968b1327a9470f77"
] | [
"tensorflow/python/kernel_tests/cwise_ops_test.py"
] | [
"# Copyright 2015 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl... | [
[
"tensorflow.real",
"numpy.vectorize",
"tensorflow.complex",
"tensorflow.reshape",
"numpy.ones_like",
"tensorflow.is_nan",
"tensorflow.convert_to_tensor",
"tensorflow.reduce_sum",
"tensorflow.split",
"numpy.isfinite",
"tensorflow.minimum",
"tensorflow.maximum",
"... |
carboncoo/UNITER | [
"dfe007c2cea55430a847fd1cf318e88ae8ffe88f"
] | [
"data/data.py"
] | [
"\"\"\"\nCopyright (c) Microsoft Corporation.\nLicensed under the MIT license.\n\nDataset interfaces\n\"\"\"\nfrom collections import defaultdict\nfrom contextlib import contextmanager\nimport io\nimport json\nfrom os.path import exists\n\nimport numpy as np\nimport torch\nfrom torch.utils.data import Dataset, Conc... | [
[
"numpy.load",
"torch.tensor",
"torch.arange",
"torch.zeros",
"torch.cat"
]
] |
jojonki/AttentionNetworks-for-QA | [
"16f469c0719bf30c42695a1b4df6bbd84db8ea49"
] | [
"process_data.py"
] | [
"import os\nimport numpy as np\nimport json\nimport pickle\nfrom nltk.tokenize import word_tokenize\nimport random\nimport torch\nfrom torch.autograd import Variable\n\n# TODO global\nNULL = \"-NULL-\"\nUNK = \"-UNK-\"\nENT = \"-ENT-\"\n\n\ndef save_pickle(d, path):\n print('save pickle to', path)\n with open... | [
[
"torch.ones",
"torch.stack",
"numpy.zeros",
"torch.autograd.Variable",
"torch.cuda.is_available",
"numpy.array",
"torch.LongTensor"
]
] |
WangWenjun559/MITS | [
"8d7ace2b3b2a58fb33af225c2997106d9402aaf5"
] | [
"summary/sumy/sklearn/decomposition/pca.py"
] | [
"\"\"\" Principal Component Analysis\n\"\"\"\n\n# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>\n# Olivier Grisel <olivier.grisel@ensta.org>\n# Mathieu Blondel <mathieu@mblondel.org>\n# Denis A. Engemann <d.engemann@fz-juelich.de>\n# Michael Eickenberg <michael.eickenberg@... | [
[
"numpy.sqrt",
"numpy.sum",
"numpy.eye",
"numpy.empty",
"numpy.zeros",
"scipy.special.gammaln",
"numpy.var",
"scipy.linalg.inv",
"numpy.log",
"numpy.maximum",
"numpy.dot",
"numpy.mean",
"scipy.linalg.svd"
]
] |
caglorithm/stimulus_neural_populations | [
"58567901bed6f6bc17fc2975435138c33bb6be66"
] | [
"models/brian2/utils_net.py"
] | [
"import numpy as np\n# try to import numba\n# or define dummy decorator\ntry:\n from numba import autojit\nexcept:\n def autojit(func):\n return func\n\n# util functions for network simulation\ndef smooth_trace(trace, scale):\n scale = int(scale)\n if scale == 1 or scale == 0:\n return tra... | [
[
"numpy.zeros_like",
"numpy.ones",
"numpy.zeros",
"numpy.random.rand",
"numpy.mean"
]
] |
SergioRAgostinho/cvxpnpl | [
"eaa568594df0adcf0c70cc5288b24e5dc1fa9d2f",
"eaa568594df0adcf0c70cc5288b24e5dc1fa9d2f"
] | [
"benchmarks/toolkit/datasets.py",
"benchmarks/real/pnpl.py"
] | [
"from collections import namedtuple\nimport json\nimport os\nfrom os.path import join as pjoin\nfrom pathlib import Path\n\nimport numpy as np\nfrom plymit import Ply\nfrom PIL import Image\n\nfrom .renderer import Renderer\n\nModel = namedtuple(\n \"Model\",\n [\n \"id\",\n \"points\",\n ... | [
[
"numpy.array",
"numpy.zeros"
],
[
"numpy.random.seed"
]
] |
kcrumb/automl | [
"6e0cb70003c05dbbba45a7d741ec975423042f0e"
] | [
"efficientdet/utils.py"
] | [
"# Copyright 2020 Google Research. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by... | [
[
"tensorflow.compat.v1.zeros_like",
"tensorflow.compat.v1.get_collection",
"tensorflow.compat.v1.math.square",
"tensorflow.compat.v2.summary.image",
"tensorflow.compat.v1.config.experimental.list_physical_devices",
"tensorflow.compat.v1.zeros_initializer",
"tensorflow.compat.v1.profiler... |
Tchiik/CompViz | [
"b0a94cbf360e04cc4bcac261ae435eff462aa625"
] | [
"custom_2.py"
] | [
"\"\"\"\nMask R-CNN\nTrain on the toy bottle dataset and implement color splash effect.\nCopyright (c) 2018 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n------------------------------------------------------------\nUsage: import the module (see Jupyter noteb... | [
[
"numpy.array",
"numpy.sum",
"numpy.where"
]
] |
CubicZebra/anomalydetect | [
"ec571b47569f491f72abc9736097fb30f9289f46"
] | [
"core/nearest.py"
] | [
"import numpy as np\nfrom basic.types import vector, matrix\nfrom typing import Optional\nfrom basic.tests import dt\n\n\n# print(dt)\n# print(dt.mean(axis=0))\n\n\n_ptr = np.array([1, 1, 4, 4, 8])\n# print(dt - _ptr)\n\n\ndef _is_broadcastable(x: matrix, _x: vector) -> Optional[TypeError]:\n if x.shape[1] != _x... | [
[
"numpy.array",
"numpy.where",
"numpy.linalg.norm",
"numpy.unique"
]
] |
Liang-ZX/Stereo-Mask-RCNN | [
"c7c53062eacca4511fd4d091bea41cd7b5cf100d"
] | [
"demo.py"
] | [
"# --------------------------------------------------------\n# Tensorflow Faster R-CNN\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Jiasen Lu, Jianwei Yang, based on code from Ross Girshick\n\n# Modified by Peiliang Li for Stereo RCNN demo\n# --------------------------------------------... | [
[
"torch.FloatTensor",
"torch.nonzero",
"torch.load",
"torch.no_grad",
"numpy.random.seed",
"numpy.asarray",
"torch.from_numpy",
"numpy.min",
"torch.max",
"numpy.array",
"numpy.concatenate",
"torch.LongTensor",
"torch.cat",
"torch.sort"
]
] |
fshart/aesara | [
"1ddf96a7b8e8503fb8773b09c3ca77483fd884c4"
] | [
"aesara/misc/safe_asarray.py"
] | [
"\"\"\"\nHelper function to safely convert an array to a new data type.\n\"\"\"\n\n\nimport numpy as np\n\nfrom aesara.configdefaults import config\n\n\n__docformat__ = \"restructuredtext en\"\n\n\ndef _asarray(a, dtype, order=None):\n \"\"\"Convert the input to a Numpy array.\n\n This function is almost iden... | [
[
"numpy.dtype",
"numpy.asarray"
]
] |
synicalsyntax/eeg-notebooks | [
"1edcaf24d55eabe076f6ba98645fcc09b3459613"
] | [
"notebooks/stimulus_presentation/spatial_gratings.py"
] | [
"\"\"\"\nGenerate spatial gratings\n=========================\n\nStimulus presentation based on gratings of different spatial frequencies\nfor generating ERPs, high frequency oscillations, and alpha reset.\n\nInspired from:\n\n> Hermes, Dora, K. J. Miller, B. A. Wandell, and Jonathan Winawer. \"Stimulus\ndependence... | [
[
"numpy.random.binomial",
"numpy.ones",
"numpy.float32",
"numpy.random.RandomState",
"numpy.random.rand",
"numpy.random.randint"
]
] |
flaport/gdsfactory | [
"1f2e844c1fe27b9c6340e2d51500fd3358fa16e5"
] | [
"pp/components/waveguide_heater.py"
] | [
"from typing import Callable, Dict, List, Tuple\n\nimport numpy as np\n\nimport pp\nfrom pp.cell import cell\nfrom pp.component import Component\nfrom pp.components.electrical.tlm import tlm\nfrom pp.components.extension import line\nfrom pp.components.hline import hline\nfrom pp.components.waveguide import wavegui... | [
[
"numpy.sign"
]
] |
LeBenchmark/Interspeech2021 | [
"1b368c6461a9a56a4337f9ee86888e286a55f2f9"
] | [
"SLU/slu_models.py"
] | [
"# coding: utf8\n\nimport os\nimport sys\nimport torch\nimport torch.autograd as autograd\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom collections import OrderedDict\n\n#sys.path.append( os.environ['RNNTAGGERPATH'] )\nfrom fairseq.globals import *\n#import utils_classes as Cl\n\n# ---------- Decode... | [
[
"torch.sum",
"torch.FloatTensor",
"torch.nn.LSTM",
"torch.nn.Linear",
"torch.ones",
"torch.cuda.FloatTensor",
"torch.nn.Embedding",
"torch.nn.LogSoftmax",
"torch.nn.Conv1d",
"torch.nn.LayerNorm",
"torch.max",
"torch.zeros",
"torch.LongTensor",
"torch.cat",
... |
hisiter97/Transformer_OCR_API | [
"78322ec2b9648d0b027326dced7c4aec967bcab3"
] | [
"vietocr/model/trainer.py"
] | [
"from vietocr.optim.optim import ScheduledOptim\nfrom vietocr.optim.labelsmoothingloss import LabelSmoothingLoss\nfrom torch.optim import Adam, SGD, AdamW\nfrom torch import nn\nfrom vietocr.tool.translate import build_model\nfrom vietocr.tool.translate import translate, batch_translate_beam_search\nfrom vietocr.to... | [
[
"torch.utils.data.DataLoader",
"torch.load",
"torch.optim.lr_scheduler.OneCycleLR",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.axis",
"torch.save",
"torch.no_grad",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.show",
"torch.device",
"numpy.mean"
]
] |
ad-daniel/opendr | [
"cc71138ae22ec39b186960ff98c74bc2cdca3623"
] | [
"tests/sources/tools/perception/object_detection_2d/gem/test_gem.py"
] | [
"# Copyright 2020-2022 OpenDR European Project\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 applicab... | [
[
"torch.cuda.is_available",
"torch.equal"
]
] |
ryosukehata/pytorch-lightning | [
"a5bd2edefbafa6e03acffd4ba1a8816bbc1682a3"
] | [
"pl_examples/basic_examples/lightning_module_template.py"
] | [
"\"\"\"\nExample template for defining a system\n\"\"\"\nimport os\nfrom argparse import ArgumentParser\nfrom collections import OrderedDict\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision.transforms as transforms\nfrom torch import optim\nfrom torch.utils.data import Dat... | [
[
"torch.optim.lr_scheduler.CosineAnnealingLR",
"torch.utils.data.DataLoader",
"torch.nn.functional.log_softmax",
"torch.sum",
"torch.nn.Linear",
"torch.utils.data.distributed.DistributedSampler",
"torch.nn.BatchNorm1d",
"torch.argmax",
"torch.nn.functional.nll_loss",
"torch.... |
ajshajib/fabspec | [
"0fec1595a4525215bbabd1f2480d1d31a86d955e"
] | [
"fabspec/spectra.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nThis module defines the class Spectra() that contains a spectra and\nrelevant information.\n\"\"\"\n\nimport numpy as np\nfrom scipy.interpolate import interp1d\nfrom copy import deepcopy\n\n\nclass Spectra(object):\n \"\"\"\n Contains a spectra and relevant information.\n ... | [
[
"scipy.interpolate.interp1d",
"numpy.diff",
"numpy.median",
"numpy.arange",
"numpy.array"
]
] |
edward-io/pytorch | [
"04caef8e1d4f951cc380d6cebb9967b71695de13"
] | [
"torch/profiler/profiler.py"
] | [
"import gzip\nimport json\nimport os\nimport tempfile\nfrom enum import Enum\nfrom typing import Any, Callable, Iterable, Optional\nfrom warnings import warn\n\nimport torch\nimport torch.autograd.profiler as prof\nfrom torch.autograd import kineto_available, ProfilerActivity\n\n\nclass ProfilerAction(Enum):\n \... | [
[
"torch.distributed.get_backend",
"torch.distributed.get_rank",
"torch.autograd._add_metadata_json",
"torch.distributed.get_world_size",
"torch.distributed.is_available",
"torch.distributed.is_initialized",
"torch.autograd._supported_activities",
"torch.autograd.kineto_available",
... |
JhonLiuljs/tensorflow_demo | [
"0757f81a2c8baae41fce586e5d86f7312f46fda6"
] | [
"1.Cnn_Captcha/gen_captcha.py"
] | [
"# coding:utf-8\nfrom captcha.image import ImageCaptcha # pip install captcha\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom PIL import Image\nimport random\nimport time\nimport sys\n\nfrom constants import number\nfrom constants import alphabet\nfrom constants import ALPHABET\n\n\n# 验证码一般都无视大小写;验证码长度4... | [
[
"numpy.array",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.imshow",
"numpy.mean"
]
] |
yoheikikuta/a-primer-on-adversarial-examples | [
"1f4bea303b01b140b3a022cc7448ad3daaae3447"
] | [
"data.py"
] | [
"import random\nfrom abc import ABC, abstractmethod\n\nimport torch\nimport torchvision\nimport torchvision.transforms as transforms\nimport torchvision.transforms.functional as F\n\n\nclass Data(ABC):\n \"\"\"Data represents an abstract class providing interfaces.\n\n Attributes\n ----------\n base_dit... | [
[
"torch.utils.data.DataLoader"
]
] |
fenning-research-group/sentaurus_ddd | [
"e9e7a9b86c8b87cafff0b69c4a0f83c2fe292a45"
] | [
"DatAnalysis.py"
] | [
"# DatAnalysis.py\n# Module containing data analysis functions used for the DDD model\n\nimport os\nimport re # Regular Expression package\nimport pdb # debugger\nimport numpy as np\nimport matplotlib.pyplot as plt # plotting package\n#import readh5conc\nimport csv\nimport h5py\nfrom scipy import signal\nfrom scipy... | [
[
"matplotlib.pyplot.yscale",
"numpy.asarray",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot",
"numpy.isfinite",
"matplotlib.pyplot.figure",
"numpy.reshape",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.rcParams.update",
"scipy.i... |
bdice/pymbar | [
"22c327bcdde20f7c6256b3eb0de2efc4939e77c8"
] | [
"pymbar/tests/test_covariance.py"
] | [
"import numpy as np\nimport pymbar\nfrom pymbar.utils_for_testing import eq, suppress_derivative_warnings_for_tests\n\ndef load_oscillators(n_states, n_samples):\n name = \"%dx%d oscillators\" % (n_states, n_samples)\n O_k = np.linspace(1, 5, n_states)\n k_k = np.linspace(1, 3, n_states)\n N_k = (np.one... | [
[
"numpy.ones",
"numpy.exp",
"numpy.linspace",
"numpy.zeros"
]
] |
xunhen/HRNet-Object-Detection | [
"44f641da00810c61e217c1080ef1b45d39df484f"
] | [
"mmdet/ops/nms/setup.py"
] | [
"import os.path as osp\nfrom setuptools import setup, Extension\n\nimport numpy as np\nfrom Cython.Build import cythonize\nfrom Cython.Distutils import build_ext\nfrom torch.utils.cpp_extension import BuildExtension, CUDAExtension\n\next_args = dict(\n include_dirs=[np.get_include()],\n language='c++',\n e... | [
[
"torch.utils.cpp_extension.CUDAExtension",
"numpy.get_include"
]
] |
mrsempress/stereo | [
"c7465e92d9d03f73c13011125bdd02c33def6c19"
] | [
"epilines.py"
] | [
"\"\"\"\nIt is for Epipolar geometry\n\"\"\"\n\nimport numpy as np\nimport cv2\nfrom matplotlib import pyplot as plt\n\n\ndef Epipolar_geometry(leftpath, rightpath):\n \"\"\"\n :param leftpath: The path of left images\n :param rightpath: The path of right images\n :return:\n \"\"\"\n # objP = np.z... | [
[
"numpy.float32",
"numpy.int32",
"matplotlib.pyplot.subplot",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"numpy.random.randint"
]
] |
vednatnaik/sip_calculator | [
"84da3c5c314f4da27dea2bccc0c05620cd18ec6c"
] | [
"Yearly_Sip_calculator.py"
] | [
"import matplotlib\r\nmatplotlib.use('WebAgg')\r\nfrom matplotlib import pyplot as plt\r\n\r\ndef sip_calculator (sip_amount, years, IntrestRate):\r\n\r\n current_amount = sip_amount\r\n current_amount = sip_amount + (current_amount * IntrestRate) / 100\r\n\r\n print(f\"first month return {current_amount}\... | [
[
"matplotlib.pyplot.Circle",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.pie",
"matplotlib.pyplot.show",
"matplotlib.use"
]
] |
vita-epfl/openpifpaf_posetrack | [
"282ba063450d523728637167420d9ade4d9c1e65"
] | [
"openpifpaf_posetrack/transforms/scale.py"
] | [
"import logging\n\nimport numpy as np\nimport PIL\n\nimport openpifpaf\nfrom openpifpaf.transforms.scale import _scale\n\nLOG = logging.getLogger(__name__)\n\n\nclass ScaleMix(openpifpaf.transforms.Preprocess):\n def __init__(self, scale_threshold, *,\n upscale_factor=2.0,\n downs... | [
[
"numpy.sqrt",
"numpy.all",
"numpy.any"
]
] |
FunByJohn/QaDiL | [
"9e22bb061c5a2c32473c7ab3aa9b9cce4e98c963"
] | [
"Notes/IMO21/img/Matplotlib/sephp.py"
] | [
"#import numpy as np\nimport matplotlib\n#matplotlib.rcParams['text.usetex'] = True\nimport matplotlib.pyplot as plt\n\nplt.plot([1.35, 1.42, 1.45, 1.52], [35, 50, 40, 45], 'ro')\n\nplt.plot([1.68, 1.70, 1.73, 1.73], [65, 70, 60, 80], 'bo')\n\nplt.axis([1.3, 1.8, 30, 90])\n\nplt.xlabel(\"height (m)\")\n\nplt.ylabel... | [
[
"matplotlib.pyplot.axis",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel"
]
] |
timudk/probability | [
"8bdbf1c0b0f801edaf342f4ffc9caf1cfd6f1103"
] | [
"tensorflow_probability/python/internal/special_math.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.compat.v2.square",
"numpy.log",
"tensorflow.compat.v2.name_scope",
"tensorflow.compat.v2.constant",
"tensorflow.compat.v2.math.log",
"tensorflow.compat.v2.zeros_like",
"tensorflow.compat.v2.less",
"tensorflow.compat.v2.convert_to_tensor",
"tensorflow.compat.v1.where... |
suytingwan/models | [
"ccdbfe77d071cc19b55fb9f4b738912e35d982ef",
"ccdbfe77d071cc19b55fb9f4b738912e35d982ef"
] | [
"PaddleCV/video/metrics/youtube8m/eval_util.py",
"dygraph/bmn/model.py"
] | [
"# Copyright 2016 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by app... | [
[
"numpy.sum",
"numpy.argpartition",
"numpy.argmax",
"numpy.arange",
"numpy.average",
"numpy.mean"
],
[
"numpy.array"
]
] |
Faiz99khan/ISL_hand_gesture_recognition_in_real-time | [
"dade99478e9b37440ebe7fb7842d451582132f0a"
] | [
"models/resnet.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport math\nfrom functools import partial\n\n__all__ = [\n 'ResNet', 'resnet10', 'resnet18', 'resnet34', 'resnet50', 'resnet101',\n 'resnet152', 'resnet200'\n]\n\n\ndef conv3x3x3(in_planes, out_planes,... | [
[
"torch.nn.init.kaiming_normal",
"torch.nn.MaxPool3d",
"torch.nn.BatchNorm3d",
"torch.nn.Linear",
"torch.nn.Sequential",
"torch.nn.AvgPool3d",
"torch.nn.Conv3d",
"torch.nn.functional.avg_pool3d",
"torch.nn.ReLU",
"torch.cat"
]
] |
ghmagazine/python_ml_book | [
"57e874fd4fa86abaa2e2d032d18946942cf50c42"
] | [
"03/evaluation.py"
] | [
"from sklearn import tree\nfrom sklearn.datasets import load_wine\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import classification_report\n\nwine = load_wine()\ndata = wine.data\ntarget = wine.target\nX_train, X_test, Y_train, Y_test = train_test_split(data, target, test_size=0.2, r... | [
[
"sklearn.tree.DecisionTreeClassifier",
"sklearn.model_selection.train_test_split",
"sklearn.metrics.classification_report",
"sklearn.datasets.load_wine"
]
] |
cdbethune/d3m-primitives | [
"5530da1b8efba7de8cec6890401c5d4091acd45a"
] | [
"scripts/plot_forecasting_comparison.py"
] | [
"from typing import List\n\nimport pandas as pd\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nsns.set(style=\"whitegrid\")\n\nfrom compare_forecasting_methods import pred_lengths\n\ndef to_query(\n elements: List[str],\n):\n if len(elements) == 1:\n return elements[0]\n else:\n ret... | [
[
"matplotlib.pyplot.xticks",
"pandas.read_csv",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.title",
"matplotlib.pyplot.subplots_adjust",
"matplotlib.pyplot.xlabel"
]
] |
YZ-Zheng/AI-Learns-Handwritten-Digits | [
"6ce2dcce7ed6e4689b3f7d0da3ddcf8ad06ce6ce"
] | [
"train_data.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn.functional as F\nimport torch.nn as nn\n\n\n# check if gpu is available\ndevice = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\n\n\nclass Flatten(nn.Module):\n \"\"\"\n performs the flatten operation\n \"\"\"\n def forward(self, input):\... | [
[
"torch.argmax",
"torch.tensor",
"torch.cuda.is_available",
"torch.nn.functional.cross_entropy",
"numpy.mean"
]
] |
ai2cm/fv3net | [
"e62038aee0a97d6207e66baabd8938467838cf51"
] | [
"workflows/diagnostics/fv3net/diagnostics/prognostic_run/computed_diagnostics.py"
] | [
"\"\"\"Utilities for loading computed diagnostics\n\n\"\"\"\nimport json\nfrom typing import Iterable, Hashable, Sequence, Tuple, Any, Set, Mapping\nimport os\nimport xarray as xr\nimport numpy as np\nimport fsspec\nimport pandas as pd\nfrom pathlib import Path\nfrom dataclasses import dataclass\nimport tempfile\n\... | [
[
"pandas.merge"
]
] |
karen-pal/scikit-learn | [
"2a67d88258264eb2b6dfad221be8f8d61684dcba"
] | [
"sklearn/cross_decomposition/tests/test_pls.py"
] | [
"import pytest\nimport numpy as np\nfrom numpy.testing import assert_array_almost_equal, assert_array_equal, assert_allclose\n\nfrom sklearn.datasets import load_linnerud\nfrom sklearn.cross_decomposition._pls import (\n _center_scale_xy,\n _get_first_singular_vectors_power_method,\n _get_first_singular_ve... | [
[
"numpy.diag",
"numpy.random.RandomState",
"sklearn.datasets.make_regression",
"sklearn.datasets.load_linnerud",
"sklearn.cross_decomposition._pls._center_scale_xy",
"numpy.abs",
"numpy.testing.assert_array_equal",
"sklearn.cross_decomposition._pls._get_first_singular_vectors_power_... |
rohithdesikan/evprediction | [
"3ea5a2b3db350397385c9c9835483eb7dfb2773b"
] | [
"app/app.py"
] | [
"# %%\nimport os\nimport numpy as np\nimport pandas as pd \nimport flask\nfrom flask import Flask, jsonify, request, make_response\nimport tensorflow as tf\n\nfrom evprediction import convert_to_array\n\n# %%\n# Load saved model\n# model_path = os.path.abspath(os.path.join(os.getcwd(), 'models'))\nmodel_name = 'evm... | [
[
"numpy.array",
"numpy.reshape",
"numpy.round",
"tensorflow.keras.models.load_model"
]
] |
prateekiiest/interpret | [
"b5530a587251a77516ab443037fc37f71708564c"
] | [
"python/interpret-core/interpret/glassbox/ebm/test/test_internal.py"
] | [
"# Copyright (c) 2019 Microsoft Corporation\n# Distributed under the MIT software license\n\nfrom ..internal import Native, NativeEBMBooster\n\nimport numpy as np\nimport ctypes as ct\nfrom contextlib import closing\n\ndef test_booster_internals():\n with closing(\n NativeEBMBooster(\n model_ty... | [
[
"numpy.array"
]
] |
mohammadpz/Associative_LSTM | [
"5094829ed8432be738c79c6a87396e0edf63b008"
] | [
"holographic_memory.py"
] | [
"import numpy as np\nimport theano\nimport theano.tensor as T\n# import matplotlib\n# matplotlib.use('Agg')\nimport matplotlib.pyplot as plt\n\nB = 10\nF = 110 * 110 * 3\nC = 20\n\n# shape: C x F/2\npermutations = []\nindices = np.arange(F / 2)\nfor i in range(C):\n np.random.shuffle(indices)\n permutations.a... | [
[
"numpy.vstack",
"numpy.load",
"numpy.random.shuffle",
"numpy.swapaxes",
"numpy.reshape",
"numpy.cos",
"numpy.arange",
"numpy.random.random",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.show",
"numpy.sin",
"numpy.concatenate"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.