repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
CMU-Light-Curtains/SafetyEnvelopes | [
"e2b32f99437ea36c8b22f97470c5a7f406d3ec78"
] | [
"policies/actors/nn/features/residual.py"
] | [
"from dataclasses import dataclass\nfrom typing import Optional, List\nimport numpy as np\n\nfrom devices.light_curtain import LCReturn\nimport utils\n\n\ndef _components_from_size(np_array: np.ndarray,\n sizes: List[int]):\n sizes = np.array(sizes, dtype=np.int)\n ends = sizes.cumsum... | [
[
"numpy.hstack",
"numpy.array",
"numpy.atleast_2d"
]
] |
afcarl/fed-rates-bot | [
"2c65fb834075ce9a1b145394fd4297bdaa803487"
] | [
"fed_bot/tests/tests.py"
] | [
"__author__ = 'allentran'\n\nimport numpy as np\n\nfrom ..scraper import Scraper\nfrom ..model import lstm, lstm_lasagne\n\ndef model_test():\n\n n_sentences = 6\n T = 21\n n_batch = 7\n vocab_size=55\n word_vector_size=111\n\n test_ob = dict(\n word_vectors=np.random.randint(0, vocab_size,... | [
[
"numpy.random.normal",
"numpy.ones",
"numpy.random.randn",
"numpy.random.randint"
]
] |
NadimKawwa/CybersecurityThreatIdentification | [
"e088dbb861342676337b4c9d385e6abfb6463291"
] | [
"combine_wild_cve.py"
] | [
"import os\nimport glob\nimport pandas as pd\nimport numpy as np\nfrom tqdm import tqdm\nimport pickle\nfrom copy import copy\n\n\ndef load_obj(path ):\n with open(path, 'rb') as f:\n return pickle.load(f)\n\n\ndef main():\n \"\"\"\n combines everything into one csv file\n \"\"\"\n #reading fr... | [
[
"pandas.DataFrame.from_dict"
]
] |
code4days/URLNet | [
"e5119168d6d1b681e74a8807d8b4075811b2b78a"
] | [
"test.py"
] | [
"from utils import * \nimport pickle \nimport time \nfrom tqdm import tqdm\nimport argparse\nimport numpy as np \nimport pickle \nimport tensorflow as tf \nfrom tensorflow.contrib import learn \nfrom tflearn.data_utils import to_categorical, pad_sequences\n\nparser = argparse.ArgumentParser(description=\"Test URLNe... | [
[
"tensorflow.Graph",
"tensorflow.train.latest_checkpoint",
"tensorflow.ConfigProto",
"numpy.concatenate",
"tensorflow.Session"
]
] |
ymjiang/imagenet18 | [
"c8c3806156d93c0c1fef1054803a241b89034ccb"
] | [
"training/dist_utils.py"
] | [
"import torch.distributed as dist\nfrom torch.nn.parallel import DistributedDataParallel\nimport os\nimport byteps.torch as bps\n\nclass DDP(DistributedDataParallel):\n # Distributed wrapper. Supports asynchronous evaluation and model saving\n def forward(self, *args, **kwargs):\n # DDP has a sync point on for... | [
[
"torch.distributed.all_reduce"
]
] |
rk2900/Unbiased-Learning-to-Rank-with-Unbiased-Propensity-Estimation | [
"85bb4241f18e4d118ac46961f55f6edb47509bc7"
] | [
"Unbiased_LTR/DLA/main.py"
] | [
"\"\"\"Training and testing the dual learning algorithm for unbiased learning to rank.\n\nSee the following paper for more information on the dual learning algorithm.\n\t\n\t* Qingyao Ai, Keping Bi, Cheng Luo, Jiafeng Guo, W. Bruce Croft. 2018. Unbiased Learning to Rank with Unbiased Propensity Estimation. In Proce... | [
[
"tensorflow.train.get_checkpoint_state",
"tensorflow.summary.FileWriter",
"tensorflow.app.flags.DEFINE_integer",
"tensorflow.ConfigProto",
"tensorflow.global_variables_initializer",
"tensorflow.app.flags.DEFINE_string",
"tensorflow.Session",
"tensorflow.app.flags.DEFINE_boolean",
... |
kyungkoo70/keras-image-captioning | [
"47be86a6de4c5747debb52c54789b44ef0934cd1"
] | [
"keras_image_captioning/dataset_providers.py"
] | [
"import numpy as np\n\nfrom copy import copy\nfrom math import ceil\nfrom operator import attrgetter\n\nfrom common_utils import flatten_list_2d\nfrom config import active_config\nfrom datasets import get_dataset_instance\nfrom preprocessors import CaptionPreprocessor, ImagePreprocessor\n\n\nclass DatasetProvider(o... | [
[
"numpy.random.shuffle"
]
] |
MasazI/cnn_depth_tensorflow | [
"7959165c8924394154c4229a4b24c163e6dc70e4"
] | [
"task.py"
] | [
"#encoding: utf-8\n\nfrom datetime import datetime\nfrom tensorflow.python.platform import gfile\nimport numpy as np\nimport tensorflow as tf\nfrom dataset import DataSet\nfrom dataset import output_predict\nimport model\nimport train_operation as op\n\nMAX_STEPS = 10000000\nLOG_DEVICE_PLACEMENT = True\nBATCH_SIZE ... | [
[
"tensorflow.train.get_checkpoint_state",
"tensorflow.Graph",
"tensorflow.Variable",
"numpy.isnan",
"tensorflow.train.start_queue_runners",
"tensorflow.train.Coordinator",
"tensorflow.global_variables",
"tensorflow.placeholder",
"tensorflow.trainable_variables",
"tensorflow.... |
brent-lemieux/fsdl-text-recognizer-2021-labs | [
"42529f580fb9d9995bfc94b30e63cc42af5753cf"
] | [
"lab3/text_recognizer/lit_models/base.py"
] | [
"import argparse\nimport pytorch_lightning as pl\nimport torch\n\n\nOPTIMIZER = \"Adam\"\nLR = 1e-3\nLOSS = \"cross_entropy\"\nONE_CYCLE_TOTAL_STEPS = 100\n\n\nclass Accuracy(pl.metrics.Accuracy):\n \"\"\"Accuracy Metric with a hack.\"\"\"\n\n def update(self, preds: torch.Tensor, target: torch.Tensor) -> Non... | [
[
"torch.optim.lr_scheduler.OneCycleLR",
"torch.nn.functional.softmax"
]
] |
arkmagus/tensor_rnn | [
"aa74a2414d6e46cc8ddf9be81f38eb262348194b"
] | [
"tensor_rnn/utils/data_util.py"
] | [
"import numpy as np\n\ndef iter_minibatches(indices, batchsize, shuffle=True, pad=False, excludes=None):\n \"\"\"\n Args:\n datasize : total number of data or list of indices\n batchsize : mini-batchsize\n shuffle :\n use_padding : pad the dataset if dataset can't divided by batchs... | [
[
"numpy.random.shuffle"
]
] |
Vrroom/IRL | [
"56caab14cc5084077e1db40995f778a0bbc9fe31"
] | [
"IRL.py"
] | [
"\"\"\" Main reward optimization loop \"\"\"\nimport Config as C\nimport numpy as np\nnp.random.seed(C.SEED)\nimport random\nrandom.seed(C.SEED)\nfrom RewardFnSpace import *\nimport pickle\nimport more_itertools\nfrom AcrobotUtils import *\nfrom scipy.spatial.distance import pdist, squareform\nimport os\nimport os.... | [
[
"numpy.random.seed",
"numpy.arange",
"numpy.stack",
"numpy.concatenate",
"numpy.mean",
"numpy.array",
"numpy.where"
]
] |
kuihao/KuihaoFL | [
"69c9161497f2a82ab8ef2d785a0c7e2e6975a328"
] | [
"Implement_google_AdaptiveFL/Print_Result_AvgLast100round.py"
] | [
"import numpy as np\n\ndef Result_AvgLast100round(forderpath, filename,):\n results_np = np.load(f\"{forderpath}/{filename}\", allow_pickle=True)\n '''解壓縮、匯入'''\n #print(results_np.files) # ['arr_0']\n #print(results_np['arr_0']) # {'loss': [], 'accuracy': [], 'top_k_categorical_accuracy': []}\n \n ... | [
[
"numpy.atleast_1d",
"numpy.load",
"numpy.mean"
]
] |
N-SPC700/corrscope | [
"9e85a33fbede1e53c20f4e05d71384d276c9f9a9"
] | [
"corrscope/triggers.py"
] | [
"from abc import ABC, abstractmethod\nfrom typing import TYPE_CHECKING, Type, Optional, ClassVar, Union\n\nimport attr\nimport numpy as np\n\nimport corrscope.utils.scipy.signal as signal\nimport corrscope.utils.scipy.windows as windows\nfrom corrscope.config import KeywordAttrs, CorrError, Alias, with_units\nfrom ... | [
[
"numpy.log",
"numpy.minimum",
"numpy.linspace",
"numpy.isnan",
"numpy.add.reduce",
"numpy.ones",
"numpy.argmax",
"numpy.copysign",
"numpy.tanh",
"numpy.zeros",
"numpy.empty"
]
] |
haochen12/dpPython | [
"c6b58c12786e8b17728b9683f665efebcada43ec"
] | [
"myworkspace/translate_tutorial/ch15.py"
] | [
"# Visualize training history\nfrom tensorflow.keras.models import Sequential\nfrom tensorflow.keras.layers import Dense\nimport matplotlib.pyplot as plt\nimport numpy\n\n# fix random seed for reproducibility\nseed = 7\nnumpy.random.seed(seed)\n# load pima indians dataset\ndataset = numpy.loadtxt(\"pima-indians-dia... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.title",
"numpy.random.seed",
"tensorflow.keras.layers.Dense",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"tensorflow.keras.models.Sequential",
"numpy.loadtxt",
"matplotlib.pyplot.ylabel"
]... |
SachinVarghese/edge-cloud-inference | [
"ddf7de798d6e4dee2294df41c8ffde1b94b41dbc"
] | [
"src/train.py"
] | [
"from src.data import IrisData\nfrom sklearn.linear_model import LogisticRegression\nfrom xgboost import XGBClassifier\nimport joblib\n\nEdgeModelFolder = \"edge\"\nCloudModelFolder = \"cloud\"\n\n\ndef train_edge_model(data: IrisData, artifacts_folder: str):\n logreg = LogisticRegression(C=1e5)\n logreg.fit(... | [
[
"sklearn.linear_model.LogisticRegression"
]
] |
RaphDal/GraphNAS | [
"acb1fb978e10481b4417b7b4a22aec0482d8ff6b"
] | [
"graphnas_variants/macro_graphnas/pyg/pyg_gnn_layer.py"
] | [
"import torch\nimport torch.nn.functional as F\nfrom torch.nn import Parameter\nfrom torch_geometric.nn.inits import glorot, zeros\nfrom torch_geometric.utils import remove_self_loops, add_self_loops, softmax\nfrom torch_geometric.utils.num_nodes import maybe_num_nodes\n\nfrom torch_scatter import scatter_add\n\nfr... | [
[
"torch.mm",
"torch.Tensor",
"torch.cat",
"torch.full",
"torch.nn.functional.dropout",
"torch.nn.ModuleList",
"torch.tanh",
"torch.nn.Linear",
"torch.nn.functional.leaky_relu",
"torch.arange"
]
] |
KaenChan/ProbFace | [
"80a4de290ae583c81714bd3e3446c039a010e095",
"80a4de290ae583c81714bd3e3446c039a010e095"
] | [
"evaluation/lfw.py",
"evaluation/ijba.py"
] | [
"\"\"\"Test protocols on LFW dataset\n\"\"\"\n# MIT License\n# \n# Copyright (c) 2017 Yichun Shi\n# Copyright (c) 2021 Kaen Chan\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 wi... | [
[
"numpy.array",
"numpy.zeros",
"numpy.mean"
],
[
"numpy.stack",
"numpy.concatenate",
"numpy.std",
"numpy.mean",
"numpy.array"
]
] |
rpradal/cvxpy | [
"86307f271819bb78fcdf64a9c3a424773e8269fa",
"222ae345d2df67040346267f55369d8433d2e50f"
] | [
"cvxpy/tests/test_qp_solvers.py",
"cvxpy/tests/test_problem.py"
] | [
"\"\"\"\n\nCopyright 2013 Steven Diamond, 2017 Robin Verschueren\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by app... | [
[
"numpy.dot",
"numpy.maximum",
"numpy.sqrt",
"numpy.random.seed",
"numpy.power",
"numpy.linalg.inv",
"scipy.sparse.rand",
"scipy.linalg.lstsq",
"numpy.ones",
"numpy.atleast_2d",
"scipy.sparse.random",
"numpy.random.randn",
"numpy.random.rand",
"numpy.array"
... |
Christian8491/tpcx-bb | [
"936b5343c61880fac31c52ad795f81255f5aaa93"
] | [
"tpcx_bb/queries/q16/tpcx_bb_query_16.py"
] | [
"#\n# Copyright (c) 2019-2020, NVIDIA CORPORATION.\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... | [
[
"numpy.datetime64"
]
] |
Erfi/stable-baselines3 | [
"a31863e1db4fe58ad06ed45fb6e0169b0db56a9c"
] | [
"stable_baselines3/petssac/petssac.py"
] | [
"from typing import List, Dict, Tuple, Any\n\nimport numpy as np\nimport torch as th\nfrom torch.nn import functional as F\n\nfrom gym.envs.mujoco.mujoco_env import MujocoEnv\nfrom stable_baselines3.sac import SAC\nfrom stable_baselines3.common import logger\nfrom stable_baselines3.common.vec_env import DummyVecEnv... | [
[
"torch.nn.functional.mse_loss",
"torch.no_grad",
"torch.min",
"numpy.mean"
]
] |
ofazzito/yolov4-deepsort | [
"bac1e8f800f3074e89bb6980a7787be636e5cd58"
] | [
"alpr/ocr.py"
] | [
"import tensorflow as tf\nimport numpy as np\nimport cv2\nimport string\n\nMODELOS = {\n 1: 'alpr/models/ocr/m1_2.0M_GPU',\n 2: 'alpr/models/ocr/m2_1.5M_GPU',\n 3: 'alpr/models/ocr/m3_1.3M_CPU',\n 4: 'alpr/models/ocr/m4_1.1M_CPU',\n}\n\n\nclass PlateOCR:\n '''\n Modulo encargado del reconocimiento... | [
[
"tensorflow.constant",
"tensorflow.saved_model.load",
"numpy.max",
"numpy.argmax",
"numpy.mean"
]
] |
anonymousUpdatar/fse22_prompt | [
"68a0ce66e2965dd9456a6834e202725f0d8a3117"
] | [
"defect/prompt/run.py"
] | [
"from __future__ import absolute_import, division, print_function\n\nimport argparse\nimport glob\nimport logging\nimport os\nimport pickle\nimport random\nimport re\nimport shutil\n\nimport numpy as np\nimport torch\nfrom torch.utils.data import DataLoader, Dataset, SequentialSampler, RandomSampler,TensorDataset\n... | [
[
"torch.manual_seed",
"torch.cuda.manual_seed",
"numpy.random.seed",
"torch.tensor"
]
] |
bobiblazeski/navigation | [
"bb863b4475a90ff26bede20af647ae4882a0f6fb"
] | [
"agent.py"
] | [
"import numpy as np\nimport random\nfrom collections import namedtuple, deque\n\n\nimport torch\nimport torch.nn.functional as F\nimport torch.optim as optim\n\n\nfrom lib.network import QNetwork, DuelingQNetwork\nfrom lib.replay_buffer import ReplayBuffer\nfrom lib.priority_buffer import PriorityBuffer\n\n\nBUFFER... | [
[
"torch.max",
"torch.load",
"numpy.arange",
"torch.from_numpy",
"torch.nn.functional.mse_loss",
"torch.no_grad",
"torch.cuda.is_available",
"torch.squeeze"
]
] |
kchen92/graphnav | [
"7c2159b876ac377e6ff075ae6c7201036144f4f2"
] | [
"src/semnav/lib/navigation_plan.py"
] | [
"from __future__ import print_function\n\nimport numpy as np\n\nfrom collections import namedtuple, OrderedDict\n\nfrom semnav_ros.msg import NavCommandGoal\nfrom semnav.lib.categories import NavPlanDifficulty\n\n\nNavigationGoal = namedtuple('NavigationGoal', ['start_node', 'end_node'])\n\n\nclass NavigationPlan(o... | [
[
"numpy.linalg.norm"
]
] |
condereis/kaggle-mnist | [
"51c6935fccb1545dcbf3160e9041f3dc89f1a304"
] | [
"src/models/predict.py"
] | [
"import click\nimport json\nimport numpy as np\nimport os\nimport pandas as pd\nimport sys\nimport tensorflow as tf\n\nimport logreg\nimport convnn\n\n\n@click.command()\n@click.option('--model', type=click.Choice(['logreg', 'convnn']), default='convnn')\ndef main(model):\n # Load data\n project_dir = os.path... | [
[
"pandas.read_csv"
]
] |
EmeseThamo/rl-attack | [
"2bb72aed3c684d2f88eec84df9b82b0099de8b25"
] | [
"enjoy-adv.py"
] | [
"\"\"\" DQN - Test-time attacks\n\n============ Sample usage ============ \n\nNo attack, testing a DQN model of Breakout trained without parameter noise:\n$> python3 enjoy-adv.py --env Breakout --model-dir ./data/Breakout/model-173000 --video ./Breakout.mp4\n\nNo attack, testing a DQN model of Breakout trained with... | [
[
"tensorflow.train.Saver",
"tensorflow.Graph",
"numpy.array",
"tensorflow.Session"
]
] |
julianyulu/SyncNetCN | [
"cdd378aa3a2ac5a3a3edef5edc0478ae66da041d"
] | [
"SyncNet/runner.py"
] | [
"import os\nimport glob \nimport torch\nimport argparse\nfrom tqdm import tqdm \nfrom .dataset import Dataset\nfrom .model import SyncNet\nfrom omegaconf import OmegaConf \nfrom torch.utils import data as data_utils\nfrom utils import wandb_utils\nfrom utils.batch_sampler import RandomEntryBatchSampler\nimport pdb ... | [
[
"torch.load",
"torch.utils.data.DataLoader",
"torch.nn.BCELoss",
"torch.nn.DataParallel",
"torch.nn.functional.cosine_similarity",
"torch.no_grad",
"torch.cuda.is_available",
"torch.cuda.device_count",
"torch.save"
]
] |
statmlben/CUHK-STAT3009 | [
"6cf8f70a8533ba15abbfb5f50db17cb01fc56410"
] | [
"TF-Ranking/examples/keras/tfrbert_antique_train.py"
] | [
"# Copyright 2021 The TensorFlow Ranking 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 appli... | [
[
"tensorflow.io.FixedLenFeature"
]
] |
AlexMuresan/single_person_tracker | [
"17bbdf48e1ef6618cbe8ce0f31a5febc02adc22d"
] | [
"demo_script_video_parallel.py"
] | [
"import os\nimport cv2\nimport copy\nimport torch\nimport warnings\nimport numpy as np\n\nfrom threading import Thread\nfrom datetime import datetime\n\nfrom tqdm import tqdm\nfrom utils import get_gt\nfrom utils import get_pred\nfrom utils import load_model\nfrom utils import xywh2xyxy\n\nfrom utils import draw_bo... | [
[
"numpy.ones_like",
"torch.Tensor",
"numpy.stack",
"numpy.zeros_like",
"numpy.mean",
"numpy.array"
]
] |
neolixcn/LaneATT | [
"146b72de909ff0561b84d51f63f7cfb51e18f7aa"
] | [
"lib/experiment.py"
] | [
"import os\nimport re\nimport json\nimport logging\nimport subprocess\n\nimport torch\nfrom torch.utils.tensorboard import SummaryWriter\n\n\nclass Experiment:\n def __init__(self, exp_name, args=None, mode='train', exps_basedir='experiments', tensorboard_dir='tensorboard'):\n self.name = exp_name\n ... | [
[
"torch.load"
]
] |
fossabot/unifacisa-visao-computacional | [
"14aef22a3e7fe10ee820d31ce12ad21a3cad7b0b"
] | [
"modulo2/5-publicacao/5.2-servidor/servidor/models.py"
] | [
"import torch.nn.functional as F\n\nfrom utils.google_utils import *\nfrom utils.parse_config import *\nfrom utils.utils import *\n\nONNX_EXPORT = False\n\n\ndef create_modules(module_defs, img_size, arc):\n # Constructs module list of layer blocks from module configuration in module_defs\n\n hyperparams = mo... | [
[
"torch.nn.functional.softmax",
"torch.nn.functional.interpolate"
]
] |
ykanebako/AI-Feynman | [
"1f937533a7e510e31c704ec8ac343c770630f17a"
] | [
"aifeynman/S_NN_get_gradients.py"
] | [
"# SAve a file with 2*(n-1) columns contaning the (n-1) independent variables and the (n-1) gradients of the trained NN with respect these variables\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport copy\nimport os\nimport sys\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nis_cu... | [
[
"torch.ones",
"torch.tensor",
"torch.cuda.is_available",
"numpy.column_stack",
"numpy.savetxt",
"torch.autograd.grad",
"numpy.loadtxt"
]
] |
Saphron-Asia/nan.ai-ml-ocr | [
"bcae3eaed21f61a1c4478a1bc7510197e99b3979"
] | [
"data extraction/word_detector_nn/src/dataloader.py"
] | [
"from collections import namedtuple\n\nimport cv2\nimport numpy as np\nimport torch\n\nfrom aabb import AABB\nfrom coding import encode\nfrom utils import compute_scale_down, prob_true\n\nDataLoaderItem = namedtuple('DataLoaderItem', 'batch_imgs,batch_gt_maps,batch_aabbs')\n\n\nclass DataLoaderIAM:\n \"\"\"loade... | [
[
"torch.from_numpy",
"numpy.random.shuffle",
"numpy.stack",
"numpy.ones",
"numpy.float32",
"numpy.random.triangular",
"numpy.random.uniform",
"numpy.random.randint"
]
] |
xufuzhi/crnn_pytorch | [
"0e07d1269339101f147a0d83bb41a006cd0406d9"
] | [
"train.py"
] | [
"import argparse\nimport time\n\nimport torch\nimport torch.backends.cudnn as cudnn\nimport torch.optim as optim\nimport torch.utils.data\nfrom torch.nn import CTCLoss\nimport os\nfrom utils import utils, dataset\n\nimport models.crnn as crnn\nimport verify\n\ncudnn.benchmark = True\n\n\n# custom weights initializa... | [
[
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.empty",
"torch.load",
"torch.nn.CTCLoss",
"torch.cuda.is_available"
]
] |
parkjan4/DSIP | [
"9a1fabd1b87f70d5f94a14b6c5adc0c6895cfbf0"
] | [
"ProblemSet3/Churn prediction.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[16]:\n\n\nget_ipython().run_line_magic('pylab', 'inline --no-import-all')\n\nfrom scipy import interp\n\nimport pandas as pd\nfrom pandas.api.types import CategoricalDtype\n\nimport sklearn\nfrom sklearn import ensemble, model_selection, metrics\nimport xgboost\nfrom ... | [
[
"sklearn.metrics.roc_auc_score",
"pandas.api.types.CategoricalDtype",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.metrics.accuracy_score",
"sklearn.model_selection.train_test_split",
"sklearn.model_selection.StratifiedKFold",
"sklearn.metrics.roc_curve",
"sklearn.metrics.av... |
Nordant/plantstat | [
"50f43f55b2b9895132fe840b426a7d58b41a76c0"
] | [
"plantstat/vision/stomata_vision.py"
] | [
"import numpy as np\r\nimport pandas as pd\r\nimport random, os, cv2, glob\r\nimport matplotlib.pyplot as plt\r\nfrom tqdm import tqdm\r\nimport torch\r\nimport torchvision\r\nfrom torchvision import transforms\r\nfrom torch.utils.data import DataLoader\r\nfrom google_drive_downloader import GoogleDriveDownloader a... | [
[
"matplotlib.pyplot.imshow",
"torch.sigmoid",
"pandas.Series",
"torch.cuda.manual_seed",
"numpy.random.seed",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"matplotlib.pyplot.savefig",
"numpy.concatenate",
"numpy.ceil",
"torch.set_grad_enabled",
"torch.cuda.is_... |
schlegelflegel/manim | [
"3e7bc9cc242e6d2da1c5346ad93fc9c964221bcb"
] | [
"manim/scene/scene.py"
] | [
"\"\"\"A Scene is the canvas of the animation.\"\"\"\n\n\n__all__ = [\"Scene\", \"EndSceneEarlyException\"]\n\n\nimport inspect\nimport random\nimport warnings\nimport platform\nimport copy\n\nfrom tqdm import tqdm as ProgressDisplay\nimport numpy as np\n\nfrom .. import camera_config, file_writer_config, logger\nf... | [
[
"numpy.arange",
"numpy.max",
"numpy.array",
"numpy.random.seed"
]
] |
muntumdwara/TopGun | [
"fc253faa8ac0a7c9b7d000c2ea018bba9c584d27"
] | [
"topgun/charting/overplot.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\" Overplot\n\nSeries of functions designed to help with charting in Plotly\n\n\"\"\"\n\nimport pandas as pd\nimport plotly.express as px\nimport plotly.graph_objs as go\nimport plotly.io as pio\n\n# %% PLOTLY EXPRESS STANLIB TEMPLATE\n\n# Approximatation of STANLIB colour theme\nCOLOU... | [
[
"pandas.concat",
"pandas.DataFrame"
]
] |
ea42gh/holoviews_functions | [
"e450617ac99656cd080a52437efb5bfc4bb49bc0"
] | [
"holoviews_functions/vectorfield.py"
] | [
"import numpy as np\nimport holoviews as hv\n\ndef vector_field_with_background(x,y, slopes, length=1, subsample=3):\n \"\"\"\n Given vectors x, y and an array of slopes(x,y)\n return a grayscale image of the slopes y' together with\n a vector field representation of the slopes\n \"\"\"\n\n ... | [
[
"numpy.arctan2",
"numpy.copy",
"numpy.full_like"
]
] |
Shinetism/MEE | [
"6ce38b4c930cdd50f69fd9f79e6dec441aa2d220"
] | [
"src/utils/grad_ckpt.py"
] | [
"import torch\nimport warnings\n\n\ndef detach_variable(inputs):\n if isinstance(inputs, tuple):\n out = []\n for inp in inputs:\n x = inp.detach()\n x.requires_grad = inp.requires_grad\n out.append(x)\n return tuple(out)\n else:\n raise RuntimeErro... | [
[
"torch.no_grad",
"torch.autograd.grad",
"torch.enable_grad"
]
] |
kaywenith/TorchMPS | [
"abd2dca54f3eb35b931cfb8c43ba09a6fa94ae49"
] | [
"torchmps/torchmps.py"
] | [
"\"\"\"\nTODO:\n (1) Update master to include all the new features in dynamic_capacity\n\"\"\"\nimport torch\nimport torch.nn as nn\n\nfrom .utils import init_tensor, svd_flex\nfrom .contractables import (\n SingleMat,\n MatRegion,\n OutputCore,\n ContractableList,\n EdgeVec,\n OutputMat,\n)\n\... | [
[
"torch.randn_like",
"torch.norm",
"torch.ones",
"torch.empty",
"torch.nn.Parameter",
"torch.cat",
"torch.zeros",
"torch.einsum",
"torch.nn.ModuleList",
"torch.eye",
"torch.tensor",
"torch.exp",
"torch.no_grad",
"torch.log",
"torch.stack"
]
] |
atultherajput/machine-learning | [
"7bb6de78f8bc482bf74a115c3db009011c38c454"
] | [
"naive_bayes/nb_author_id.py"
] | [
"#!/usr/bin/env python3\n\n\"\"\"\n\n Use a Naive Bayes Classifier to identify emails by their authors\n\n authors and labels:\n Sara has label 0\n Chris has label 1\n\"\"\"\n\nimport sys\nfrom time import time\nsys.path.append(\"../libraries/tools\")\nfrom email_preprocess import preprocess\n\n\n### fe... | [
[
"sklearn.naive_bayes.GaussianNB",
"sklearn.metrics.accuracy_score"
]
] |
amckenna41/pySAR | [
"f5f5dea252c04bcf40ed102e1353af9cedbd75a0"
] | [
"tests/test_proDSP.py"
] | [
"################################################################################\n################# ProDSP Module Tests #################\n################################################################################\n\nimport os\nimport sys\nimport pandas as pd\nimport numpy as np\nimp... | [
[
"numpy.all",
"numpy.isnan"
]
] |
manjitullal/spatiotemporal | [
"00d731b2c437ba2356fc1ccf4b3a73cf9ce76acc"
] | [
"src/Transformer/Batch.py"
] | [
"import torch\nfrom torchtext import data\nimport numpy as np\nfrom torch.autograd import Variable\n\n\ndef nopeak_mask(size, opt):\n np_mask = np.triu(np.ones((1, size, size)),\n k=1).astype('uint8')\n np_mask = Variable(torch.from_numpy(np_mask) == 0)\n# if opt.device == 0:\n# np_mask = np_mask.... | [
[
"torch.from_numpy",
"numpy.ones"
]
] |
RomainBrault/addons | [
"f5337ad39d12c7bc381006b86dffbf1c17e722a4"
] | [
"tensorflow_addons/image/tests/resampler_ops_test.py"
] | [
"# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requi... | [
[
"tensorflow.constant",
"numpy.pad",
"numpy.random.seed",
"numpy.clip",
"numpy.asarray",
"numpy.linspace",
"numpy.random.randn",
"tensorflow.test.compute_gradient",
"numpy.zeros_like",
"numpy.floor",
"numpy.random.rand",
"tensorflow.test.is_gpu_available",
"numpy... |
NeurIPS21-3353/CodeRepo | [
"514dce311daf5d075fa266c473aaa76885e078ad"
] | [
"loggers/plotting/basics.py"
] | [
"import os\n\nimport matplotlib\nimport numpy as np\nimport torch\n\nimport matplotlib.pyplot as plt\nfrom PIL import Image\nfrom matplotlib import cm\n\n\nclass TwoDimPlotter():\n def __init__(self, target, location, rotation=None, interval=1, range=5.5, steps=200):\n self.steps = steps\n self.tar... | [
[
"torch.abs",
"torch.linspace",
"matplotlib.pyplot.contourf",
"matplotlib.pyplot.tight_layout",
"torch.norm",
"matplotlib.pyplot.scatter",
"torch.zeros_like",
"matplotlib.rc",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.gcf",
"matplotlib.pyplot.clf",
"torch.Float... |
tobias17/CodeNamesOld | [
"10fdccc35b5a23eb68ed5d7e7257e9fe83977278"
] | [
"engine.py"
] | [
"from __future__ import print_function, division\n\nimport itertools\nimport re\nimport sys\nimport os\nimport platform\n\nimport numpy as np\nfrom datetime import datetime\n\nimport model\nfrom config import config\nfrom tqdm import tqdm\n\nCLUE_PATTERN = r\"^([a-zA-Z]+) ({0})$\"\nUNLIMITED = \"unlimited\"\n\ndisp... | [
[
"numpy.ones_like",
"numpy.random.RandomState",
"numpy.asarray",
"numpy.concatenate",
"numpy.array",
"numpy.where",
"numpy.empty"
]
] |
flurinus/IntTripAssignment | [
"9e6ce4c7ba21bb989537b6492b8f05b7cbb5a14e"
] | [
"src/area.py"
] | [
"import simpy\nimport math\nimport numpy as np\nfrom parameter import Parameter\n\nclass Area:\n \n def __init__(self, simEnv, surfaceArea, areaType):\n assert(surfaceArea > 0)\n assert(areaType in Parameter.maxFacilityDensity)\n \n self.streamList = list()\n \n #area... | [
[
"numpy.interp"
]
] |
ishine/phonetic_mlm | [
"91ae25fa3f3508a50d26f86029dbfde145686ecf"
] | [
"src/test_phonetic_mlm.py"
] | [
"import os\nimport argparse\nfrom pprint import pprint\n\nimport torch\nfrom torch.utils.data import DataLoader\nfrom transformers import BertTokenizer, BertForTokenClassification, BertForMaskedLM\nfrom tqdm import tqdm\n\nfrom dataset import prepare_data, TypoDataset\nfrom utils import load_config, RunningAverage\... | [
[
"torch.no_grad",
"torch.utils.data.DataLoader",
"torch.cuda.is_available",
"torch.load"
]
] |
birds-on-mars/birdsonearth | [
"62921423b787ad8b81b8e60e8de42a3f6e113d88"
] | [
"train.py"
] | [
"import sys, getopt\nimport imp\nimport params as p\nimport VGGish_model as m\nimport torch\nimport pickle\nimport os\n\nfrom utils import Dataset as d\nfrom utils import trainer as t\nfrom utils import preprocessing as pre\n\nimp.reload(p)\nimp.reload(d)\nimp.reload(m)\nimp.reload(t)\nimp.reload(pre)\n\n\ndef prep... | [
[
"torch.device",
"torch.nn.Linear",
"torch.nn.CrossEntropyLoss"
]
] |
dennis199441/Audio-Captcha-Recognition | [
"cd8a30a95daefb24cad7a9abe37604417f893484"
] | [
"src/utils.py"
] | [
"# -*- coding: utf-8 -*-\n#\n# This file is part of SIDEKIT.\n#\n# SIDEKIT is a python package for speaker verification.\n# Home page: http://www-lium.univ-lemans.fr/sidekit/\n#\n# SIDEKIT is a python package for speaker verification.\n# Home page: http://www-lium.univ-lemans.fr/sidekit/\n# \n# SIDEKIT is free s... | [
[
"numpy.diag",
"numpy.dot",
"numpy.resize",
"numpy.minimum",
"numpy.sqrt",
"numpy.round",
"numpy.zeros_like",
"scipy.fftpack.realtransforms.dct",
"numpy.hanning",
"numpy.exp",
"numpy.roll",
"numpy.hstack",
"numpy.arange",
"numpy.eye",
"numpy.roots",
"... |
lindylin1817/pytorch-image-models | [
"207b3607d196c4c095b13bcfd056b8c4617f0721"
] | [
"timm/models/layers/classifier.py"
] | [
"\"\"\" Classifier head and layer factory\n\nHacked together by / Copyright 2020 Ross Wightman\n\"\"\"\nfrom torch import nn as nn\nfrom torch.nn import functional as F\n\nfrom .adaptive_avgmax_pool import SelectAdaptivePool2d\nfrom .linear import Linear\n\n\ndef _create_pool(num_features, num_classes, pool_type='a... | [
[
"torch.nn.Identity",
"torch.nn.Conv2d",
"torch.nn.Flatten"
]
] |
Leedehai/taichi | [
"3aae973ae4e214c5c0f8d6fe8a5b290a9ade5fc9"
] | [
"examples/particle_renderer.py"
] | [
"import taichi as ti\nimport numpy as np\nimport math\nimport time\nfrom renderer_utils import out_dir, ray_aabb_intersection, inf, eps, \\\n intersect_sphere, sphere_aabb_intersect_motion, inside_taichi\n\nti.init(arch=ti.cuda, device_memory_GB=4)\n\nres = 1280, 720\nnum_spheres = 1024\ncolor_buffer = ti.Vector(3... | [
[
"numpy.zeros",
"numpy.random.rand"
]
] |
crazysal/chemml | [
"300ed183c623fc8762ed2343e48c9e2ac5102c0f"
] | [
"chemml/chem/magpie_python/attributes/generators/crystal/CoulombMatrixAttributeGenerator.py"
] | [
"import types\nimport numpy as np\nimport pandas as pd\nfrom ....data.materials.CrystalStructureEntry import CrystalStructureEntry\nfrom ....models.regression.crystal.CoulombSineMatrixRegression import \\\n CoulombSineMatrixRegression\n\nclass CoulombMatrixAttributeGenerator:\n \"\"\"Class to compute attribut... | [
[
"numpy.zeros",
"pandas.DataFrame"
]
] |
wjbKimberly/DetectAndTrack-wjb | [
"e8f065ce389d559307f48b5de3fbb0a417b7faea"
] | [
"lib/datasets/posetrack/poseval/py/evaluatePCKh.py"
] | [
"import numpy as np\nimport json\nimport os\nimport sys\n\nimport eval_helpers\n\ndef computeDist(gtFrames,prFrames):\n assert(len(gtFrames) == len(prFrames))\n\n nJoints = eval_helpers.Joint().count\n distAll = {}\n for pidx in range(nJoints):\n distAll[pidx] = np.zeros([0,0])\n \n for... | [
[
"numpy.subtract",
"numpy.append",
"numpy.zeros",
"numpy.argwhere"
]
] |
shih29242890/x100x1000_donkeycar | [
"cdd75d64843d1e5d20ad8a0aa68c9f311c33bcfb"
] | [
"donkeycar/templates/complete.py"
] | [
"#!/usr/bin/env python3\n\"\"\"\nScripts to drive a donkey 2 car\n\nUsage:\n manage.py (drive) [--model=<model>] [--js] [--type=(linear|categorical|rnn|imu|behavior|3d|localizer|latent)] [--camera=(single|stereo)] [--meta=<key:value> ...]\n manage.py (train) [--tub=<tub1,tub2,..tubn>] [--file=<file> ...] (--m... | [
[
"tensorflow.python.keras.models.model_from_json"
]
] |
ArvindSoma/HumanEstimation | [
"8bbdfbe54ce377d197a477cbef0b8a89154531eb"
] | [
"utils/prep_densepose.py"
] | [
"import os\nimport sys\nimport argparse\nimport pickle\nimport numpy as np\nimport cv2\nimport torch\nfrom scipy import io as io\n\nfrom pycocotools.coco import COCO\nimport pycocotools.mask as mask_util\n\nimport trimesh\nfrom tqdm import tqdm\n\nfrom utils.render_utils import Render, match_faces\n\n\nfrom externa... | [
[
"scipy.io.loadmat",
"torch.from_numpy",
"numpy.ones",
"numpy.zeros_like",
"torch.nn.functional.grid_sample",
"numpy.array",
"numpy.zeros",
"numpy.where"
]
] |
stefan-f-bucher/PyDDM | [
"6476a7268daebab4e599e1f1ab566a4100947a55"
] | [
"integration_tests.py"
] | [
"import unittest\nfrom unittest import TestCase, main\nimport numpy as np\nfrom math import fsum\nimport pandas\n\nimport ddm\n\nSHOW_PLOTS = False\n\nif SHOW_PLOTS:\n import ddm.plot\n import matplotlib.pyplot as plt\n\ndef _modeltest_numerical_vs_analytical(m, conditions={}, method=None, max_diff=.1, mean_d... | [
[
"numpy.random.rand",
"matplotlib.pyplot.show",
"numpy.abs"
]
] |
jlandercy/odapi | [
"781aa95ef346f8d5f1d727a19ae078687cc4cc36"
] | [
"odapi/toolbox/psychro.py"
] | [
"import numpy as np\nfrom scipy import optimize\nimport matplotlib.pyplot as plt\nfrom matplotlib.patches import Polygon\nfrom matplotlib.collections import PatchCollection\n\n\nclass Constants:\n \"\"\"\n Physical Constants\n \"\"\"\n R = 8.314472 # [J/mol.K]\n T0K = 273.15 ... | [
[
"numpy.linspace",
"numpy.arange",
"matplotlib.pyplot.subplots",
"numpy.full",
"numpy.array",
"numpy.exp",
"numpy.flip"
]
] |
albertaillet/MLP_function_approx | [
"8b91467b8321eefd1de6aa29dd8593f7e6d5d08b"
] | [
"MLP_squared.py"
] | [
"# This script trains a MLP to approximate x^2\n# Model source: https://sonnet.dev/\n# Number of trainable source:\n# https://stackoverflow.com/questions/38160940/how-to-count-total-number-of-trainable-parameters-in-a-tensorflow-model\nimport numpy as np\nimport sonnet as snt\nimport tensorflow as tf\nimport matplo... | [
[
"numpy.square",
"matplotlib.pyplot.legend",
"tensorflow.convert_to_tensor",
"matplotlib.pyplot.title",
"numpy.linspace",
"tensorflow.compat.v1.losses.mean_squared_error",
"matplotlib.pyplot.plot",
"numpy.random.uniform",
"tensorflow.GradientTape",
"numpy.mean",
"numpy.p... |
JoshuaHaustein/oracle_server | [
"9dc54cd03e28eee6d546b811ce32bcc4d16cec0c"
] | [
"python_src/utils.py"
] | [
"import torch\nfrom torch.autograd import Variable\n\n\nclass Normalization(torch.nn.Module):\n\n def __init__(self, n_features):\n super(Normalization, self).__init__()\n self.register_buffer('mean', torch.zeros(n_features))\n self.register_buffer('std', torch.ones(n_features))\n \n ... | [
[
"torch.autograd.Variable",
"torch.ones",
"torch.zeros"
]
] |
ratschlab/projects2017-kG | [
"dfbebe4139d248ed229d783b72fb309d97bc9c84"
] | [
"kv/kv_class.py"
] | [
"# Copyright 2017 Max Planck Society\n# Distributed under the BSD-3 Software license,\n# (See accompanying file ./LICENSE.txt or copy at\n# https://opensource.org/licenses/BSD-3-Clause)\n\"\"\"This class implements VAE training.\n\n\"\"\"\n\nimport os\nimport logging\nimport tensorflow as tf\nimport utils\nfrom uti... | [
[
"tensorflow.nn.relu",
"tensorflow.device",
"tensorflow.nn.sigmoid",
"tensorflow.shape",
"numpy.reshape",
"numpy.random.choice",
"tensorflow.reshape",
"tensorflow.nn.tanh",
"numpy.ones",
"tensorflow.global_variables_initializer",
"numpy.copy",
"tensorflow.reset_defau... |
ClementLalanne/alphacsc | [
"754cf9bb354d542a7fcebc34efe7d84705c65f55"
] | [
"alphacsc/learn_d_z_trend.py"
] | [
"# Authors: Mainak Jas <mainak.jas@telecom-paristech.fr>\n# Tom Dupre La Tour <tom.duprelatour@telecom-paristech.fr>\n# Umut Simsekli <umut.simsekli@telecom-paristech.fr>\n# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>\n\nfrom __future__ import print_function\nimport time\... | [
[
"numpy.sqrt",
"numpy.linalg.norm",
"numpy.diff",
"scipy.linalg.norm",
"numpy.zeros"
]
] |
jwitch/CallingCard | [
"2dc6dc7ce42a4f82f053a28fbb40f879e7893d26"
] | [
"CallingCards_current.py"
] | [
"#!/usr/bin/python\n\n##########################################################\n#Project: Calling_Cards\n#Date:2018/01/01\n#Author: Zontai Qi with modifications by JNW, modified for python 3\n##########################################################\n\n'''\nInput: working directory, csv with exp+ref pairs\nWrapp... | [
[
"numpy.amax",
"pandas.read_csv",
"pandas.Series",
"numpy.unique",
"numpy.amin",
"pandas.DataFrame",
"scipy.stats.hypergeom.cdf",
"numpy.savetxt",
"numpy.array",
"numpy.loadtxt"
]
] |
gitter-badger/HEPAutoencoders | [
"43010cd66fa4335a04b30b87926148e1c8d92de9"
] | [
"HEPAutoencoders/utils.py"
] | [
"import os.path\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport time\nimport pickle\n\nimport torch\nimport torch.nn as nn\n# import torch.optim as optim\nimport torch.utils.data\n\nfrom torch.utils.data import TensorDataset\n\nimport my_matplotlib_style as ms\n\nfrom fastai import... | [
[
"matplotlib.pyplot.legend",
"numpy.add",
"numpy.nanmean",
"numpy.nanstd",
"numpy.ones_like",
"numpy.arange",
"torch.tensor",
"matplotlib.pyplot.figure",
"numpy.multiply",
"matplotlib.pyplot.title",
"numpy.power",
"numpy.invert",
"matplotlib.pyplot.savefig",
... |
JB1959/Python | [
"b6ca263983933c3ecc06ed0083dd11b6faf870c8"
] | [
"dynamic_programming/max_sub_array.py"
] | [
"\"\"\"\nauthor : Mayank Kumar Jha (mk9440)\n\"\"\"\nfrom typing import List\n\n\ndef find_max_sub_array(A, low, high):\n if low == high:\n return low, high, A[low]\n else:\n mid = (low + high) // 2\n left_low, left_high, left_sum = find_max_sub_array(A, low, mid)\n right_low, righ... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
etzinis/nldrp | [
"3b6e24aa86a6d43bfd6f753b346739c00c282de3"
] | [
"nldrp/dnn/models/test.py"
] | [
"import os\n\nfrom nldrp.dnn.config import DNN_BASE_PATH\nfrom nldrp.dnn.experiments.data_splits import generate_speaker_splits, \\\n generate_folds\n\nfrom sklearn.externals import joblib\n\nIEMOCAP_PATH = os.path.join(DNN_BASE_PATH, 'data',\n \"IEMOCAP_linear_emobase2010_segl_1.0_seg... | [
[
"sklearn.externals.joblib.load"
]
] |
e-koch/fil_finder | [
"aa03e4e7b7f443d6d9dbd127a46a18eb67680499"
] | [
"fil_finder/pixel_ident.py"
] | [
"# Licensed under an MIT open source license - see LICENSE\n\nfrom .length import *\nfrom .utilities import distance\n\nimport numpy as np\nimport scipy.ndimage as nd\nimport matplotlib.pyplot as p\nimport copy\n\n\ndef isolateregions(binary_array, size_threshold=0, pad_size=0,\n fill_hole=False, ... | [
[
"numpy.logical_not",
"matplotlib.pyplot.imshow",
"numpy.sqrt",
"numpy.in1d",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.draw",
"matplotlib.pyplot.plot",
"numpy.ones",
"matplotlib.pyplot.clf",
"numpy.zeros_like",
"matplotlib.pyplot.close",
"numpy.array",
"nu... |
kevinjacksonm/eudract_ae | [
"3769ef63326c0ce3a8052cd6f28ced3690a78e88"
] | [
"eudract_ae.py"
] | [
"\nfrom lxml import etree\nimport argparse\nimport os\nimport pandas as pd\n\n# names of spreadsheets created by SP, one for serious events and one for non-serious events\nnsae_xlsx=\"t-teae-nonser-5pct.xlsx\"\nsae_xlsx =\"t-teae-ser.xlsx\"\n\n# set up XML namespaces necessary EudraCT XML file\n\nns_eudra_ae=\"http... | [
[
"pandas.isna",
"pandas.merge",
"pandas.read_excel"
]
] |
hanseungwook/BigGAN-PyTorch | [
"d9314ee435efec7cd921a23271398761f4d1df84"
] | [
"inception_utils_baseline.py"
] | [
"''' Inception utilities\n This file contains methods for calculating IS and FID, using either\n the original numpy code or an accelerated fully-pytorch version that \n uses a fast newton-schulz approximation for the matrix sqrt. There are also\n methods for acquiring a desired number of samples from th... | [
[
"torch.mean",
"torch.nn.functional.softmax",
"torch.cat",
"torch.nn.functional.dropout",
"torch.no_grad",
"numpy.mean",
"torch.nn.functional.interpolate",
"numpy.iscomplexobj",
"numpy.exp",
"torch.trace",
"numpy.trace",
"torch.sqrt",
"numpy.eye",
"torch.eye"... |
donna-legal/allennlp | [
"fd1e3cfaed07ec3ba03b922d12eee47f8be16837"
] | [
"allennlp/nn/util.py"
] | [
"\"\"\"\nAssorted utilities for working with neural networks in AllenNLP.\n\"\"\"\n\nfrom collections import defaultdict\nfrom typing import Any, Dict, List, Optional, Sequence, Tuple, TypeVar, Union\nimport logging\nimport copy\nimport math\nimport json\nimport numpy\n\nimport torch\n\nfrom allennlp.common.checks ... | [
[
"torch.nn.functional.softmax",
"torch.max",
"torch.cat",
"torch.zeros",
"torch.sin",
"torch.nn.utils.rnn.pad_sequence",
"torch.sum",
"torch.topk",
"torch.ones",
"torch.tensor",
"torch.arange",
"torch.cos",
"torch.min",
"torch.zeros_like",
"torch.exp",
... |
megachester/mlcomp | [
"8d30ba0a52e225144533e68295b71acb49e3c68a"
] | [
"mlcomp/contrib/model/video/resnext3d/resnext3d_stem.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport torch.nn as nn\n\nfrom .r2plus1_util import r2plus1_unit\n\n\nclass ResNeXt3DStemSinglePathway(nn.Mod... | [
[
"torch.nn.MaxPool3d",
"torch.nn.Conv3d",
"torch.nn.BatchNorm3d",
"torch.nn.ReLU"
]
] |
mathblue/Custom-Pose-Estimation-Yaw-Roll-Pitch-detection-tensorrt-compilation | [
"1a8501f0634c2cd81955d0ec3ec5837af04f893b"
] | [
"custom_pose/tensorrt/demo-trt.py"
] | [
"import argparse\n\nimport cv2\nimport numpy as np\nimport torch\nfrom torch2trt import torch2trt\nfrom torch2trt import TRTModule\n\nfrom models.with_mobilenet import PoseEstimationWithMobileNet\nfrom modules.keypoints import extract_keypoints, group_keypoints\nfrom modules.load_state import load_state\nfrom modul... | [
[
"numpy.ones",
"numpy.array",
"torch.from_numpy",
"torch.load"
]
] |
29riyasaxena/MDF | [
"476e6950d0f14f29463eb4f6e3be518dfb2160a5"
] | [
"examples/PyTorch/inception.py"
] | [
"import numpy as np\nimport torch\nimport torch.nn as nn\n\nfrom modeci_mdf.interfaces.pytorch import pytorch_to_mdf\n\n\nclass InceptionBlocks(nn.Module):\n \"\"\"An Inception-like model provided as a test case by the WebGME folks\"\"\"\n\n def __init__(self):\n super().__init__()\n\n self.asym... | [
[
"numpy.allclose",
"torch.zeros",
"torch.cat",
"torch.manual_seed",
"torch.nn.PReLU",
"torch.nn.Conv2d",
"torch.nn.Linear",
"torch.nn.AvgPool2d",
"torch.flatten",
"torch.nn.ZeroPad2d"
]
] |
Izardo/myWork | [
"f2a6fd46f31f840589108963d6c0e9d7fdc9ddde"
] | [
"Topic_4_flow/guess2.py"
] | [
"# User guesses a randomly generated number, if \n# the guess is incorrect, the program gives hints\n# Author: Isabella Doyle\n\nfrom numpy import random\n\nnumberToGuess = random.randint(1, 100)\n\nguess = int(input(\"Guess a number: \"))\n\nwhile guess != numberToGuess:\n print(\"You guessed wrong\")\n if g... | [
[
"numpy.random.randint"
]
] |
junjungoal/mjrl | [
"3e21bb752a02c809a5d0be2c6268043c0d2f656c"
] | [
"mjrl/algos/behavior_cloning_2.py"
] | [
"import logging\nlogging.disable(logging.CRITICAL)\nimport numpy as np\nimport time as timer\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nfrom mjrl.utils.logger import DataLog\nfrom tqdm import tqdm\n\nclass BC:\n def __init__(self, expert_paths,\n policy,\n ... | [
[
"numpy.log",
"numpy.random.choice",
"torch.from_numpy",
"numpy.concatenate",
"numpy.std",
"numpy.mean",
"torch.nn.MSELoss"
]
] |
bcorner/optics-topics-book | [
"664e7ea961d1bbd05e5dce1822e01939c053cf4d"
] | [
"optics_topics/_build/jupyter_execute/image-processing.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# # Image Processing\n# \n\n# ## Section table of contents\n# \n# ```{tableofcontents}\n# ```\n\n# ## Set up Environment\n# I suppose I better import some modules:\n# * scipy\n# * numpy\n# * matplotlib\n\n# In[1]:\n\n\n\nimport numpy as np\nimport matplotlib as mpl\nimport... | [
[
"numpy.asarray",
"matplotlib.image.imread",
"matplotlib.pyplot.imshow",
"scipy.fft.fft2"
]
] |
henrystoldt/MAPLEAF | [
"af970d3e8200832f5e70d537b15ad38dd74fa551"
] | [
"MAPLEAF/Rocket/RocketComponents.py"
] | [
" # -*- coding: utf-8 -*-\n\"\"\"\nContains interface definitions (`RocketComponent`/`BodyComponent`) and Base classes for all RocketComponents (`FixedMass`), \nas well as some simple rocket component classes (`FixedForce`,`AeroForce`,`AeroDamping` etc.)\n\n\"\"\"\n\nfrom abc import ABC, abstractmethod\nfrom ty... | [
[
"numpy.loadtxt"
]
] |
samadeusfp/prescriptiveProcessMonitoring | [
"7b39c9b3cb20208d409e733e91cb91fb69dbf238"
] | [
"get_accuracy_dataset.py"
] | [
"import EncoderFactory\nfrom DatasetManager import DatasetManager\n\nimport pandas as pd\nimport numpy as np\n\nfrom sklearn.metrics import roc_auc_score, precision_recall_fscore_support, confusion_matrix\nfrom sklearn.pipeline import FeatureUnion\n\nimport time\nimport os\nimport sys\nimport csv\nfrom sys import a... | [
[
"pandas.concat",
"sklearn.metrics.confusion_matrix",
"pandas.DataFrame"
]
] |
andylolu2/Alpha-Reversi | [
"226ddb8e794a892674209be75ea5e4af69b9a4df"
] | [
"apple_chess.py"
] | [
"from queue import Queue\nimport numpy as np\nimport random\nimport copy\nfrom multiprocessing import Manager, Pipe\nfrom constants import BOARD_DIM, C_PUCT, C_VIRTUAL_LOSS, HISTORY_LEN, MCTS_BATCH_SIZE, SAMPLES_PER_POS\nfrom helper_methods import dihedral_trans\n\nclass Board:\n '''\n Class Board impleme... | [
[
"numpy.arange",
"numpy.full",
"numpy.concatenate",
"numpy.all",
"numpy.copy",
"numpy.array",
"numpy.zeros",
"numpy.where"
]
] |
rmw83/molecool | [
"7646661be5e141b6f5cbd857a2042c72b6285bce"
] | [
"molecool/tests/test_measure.py"
] | [
"\"\"\"\nUnit Testing for Measure Module.\n\"\"\"\n\nimport numpy as np\nimport molecool\nimport pytest\n\ndef test_calculate_distance():\n \n Atom_A = np.array([0.0, 0.0, 0.0])\n Atom_B = np.array([1.0, 0.0, 0.0])\n\n expected_distance = 1.0\n\n calculated_distance = molecool.calculate_distance(Atom... | [
[
"numpy.array",
"numpy.sqrt"
]
] |
Navjeet-AIT/CHAT-SENTIMENT-ANALYSIS | [
"f49682c7d973c4a966093ed6517fd28b5ce79bc2"
] | [
"Text/tests/examples/score_texts_emojis.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\" Use Text to score texts for emoji distribution.\n\nThe resulting emoji ids (0-63) correspond to the mapping\nin emoji_overview.png file at the root of the Text repo.\n\nWrites the result to a csv file.\n\"\"\"\nfrom __future__ import print_function, division\nimport example_helper... | [
[
"numpy.argsort",
"numpy.argpartition"
]
] |
Pandinosaurus/midair-dataset | [
"df55d456d2a8f6370c4a0bc597a55b0e47e6b6f0"
] | [
"tools/IMU-data_generator.py"
] | [
"import h5py\nimport numpy as np\nfrom pyquaternion import Quaternion\nimport argparse\nimport os\nimport sys\n\nparser = argparse.ArgumentParser(description='Generate new IMU measurements for all trajectories in the given hdf5 file')\nparser.add_argument('--hdf5_path', type=str, help='path to hdf5 file',required=T... | [
[
"numpy.random.uniform",
"numpy.random.normal",
"numpy.array",
"numpy.zeros"
]
] |
benoitbonnet/pytorch-CycleGAN-and-pix2pix | [
"348e97e4603a29e287c4ff1aa29cffe2999d0a4f"
] | [
"models/template_model.py"
] | [
"\"\"\"Model class template\n\nThis module provides a template for users to implement custom models.\nYou can specify '--model template' to use this model.\nThe class name should be consistent with both the filename and its model option.\nThe filename should be <model>_dataset.py\nThe class name should be <Model>Da... | [
[
"torch.nn.L1Loss"
]
] |
E-tanok/ReinforcementLearning_starcraft_2_pysc2 | [
"7587b1c7f269a1b533b4d33caa8f80319d11a5f3"
] | [
"parameters_custom.py"
] | [
"import pickle\nimport tensorflow as tf\n\n#Environment parameters :\nstep_mul = 10\nn_workers = 1\n\n#Workers parameters :\ngamma = 0.99\nrollout_size = 40\nwith_random_policy = False\ndict_worker_params = {'gamma':gamma, 'rollout_size':rollout_size, 'with_random_policy':with_random_policy}\n\n#Networks parameters... | [
[
"tensorflow.train.RMSPropOptimizer"
]
] |
JeyesHan/DeFRCN_Custom | [
"6a536408a61bb10a5ef84ce6683b6278e6e01f43"
] | [
"defrcn/modeling/roi_heads/roi_heads.py"
] | [
"import torch\nimport logging\nimport numpy as np\nfrom torch import nn\nfrom typing import Dict\nfrom detectron2.layers import ShapeSpec\nfrom detectron2.utils.registry import Registry\nfrom detectron2.modeling.matcher import Matcher\nfrom detectron2.modeling.poolers import ROIPooler\nfrom detectron2.utils.events ... | [
[
"torch.nn.Sequential",
"torch.cat",
"torch.zeros_like",
"torch.no_grad",
"numpy.mean"
]
] |
shenlong95/zoofs | [
"8cac2ba00342e4c02d6004414871b34cbc5f3c38"
] | [
"zoofs/harrishawkoptimization.py"
] | [
"from zoofs.baseoptimizationalgorithm import BaseOptimizationAlgorithm\nimport numpy as np\nimport pandas as pd\nimport logging as log\nimport time\nimport plotly.graph_objects as go\nimport scipy\nimport warnings\nimport math\n\nclass HarrisHawkOptimization(BaseOptimizationAlgorithm):\n def __init__(self,\n ... | [
[
"numpy.random.random",
"numpy.abs",
"numpy.arange",
"numpy.sin",
"numpy.ones",
"numpy.repeat",
"numpy.where"
]
] |
LiwenxuanNJU/TVpgGLM | [
"d07f81cf3a404474b640777a3ab01b0a79ad9187"
] | [
"plot/Plotfun1.py"
] | [
"import sys\n\nsys.path.append(\"/Users/Roger/Dropbox/pyglm-master/pyglm/\")\nsys.path.append(\"/Users/Roger/Dropbox/pyglm-master/pyglm/utils/\")\n\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pickle\nfrom hips.plotting.colormaps import harvard_colors\nfrom mpl_toolkits.axes_grid1 import make_axes... | [
[
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.ion",
"matplotlib.pyplot.figure"
]
] |
knowledgevis/rms_infer_web | [
"53382762ffc6ec12ac635e2938661008cd87cae8"
] | [
"girder_worker_tasks/arbor_nova_tasks/arbor_tasks/fnlcr/myod1.py"
] | [
"# added for girder interaction as plugin arbor task\nfrom girder_worker.app import app\nfrom girder_worker.utils import girder_job\nfrom tempfile import NamedTemporaryFile\n\nimport billiard as multiprocessing\nfrom billiard import Queue, Process \nimport json\nimport sys\n\n#---------\n\nimport torch\nfrom torch.... | [
[
"numpy.rollaxis",
"torch.nn.Softmax",
"numpy.expand_dims",
"torch.max",
"torch.load",
"numpy.asarray",
"torch.zeros",
"torch.nn.ELU",
"torch.no_grad",
"torch.nn.Dropout",
"torch.from_numpy",
"torch.tensor",
"numpy.zeros",
"torch.nn.AlphaDropout",
"torch.... |
Said6289/SPlisHSPlasH | [
"fe0a37b05e25fa9d61bb7bd7372d1f26543d4e35"
] | [
"pySPlisHSPlasH/examples/plot.py"
] | [
"# Note that for this example you have to install matplotlib by:\n# pip install matplotlib\n \nimport pysplishsplash as sph\nimport matplotlib.pyplot as plt\nimport numpy as np\n\ncounter = 0\nvelocities = []\ntimes = []\n\ndef time_step_callback():\n\tglobal counter\n\tsim = sph.Simulation.getCurrent()\n\ttm = sph... | [
[
"matplotlib.pyplot.title",
"numpy.linalg.norm",
"matplotlib.pyplot.draw",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ion",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ylabel"
]
] |
AdrianLangseth/TDT4173_Anomaly_Detection | [
"7b8f511f3d24427ba52331afb7d0979666151440"
] | [
"src/ffnn/hyp_opt.py"
] | [
"import numpy as np\nimport tensorflow.keras.layers as KL\nimport tensorflow.keras.optimizers as opt\nimport tensorflow.python.keras.models as KM\nfrom data_load import load_MNIST\nfrom hyperas import optim\nfrom hyperas.distributions import uniform, choice\nfrom hyperopt import Trials, STATUS_OK, tpe\n\n\ndef crea... | [
[
"numpy.amax",
"tensorflow.keras.layers.Dense",
"tensorflow.python.keras.models.Model",
"tensorflow.keras.layers.Dropout",
"tensorflow.keras.layers.Flatten",
"tensorflow.keras.layers.Input"
]
] |
pi-kappa-devel/rad | [
"a8595c4991ad5ff27b1e70d1ff9a85d9234adca8"
] | [
"prad/rad.py"
] | [
"\"\"\"@package rad\nPython radial attention model classes.\n\nThe file contains three basic classes; namely a grid, a variable and a model\nclass. These classes provide are used as a bridge between the c applications\nand the Python Jupyter notebook. The c applications solve the radial attention\nmodel, generate s... | [
[
"matplotlib.pyplot.legend",
"numpy.linspace",
"numpy.ones",
"matplotlib.pyplot.plot",
"scipy.ndimage.filters.gaussian_filter1d",
"numpy.meshgrid",
"numpy.zeros",
"numpy.where",
"matplotlib.pyplot.figure"
]
] |
Nitin-Mane/SARS-CoV-2-xDNN-Classifier | [
"abb6a82b8ee89a041b0e26e14ec1e416c4561266"
] | [
"modules/server.py"
] | [
"#!/usr/bin/env python\n###################################################################################\n##\n## Project: COVID -19 xDNN Classifier 2020\n## Version: 1.0.0\n## Module: Server\n## Desription: The COVID -19 xDNN Classifier 2020 server.\n## License: MIT\n## Copyright: 2021, Asociacion ... | [
[
"numpy.expand_dims",
"tensorflow.keras.preprocessing.image.img_to_array",
"tensorflow.keras.applications.vgg16.preprocess_input"
]
] |
zgulde/zgulde-python | [
"0dd89962b4ca2141ebe4335ef0200b0595d06d4d"
] | [
"misc/scatter_lowess.py"
] | [
"import pandas as pd\nimport matplotlib.pyplot as plt\nfrom statsmodels.nonparametric.smoothers_lowess import lowess\nplt.ion()\n\n\ndef scatter_lowess(\n df: pd.DataFrame, x: str, y: str, g=None, ax=None, scatter_kwargs={}, plot_kwargs={}\n):\n if ax is None:\n ax = plt.gca()\n if g is not None:\n ... | [
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.ion",
"matplotlib.pyplot.subplots"
]
] |
jcoheur/pybitup | [
"6b31cbea7ae871a09aad154829eb85e599ce9214"
] | [
"pybitup/post_process.py"
] | [
"import matplotlib.pyplot as plt\nfrom matplotlib import colors \nimport pickle\nimport pandas as pd \nimport pathlib\nimport json\nfrom jsmin import jsmin\nimport numpy as np\nfrom scipy import stats\nimport seaborn as sns\n\nfrom tikzplotlib import save as tikz_save\n\n\ndef post_process_data(input_file_name):\n ... | [
[
"matplotlib.pyplot.legend",
"numpy.sqrt",
"pandas.DataFrame",
"matplotlib.pyplot.plot",
"numpy.max",
"scipy.stats.gaussian_kde",
"numpy.mean",
"pandas.read_csv",
"numpy.std",
"numpy.argmax",
"numpy.load",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.min... |
cadurosar/laplacian_networks | [
"27f6f2d7145426b38f578e9c1beecae3e7392f1b"
] | [
"imagenet32/models/preact_parseval.py"
] | [
"'''Pre-activation ResNet in PyTorch.\n\nReference:\n[1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun\n Identity Mappings in Deep Residual Networks. arXiv:1603.05027\n'''\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\nimport math\nimport os\n\nfrom torch.autograd ... | [
[
"torch.mean",
"numpy.sqrt",
"torch.nn.functional.conv2d",
"torch.cuda.FloatTensor",
"torch.nn.Linear",
"torch.nn.functional.relu",
"torch.nn.BatchNorm2d",
"torch.autograd.Variable"
]
] |
reyjul/alphafold | [
"d422d5f024c9ac40a389b51704c0560d9152103c"
] | [
"run_alphafold.py"
] | [
"# Copyright 2021 DeepMind Technologies Limited\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applic... | [
[
"numpy.repeat"
]
] |
goldenbili/Bert_Test2 | [
"35aa7505010d738a1e2b614d53f78707077157dd",
"35aa7505010d738a1e2b614d53f78707077157dd"
] | [
"run_squad_ColabTCPTrans_201910151851.py",
"run_squad_coding.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.logging.warning",
"tensorflow.FixedLenFeature",
"tensorflow.nn.log_softmax",
"tensorflow.reduce_sum",
"tensorflow.train.init_from_checkpoint",
"tensorflow.gfile.MakeDirs",
"tensorflow.to_int32",
"tensorflow.c... |
jjgoings/cclib | [
"56e34d48d0f6bb5e7a940873558b57bd3a59a7d8"
] | [
"cclib/parser/data.py"
] | [
"# -*- coding: utf-8 -*-\r\n#\r\n# Copyright (c) 2019, the cclib development team\r\n#\r\n# This file is part of cclib (http://cclib.github.io) and is distributed under\r\n# the terms of the BSD 3-Clause License.\r\n\r\n\"\"\"Classes and tools for storing and handling parsed data\"\"\"\r\n\r\nimport logging\r\nfrom... | [
[
"numpy.array"
]
] |
ischtz/lighthouse-inventory | [
"fab4d47eb9fc3e74223814b7e8dfb955337aa5cc"
] | [
"lh_inventory.py"
] | [
"\"\"\"\nUtility to inventorize SteamVR (Lighthouse) tracked devices from \ntheir JSON config files. \n\"\"\"\n\nimport os\nimport glob\nimport json\nimport pprint\nimport argparse\n\nimport pandas as pd\n\nLH_PATH = os.environ['ProgramFiles(x86)'] + '\\\\Steam\\\\config\\\\lighthouse'\nSEP = ';'\n\nif __name__ == ... | [
[
"pandas.read_csv",
"pandas.DataFrame"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.