repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
puchake/market-teller
[ "368b8fd8cf151723edebaf5787c3d95c0731c72a" ]
[ "src/nn/config.py" ]
[ "import os\n\nimport numpy as np\nimport tensorflow as tf\n\n\nclass NnConst(object):\n # Global index of performed network run.\n RUN_INDEX = 33\n\n # Index of input data set, which is used for network\n # (basic_nn_set_0, 1, 2 or 3).\n SET_INDEX = 0\n\n # Available modes of the network. If it is...
[ [ "numpy.load" ] ]
owaisCS/TestHateSpeech
[ "6b72afa1ebafc43624676e7006795c8d99a305b6" ]
[ "bert/run_classifier.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.\n# Copyright (c) 2018, NVIDIA CORPORATION. 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...
[ [ "torch.distributed.get_world_size", "torch.utils.data.RandomSampler", "scipy.stats.pearsonr", "torch.cuda.is_available", "sklearn.metrics.f1_score", "torch.nn.CrossEntropyLoss", "torch.nn.DataParallel", "torch.distributed.init_process_group", "torch.manual_seed", "torch.ten...
lucyfan7266/Accelerator-Control
[ "9be80ce4dbe917712f35d96004ca920146e9c909" ]
[ "tests/test_mesh.py" ]
[ "import unittest\nfrom numpy.linalg import det\nimport numpy.random as npr\nimport numpy as np\n\nfrom DLA_Control import MZI, Layer, Mesh\n\nclass TestMesh(unittest.TestCase):\n \"\"\" Code for testing the MZI mesh\"\"\"\n\n def setUp(self):\n pass\n\n @staticmethod\n def is_unitary(M):\n ...
[ [ "numpy.array", "numpy.dot", "numpy.eye", "numpy.abs", "numpy.random.random" ] ]
shashankg7/glove-tensorflow
[ "b44e01da2110424d8b31ef2854190151f6704b24" ]
[ "glove/train.py" ]
[ "\nfrom glove import glove\nfrom build_coocurence import generateCoocur as gen_coocur\nimport os\nimport json\nimport cPickle as pickle\nimport numpy as np\nimport argparse\nimport logging\nimport time\nimport pdb\n\nclass train_glove(object):\n\n def __init__(self):\n '''\n Define hyperparamters o...
[ [ "numpy.zeros_like", "numpy.asarray", "numpy.log", "numpy.zeros", "numpy.random.shuffle" ] ]
neuro-inc/ml-recipe-distributed-pytorch
[ "23666a026a08d80b57b288e8bdc62f52da859769" ]
[ "modules/model/utils/list_dataloader.py" ]
[ "import logging\nimport multiprocessing as mp\n\nimport numpy as np\n\nlogger = logging.getLogger(__file__)\n\n\nclass ListDalatoaderIterator:\n def __init__(self, processor):\n self.manager = mp.Manager()\n self.pool_queue = self.manager.Queue(processor.buffer_size)\n self.pool = mp.Pool(pr...
[ [ "numpy.random.shuffle" ] ]
jayant766/MIDAS-IIITD
[ "9a6085bff579a5846c58bac70264a736ed9da750" ]
[ "libraries/classification/inception/data/build_image_data.py" ]
[ "\"\"\"Converts image data to TFRecords file format with Example protos.\n\nThe image data set is expected to reside in JPEG files located in the\nfollowing directory structure.\n\n data_dir/label_0/image0.jpeg\n data_dir/label_0/image1.jpg\n ...\n data_dir/label_1/weird-image.jpeg\n data_dir/label_1/my-image....
[ [ "tensorflow.train.BytesList", "tensorflow.app.flags.DEFINE_integer", "tensorflow.train.Int64List", "tensorflow.train.Coordinator", "tensorflow.app.flags.DEFINE_string", "tensorflow.gfile.Glob", "tensorflow.compat.as_bytes", "tensorflow.Session", "tensorflow.image.encode_jpeg", ...
jlmayfield/Cirq
[ "dc1294f54118a9a4f92546ca13780b91615dd675" ]
[ "cirq/testing/consistent_protocols_test.py" ]
[ "# Copyright 2018 The Cirq Developers\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law o...
[ [ "numpy.diag", "numpy.dot", "numpy.conj", "numpy.exp" ] ]
zju3dv/rnin-vio
[ "b030ecc94f151159973a9086c8ba76e22bdbc56e" ]
[ "ronin_3d/source/data_glob_heading.py" ]
[ "import json\nimport random\nimport sys\nfrom os import path as osp\n\nimport h5py\nimport numpy as np\nimport quaternion\nfrom scipy.ndimage import gaussian_filter1d\nfrom torch.utils.data import Dataset\n\nfrom math_util import orientation_to_angles\nfrom data_glob_speed import GlobSpeedSequence\nfrom data_utils ...
[ [ "numpy.sin", "numpy.linalg.norm", "numpy.copy", "scipy.ndimage.gaussian_filter1d", "numpy.cos" ] ]
GKNL/R2CNN_Faster-RCNN_Tensorflow-Improved
[ "a163520b63858df4bcd573980897b33d017288dd" ]
[ "data/io/read_tfrecord.py" ]
[ "# -*- coding: utf-8 -*-\n\nfrom __future__ import absolute_import\nfrom __future__ import print_function\nfrom __future__ import division\n\nimport numpy as np\nimport tensorflow as tf\nimport os\nfrom data.io import image_preprocess\nfrom libs.configs import cfgs\n\n\ndef read_single_example_and_decode(filename_q...
[ [ "tensorflow.decode_raw", "tensorflow.train.batch", "tensorflow.FixedLenFeature", "tensorflow.Session", "tensorflow.train.match_filenames_once", "tensorflow.reshape", "tensorflow.train.string_input_producer", "tensorflow.constant", "tensorflow.squeeze", "tensorflow.TFRecordR...
PaccMann/paccmann_omics
[ "dbb2d2d67afd5a6ff58ba316f53c699406f5c655" ]
[ "paccmann_omics/utils/hyperparams.py" ]
[ "\"\"\"Factories to ingest string model parameters.\"\"\"\nimport torch\nimport torch.optim as optim\nimport torch.nn as nn\nfrom .utils import gaussian_mixture, kl_divergence_loss\n\n# LSTM(10, 20, 2) -> input has 10 features, 20 hidden size and 2 layers.\n# NOTE: Make sure to set batch_first=True. Optionally set ...
[ [ "torch.nn.SELU", "torch.nn.CELU", "torch.nn.MSELoss", "torch.nn.Sigmoid", "torch.nn.Tanh", "torch.nn.LeakyReLU", "torch.nn.L1Loss", "torch.nn.ReLU", "torch.nn.BCELoss", "torch.nn.ELU" ] ]
Muraru-taketa/100_knocks
[ "d34c0157d15a0fda45ac60e41e93bd6b73cebb58" ]
[ "np23.py" ]
[ "#np23.py\nimport re\nimport pandas as pd\n#ここらは一緒です。\ndf = pd.read_json(\"jawiki-country.json\", lines=True)\nsec_txt = df.query('title==\"イギリス\"')['text'].values[0]\nans = r'^(={2,})\\s*(.+?)\\s*\\1$'#参照下\nfor line in sec_txt.split(\"\\n\"):#分割改行\n result = re.match(ans, line)\n if result is None: #resultがマ...
[ [ "pandas.read_json" ] ]
ikoktz/super-mra
[ "822f79792bbafbcda1aeddfa74b32aade2808a48" ]
[ "models.py" ]
[ "import numpy as np\nfrom keras.layers import Conv2D, Concatenate, Conv3D, MaxPooling3D, Conv3DTranspose\nfrom keras.layers import UpSampling3D, Dropout, BatchNormalization, Activation\nfrom keras.models import Input, Model\n\n\n# 3D U-Net\ndef unet3d(img_shape, out_ch=1, start_ch=64, depth=4, inc_rate=2., activati...
[ [ "numpy.int" ] ]
KeepSilenceQP/tensorflow
[ "3a3d3591923501aa6fb03ef4da1d64400ad209d8" ]
[ "tensorflow/python/distribute/mirrored_variable_test.py" ]
[ "# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.variables.Variable", "tensorflow.python.eager.context.graph_mode", "tensorflow.python.distribute.values.PerReplica", "tensorflow.python.ops.variable_scope.variable_scope", "tensorflow.python.ops.variable_scope.get_variable", "tensorflow.python.eager.context.executing...
nachovizzo/pyLiDAR-SLAM
[ "fd8fcc23380abd0b2ef34388a9f177c4cd41575e" ]
[ "src/pylidar_slam/odometry/odometry_runner.py" ]
[ "import dataclasses\nimport logging\nfrom pathlib import Path\nfrom typing import Optional\nimport time\n\nimport os\nimport torch\n\nfrom abc import ABC\nimport numpy as np\nfrom omegaconf import OmegaConf\nfrom torch.utils.data import DataLoader\nfrom tqdm import tqdm\nimport shutil\n\n# Hydra and OmegaConf impor...
[ [ "torch.device", "torch.cuda.is_available", "torch.utils.data.DataLoader" ] ]
python-marketing-research/python-marketing-research-1ed
[ "9fa18b68f5b165149e0a4d7a89a403b8ad337fb6" ]
[ "python_marketing_research_functions/chapter7.py" ]
[ "\"\"\"\nThis module contains all function from Chapter 7 of Python for \nMarketing Research and Analytics\n\"\"\"\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom statsmodels.graphics import gofplots, regressionplots\n\n\ndef generate_satisfaction_scores(mean, std, halo,\n ...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "numpy.floor", "numpy.clip", "matplotlib.pyplot.ylabel", "numpy.abs", "matplotlib.pyplot.subplot" ] ]
MarcTLaw/DRPR_Flowers_experiment
[ "81b4131ed56da914cace6dc83e1a9c9d918f165e" ]
[ "flowers_train_and_test.py" ]
[ "from __future__ import print_function\nimport argparse\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torchvision import datasets, transforms\nfrom torch.autograd import Variable\nimport numpy as np\nimport sys\n\nbatch_size = 5000\nthreshold_compare = -35....
[ [ "torch.nn.Linear", "torch.cuda.manual_seed", "torch.max", "torch.autograd.Variable", "numpy.sum", "torch.norm", "numpy.load", "torch.le", "torch.from_numpy", "torch.manual_seed", "torch.cuda.is_available", "torch.log", "torch.exp", "torch.utils.data.TensorDa...
Bertinus/gene-graph-analysis
[ "a596987f075844f853e7ecd8306b62d068c4aac8" ]
[ "clinical_pipeline/adjacency_regularized_classification.py" ]
[ "import meta_dataloader.TCGA\nfrom torch.utils.data import DataLoader, TensorDataset\nimport numpy as np\nimport pandas as pd\nfrom torch import Tensor\nfrom torch import nn\nimport networkx as nx\nimport torch\nfrom torch.nn.parameter import Parameter\nfrom torch.nn import functional as F\nfrom torch.nn import ini...
[ [ "torch.nn.Linear", "numpy.array", "sklearn.model_selection.StratifiedKFold", "torch.nn.init.uniform_", "pandas.DataFrame", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "numpy.load", "matplotlib.pyplot.legend", "torch.nn.ReLU", "torch.nn.init._calculate_fan_in_and...
ZymHedy/CV_course
[ "989b9ddad1de83ad8108229bc7c5bef408a0e586" ]
[ "week4/logistic.py" ]
[ "import numpy as np\nfrom numpy.linalg import cholesky\nimport matplotlib.pyplot as plt\n\n\n# Make dataset\n\n# ground truth label: 0 or 1\n# predict probs: (0, 1)\n# logistic loss\n\ndef gen_sample_data():\n sampleNo = 1000\n mu = np.array([[1, 5]])\n sigma = np.array([[2, 0], [0, 3]])\n R = cholesky(...
[ [ "numpy.max", "numpy.array", "matplotlib.pyplot.ion", "numpy.zeros", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "numpy.min", "numpy.mean", "matplotlib.pyplot.subplots", "numpy.random.randn", "numpy.ones", "numpy.exp", "matplotlib.pyplot.show", "matp...
3neutronstar/ml_benchmark
[ "b5c689109ddffc75b206a8152d06c27d7e315c5c" ]
[ "Model/vgg.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as f\nimport torch.optim as optim\n\ncfg = {\n 'vgg11': [64, 'M', 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512, 'M'],\n 'vgg13': [64, 64, 'M', 128, 128, 'M', 256, 256, 'M', 512, 512, 'M', 512, 512, 'M'],\n 'vgg16': [64, 64, 'M', 128, 128,...
[ [ "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.optim.lr_scheduler.MultiStepLR", "torch.nn.ReLU", "torch.randn", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d", "torch.nn.CrossEntropyLoss" ] ]
RyanC1681/RCAI1122
[ "c9683110b58c255a7a78d880ff73df7ff2329405" ]
[ "runner_competition_1126.py" ]
[ "import logging, warnings\nimport numpy as np\nimport time\nfrom ROAR_Sim.configurations.configuration import Configuration as CarlaConfig\nfrom ROAR.configurations.configuration import Configuration as AgentConfig\nfrom pathlib import Path\nfrom ROAR.agent_module.pure_pursuit_agent \\\n import PurePursuitAgent\...
[ [ "numpy.set_printoptions", "numpy.array" ] ]
PastelDew/RGB-D-Mask-R-CNN
[ "912a488f0dbe5cb7bca5b975d08f0f1cbf098a8d" ]
[ "PDStereo/Camera/Utils.py" ]
[ "import numpy as np\nimport cv2\nimport os\n\nply_header = '''ply\nformat ascii 1.0\nelement vertex %(vert_num)d\nproperty float x\nproperty float y\nproperty float z\nproperty uchar red\nproperty uchar green\nproperty uchar blue\nend_header\n'''\n\ndef changeAllToNumpy(lst, dtype=np.float32):\n if not isinstanc...
[ [ "numpy.uint8", "numpy.savetxt", "numpy.dstack", "numpy.hstack", "numpy.int16" ] ]
TheEagerLearner/hacktoberfest2021-2
[ "6ac33dfdf34c97d07a303d855ce09769f6b448f4" ]
[ "Python/Linear Regression in Python/Random_Forest_Regression.py" ]
[ "import numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\ndataset=pd.read_csv(\"Position_Salaries.csv\")\nX=dataset.iloc[:,1:-1].values\nY=dataset.iloc[:,-1].values\n\nfrom sklearn.ensemble import RandomForestRegressor\n\n\nregressor=RandomForestRegressor(n_estimators=10,random_state=0)\nregresso...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.show", "sklearn.ensemble.RandomForestRegressor", "matplotlib.pyplot.scatter", "pandas.read_csv" ] ]
ecomodeller/pytides
[ "78aa785d70cea5bf8c47e23d5d3e82ed4e028af6" ]
[ "pytides/astro.py" ]
[ "from collections import namedtuple\nimport numpy as np\n\n\n# Most of this is based around Meeus's Astronomical Algorithms, since it\n# presents reasonably good approximations of all the quantities we require in a\n# clear fashion. Reluctant to go all out and use VSOP87 unless it can be shown\n# to make a sig...
[ [ "numpy.sin", "numpy.arccos", "numpy.tan", "numpy.degrees", "numpy.radians", "numpy.arctan", "numpy.cos", "numpy.mod", "numpy.floor" ] ]
panzheyi/AutoSTG
[ "4e53146863b1a0353af810765ab25aab06b7cdf7" ]
[ "src/train.py" ]
[ "import logging\n\nlogging.basicConfig(level=logging.INFO)\n\nimport random\nimport numpy as np\nimport torch\nfrom setting import config as cfg\nfrom data.dataset import TrafficDataset\nfrom model.nas import AutoSTG\nfrom run_manager import RunManager\n\n\ndef system_init():\n \"\"\" Initialize random seed. \"\...
[ [ "numpy.random.seed", "numpy.set_printoptions", "torch.manual_seed" ] ]
JasonJerome/Pointer-meter-reading-algorithm-by-Python
[ "3cb2b260301875e4b4bb07dc8d7a86d8affc88a5" ]
[ "train.py" ]
[ "\"\"\"\r\nRetrain the YOLO model for your own dataset.\r\n\"\"\"\r\n\r\nimport numpy as np\r\nimport keras.backend as K\r\nfrom keras.layers import Input, Lambda\r\nfrom keras.models import Model\r\nfrom keras.optimizers import Adam\r\nfrom keras.callbacks import TensorBoard, ModelCheckpoint, ReduceLROnPlateau, Ea...
[ [ "numpy.random.seed", "numpy.array", "numpy.zeros", "numpy.random.shuffle" ] ]
Dogacel/mmfashion
[ "e49613245c8501042edd7aeeaa8fb93e5ea13238" ]
[ "demo/test_retriever.py" ]
[ "from __future__ import division\nimport argparse\n\nimport torch\nfrom mmcv import Config\nfrom mmcv.runner import load_checkpoint\n\nfrom mmfashion.core import ClothesRetriever\nfrom mmfashion.datasets import build_dataloader, build_dataset\nfrom mmfashion.models import build_retriever\nfrom mmfashion.utils impor...
[ [ "torch.device", "torch.cat", "torch.cuda.manual_seed_all", "torch.no_grad", "torch.manual_seed", "torch.cuda.is_available" ] ]
gupta-abhay/pytorch-frn
[ "cc86a984fcbae61431ed41f37695e78f5e4b196e" ]
[ "frn.py" ]
[ "import torch\nimport torch.nn as nn\n\n\n__all__ = ['FilterResponseNorm1d', 'FilterResponseNorm2d',\n 'FilterResponseNorm3d']\n\n\nclass FilterResponseNormNd(nn.Module):\n \n def __init__(self, ndim, num_features, eps=1e-6,\n learnable_eps=False):\n \"\"\"\n Input Vari...
[ [ "torch.max", "torch.nn.init.ones_", "torch.ones", "torch.abs", "torch.nn.init.zeros_", "torch.Tensor", "torch.pow" ] ]
cosmozhang-lab/motion-illusion-model
[ "32a5ccab920095818b220642bae491429ff71f27" ]
[ "largescale/src/neuron/neuron/neuron.py" ]
[ "# Neuron base\r\n\r\nimport numpy as np\r\nimport largescale.src.support.cl_support as clspt\r\nfrom largescale.src.support.common import CommonConfig\r\nfrom program import chain2\r\n\r\nT_EXCITATORY = 1\r\nT_INHIBITORY = 2\r\nT_EXC = T_EXCITATORY\r\nT_E = T_EXCITATORY\r\nT_INH = T_INHIBITORY\r\nT_I = T_INHIBITOR...
[ [ "numpy.array", "numpy.prod", "numpy.zeros" ] ]
MartinThoma/clan
[ "f7645c7483d4476ffe7d5ee56f746e0ee392a082" ]
[ "clana/clustering.py" ]
[ "\"\"\"Everything about clustering classes of a confusion matrix.\"\"\"\n\n# Core Library\nimport logging\nimport random\nfrom typing import List, TypeVar, Union, cast\n\n# Third party\nimport numpy as np\nimport numpy.typing as npt\n\n# First party\nimport clana.utils\n\ncfg = clana.utils.load_cfg()\nlogger = logg...
[ [ "numpy.zeros" ] ]
sotirios4/xgboost
[ "7f101d1b331caae99c0ba685bf6e426b7e68b9ad" ]
[ "python-package/xgboost/core.py" ]
[ "# coding: utf-8\n# pylint: disable=too-many-arguments, too-many-branches, invalid-name\n# pylint: disable=too-many-lines, too-many-locals\n\"\"\"Core XGBoost Library.\"\"\"\nimport collections\n# pylint: disable=no-name-in-module,import-error\nfrom collections.abc import Mapping\n# pylint: enable=no-name-in-module...
[ [ "numpy.histogram", "numpy.array", "numpy.zeros", "numpy.column_stack", "numpy.unique" ] ]
nsina/datashader
[ "7db4112d57589fb23c2a70ea8d88ca57ba954eba" ]
[ "datashader/tests/test_pandas.py" ]
[ "from __future__ import absolute_import\nfrom collections import OrderedDict\nimport os\nfrom numpy import nan\n\nimport numpy as np\nimport pandas as pd\nimport xarray as xr\n\nimport datashader as ds\n\nimport pytest\n\nfrom datashader.datatypes import RaggedDtype\n\ndf_pd = pd.DataFrame({'x': np.array(([0.] * 10...
[ [ "numpy.concatenate", "numpy.array", "numpy.fill_diagonal", "numpy.zeros", "numpy.testing.assert_equal", "pandas.DataFrame", "pandas.array", "numpy.ones", "numpy.where", "numpy.arange", "numpy.spacing" ] ]
XiangboGaoBarry/TexasHoldemAI
[ "91776498fafd464040eca2b1fe454333991bc04e" ]
[ "examples/limit_holdem_dqn.py" ]
[ "''' An example of learning a Deep-Q Agent on Texas Limit Holdem\n'''\n\nimport tensorflow as tf\nimport os\n\nimport rlcard\nfrom rlcard.agents import DQNAgent\nfrom rlcard.agents import RandomAgent\nfrom rlcard.utils import set_global_seed, tournament\nfrom rlcard.utils import Logger\n\n# Make environment\nenv = ...
[ [ "tensorflow.Session", "tensorflow.Variable", "tensorflow.global_variables_initializer" ] ]
KTH-SML/geomtwo
[ "d529c1745eacd27aaca1dfd484c7b561e99f966b" ]
[ "nodes/pose_plotter.py" ]
[ "#!/usr/bin/env python\nimport rospy as rp\nimport geomtwo.msg as gms\nimport geomtwo.impl as gmi\nimport threading as thd\nimport matplotlib.pyplot as plt\n\n\nrp.init_node(name=\"pose_plotter\")\nFREQUENCY = 3e1\nRATE = rp.Rate(FREQUENCY)\nTIME_STEP = 1/FREQUENCY\n\nLOCK = thd.Lock()\n\npose = None\nartists = Non...
[ [ "matplotlib.pyplot.ion", "matplotlib.pyplot.grid", "matplotlib.pyplot.figure", "matplotlib.pyplot.draw", "matplotlib.pyplot.axis" ] ]
phillips96/similarity
[ "3794f288f17f47f1f90b5368e5c0eeac1e81e10d" ]
[ "tensorflow_similarity/models/similarity_model.py" ]
[ "# Copyright 2021 The TensorFlow 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 la...
[ [ "tensorflow.constant", "tensorflow.keras.models.save_model", "tensorflow.expand_dims", "tensorflow.keras.utils.register_keras_serializable" ] ]
zheng-ningxin/Prune-Ratio-Sensitivity
[ "b7c336dfd2cc1cec8b9cff7dce9bdc308bdeb2e5" ]
[ "src/filter_pruner.py" ]
[ "#!/bin/env python\nimport torch\nimport torch.nn as nn\n\n\nclass filter_pruner:\n def __init__(self, layer):\n self.layer = layer\n\n def cal_mask_l1(self, ratio):\n filters = self.layer.weight.shape[0]\n w_abs = self.layer.ori_weight.abs()\n w_sum = w_abs.view(filters, -1).sum(1...
[ [ "torch.gt" ] ]
behnam-samadi/Fast_FPS
[ "6e522bfc5c3d53a1c200569f28b5df0065872abe" ]
[ "models/pointnet_util_current.py" ]
[ "\"\"\"\nAuthor: Benny\nDate: Nov 2019\n\"\"\"\nfrom data_utils.ModelNetDataLoader import ModelNetDataLoader\nimport argparse\nimport numpy as np\nimport os\nimport torch\nimport logging\nfrom tqdm import tqdm\nimport sys\nimport importlib\n\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\nROOT_DIR = BASE_DI...
[ [ "torch.cat", "torch.nn.ModuleList", "torch.nn.BatchNorm2d", "numpy.mean", "numpy.where", "torch.squeeze", "torch.sum", "torch.nn.Conv1d", "numpy.random.randint", "torch.utils.data.DataLoader", "torch.tensor", "numpy.argmax", "numpy.expand_dims", "torch.zeros...
fathomer/pandas
[ "5baccd46441e94fca4b40f25da70a563f642fae3" ]
[ "pandas/plotting/_matplotlib/tools.py" ]
[ "# being a bit too dynamic\nfrom __future__ import annotations\n\nfrom math import ceil\nfrom typing import (\n TYPE_CHECKING,\n Iterable,\n List,\n Sequence,\n Tuple,\n Union,\n)\nimport warnings\n\nimport matplotlib.table\nimport matplotlib.ticker as ticker\nimport numpy as np\n\nfrom pandas._ty...
[ [ "numpy.array", "numpy.empty", "numpy.asarray", "numpy.zeros", "matplotlib.ticker.AutoLocator", "pandas.plotting._matplotlib.compat.mpl_ge_3_2_0", "matplotlib.pyplot.figure", "pandas.plotting._matplotlib.compat.mpl_ge_3_4_0", "matplotlib.ticker.FormatStrFormatter", "numpy.na...
ivclab/AdaLabelHash
[ "3fdca6749ae6e3e5a3f0610443f9bb0b55cfe3b4" ]
[ "utils/models.py" ]
[ "import sys\nimport numpy as np\nimport keras.backend as K\nfrom keras.layers import Dense, Embedding, Input, Activation, Lambda\nfrom keras.engine import Model\nfrom keras.applications import imagenet_utils\nfrom keras.preprocessing.image import img_to_array\nfrom PIL import Image as pil_image\nfrom .VGG_CNN_F_ker...
[ [ "numpy.arange", "numpy.squeeze", "numpy.min", "numpy.vstack" ] ]
mikelytaev/wave-propagation
[ "eff0eb1fc843e4d206b05731e40047e1d810d76f" ]
[ "transforms/frft.py" ]
[ "\"\"\"\nImplementation of the Fourier transform method from\nBailey D. H., Swarztrauber P. N. A fast method for the numerical evaluation of continuous Fourier and Laplace\ntransforms //SIAM Journal on Scientific Computing. – 1994. – Vol. 15. – N. 5. – С. 1105-1110.\n\"\"\"\nimport numpy as np\nimport cmath as cm\n...
[ [ "numpy.fft.fft", "numpy.arange", "numpy.exp", "numpy.zeros" ] ]
dumpmemory/Research
[ "30fd70ff331b3d9aeede0b71e7a691ed6c2b87b3" ]
[ "CV/Effective Transformer-based Solution for RSNA Intracranial Hemorrhage Detection/easymia/utils/progbar.py" ]
[ "# -*-coding utf-8 -*-\n##########################################################################\n#\n# Copyright (c) 2022 Baidu.com, Inc. All Rights Reserved\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtai...
[ [ "numpy.log10" ] ]
cyk19/Geospatial_hackathon
[ "1e9a2d3c19338838afbc2cab2615743e91bee4fa" ]
[ "Differences/differencing.py" ]
[ "from skimage.metrics import structural_similarity\nimport cv2\nimport numpy as np\n\nbefore = cv2.imread('differences/img0.jpg')\nafter = cv2.imread('differences/img1.jpg')\n\n\"\"\" \nimage_size will store image.shape \nwhich is a 3obj tuple (dimension_y, dimension_x, RBG)\n\"\"\"\n#print(before)\n#print(after)\n...
[ [ "numpy.zeros" ] ]
ictnlp/MoE-Waitk
[ "6f8ca9834c2ab77785ebd93fd569f73c3819340b" ]
[ "fairseq/models/bart/hub_interface.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 copy\nimport logging\nfrom typing import Dict, List\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch....
[ [ "torch.nn.functional.log_softmax" ] ]
deepair-io/flai
[ "edbf74285e24f8605a625edf3a1c73ebae79a6de" ]
[ "flai/core.py" ]
[ "from abc import ABC, abstractmethod\nimport json\nimport math\nimport numpy as np\nfrom flai.utils import np_random\n\n\nclass Env(ABC):\n \"\"\"The main Environment class. It encapsulates an environment with\n arbitrary behind-the-scenes dynamics. An environment can be\n partially or fully observed.\n ...
[ [ "numpy.array", "numpy.diff" ] ]
meghbali/ANNElastoplasticity
[ "697a3edecc06999fc4492a16e67ac28650fec212" ]
[ "epnn_module_utility.py" ]
[ "\"\"\" Elasto-Plastic Neural Network (EPNN)\r\n\r\nDEVELOPED AT:\r\n COMPUTATIONAL GEOMECHANICS LABORATORY\r\n DEPARTMENT OF CIVIL ENGINEERING\r\n UNIVERSITY OF CALGARY, AB, CANADA\r\n DIRECTOR: Prof. Richard Wan\r\n\r\nDEVELOPED BY:\r\n ...
[ [ "numpy.array", "torch.cat", "torch.mul", "torch.norm", "torch.ones", "torch.load", "numpy.sqrt", "torch.div", "torch.matmul" ] ]
duongnv0499/Explain-Deformable-DETR
[ "3f222f514a0bba0d0125063300b85aafc5a6030b" ]
[ "main.py" ]
[ "# ------------------------------------------------------------------------\n# Deformable DETR\n# Copyright (c) 2020 SenseTime. All Rights Reserved.\n# Licensed under the Apache License, Version 2.0 [see LICENSE for details]\n# ------------------------------------------------------------------------\n# Modified fro...
[ [ "torch.device", "torch.optim.AdamW", "torch.optim.lr_scheduler.StepLR", "torch.utils.data.RandomSampler", "numpy.random.seed", "torch.save", "torch.utils.data.SequentialSampler", "torch.optim.SGD", "torch.nn.parallel.DistributedDataParallel", "torch.manual_seed", "torch...
PHBS/ASP
[ "d18a9c25f13cf5c02353b83636d3c6ce13de5242" ]
[ "py/HW2/option_models/basket.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Sep 19 22:56:58 2017\n\n@author: jaehyuk\n\"\"\"\nimport numpy as np\nimport scipy.stats as ss\nfrom .bsm import bsm_formula\nfrom .normal import normal_formula\n\ndef basket_check_args(spot, vol, corr_m, weights):\n '''\n This function simply checks that the s...
[ [ "numpy.random.normal", "numpy.array", "numpy.zeros_like", "numpy.fmax", "numpy.exp", "numpy.sqrt", "numpy.linalg.cholesky", "numpy.random.get_state" ] ]
brookzhcn/covid-xprize-prawn
[ "c289fcdb8c9d1bc8d8053df9aa2a2d58d5945b9e" ]
[ "prawn/prescribe.py" ]
[ "# Copyright 2020 (c) Cognizant Digital Business, Evolutionary AI. All rights reserved. Issued under the Apache 2.0 License.\n\nimport argparse\nimport pandas as pd\nfrom joblib import Parallel, delayed\nimport time\nfrom prawn_prescribe import run_geo, PrawnPrescribe, get_country_region\nfrom standard_predictor.xp...
[ [ "pandas.DataFrame", "pandas.concat" ] ]
ndmaxar/DEODR
[ "a18e49240825e3209f28f6eedafd68fb05a90b3e" ]
[ "setup.py" ]
[ "\"\"\"Setup script for the DEODR project.\"\"\"\n\nfrom setuptools import setup, find_packages\n\nfrom Cython.Build import cythonize\n\nimport numpy as np\n\n\n# compilation mode for debuging\n# extensions = [\n# Extension(\"differentiable_renderer_cython\",\n# [\"DEODR/differentiable_renderer_cython.pyx\"]\n# ,ex...
[ [ "numpy.get_include" ] ]
rowanz/verb-attributes
[ "a04931e3b2ef5be859bdb4c0f123148b194c9d42" ]
[ "models/baselines/eszsl/run_exp.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom data.imsitu_loader import ImSitu\nfrom data.attribute_loader import Attributes, COLUMNS\n\ntrain_data, val_data, test_data = ImSitu.splits(zeroshot=True)\n\n# X \\in \\R^{d x m} where D is dimensionality and m is # examples\ntrain_feats = np.load('train_feats.npy').T\n...
[ [ "numpy.concatenate", "numpy.log", "pandas.concat", "pandas.DataFrame", "numpy.ones", "numpy.load", "numpy.exp", "numpy.eye", "numpy.allclose", "numpy.where", "numpy.argmax", "numpy.arange", "numpy.linalg.solve", "pandas.Series", "numpy.random.random" ]...
DiMoser/PyPinT
[ "3cba394d0fd87055ab412d35fe6dbf4a3b0dbe73" ]
[ "examples/mlsdc_stability_regions.py" ]
[ "# coding=utf-8\nimport warnings as warnings\n# emmit all warnings\n\nwarnings.simplefilter('always')\n# Deactivate Annoyances\n# DeprecationWarnings are emitted by various numpy functions\nwarnings.simplefilter('ignore', category=DeprecationWarning)\n# RuntimeWarnings are emitted by numpy.abs on most calls when ...
[ [ "numpy.zeros", "matplotlib.pyplot.pcolor", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.grid", "numpy.linspace", "matplotlib.pyplot.rc", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.gcf", "matplotlib.pyplot.clabel", "matplotlib.pypl...
aanavisinha/def_vit
[ "fd411eeb62fc13c0cf9ff52952748a05f1294bc7" ]
[ "models/backbone.py" ]
[ "# ------------------------------------------------------------------------\n# Deformable DETR\n# Copyright (c) 2020 SenseTime. All Rights Reserved.\n# Licensed under the Apache License, Version 2.0 [see LICENSE for details]\n# ------------------------------------------------------------------------\n# Modified fro...
[ [ "torch.ones", "torch.zeros", "torch.reshape" ] ]
PandoraLS/Seq2Seq
[ "96851fd7d0fe2a7cbcaafb3b2d41d58541ad652b" ]
[ "experiment/trainer.py" ]
[ "# -*- coding: utf-8 -*-\n# @Time : 2021/4/22 下午12:37\n\nimport torch\nimport random\nfrom experiment.base_trainer import BaseTrainer\n\nclass Trainer(BaseTrainer):\n def __init__(self,\n config: dict,\n resume: bool,\n encoder,\n decoder,\n ...
[ [ "torch.zeros", "torch.no_grad", "torch.tensor" ] ]
d-v-b/CNNectome
[ "2b1f4786282306edf94b231c9fcf64419d8d1e2a" ]
[ "training/anisotropic/train_dist_cleftprepost_deluxe.py" ]
[ "from __future__ import print_function\nfrom gunpowder import *\nfrom gunpowder.tensorflow import *\nfrom gunpowder.contrib import (\n ZeroOutConstSections,\n AddBoundaryDistance,\n AddDistance,\n AddPrePostCleftDistance,\n)\nimport gpn\nimport tensorflow as tf\nimport os\nimport math\nimport json\nimpo...
[ [ "tensorflow.train.latest_checkpoint" ] ]
YKSIAT/InceptionV4
[ "95559af854c63b673e8fc21b679eae9765b33411" ]
[ "test2.py" ]
[ "# -*- coding: utf-8 -*-\r\nimport tensorflow as tf\r\nimport Input_Data\r\nLEARNING_RATE = 0.0001\r\nSTEPS = 5000\r\nBATCH = 50\r\nN_CLASSES = 2\r\nIMAGE_WEIGHT = 299\r\nIMAGE_HEIGHT = 299\r\nBATCH_SIZE = 10\r\nCAPACITY = 100\r\nEPOCH = 10\r\n\r\n# INPUT_DATA = \"F:\\\\Program\\\\Data_test\\\\dogvscat\\\\train\"\r...
[ [ "tensorflow.train.start_queue_runners", "tensorflow.Session", "tensorflow.placeholder", "tensorflow.train.Coordinator" ] ]
87003697/FewX-mmdet
[ "3b8f634aca1f8c41a8d5e5d081d335b947bf57fc" ]
[ "mmdet/models/detectors/fsod_rcnn.py" ]
[ "import torch\n\nfrom ..builder import DETECTORS, build_backbone, build_head, build_neck\nfrom .base import BaseDetector\nimport pandas as pd\nimport pdb\n@DETECTORS.register_module()\nclass FsodRCNN(BaseDetector):\n \"\"\"Base class for two-stage detectors of FSOD\n\n Two-stage detectors typically consisting...
[ [ "torch.stack", "torch.onnx.is_in_onnx_export", "torch._shape_as_tensor", "torch.squeeze", "torch.zeros_like", "torch.randn" ] ]
svortega/steelpy
[ "bef35eb8ab8728fc29f57b7070b5f3bac0b0e840" ]
[ "steelpy/process/math/runkut5.py" ]
[ "## module run_kut5\n\nimport math\nimport numpy as np\n\ndef integrate(F,x,y,xStop,h,tol=1.0e-6):\n ''' X,Y = integrate(F,x,y,xStop,h,tol=1.0e-6).\n Adaptive Runge-Kutta method with Dormand-Price\n coefficients for solving the\n initial value problem {y}' = {F(x,{y})}, where\n {y} = ...
[ [ "numpy.sum", "numpy.array" ] ]
hdfkndkndknknknvklsbljsbsmb/ibis
[ "dbacd7a52ca062529fb7bf6dec51b98d7199d1dc" ]
[ "ibis/backends/pandas/client.py" ]
[ "\"\"\"The pandas client implementation.\"\"\"\nfrom functools import partial\n\nimport dateutil.parser\nimport numpy as np\nimport pandas as pd\nimport pytz\nimport toolz\nfrom pandas.api.types import CategoricalDtype, DatetimeTZDtype\n\nimport ibis.common.exceptions as com\nimport ibis.expr.datatypes as dt\nimpor...
[ [ "pandas.to_datetime", "pandas.DataFrame", "pandas.api.types.CategoricalDtype", "pandas.api.types.DatetimeTZDtype", "numpy.dtype" ] ]
luis-armando-perez-rey/learning-group-structure
[ "e238308de73a29506d9281e1b55cdd2de2795ebb" ]
[ "added_modules/architectures/vgg.py" ]
[ "import torch.nn as nn\nimport torch\nimport numpy as np\nimport torch.nn.functional as F\n\n\ndef calculate_pad_same(image_size, kernel_size, stride):\n \"\"\"\n Calculates the padding to get the \"same\" size as in Tensorflow\n Only works for images were filter covers the complete image in the convolutio...
[ [ "torch.nn.Linear", "numpy.product", "torch.nn.functional.normalize", "torch.sigmoid", "torch.nn.MaxPool2d", "torch.nn.Upsample", "torch.nn.Conv2d", "torch.flatten", "torch.reshape" ] ]
gmavros1/ndlib
[ "f5817eec0c8e7e86fb03aafe7be208fd4a0e0f6e" ]
[ "ndlib/models/epidemics/SEIRModel.py" ]
[ "from ..DiffusionModel import DiffusionModel\nimport numpy as np\nimport future\n\n__author__ = [\"Vincenzo Caproni\", \"Beatrice Caputo\", \"Ettore Puccetti\", \"Elisa Salatti\"]\n__license__ = \"BSD-2-Clause\"\n\n\nclass SEIRModel(DiffusionModel):\n\n def __init__(self, graph, seed=None):\n\n super(self...
[ [ "numpy.random.random_sample" ] ]
tlienart/autogluon
[ "d02e37f41cd947dd1281bb1296cd12a8187ec441" ]
[ "autogluon/utils/tabular/ml/models/lgb/lgb_model.py" ]
[ "import gc\nimport logging\nimport os\nimport random\nimport re\nimport time\nimport warnings\n\nimport numpy as np\nimport pandas as pd\nfrom pandas import DataFrame, Series\n\nfrom . import lgb_utils\nfrom .callbacks import early_stopping_custom\nfrom .hyperparameters.lgb_trial import lgb_trial\nfrom .hyperparame...
[ [ "numpy.random.seed", "pandas.DataFrame" ] ]
gioele8/AI-soccer-highlights
[ "756b6b6f332cedbfbc5a3540d0c6d7aa50219e51" ]
[ "utilities/preprocessing/video_resize_preprocessor.py" ]
[ "# import the necessary packages\nimport cv2\nfrom pathlib import Path\nimport os\nimport numpy as np\nfrom skimage.transform import resize\n\nclass VideoResizePreprocessor:\n def __init__(self, width, height, inter=cv2.INTER_AREA, verbose=500):\n # store the target image width, height, and interpolation\...
[ [ "numpy.array", "numpy.load" ] ]
damo-cv/MotionRGBD
[ "d9c4308e4308192e186cab6fde6d8d4ba3d655ba" ]
[ "lib/datasets/Jester.py" ]
[ "'''\nCopyright (C) 2010-2021 Alibaba Group Holding Limited.\n'''\n\nimport torch\nfrom .base import Datasets\nfrom torchvision import transforms, set_image_backend\nimport random, os\nfrom PIL import Image\nimport numpy as np\nimport logging\nimport accimage\nset_image_backend('accimage')\nnp.random.seed(123)\n\nc...
[ [ "numpy.random.seed" ] ]
vfdev-5/gin-config
[ "01875b83cb678ede74ceead7e455a62ca089006e" ]
[ "tests/torch/external_configurables_test.py" ]
[ "# coding=utf-8\n# Copyright 2020 The Gin-Config 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 ...
[ [ "torch.rand" ] ]
reveriel/cuda_scheduling_examiner_mirror
[ "16d2404c0dc8d72f7a13e4a167d3db4c86128a26" ]
[ "scripts/view_times_cdf.py" ]
[ "import argparse\nimport glob\nimport itertools\nimport json\nimport matplotlib.pyplot as plot\nimport numpy\nimport re\nimport sys\n\ndef convert_values_to_cdf(values):\n \"\"\"Takes a 1-D list of values and converts it to a CDF representation. The\n CDF consists of a vector of times and a vector of percenta...
[ [ "matplotlib.pyplot.show", "numpy.arange", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure" ] ]
cswangjiawei/ChineseNER
[ "183f2a2dd2c552f2c66e6d7be78c3fbc479b9317" ]
[ "ChineseNER/model.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence\nimport numpy as np\nfrom .crf import CRF\nimport argparse\nfrom .utils import WordVocabulary, LabelVocabulary, get_mask, write_dict\nimport os\n\n\nclass NamedEntityRecog(nn.Module):\n def __init__(sel...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.LSTM", "torch.cuda.is_available", "torch.nn.utils.rnn.pack_padded_sequence", "torch.nn.CrossEntropyLoss", "numpy.empty", "torch.nn.Conv1d", "torch.tensor", "numpy.sqrt", "numpy.zeros", "torch.max", "torch.nn.Sequential",...
hassaku/audio-plot-lib
[ "fb3c6e7129dba39fade15147130913946b2172a2" ]
[ "audio_plot_lib/interactive.py" ]
[ "import copy\nimport numpy as np\nfrom bokeh import events\nfrom bokeh.models import CustomJS, HoverTool, Slider, Div\nfrom bokeh.plotting import figure, output_notebook, show\nfrom bokeh.layouts import column, row\nfrom bokeh.models import LinearAxis, Range1d\nfrom IPython.display import HTML, display\n\ndef __set...
[ [ "numpy.max", "numpy.zeros_like", "numpy.array", "numpy.min" ] ]
whoanuragverma/central-perk
[ "9140f94fad42a5cefb192a50a380951e95eea892" ]
[ "python/scraper.py" ]
[ "from bs4 import BeautifulSoup\nimport pandas as pd\nimport os\n\nmain = []\ntitles = []\n\nep_no = 1\nfor folders in os.listdir('raw'):\n for files in os.listdir(os.path.join('raw', folders)):\n soup = BeautifulSoup(\n open(os.path.join('raw', folders, files), encoding='cp1252'), \"html.parser...
[ [ "pandas.DataFrame" ] ]
GuoBo98/ShipDet
[ "2979c39c5a56be3b99ba77833cfe556a8a0fc97e" ]
[ "mmdet/models/roi_heads/rbbox_heads/convfc_rbbox_head.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom mmcv.runner import force_fp32\nfrom mmdet.models.roi_heads.bbox_heads import ConvFCBBoxHead\n\nfrom mmdet.core import bbox_target_rbbox, rbbox_target_rbbox,choose_best_Rroi_batch, hbb2obb_v2, multiclass_nms_rbbox\nfrom mmdet.models.losses i...
[ [ "torch.nn.Linear", "torch.nonzero", "torch.cat", "torch.stack", "torch.gather", "torch.nn.init.constant_", "torch.nn.init.xavier_uniform_", "torch.nn.init.normal_", "torch.nn.functional.softmax", "torch.sum" ] ]
WuDiDaBinGe/TAKG
[ "83e608e677a4ee74722d18cb5ef430f4f6c6ad31" ]
[ "retrievers/build_tfidf.py" ]
[ "#!/usr/bin/env python3\n# Copyright 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n\"\"\"A script to build the tf-idf document matrices for retrieval.\"\"\"\nimport numpy as np\nimpor...
[ [ "scipy.sparse.diags", "numpy.log" ] ]
stevenchen521/quant_ml
[ "f7d5efc49c934724f97fcafacc560f4a35b24551" ]
[ "rqalpha_backtest/Portfolio_RSI.py" ]
[ "import talib\nfrom rqalpha.api import *\nfrom rqalpha import run_func\nimport pandas as pd\nimport numpy as np\nfrom scipy.signal import argrelextrema\n\n\n# 在这个方法中编写任何的初始化逻辑。context对象将会在你的算法策略的任何方法之间做传递。\ndef init(context):\n\n # 选择我们感兴趣的股票\n context.s1 = \"002475.XSHE\"\n # context.s2 = \"601988.XSHG\"\...
[ [ "numpy.isnan", "scipy.signal.argrelextrema" ] ]
matthaeusheer/uncertify
[ "dfc2df16fb07ee8d7d17906827e0f0c8b2747532" ]
[ "uncertify/evaluation/utils.py" ]
[ "import torch\nimport scipy.ndimage\n\nfrom uncertify.utils.custom_types import Tensor\n\n\ndef residual_l1_max(reconstruction: Tensor, original: Tensor) -> Tensor:\n \"\"\"Construct l1 difference between original and reconstruction.\n\n Note: Only positive values in the residual are considered, i.e. values b...
[ [ "torch.zeros_like", "torch.where", "torch.ones_like", "torch.abs_" ] ]
aletuf93/analogistics
[ "c5f76910683bc3a1cc6f24799f0299232b4fc522" ]
[ "analogistics/learning/analogizers_grids.py" ]
[ "from sklearn import svm\n\nfrom analogistics.learning.grids import GridSearch\n\ntuned_param_svm = [{'kernel': ['rbf'],\n 'gamma': [1e-3, 1e-4],\n 'C': [1, 10, 100, 1000],\n }]\n\ntuned_param_svm_linear = [{'penalty': ['l1', 'l2'],\n ...
[ [ "sklearn.svm.SVR", "sklearn.svm.LinearSVC", "sklearn.svm.SVC" ] ]
catskillsresearch/xview2-catskills
[ "5671cff323c8121c0ae251e360e454a1e8568f58" ]
[ "spacenet/src/models/polygon_loss_from_cuda_gt_mask.py" ]
[ "import chainer.functions as F\nfrom chainer import cuda\nimport numpy as np\nfrom imantics import Mask\nfrom predict_polygons import predict_polygons\nimport cupy\n\ndef polygon_loss_from_cuda_gt_mask(score_cuda, gt_mask_cuda):\n try:\n gt_mask=cuda.to_cpu(gt_mask_cuda)[0]\n except:\n gt_mask=c...
[ [ "numpy.argmax" ] ]
woaksths/set2regex-baseline
[ "be377593526ad664a727dd7152fcb186118adaa5" ]
[ "seq2seq/evaluator/evaluator.py" ]
[ "from __future__ import print_function, division\n\nimport torch\nimport torchtext\n\nimport seq2seq\nfrom seq2seq.loss import NLLLoss\n\nclass Evaluator(object):\n \"\"\" Class to evaluate models with given datasets.\n\n Args:\n loss (seq2seq.loss, optional): loss for evaluator (default: seq2seq.loss....
[ [ "torch.device", "torch.no_grad", "torch.cuda.is_available" ] ]
xiong233/SOAP
[ "2376c39fe89ea1416eddfa6bf0ec70e60fc56a8b" ]
[ "lib/model/faster_rcnn/faster_rcnn.py" ]
[ "#encoding=utf-8\nimport random\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport torchvision.models as models\nfrom torch.autograd import Variable\nimport numpy as np\nfrom model.utils.config import cfg\nfrom model.rpn.rpn import _RPN\n\nfrom model.r...
[ [ "torch.autograd.Variable", "torch.nn.functional.softmax" ] ]
o-netzer/VornamenBerlin
[ "9ca776ef8d89226044289e5e8112c2754ae0cfa3" ]
[ "vornamen.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Jun 3 18:50:52 2020\n\n@author: netzer\n\"\"\"\n\n\n############## source path to csv files ##########################\n\nyear = '2012'\n\n############## source path to csv files ##########################\n\n# p = Path(sourcepath)\n# dirs = [x for x in p.iterdir() ...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
DandyWei/finlab_course_ml
[ "e52542f320bfb50e333046075ff554b1f745e105", "e52542f320bfb50e333046075ff554b1f745e105" ]
[ "finlab/finlab_old/backtest.py", "finlab/finlab_old/data.py" ]
[ "import datetime\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport warnings\nimport math\n\nwarnings.simplefilter(action='ignore', category=FutureWarning)\n\ndef backtest(start_date, end_date, hold_days, strategy, data, weight='average', benchmark=None, stop_loss=None, stop_profit=No...
[ [ "matplotlib.pyplot.grid", "pandas.DataFrame", "matplotlib.pyplot.ylabel", "pandas.Series", "numpy.abs", "matplotlib.pyplot.show", "numpy.floor" ], [ "pandas.to_datetime", "pandas.DataFrame", "pandas.read_sql" ] ]
kevinmooreiii/autochem
[ "87f50adc09c3f1170459c629697aadd74154c769" ]
[ "automol/convert/zmat.py" ]
[ "\"\"\" z-matrix conversions\n\"\"\"\nimport itertools\nimport numpy\nfrom automol import create\nfrom automol import cart\nfrom automol.convert import _util\nimport automol.zmat\n\n\n# z-matrix => geometry\ndef geometry(zma, remove_dummy_atoms=None):\n \"\"\" z-matrix => geometry\n \"\"\"\n syms = automol...
[ [ "numpy.zeros" ] ]
eliorodriguez/Proctoring-AI
[ "06c7c9e3bf704b7b07e7daf346479cbd28339313" ]
[ "validate_head_position.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jul 31 03:00:36 2020\n\n@author: hp\n\"\"\"\n\nimport cv2\nimport numpy as np\nimport math\nfrom face_detector import get_face_detector, find_faces\nfrom face_landmarks import get_landmark_model, detect_marks\n\ndef get_2d_points(img, rotation_vector, translation_vec...
[ [ "numpy.array", "numpy.zeros" ] ]
jiangz17THU/ColossalAI
[ "354b7954d1fa6b21a5ba566f0d5ec099280ad315" ]
[ "tests/test_moe/test_moe_group.py" ]
[ "from functools import partial\nimport pytest\nimport torch.nn as nn\nimport torch.multiprocessing as mp\nimport torch.distributed as dist\nimport colossalai\nfrom colossalai.utils import free_port, get_current_device\nfrom colossalai.nn.layer.moe import Experts\nfrom colossalai.context.moe_context import MOE_CONTE...
[ [ "torch.distributed.get_rank", "torch.multiprocessing.spawn", "torch.nn.ModuleList" ] ]
raoulcollenteur/flopy
[ "e6eafcb11fb8dd9831373f2e355d4cec96518b79" ]
[ "flopy/modflow/mfsfr2.py" ]
[ "__author__ = 'aleaf'\r\n\r\nimport sys\r\nimport os\r\nimport numpy as np\r\nimport warnings\r\nimport copy\r\nfrom numpy.lib import recfunctions\r\nfrom ..pakbase import Package\r\nfrom ..utils import MfList\r\nfrom ..utils.flopy_io import line_parse\r\nfrom ..utils.recarray_utils import create_empty_recarray\r\n...
[ [ "numpy.array_equal", "numpy.min", "numpy.mean", "numpy.sign", "numpy.where", "numpy.sort", "numpy.cumsum", "numpy.dtype", "numpy.concatenate", "numpy.bincount", "numpy.max", "pandas.DataFrame", "numpy.interp", "matplotlib.pyplot.subplots", "numpy.arange"...
ted-hou/spike-sorting
[ "c71b05ce3a08c4136ea731a6d639c5b93cc7d35a" ]
[ "continuousdata.py" ]
[ "from __future__ import annotations # allows TreeItem type hint in its own constructor\nimport os\nimport warnings\nfrom dataclasses import dataclass\nfrom datetime import datetime, timezone, timedelta\nfrom typing import Sequence\nimport numpy as np\nimport numpy.random\n\n\nclass ContinuousData:\n @dataclass\...
[ [ "numpy.empty", "numpy.asarray", "scipy.signal.sosfilt", "numpy.reshape", "scipy.interpolate.splrep", "numpy.rint", "scipy.signal.butter", "numpy.ndarray", "numpy.arange", "numpy.fromfile", "scipy.interpolate.splev", "numpy.convolve" ] ]
JesseAllardice/Action-Recognition
[ "7b3149d5083ea655a71af62555dca8321b0d078e" ]
[ "predictors/posepredictor.py" ]
[ "\"\"\"\ninherients from predictor\n\"\"\"\n# Standard packages\nimport time\nfrom collections import deque\nimport numpy as np\nimport tensorflow as tf\nimport cv2\n\n# unique modules\nfrom predictors.predictor import Predictor\n\nclass PosePredictor(Predictor):\n \"\"\"\n Instantisation methods\n \"\"\"\...
[ [ "numpy.array", "numpy.squeeze", "tensorflow.lite.Interpreter", "numpy.exp", "numpy.random.random_sample", "numpy.float32", "numpy.argmax", "numpy.diag", "numpy.expand_dims" ] ]
jacke121/HRNet-Facial-Landmark-Detection
[ "6d29324ce8bf203518bb8e92d1df919145a7063c" ]
[ "test.py" ]
[ "# ------------------------------------------------------------------------------\n# Copyright (c) Microsoft\n# Licensed under the MIT License.\n# Created by Tianheng Cheng(tianhengcheng@gmail.com)\n# ------------------------------------------------------------------------------\n\nimport os\nimport pprint\nimport ...
[ [ "torch.load", "torch.nn.DataParallel" ] ]
KiLJ4EdeN/torchxrayvision
[ "18985291b217d51bd7d46c8a0dc069a78a82755e" ]
[ "scripts/process_image.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\nimport os,sys\nsys.path.insert(0,\"..\")\nfrom glob import glob\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport argparse\nimport skimage, skimage.io\nimport pprint\n\nimport torch\nimport torch.nn.functional as F\nimport torchvision, torchvision.transforms\n\n...
[ [ "torch.nn.functional.relu", "torch.no_grad", "torch.nn.functional.adaptive_avg_pool2d", "torch.from_numpy" ] ]
endrizzimarco/trading-bot
[ "3df3f32db5cd1ff23d9ad45a994fdc1e37f58c8b" ]
[ "src/plot.py" ]
[ "import matplotlib.pyplot as plt\nimport mplfinance as mpf\nfrom endpoints.instrument import Instrument\nfrom indicators import *\n\n\ndf = Instrument(\n \"EUR_USD\", params={\"from\": \"2020-9-10\", \"to\": \"2021-01-01\", \"granularity\": \"H4\"}\n).df\n\ndf[\"tenkanSen\"] = tenkanSen(df)\ndf[\"kijunSen\"] = k...
[ [ "matplotlib.pyplot.show" ] ]
vanshhhhh/federated
[ "20fdca66d01051c55413868310d60c068c84b35d" ]
[ "tensorflow_federated/python/tests/map_reduce_form_test.py" ]
[ "# Copyright 2019, The TensorFlow Federated Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by a...
[ [ "tensorflow.TensorSpec", "tensorflow.keras.optimizers.SGD", "numpy.array", "numpy.random.seed", "tensorflow.compat.v1.ConfigProto", "tensorflow.config.list_logical_devices", "tensorflow.keras.layers.Dense", "tensorflow.keras.losses.SparseCategoricalCrossentropy", "tensorflow.ke...
ku2482/rltorch
[ "7819af49d95bfa268e00413a7606564b0e7286a7" ]
[ "rltorch/agent/sac_discrete/actor.py" ]
[ "import os\nfrom time import time\nimport numpy as np\nimport torch\nfrom torch.utils.tensorboard import SummaryWriter\n\nfrom .base import SacDiscreteAgent\nfrom rltorch.memory import DummyMultiStepMemory, DummyPrioritizedMemory\nfrom rltorch.policy import ConvCategoricalPolicy\nfrom rltorch.q_function import Twin...
[ [ "numpy.random.seed", "torch.no_grad", "torch.manual_seed", "torch.abs", "torch.cuda.is_available", "torch.utils.tensorboard.SummaryWriter" ] ]
Astech34/pymms
[ "165925d3641090c7a8487ec63ef9fc70d47cb6e9" ]
[ "pymms/sql/data_export_sql.py" ]
[ "import numpy as np\nimport datetime as dt\nimport spacepy\nfrom spacepy import pycdf\nimport pandas as pd\nfrom pandas import DataFrame, Series\nimport matplotlib.pyplot as plt\nimport matplotlib.dates as mdates\nimport os.path\nimport pymms\nfrom pymms import mms_utils\nimport pdb\n\n## Creating the pymms object\...
[ [ "numpy.array", "numpy.zeros", "pandas.DataFrame", "numpy.interp", "numpy.shape", "numpy.arctan2", "numpy.size", "numpy.sqrt", "pandas.Series" ] ]
kingqicai/myfast
[ "15c3233ba60a554fe5a8fd493048e9c36400ad18" ]
[ "decoding.py" ]
[ "\"\"\" decoding utilities\"\"\"\nimport json\nimport re\nimport os\nfrom os.path import join\nimport pickle as pkl\nfrom itertools import starmap\n\nfrom cytoolz import curry\n\nimport torch\n\nfrom utils import PAD, UNK, START, END\nfrom model.copy_summ import CopySumm\nfrom model.extract import ExtractSumm, PtrE...
[ [ "torch.device" ] ]
afarahi/tatter
[ "e206b761baec0deb79ddc692a25bfd063f8d5ce1" ]
[ "tatter/KL_estimator.py" ]
[ "from __future__ import absolute_import, division, print_function\nimport numpy as np\n\ndef KL_divergence_estimator(X, Y, k=1):\n \"\"\" Estimate symmetric version of KL divergence. \n The symmetric version is 0.5 * [ D(P|Q) + D(Q|P) ].\n \n Parameters\n ----------\n X, Y: numpy array\n ...
[ [ "numpy.linalg.norm", "numpy.sort", "numpy.log" ] ]
franklintandy/MegazordPSC2
[ "11152c63f55e3d94be3e8aebe1c106bdd0365abb" ]
[ "src/zerg_rush.py" ]
[ "import sys, os\n\nsys.path.append(os.path.join(os.path.dirname(__file__), \"../..\"))\n\nimport numpy as np\nfrom sc2.position import Point2, Point3\n\nimport sc2\nfrom sc2.data import Result\nfrom sc2 import Race, Difficulty\nfrom sc2.constants import *\nfrom sc2.player import Bot, Computer\nfrom sc2.unit import ...
[ [ "numpy.ndenumerate" ] ]
jd-aig/aves2_algorithm_components
[ "12e06717596b824f7b0db115b95856606b97cd82" ]
[ "src/ml/classification/gbdt/run.py" ]
[ "from sklearn.ensemble import GradientBoostingClassifier \nfrom sklearn.metrics import accuracy_score,precision_score,recall_score,f1_score,confusion_matrix\nfrom sklearn.externals import joblib\nimport numpy as np\nimport pandas as pd\nimport argparse\nimport os\nimport json\nparser = argparse.ArgumentParser()\npa...
[ [ "pandas.read_csv", "sklearn.externals.joblib.dump", "sklearn.ensemble.GradientBoostingClassifier" ] ]
a4aleem/GymROS-drones
[ "043eab8212d2670e543735294508462a1636256e" ]
[ "src/openai_ros/src/openai_ros/task_envs/wamv/wamv_nav_twosets_buoys.py" ]
[ "import rospy\nimport numpy\nfrom gym import spaces\nfrom openai_ros.robot_envs import wamv_env\nfrom gym.envs.registration import register\nfrom geometry_msgs.msg import Point\nfrom geometry_msgs.msg import Vector3\nfrom tf.transformations import euler_from_quaternion\nfrom openai_ros.task_envs.task_commons import...
[ [ "numpy.array", "numpy.linalg.norm" ] ]
BarbeauGroup/pygama
[ "5224ab6cacc9f354e49f3234fb32c09fcd99f760" ]
[ "pygama/dsp/_processors/multi_t_filter.py" ]
[ "import numpy as np\nfrom numba import guvectorize\nfrom pygama.dsp._processors.time_point_thresh import time_point_thresh\n\n \n@guvectorize([\"void(float32[:],float32[:],float32[:])\",\n \"void(float64[:],float64[:],float64[:])\"],\n \"(n),(n) -> (n)\", nopython=True, cache=True)\ndef ...
[ [ "numpy.append", "numpy.isnan", "numpy.full_like" ] ]
cesar-rocha/HorizontalConvection
[ "73773607291be2e5d963cb5513c39981b3606080" ]
[ "Code/Figure6.py" ]
[ "\n\"\"\"\n Script for 'The heat flux of horizontal convection: \n definition of the Nusselt number and scaling second paper,' \n by C.B. Rocha, T. Bossy, N.C. Constantinou, S.G. Llewellyn Smith \n & W.R. Young, submitted to JFM.\n\n Figure6.py: log vs. log Ra-Nu diagram.\n\n Cesar Rocha et al.\n ...
[ [ "matplotlib.pyplot.text", "numpy.array", "matplotlib.pyplot.xlim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "numpy.load", "matplotlib.pyplot.close", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylab...
emperorjnx/EmotionRecognition
[ "db808135ebc1aa07f8de4f9c0253afd68b561213" ]
[ "train_model.py" ]
[ "from __future__ import print_function\nimport keras\nfrom keras.preprocessing.image import ImageDataGenerator\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Dropout, Activation, Flatten, BatchNormalization\nfrom keras.layers import Conv2D, MaxPooling2D\nimport tensorflow as tf\nfrom tensorfl...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
rbtsbg/captum
[ "b9d88a9f0b65c25f55337ab8b6617abffe87acc7" ]
[ "captum/attr/_utils/common.py" ]
[ "#!/usr/bin/env python3\nimport typing\nfrom inspect import signature\nfrom typing import TYPE_CHECKING, Any, Callable, List, Tuple, Union\n\nimport torch\nfrom torch import Tensor\n\nfrom ..._utils.common import _format_baseline, _format_input, _format_output\nfrom ..._utils.common import _validate_input as _valid...
[ [ "torch.cat", "torch.numel", "torch.full_like" ] ]
GreenWaves-Technologies/nncf
[ "5cdcb3bdd9b22e3666ff979ff7df3070e6182be8" ]
[ "examples/tensorflow/segmentation/evaluation.py" ]
[ "\"\"\"\n Copyright (c) 2022 Intel Corporation\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n http://www.apache.org/licenses/LICENSE-2.0\n Unless required by applicable law or agr...
[ [ "tensorflow.train.latest_checkpoint", "tensorflow.distribute.get_strategy", "tensorflow.Variable", "tensorflow.io.gfile.isdir", "tensorflow.nest.map_structure", "tensorflow.io.gfile.exists", "tensorflow.train.checkpoints_iterator", "tensorflow.get_logger" ] ]
shuu-tatsu/qagan
[ "15c76655cfecba4f6073940728d930b58a305eec" ]
[ "src/discriminator.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n'''\nタスク:2つのセンテンス間の関連度を算出する.\n用途:QAとCDからの引用.\n'''\n\nimport sys\nsys.path.append('./')\nimport utils\nimport load\nimport index\nimport glove_pre_trained_vectors\nfrom torch.nn.parameter import Parameter\nfrom io import open\nimport unicodedata\nimport string\nimp...
[ [ "torch.nn.NLLLoss", "torch.zeros", "torch.nn.Linear", "torch.cat", "torch.nn.parameter.Parameter", "torch.no_grad", "torch.manual_seed", "torch.LongTensor", "torch.tensor", "torch.nn.Embedding", "torch.nn.GRUCell" ] ]