repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
achalagarwal/tensorflow | [
"36f817a9f3e7d2339cb53b91ddc508b3e25ab761"
] | [
"tensorflow/tools/compatibility/tf_upgrade_v2.py"
] | [
"# Copyright 2018 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.tools.compatibility.ast_edits.get_arg_value",
"tensorflow.tools.compatibility.ast_edits.full_name_node"
]
] |
SekiroRong/Carla_dataset_generator | [
"a42cfa44c0c4237b7ee45dbda6067eadf1a66ad5"
] | [
"util/raycast_sensor_testing.py"
] | [
"#!/usr/bin/env python\r\n\r\n# Copyright (c) 2020 Computer Vision Center (CVC) at the Universitat Autonoma de\r\n# Barcelona (UAB).\r\n#\r\n# This work is licensed under the terms of the MIT license.\r\n# For a copy, see <https://opensource.org/licenses/MIT>.\r\n\r\n\"\"\"\r\nRaycast sensor profiler\r\n\r\nThis sc... | [
[
"numpy.array",
"numpy.reshape",
"numpy.zeros",
"numpy.fabs",
"numpy.dtype"
]
] |
JoElfner/pandas | [
"0ffa8025a70f402d9708c3e121c0601c0d78b625"
] | [
"pandas/core/window/rolling.py"
] | [
"\"\"\"\nProvide a generic structure to support window functions,\nsimilar to how we have a Groupby object.\n\"\"\"\nfrom datetime import timedelta\nfrom functools import partial\nimport inspect\nfrom textwrap import dedent\nfrom typing import Callable, Dict, List, Optional, Set, Tuple, Type, Union\n\nimport numpy ... | [
[
"pandas.core.window.indexers.FixedWindowIndexer",
"pandas.core.common.asarray_tuplesafe",
"pandas.core.indexes.api.ensure_index",
"numpy.where",
"pandas.core.construction.extract_array",
"pandas.core.window.indexers.GroupbyRollingIndexer",
"numpy.apply_along_axis",
"pandas.core.dty... |
Artcs1/eval_icdar | [
"69caba1efd203741e8756db85ebafcde6a38838c"
] | [
"eval.py"
] | [
"# coding:utf-8\nimport math\nimport os\nimport shutil\nimport time\n\nimport cv2\nimport numpy as np\nimport torch\nfrom torchvision import transforms\nfrom tqdm import tqdm\n\nimport lanms\nfrom config import device, result_root\nfrom data_gen import data_transforms, test_data_path\nfrom icdar import restore_rect... | [
[
"numpy.zeros_like",
"numpy.array",
"numpy.linalg.norm",
"numpy.zeros",
"numpy.sum",
"torch.load",
"numpy.argwhere",
"numpy.argsort"
]
] |
svh2811/tweet-hashtag-reccomendation | [
"6c9359a05ebc148c0c9f4415db5691ad54684f50"
] | [
"preprocessing/hashtag_mention_distributions.py"
] | [
"import pickle\nimport matplotlib.pyplot as plt\n\nsorted_hashtag_counts = pickle.load(open(\"sorted_hashtag_counts.p\", \"rb\"))\nsorted_mention_counts = pickle.load(open(\"sorted_mention_counts.p\", \"rb\"))\n\nk = 30\nprint('Top %d most popular hashtags:' % k)\nfor i in range(1,k+1):\n print('Hashtag: %s, use... | [
[
"matplotlib.pyplot.clf",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
kohei-iwase/ML-agents | [
"ef3fac54edc9e3ddb771c80e28f5ee22b3dae3d1"
] | [
"ml-agents-envs/mlagents_envs/tests/test_envs.py"
] | [
"from unittest import mock\nimport pytest\n\nimport numpy as np\n\nfrom mlagents_envs.environment import UnityEnvironment\nfrom mlagents_envs.base_env import DecisionSteps, TerminalSteps\nfrom mlagents_envs.exception import UnityEnvironmentException, UnityActionException\nfrom mlagents_envs.mock_communicator import... | [
[
"numpy.ones",
"numpy.zeros"
]
] |
lingss0918/fairseq | [
"45fbd419c9020eb782eab96e194a1d76a90ee524"
] | [
"examples/decoar/models/quant.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport math\nfrom dataclasses import dataclass, field\nfrom typing import List, Tuple\n\nimport numpy as np\nimport torch\nimport to... | [
[
"torch.log",
"torch.randn"
]
] |
richardliaw/thinc | [
"fca3da42d57b5f3f50bee67c76d8dbdd28d05c2e"
] | [
"thinc/shims/pytorch.py"
] | [
"from typing import Any, cast\nimport contextlib\nfrom io import BytesIO\nimport srsly\n\ntry:\n import torch.autograd\n import torch.optim\n import torch\nexcept ImportError: # pragma: no cover\n pass\n\nfrom ..util import torch2xp, xp2torch, convert_recursive\nfrom ..backends import get_current_ops\n... | [
[
"torch.no_grad",
"torch.autograd.backward",
"torch.load",
"torch.cuda.current_device"
]
] |
speedcell4/self-attentive-parser | [
"644a27d07316d1441a62425c85f78128b8dee4fe"
] | [
"src/benepar/integrations/spacy_plugin.py"
] | [
"import numpy as np\nimport torch\n\nfrom .downloader import load_trained_model\nfrom .spacy_extensions import ConstituentData\nfrom ..parse_base import BaseInputExample\n\n\nclass PartialConstituentData:\n def __init__(self):\n self.starts = [np.array([], dtype=int)]\n self.ends = [np.array([], dt... | [
[
"numpy.hstack",
"numpy.array",
"torch.cuda.is_available"
]
] |
felixzheng02/pypkpd | [
"9e7f41aa7e33ba50cec3482f14e7be08a4bc23e7",
"9e7f41aa7e33ba50cec3482f14e7be08a4bc23e7"
] | [
"project/trace_matrix.py",
"project/util.py"
] | [
"\"\"\"\r\nFunction written to match MATLAB function\r\n\r\nAuthor: Caiya Zhang, Yuchen Zheng\r\n\"\"\"\r\n\r\n\r\nimport numpy as np\r\n\r\n\r\ndef trace_matrix (mat):\r\n\r\n if len(mat.shape) == 1:\r\n return mat[0]\r\n elif len(mat.shape) == 2:\r\n return(np.trace(mat))\r\n else:\r\n ... | [
[
"numpy.trace"
],
[
"numpy.isinf",
"scipy.stats.norm.pdf",
"numpy.array",
"scipy.stats.norm.ppf",
"scipy.stats.norm.logppf",
"scipy.stats.norm.logpdf",
"numpy.log",
"numpy.exp",
"numpy.stack"
]
] |
huaxiuyao/DMVST-Net | [
"6aa85dbd1acccc94e58118e8a389ad5099659e03"
] | [
"model.py"
] | [
"import tensorflow as tf\nfrom utils import *\nfrom keras import backend as K\nimport numpy as np\nimport pandas as pd\nimport argparse\nfrom keras.models import Sequential, Model\nfrom keras import activations\nfrom keras.engine.topology import Layer, InputSpec\nfrom keras.utils import conv_utils\nfrom keras.layer... | [
[
"tensorflow.Session",
"tensorflow.stack"
]
] |
Castdeath97/csc8634-project | [
"66b9197211dc8493d6435f4e84a15bd627677327"
] | [
"src/tests/test_make_dataset.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nIntroduction\n--------------\n\nThis python file contains the source code used to test the data preparation\nprocess\n\nCode\n------\n\n\"\"\"\nimport pandas as pd\nfrom src.data import make_dataset as md\nimport pytest\nfrom datetime import datetime\n\nBASE_RAW_DATA_DIR = 'data/ra... | [
[
"pandas.read_csv"
]
] |
Yoontae6719/pytorch_hydra | [
"c608f144fb8002bdcd329e09daf0416cba10a850"
] | [
"srcs/model/model.py"
] | [
"import torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass MnistModel(nn.Module):\n def __init__(self, num_classes=10):\n super().__init__()\n self.conv1 = nn.Conv2d(1, 10, kernel_size=5)\n self.conv2 = nn.Conv2d(10, 20, kernel_size=5)\n self.conv2_drop = nn.Dropout2d()\n ... | [
[
"torch.nn.Linear",
"torch.nn.functional.dropout",
"torch.nn.functional.log_softmax",
"torch.nn.Conv2d",
"torch.nn.Dropout2d"
]
] |
0xflotus/delta | [
"01018da60aa9380ba272a3b5df52d8ccde8ceac7"
] | [
"delta/layers/ops/kernels/spectrum_op_test.py"
] | [
"# Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd.\n# 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.o... | [
[
"numpy.array"
]
] |
RidongHan/GHE-LPC | [
"9dcb11a8fbfd28821b176f753c2385e238eb2c77"
] | [
"data_loader.py"
] | [
"import os\nimport json\nimport torch\nimport pickle\nimport numpy as np\nimport torch.utils.data as data\nfrom collections import Counter\nfrom tqdm import tqdm\n\n########################################################################\n############################ For RHI-EOP ##############################\ncla... | [
[
"torch.zeros",
"torch.cat",
"numpy.array",
"torch.stack",
"numpy.zeros",
"numpy.random.randn",
"numpy.save",
"torch.ones",
"torch.cuda.is_available",
"torch.tensor",
"torch.utils.data.DataLoader",
"numpy.sqrt",
"numpy.arange"
]
] |
JaehoonShin/RLTaskController_simulation | [
"2a17e25ccae6c4e2d2590757c2528c7023b6a1ac"
] | [
"simulation_RNN_reader.py"
] | [
"\"\"\" Shuangyi Tong <s9tong@edu.uwaterloo.ca>\n Sept 17, 2018\n\"\"\"\nimport getopt\nimport sys\nimport csv\nimport torch\nimport numpy as np\nimport pandas as pd\nimport dill as pickle # see https://stackoverflow.com/questions/25348532/can-python-pickle-lambda-functions\nimport random\n\nfrom tqdm import tqd... | [
[
"numpy.random.choice",
"numpy.zeros",
"pandas.DataFrame",
"torch.save",
"numpy.ones",
"numpy.load",
"torch.FloatTensor",
"torch.unsqueeze",
"numpy.append",
"torch.nn.CosineSimilarity",
"torch.utils.tensorboard.SummaryWriter"
]
] |
instedd/StockPricePrediction | [
"410d025fdb703b2b6ba63f821c1e4851b9ccd429"
] | [
"scripts/Algorithms/regression_helpers.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n Miscellaneous Functions for Regression File.\n\"\"\"\n\nfrom __future__ import print_function\nimport numpy as np\nimport pandas as pd\nfrom sklearn import preprocessing\nfrom sklearn.metrics import mean_squared_error, r2_score\nfrom sklearn.ensemble import RandomForestRegresso... | [
[
"pandas.ewma",
"sklearn.feature_selection.SelectKBest",
"pandas.concat",
"pandas.read_csv",
"sklearn.neighbors.KNeighborsRegressor",
"sklearn.svm.SVC",
"matplotlib.pyplot.tight_layout",
"sklearn.preprocessing.LabelEncoder",
"pandas.rolling_mean",
"sklearn.ensemble.GradientB... |
qmpzzpmq/pytorch-lightning | [
"854bdc042d12fe4b713de881c58b025de30d0c39"
] | [
"tests/callbacks/test_pruning.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.any",
"torch.allclose",
"torch.all",
"torch.nn.Linear"
]
] |
LaudateCorpus1/python-aiplatform | [
"0ca374769f922fd427c5b6f58c9ce1ab40f18d18"
] | [
"tests/system/aiplatform/test_featurestore.py"
] | [
"# -*- coding: utf-8 -*-\n\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by... | [
[
"pandas.DataFrame"
]
] |
jpgacrama/DeepLearning | [
"db0f7edc918d28d330f4926ef1961dbd01ec9012"
] | [
"pt_framework/c7e3_convnet_cifar_conf5.py"
] | [
"\"\"\"\nThe MIT License (MIT)\n\nCopyright (c) 2021 NVIDIA\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, mo... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.MaxPool2d",
"torch.nn.init.constant_",
"torch.nn.init.xavier_uniform_",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.cuda.is_available",
"torch.nn.CrossEntropyLoss",
"torch.nn.Flatten"
]
] |
slaclab/pabv_control | [
"329193bfe219d3472d9d9ab9e9b28a18ff341c2c"
] | [
"python_client/npfifo.py"
] | [
"import numpy\n\nclass npfifo:\n def __init__(self, num_parm, num_points):\n self._n = num_parm\n self._x = num_points\n self.A = numpy.zeros((self._n, self._x))\n self._i = 0\n\n def append(self, X):\n if len(X) != self._n:\n #print(\"Wrong number of parameters t... | [
[
"numpy.zeros"
]
] |
tanvi355/Awesome_Python_Scripts | [
"dd906dff3c311e260851f8720cbce77d7398be43"
] | [
"GUIScripts/Nobel Prize Winner/nobel_prize_winner.py"
] | [
"\n# Nobel Prize Winner\n\n# imported necessary library\nimport tkinter\nfrom tkinter import *\nimport tkinter as tk\nimport tkinter.messagebox as mbox\nimport pandas as pd\n\n\n# created main window\nwindow = Tk()\nwindow.geometry(\"1000x700\")\nwindow.title(\"Nobel Prize Winner\")\n\n# ---------------------- for ... | [
[
"pandas.read_csv"
]
] |
gatoniel/napari-3d-ortho-viewer | [
"cfeb59c9fbfbe24140bd819233f4f16f41b7dc09"
] | [
"src/napari_3d_ortho_viewer/_crop_dock_list_widget.py"
] | [
"\"\"\"Widget to crop images around certain labels to introspect them better.\"\"\"\nfrom typing import Optional, List, Tuple\nimport napari\nimport numpy as np\nfrom napari.layers import Labels, Image\nfrom napari_plugin_engine import napari_hook_implementation\nfrom qtpy.QtWidgets import QWidget\nfrom qtpy.QtWidg... | [
[
"numpy.array",
"numpy.argsort"
]
] |
LeanAndMean/torchani | [
"74221a9816a39b78945d9cc693f6cf5b2923b8b9"
] | [
"examples/nnp_training.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\n.. _training-example:\n\nTrain Your Own Neural Network Potential\n=======================================\n\nThis example shows how to use TorchANI train your own neural network potential.\n\"\"\"\n\n###############################################################################\n#... | [
[
"torch.nn.Linear",
"torch.nn.CELU",
"torch.nn.Sequential",
"torch.cuda.is_available",
"torch.load"
]
] |
Teledyne-Marine/pyplot7k | [
"9e3a9ffe20875cfdb91a5b37673e242d2c5ebd96"
] | [
"examples/wedge_save_image.py"
] | [
"\"\"\"\nThis is an example of plotting a wedge out of raw 7k ping data, and saving it as an image.\n\"\"\"\nfrom pyread7k import PingDataset, PingType\nfrom pyplot7k import *\nimport matplotlib.pyplot as plt\n\npath = \"path/to/file.s7k\"\ndataset = PingDataset(path, include=PingType.BEAMFORMED)\nping = dataset[0]... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots"
]
] |
scottgigante/tf_seq2seq | [
"743d5b224457a6730ab48707dce28920bbfe21a0"
] | [
"tf_seq2seq/DecodeModel.py"
] | [
"import tensorflow as tf\nfrom tensorflow.python.layers.core import Dense\n\nfrom Optimizer import Optimizer\n\nclass DecodeModel:\n \n def __init__(self, inputs, input_length, targets, target_length, max_target_length, \n num_layers, rnn_size, sample_prob, keep_prob, learning_rate, num_labels... | [
[
"tensorflow.nn.embedding_lookup",
"tensorflow.contrib.rnn.MultiRNNCell",
"tensorflow.contrib.seq2seq.BahdanauAttention",
"tensorflow.identity",
"tensorflow.cast",
"tensorflow.contrib.rnn.DropoutWrapper",
"tensorflow.summary.histogram",
"tensorflow.constant",
"tensorflow.variabl... |
UnknwoonUser/kaggle-dfdc | [
"2088c2c54866b6a959e3477c1c7f277f82b9ebe3"
] | [
"submission.py"
] | [
"import os\nimport time\n\nfrom cv2 import cv2\nimport numpy as np\nfrom collections import defaultdict\n\nfrom PIL import Image\nfrom torch import torch\nimport torch.nn.functional as F\nfrom torchvision import transforms as T\n\nfrom face_utils import norm_crop, FaceDetector\nfrom model_def import WSDAN, xception... | [
[
"torch.nn.functional.interpolate",
"numpy.mean",
"torch.torch.Tensor",
"torch.torch.device",
"torch.torch.set_grad_enabled",
"torch.torch.stack"
]
] |
matangover/beatogether | [
"413f945541990e2e297532a609741cea1f2dfeb4"
] | [
"Person.py"
] | [
"import pandas as pd\nfrom pandas import DataFrame, Series\nimport math\nfrom primesense import openni2, nite2\nimport time\nimport numpy as np\n\nclass Person(object):\n MOVEMENT_SMOOTHING_WINDOW_SIZE_SECONDS = 0.1\n \n def __init__(self):\n # lh_y, rh_y, head_y, body_z, hand_dist\n self.par... | [
[
"pandas.to_datetime",
"numpy.linalg.norm",
"numpy.dot",
"pandas.DataFrame",
"pandas.Series"
]
] |
wangwanglulu/workstation | [
"cee21f6241448f40e6ecb528607ee551f5371f73"
] | [
"dv/sanguo2.py"
] | [
"from matplotlib import pyplot as plt\r\nfrom wordcloud import WordCloud\r\nimport jieba\r\nfilename = 'tianlongbabu.txt'\r\nwith open(filename , encoding=\"utf-8\") as f_obj:\r\n contents = f_obj.read()\r\n\r\ns = jieba.lcut(contents) \r\n\r\ntxt = \" \".join(s)\r\n\r\nfont = r'C:\\Windows\\Fonts\\simkai.ttf'\r... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.imshow"
]
] |
madian9/mmf | [
"6db9048c848a178872d1aa1a14ee0009de703750"
] | [
"mmf/modules/encoders.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\nimport os\nimport pickle\nimport re\nfrom collections import OrderedDict\nfrom copy import deepcopy\nfrom dataclasses import dataclass\nfrom enum import Enum\nfrom typing import Any\n\nimport torch\nimport torchvision\nfrom mmf.common.registry import registry\nfr... | [
[
"torch.nn.Linear",
"torch.nn.Identity",
"torch.cat",
"torch.prod",
"torch.flatten",
"torch.nn.Sequential",
"torch.from_numpy",
"torch.hub.load_state_dict_from_url",
"torch.nn.functional.relu",
"torch.nn.Embedding"
]
] |
michaellin/cs224n-finalproj | [
"a82e420f9ed3055ee0155133670ad82b4ca171d4"
] | [
"training_ptr_gen/model.py"
] | [
"from __future__ import unicode_literals, print_function, division\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence\nfrom data_util import config\nfrom numpy import random\n\nuse_cuda = config.use_gpu and torch.cuda.is_... | [
[
"torch.nn.Linear",
"torch.nn.functional.sigmoid",
"torch.cat",
"torch.cuda.manual_seed_all",
"torch.nn.LSTM",
"numpy.random.seed",
"torch.bmm",
"torch.manual_seed",
"torch.cuda.is_available",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.tensor",
"torch.nn.utils.... |
CrowdStrike/omigo-data-analytics | [
"aeb8ebcc23f4c9cf4518291ab1bb294de4435828"
] | [
"python-packages/core/src/omigo_core/tsv.py"
] | [
"\"\"\"TSV Class\"\"\"\nimport re\nimport math\nimport pandas as pd\nimport random\nimport json\nfrom omigo_core import tsvutils\nfrom omigo_core import utils\nimport sys\n\nclass TSV:\n \"\"\"This is the main data processing class to apply different filter and transformation functions\n on tsv data and get t... | [
[
"pandas.DataFrame"
]
] |
dhruvramani/ai-safety-a2c | [
"519386b87d8e2dac5e33da900f11102780fd6d52"
] | [
"utils.py"
] | [
"# Code is from OpenAI baseline.\n# https://github.com/openai/baselines/tree/master/baselines/common/vec_env\n\nimport numpy as np\nfrom multiprocessing import Process, Pipe\n\ndef worker(remote, parent_remote, env_fn_wrapper):\n parent_remote.close()\n env = env_fn_wrapper.x()\n while True:\n cmd, ... | [
[
"numpy.stack"
]
] |
mesuga-reymond/change_detection.pytorch | [
"cc9a4aec59e13fb45f22b9d9d3f4c735bd257892"
] | [
"change_detection_pytorch/utils/lr_scheduler.py"
] | [
"from torch.optim.lr_scheduler import _LRScheduler\nfrom torch.optim.lr_scheduler import ReduceLROnPlateau\n\n__all__ = ['GradualWarmupScheduler']\n\n\nclass GradualWarmupScheduler(_LRScheduler):\n \"\"\" Gradually warm-up(increasing) learning rate in optimizer.\n Proposed in 'Accurate, Large Minibatch SGD: T... | [
[
"torch.optim.sgd.SGD",
"torch.optim.lr_scheduler.StepLR",
"torch.randn"
]
] |
truebluejason/R-Drop | [
"4e027c1f58a9b5e7ca9330de78bfdc5ee4af408e"
] | [
"vit_src/models/modeling.py"
] | [
"# coding=utf-8\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport copy\nimport logging\nimport math\n\nfrom os.path import join as pjoin\n\nimport torch\nimport torch.nn as nn\nimport numpy as np\n\nfrom torch.nn import CrossEntropyLoss, Dropou... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.modules.utils._pair",
"torch.nn.ModuleList",
"torch.nn.CrossEntropyLoss",
"numpy.concatenate",
"torch.sigmoid",
"torch.nn.LayerNorm",
"torch.nn.Softmax",
"torch.nn.init.normal_",
"numpy.sqrt",
"torch.nn.init.zeros_",
"to... |
leafvmaple/name_disambiguation | [
"c0007bb85330b509fa6a1bd2975a0e609b092e02"
] | [
"models/vgae.py"
] | [
"from __future__ import division\nfrom __future__ import print_function\n\nimport time\nimport os\n\n# Train on CPU (hide GPU) due to memory constraints\nos.environ['CUDA_VISIBLE_DEVICES'] = \"\"\n\nimport tensorflow as tf\nimport numpy as np\nimport scipy.sparse as sp\n\nfrom utility.model import clustering, pairw... | [
[
"tensorflow.compat.v1.placeholder",
"tensorflow.compat.v1.global_variables_initializer",
"tensorflow.compat.v1.name_scope",
"tensorflow.compat.v1.sparse_placeholder",
"scipy.sparse.eye",
"tensorflow.sparse.to_dense",
"tensorflow.compat.v1.Session",
"tensorflow.compat.v1.placeholder... |
jamesellis1999/qml | [
"33c9d66712b36861dc098f9c789ba2c3ab897fdb"
] | [
"demonstrations/tutorial_variational_classifier.py"
] | [
"r\"\"\"\n.. role:: html(raw)\n :format: html\n\n.. _variational_classifier:\n\nVariational classifier\n======================\n\n.. meta::\n :property=\"og:description\": Using PennyLane to implement quantum circuits that can be trained from labelled data to\n classify new data samples.\n :property=... | [
[
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.show",
"matplotlib.pyplot.scatter",
"matplotlib.pyplot.contour"
]
] |
MikeLagunes/Supervised-Triplet-Network | [
"575bcaf8f17affb0ff0e93212dde0f3f634c196f"
] | [
"loss.py"
] | [
"import torch\nimport numpy as np\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nclass SoftmaxLoss(nn.Module):\n \"\"\"\n Softmax loss\n Takes logits and class labels\n \"\"\"\n\n def __init__(self, margin=128.0, size_average=True):\n super(SoftmaxLoss, self).__init__()\n se... | [
[
"torch.abs",
"torch.nn.functional.relu",
"torch.nn.CrossEntropyLoss"
]
] |
nparkstar/nauta | [
"1bda575a01f782d1dc2cd5221122651f184f7167"
] | [
"applications/cli/example-python/tfrecord_batch_prediction/tfrecords_converter.py"
] | [
"#\n# Copyright (c) 2019 Intel 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 applicable ... | [
[
"tensorflow.train.BytesList",
"tensorflow.python_io.TFRecordWriter"
]
] |
AyushMehta1/Codes | [
"b609fa2e70f3b4c06a2f7867346d3363c232565f"
] | [
"drowsinessDetector.py"
] | [
"\nimport cv2\nimport dlib\nfrom scipy.spatial import distance\n\ndef calculate_EAR(eye):\n\tA = distance.euclidean(eye[2], eye[4])\n\tB = distance.euclidean(eye[1], eye[3])\n\tC = distance.euclidean(eye[1], eye[2])\n\tear_aspect_ratio = (A+B)/(2.0*C)\n\treturn ear_aspect_ratio\n\ncap = cv2.VideoCapture(0)\nhog_fac... | [
[
"scipy.spatial.distance.euclidean"
]
] |
giuliapuntoit/RL-tcp-toycase | [
"c4c77ac6aef682e930892dcd69dcc7212207910f"
] | [
"integrated_version/sarsa_simplified_class.py"
] | [
"import time\nimport numpy as np\nimport random\nimport matplotlib.pyplot as plt\n# from transitions import Machine\nfrom transitions.extensions import GraphMachine as Machine\n\n\nclass Connection(object):\n pass\n\n\nclass SarsaSimplified(object):\n\n def __init__(self, epsilon=0.3, total_episodes=5000, max... | [
[
"numpy.array_equal",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"numpy.random.uniform",
"numpy.argmax",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show"
]
] |
pskrunner14/pos-tagger | [
"4635eb983c581eb8de0e8729466105193b388a7f"
] | [
"utils.py"
] | [
"from collections import defaultdict\nfrom collections import Counter\n\nimport nltk\nimport sys\nimport numpy as np\n\nfrom sklearn.model_selection import train_test_split\nfrom keras.utils.np_utils import to_categorical\n\n\ndef load_dataset():\n nltk.download('brown')\n nltk.download('universal_tagset')\n\... | [
[
"sklearn.model_selection.train_test_split"
]
] |
Aircoookie/LedFx | [
"95628fc237497dd89aaf30fdbf88f780f3330166"
] | [
"ledfxcontroller/effects/gradient.py"
] | [
"from ledfxcontroller.effects.temporal import TemporalEffect\nfrom ledfxcontroller.color import COLORS, GRADIENTS\nfrom ledfxcontroller.effects import Effect\nfrom scipy.misc import comb\nimport voluptuous as vol\nimport numpy as np\nimport logging\n\n_LOGGER = logging.getLogger(__name__)\n\n@Effect.no_registration... | [
[
"numpy.dot",
"numpy.linspace",
"scipy.misc.comb",
"numpy.roll"
]
] |
valeoai/SemanticPalette | [
"a1b02a384c09881d6f1ca1a0c0ebfd87278c3d7d",
"a1b02a384c09881d6f1ca1a0c0ebfd87278c3d7d"
] | [
"helpers/segmentor_trainer.py",
"helpers/visualizer.py"
] | [
"import torch\r\nfrom apex import amp\r\nfrom math import ceil\r\nimport random\r\nimport PIL\r\nfrom tqdm import tqdm\r\n#torch.multiprocessing.set_start_method('spawn', force=True)\r\n\r\nimport os,sys,inspect\r\ncurrent_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))\r\nurbangan_d... | [
[
"torch.zeros",
"torch.nn.functional.interpolate",
"torch.no_grad",
"torch.diag",
"torch.Tensor"
],
[
"torch.cat",
"torch.stack",
"numpy.load",
"torch.sum",
"torch.mul",
"torch.sqrt",
"pandas.DataFrame",
"matplotlib.pyplot.subplots",
"torch.tensor",
"... |
Lee-guccii/ExtensiveReading_YL_Estimation | [
"89e3d4aacdc6e7d812b8cedc24f37e1f173087bc"
] | [
"coh-metrix_3/cohmetrix_tkentei.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nfrom scipy import stats\nfrom scipy.stats import spearmanr\nimport scipy\n\n\n\n###############\ntosyo=0\nnew_list_tadoku = []\nnew_list_ippann = []\n\n#textをnew_listに読み込む\n\n#多読図書\nwith open(\"CohMetrixOutput.txt\", \"r\", encoding=\"utf-8\") as f:\n list_ta... | [
[
"numpy.array",
"scipy.stats.ttest_ind",
"scipy.stats.spearmanr",
"scipy.stats.mannwhitneyu",
"scipy.stats.bartlett",
"scipy.stats.shapiro"
]
] |
wtarit/image-segmentation-keras | [
"2709f3c471ccbceb37de9d54632d5050142eed59"
] | [
"keras_segmentation/model_compression.py"
] | [
"import keras\nimport tensorflow as tf\n\nfrom tqdm import tqdm \nimport numpy as np\nimport six \nimport os \nimport json \nimport sys \n\nfrom .data_utils.data_loader import image_segmentation_generator\nfrom .train import CheckpointsCallback \n\nfrom tensorflow.keras.models import Model \n\n\n\ndef get_pariwise_... | [
[
"numpy.array",
"tensorflow.GradientTape",
"tensorflow.reshape",
"tensorflow.keras.models.Model",
"tensorflow.reduce_sum",
"tensorflow.image.resize",
"tensorflow.nn.max_pool"
]
] |
lis-epfl/Tensoft-G21 | [
"7a83c5dabc12906c0a6bd1da0a28a131e9d5e144"
] | [
"ea_sim/visualization/data_plotter.py"
] | [
"#! /usr/bin/env python3\n\nimport os\nimport re\nimport json\nimport argparse\nimport numpy as np\n\nimport matplotlib\n# select matplotlib backend\nmatplotlib.use('pdf')\nimport matplotlib.pyplot as plt\n\n\ndef load_evo_file(file, total_num_sim=None):\n with open(file) as evo_file:\n raw_data = json.lo... | [
[
"matplotlib.use",
"numpy.concatenate",
"numpy.max",
"numpy.ceil",
"numpy.asarray",
"numpy.median",
"matplotlib.pyplot.savefig",
"numpy.copy",
"numpy.percentile",
"matplotlib.pyplot.close",
"numpy.mean",
"matplotlib.pyplot.figure",
"matplotlib.rc",
"numpy.std... |
anirudhb11/kornia | [
"df591b3b440de84c197f7e2ef91e1d3880e35ce1"
] | [
"kornia/filters/filter.py"
] | [
"from typing import List\n\nimport torch\nimport torch.nn.functional as F\n\nfrom kornia.filters.__tmp__ import _deprecation_wrapper\nfrom kornia.filters.kernels import normalize_kernel2d\n\n\ndef _compute_padding(kernel_size: List[int]) -> List[int]:\n \"\"\"Compute padding tuple.\"\"\"\n # 4 or 6 ints: (pa... | [
[
"torch.nn.functional.pad"
]
] |
Jay-9912/2048-api | [
"979b9005eae866e1745df5b2732c2fa377e9081e"
] | [
"train_my_agent/train_val_test.py"
] | [
"import numpy as np\nimport random\nx=np.load(\"G:\\\\learning_material\\\\lab\\\\2048\\\\2048-api\\\\data\\\\x.npy\")\ny=np.load(\"G:\\\\learning_material\\\\lab\\\\2048\\\\2048-api\\\\data\\\\y.npy\")\n#altogether 419966 samples\n#x is a 419966*4*4*11 array\n#y is a 419966*4 array\nindex=[i for i in range(len(x))... | [
[
"numpy.load",
"numpy.save"
]
] |
sglyon/quant-econ | [
"a7a0c609a2ab3267df835783b58b46cba15819f2",
"67d44ed719c9e6202c53f3b18d16ddf7e666e58b"
] | [
"examples/subplots.py",
"quantecon/estspec.py"
] | [
"\nimport matplotlib.pyplot as plt\nimport numpy as np\n\ndef subplots():\n \"Custom subplots with axes throught the origin\"\n fig, ax = plt.subplots()\n\n # Set the axes through the origin\n for spine in ['left', 'bottom']:\n ax.spines[spine].set_position('zero')\n for spine in ['right', 'to... | [
[
"matplotlib.pyplot.show",
"numpy.linspace",
"numpy.sin",
"matplotlib.pyplot.subplots"
],
[
"numpy.concatenate",
"pandas.ols",
"numpy.ones",
"numpy.exp",
"numpy.fft.fft",
"numpy.arange",
"pandas.Series"
]
] |
JieMEI1994/machine-learning-from-scratches | [
"3006a48092c4d3d1b3aec2bf7ccf379eeb1d8749"
] | [
"deep learning/function/dropout_function.py"
] | [
"import numpy as np\r\n\r\nclass dropout:\r\n def __init__(self, keep_prob=0.5):\r\n self.keep_prob = keep_prob\r\n\r\n def forward(self, A):\r\n D = np.random.rand(A.shape[0], A.shape[1])\r\n D = D < self.keep_prob\r\n A = np.multiply(A, D)\r\n A /= self.keep_prob\r\n ... | [
[
"numpy.multiply",
"numpy.random.rand"
]
] |
pierluigiferrari/differential_equations_resnet | [
"21ba75e0fa8f01c6b336524f089aa24c8ac86ee1"
] | [
"training/training.py"
] | [
"'''\nA training routine for tf.keras models written in the low-level TensorFlow API.\n\nCopyright (C) 2019 Pierluigi Ferrari\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://w... | [
[
"tensorflow.reshape",
"tensorflow.local_variables_initializer",
"tensorflow.global_variables_initializer",
"tensorflow.identity",
"tensorflow.concat",
"tensorflow.keras.backend.categorical_crossentropy",
"tensorflow.contrib.framework.get_variables",
"tensorflow.argmax",
"tensor... |
robewedd/gcp_log_toolbox | [
"b2c0bf0a91b8f193a594c022e958cc4db906f1bb"
] | [
"gcp_log_toolbox.py"
] | [
"import os\nimport sys\nimport glob\nimport json\nimport fnmatch\nimport logging\nimport pathlib\nimport argparse\nimport pandas as pd\nfrom datetime import datetime\nfrom datetime import timedelta\nfrom google.cloud import storage\nfrom google.cloud.exceptions import NotFound\n\n\ndef readLog(logPath):\n \"\"\"... | [
[
"pandas.DataFrame",
"pandas.Timestamp"
]
] |
erdos-project/erdos-experiments | [
"56eea1d52991ada5cc3c4a2e26ddc1da31f1ac2e",
"56eea1d52991ada5cc3c4a2e26ddc1da31f1ac2e"
] | [
"plotting_scripts/plot_synthetic_pipeline.py",
"plotting_scripts/pylot_utils.py"
] | [
"import seaborn as sns\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport matplotlib.gridspec as gridspec\nimport brewer2mpl\nfrom utils import *\nimport systems_utils\nfrom systems_utils import get_colors, HATCH_DICT\nimport matplotlib.patheffects as path_effects\nimport matplotlib as mpl\nimport fire\n... | [
[
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure"
],
[
"pandas.DataFrame",
"pandas.read_csv",
"numpy.array"
]
] |
schellmi42/viewpoint_learning | [
"c38850c93a34ce80e63a14fed131878f3a4a27dd"
] | [
"viewpoint_learning/code/train_images.py"
] | [
"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''\n\n \\brief Code to train DLDL\n\n \\copyright Copyright (c) 2021 Visual Computing group of Ulm University, \n Germany. See the LICENSE file at the top-level directory of \n this distribution.\n''''''... | [
[
"tensorflow.summary.FileWriter",
"tensorflow.group",
"tensorflow.train.import_meta_graph",
"tensorflow.reshape",
"numpy.mean",
"tensorflow.losses.mean_squared_error",
"tensorflow.stack",
"tensorflow.control_dependencies",
"tensorflow.local_variables_initializer",
"numpy.cos... |
ntent/rasa | [
"a7df9c1ecddb8cd03b090b4cd3e0229e78fd6f98"
] | [
"rasa/core/nlg/template.py"
] | [
"import copy\nimport logging\nimport re\nfrom collections import defaultdict\n\nfrom rasa.core.trackers import DialogueStateTracker\nfrom typing import Text, Any, Dict, Optional, List\n\nfrom rasa.core.nlg.generator import NaturalLanguageGenerator\n\nlogger = logging.getLogger(__name__)\n\n\nclass TemplatedNaturalL... | [
[
"numpy.random.choice"
]
] |
takmakov/GofL | [
"9e3d5a6bb1aa3370157ba3353a980454e9256cc4"
] | [
"gameoflife/game.py"
] | [
"\nimport numpy as np\nimport random\nimport time\nfrom itertools import product\nimport sys\n\n_BIRTH = 3\n_SUSTAIN = (2, 3)\n_LONELY = (0, 1)\n_CROWDED = 4\n\nclass Game:\n\t'''Generate game oobject'''\n\n\tdef __init__(self, **kwargs):\n\t\t'''Initiate new game'''\n\n\t\tself.x_size = kwargs.get('size', 10)\n\t\... | [
[
"numpy.where",
"numpy.array_equal",
"numpy.zeros"
]
] |
MartinBeseda/qiskit-optimization | [
"11a924bd7b7f8508149d051827fe82591a12caba"
] | [
"qiskit_optimization/algorithms/grover_optimizer.py"
] | [
"# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2020, 2021.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modificatio... | [
[
"numpy.ceil",
"numpy.diag"
]
] |
jetbrains-academy/Machine-Learning-101 | [
"7b583dbff1e90115296dcaeac78ca88363c158c9"
] | [
"Iris Network/Backpropagation/task.py"
] | [
"import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom network import NN\n\n\n\ndef read_data(fpath):\n iris = pd.read_csv(fpath)\n iris.loc[iris['species'] == 'virginica', 'species'] = 0\n iris.loc[iris['species'] == 'versicolor', 'species'] = 1\n iris.loc[iris['species'] == 's... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"numpy.random.shuffle",
"matplotlib.pyplot.show",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.scatter",
"pandas.read_csv"
]
] |
Keiichi-Hirano/noteshrinkMacAndWin | [
"5faf077dc509083d6b5438c343ec78b815bb26b0"
] | [
"noteshrinkMacAndWin.py"
] | [
"#!/usr/bin/env python\n\n'''Converts sequence of images to compact PDF while removing speckles,\nbleedthrough, etc.\n\n'''\n\n# for some reason pylint complains about members being undefined :(\n# pylint: disable=E1101\n\nfrom __future__ import print_function\n\nimport sys\nimport os\nimport re\nimport subprocess\... | [
[
"numpy.array",
"numpy.zeros",
"numpy.random.shuffle",
"numpy.where",
"numpy.arange",
"numpy.vstack",
"numpy.abs",
"scipy.cluster.vq.vq",
"numpy.hstack",
"numpy.unique"
]
] |
rsulli55/automates | [
"1647a8eef85c4f03086a10fa72db3b547f1a0455"
] | [
"scripts/code_summarization/generators.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nimport torch.nn.functional as F\nfrom torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence\n\n\nclass CodeEncoder(nn.Module):\n def __init__(self, vecs, drop=0, hidden_sz=50, num_layers=1, gpu=False):\n super(CodeEnc... | [
[
"torch.zeros",
"torch.nn.Linear",
"torch.nn.Embedding.from_pretrained",
"torch.nn.Dropout",
"torch.nn.LSTM",
"torch.cat",
"torch.mm"
]
] |
crutcher/stylelens | [
"8df3704f56fe6a30395eadcb1aee2e11563dfabb"
] | [
"base/base_trainer.py"
] | [
"# ------------------------------------------------------------------------------\n# Libraries\n# ------------------------------------------------------------------------------\nimport datetime\nimport json\nimport logging\nimport math\nimport os\nfrom time import time\n\nimport torch\n\nfrom utils.visualization ... | [
[
"torch.device",
"torch.save",
"torch.cuda.device_count",
"torch.load",
"torch.nn.DataParallel"
]
] |
jaehlee/flax | [
"e01e2bcb012211d48e4c75e78297b8e15d742a37"
] | [
"examples/mnist/train.py"
] | [
"# Copyright 2021 The Flax Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or a... | [
[
"numpy.mean"
]
] |
satya-pattnaik/skorecard | [
"ba31821799985052ffb498569b41e969034ea28e"
] | [
"tests/test_usage_flows.py"
] | [
"from skorecard.bucketers import DecisionTreeBucketer, OptimalBucketer\nfrom sklearn.pipeline import make_pipeline\n\n\ndef test_full_pipeline(df):\n \"\"\"Tests some complete pipelines.\"\"\"\n X = df.drop(columns=[\"default\"])\n y = df[\"default\"]\n\n num_cols = [\"LIMIT_BAL\", \"BILL_AMT1\"]\n c... | [
[
"sklearn.pipeline.make_pipeline"
]
] |
Mariabba/DataMining2-project | [
"d12cf4d6605a16194f24b8410c332cff701d2b6d"
] | [
"data understanding/DM2-understanding first lock.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[2]:\n\n\n# general libraries\nimport os\nimport sys\nimport math\nimport statistics\nimport collections\nimport missingno as msno\nfrom pylab import MaxNLocator\nfrom collections import defaultdict\nimport seaborn as sns\nimport ast\nfrom pathlib import Path\n# pandas... | [
[
"pandas.to_datetime",
"numpy.zeros_like",
"numpy.triu_indices_from",
"matplotlib.pyplot.title",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.hist",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.subplot2grid",
"m... |
techthiyanes/accelerate | [
"3d92caa24169b9606ba2a7dbf7b86dc0e009fba0",
"3d92caa24169b9606ba2a7dbf7b86dc0e009fba0"
] | [
"examples/by_feature/multi_process_metrics.py",
"src/accelerate/utils/modeling.py"
] | [
"# coding=utf-8\n# Copyright 2022 The HuggingFace Inc. team. 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.... | [
[
"torch.no_grad",
"torch.utils.data.DataLoader"
],
[
"torch.cuda.mem_get_info",
"torch.device",
"torch.no_grad",
"torch.nn.Parameter",
"torch.cuda.device_count",
"numpy.memmap",
"torch.cuda.is_available",
"torch.tensor",
"torch.load"
]
] |
jnnr/oemof-tabular | [
"ab58d8c3035b6e97d9d45169832745de11e5bb36"
] | [
"src/oemof/tabular/datapackage/reading.py"
] | [
"\"\"\" Tools to deserialize energy systems from datapackages.\n\n**WARNING**\n\nThis is work in progress and still pretty volatile, so use it at your own risk.\nThe datapackage format and conventions we use are still a bit in flux. This is\nalso why we don't have documentation or tests yet. Once things are stabili... | [
[
"pandas.to_datetime",
"pandas.DatetimeIndex"
]
] |
sharshofski/evalml | [
"f13dcd969e86b72ba01ca520247a16850030dcb0"
] | [
"evalml/tests/data_checks_tests/test_data_checks.py"
] | [
"import numpy as np\nimport pandas as pd\nimport pytest\nimport woodwork as ww\n\nfrom evalml.automl import get_default_primary_search_objective\nfrom evalml.data_checks import (\n AutoMLDataChecks,\n DataCheck,\n DataCheckError,\n DataCheckMessageCode,\n DataChecks,\n DataCheckWarning,\n Defau... | [
[
"pandas.DataFrame",
"pandas.Series"
]
] |
niklasnolte/agents | [
"c727141f67051b86d2564c4bd5fbc080623bfe19"
] | [
"tf_agents/agents/categorical_dqn/categorical_dqn_agent.py"
] | [
"# coding=utf-8\n# Copyright 2018 The TF-Agents 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 b... | [
[
"tensorflow.reduce_min",
"tensorflow.reshape",
"tensorflow.clip_by_value",
"tensorflow.stack",
"tensorflow.tile",
"tensorflow.control_dependencies",
"tensorflow.nn.softmax",
"tensorflow.cast",
"tensorflow.shape",
"tensorflow.concat",
"tensorflow.nest.assert_same_structu... |
yocheah/dac-man | [
"758849decf26f40fdc89f10cd29b1340e344008d"
] | [
"dacman/plugins/excel.py"
] | [
"from pathlib import Path\nimport numpy as np\n\ntry:\n import pandas as pd\nexcept ImportError:\n from dacman.core.utils import dispatch_import_error\n dispatch_import_error(module_name='pandas', plugin_name='Excel')\n\ntry:\n import xlrd\nexcept ImportError:\n from dacman.core.utils import dispatch... | [
[
"pandas.read_excel"
]
] |
dspicher/brian2 | [
"3ff406ec389f8eb736c340ef33def6c74bb2a4bc"
] | [
"brian2/core/functions.py"
] | [
"from collections.abc import Mapping\nimport inspect\nimport types\n\nimport numpy as np\nimport sympy\nfrom sympy.codegen import cfunctions as sympy_cfunctions\nfrom numpy.random import randn, rand\nfrom sympy import Function as sympy_Function\nfrom sympy import S\n\nimport brian2.units.unitsafefunctions as unitsa... | [
[
"numpy.array",
"numpy.asarray"
]
] |
sarattha/facenet | [
"3567aa95d79503c6c9e7f559ec0e986b694af4c6"
] | [
"src/align/align_dataset_mtcnn.py"
] | [
"\"\"\"Performs face alignment and stores face thumbnails in the output directory.\"\"\"\n# MIT License\n# \n# Copyright (c) 2016 David Sandberg\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# i... | [
[
"numpy.uint8",
"numpy.asarray",
"numpy.zeros",
"numpy.minimum",
"tensorflow.Graph",
"tensorflow.compat.v1.ConfigProto",
"numpy.random.randint",
"numpy.argmax",
"tensorflow.compat.v1.GPUOptions",
"numpy.power",
"numpy.squeeze",
"numpy.vstack",
"numpy.maximum"
]... |
houwenxin/ViT-pytorch | [
"6f594f2a30859a74c79a3c58ad4d96939741a024"
] | [
"utils/data_utils.py"
] | [
"import logging\n\nimport torch\n\nfrom torchvision import transforms, datasets\nfrom torch.utils.data import DataLoader, RandomSampler, DistributedSampler, SequentialSampler\n\nimport numpy as np\n\nlogger = logging.getLogger(__name__)\n\ndef mixup_data(x, y, alpha=1.0, use_cuda=True):\n '''Returns mixed inputs... | [
[
"torch.utils.data.RandomSampler",
"torch.utils.data.DistributedSampler",
"torch.utils.data.SequentialSampler",
"torch.randperm",
"numpy.random.beta",
"torch.utils.data.DataLoader",
"torch.distributed.barrier"
]
] |
ksh981214/moses | [
"8a932ae578adb27c7f73ceb6f0de20acbe8196ff"
] | [
"moses/script_utils.py"
] | [
"import argparse\nimport random\nimport re\nimport numpy as np\nimport pandas as pd\nimport torch\n\n\ndef add_common_arg(parser):\n def torch_device(arg):\n if re.match('^(cuda(:[0-9]+)?|cpu)$', arg) is None:\n raise argparse.ArgumentTypeError(\n 'Wrong device format: {}'.format... | [
[
"torch.cuda.manual_seed_all",
"numpy.random.seed",
"torch.cuda.device_count",
"torch.manual_seed",
"torch.cuda.is_available",
"pandas.read_csv"
]
] |
nel-lab/Mask_RCNN | [
"c76040350b8ead818ef0c7fdd285f52e695f13e7"
] | [
"mrcnn/utils.py"
] | [
"\"\"\"\nMask R-CNN\nCommon utility functions and classes.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport sys\nimport os\nimport logging\nimport math\nimport random\nimport numpy as np\nimport tensorflow as tf\nimport sci... | [
[
"numpy.dot",
"numpy.minimum",
"numpy.exp",
"numpy.multiply",
"numpy.where",
"tensorflow.stack",
"numpy.cumsum",
"tensorflow.cast",
"numpy.concatenate",
"numpy.max",
"numpy.divide",
"numpy.empty",
"numpy.log",
"numpy.argmax",
"numpy.arange",
"numpy.sq... |
syyunn/PINNs | [
"13ba30c2a3ebf9a932c0faa46c7b853fcd6e2677"
] | [
"appendix/discrete_time_inference (Burgers)/Burgers_systematic.py"
] | [
"\"\"\"\n@author: Maziar Raissi\n\"\"\"\n\nimport sys\n\nsys.path.insert(0, \"../../Utilities/\")\n\nimport tensorflow as tf\nimport numpy as np\nimport time\nimport scipy.io\n\nnp.random.seed(1234)\ntf.set_random_seed(1234)\n\n\nclass PhysicsInformedNN:\n # Initialize the class\n def __init__(self, x0, u0, x... | [
[
"numpy.random.choice",
"tensorflow.matmul",
"tensorflow.gradients",
"numpy.finfo",
"tensorflow.global_variables_initializer",
"tensorflow.set_random_seed",
"numpy.linalg.norm",
"tensorflow.ConfigProto",
"numpy.sqrt",
"numpy.vstack",
"numpy.array",
"tensorflow.zeros"... |
martin-xia0/Jam_Forecaster | [
"bb79fbd5096050bcae427f27f674ea7dfd33a018"
] | [
"lstm_model/lstm_model.py"
] | [
"import os\r\nimport numpy as np\r\nimport datetime as dt\r\nimport json\r\nimport pandas as pd\r\nfrom keras.layers import Dense, Activation, Dropout, LSTM\r\nfrom keras.models import Sequential, load_model\r\nfrom keras.callbacks import EarlyStopping, ModelCheckpoint\r\n\r\n\r\nclass Model:\r\n def __init__(se... | [
[
"numpy.array",
"pandas.read_csv"
]
] |
cszmli/mirror-sigir | [
"fbcf09a5317dbf4f9f5836a945279d97e90005ff"
] | [
"onmt/ModelConstructor.py"
] | [
"\"\"\"\nThis file is for models creation, which consults options\nand creates each encoder and decoder accordingly.\n\"\"\"\nimport torch\nimport torch.nn as nn\n\nimport onmt\nimport onmt.io\nimport onmt.Models\nimport onmt.modules\nfrom onmt.Models import NMTModel, MeanEncoder, RNNEncoder, \\\n ... | [
[
"torch.nn.LogSoftmax",
"torch.load"
]
] |
pabloferz/hoomd-blue | [
"9a27f63b9243b8a3a04ccd3047f686cb0e12ec31"
] | [
"hoomd/md/pytest/test_minimize_fire.py"
] | [
"# Copyright (c) 2009-2022 The Regents of the University of Michigan.\n# Part of HOOMD-blue, released under the BSD 3-Clause License.\n\nimport numpy as np\nimport pytest\n\nimport hoomd\nfrom hoomd.logging import LoggerCategories\nfrom hoomd.conftest import operation_pickling_check, logging_check\nfrom hoomd impor... | [
[
"numpy.random.randint",
"numpy.random.rand"
]
] |
DmytroBabenko/Text-Classification-Models-Pytorch | [
"0bdc2c1b7e40a5aab320485abf0a132bbb27f88e"
] | [
"Model_Transformer/train.py"
] | [
"# train.py\n\nfrom utils import *\nfrom model import *\nfrom config import Config\nimport sys\nimport torch.optim as optim\nfrom torch import nn\nimport torch\n\nif __name__=='__main__':\n config = Config()\n train_file = '../data/ag_news.train'\n if len(sys.argv) > 2:\n train_file = sys.argv[1]\n ... | [
[
"torch.nn.NLLLoss",
"torch.cuda.is_available"
]
] |
Laksh1997/pytorch-lightning | [
"10c643f162318b7fe2b4a041a1f2975468492a92"
] | [
"pytorch_lightning/callbacks/model_checkpoint.py"
] | [
"\"\"\"\nModel Checkpointing\n===================\n\nAutomatically save model checkpoints during training.\n\n\"\"\"\n\nimport os\nimport re\n\nimport numpy as np\nfrom typing import Optional\n\nimport torch\nfrom pytorch_lightning import _logger as log\nfrom pytorch_lightning.callbacks.base import Callback\nfrom p... | [
[
"torch.tensor"
]
] |
oriolromani/minst-dataset | [
"5847ac421522a393df77ca2a43acdc326f7d64e8"
] | [
"scripts/tests/test_build.py"
] | [
"import pytest\n\nimport logging\nimport os\nimport pandas as pd\n\nimport scripts_helpers\n\nimport minst.logger\nimport minst.sources.uiowa as uiowa\nimport minst.sources.rwc as rwc\nimport minst.sources.philharmonia as philz\n\nlogging.config.dictConfig(minst.logger.get_config('INFO'))\n\n\ndef test_build_defaul... | [
[
"pandas.read_csv"
]
] |
koconnor4/pyDIA | [
"7c0c2c21f039ae28bcda4af821f16dbafb27ceb5"
] | [
"pydia/cuda_interface_functions.py"
] | [
"import numpy as np\nimport pycuda.driver as cuda\nimport pycuda.autoinit\nfrom cuda_functions_sp import cu_matrix_kernel\nfrom image_functions import convolve_undersample\nimport sys\n\n\ndef numpy3d_to_array(np_array, allow_surface_bind=False, layered=True):\n d, h, w = np_array.shape\n\n descr = cuda.Array... | [
[
"numpy.int32",
"numpy.array",
"numpy.sum",
"numpy.zeros"
]
] |
mrbaozi/fourier_neural_operator | [
"ffcfef3e13879235d222a1f25f7ebf9b34260f3e"
] | [
"fourier_1d.py"
] | [
"\"\"\"\n@author: Zongyi Li\nThis file is the Fourier Neural Operator for 1D problem such as the (time-independent) Burgers equation discussed in Section 5.1 in the [paper](https://arxiv.org/pdf/2010.08895.pdf).\n\"\"\"\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfro... | [
[
"torch.zeros",
"torch.nn.Linear",
"torch.rand",
"torch.optim.lr_scheduler.StepLR",
"torch.einsum",
"torch.nn.Conv1d",
"numpy.random.seed",
"torch.no_grad",
"torch.fft.rfft",
"torch.manual_seed",
"torch.tensor",
"torch.nn.functional.relu",
"numpy.linspace",
"... |
tonigi/DeOldify | [
"726fcc0776c828a00558e3a73a32ca202b66a593"
] | [
"app.py"
] | [
"# import the necessary packages\nimport os\nimport sys\nimport requests\nimport ssl\nfrom flask import Flask\nfrom flask import request\nfrom flask import jsonify\nfrom flask import send_file\n\n\nfrom app_utils import download\nfrom app_utils import generate_random_filename\nfrom app_utils import clean_me\nfrom a... | [
[
"torch.cuda.is_available"
]
] |
echtesmikkelbeer21/gym-collision-avoidance | [
"0ae1fa9335219c5b69554c3d85c334779f97d8c1"
] | [
"gym_collision_avoidance/envs/policies/CADRL/scripts/multi/nn_navigation_value_multi.py"
] | [
"#!/usr/bin/env python\nimport sys\nsys.path.append('../neural_networks')\n\nimport numpy as np\nimport numpy.matlib\nimport pickle\nimport copy\nfrom mpl_toolkits.mplot3d import Axes3D\nfrom matplotlib import cm\nimport matplotlib.pyplot as plt\nimport os\nimport time\nimport copy\n\nfrom gym_collision_avoidance.e... | [
[
"numpy.random.rand",
"matplotlib.pyplot.arrow",
"numpy.minimum",
"numpy.min",
"numpy.where",
"numpy.sign",
"matplotlib.pyplot.draw",
"numpy.cos",
"numpy.max",
"numpy.sin",
"numpy.linalg.norm",
"matplotlib.pyplot.colorbar",
"matplotlib.pyplot.tripcolor",
"num... |
Pearl-Ayem/ATSC_Notebook_Data | [
"c075d166c235ac4e68a4b77750e02b2a5e77abd0"
] | [
"notebooks/python/modis_level1b_read.py"
] | [
"\n# coding: utf-8\n\n# <h1>Table of Contents<span class=\"tocSkip\"></span></h1>\n# <div class=\"toc\"><ul class=\"toc-item\"><li><span><a href=\"#Introduction\" data-toc-modified-id=\"Introduction-1\"><span class=\"toc-item-num\">1 </span>Introduction</a></span></li><li><span><a href=\"#Reading-modis-d... | [
[
"numpy.searchsorted",
"matplotlib.pyplot.subplots"
]
] |
ParisNeo/FaceAnalyzer | [
"85e967a1dfff09a8c76d5a14801760140d198292"
] | [
"examples/Pygame/face_chacer/calibrator.py"
] | [
"\"\"\"=============\n Example : calibrator.py\n Author : Saifeddine ALOUI\n Description :\n A tool to calibrate gaze motion inside the screen\n<================\"\"\"\n\nimport pygame\nfrom FaceAnalyzer import FaceAnalyzer\nfrom FaceAnalyzer.helpers.geometry.euclidian import is_point_inside_rect, ... | [
[
"numpy.array",
"numpy.mean",
"numpy.zeros",
"numpy.eye"
]
] |
aidrivers-sg/yolact_edge | [
"7e0bdbeba9e19232fa5b00622fbac1c26b17d5ef"
] | [
"eval.py"
] | [
"from data import COCODetection, YoutubeVIS, get_label_map, MEANS, COLORS\nfrom yolact import Yolact\nfrom utils.augmentations import BaseTransform, BaseTransformVideo, FastBaseTransform, Resize\nfrom utils.functions import MovingAverage, ProgressBar\nfrom layers.box_utils import jaccard, center_size\nfrom utils im... | [
[
"numpy.array",
"torch.stack",
"torch.cuda.synchronize",
"numpy.asarray",
"torch.no_grad",
"matplotlib.pyplot.title",
"torch.set_default_tensor_type",
"numpy.save",
"torch.from_numpy",
"torch.sum",
"matplotlib.pyplot.show",
"torch.utils.data.DataLoader",
"numpy.s... |
vibinabraham/FermiCluster | [
"2264b343d15c9e23ab964810c99ba0af60abe985"
] | [
"test/tdm_test.py"
] | [
"import numpy as np\nimport scipy\nimport itertools\nimport time\nfrom math import factorial\nimport copy as cp\nimport sys\n\nfrom fermicluster import *\nfrom pyscf_helper import *\nimport pyscf\nttt = time.time()\nnp.set_printoptions(suppress=True, precision=10, linewidth=1500)\nprint(\"GITHUB TREE\")\nimport sub... | [
[
"numpy.linalg.norm",
"numpy.set_printoptions",
"numpy.linalg.eigh",
"numpy.sum",
"numpy.allclose",
"scipy.sparse.linalg.eigsh"
]
] |
yjw0510/freud | [
"b47b36d9afacc0833febfd51755b0e94664c0c07"
] | [
"benchmarks/benchmark_locality_LinkCell.py"
] | [
"import numpy as np\nimport freud\nfrom benchmark import Benchmark\nfrom benchmarker import run_benchmarks\n\n\nclass BenchmarkLocalityLinkCell(Benchmark):\n def __init__(self, L, r_max):\n self.L = L\n self.r_max = r_max\n\n def bench_setup(self, N):\n self.box = freud.box.Box.cube(self.... | [
[
"numpy.random.seed",
"numpy.random.uniform"
]
] |
ElisNycander/nordic_model | [
"354bb8d8031022ee13a234f588db1afa95767760"
] | [
"case_studies.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Aug 12 13:27:07 2019\n\n@author: elisn\n\"\"\"\n\nfrom nordic_model import Model\nimport pickle\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nfrom pathlib import Path\nimport datetime\nfrom help_functions import str_to_date\nfrom model_de... | [
[
"numpy.square",
"pandas.set_option",
"matplotlib.pyplot.grid",
"pandas.DataFrame",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.legend",
"matplotlib.dates.DateFormatter",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.title",
"matplotlib... |
erfan111/qsim | [
"677caa075b964b6a435c0126490e7122123b7242"
] | [
"simulator.py"
] | [
"from scipy import stats\nimport numpy as np\nimport argparse\nimport heapq\nimport math\nimport random\nimport multiprocessing as mp\nfrom itertools import product\nfrom operator import attrgetter\n\nMULTIPROCESSING_CPUS = mp.cpu_count()\n\ndists = {\n \"exponential\": stats.expon,\n \"uniform\": stats.unifo... | [
[
"numpy.percentile"
]
] |
ayushjain1144/LDLS | [
"314d5930992713acc58097d3aacb23929c036fdd"
] | [
"lidar_segmentation/kitti_utils_custom.py"
] | [
"# class, xmin, ymin, xmax, ymax, 3d_height, width, length, x, y, z, yaw\n\n\"\"\" Helper methods for loading and parsing KITTI data.\n\nAuthor: Charles R. Qi\nDate: September 2017\n\"\"\"\nfrom __future__ import print_function\n\nimport numpy as np\nimport cv2\nimport os\nimport ipdb\nst = ipdb.set_trace\nimport t... | [
[
"numpy.max",
"numpy.zeros_like",
"numpy.array",
"numpy.sin",
"numpy.dot",
"numpy.zeros",
"numpy.reshape",
"numpy.ones",
"numpy.load",
"numpy.min",
"numpy.eye",
"torch.from_numpy",
"numpy.any",
"numpy.transpose",
"numpy.cos",
"numpy.hstack",
"nump... |
liyifan-123/ABAE | [
"c6a4ff6e1b5177b2a4b400f442a311c58cef08e5"
] | [
"model/SubAttConv.py"
] | [
"import torch as t\nimport torch.nn as nn\nfrom model.AttentionLayer import AttentionSCN\n\n\ndef generate_graph(m, num_nodes):\n now = 0\n graph = []\n while now * m + 1 < num_nodes:\n col = [now]\n col = col + [node for node in range(now * m + 1, now * m + 1 + m)]\n graph.append(t.te... | [
[
"torch.cat",
"torch.tensor"
]
] |
laiou/Paddle-Lite | [
"a99080a48186ec7df546d77d39db58d84d1dda3e"
] | [
"lite/tests/unittest_py/op/common/test_gru_unit_op_base.py"
] | [
"# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless re... | [
[
"numpy.random.random"
]
] |
minired2154/BackgroundMattingV2 | [
"bea02b317a5d9985c1ee2f278ec652339423e31e"
] | [
"model/refiner.py"
] | [
"from gzip import READ\nimport torch\nimport torchvision\nfrom torch import nn\nfrom torch.nn import functional as F\nfrom typing import Tuple\n\n\nclass Refiner(nn.Module):\n \"\"\"\n Refiner refines the coarse output to full resolution.\n \n Args:\n mode: area selection mode. Options:\n ... | [
[
"torch.cat",
"torch.stack",
"torch.arange",
"torch.nn.BatchNorm2d",
"torch.nn.functional.interpolate",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.zeros_like",
"torch.nn.functional.pad"
]
] |
maliesa96/garage | [
"6ba6cf3a4fbe231418d34f432a610f67a7187e6b"
] | [
"tests/garage/tf/policies/test_categorical_mlp_policy2.py"
] | [
"import pickle\n\nimport numpy as np\nimport pytest\nimport tensorflow as tf\n\nfrom garage.tf.envs import TfEnv\nfrom garage.tf.policies import CategoricalMLPPolicy2\nfrom tests.fixtures import TfGraphTestCase\nfrom tests.fixtures.envs.dummy import DummyBoxEnv\nfrom tests.fixtures.envs.dummy import DummyDiscreteEn... | [
[
"tensorflow.compat.v1.placeholder",
"tensorflow.compat.v1.get_variable",
"numpy.array_equal",
"tensorflow.Graph",
"tensorflow.ones_like",
"tensorflow.compat.v1.variable_scope"
]
] |
surajj-naik/spark | [
"f4c896885dfae193267da1375268da70851b9619"
] | [
"python/pyspark/pandas/tests/data_type_ops/test_null_ops.py"
] | [
"#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo... | [
[
"pandas.Series"
]
] |
puneat/test | [
"f925a9a1f1622d4141a13933d77578a4741cd195"
] | [
"helpers.py"
] | [
"import pandas as pd\nimport numpy as np\nimport warnings\nfrom numpy import cumsum, log, polyfit, sqrt, std, subtract\nfrom datetime import datetime, timedelta\nimport scipy.stats as st\nimport statsmodels.api as sm\nimport math\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom tqdm import tqdm\nfrom scipy... | [
[
"pandas.to_datetime",
"matplotlib.style.use",
"numpy.asarray",
"pandas.set_option",
"pandas.merge",
"pandas.DataFrame",
"numpy.maximum.accumulate",
"numpy.where",
"numpy.argmax"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.